mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-12-23 08:21:09 +00:00
add tests
This commit is contained in:
parent
06c06ac8d2
commit
8024bb3bde
1 changed files with 16 additions and 1 deletions
|
|
@ -758,4 +758,19 @@ do_execsql_test_on_specific_db {:memory:} trigger-multiple-before-insert-lifo {
|
|||
2|3|4|5|t67_second
|
||||
3|4|6|8|t67_second
|
||||
4|2|3|4|t67_first
|
||||
5|1|1|1|jussi}
|
||||
5|1|1|1|jussi}
|
||||
|
||||
# dropping table should drop triggers
|
||||
do_execsql_test_on_specific_db {:memory:} trigger-drop-make-same-table{
|
||||
create table a(id int primary key, x int);
|
||||
create table t(id int primary key, b int, d int, c int);
|
||||
create table t1(id int, y int); create trigger trg after insert on t begin update a set x = x - new.d + new.c where id = new.b; insert into t1(id, y) values (new.id, new.c - new.d); end; insert into a values (1, 5000);
|
||||
insert into a values (2, 3000);
|
||||
drop table t;
|
||||
create table t(id int primary key, b int, c int, d int);
|
||||
insert into t values (1, 1, 1000, 50);
|
||||
insert into t values (2, 2, 500, 100);
|
||||
select * from a;
|
||||
select * from t1;
|
||||
} {1|5000
|
||||
2|3000}
|
||||
Loading…
Add table
Add a link
Reference in a new issue