]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fixes for problems following OOM errors.
authordrh <drh@noemail.net>
Sat, 20 Aug 2016 18:06:14 +0000 (18:06 +0000)
committerdrh <drh@noemail.net>
Sat, 20 Aug 2016 18:06:14 +0000 (18:06 +0000)
FossilOrigin-Name: 9041ee4a6f0e8389297f887f1431ab5cfe783390

manifest
manifest.uuid
src/expr.c
src/parse.y

index 2f60c39a03e3e948b85e41bb24895abd6c8f48d5..15b48703cd6438dd38f872ae4bfd8ba589437a82 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Do\snot\sduplicate\sthe\sExpr.pLeft\ssubtree\sof\sa\sTK_SELECT_COLUMN\snode.
-D 2016-08-20T17:00:16.608
+C Fixes\sfor\sproblems\sfollowing\sOOM\serrors.
+D 2016-08-20T18:06:14.286
 F Makefile.in cfd8fb987cd7a6af046daa87daa146d5aad0e088
 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
 F Makefile.msc d66d0395c38571aab3804f8db0fa20707ae4609a
@@ -338,7 +338,7 @@ F src/ctime.c e77f3dc297b4b65c96da78b4ae4272fdfae863d7
 F src/date.c 95c9a8d00767e7221a8e9a31f4e913fc8029bf6b
 F src/dbstat.c 19ee7a4e89979d4df8e44cfac7a8f905ec89b77d
 F src/delete.c 76c084f0265f4a3cd1ecf17eee112a94f1ccbc05
-F src/expr.c 8e1288b32f542dd8e8a2e21c30e936112968a4ab
+F src/expr.c e96f29a02a3927b2afaca1f86fc84e80cac50ca7
 F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb
 F src/fkey.c e2be0968c1adc679c87e467aa5b4f167588f38a8
 F src/func.c 29cc9acb170ec1387b9f63eb52cd85f8de96c771
@@ -373,7 +373,7 @@ F src/os_win.c 520f23475f1de530c435d30b67b7b15fe90874b0
 F src/os_win.h 7b073010f1451abe501be30d12f6bc599824944a
 F src/pager.c 40928c450320da78bb4bd3ae82818f4239e19b7e
 F src/pager.h 966d2769e76ae347c8a32c4165faf6e6cb64546d
-F src/parse.y 9895eddbbb03c4a47cd760ff4f51cb8d139884d2
+F src/parse.y 0e0b6d46a990d01e4ca1e9d7e1d2d9b5a98f6bcb
 F src/pcache.c 5583c8ade4b05075a60ba953ef471d1c1a9c05df
 F src/pcache.h 2cedcd8407eb23017d92790b112186886e179490
 F src/pcache1.c 4bb7a6a5300c67d0b033d25adb509c120c03e812
@@ -1519,7 +1519,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 203f07c5e140e74cf91d0c1e20135c21236f0fc1
-R 753238d9341a2b18b0026dcf708bc835
+P 8384c77ebb3f65fbc54c199885926f2066f0b140
+R d29ab3049f2812696918a926abccb285
 U drh
-Z d423421ba92880810032946cac8ccbb5
+Z 08f6ec095045e30304bec0161a676b54
index 3459023db33acbc15b1f624febdf1bfd20ebabc0..be0615edf677d21678f581e0245fd3dfb0d093c6 100644 (file)
@@ -1 +1 @@
-8384c77ebb3f65fbc54c199885926f2066f0b140
\ No newline at end of file
+9041ee4a6f0e8389297f887f1431ab5cfe783390
\ No newline at end of file
index bd2426addb449ef804652610f9486f1edcedd094..ac67eca6914ccb00543b44cf9095eeb866ecd136 100644 (file)
@@ -406,8 +406,11 @@ Expr *sqlite3ExprForVectorField(
     ** with the same pLeft pointer to the pVector, but only one of them
     ** will own the pVector.
     */
-    pRet = sqlite3PExpr(pParse, TK_SELECT_COLUMN, pVector, 0, 0);
-    if( pRet ) pRet->iColumn = iField;
+    pRet = sqlite3PExpr(pParse, TK_SELECT_COLUMN, 0, 0, 0);
+    if( pRet ){
+      pRet->iColumn = iField;
+      pRet->pLeft = pVector;
+    }
     assert( pRet==0 || pRet->iTable==0 );
   }else{
     if( pVector->op==TK_VECTOR ) pVector = pVector->x.pList->a[iField].pExpr;
@@ -462,7 +465,8 @@ static int exprVectorRegister(
   int *pRegFree                   /* OUT: Temp register to free */
 ){
   assert( pVector->op==TK_VECTOR || pVector->op==TK_SELECT );
-  assert( pParse->nErr || (pVector->op==TK_VECTOR)==(regSelect==0) );
+  assert( pParse->nErr || pParse->db->mallocFailed
+          || (pVector->op==TK_VECTOR)==(regSelect==0) );
   if( pVector->op==TK_SELECT ){
     *ppExpr = pVector->x.pSelect->pEList->a[iField].pExpr;
      return regSelect+iField;
index c175b02867739c91d6fe1f6d786f8f04b7bd0ee8..51bdcff691b5438a7dfdde0d4c678ea1be4f1922 100644 (file)
@@ -952,11 +952,14 @@ term(A) ::= CTIME_KW(OP). {
   }
 }
 
-expr(A) ::= LP(L) nexprlist(X) COMMA expr(Y) RP(R). { 
+expr(A) ::= LP(L) nexprlist(X) COMMA expr(Y) RP(R). {
+  ExprList *pList = sqlite3ExprListAppend(pParse, X, Y.pExpr);
   A.pExpr = sqlite3PExpr(pParse, TK_VECTOR, 0, 0, 0);
   if( A.pExpr ){
-    A.pExpr->x.pList = sqlite3ExprListAppend(pParse, X, Y.pExpr);
+    A.pExpr->x.pList = pList;
     spanSet(&A, &L, &R);
+  }else{
+    sqlite3ExprListDelete(pParse->db, pList);
   }
 }