1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-09-02 12:21:26 +03:00

Avoid 32-bit integer overflow when evaluating the exponent of a floating point

value during ascii to binary conversion.

FossilOrigin-Name: 4becc47eb4d48686faca4f61e93e5f379b227fcc
This commit is contained in:
drh
2011-10-17 20:41:46 +00:00
parent 2458a2e742
commit 57db4a7509
4 changed files with 55 additions and 9 deletions

View File

@@ -320,6 +320,52 @@ do_realnum_test nan-4.20 {
db eval {SELECT x, typeof(x) FROM t1}
} {inf real}
do_realnum_test nan-4.30 {
db eval {
DELETE FROM t1;
INSERT INTO t1 VALUES('2.5e+9999');
SELECT x, typeof(x) FROM t1;
}
} {inf real}
do_realnum_test nan-4.31 {
db eval {
DELETE FROM t1;
INSERT INTO t1 VALUES('2.5e+10000');
SELECT x, typeof(x) FROM t1;
}
} {inf real}
do_realnum_test nan-4.32 {
db eval {
DELETE FROM t1;
INSERT INTO t1 VALUES('2.5e-9999');
SELECT x, typeof(x) FROM t1;
}
} {0.0 real}
do_realnum_test nan-4.33 {
db eval {
DELETE FROM t1;
INSERT INTO t1 VALUES('2.5e-10000');
SELECT x, typeof(x) FROM t1;
}
} {0.0 real}
do_realnum_test nan-4.34 {
db eval {
DELETE FROM t1;
INSERT INTO t1 VALUES('2.5e2147483650');
SELECT x, typeof(x) FROM t1;
}
} {inf real}
do_realnum_test nan-4.35 {
db eval {
DELETE FROM t1;
INSERT INTO t1 VALUES('2.5e-2147483650');
SELECT x, typeof(x) FROM t1;
}
} {0.0 real}
finish_test