Issue Details (XML | Word | Printable)

Key: CORE-2409
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Cosmin Apreutesei
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Firebird Core

isql -ex semicolon and one-line comment problem

Created: 08/Apr/09 03:28 AM   Updated: 15/Apr/09 04:52 AM
Component/s: ISQL
Affects Version/s: 2.5 Beta 1
Fix Version/s: None


 Description  « Hide
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.




 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Adriano dos Santos Fernandes added a comment - 09/Apr/09 08:28 AM
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
;

Cosmin Apreutesei added a comment - 10/Apr/09 02:10 AM
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 :)


Adriano dos Santos Fernandes added a comment - 14/Apr/09 08:02 AM
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
;

Cosmin Apreutesei added a comment - 15/Apr/09 04:52 AM
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.