diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/build.c | 6 | ||||
-rw-r--r-- | src/insert.c | 8 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/build.c b/src/build.c index 51a26326e..fe3a781d6 100644 --- a/src/build.c +++ b/src/build.c @@ -234,15 +234,17 @@ void sqlite3FinishCoding(Parse *pParse){ pParse->nVtabLock = 0; #endif +#ifndef SQLITE_OMIT_SHARED_CACHE /* Once all the cookies have been verified and transactions opened, ** obtain the required table-locks. This is a no-op unless the ** shared-cache feature is enabled. */ - codeTableLocks(pParse); + if( pParse->nTableLock ) codeTableLocks(pParse); +#endif /* Initialize any AUTOINCREMENT data structures required. */ - sqlite3AutoincrementBegin(pParse); + if( pParse->pAinc ) sqlite3AutoincrementBegin(pParse); /* Code constant expressions that where factored out of inner loops. ** diff --git a/src/insert.c b/src/insert.c index 58840bf4c..1c31ca233 100644 --- a/src/insert.c +++ b/src/insert.c @@ -35,8 +35,10 @@ void sqlite3OpenTable( assert( pParse->pVdbe!=0 ); v = pParse->pVdbe; assert( opcode==OP_OpenWrite || opcode==OP_OpenRead ); - sqlite3TableLock(pParse, iDb, pTab->tnum, - (opcode==OP_OpenWrite)?1:0, pTab->zName); + if( !pParse->db->noSharedCache ){ + sqlite3TableLock(pParse, iDb, pTab->tnum, + (opcode==OP_OpenWrite)?1:0, pTab->zName); + } if( HasRowid(pTab) ){ sqlite3VdbeAddOp4Int(v, opcode, iCur, pTab->tnum, iDb, pTab->nNVCol); VdbeComment((v, "%s", pTab->zName)); @@ -2675,7 +2677,7 @@ int sqlite3OpenTableAndIndices( *piDataCur = iDataCur; if( HasRowid(pTab) && (aToOpen==0 || aToOpen[0]) ){ sqlite3OpenTable(pParse, iDataCur, iDb, pTab, op); - }else{ + }else if( pParse->db->noSharedCache==0 ){ sqlite3TableLock(pParse, iDb, pTab->tnum, op==OP_OpenWrite, pTab->zName); } *piIdxCur = iBase; |