SQLite

Check-in [8cb8516d20]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Avoid generating OP_TableLock unnecessary instructions on btrees that are not sharable.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 8cb8516d2009d52d35a22263e4c892f162b34b81
User & Date: drh 2016-11-08 17:19:22.006
References
2017-01-09
06:53
Disable the optimization from [8cb8516d] (omit TableLock instructions for non-sharable databases) on this branch. This branch uses the TableLock instructions to ensure that the db schema is not written from within a BEGIN CONCURRENT transaction. (check-in: c8ca3e0a8d user: dan tags: begin-concurrent)
Context
2016-11-08
19:22
Avoid superfluous cursor seeks in "INSERT OR REPLACE" statements. (check-in: bec5b6d4d0 user: dan tags: trunk)
17:19
Avoid generating OP_TableLock unnecessary instructions on btrees that are not sharable. (check-in: 8cb8516d20 user: drh tags: trunk)
16:27
Fix the speedtest1.c test program so that it gives closing "%" wildcards on LIKE searches. (check-in: c2f84f637f user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/build.c.
55
56
57
58
59
60
61


62
63
64
65
66
67
68
){
  Parse *pToplevel = sqlite3ParseToplevel(pParse);
  int i;
  int nBytes;
  TableLock *p;
  assert( iDb>=0 );



  for(i=0; i<pToplevel->nTableLock; i++){
    p = &pToplevel->aTableLock[i];
    if( p->iDb==iDb && p->iTab==iTab ){
      p->isWriteLock = (p->isWriteLock || isWriteLock);
      return;
    }
  }







>
>







55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
){
  Parse *pToplevel = sqlite3ParseToplevel(pParse);
  int i;
  int nBytes;
  TableLock *p;
  assert( iDb>=0 );

  if( iDb==1 ) return;
  if( !sqlite3BtreeSharable(pParse->db->aDb[iDb].pBt) ) return;
  for(i=0; i<pToplevel->nTableLock; i++){
    p = &pToplevel->aTableLock[i];
    if( p->iDb==iDb && p->iTab==iTab ){
      p->isWriteLock = (p->isWriteLock || isWriteLock);
      return;
    }
  }