/ 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 Unified Diffs Show Whitespace Changes Patch

Changes to src/main.c.

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
...
463
464
465
466
467
468
469

470
471
472
473
474
475
476
**
*************************************************************************
** Main file for the SQLite library.  The routines in this file
** implement the programmer interface to the library.  Routines in
** other files are for internal use by SQLite and should not be
** accessed by users of the library.
**
** $Id: main.c,v 1.81 2002/06/20 11:36:49 drh Exp $
*/
#include "sqliteInt.h"
#include "os.h"
#include <ctype.h>

/*
** This is the callback routine for the code that initializes the
................................................................................
** Close an existing SQLite database
*/
void sqlite_close(sqlite *db){
  HashElem *i;
  if( sqliteSafetyCheck(db) || sqliteSafetyOn(db) ){ return; }
  db->magic = SQLITE_MAGIC_CLOSED;
  sqliteBtreeClose(db->pBe);

  clearHashTable(db, 0);
  if( db->pBeTemp ){
    sqliteBtreeClose(db->pBeTemp);
  }
  for(i=sqliteHashFirst(&db->aFunc); i; i=sqliteHashNext(i)){
    FuncDef *pFunc, *pNext;
    for(pFunc = (FuncDef*)sqliteHashData(i); pFunc; pFunc=pNext){







|







 







>







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
...
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
**
*************************************************************************
** Main file for the SQLite library.  The routines in this file
** implement the programmer interface to the library.  Routines in
** other files are for internal use by SQLite and should not be
** accessed by users of the library.
**
** $Id: main.c,v 1.82 2002/06/21 11:55:49 drh Exp $
*/
#include "sqliteInt.h"
#include "os.h"
#include <ctype.h>

/*
** This is the callback routine for the code that initializes the
................................................................................
** Close an existing SQLite database
*/
void sqlite_close(sqlite *db){
  HashElem *i;
  if( sqliteSafetyCheck(db) || sqliteSafetyOn(db) ){ return; }
  db->magic = SQLITE_MAGIC_CLOSED;
  sqliteBtreeClose(db->pBe);
  sqliteRollbackInternalChanges(db);
  clearHashTable(db, 0);
  if( db->pBeTemp ){
    sqliteBtreeClose(db->pBeTemp);
  }
  for(i=sqliteHashFirst(&db->aFunc); i; i=sqliteHashNext(i)){
    FuncDef *pFunc, *pNext;
    for(pFunc = (FuncDef*)sqliteHashData(i); pFunc; pFunc=pNext){