SQLite

Check-in [12be361a53]
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
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 12be361a532df0c22a7e4d97658b82a69b1a205d4cca8d092b9e6b7790c1ee40
User & Date: drh 2018-07-09 20:41:39.352
Context
2018-07-09
20:58
Add a comment to restriction (6) of the push-down optimization. No changes to code. (check-in: 0c8a2f257f user: drh tags: trunk)
20:41
Add an ALWAYS() around a branch in sqlite3BtreeSkipNext() that we believe must always be true. (check-in: 12be361a53 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: 1ddbb5372e user: dan tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/btree.c.
5192
5193
5194
5195
5196
5197
5198



5199
5200
5201
5202
5203
5204
5205
5206
/*
** This function is a no-op if cursor pCur does not point to a valid row.
** Otherwise, if pCur is valid, configure it so that the next call to
** sqlite3BtreeNext() is a no-op.
*/
#ifndef SQLITE_OMIT_WINDOWFUNC
void sqlite3BtreeSkipNext(BtCursor *pCur){



  if( pCur->eState==CURSOR_VALID ){
    pCur->eState = CURSOR_SKIPNEXT;
    pCur->skipNext = 1;
  }
}
#endif /* SQLITE_OMIT_WINDOWFUNC */

/* Move the cursor to the last entry in the table.  Return SQLITE_OK







>
>
>
|







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

/* Move the cursor to the last entry in the table.  Return SQLITE_OK