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

Regression: CREATE DATABASE fails with 'Token unknown' error when DB name is enclosed in double quotes and 'DEFAULT CHARACTER SET' is specified after DB name [CORE6517] #6746

Closed
firebird-automations opened this issue Mar 17, 2021 · 5 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: @pavel-zotov

Script (CAUTION: do not keep any sensitive databases in C:\temp\, it can drop some of them!)

shell del c:\temp\1*.fdb 2>nul;

set list on;
set echo on;

create database "c:\temp\111.fdb" page_size 8192;
select mon$database_name as test_name_2 from mon$database;
commit;

create database "c:\temp\112.fdb" default character set utf8;
select mon$database_name as test_name_2 from mon$database;
commit;

show version;

Output on 2.5.9.27152:

TEST_NAME_1 C:\TEMP\111.FDB
TEST_NAME_2 C:\TEMP\112.FDB

Output on 3.0.8.33426 and 4.0.0.2387:

TEST_NAME_1 C:\TEMP\111.FDB
. . .
create database "c:\temp\112.fdb" default character set utf8;
Statement failed, SQLSTATE = 42000
Dynamic SQL Error
-SQL error code = -104
-Token unknown - line 1, column 17
-"c:\temp\112.fdb"

Commits: 005bc68 0656331

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Without "default character set" clause the command is fully preparsed (with different parser than server) in client code.

With "default character set" the command must be re-parsed in server which uses different rules (double quote is not recognized there and also has length limit if recognized).

I think bet way to fix it is transforming double-quoted string before send the statement to server.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 4.0.0 [ 10931 ]

Fix Version: 3.0.8 [ 10960 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: No test => Done successfully

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Closed [ 6 ]

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