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

Unified Diff: third_party/sqlite/src/test/fkey2.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/fkey1.test ('k') | third_party/sqlite/src/test/fkey5.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/fkey2.test
diff --git a/third_party/sqlite/src/test/fkey2.test b/third_party/sqlite/src/test/fkey2.test
index 53b90dc91c21131f78025e0b978d1cd4e713b66e..aec75ed693cf2cbc39edf3e77bf0a938311fb73b 100644
--- a/third_party/sqlite/src/test/fkey2.test
+++ b/third_party/sqlite/src/test/fkey2.test
@@ -676,6 +676,11 @@ do_test fkey2-9.2.3 {
SELECT * FROM cc;
}
} {{} A {} {} B {} 3 A 2 3 B 2}
+do_execsql_test fkey2-9.3.0 {
+ CREATE TABLE t3(x PRIMARY KEY REFERENCES t3 ON DELETE SET NULL);
+ INSERT INTO t3(x) VALUES(12345);
+ DROP TABLE t3;
+} {}
#-------------------------------------------------------------------------
# The following tests, fkey2-10.*, test "foreign key mismatch" and
@@ -746,10 +751,10 @@ do_test fkey2-10.2.2 {
drop_all_tables
do_test fkey2-11.1.1 {
execsql {
- CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
+ CREATE TABLE t1(a INTEGER PRIMARY KEY, b, rowid, _rowid_, oid);
CREATE TABLE t2(c, d, FOREIGN KEY(c) REFERENCES t1(a) ON UPDATE CASCADE);
- INSERT INTO t1 VALUES(10, 100);
+ INSERT INTO t1 VALUES(10, 100, 'abc', 'def', 'ghi');
INSERT INTO t2 VALUES(10, 100);
UPDATE t1 SET a = 15;
SELECT * FROM t2;
@@ -2014,4 +2019,18 @@ do_test fkey2-ce7c13.1.6 {
}
} {1 {FOREIGN KEY constraint failed}}
+# 2015-04-16: Foreign key errors propagate back up to the parser.
+#
+do_test fkey2-20150416-100 {
+ db close
+ sqlite3 db :memory:
+ catchsql {
+ PRAGMA foreign_keys=1;
+ CREATE TABLE t1(x PRIMARY KEY);
+ CREATE TABLE t(y REFERENCES t0(x)ON DELETE SET DEFAULT);
+ CREATE TABLE t0(y REFERENCES t1 ON DELETE SET NULL);
+ REPLACE INTO t1 SELECT(0);CREATE TABLE t2(x);CREATE TABLE t3;
+ }
+} {1 {foreign key mismatch - "t" referencing "t0"}}
+
finish_test
« no previous file with comments | « third_party/sqlite/src/test/fkey1.test ('k') | third_party/sqlite/src/test/fkey5.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698