SQLite

Check-in [a7e0e7a483]
Login

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

Overview
Comment:Adjust the bitvec related sqlite3_log messages added by [9527089b].
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | begin-concurrent
Files: files | file ages | folders
SHA3-256: a7e0e7a4835314a04e065839a7f88b074eda795da2b2da5741b2afc096421a32
User & Date: dan 2017-05-26 18:18:51.758
Context
2017-05-29
14:27
Enhance the log messages emitted when a page conflict is detected. (check-in: 92618492b0 user: dan tags: begin-concurrent)
2017-05-26
18:18
Adjust the bitvec related sqlite3_log messages added by [9527089b]. (check-in: a7e0e7a483 user: dan tags: begin-concurrent)
16:51
Add extra test cases for deferred page allocation. (check-in: 9df0195780 user: dan tags: begin-concurrent)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/bitvec.c.
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
** Otherwise the behavior is undefined.
*/
int sqlite3BitvecSet(Bitvec *p, u32 i){
  u32 h;
  if( p==0 ) return SQLITE_OK;
  assert( i>0 );
  assert( i<=p->iSize );
  if( i>p->iSize ){
    sqlite3_log(SQLITE_ERROR, 
        "Bitvec: setting bit %d of bitvec size %d\n", (int)i, (int)p->iSize
    );
  }
  i--;
  while((p->iSize > BITVEC_NBIT) && p->iDivisor) {
    u32 bin = i/p->iDivisor;







|







167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
** Otherwise the behavior is undefined.
*/
int sqlite3BitvecSet(Bitvec *p, u32 i){
  u32 h;
  if( p==0 ) return SQLITE_OK;
  assert( i>0 );
  assert( i<=p->iSize );
  if( i>p->iSize || i==0 ){
    sqlite3_log(SQLITE_ERROR, 
        "Bitvec: setting bit %d of bitvec size %d\n", (int)i, (int)p->iSize
    );
  }
  i--;
  while((p->iSize > BITVEC_NBIT) && p->iDivisor) {
    u32 bin = i/p->iDivisor;
Changes to src/pager.c.
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
  if( rc!=SQLITE_OK ){
    assert( !MEMDB );
    pager_unlock(pPager);
    assert( pPager->eState==PAGER_OPEN );
  }else{
    pPager->eState = PAGER_READER;
    pPager->hasHeldSharedLock = 1;
#ifndef SQLITE_OMIT_CONCURRENT
    if( pPager->pAllRead ){
      sqlite3_log(SQLITE_ERROR, 
          "Bitvec: pAllRead already allocated in PagerSharedLock()"
      );
    }
#endif
  }
  return rc;
}

/*
** If the reference count has reached zero, rollback any active
** transaction and unlock the pager.







<
<
<
<
<
<
<







5382
5383
5384
5385
5386
5387
5388







5389
5390
5391
5392
5393
5394
5395
  if( rc!=SQLITE_OK ){
    assert( !MEMDB );
    pager_unlock(pPager);
    assert( pPager->eState==PAGER_OPEN );
  }else{
    pPager->eState = PAGER_READER;
    pPager->hasHeldSharedLock = 1;







  }
  return rc;
}

/*
** If the reference count has reached zero, rollback any active
** transaction and unlock the pager.
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
      ** WAL mode sets Pager.eState to PAGER_WRITER_LOCKED or CACHEMOD
      ** when it has an open transaction, but never to DBMOD or FINISHED.
      ** This is because in those states the code to roll back savepoint 
      ** transactions may copy data from the sub-journal into the database 
      ** file as well as into the page cache. Which would be incorrect in 
      ** WAL mode.
      */
#ifndef SQLITE_OMIT_CONCURRENT
      if( pPager->pAllRead 
       && pPager->dbSize!=sqlite3BitvecSize(pPager->pAllRead) 
      ){
        sqlite3_log(SQLITE_ERROR, 
            "Bitvec: pAllRead size is %d, dbOrigSize set to %d", 
            (int)sqlite3BitvecSize(pPager->pAllRead), pPager->dbSize
        );
      }
#endif
      pPager->eState = PAGER_WRITER_LOCKED;
      pPager->dbHintSize = pPager->dbSize;
      pPager->dbFileSize = pPager->dbSize;
      pPager->dbOrigSize = pPager->dbSize;
      pPager->journalOff = 0;
    }








<
<
<
<
<
<
<
<
<
<







5880
5881
5882
5883
5884
5885
5886










5887
5888
5889
5890
5891
5892
5893
      ** WAL mode sets Pager.eState to PAGER_WRITER_LOCKED or CACHEMOD
      ** when it has an open transaction, but never to DBMOD or FINISHED.
      ** This is because in those states the code to roll back savepoint 
      ** transactions may copy data from the sub-journal into the database 
      ** file as well as into the page cache. Which would be incorrect in 
      ** WAL mode.
      */










      pPager->eState = PAGER_WRITER_LOCKED;
      pPager->dbHintSize = pPager->dbSize;
      pPager->dbFileSize = pPager->dbSize;
      pPager->dbOrigSize = pPager->dbSize;
      pPager->journalOff = 0;
    }