diff options
author | drh <> | 2023-06-20 17:45:19 +0000 |
---|---|---|
committer | drh <> | 2023-06-20 17:45:19 +0000 |
commit | 40ee72947e39f54e9acc4d6ad7f024b87509652b (patch) | |
tree | 606f3d9d2e7fc7334e38b96a5cd59f115057efe0 /src/insert.c | |
parent | c439b9e0c6f5551abc1c8fb82368e4b9f0d3836f (diff) | |
download | sqlite-40ee72947e39f54e9acc4d6ad7f024b87509652b.tar.gz sqlite-40ee72947e39f54e9acc4d6ad7f024b87509652b.zip |
Omit unnecessary calls to table locking routines in the common case when
there is no shared cache.
FossilOrigin-Name: f94f3021cde1d46373ee8fc8e5028d7507a937240c59cf0d0d19ab22acbd3c41
Diffstat (limited to 'src/insert.c')
-rw-r--r-- | src/insert.c | 8 |
1 files changed, 5 insertions, 3 deletions
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; |