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

Fix a problem with the pre-update hook on this branch.

FossilOrigin-Name: 6fc4fbfa29cfa795edf32e4a1f2d0eceb3007f68
This commit is contained in:
dan
2017-01-25 17:44:13 +00:00
parent 585ce1923c
commit 2a86c1962c
6 changed files with 56 additions and 25 deletions

View File

@ -854,4 +854,40 @@ do_preupdate_test 8.1 {
} {
}
#-------------------------------------------------------------------------
reset_db
db preupdate hook preupdate_hook
do_execsql_test 9.0 {
CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c);
CREATE TABLE t2(a, b INTEGER PRIMARY KEY);
}
do_preupdate_test 9.1 {
INSERT INTO t1 VALUES(456, NULL, NULL);
} {
INSERT main t1 456 456 0 456 {} {}
}
do_execsql_test 9.2 {
ALTER TABLE t1 ADD COLUMN d;
}
do_preupdate_test 9.3 {
INSERT INTO t1(a, b, c) VALUES(457, NULL, NULL);
} {
INSERT main t1 457 457 0 457 {} {} {}
}
do_preupdate_test 9.4 {
DELETE FROM t1 WHERE a=456
} {
DELETE main t1 456 456 0 456 {} {} {}
}
do_preupdate_test 9.5 {
INSERT INTO t2 DEFAULT VALUES;
} {
INSERT main t2 1 1 0 {} 1
}
do_preupdate_test 9.6 {
INSERT INTO t1 DEFAULT VALUES;
} {
INSERT main t1 458 458 0 458 {} {} {}
}
finish_test