1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-12-24 14:17:58 +03:00

Fix some broken asserts in btree.c and vdbeaux.c that may fail following an OOM error.

FossilOrigin-Name: e15f47064bef431c0afd8bf93eb4e160c23ad562
This commit is contained in:
dan
2014-05-02 17:12:41 +00:00
parent 012e133772
commit a7bf23c6b5
5 changed files with 38 additions and 15 deletions

View File

@@ -902,6 +902,26 @@ do_faultsim_test 40.3 -faults oom-trans* -body {
faultsim_integrity_check
}
reset_db
add_test_utf16bin_collate db
set big [string repeat x 200]
do_execsql_test 41.1 {
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a COLLATE utf16bin);
INSERT INTO t1 VALUES('fghij' || $::big);
INSERT INTO t1 VALUES('pqrst' || $::big);
INSERT INTO t1 VALUES('abcde' || $::big);
INSERT INTO t1 VALUES('uvwxy' || $::big);
INSERT INTO t1 VALUES('klmno' || $::big);
CREATE INDEX i1 ON t1(a);
}
do_faultsim_test 41.2 -faults oom* -body {
execsql { SELECT * FROM t1 WHERE a = ('abcde' || $::big)}
} -test {
faultsim_test_result [list 0 "abcde$::big"]
faultsim_integrity_check
}
# Ensure that no file descriptors were leaked.
do_test malloc-99.X {
catch {db close}