]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix an assert() failure that can occur following a malloc() failure. Ticket #3455...
authordanielk1977 <danielk1977@noemail.net>
Wed, 22 Oct 2008 10:45:37 +0000 (10:45 +0000)
committerdanielk1977 <danielk1977@noemail.net>
Wed, 22 Oct 2008 10:45:37 +0000 (10:45 +0000)
FossilOrigin-Name: e0d3aa75b4fa0e706185a3058b5962916e30d066

manifest
manifest.uuid
src/build.c
test/attachmalloc.test

index 680d6f51828fd87cf45bdf432235a9619cd824a0..c9bda37458e5ccd7518e3294eb469a09c54bfe5b 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Update\sthe\sautoconf\sbuild\ssystem\sto\sinclude\smemjournal.c.\s(CVS\s5833)
-D 2008-10-21T04:30:32
+C Fix\san\sassert()\sfailure\sthat\scan\soccur\sfollowing\sa\smalloc()\sfailure.\sTicket\s#3455.\s(CVS\s5834)
+D 2008-10-22T10:45:38
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in 4352ab12369706c793f3e8165db35b102c929998
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -102,7 +102,7 @@ F src/btmutex.c 3a90096c3080b9057dc570b8e16e46511e1c788a
 F src/btree.c 3e686f899659df8d79f2587d0f34f51fdf6a6276
 F src/btree.h 903682f2a88da37435f103da00cb915d63bc8015
 F src/btreeInt.h e38e9b2b285f40f5bc0a6664f630d4a141622f16
-F src/build.c 8714bd809583bbe07bf22d0e1808a3fc31abe330
+F src/build.c d6d55f97abcb6f17ac3e9e7a1dd8c0db67db34fd
 F src/callback.c e970e5beddbdb23f89a6d05cb1a6419d9f755624
 F src/complete.c cb14e06dbe79dee031031f0d9e686ff306afe07c
 F src/date.c 6f4277fa56d8c1b8e70c0bde838c9e99609f5ec0
@@ -217,7 +217,7 @@ F test/async3.test 9ffa0977a78cc6351862a1583be2b1eecd41736d
 F test/attach.test 75a5d22f88e730967d68f2c9f95e786e3953d8e3
 F test/attach2.test a295d2d7061adcee5884ef4a93c7c96a82765437
 F test/attach3.test 7b92dc8e40c1ebca9732ca6f2d3fefbd46f196df
-F test/attachmalloc.test ccbde53bcb0a61020afa3e0670ca9c6c5b99af32
+F test/attachmalloc.test cf8cf17d183de357b1147a9baacbdfc85b940b61
 F test/auth.test 9eb4b6b99eee54c95711c74c4b9694acf4d850ed
 F test/auth2.test ee3ba272e2b975e913afc9b041ee75706e190005
 F test/autoinc.test ab549b48b389cabd92967b86c379ec8b31fa6c16
@@ -649,7 +649,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P 81cfee5c14f241f5ae7f607d73b0b5cb821cda24
-R c2c7d8cb37eb348018dbe6bab154dcb8
+P a3c810f0c80e3e9dfe60a0ffd8688d7c76a30d50
+R eb10ad551dda09e9891a5b737d1b43ef
 U danielk1977
-Z 5b6062772586553c07d23b9b4a71be8f
+Z 78303c07616fabd1b430a1645d928812
index 0f90293cca653196b551f878b19b900b8e045ceb..0ce41d9ec3ac659a2c42f396d2bb61640a32ba75 100644 (file)
@@ -1 +1 @@
-a3c810f0c80e3e9dfe60a0ffd8688d7c76a30d50
\ No newline at end of file
+e0d3aa75b4fa0e706185a3058b5962916e30d066
\ No newline at end of file
index 220f2566e10902fb6bbc83536afa125bb0d040f3..84fb23c3fa5a5fa03a55fc9db73bcc0cb8b80fe9 100644 (file)
@@ -22,7 +22,7 @@
 **     COMMIT
 **     ROLLBACK
 **
-** $Id: build.c,v 1.498 2008/10/06 16:18:40 danielk1977 Exp $
+** $Id: build.c,v 1.499 2008/10/22 10:45:38 danielk1977 Exp $
 */
 #include "sqliteInt.h"
 #include <ctype.h>
@@ -2401,7 +2401,7 @@ void sqlite3CreateIndex(
     }
     pTab = sqlite3LocateTable(pParse, 0, pTblName->a[0].zName, 
         pTblName->a[0].zDatabase);
-    if( !pTab ) goto exit_create_index;
+    if( !pTab || db->mallocFailed ) goto exit_create_index;
     assert( db->aDb[iDb].pSchema==pTab->pSchema );
   }else{
     assert( pName==0 );
index a6de5cecb3ee860ebc77abe864ff60ac8f5b0d4e..30841cea76f797dd7baace70c9c8aa3b4ba2844e 100644 (file)
@@ -12,7 +12,7 @@
 # focus of this script is testing the ATTACH statement and
 # specifically out-of-memory conditions within that command.
 #
-# $Id: attachmalloc.test,v 1.9 2008/08/04 20:13:27 drh Exp $
+# $Id: attachmalloc.test,v 1.10 2008/10/22 10:45:38 danielk1977 Exp $
 #
 
 set testdir [file dirname $argv0]
@@ -46,4 +46,18 @@ do_malloc_test attachmalloc-1 -tclprep {
   CREATE TABLE four.t1(x);
 }
 
+do_malloc_test attachmalloc-2 -tclprep {
+  file delete -force test2.db
+  file delete -force test2.db-journal
+  sqlite3 db2 test2.db
+  db2 eval {
+    CREATE TABLE t1(a, b, c);
+    CREATE INDEX i1 ON t1(a, b);
+  }
+  db2 close
+} -sqlbody {
+  CREATE TABLE t1(d, e, f);
+  ATTACH 'test2.db' AS db1;
+}
+
 finish_test