You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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.
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
The text was updated successfully, but these errors were encountered: