aboutsummaryrefslogtreecommitdiff
path: root/src/parse.y
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2008-08-08 14:19:41 +0000
committerdrh <drh@noemail.net>2008-08-08 14:19:41 +0000
commit200a81dcb51bb5c02625a4fe6b6dabbf630a069c (patch)
tree0c8d6f54b2570e89025eda735ddcb9de11e8c473 /src/parse.y
parenta33cb5f776c294441ffa4982197a3fe04ea92e03 (diff)
downloadsqlite-200a81dcb51bb5c02625a4fe6b6dabbf630a069c.tar.gz
sqlite-200a81dcb51bb5c02625a4fe6b6dabbf630a069c.zip
Disallow the ON CONFLICT clause on CHECK constraints. The syntax used to be
allowed but never worked, so this should not present compatibility problems. Other internal grammar simplifications. (CVS 5546) FossilOrigin-Name: 4cedc641ed39982ae8cbb9200aa1e2f37c878b73
Diffstat (limited to 'src/parse.y')
-rw-r--r--src/parse.y12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/parse.y b/src/parse.y
index b2cbe9bca..8b6d1632e 100644
--- a/src/parse.y
+++ b/src/parse.y
@@ -14,7 +14,7 @@
** the parser. Lemon will also generate a header file containing
** numeric codes for all of the tokens.
**
-** @(#) $Id: parse.y,v 1.248 2008/07/31 01:40:42 shane Exp $
+** @(#) $Id: parse.y,v 1.249 2008/08/08 14:19:41 drh Exp $
*/
// All token codes are small integers with #defines that begin with "TK_"
@@ -91,7 +91,6 @@ struct AttachKey { int type; Token key; };
input ::= cmdlist.
cmdlist ::= cmdlist ecmd.
cmdlist ::= ecmd.
-cmdx ::= cmd. { sqlite3FinishCoding(pParse); }
ecmd ::= SEMI.
ecmd ::= explain cmdx SEMI.
explain ::= . { sqlite3BeginParse(pParse, 0); }
@@ -99,6 +98,7 @@ explain ::= . { sqlite3BeginParse(pParse, 0); }
explain ::= EXPLAIN. { sqlite3BeginParse(pParse, 1); }
explain ::= EXPLAIN QUERY PLAN. { sqlite3BeginParse(pParse, 2); }
%endif SQLITE_OMIT_EXPLAIN
+cmdx ::= cmd. { sqlite3FinishCoding(pParse); }
///////////////////// Begin and end transactions. ////////////////////////////
//
@@ -313,7 +313,7 @@ tcons ::= PRIMARY KEY LP idxlist(X) autoinc(I) RP onconf(R).
{sqlite3AddPrimaryKey(pParse,X,R,I,0);}
tcons ::= UNIQUE LP idxlist(X) RP onconf(R).
{sqlite3CreateIndex(pParse,0,0,0,X,R,0,0,0,0);}
-tcons ::= CHECK LP expr(E) RP onconf. {sqlite3AddCheckConstraint(pParse,E);}
+tcons ::= CHECK LP expr(E) RP. {sqlite3AddCheckConstraint(pParse,E);}
tcons ::= FOREIGN KEY LP idxlist(FA) RP
REFERENCES nm(T) idxlist_opt(TA) refargs(R) defer_subclause_opt(D). {
sqlite3CreateForeignKey(pParse, FA, &T, TA, R);
@@ -885,11 +885,10 @@ uniqueflag(A) ::= . {A = OE_None;}
%destructor idxlist {sqlite3ExprListDelete(pParse->db, $$);}
%type idxlist_opt {ExprList*}
%destructor idxlist_opt {sqlite3ExprListDelete(pParse->db, $$);}
-%type idxitem {Token}
idxlist_opt(A) ::= . {A = 0;}
idxlist_opt(A) ::= LP idxlist(X) RP. {A = X;}
-idxlist(A) ::= idxlist(X) COMMA idxitem(Y) collate(C) sortorder(Z). {
+idxlist(A) ::= idxlist(X) COMMA nm(Y) collate(C) sortorder(Z). {
Expr *p = 0;
if( C.n>0 ){
p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0);
@@ -899,7 +898,7 @@ idxlist(A) ::= idxlist(X) COMMA idxitem(Y) collate(C) sortorder(Z). {
sqlite3ExprListCheckLength(pParse, A, "index");
if( A ) A->a[A->nExpr-1].sortOrder = Z;
}
-idxlist(A) ::= idxitem(Y) collate(C) sortorder(Z). {
+idxlist(A) ::= nm(Y) collate(C) sortorder(Z). {
Expr *p = 0;
if( C.n>0 ){
p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0);
@@ -909,7 +908,6 @@ idxlist(A) ::= idxitem(Y) collate(C) sortorder(Z). {
sqlite3ExprListCheckLength(pParse, A, "index");
if( A ) A->a[A->nExpr-1].sortOrder = Z;
}
-idxitem(A) ::= nm(X). {A = X;}
%type collate {Token}
collate(C) ::= . {C.z = 0; C.n = 0;}