]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Simplify the parser reduction code for the LIMIT clause on an UPDATE or
authordrh <drh@noemail.net>
Fri, 10 Oct 2008 14:27:16 +0000 (14:27 +0000)
committerdrh <drh@noemail.net>
Fri, 10 Oct 2008 14:27:16 +0000 (14:27 +0000)
DELETE. (CVS 5792)

FossilOrigin-Name: 3de179630e812396ec29e77f7a06758472d0802f

manifest
manifest.uuid
src/parse.y

index 1f24da0407fca4c809cc44ba73e3881cc21a577c..4983510faa92f2285894718b23a648703ec9d56e 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Re-factored\smemory\sallocation\sfailure\shandling\sin\sthe\ssqlite3LimitWhere()\sfunction\sbased\son\sfailures\sin\sthe\smallocJ.test\sscript.\s(CVS\s5791)
-D 2008-10-10T13:35:58
+C Simplify\sthe\sparser\sreduction\scode\sfor\sthe\sLIMIT\sclause\son\san\sUPDATE\sor\nDELETE.\s(CVS\s5792)
+D 2008-10-10T14:27:17
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in 7fc26e087207e7a4a7723583dbd7997477af3b13
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -140,7 +140,7 @@ F src/os_unix.c f33b69d8a85372b270fe37ee664a4c2140a5217d
 F src/os_win.c 04033a86a39f49cb8e348f515eb0116aa9d36678
 F src/pager.c d98f56128e849083f2f612196efebd982c491fea
 F src/pager.h 9c1917be28fff58118e1fe0ddbc7adfb8dd4f44d
-F src/parse.y ecabcd6402a611a223824291b8b4e026c622c2b3
+F src/parse.y 72fc66fd30bca541e05580f8ffbdcd0e983c1f66
 F src/pcache.c f8d7beceba164a34441ac37e88abb3a404f968a7
 F src/pcache.h 28d9ce2d66909db1f01652586450b62b64793093
 F src/pragma.c 0b1c2d2a241dd79a7361bbeb8ff575a9e9d7cd71
@@ -645,7 +645,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P 5375b348b12a4ae149472c84d6f05a78a5542a21
-R 49f64e7755b925909a2d8b6b2b92d853
-U shane
-Z ba6b812faf4f8b8fc8236a25b1811c24
+P 43507bbefbf79e8db8fe31319ad621d48247983f
+R 0f3d53a6d1c1c43e26912a5b940877e0
+U drh
+Z 451d4561ebde2fb2ef1d789ddc49a01c
index 131ce234d4043eaaf7eaebd97480025c672063ab..d79fd5e4cd825d6eed164bf6808417116e86750c 100644 (file)
@@ -1 +1 @@
-43507bbefbf79e8db8fe31319ad621d48247983f
\ No newline at end of file
+3de179630e812396ec29e77f7a06758472d0802f
\ No newline at end of file
index b2b34103137584a5e7ec183690c311ed3322a4bf..e8f3176082aad5cd8d4bb8a67cfcfbc4156efb50 100644 (file)
@@ -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.256 2008/10/10 04:34:16 shane Exp $
+** @(#) $Id: parse.y,v 1.257 2008/10/10 14:27:17 drh Exp $
 */
 
 // All token codes are small integers with #defines that begin with "TK_"
@@ -579,17 +579,14 @@ limit_opt(A) ::= LIMIT expr(X) COMMA expr(Y).
 /////////////////////////// The DELETE statement /////////////////////////////
 //
 %ifdef SQLITE_ENABLE_UPDATE_DELETE_LIMIT
-cmd ::= DELETE FROM fullname(X) indexed_opt(I) where_opt(W) orderby_opt(O) limit_opt(L). {
+cmd ::= DELETE FROM fullname(X) indexed_opt(I) where_opt(W) 
+        orderby_opt(O) limit_opt(L). {
   sqlite3SrcListIndexedBy(pParse, X, &I);
   if( O && !L.pLimit ){
     sqlite3ErrorMsg(pParse, "ORDER BY without LIMIT on DELETE");
     pParse->parseError = 1;
-  } else if (L.pLimit) {
-    Expr *LW = sqlite3LimitWhere(pParse, X, W, O, L.pLimit, L.pOffset);
-    if( LW ) {
-      sqlite3DeleteFrom(pParse,X,LW);
-    }
-  } else {
+  }else{
+    W = sqlite3LimitWhere(pParse, X, W, O, L.pLimit, L.pOffset);
     sqlite3DeleteFrom(pParse,X,W);
   }
 }
@@ -616,12 +613,8 @@ cmd ::= UPDATE orconf(R) fullname(X) indexed_opt(I) SET setlist(Y) where_opt(W)
   if( O && !L.pLimit ){
     sqlite3ErrorMsg(pParse, "ORDER BY without LIMIT on UPDATE");
     pParse->parseError = 1;
-  } else if (L.pLimit) {
-    Expr *LW = sqlite3LimitWhere(pParse, X, W, O, L.pLimit,L.pOffset);
-    if( LW ) {
-      sqlite3Update(pParse,X,Y,LW,R);
-    }
-  } else {
+  }else{
+    W = sqlite3LimitWhere(pParse, X, W, O, L.pLimit,L.pOffset);
     sqlite3Update(pParse,X,Y,W,R);
   }
 }