mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-27 20:41:58 +03:00
Fix an OOM related crash in fkey.c.
FossilOrigin-Name: 635d6a775a3f192d4292738905f5e01bc956a712
This commit is contained in:
36
test/fkey_malloc.test
Normal file
36
test/fkey_malloc.test
Normal file
@ -0,0 +1,36 @@
|
||||
# 2009 September 22
|
||||
#
|
||||
# The author disclaims copyright to this source code. In place of
|
||||
# a legal notice, here is a blessing:
|
||||
#
|
||||
# May you do good and not evil.
|
||||
# May you find forgiveness for yourself and forgive others.
|
||||
# May you share freely, never taking more than you give.
|
||||
#
|
||||
#***********************************************************************
|
||||
#
|
||||
#
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
|
||||
ifcapable !foreignkey||!trigger {
|
||||
finish_test
|
||||
return
|
||||
}
|
||||
source $testdir/malloc_common.tcl
|
||||
|
||||
do_malloc_test fkey_malloc-1 -sqlprep {
|
||||
PRAGMA foreign_keys = 1;
|
||||
CREATE TABLE t1(a PRIMARY KEY, b);
|
||||
CREATE TABLE t2(x REFERENCES t1 ON UPDATE CASCADE ON DELETE CASCADE);
|
||||
} -sqlbody {
|
||||
INSERT INTO t1 VALUES('aaa', 1);
|
||||
INSERT INTO t2 VALUES('aaa');
|
||||
UPDATE t1 SET a = 'bbb';
|
||||
DELETE FROM t1;
|
||||
}
|
||||
|
||||
finish_test
|
||||
|
||||
|
Reference in New Issue
Block a user