DECFLOAT should not throw exceptions when +/-NaN, +/-sNaN and +/-Infinity is used in comparisons [CORE5699] #5965
Submitted by: @mrotteveel
The datatype DECFLOAT currently supports storing +/-NaN, +/-sNaN and +/-Infinity (because the underlying Decimal64 / Decimal128 supports that), this should be disallowed and when attempting to store these values, a "data exception — numeric value out of range" error (or equivalent) should be raised. Storing these values can be achieved by either storing it using parameters, or using conversion from string.
See also SQL:2016, 6.29 <numeric value expression>.
Currently Firebird already disallows overflow to +/- Infinity during calculations with DECFLOAT, nor is it (or should it be possible) to produce NaN during calculation.
Currently, storing +/-NaN or +/-sNaN in a column can lead to problems, for example in a select with a condition involving a decfloat column, having a NaN in that column leads to an error during fetch:
SQL Message : -901
Engine Code : 335545141
The text was updated successfully, but these errors were encountered:
Commented by: @AlexPeshkoff
Making it impossible to store special decimal float values in a field does not look like good idea. We can store such values in double field:
(I've used c++ program to add such records to the table - insert with parameter.)
SQL> select v, v < 1 from dou;