Skip to content

Commit

Permalink
Fix an assertion fault that can only occur if SQLITE_ENABLE_STAT2 is …
Browse files Browse the repository at this point in the history
…defined

and the constant folding optimization is disabled using sqlite3_test_control().
Problem introduced by [ad8bc68197f2b4] but we missed it prior to the 3.7.4
release due to taking shortcuts and skipping tests in the release checklist.
  • Loading branch information
Unknown committed Dec 16, 2010
1 parent ece1788 commit 149dc3e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/where.c
Expand Up @@ -2315,10 +2315,9 @@ static int valueFromExpr(
u8 aff,
sqlite3_value **pp
){
/* The evalConstExpr() function will have already converted any TK_VARIABLE
** expression involved in an comparison into a TK_REGISTER. */
assert( pExpr->op!=TK_VARIABLE );
if( pExpr->op==TK_REGISTER && pExpr->op2==TK_VARIABLE ){
if( pExpr->op==TK_VARIABLE
|| (pExpr->op==TK_REGISTER && pExpr->op2==TK_VARIABLE)
){
int iVar = pExpr->iColumn;
sqlite3VdbeSetVarmask(pParse->pVdbe, iVar); /* IMP: R-23257-02778 */
*pp = sqlite3VdbeGetValue(pParse->pReprepare, iVar, aff);
Expand Down

0 comments on commit 149dc3e

Please sign in to comment.