Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isql -ex semicolon and one-line comment problem [CORE2409] #2827

Open
firebird-automations opened this issue Apr 8, 2009 · 5 comments
Open

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Cosmin Apreutesei (cosmin_ap2)

Test case:
- make a view with a line comment on the last line of its body.
You'll see that it appends the semicolon to the comment line. So i guess an LF before the semicolon would be needed in this case.

@firebird-automations
Copy link
Collaborator Author

Modified by: Claudio Valderrama C. (robocop)

Component: ISQL [ 10003 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Test case, please... Because in my test everything is fine:

isql T.FDB
Database: T.FDB
SQL> create view v1 as select 1 n from rdb$database; -- teste
SQL> show view v1;
N INTEGER Expression
View Source:
==== ======
select 1 n from rdb$database
SQL> create view v2 as select 2 n from rdb$database -- teste
CON> ;
SQL> show view v2;
N INTEGER Expression
View Source:
==== ======
select 2 n from rdb$database -- teste

SQL> ^Z

isql -ex T.FDB
Database: T.FDB

SET SQL DIALECT 3;

/* CREATE DATABASE 'T.FDB' PAGE_SIZE 4096 DEFAULT CHARACTER SET NONE */

/* View: V1, Owner: SYSDBA */
CREATE VIEW V1 (N) AS
select 1 n from rdb$database;

/* View: V2, Owner: SYSDBA */
CREATE VIEW V2 (N) AS
select 2 n from rdb$database -- teste
;

@firebird-automations
Copy link
Collaborator Author

Commented by: Cosmin Apreutesei (cosmin_ap2)

try this (I did it in ibexpert but I don't think it matters):

create view V
as
select
1as f
from
rdb$database
where
1 = 1
and 1 = 1 -- some comment

This made it append the semicolon to the comment. You need a where clause for some reason :)

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Again, not reproducible:

isql T.FDB
Database: T.FDB
SQL> create view V
CON> as
CON> select
CON> 1as f
CON> from
CON> rdb$database
CON> where
CON> 1 = 1
CON> and 1 = 1 -- some comment
CON> ;
SQL> ^Z

isql -ex T.FDB
Database: T.FDB

SET SQL DIALECT 3;

/* CREATE DATABASE 'T.FDB' PAGE_SIZE 4096 DEFAULT CHARACTER SET NONE */

/* View: V, Owner: SYSDBA */
CREATE VIEW V (F) AS

select
1as f
from
rdb$database
where
1 = 1
and 1 = 1 -- some comment
;

@firebird-automations
Copy link
Collaborator Author

Commented by: Cosmin Apreutesei (cosmin_ap2)

Might be because I create this in ibexpert, and without a semi-colon to terminate the sql command?

To clear any doubt, here's what I get in RDB$RELATIONS.RDB$VIEW_SOURCE after executing the above command (last character is a space character on all lines except last one):

1
2select
3 1as f
4from
5 rdb$database
6where
7 1 = 1
8 and 1 = 1 -- some comment

Maybe this helps. Anyway, I'll get HEAD again (it's a few days old) and test again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant