/ Check-in [12be361a]
Login

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

Overview
Comment:Add an ALWAYS() around a branch in sqlite3BtreeSkipNext() that we believe must always be true.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 12be361a532df0c22a7e4d97658b82a69b1a205d4cca8d092b9e6b7790c1ee40
User & Date: drh 2018-07-09 20:41:39
Context
2018-07-09
20:58
Add a comment to restriction (6) of the push-down optimization. No changes to code. check-in: 0c8a2f25 user: drh tags: trunk
20:41
Add an ALWAYS() around a branch in sqlite3BtreeSkipNext() that we believe must always be true. check-in: 12be361a user: drh tags: trunk
18:55
Avoid leaving view-definitions with an incomplete set of column names/types in the in-memory schema if an OOM strikes while allocating the same. check-in: 1ddbb537 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/btree.c.

  5192   5192   /*
  5193   5193   ** This function is a no-op if cursor pCur does not point to a valid row.
  5194   5194   ** Otherwise, if pCur is valid, configure it so that the next call to
  5195   5195   ** sqlite3BtreeNext() is a no-op.
  5196   5196   */
  5197   5197   #ifndef SQLITE_OMIT_WINDOWFUNC
  5198   5198   void sqlite3BtreeSkipNext(BtCursor *pCur){
  5199         -  if( pCur->eState==CURSOR_VALID ){
         5199  +  /* We believe that the cursor must always be in the valid state when
         5200  +  ** this routine is called, but the proof is difficult, so we add an
         5201  +  ** ALWaYS() test just in case we are wrong. */
         5202  +  if( ALWAYS(pCur->eState==CURSOR_VALID) ){
  5200   5203       pCur->eState = CURSOR_SKIPNEXT;
  5201   5204       pCur->skipNext = 1;
  5202   5205     }
  5203   5206   }
  5204   5207   #endif /* SQLITE_OMIT_WINDOWFUNC */
  5205   5208   
  5206   5209   /* Move the cursor to the last entry in the table.  Return SQLITE_OK