aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <>2021-05-17 11:19:32 +0000
committerdrh <>2021-05-17 11:19:32 +0000
commit9430506df07923d22a4bd03973ff5671e76dfed4 (patch)
tree103fd3937b15b330bc09bf6d75b97a18a4a72dcd /src
parent2454e4a901c7221603cc43e41a47e5becb8b2309 (diff)
downloadsqlite-9430506df07923d22a4bd03973ff5671e76dfed4.tar.gz
sqlite-9430506df07923d22a4bd03973ff5671e76dfed4.zip
Performance improvement in sqlite3TableLock().
FossilOrigin-Name: 0d77e371c47107f67550e9bedfd26808fcfd84c7473f94b6053f75f0e3463c73
Diffstat (limited to 'src')
-rw-r--r--src/build.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/build.c b/src/build.c
index 6339a9784..25954b4d4 100644
--- a/src/build.c
+++ b/src/build.c
@@ -46,7 +46,7 @@ struct TableLock {
** code to make the lock occur is generated by a later call to
** codeTableLocks() which occurs during sqlite3FinishCoding().
*/
-void sqlite3TableLock(
+static SQLITE_NOINLINE void lockTable(
Parse *pParse, /* Parsing context */
int iDb, /* Index of the database containing the table to lock */
Pgno iTab, /* Root page number of the table to be locked */
@@ -59,8 +59,6 @@ void sqlite3TableLock(
TableLock *p;
assert( iDb>=0 );
- if( iDb==1 ) return;
- if( !sqlite3BtreeSharable(pParse->db->aDb[iDb].pBt) ) return;
pToplevel = sqlite3ParseToplevel(pParse);
for(i=0; i<pToplevel->nTableLock; i++){
p = &pToplevel->aTableLock[i];
@@ -84,6 +82,17 @@ void sqlite3TableLock(
sqlite3OomFault(pToplevel->db);
}
}
+void sqlite3TableLock(
+ Parse *pParse, /* Parsing context */
+ int iDb, /* Index of the database containing the table to lock */
+ Pgno iTab, /* Root page number of the table to be locked */
+ u8 isWriteLock, /* True for a write lock */
+ const char *zName /* Name of the table to be locked */
+){
+ if( iDb==1 ) return;
+ if( !sqlite3BtreeSharable(pParse->db->aDb[iDb].pBt) ) return;
+ lockTable(pParse, iDb, iTab, isWriteLock, zName);
+}
/*
** Code an OP_TableLock instruction for each table locked by the