mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +03:00
Make sure integer primary keys larger than 2^31 are handled
properly. Ticket #1188. (CVS 2436) FossilOrigin-Name: 1d04c2ab299430959b8a193d4679cbc4c0be31a4
This commit is contained in:
@ -13,7 +13,7 @@
|
||||
# This file implements tests for the special processing associated
|
||||
# with INTEGER PRIMARY KEY columns.
|
||||
#
|
||||
# $Id: intpkey.test,v 1.21 2005/02/22 09:47:19 danielk1977 Exp $
|
||||
# $Id: intpkey.test,v 1.22 2005/03/31 18:40:05 drh Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@ -557,5 +557,46 @@ do_test intpkey-14.6 {
|
||||
}
|
||||
} {2 2 2 3 3 3}
|
||||
|
||||
finish_test
|
||||
# Check for proper handling of primary keys greater than 2^31.
|
||||
# Ticket #1188
|
||||
#
|
||||
do_test intpkey-15.1 {
|
||||
execsql {
|
||||
INSERT INTO t1 VALUES(2147483647, 'big-1', 123);
|
||||
SELECT * FROM t1 WHERE a>2147483648;
|
||||
}
|
||||
} {}
|
||||
do_test intpkey-15.2 {
|
||||
execsql {
|
||||
INSERT INTO t1 VALUES(NULL, 'big-2', 234);
|
||||
SELECT b FROM t1 WHERE a>=2147483648;
|
||||
}
|
||||
} {big-2}
|
||||
do_test intpkey-15.3 {
|
||||
execsql {
|
||||
SELECT b FROM t1 WHERE a>2147483648;
|
||||
}
|
||||
} {}
|
||||
do_test intpkey-15.4 {
|
||||
execsql {
|
||||
SELECT b FROM t1 WHERE a>=2147483647;
|
||||
}
|
||||
} {big-1 big-2}
|
||||
do_test intpkey-15.5 {
|
||||
execsql {
|
||||
SELECT b FROM t1 WHERE a<2147483648;
|
||||
}
|
||||
} {y zero 2 hello second hello b-20 b-22 new 3 big-1}
|
||||
do_test intpkey-15.6 {
|
||||
execsql {
|
||||
SELECT b FROM t1 WHERE a<12345678901;
|
||||
}
|
||||
} {y zero 2 hello second hello b-20 b-22 new 3 big-1 big-2}
|
||||
do_test intpkey-15.7 {
|
||||
execsql {
|
||||
SELECT b FROM t1 WHERE a>12345678901;
|
||||
}
|
||||
} {}
|
||||
|
||||
|
||||
finish_test
|
||||
|
Reference in New Issue
Block a user