Issue Details (XML | Word | Printable)

Key: CORE-5570
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Adriano dos Santos Fernandes
Reporter: Jiri Cincura
Votes: 0
Watchers: 1
Operations

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

Negative infinity (double) shown incorrectly without sign in isql

Created: 20/Jun/17 11:51 AM   Updated: 29/Jul/17 07:45 AM
Component/s: ISQL
Affects Version/s: 3.0.2
Fix Version/s: 4.0 Alpha 1, 3.0.3

QA Status: Done successfully


 Description  « Hide
Storing Double.NegativeInfinity (https://msdn.microsoft.com/en-us/library/system.double.negativeinfinity(v=vs.110).aspx) stores it correctly (correct value is read back), but in isql the sign is not shown.

SQL> select * from test;

                      D
=======================
               Infinity
               Infinity

The second value should be negative (was stored as negative).

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Adriano dos Santos Fernandes added a comment - 18/Jul/17 06:29 PM
Please test in the next snapshot.

Jiri Cincura added a comment - 24/Jul/17 07:29 AM
So far the 3.0.3 still shows wrong values.

Adriano dos Santos Fernandes added a comment - 24/Jul/17 11:42 AM
Fix was temporary reopened and now just committed in master only for testing.

Pavel Zotov added a comment - 27/Jul/17 04:11 AM
Which numeric literals should be passed to ISQL in order to get such results on console ("+/- Infinity") ?
I've tried this ( took values from https://msdn.microsoft.com/en-us/library/system.double.minvalue(v=vs.110).aspx ):
===
set list on;
set sqlda_display on;
set echo on;

select
-7.997e307 + -9.985e307 as add_result
from rdb$database;

select
-1.5935e250 * 7.948e110 as mul_result
from rdb$database;
===

-- but got:

Statement failed, SQLSTATE = 22003
arithmetic exception, numeric overflow, or string truncation
-Floating-point overflow. The exponent of a floating-point operation is greater than the magnitude allowed.


As of 'select 1/.0 from ...' (found this in git discussion) - result is:

Statement failed, SQLSTATE = 22012
arithmetic exception, numeric overflow, or string truncation
-Integer divide by zero. The code attempted to divide an integer value by an integer divisor of zero.

Adriano dos Santos Fernandes added a comment - 27/Jul/17 11:01 AM
I do not know, really. I did the test internally modifying the engine to produce -Infinity.

Jiri Cincura added a comment - 27/Jul/17 11:12 AM
I can confirm the Firebird-3.0.3.32794 shows the negative infinity correctly.

Slavomir Skopalik added a comment - 27/Jul/17 01:35 PM
Will be nice if there will be a UDF/Internal set of functions that will provide +-Nan constant and test for Nan.

Pavel Zotov added a comment - 27/Jul/17 02:24 PM
> I can confirm the Firebird-3.0.3.32794 shows the negative infinity correctly.

Using ISQL ? Which values for numbers do you use ?


Jiri Cincura added a comment - 27/Jul/17 04:04 PM
No, using .NET.