1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Fix a NEVER() in the iif() logic that can be true if compiled with

SQLITE_ENABLE_UNKNOWN_SQL_FUNCTIONS.  Problem introduced by [eb5ac9e5b9a4f9c8].

FossilOrigin-Name: 3ec2df5a6c731b59b0ab132ee59c74d107f9c4bd32cf47d9776887858b9c0dea
This commit is contained in:
drh
2024-11-29 11:49:05 +00:00
parent 2aac896611
commit 5c208f36a4
3 changed files with 12 additions and 8 deletions

View File

@@ -6478,7 +6478,11 @@ static int sqlite3ExprIsIIF(sqlite3 *db, const Expr *pExpr){
if( (z[0]!='i' && z[0]!='I') ) return 0;
if( pExpr->x.pList==0 ) return 0;
pDef = sqlite3FindFunction(db, z, pExpr->x.pList->nExpr, ENC(db), 0);
#ifdef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
if( pDef==0 ) return 0;
#else
if( NEVER(pDef==0) ) return 0;
#endif
if( (pDef->funcFlags & SQLITE_FUNC_INLINE)==0 ) return 0;
if( NEVER(SQLITE_PTR_TO_INT(pDef->pUserData)!=INLINEFUNC_iif) ) return 0;
}else if( pExpr->op==TK_CASE ){