Infinity should not escape from the engine [CORE2581] #2991
Labels
affect-version: 1.5.4
affect-version: 1.5.5
affect-version: 2.0.0
affect-version: 2.0.1
affect-version: 2.0.2
affect-version: 2.0.3
affect-version: 2.0.4
affect-version: 2.0.5
affect-version: 2.1.0
affect-version: 2.1.1
affect-version: 2.1.2
affect-version: 2.5 Alpha 1
affect-version: 2.5 Beta 1
component: engine
fix-version: 2.5 RC1
priority: major
qa: done successfully
type: bug
Submitted by: Claudio Valderrama C. (robocop)
Assigned to: Claudio Valderrama C. (robocop)
Is related to QA409
Infinity and NaN should not escape from the engine. Client side tools should not see the special values. Integer overflow should be detected in the server side, too.
SQL> select 1e161/1e-161from rdb$database;
=======================
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.
This is correct detection.
SQL> set sql dialect 1;
WARNING: Client SQL dialect has been set to 1 when connecting to Database SQL dialect 3 database.
SQL> select 1e161/1e-161from rdb$database;
=======================
Infinity
AFAIK, dialect 1 should be protected as well. Multiplication is protected in both dialects.
We need to protect sum and subtraction as well:
SQL> set sql dialect 3;
SQL> select 1e308 + 1e308 from rdb$database;
=======================
Infinity
SQL> select 1e308 - -1e308 from rdb$database;
=======================
Infinity
Commits: ef30c29
The text was updated successfully, but these errors were encountered: