SQLite

Check-in [1ca707a4fb]
Login

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

Overview
Comment:Fix a bug in the deterministic date/time function logic that can only appear with STAT3 or STAT4.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 1ca707a4fb8db7aa85430413164265607ce727fc8a5afc3424b3abfb59921b39
User & Date: drh 2017-07-25 01:34:05.482
Context
2017-07-26
10:04
Fix a comment on the UnpackedRecord.r1 and UnpackedRecord.r2 fields. No changes to code. (check-in: 622b108915 user: drh tags: trunk)
2017-07-25
15:12
Release candidate 2 for 3.20.0. (check-in: f39cb76b33 user: drh tags: branch-3.20)
01:34
Fix a bug in the deterministic date/time function logic that can only appear with STAT3 or STAT4. (check-in: 1ca707a4fb user: drh tags: trunk)
2017-07-24
20:01
Do not attempt to run test file unionvtabfault.test with SQLITE_OMIT_VIRTUAL_TABLE builds. (check-in: 1a632a9a6c user: dan tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/vdbeaux.c.
4589
4590
4591
4592
4593
4594
4595



4596
4597
4598
4599
4600
4601
4602
**
** OP_PureFunc means that the function must be deterministic, and should
** throw an error if it is given inputs that would make it non-deterministic.
** This routine is invoked by date/time functions that use non-deterministic
** features such as 'now'.
*/
int sqlite3NotPureFunc(sqlite3_context *pCtx){



  if( pCtx->pVdbe->aOp[pCtx->iOp].opcode==OP_PureFunc ){
    sqlite3_result_error(pCtx, 
       "non-deterministic function in index expression or CHECK constraint",
       -1);
    return 0;
  }
  return 1;







>
>
>







4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
**
** OP_PureFunc means that the function must be deterministic, and should
** throw an error if it is given inputs that would make it non-deterministic.
** This routine is invoked by date/time functions that use non-deterministic
** features such as 'now'.
*/
int sqlite3NotPureFunc(sqlite3_context *pCtx){
#ifdef SQLITE_ENABLE_STAT3_OR_STAT4
  if( pCtx->pVdbe==0 ) return 1;
#endif
  if( pCtx->pVdbe->aOp[pCtx->iOp].opcode==OP_PureFunc ){
    sqlite3_result_error(pCtx, 
       "non-deterministic function in index expression or CHECK constraint",
       -1);
    return 0;
  }
  return 1;