mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Make sure that transactions are started on all virtual tables that
changes in a single statement, not just the first. Ticket #3083. Need to add test cases. (CVS 5063) FossilOrigin-Name: 133b7ee50ea6012739ebe0e334374c5d9b1fcc7f
This commit is contained in:
21
src/vtab.c
21
src/vtab.c
@@ -11,7 +11,7 @@
|
||||
*************************************************************************
|
||||
** This file contains code used to help implement virtual tables.
|
||||
**
|
||||
** $Id: vtab.c,v 1.67 2008/04/27 18:40:12 drh Exp $
|
||||
** $Id: vtab.c,v 1.68 2008/04/28 18:46:43 drh Exp $
|
||||
*/
|
||||
#ifndef SQLITE_OMIT_VIRTUALTABLE
|
||||
#include "sqliteInt.h"
|
||||
@@ -802,4 +802,23 @@ FuncDef *sqlite3VtabOverloadFunction(
|
||||
return pNew;
|
||||
}
|
||||
|
||||
/*
|
||||
** Make sure virtual table pTab is contained in the pParse->apVirtualLock[]
|
||||
** array so that an OP_VBegin will get generated for it. Add pTab to the
|
||||
** array if it is missing. If pTab is already in the array, this routine
|
||||
** is a no-op.
|
||||
*/
|
||||
void sqlite3VtabMakeWritable(Parse *pParse, Table *pTab){
|
||||
int i, n;
|
||||
assert( IsVirtual(pTab) );
|
||||
for(i=0; i<pParse->nVtabLock; i++){
|
||||
if( pTab==pParse->apVtabLock[i] ) return;
|
||||
}
|
||||
n = (pParse->nVtabLock+1)*sizeof(pParse->apVtabLock[0]);
|
||||
pParse->apVtabLock = sqlite3_realloc(pParse->apVtabLock, n);
|
||||
if( pParse->apVtabLock ){
|
||||
pParse->apVtabLock[pParse->nVtabLock++] = pTab;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* SQLITE_OMIT_VIRTUALTABLE */
|
||||
|
Reference in New Issue
Block a user