/ Check-in [2532792a]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix for ticket #78: Avoid an assertion failure when sqlite_close() to be called in the middle of a transaction. (CVS 634)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:2532792a5875f9cc0f7d8eaf90dd49d1f6025ca3
User & Date: drh 2002-06-21 11:55:49
Context
2002-06-21
13:09
Fix for ticket #76: Fix a database corruption that might occur when dropping tables or indices. (CVS 635) check-in: 7936b032 user: drh tags: trunk
11:55
Fix for ticket #78: Avoid an assertion failure when sqlite_close() to be called in the middle of a transaction. (CVS 634) check-in: 2532792a user: drh tags: trunk
2002-06-20
11:41
Update the file-format change document to describes the changes between versions 2.4.12 and 2.5.0. (CVS 633) check-in: d28a2ecc user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/main.c.

    10     10   **
    11     11   *************************************************************************
    12     12   ** Main file for the SQLite library.  The routines in this file
    13     13   ** implement the programmer interface to the library.  Routines in
    14     14   ** other files are for internal use by SQLite and should not be
    15     15   ** accessed by users of the library.
    16     16   **
    17         -** $Id: main.c,v 1.81 2002/06/20 11:36:49 drh Exp $
           17  +** $Id: main.c,v 1.82 2002/06/21 11:55:49 drh Exp $
    18     18   */
    19     19   #include "sqliteInt.h"
    20     20   #include "os.h"
    21     21   #include <ctype.h>
    22     22   
    23     23   /*
    24     24   ** This is the callback routine for the code that initializes the
................................................................................
   463    463   ** Close an existing SQLite database
   464    464   */
   465    465   void sqlite_close(sqlite *db){
   466    466     HashElem *i;
   467    467     if( sqliteSafetyCheck(db) || sqliteSafetyOn(db) ){ return; }
   468    468     db->magic = SQLITE_MAGIC_CLOSED;
   469    469     sqliteBtreeClose(db->pBe);
          470  +  sqliteRollbackInternalChanges(db);
   470    471     clearHashTable(db, 0);
   471    472     if( db->pBeTemp ){
   472    473       sqliteBtreeClose(db->pBeTemp);
   473    474     }
   474    475     for(i=sqliteHashFirst(&db->aFunc); i; i=sqliteHashNext(i)){
   475    476       FuncDef *pFunc, *pNext;
   476    477       for(pFunc = (FuncDef*)sqliteHashData(i); pFunc; pFunc=pNext){