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

Do not delete tables with the same name when dropping triggers.

Ticket #430. (CVS 1074)

FossilOrigin-Name: ef58f163b08d13f8e9b69459bd83e0bf9d5b404b
This commit is contained in:
drh
2003-08-16 12:37:51 +00:00
parent 8e18bac793
commit 9b1b01bb76
5 changed files with 60 additions and 16 deletions

View File

@ -309,4 +309,47 @@ do_test trigger-4.4 {
integrity_check trigger-5.1
# Create a trigger with the same name as a table. Make sure the
# trigger works. Then drop the trigger. Make sure the table is
# still there.
#
do_test trigger-6.1 {
execsql {SELECT type, name FROM sqlite_master}
} {view v1 table t2}
do_test trigger-6.2 {
execsql {
CREATE TRIGGER t2 BEFORE DELETE ON t2 BEGIN
SELECT RAISE(ABORT,'deletes are not allows');
END;
SELECT type, name FROM sqlite_master;
}
} {view v1 table t2 trigger t2}
do_test trigger-6.3 {
catchsql {DELETE FROM t2}
} {1 {deletes are not allows}}
do_test trigger-6.4 {
execsql {SELECT * FROM t2}
} {3 4 7 8}
do_test trigger-6.5 {
db close
sqlite db test.db
execsql {SELECT type, name FROM sqlite_master}
} {view v1 table t2 trigger t2}
do_test trigger-6.6 {
execsql {
DROP TRIGGER t2;
SELECT type, name FROM sqlite_master;
}
} {view v1 table t2}
do_test trigger-6.7 {
execsql {SELECT * FROM t2}
} {3 4 7 8}
do_test trigger-6.8 {
db close
sqlite db test.db
execsql {SELECT * FROM t2}
} {3 4 7 8}
integrity_check trigger-7.1
finish_test