Incorrect size of the output argument when connection character set does not 
match the character set of the return argument
---------------------------------------------------------------------------------------------------------------------------

                 Key: CORE-4566
                 URL: http://tracker.firebirdsql.org/browse/CORE-4566
             Project: Firebird Core
          Issue Type: Bug
          Components: Charsets/Collation
    Affects Versions: 3.0 Alpha 2
            Reporter: Simonov Denis


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



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to