1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-19 21:43:15 +03:00

Make sure BEGIN, COMMIT, and ROLLBACK are really no-ops when preceded

by EXPLAIN.  Ticket #626. (CVS 1267)

FossilOrigin-Name: 2af1f065b5eb39fd3ecac00f8a66d1b4186aead5
This commit is contained in:
drh
2004-02-24 01:04:11 +00:00
parent 701a0aebe2
commit 02f75f19e5
4 changed files with 39 additions and 17 deletions

View File

@@ -23,7 +23,7 @@
** ROLLBACK
** PRAGMA
**
** $Id: build.c,v 1.174 2004/02/22 20:05:01 drh Exp $
** $Id: build.c,v 1.175 2004/02/24 01:04:12 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -2028,8 +2028,10 @@ void sqliteBeginTransaction(Parse *pParse, int onError){
return;
}
sqliteBeginWriteOperation(pParse, 0, 0);
db->flags |= SQLITE_InTrans;
db->onError = onError;
if( !pParse->explain ){
db->flags |= SQLITE_InTrans;
db->onError = onError;
}
}
/*
@@ -2045,9 +2047,13 @@ void sqliteCommitTransaction(Parse *pParse){
sqliteErrorMsg(pParse, "cannot commit - no transaction is active");
return;
}
db->flags &= ~SQLITE_InTrans;
if( !pParse->explain ){
db->flags &= ~SQLITE_InTrans;
}
sqliteEndWriteOperation(pParse);
db->onError = OE_Default;
if( !pParse->explain ){
db->onError = OE_Default;
}
}
/*
@@ -2068,8 +2074,10 @@ void sqliteRollbackTransaction(Parse *pParse){
if( v ){
sqliteVdbeAddOp(v, OP_Rollback, 0, 0);
}
db->flags &= ~SQLITE_InTrans;
db->onError = OE_Default;
if( !pParse->explain ){
db->flags &= ~SQLITE_InTrans;
db->onError = OE_Default;
}
}
/*