1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Fix a subtle problem that can occur when a transaction is automatically rolled back, and afterwards a VM that had opened a statement transaction within the abandoned transaction is finalized. Fixes an assert() that was failing in rtree3.test. (CVS 6903)

FossilOrigin-Name: 910df46e0f570cbffa9ff9b50d75632c091838b6
This commit is contained in:
danielk1977
2009-07-17 17:25:43 +00:00
parent 33c54a989e
commit e494817534
3 changed files with 14 additions and 9 deletions

View File

@@ -14,7 +14,7 @@
** to version 2.8.7, all this code was combined into the vdbe.c source file.
** But that file was getting too big so this subroutines were split out.
**
** $Id: vdbeaux.c,v 1.475 2009/07/15 16:30:50 drh Exp $
** $Id: vdbeaux.c,v 1.476 2009/07/17 17:25:43 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "vdbeInt.h"
@@ -1614,7 +1614,12 @@ int sqlite3VdbeCloseStatement(Vdbe *p, int eOp){
sqlite3 *const db = p->db;
int rc = SQLITE_OK;
if( p->iStatement ){
/* If p->iStatement is greater than zero, then this Vdbe opened a
** statement transaction that should be closed here. The only exception
** is that an IO error may have occured, causing an emergency rollback.
** In this case (db->nStatement==0), and there is nothing to do.
*/
if( db->nStatement && p->iStatement ){
int i;
const int iSavepoint = p->iStatement-1;