1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-27 20:41:58 +03:00

Correctly handle 64-bit integers in SQL statements. (CVS 1408)

FossilOrigin-Name: 34f03ba6a9d6e2144d0c6cbbbeb37b4c69705f1f
This commit is contained in:
drh
2004-05-19 20:41:03 +00:00
parent 7cf6e4de35
commit fec19aad44
10 changed files with 156 additions and 112 deletions

View File

@ -13,7 +13,7 @@
# This file implements tests for miscellanous features that were
# left out of other test files.
#
# $Id: misc1.test,v 1.23 2003/08/05 13:13:39 drh Exp $
# $Id: misc1.test,v 1.24 2004/05/19 20:41:04 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -252,18 +252,17 @@ execsql {
DROP TABLE t4;
}
# If an integer is too big to be represented as a 32-bit machine integer,
# then treat it as a string.
# 64-bit integers are represented exactly.
#
do_test misc1-9.1 {
catchsql {
CREATE TABLE t1(a unique not null, b unique not null);
INSERT INTO t1 VALUES('a',12345678901234567890);
INSERT INTO t1 VALUES('b',12345678911234567890);
INSERT INTO t1 VALUES('c',12345678921234567890);
INSERT INTO t1 VALUES('a',1234567890123456789);
INSERT INTO t1 VALUES('b',1234567891123456789);
INSERT INTO t1 VALUES('c',1234567892123456789);
SELECT * FROM t1;
}
} {0 {a 12345678901234567890 b 12345678911234567890 c 12345678921234567890}}
} {0 {a 1234567890123456789 b 1234567891123456789 c 1234567892123456789}}
# A WHERE clause is not allowed to contain more than 99 terms. Check to
# make sure this limit is enforced.
@ -330,7 +329,7 @@ do_test misc1-11.2 {
#
do_test misc1-12.1 {
execsql {SELECT '0'=='0.0'}
} {0}
} {1}
do_test misc1-12.2 {
execsql {SELECT '0'==0.0}
} {1}
@ -395,17 +394,17 @@ do_test misc1-12.11 {
INSERT INTO t8 VALUES(0.0,0.0,4);
SELECT DISTINCT x, y FROM t8 ORDER BY z;
}
} {0 0 0 0.0}
} {0 0 0.0 0}
do_test misc1-12.12 {
execsql {
SELECT min(z), max(z), count(z) FROM t8 GROUP BY x ORDER BY 1;
}
} {1 4 4}
} {1 3 2 2 4 2}
do_test misc1-12.13 {
execsql {
SELECT min(z), max(z), count(z) FROM t8 GROUP BY y ORDER BY 1;
}
} {1 2 2 3 4 2}
} {1 4 4}
# There was a problem with realloc() in the OP_MemStore operation of
# the VDBE. A buffer was being reallocated but some pointers into

View File

@ -10,7 +10,7 @@
#***********************************************************************
# This file runs all tests.
#
# $Id: quick.test,v 1.13 2004/05/19 13:13:08 drh Exp $
# $Id: quick.test,v 1.14 2004/05/19 20:41:04 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -43,7 +43,6 @@ lappend EXCLUDE version.test ;# uses the btree_meta API (not updated)
# Some tests fail in these file as a result of the partial manifest types
# implementation.
lappend EXCLUDE misc1.test
lappend EXCLUDE capi2.test