mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-30 19:03:16 +03:00
Detect integer overflow in the abs() function. The random() function
now provides 64 bits of randomness instead of just 32. Fix bugs in testing logic of test4.c. (CVS 3108) FossilOrigin-Name: 942c509595a2a300e798e6b048ad7fc3bc54af43
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.48 2006/02/11 17:34:01 drh Exp $
|
||||
# $Id: func.test,v 1.49 2006/02/23 21:43:56 drh Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@ -622,5 +622,19 @@ do_test func-18.22 {
|
||||
}
|
||||
} {0 1}
|
||||
|
||||
# Integer overflow on abs()
|
||||
#
|
||||
do_test func-18.31 {
|
||||
catchsql {
|
||||
SELECT abs(-9223372036854775807);
|
||||
}
|
||||
} {0 9223372036854775807}
|
||||
do_test func-18.32 {
|
||||
catchsql {
|
||||
SELECT abs(-9223372036854775807-1);
|
||||
}
|
||||
} {1 {integer overflow}}
|
||||
|
||||
|
||||
|
||||
finish_test
|
||||
|
Reference in New Issue
Block a user