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
The parameterized exception does not accept not ASCII characters as parameter [CORE4160] #4487
Comments
Commented by: @dyemanov Just to confirm - was a connection charset also set to WIN1251? |
Commented by: @sim1984 Yes. Charset connection as WIN1251 |
Modified by: @dyemanovassignee: Adriano dos Santos Fernandes [ asfernandes ] |
Modified by: @sim1984description: recreate exception e_incorrect_value 'Некорректное значение @1'; execute block E_INCORRECT_VALUE. It's correct execute block E_INCORRECT_VALUE. It's incorrect => Use CONNECT or CREATE DATABASE to specify a database Dмама SQL>recreate exception e_incorrect_value 'Некорректное значение @1'; summary: Exceptions with parameters distort not ASCII characters => The parameterized exception doesn't accept a line from not ASCII characters as parameter |
Modified by: @sim1984summary: The parameterized exception doesn't accept a line from not ASCII characters as parameter => The parameterized exception does not accept not ASCII characters as parameter |
Commented by: @asfernandes First thing is SET NAMES has no value after database connection is stablished. Do you say that "Charset connection as WIN1251" has done before the connection? Second, exceptions and non-ascii strings is a nobscure area, because exception text in metadata uses NONE charset. It's a pity, but unfortunately previous proposal to fix this had not an agreement nor a counter proposal. |
Commented by: @sim1984 I changed the bug description. The error all the same is, but now it other kind. |
Modified by: @sim1984description: Use CONNECT or CREATE DATABASE to specify a database Dмама SQL>recreate exception e_incorrect_value 'Некорректное значение @1'; => c:\Program Files\Firebird\Firebird_3_0>chcp 1251 c:\Program Files\Firebird\Firebird_3_0>isql Dмама SQL> recreate exception e_incorrect_value 'Некорректное значение @1'; |
Commented by: @asfernandes > " // this is bug " This is what I told you about charset of exceptions. It's well know thing. |
Commented by: @sim1984 Why exceptions don't use UNICODE_FSS as it is done by stored procedures? If the parameterized exceptions work as they work now (distorting not ASCII characters coming from parameters), their significance considerably decreases. |
Commented by: @asfernandes I've fixed it as is possible now. It will work correctly when the stored exception encoding matches the connection charset. |
Modified by: @asfernandesstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 3.0 Alpha 2 [ 10560 ] |
Commented by: @sim1984 I confirm. Bug fixed. |
Modified by: @pavel-zotovstatus: Resolved [ 5 ] => Resolved [ 5 ] Test Details: Test implemented using UTF8 in order to check multiple languages. |
Submitted by: @sim1984
c:\Program Files\Firebird\Firebird_3_0>chcp 1251
Текущая кодовая страница: 1251
c:\Program Files\Firebird\Firebird_3_0>isql
Use CONNECT or CREATE DATABASE to specify a database
SQL> SET NAMES WIN1251;
SQL> CREATE DATABASE 'localhost/3051:d:\interbasedata\3.0\db1.fdb' USER 'SYSDBA' PASSWORD 'masterkey' DEFAULT CHARACTER
SET WIN1251;
SQL> CONNECT 'localhost/3051:d:\interbasedata\3.0\db1.fdb' USER 'SYSDBA' PASSWORD 'masterkey';
Commit current transaction (y/n)?y
Committing.
Database: 'localhost/3051:d:\interbasedata\3.0\db1.fdb', User: SYSDBA
SQL> select 'мама' as d from rdb$database;
D
мама
SQL> recreate exception e_incorrect_value 'Некорректное значение @1';
SQL> set term ^;
SQL> execute block
CON> as
CON> begin
CON> exception e_incorrect_value using('abc');
CON> end^
Statement failed, SQLSTATE = HY000
exception 1
-E_INCORRECT_VALUE
-Некорректное значение abc
SQL> execute block
CON> as
CON> begin
CON> exception e_incorrect_value using('абв');
CON> end^
Statement failed, SQLSTATE = HY000
exception 1
-E_INCORRECT_VALUE
-Некорректное значение абв // this is bug
SQL>
Commits: de80219 FirebirdSQL/fbt-repository@6f48d5c
====== Test Details ======
Test implemented using UTF8 in order to check multiple languages.
The text was updated successfully, but these errors were encountered: