1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Fix another OOM related problem in fkey.c.

FossilOrigin-Name: e2bc51bc61d54d103ccffd12106c27a574e4e997
This commit is contained in:
dan
2009-09-22 16:55:38 +00:00
parent 934ce300a0
commit f59c5cacb8
6 changed files with 77 additions and 53 deletions

View File

@ -31,6 +31,23 @@ do_malloc_test fkey_malloc-1 -sqlprep {
DELETE FROM t1;
}
do_malloc_test fkey_malloc-2 -sqlprep {
PRAGMA foreign_keys = 1;
CREATE TABLE t1(a, b, UNIQUE(a, b));
} -sqlbody {
CREATE TABLE t2(x, y,
FOREIGN KEY(x, y) REFERENCES t1(a, b) DEFERRABLE INITIALLY DEFERRED
);
BEGIN;
INSERT INTO t2 VALUES('a', 'b');
INSERT INTO t1 VALUES('a', 'b');
UPDATE t1 SET a = 'c';
DELETE FROM t2;
INSERT INTO t2 VALUES('d', 'b');
UPDATE t2 SET x = 'c';
COMMIT;
}
finish_test