1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Fix a problems that arise if malloc() fails while compiling SELECT

statements within a TRIGGER. (CVS 3478)

FossilOrigin-Name: ee4894b49995e4904db1991281563cfbb7b1c16d
This commit is contained in:
drh
2006-10-18 23:26:38 +00:00
parent f6bbe022c7
commit 28f4591466
5 changed files with 25 additions and 18 deletions

View File

@ -14,7 +14,7 @@
# special feature is used to see what happens in the library if a malloc
# were to really fail due to an out-of-memory situation.
#
# $Id: malloc.test,v 1.35 2006/10/04 11:55:50 drh Exp $
# $Id: malloc.test,v 1.36 2006/10/18 23:26:39 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@ -229,7 +229,10 @@ do_malloc_test 5 -sqlbody {
CREATE TABLE t1(a,b);
CREATE TABLE t2(x,y);
CREATE TRIGGER r1 AFTER INSERT ON t1 BEGIN
INSERT INTO t2(x,y) VALUES(new.rowid,1);
INSERT INTO t2(x,y) VALUES(new.rowid,1);
UPDATE t2 SET y=y+1 WHERE x=new.rowid;
SELECT 123;
DELETE FROM t2 WHERE x=new.rowid;
END;
INSERT INTO t1(a,b) VALUES(2,3);
COMMIT;