FirebirdSQL / firebird

Firebird server, client and tools
https://www.firebirdsql.org/
1.22k stars 213 forks source link

ISQL does not understand inline comment ("--") in CONNECT statement [CORE5751] #6014

Open firebird-automations opened 6 years ago

firebird-automations commented 6 years ago

Submitted by: @pavel-zotov

Correct path and name of test database file and run this script:

shell del C:\MIX\firebird\QA\fbt-repo\tmp\tmpfdb.tmp 2>nul;

set list on; set echo on;

create database 'localhost:C:\MIX\firebird\QA\fbt-repo\tmp\tmpfdb.tmp' user 'SYSDBA' password 'masterkey' ; drop database; commit;

create database 'localhost:C:\MIX\firebird\QA\fbt-repo\tmp\tmpfdb.tmp' user 'SYSDBA' password 'masterkey' -- ; commit;

connect 'localhost:C:\MIX\firebird\QA\fbt-repo\tmp\tmpfdb.tmp' user 'SYSDBA' password 'masterkey' -- ; commit;

connect 'localhost:C:\MIX\firebird\QA\fbt-repo\tmp\tmpfdb.tmp' user 'SYSDBA' password 'masterkey' ; drop database; commit;

Output will contain:

connect 'localhost:C:\MIX\firebird\QA\fbt-repo\tmp\tmpfdb.tmp' user 'SYSDBA' password 'masterkey' -- ; Command error: connect 'localhost:C:\MIX\firebird\QA\fbt-repo\tmp\tmpfdb.tmp' user 'SYSDBA' password 'masterkey' --

commit;

commit;

firebird-automations commented 6 years ago

Commented by: @dyemanov

CONNECT is a pseudo statement that's processed by ISQL itself, not the FB parser. So it knows nothing about comments and probably other parts of the SQL grammar too. Perhaps it could be improved, but honestly I see no good reason to spend time on that.