]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Make sure OOM errors in the ANALYSIS loader get reported back out to
authordrh <drh@noemail.net>
Fri, 13 Feb 2009 16:59:53 +0000 (16:59 +0000)
committerdrh <drh@noemail.net>
Fri, 13 Feb 2009 16:59:53 +0000 (16:59 +0000)
high-level layers.  Strange behavior can result otherwise. (CVS 6292)

FossilOrigin-Name: 88a6355cd65ddb319dbc27b5248c664dbf599778

manifest
manifest.uuid
src/analyze.c

index 2dc92128146ec51346b073342710af90bcd0e621..91055d9e63ae60769b71fca6ba705af12e10a876 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Correctly\shandle\sattempts\sto\sadd\sa\sUNIQUE\sor\sPRIMARY\sKEY\scolumn\susing\nthe\sALTER\sTABLE\sstatement.\s\sTicket\s#3651.\s(CVS\s6291)
-D 2009-02-13T03:43:32
+C Make\ssure\sOOM\serrors\sin\sthe\sANALYSIS\sloader\sget\sreported\sback\sout\sto\nhigh-level\slayers.\s\sStrange\sbehavior\scan\sresult\sotherwise.\s(CVS\s6292)
+D 2009-02-13T16:59:53
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in c7a5a30fb6852bd7839b1024e1661da8549878ee
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -98,7 +98,7 @@ F sqlite3.1 6be1ad09113570e1fc8dcaff84c9b0b337db5ffc
 F sqlite3.def a1be7b9a4b8b51ac41c6ff6e8e44a14ef66b338b
 F sqlite3.pc.in ae6f59a76e862f5c561eb32a380228a02afc3cad
 F src/alter.c f93d13aae63ea1a5ee604d76041be354311d08a5
-F src/analyze.c c86fd6a1425b22b3a46ce72ad403e4280026364f
+F src/analyze.c fc6056826fe67aa0856d4e01591be8f9266ac415
 F src/attach.c 81d37d1948f409146a7b22b96998fd90649d1fd3
 F src/auth.c c8b2ab5c8bad4bd90ed7c294694f48269162c627
 F src/backup.c 0fb3c8d9ba8345c06d8c8fa2bd753babf443e091
@@ -701,7 +701,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P 97203a0ad7a7ddfae04daf99558389b0589fc170
-R c3e34896fab7ddb1e1c67f27275cda31
+P dd179ff2986bc2a86d70bbe927fd0e123e17d398
+R e4eafd6d7a9222fb3694b7d165dcb016
 U drh
-Z d2ef14fc652ee88c4cbac35aebdcf995
+Z 8611aeec67c9c6405052380c9627df52
index 524e384ddcf9d594832bf818af4b14b800e78c9e..2aabdcaf9ed6c17bf8752cf11e9f723002fa56b4 100644 (file)
@@ -1 +1 @@
-dd179ff2986bc2a86d70bbe927fd0e123e17d398
\ No newline at end of file
+88a6355cd65ddb319dbc27b5248c664dbf599778
\ No newline at end of file
index b4422e7ea5bfebf290840d3b775abe98ba683aeb..3862a29aba8f8ac7266b096e1aefa7a53e011c77 100644 (file)
@@ -11,7 +11,7 @@
 *************************************************************************
 ** This file contains code associated with the ANALYZE command.
 **
-** @(#) $Id: analyze.c,v 1.47 2008/12/10 16:45:51 drh Exp $
+** @(#) $Id: analyze.c,v 1.48 2009/02/13 16:59:53 drh Exp $
 */
 #ifndef SQLITE_OMIT_ANALYZE
 #include "sqliteInt.h"
@@ -416,10 +416,15 @@ int sqlite3AnalysisLoad(sqlite3 *db, int iDb){
   /* Load new statistics out of the sqlite_stat1 table */
   zSql = sqlite3MPrintf(db, "SELECT idx, stat FROM %Q.sqlite_stat1",
                         sInfo.zDatabase);
-  (void)sqlite3SafetyOff(db);
-  rc = sqlite3_exec(db, zSql, analysisLoader, &sInfo, 0);
-  (void)sqlite3SafetyOn(db);
-  sqlite3DbFree(db, zSql);
+  if( zSql==0 ){
+    rc = SQLITE_NOMEM;
+  }else{
+    (void)sqlite3SafetyOff(db);
+    rc = sqlite3_exec(db, zSql, analysisLoader, &sInfo, 0);
+    (void)sqlite3SafetyOn(db);
+    sqlite3DbFree(db, zSql);
+    if( rc==SQLITE_NOMEM ) db->mallocFailed = 1;
+  }
   return rc;
 }