mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-30 19:03:16 +03:00
Avoid overflowing the 48-bit mantissa of a floating point number when
summing large integers in the SUM() function. Ticket #1664. (CVS 3061) FossilOrigin-Name: a9169e879de5d5e4192d1681bc3e119fb83e739c
This commit is contained in:
@ -11,7 +11,7 @@
|
||||
# This file implements regression tests for SQLite library. The
|
||||
# focus of this file is testing built-in functions.
|
||||
#
|
||||
# $Id: func.test,v 1.44 2006/01/20 15:45:37 drh Exp $
|
||||
# $Id: func.test,v 1.45 2006/02/09 13:38:21 drh Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@ -538,4 +538,15 @@ do_test func-18.6 {
|
||||
}
|
||||
} {123}
|
||||
|
||||
# Ticket #1664: 64-bit overflow in sum()
|
||||
#
|
||||
do_test func-18.10 {
|
||||
execsql {
|
||||
CREATE TABLE t6(x INTEGER);
|
||||
INSERT INTO t6 VALUES(1);
|
||||
INSERT INTO t6 VALUES(1<<62);
|
||||
SELECT sum(x) - ((1<<62)+1) from t6;
|
||||
}
|
||||
} 0
|
||||
|
||||
finish_test
|
||||
|
Reference in New Issue
Block a user