1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Do not invoke the xRollbackTo or xRelease methods of a virtual table without

having first invoked an appropriate xSavepoint method.  Add assert() statements
to FTS3/4 to verify that this is happening in all cases.

FossilOrigin-Name: 651ef24249d8c22c4f13e4c0bb98a60099cfd23a
This commit is contained in:
drh
2011-05-24 15:36:01 +00:00
parent a24bc9ced3
commit e485522462
6 changed files with 76 additions and 17 deletions

View File

@@ -873,12 +873,14 @@ int sqlite3VtabSavepoint(sqlite3 *db, int op, int iSavepoint){
if( db->aVTrans ){
int i;
for(i=0; rc==SQLITE_OK && i<db->nVTrans; i++){
const sqlite3_module *pMod = db->aVTrans[i]->pMod->pModule;
if( pMod->iVersion>=2 ){
VTable *pVTab = db->aVTrans[i];
const sqlite3_module *pMod = pVTab->pMod->pModule;
if( pMod->iVersion>=2 && (pVTab->bInSavepoint || op==SAVEPOINT_BEGIN) ){
int (*xMethod)(sqlite3_vtab *, int);
switch( op ){
case SAVEPOINT_BEGIN:
xMethod = pMod->xSavepoint;
pVTab->bInSavepoint = 1;
break;
case SAVEPOINT_ROLLBACK:
xMethod = pMod->xRollbackTo;