Issue Details (XML | Word | Printable)

Key: CORE-5722
Type: Bug Bug
Status: Open Open
Priority: Minor Minor
Assignee: Unassigned
Reporter: Lauri Zoova
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Malformed string when raising exception with non-ascii characters

Created: 22/Jan/18 10:43 PM   Updated: 16/Nov/18 01:02 AM
Component/s: Engine
Affects Version/s: 3.0.4
Fix Version/s: None

Environment: Windows

QA Status: No test


 Description  « Hide
C:\Program Files\Firebird\Firebird_3_0>chcp 1257
Active code page: 1257

C:\Program Files\Firebird\Firebird_3_0>isql
Use CONNECT or CREATE DATABASE to specify a database
SQL> set names none;
SQL> create database 'c:\test\testdb.fdb' user 'SYSDBA' password 'masterkey' default character set none;
SQL> commit;
SQL> connect 'localhost/3060:c:\test\testdb.fdb' user 'SYSDBA' password 'masterkey';
Database: 'localhost/3060:c:\test\testdb.fdb', User: SYSDBA
SQL> create exception ex_1 'Üldse ei tööta!';
SQL> create exception ex_2 '@1';
SQL> commit;
SQL> set term !;

// bug - when exception with message override
// this works as expected (=we get the override message instead of "Malformed string") in v2.5.7
SQL> execute block
CON> as
CON> begin
CON> exception ex_1 'Nägin vaeva küll aga välja kukkus nagu tavaliselt!';
CON> end!
Statement failed, SQLSTATE = 22000
Malformed string
-At block line: 4, col: 1

// works - when original exception message
SQL> execute block
CON> as
CON> begin
CON> exception ex_1;
CON> end!
Statement failed, SQLSTATE = HY000
exception 1
-EX_1
-Üldse ei tööta!
-At block line: 4, col: 1

// works - when using new exception parameter
// probably because this specific case was fixed by Adriano in CORE-4160
SQL> execute block
CON> as
CON> begin
CON> exception ex_2 using ('Täitsa nagu toimiks?');
CON> end!
Statement failed, SQLSTATE = HY000
exception 2
-EX_2
-Täitsa nagu toimiks?
-At block line: 4, col: 1

SQL>quit!


 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Alexander Peshkov added a comment - 23/Jan/18 07:41 AM
On linux I could not reproduce an error:

SQL> execute block as begin exception ex_1 'Русский текст'; end!
Statement failed, SQLSTATE = HY000
exception 6
-EX_1
-Русский текст

i.e. words 'Russkij tekst' passed as parameter caused no error and were displayed successfully.


Lauri Zoova added a comment - 16/Nov/18 01:02 AM
I've retested the issue with version 3.0.4 and unfortunately the problem remains.