diff options
author | drh <drh@noemail.net> | 2008-04-28 18:46:43 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2008-04-28 18:46:43 +0000 |
commit | 4f3dd1502e052b7dd3f1581aec32f294710a84d9 (patch) | |
tree | e4eb1c0c94156658870aeb25f039f66cee405a34 /src/build.c | |
parent | 952856ad3a297443dfd175655f1988e275296ff5 (diff) | |
download | sqlite-4f3dd1502e052b7dd3f1581aec32f294710a84d9.tar.gz sqlite-4f3dd1502e052b7dd3f1581aec32f294710a84d9.zip |
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
Diffstat (limited to 'src/build.c')
-rw-r--r-- | src/build.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/build.c b/src/build.c index 770218f13..91f7057f1 100644 --- a/src/build.c +++ b/src/build.c @@ -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, |