diff options
author | drh <> | 2023-11-08 18:08:07 +0000 |
---|---|---|
committer | drh <> | 2023-11-08 18:08:07 +0000 |
commit | 2cbe14098b156838153f194df1ea41d9b390935b (patch) | |
tree | 90b6beaeacd908187e8a072d00e1fb5b16018025 /src | |
parent | b494366370f5f9698e574150c5a4309d7c3dc78b (diff) | |
download | sqlite-2cbe14098b156838153f194df1ea41d9b390935b.tar.gz sqlite-2cbe14098b156838153f194df1ea41d9b390935b.zip |
Do not cover expressions using an indexed expression if the indexed expression
is a function that might set a subtype.
FossilOrigin-Name: e908b26a990929996b3c16f0429e8313cd8fcefe7c883c77f66ea69f4059d6e2
Diffstat (limited to 'src')
-rw-r--r-- | src/where.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/where.c b/src/where.c index 05ae24f7b..cfee45f87 100644 --- a/src/where.c +++ b/src/where.c @@ -5810,6 +5810,17 @@ static SQLITE_NOINLINE void whereAddIndexedExpr( continue; } if( sqlite3ExprIsConstant(pExpr) ) continue; + if( pExpr->op==TK_FUNCTION ){ + int n; + FuncDef *pDef; + sqlite3 *db = pParse->db; + assert( ExprUseXList(pExpr) ); + n = pExpr->x.pList ? pExpr->x.pList->nExpr : 0; + pDef = sqlite3FindFunction(db, pExpr->u.zToken, n, ENC(db), 0); + if( NEVER(pDef==0) || (pDef->funcFlags & SQLITE_FUNC_SUBTYPE)!=0 ){ + continue; + } + } p = sqlite3DbMallocRaw(pParse->db, sizeof(IndexedExpr)); if( p==0 ) break; p->pIENext = pParse->pIdxEpr; |