diff options
Diffstat (limited to 'src/parse.y')
-rw-r--r-- | src/parse.y | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/parse.y b/src/parse.y index ceea34c3c..f444aea62 100644 --- a/src/parse.y +++ b/src/parse.y @@ -658,7 +658,7 @@ as(X) ::= . {X.n = 0; X.z = 0;} // A complete FROM clause. // -from(A) ::= . {A = sqlite3DbMallocZero(pParse->db, sizeof(*A));} +from(A) ::= . {A = 0;} from(A) ::= FROM seltablist(X). { A = X; sqlite3SrcListShiftJoinType(A); @@ -890,9 +890,10 @@ where_opt(A) ::= WHERE expr(X). {A = X;} ////////////////////////// The UPDATE command //////////////////////////////// // %if SQLITE_ENABLE_UPDATE_DELETE_LIMIT || SQLITE_UDL_CAPABLE_PARSER -cmd ::= with UPDATE orconf(R) xfullname(X) indexed_opt(I) SET setlist(Y) +cmd ::= with UPDATE orconf(R) xfullname(X) indexed_opt(I) SET setlist(Y) from(F) where_opt(W) orderby_opt(O) limit_opt(L). { sqlite3SrcListIndexedBy(pParse, X, &I); + X = sqlite3SrcListAppendList(pParse, X, F); sqlite3ExprListCheckLength(pParse,Y,"set list"); #ifndef SQLITE_ENABLE_UPDATE_DELETE_LIMIT if( O || L ){ @@ -904,10 +905,11 @@ cmd ::= with UPDATE orconf(R) xfullname(X) indexed_opt(I) SET setlist(Y) sqlite3Update(pParse,X,Y,W,R,O,L,0); } %else -cmd ::= with UPDATE orconf(R) xfullname(X) indexed_opt(I) SET setlist(Y) +cmd ::= with UPDATE orconf(R) xfullname(X) indexed_opt(I) SET setlist(Y) from(F) where_opt(W). { sqlite3SrcListIndexedBy(pParse, X, &I); sqlite3ExprListCheckLength(pParse,Y,"set list"); + X = sqlite3SrcListAppendList(pParse, X, F); sqlite3Update(pParse,X,Y,W,R,0,0,0); } %endif |