mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-10 01:02:56 +03:00
Minor changes (mainly to assert() macros) to handle malloc failure in vtab operations. (CVS 3851)
FossilOrigin-Name: 175156d1fcaadab3b955597abb27f6b9043bbb5b
This commit is contained in:
13
src/main.c
13
src/main.c
@@ -14,7 +14,7 @@
|
||||
** other files are for internal use by SQLite and should not be
|
||||
** accessed by users of the library.
|
||||
**
|
||||
** $Id: main.c,v 1.369 2007/04/16 15:06:25 danielk1977 Exp $
|
||||
** $Id: main.c,v 1.370 2007/04/18 14:24:33 danielk1977 Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "os.h"
|
||||
@@ -129,6 +129,15 @@ int sqlite3_close(sqlite3 *db){
|
||||
|
||||
sqlite3ResetInternalSchema(db, 0);
|
||||
|
||||
/* If a transaction is open, the ResetInternalSchema() call above
|
||||
** will not have called the xDisconnect() method on any virtual
|
||||
** tables in the db->aVTrans[] array. The following sqlite3VtabRollback()
|
||||
** call will do so. We need to do this before the check for active
|
||||
** SQL statements below, as the v-table implementation may be storing
|
||||
** some prepared statements internally.
|
||||
*/
|
||||
sqlite3VtabRollback(db);
|
||||
|
||||
/* If there are any outstanding VMs, return SQLITE_BUSY. */
|
||||
if( db->pVdbe ){
|
||||
sqlite3Error(db, SQLITE_BUSY,
|
||||
@@ -150,8 +159,6 @@ int sqlite3_close(sqlite3 *db){
|
||||
return SQLITE_ERROR;
|
||||
}
|
||||
|
||||
sqlite3VtabRollback(db);
|
||||
|
||||
for(j=0; j<db->nDb; j++){
|
||||
struct Db *pDb = &db->aDb[j];
|
||||
if( pDb->pBt ){
|
||||
|
Reference in New Issue
Block a user