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
Error when using 16 cyrillic symbols for field name on connection with parameter lc_ctype=WIN1251 [CORE5644] #5910
Comments
Modified by: @dyemanovsecurity: Developers [ 10012 ] => |
Commented by: Simeon Bodurov (simeon.bodurov) I have tried to connect with old Firebird 2.5 client to Firebird 3.0.4.32939 to test this issue. The same happens. When I connect with lc_ctype=WIN1251 parameter and execute SQL statement May be the problem is in the server, not in the client. |
Modified by: Simeon Bodurov (simeon.bodurov)Version: 3.0.3 [ 10810 ] Component: Engine [ 10000 ] Version: 3.0.2 [ 10785 ] => Component: API / Client Library [ 10040 ] => |
Commented by: @dyemanov 16 cyrillic characters is 32 bytes which is beyond the limit for the identifier length (31 bytes). |
Commented by: Simeon Bodurov (simeon.bodurov) Dmitry, Why 16 cyrillic characters are represented with 32 bytes when I am using encoding WIN1251 ???? How is done that ? And why there is so confusing error message "expected length 31, actual 16" ? |
Submitted by: Simeon Bodurov (simeon.bodurov)
I am connecting to firebird 3.0.2 database with 32 bit Delphi application and I specify parameter lc_ctype=WIN1251
1. When I try to execute the statement:
SELECT 1 AS "АБВГДЕЖЗИЙКЛМНОП" FROM RDB$DATABASE
I receive error:
arithmetic exception, numeric overflow, or string truncation
string right truncation
expected length 31, actual 16.
"АБВГДЕЖЗИЙКЛМНОП" is 16 symbols long.
Why I receive "string right truncation" when expected length 31 and actual 16 ?
2. This statement works:
SELECT 1 AS "АБВГДЕЖЗИЙКЛМНО" FROM RDB$DATABASE
"АБВГДЕЖЗИЙКЛМНО" is 15 symbols long.
3.
SELECT 1 AS "АБВГДЕЖЗИЙКЛМНОПАБВГДЕЖЗИЙКЛМНО" FROM RDB$DATABASE
where field name is 31 symbols gives error
arithmetic exception, numeric overflow, or string truncation.
string right truncation.
expected length 31, actual 31.
4.
SELECT 1 AS "АБВГДЕЖЗИЙКЛМНОПАБВГДЕЖЗИЙКЛМНОП" FROM RDB$DATABASE;
where field name is 32 symbols gives error
Dynamic SQL Error
SQL error code = -104
Name longer than database column size.
as it should be.
When I remove lc_ctype=WIN1251 parameter from connection i.e. use NONE
The statement
SELECT 1 AS "АБВГДЕЖЗИЙКЛМНОП" FROM RDB$DATABASE
executes without error.
SELECT 1 AS "АБВГДЕЖЗИЙКЛМНОПАБВГДЕЖЗИЙКЛМНО" FROM RDB$DATABASE
aslo executes without error.
The text was updated successfully, but these errors were encountered: