-C Adjust\sthe\sparser\sso\sthat\scertain\slegacy\sschema\sconstructs\s(that\sare\snot\nvalid\saccording\sto\sthe\ssyntax\sdiagram)\scontinue\sto\sbe\saccepted,\sso\sthat\nolder\sdatabases\sthat\shappen\sto\suse\sthose\sconstructs\sare\sstill\sreadable.\nThis\sfixes\san\sissue\sintroduced\sby\scheck-in\s[1b75f301affac6]
-D 2012-05-07T19:21:36.465
+C Further\schanges\sto\sconstraint\sparsing\sto\ssupport\slegacy\ssyntax.
+D 2012-05-08T11:17:33.934
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 2f37e468503dbe79d35c9f6dffcf3fae1ae9ec20
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F src/os_win.c 412d6434133c7c81dc48b7702f3ea5e61c309e5c
F src/pager.c bb5635dde0b152797836d1c72275284724bb563c
F src/pager.h ef1eaf8593e78f73885c1dfac27ad83bee23bdc5
-F src/parse.y ad29af00e73d3afd84820f5738e072c506d8d77b
+F src/parse.y de06f412a4b3a2978071215f657fd1cd70700444
F src/pcache.c f8043b433a57aba85384a531e3937a804432a346
F src/pcache.h 1b5dcc3dc8103d03e625b177023ee67764fa6b7c
F src/pcache1.c b30b1c35908346ecc43d8d9d17f2ddf6817f8f60
F test/schema2.test 906408621ea881fdb496d878b1822572a34e32c5
F test/schema3.test 1bc1008e1f8cb5654b248c55f27249366eb7ed38
F test/schema4.test e6a66e20cc69f0e306667c08be7fda3d11707dc5
+F test/schema5.test b583e6e24adef3dce804bed040f24dd5fe789159
F test/securedel.test 87a2561151af1f1e349071a89fdd77059f50113c
F test/select1.test deba017eed9daa5af33de868676c997e7eebb931
F test/select2.test 352480e0e9c66eda9c3044e412abdf5be0215b56
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
F tool/warnings-clang.sh a8a0a3babda96dfb1ff51adda3cbbf3dfb7266c2
F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
-P a4555a53eab3f5d2f142c78a6b71189544e80ae6
-R b1ed928fe6d7cc7f56cb67cfef4cacc0
+P a1c014d8a87c8940b3a037d8d8cc4d5678809802
+R b6207703cdccfd3ac416f9da168138e7
U drh
-Z a9d5fb0a817384840c4a8fbe0a536a67
+Z c70e51594d9a44ff78a8a89d0fd856a7
-a1c014d8a87c8940b3a037d8d8cc4d5678809802
\ No newline at end of file
+38bf90af1ede6ee64ef7be66392e895e60c9126e
\ No newline at end of file
init_deferred_pred_opt(A) ::= INITIALLY DEFERRED. {A = 1;}
init_deferred_pred_opt(A) ::= INITIALLY IMMEDIATE. {A = 0;}
-conslist_opt(A) ::= . {A.n = 0; A.z = 0;}
-conslist_opt(A) ::= COMMA(X) conslist. {A = X;}
-conslist ::= conslist COMMA cname tcons cname.
-conslist ::= cname tcons cname.
+conslist_opt(A) ::= . {A.n = 0; A.z = 0;}
+conslist_opt(A) ::= COMMA(X) conslist cname. {A = X;}
+conslist ::= conslist COMMA cname tcons.
+conslist ::= conslist cname tcons.
+conslist ::= cname tcons.
cname ::= . {pParse->constraintName.n = 0;}
cname ::= CONSTRAINT nm(X). {pParse->constraintName = X;}
tcons ::= PRIMARY KEY LP idxlist(X) autoinc(I) RP onconf(R).
--- /dev/null
+# 2010 September 28
+#
+# The author disclaims copyright to this source code. In place of
+# a legal notice, here is a blessing:
+#
+# May you do good and not evil.
+# May you find forgiveness for yourself and forgive others.
+# May you share freely, never taking more than you give.
+#
+#***********************************************************************
+#
+# This file checks corner cases in the CREATE TABLE syntax to make
+# sure that legacy syntax (syntax that is disallowed according to the
+# syntax diagrams) is still accepted, so that older databases that use
+# that syntax can still be read.
+#
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+
+# Table constraints should be separated by commas, but they do not have
+# to be.
+#
+do_test schema5-1.1 {
+ db eval {
+ CREATE TABLE t1(a,b,c, PRIMARY KEY(a) UNIQUE (a) CONSTRAINT one);
+ INSERT INTO t1 VALUES(1,2,3);
+ SELECT * FROM t1;
+ }
+} {1 2 3}
+do_test schema5-1.2 {
+ catchsql {INSERT INTO t1 VALUES(1,3,4);}
+} {1 {column a is not unique}}
+do_test schema5-1.3 {
+ db eval {
+ DROP TABLE t1;
+ CREATE TABLE t1(a,b,c,
+ CONSTRAINT one PRIMARY KEY(a) CONSTRAINT two CHECK(b<10) UNIQUE(b)
+ CONSTRAINT three
+ );
+ INSERT INTO t1 VALUES(1,2,3);
+ SELECT * FROM t1;
+ }
+} {1 2 3}
+do_test schema5-1.4 {
+ catchsql {INSERT INTO t1 VALUES(10,11,12);}
+} {1 {constraint two failed}}
+
+
+
+
+finish_test