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

Comments in a view DDL that follow last byte of query aren't included in this view source [CORE5013] #5301

Open
firebird-automations opened this issue Nov 12, 2015 · 3 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @pavel-zotov

Votes: 1

Test:

create or alter view v_bar as select 2 id from rdb$database where 1=1 -- and 2=2
-- ... plus very clever comment after the last line of query
-- but before semicolon, so it should be saved in our database.
;
commit;

Run:

C:\MIX\firebird\fb30\isql /3333:e30 -i createview.sql & C:\MIX\firebird\fb30\isql /3333:e30 -x

Output:

SET SQL DIALECT 3;

/* CREATE DATABASE '/3333:e30' PAGE_SIZE 8192 DEFAULT CHARACTER SET NONE; */
COMMIT WORK;

/* View: V_BAR, Owner: SYSDBA */
CREATE VIEW V_BAR (ID) AS
select 2 id from rdb$database where 1=1;

Following lines missed in the script that is received by ISQL -X:
-- and 2=2
-- ... plus very clever comment after the last line of query
-- but before semicolon, so it should be saved in our database.

PS. WI-V3.0.0.32157

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

Component: Engine [ 10000 ]

Component: ISQL [ 10003 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

PPS.
SQL> set blob all;
SQL> select rdb$view_source from rdb$relations where rdb$relation_name='V_BAR';

RDB$VIEW_SOURCE 6:1ed
select 2 id from rdb$database where 1=1

SQL>

@firebird-automations
Copy link
Collaborator Author

Commented by: @pavel-zotov

It seems that this ticket issue is regression: no such problem on 2.5:

SET SQL DIALECT 3;

/* CREATE DATABASE '/3255:e25' PAGE_SIZE 4096 DEFAULT CHARACTER SET NONE */

/* View: V_BAR, Owner: SYSDBA */
CREATE VIEW V_BAR (ID) AS
select 2 id from rdb$database where 1=1 -- and 2=2
-- ... plus very clever comment after the last line of query
-- but before semicolon, so it should be saved in our database.
;

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