Rollback any open write-transaction when a shared-cache connection is closed. (CVS 2947)

FossilOrigin-Name: 1944d92b530d3bbcd31561063660de03d668af23
This commit is contained in:
danielk1977
2006-01-15 11:39:18 +00:00
parent 3832230e25
commit b597f74af5
5 changed files with 101 additions and 17 deletions
+3 -1
View File
@@ -9,7 +9,7 @@
** May you share freely, never taking more than you give.
**
*************************************************************************
** $Id: btree.c,v 1.297 2006/01/13 11:22:07 danielk1977 Exp $
** $Id: btree.c,v 1.298 2006/01/15 11:39:18 danielk1977 Exp $
**
** This file implements a external (disk-based) database using BTrees.
** For a detailed discussion of BTrees, refer to
@@ -1697,6 +1697,8 @@ int sqlite3BtreeClose(Btree *p){
}
}
/* Rollback any active transaction and free the handle structure */
sqlite3BtreeRollback(p);
sqliteFree(p);
#ifndef SQLITE_OMIT_SHARED_CACHE
+5 -5
View File
@@ -14,7 +14,7 @@
** This file contains functions for allocating memory, comparing
** strings, and stuff like that.
**
** $Id: util.c,v 1.170 2006/01/13 06:33:24 danielk1977 Exp $
** $Id: util.c,v 1.171 2006/01/15 11:39:18 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@@ -1355,8 +1355,8 @@ void sqlite3MallocClearFailed(){
** cause an assert to fail if sqliteMalloc() or sqliteRealloc() is called.
*/
void sqlite3MallocDisallow(){
assert(!sqlite3ThreadData()->mallocDisallowed);
sqlite3ThreadData()->mallocDisallowed = 1;
assert( sqlite3ThreadData()->mallocDisallowed>=0 );
sqlite3ThreadData()->mallocDisallowed++;
}
/*
@@ -1364,7 +1364,7 @@ void sqlite3MallocDisallow(){
** by sqlite3MallocDisallow().
*/
void sqlite3MallocAllow(){
assert(sqlite3ThreadData()->mallocDisallowed);
sqlite3ThreadData()->mallocDisallowed = 0;
assert( sqlite3ThreadData()->mallocDisallowed>0 );
sqlite3ThreadData()->mallocDisallowed--;
}
#endif