Issue Details (XML | Word | Printable)

Key: CORE-5013
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Pavel Zotov
Votes: 1
Watchers: 2
Operations

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

Comments in a view DDL that follow last byte of query aren't included in this view source

Created: 12/Nov/15 10:24 AM   Updated: 14/Apr/16 05:13 PM
Component/s: Engine, ISQL
Affects Version/s: 3.0 Beta 2
Fix Version/s: None

QA Status: No test


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

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Pavel Zotov added a comment - 12/Nov/15 10:27 AM
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>

Pavel Zotov added a comment - 14/Apr/16 05:13 PM
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.
;
===