Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(479)

Unified Diff: third_party/sqlite/src/test/triggerC.test

Issue 1610963002: Import SQLite 3.10.2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/sqlite/src/test/trigger7.test ('k') | third_party/sqlite/src/test/tt3_checkpoint.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/triggerC.test
diff --git a/third_party/sqlite/src/test/triggerC.test b/third_party/sqlite/src/test/triggerC.test
index 14cc0f01dd7e61f81163e2ff4accf7190bb053d0..3e47521fd11c71ddbf63b7507addedea33082da8 100644
--- a/third_party/sqlite/src/test/triggerC.test
+++ b/third_party/sqlite/src/test/triggerC.test
@@ -12,6 +12,7 @@
set testdir [file dirname $argv0]
source $testdir/tester.tcl
+set testprefix triggerC
ifcapable {!trigger} {
finish_test
return
@@ -993,4 +994,52 @@ reset_db
optimization_control db factor-constants 0
do_execsql_test triggerC-14.2 $SQL {1 2 3}
+#-------------------------------------------------------------------------
+# Check that table names used by trigger programs are dequoted exactly
+# once.
+#
+do_execsql_test 15.1.1 {
+ PRAGMA recursive_triggers = 1;
+ CREATE TABLE node(
+ id int not null primary key,
+ pid int not null default 0 references node,
+ key varchar not null,
+ path varchar default '',
+ unique(pid, key)
+ );
+ CREATE TRIGGER node_delete_referencing AFTER DELETE ON "node"
+ BEGIN
+ DELETE FROM "node" WHERE pid = old."id";
+ END;
+}
+do_execsql_test 15.1.2 {
+ INSERT INTO node(id, pid, key) VALUES(9, 0, 'test');
+ INSERT INTO node(id, pid, key) VALUES(90, 9, 'test1');
+ INSERT INTO node(id, pid, key) VALUES(900, 90, 'test2');
+ DELETE FROM node WHERE id=9;
+ SELECT * FROM node;
+}
+
+do_execsql_test 15.2.1 {
+ CREATE TABLE x1 (x);
+
+ CREATE TABLE x2 (a, b);
+ CREATE TABLE '"x2"'(a, b);
+
+ INSERT INTO x2 VALUES(1, 2);
+ INSERT INTO x2 VALUES(3, 4);
+ INSERT INTO '"x2"' SELECT * FROM x2;
+
+ CREATE TRIGGER x1ai AFTER INSERT ON x1 BEGIN
+ INSERT INTO """x2""" VALUES('x', 'y');
+ DELETE FROM """x2""" WHERE a=1;
+ UPDATE """x2""" SET b = 11 WHERE a = 3;
+ END;
+
+ INSERT INTO x1 VALUES('go!');
+}
+
+do_execsql_test 15.2.2 { SELECT * FROM x2; } {1 2 3 4}
+do_execsql_test 15.2.3 { SELECT * FROM """x2"""; } {3 11 x y}
+
finish_test
« no previous file with comments | « third_party/sqlite/src/test/trigger7.test ('k') | third_party/sqlite/src/test/tt3_checkpoint.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698