/ Check-in [ebe4845c]
Login

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

Overview
Comment:Ensure that the sqlite3BtreeLast() interface initializes the *pRes return to zero if the cursor is already sitting on the last entry of the table. Manuel Rigger found the obscure test case for which this makes a difference.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: ebe4845cd0ffb96b30be3c69eb399d58e93149886bc2fa60a7ebd7b4fbe447a4
User & Date: drh 2019-05-08 23:55:04
Original Comment: Ensure that the sqlite3BtreeLast() interface initializes the *pRes return to zero if the cursor is already sitting on the last entry of the table.
Context
2019-05-09
11:19
Fix a problem in the new code introduced by [658b84d7] causing corruption and other errors to be ignored. check-in: 7ccf2e7d user: dan tags: trunk
11:18
Improved error handling for the ".open --hexdb" command of the CLI. check-in: 4fa831d5 user: drh tags: trunk
2019-05-08
23:55
Ensure that the sqlite3BtreeLast() interface initializes the *pRes return to zero if the cursor is already sitting on the last entry of the table. Manuel Rigger found the obscure test case for which this makes a difference. check-in: ebe4845c user: drh tags: trunk
23:53
This is part of the previous check-in that didn't get committed for some reason - probably because I failed to press the "Save" button on the text editor. check-in: 51d32173 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/btree.c.

  5290   5290       int ii;
  5291   5291       for(ii=0; ii<pCur->iPage; ii++){
  5292   5292         assert( pCur->aiIdx[ii]==pCur->apPage[ii]->nCell );
  5293   5293       }
  5294   5294       assert( pCur->ix==pCur->pPage->nCell-1 );
  5295   5295       assert( pCur->pPage->leaf );
  5296   5296   #endif
         5297  +    *pRes = 0;
  5297   5298       return SQLITE_OK;
  5298   5299     }
  5299   5300   
  5300   5301     rc = moveToRoot(pCur);
  5301   5302     if( rc==SQLITE_OK ){
  5302   5303       assert( pCur->eState==CURSOR_VALID );
  5303   5304       *pRes = 0;