1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-16 23:02:26 +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:
drh
2008-04-28 18:46:43 +00:00
parent 952856ad3a
commit 4f3dd1502e
9 changed files with 53 additions and 28 deletions

View File

@@ -22,7 +22,7 @@
** COMMIT
** ROLLBACK
**
** $Id: build.c,v 1.482 2008/04/27 18:40:12 drh Exp $
** $Id: build.c,v 1.483 2008/04/28 18:46:43 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -159,7 +159,7 @@ void sqlite3FinishCoding(Parse *pParse){
*/
if( pParse->cookieGoto>0 ){
u32 mask;
int iDb;
int iDb, i;
sqlite3VdbeJumpHere(v, pParse->cookieGoto-1);
for(iDb=0, mask=1; iDb<db->nDb; mask<<=1, iDb++){
if( (mask & pParse->cookieMask)==0 ) continue;
@@ -168,10 +168,11 @@ void sqlite3FinishCoding(Parse *pParse){
sqlite3VdbeAddOp2(v,OP_VerifyCookie, iDb, pParse->cookieValue[iDb]);
}
#ifndef SQLITE_OMIT_VIRTUALTABLE
if( pParse->pVirtualLock ){
char *vtab = (char *)pParse->pVirtualLock->pVtab;
for(i=0; i<pParse->nVtabLock; i++){
char *vtab = (char *)pParse->apVtabLock[i]->pVtab;
sqlite3VdbeAddOp4(v, OP_VBegin, 0, 0, 0, vtab, P4_VTAB);
}
pParse->nVtabLock = 0;
#endif
/* Once all the cookies have been verified and transactions opened,