Issue Details (XML | Word | Printable)

Key: CORE-4566
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Alexander Peshkov
Reporter: Simonov Denis
Votes: 0
Watchers: 3
Operations

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

Incorrect size of the output parameter/argument when execute block, procedure or function use system field in metadata charset

Created: 01/Oct/14 08:59 AM   Updated: 25/Sep/15 01:14 PM
Component/s: Charsets/Collation
Affects Version/s: 2.1.5, 2.5.2, 2.1.5 Update 1, 2.5.2 Update 1, 3.0 Alpha 1, 3.0 Alpha 2, 2.1.6, 2.5.3
Fix Version/s: 3.0 Beta 1, 2.1.7, 2.5.4

Issue Links:
Relate
 

QA Status: Done successfully


 Description  « Hide
Incorrect size of the output argument when connection character set does not match the character set of the return argument.

Database created with character set win1251.

CREATE OR ALTER FUNCTION GET_MNEMONIC (
    AFIELD_NAME TYPE OF COLUMN RDB$TYPES.RDB$FIELD_NAME,
    ATYPE TYPE OF COLUMN RDB$TYPES.RDB$TYPE)
RETURNS TYPE OF COLUMN RDB$TYPES.RDB$TYPE_NAME
AS
begin
  RETURN (SELECT RDB$TYPE_NAME
          FROM RDB$TYPES
          WHERE RDB$FIELD_NAME = :AFIELD_NAME
            AND RDB$TYPE = :ATYPE);
end

Use CONNECT or CREATE DATABASE to specify a database
SQL> set names win1251;
SQL> connect 'localhost:test' user 'sysdba' password 'masterkey';
Database: 'localhost:horses', User: sysdba
SQL> select GET_MNEMONIC('MON$SHUTDOWN_MODE', 1) AS MNEMONIC
CON> from rdb$database;

MNEMONIC
==========
Statement failed, SQLSTATE = 22001
arithmetic exception, numeric overflow, or string truncation
-string right truncation
-expected length 10, actual 19

SQL> select cast(GET_MNEMONIC('MON$SHUTDOWN_MODE', 1) as varchar(100)) AS MNEMONIC
CON> from rdb$database;

MNEMONIC

===============================================================================
MULTI_USER_SHUTDOWN


SQL> SELECT
CON> RDB$TYPE_NAME
CON> FROM
CON> RDB$TYPES
CON> WHERE RDB$FIELD_NAME = 'MON$SHUTDOWN_MODE'
CON> AND RDB$TYPE = 1;

RDB$TYPE_NAME
===============================
MULTI_USER_SHUTDOWN



 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Alexander Peshkov made changes - 01/Oct/14 09:13 AM
Field Original Value New Value
Assignee Alexander Peshkov [ alexpeshkoff ]
Simonov Denis made changes - 02/Oct/14 05:31 PM
Affects Version/s 2.5.3 [ 10461 ]
Alexander Peshkov made changes - 05/Oct/14 01:12 PM
Summary Incorrect size of the output argument when connection character set does not match the character set of the return argument Incorrect size of the output argument when procedure or function use system field in metadata charset
Affects Version/s 2.1.6 [ 10460 ]
Affects Version/s 3.0 Alpha 1 [ 10331 ]
Affects Version/s 2.5.2 Update 1 [ 10521 ]
Affects Version/s 2.1.5 Update 1 [ 10522 ]
Affects Version/s 2.5.2 [ 10450 ]
Affects Version/s 2.1.5 [ 10420 ]
Alexander Peshkov made changes - 05/Oct/14 01:13 PM
Summary Incorrect size of the output argument when procedure or function use system field in metadata charset Incorrect size of the output parameter/argument when procedure or function use system field in metadata charset
Alexander Peshkov made changes - 05/Oct/14 01:14 PM
Summary Incorrect size of the output parameter/argument when procedure or function use system field in metadata charset Incorrect size of the output parameter/argument when execute block, procedure or function use system field in metadata charset
Alexander Peshkov made changes - 05/Oct/14 01:19 PM
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 3.0 Beta 1 [ 10332 ]
Fix Version/s 2.5.4 [ 10585 ]
Resolution Fixed [ 1 ]
Dmitry Yemanov made changes - 09/Dec/14 12:29 PM
Fix Version/s 2.1.7 [ 10651 ]
Pavel Zotov made changes - 28/May/15 03:14 PM
Status Resolved [ 5 ] Resolved [ 5 ]
QA Status Done successfully
Pavel Cisar made changes - 25/Sep/15 01:14 PM
Link This issue is related to QA-613 [ QA-613 ]