VARCHAR of insufficient length used for set bind of decfloat to varchar
-----------------------------------------------------------------------

                 Key: CORE-6206
                 URL: http://tracker.firebirdsql.org/browse/CORE-6206
             Project: Firebird Core
          Issue Type: Bug
          Components: Engine
    Affects Versions: 4.0 Beta 1
         Environment: Firebird-4.0.0.1689-0_x64 windows 10
            Reporter: Mark Rotteveel


The bind for a decfloat(34) to varchar is two (2) characters too short to show 
a maximum width value:

SQL> set sqlda_display on;
SQL> set bind of decfloat to varchar;
SQL> select -9.999999999999999999999999999999999E+6144 from rdb$database;

INPUT message field count: 0

OUTPUT message field count: 1
01: sqltype: 448 VARYING scale: 0 subtype: 0 len: 40 charset: 0 NONE
  :  name: CONSTANT  alias: CONSTANT
  : table:   owner:

CONSTANT
========================================
Statement failed, SQLSTATE = 22001
Dynamic SQL Error
-SQL error code = -303
-arithmetic exception, numeric overflow, or string truncation
-string right truncation
-expected length 40, actual 42

Using set bind of decfloat to char works fine and has the required length of 42:

SQL> set bind of decfloat to char;
SQL> select -9.999999999999999999999999999999999E+6144 from rdb$database;

INPUT message field count: 0

OUTPUT message field count: 1
01: sqltype: 452 TEXT scale: 0 subtype: 0 len: 42 charset: 0 NONE
  :  name: CONSTANT  alias: CONSTANT
  : table:   owner:

CONSTANT
==========================================
-9.999999999999999999999999999999999E+6144

-- 
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

        


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to