mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-11 01:42:22 +03:00
Omit unnecessary calls to table locking routines in the common case when
there is no shared cache. FossilOrigin-Name: f94f3021cde1d46373ee8fc8e5028d7507a937240c59cf0d0d19ab22acbd3c41
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user