On 13-05-2021 16:35, Alex Peshkoff via Firebird-devel wrote:
On 5/13/21 3:47 PM, Mark Rotteveel wrote:
2. Exact numeric literals with 30 or more digits are handled as DECFLOAT(34), they should be handled as INT128 or DECIMAL/NUMERIC backed by INT128 (as those types support 38 digits; actually 39 for INT128).

The cut off point for handling long exact numeric literals should be at 38 digits (or maybe, if no decimal point is present, at INT128 max of 7FFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF), longer values should be handled as DECFLOAT.

I haven't created a ticket for point 2 yet, as I was wondering if maybe this was a deliberate choice, or is this a left-over of the earlier situation when high-precision numerics were backed by DECFLOAT?


Mark, this works for me (37 digits):

SQL> set sqlda_display;
SQL> select 1234567890123456789012345678901234567 from rdb$database;

INPUT message field count: 0

OUTPUT message field count: 1
01: sqltype: 32752 INT128 scale: 0 subtype: 0 len: 16
   :  name: CONSTANT  alias: CONSTANT
   : table:   owner:

                                      CONSTANT
=============================================
         1234567890123456789012345678901234567

Hmm, you're right. I guess I miscounted by 10 and instead had typed 39 / 40 digits. Unfortunately my ISQL query history does not go back far enough to confirm.

Sorry for the confusion.

--
Mark Rotteveel


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

Reply via email to