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

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

Issue 2751253002: [sql] Import SQLite 3.17.0. (Closed)
Patch Set: also clang on Linux i386 Created 3 years, 9 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/pageropt.test ('k') | third_party/sqlite/src/test/permutations.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/parser1.test
diff --git a/third_party/sqlite/src/test/parser1.test b/third_party/sqlite/src/test/parser1.test
index 78c1a40c630e41ac29858536a4c8cfddfa0316a0..c708dded1f21532945e734a37413626977b709ae 100644
--- a/third_party/sqlite/src/test/parser1.test
+++ b/third_party/sqlite/src/test/parser1.test
@@ -76,4 +76,27 @@ do_catchsql_test parser1-2.2 {
SELECT x FROM c;
} {1 {syntax error after column name "x"}}
+# Verify that the comma between multiple table constraints is
+# optional.
+#
+# The missing comma is technically a syntax error. But we have to support
+# it because there might be legacy databases that omit the commas in their
+# sqlite_master tables.
+#
+do_execsql_test parser1-3.1 {
+ CREATE TABLE t300(id INTEGER PRIMARY KEY);
+ CREATE TABLE t301(
+ id INTEGER PRIMARY KEY,
+ c1 INTEGER NOT NULL,
+ c2 INTEGER NOT NULL,
+ c3 BOOLEAN NOT NULL DEFAULT 0,
+ FOREIGN KEY(c1) REFERENCES t300(id) ON DELETE CASCADE ON UPDATE RESTRICT
+ /* no comma */
+ FOREIGN KEY(c2) REFERENCES t300(id) ON DELETE CASCADE ON UPDATE RESTRICT
+ /* no comma */
+ UNIQUE(c1, c2)
+ );
+ PRAGMA foreign_key_list(t301);
+} {0 0 t300 c2 id RESTRICT CASCADE NONE 1 0 t300 c1 id RESTRICT CASCADE NONE}
+
finish_test
« no previous file with comments | « third_party/sqlite/src/test/pageropt.test ('k') | third_party/sqlite/src/test/permutations.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698