Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinity should not escape from the engine [CORE2581] #2991

Closed
firebird-issue-importer opened this issue Aug 2, 2009 · 9 comments
Closed

Infinity should not escape from the engine [CORE2581] #2991

firebird-issue-importer opened this issue Aug 2, 2009 · 9 comments

Comments

@firebird-issue-importer
Copy link

@firebird-issue-importer firebird-issue-importer commented Aug 2, 2009

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;

             DIVIDE

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

             DIVIDE

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

                ADD

=======================
Infinity

SQL> select 1e308 - -1e308 from rdb$database;

           SUBTRACT

=======================
Infinity

Commits: ef30c29

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Aug 2, 2009

Modified by: Claudio Valderrama C. (robocop)

assignee: Claudio Valderrama C. [ robocop ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Oct 24, 2009

Commented by: @dyemanov

Claudio, I see commits happened for this ticket, but it's still open. Shouldn't we resolve it?

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Oct 24, 2009

Commented by: Claudio Valderrama C. (robocop)

I tested now and it's solved in the FB2.5 that I have. I protected evl and fun, but I don't know how to protect floats. The test for inifinity and nan we have seems to be only for double.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Oct 27, 2009

Modified by: Claudio Valderrama C. (robocop)

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.5 RC1 [ 10362 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Feb 24, 2011

Modified by: @pcisar

Link: This issue is related to QA409 [ QA409 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 28, 2011

Commented by: @pcisar

QA test added.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 28, 2011

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 18, 2016

Modified by: @pavel-zotov

QA Status: No test

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 19, 2016

Modified by: @pavel-zotov

QA Status: No test => Done successfully

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment