Issue Details (XML | Word | Printable)

Key: CORE-6356
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Alexander Peshkov
Reporter: Pavel Zotov
Votes: 0
Watchers: 2
Operations

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

ROUND() does not allow second argument >=1 when its first argument is more than MAX_BIGINT / 10

Created: 06/Jul/20 07:45 PM   Updated: 08/Jul/20 09:36 PM
Component/s: Engine
Affects Version/s: None
Fix Version/s: 4.0 RC 1

QA Status: Done successfully


 Description  « Hide
Consider number: 922337203685477580 = floor( max_bigint / 10 )

This:

SQL> select round( 922337203685477580 ,1) from rdb$database;

-- works OK:

INPUT message field count: 0

OUTPUT message field count: 1
01: sqltype: 580 INT64 scale: 0 subtype: 0 len: 8
  : name: ROUND alias: ROUND
  : table: owner:

                ROUND
=====================
   922337203685477580

The same number + 1 will fail:

SQL> select round( 922337203685477581,1) from rdb$database;

INPUT message field count: 0

OUTPUT message field count: 1
01: sqltype: 580 INT64 scale: 0 subtype: 0 len: 8
  : name: ROUND alias: ROUND
  : table: owner:

                ROUND
=====================
Statement failed, SQLSTATE = 22003
arithmetic exception, numeric overflow, or string truncation
-numeric value is out of range
SQL>


 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.