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

Partial fix for ticket #49. The correct result is computed, but now we have

a memory leak.  I'm not sure if the memory leak was pre-existing or a result
of this change. (CVS 581)

FossilOrigin-Name: 4d27ee411902a197cd72416ca9da9197d3f87f13
This commit is contained in:
drh
2002-05-23 12:50:18 +00:00
parent e4697f5e90
commit 07d6e3a74c
5 changed files with 49 additions and 19 deletions

View File

@ -110,11 +110,39 @@ do_test trig_cd-1.9 {
}
} {1 {cannot create trigger on system table: sqlite_master}}
catchsql {
DROP TABLE temp_table;
}
catchsql {
DROP TABLE t1;
}
# Check to make sure that a DELETE statement within the body of
# a trigger does not mess up the DELETE that caused the trigger to
# run in the first place.
#
do_test trig_cd-1.10 {
execsql {
create table t1(a,b);
insert into t1 values(1,'a');
insert into t1 values(2,'b');
insert into t1 values(3,'c');
insert into t1 values(4,'d');
create trigger r1 after delete on t1 for each row begin
delete from t1 WHERE a=old.a+2;
end;
delete from t1 where a in (1,3);
select * from t1;
drop table t1;
}
} {2 b 4 d}
do_test trig_cd-1.11 {
execsql {
create table t1(a,b);
insert into t1 values(1,'a');
insert into t1 values(2,'b');
insert into t1 values(3,'c');
insert into t1 values(4,'d');
create trigger r1 after update on t1 for each row begin
delete from t1 WHERE a=old.a+2;
end;
update t1 set b='x-' || b where a in (1,3);
select * from t1;
drop table t1;
}
} {1 x-a 2 b 4 d}
finish_test