1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-12-24 14:17:58 +03:00

Add a NEVER() to an unreachable branch in the new indexed-subtype logic.

Mark the pi() function as deterministic.

FossilOrigin-Name: 50be8f5091b2202b67a80f826feee2c378f001745ad5acb7c4374423bbf6ff22
This commit is contained in:
drh
2024-10-07 21:04:57 +00:00
parent f7f78a624d
commit ddc764b274
4 changed files with 10 additions and 10 deletions

View File

@@ -4582,7 +4582,7 @@ static int exprNodeCanReturnSubtype(Walker *pWalker, Expr *pExpr){
db = pWalker->pParse->db;
n = pExpr->x.pList ? pExpr->x.pList->nExpr : 0;
pDef = sqlite3FindFunction(db, pExpr->u.zToken, n, ENC(db), 0);
if( pDef==0 || (pDef->funcFlags & SQLITE_RESULT_SUBTYPE)!=0 ){
if( NEVER(pDef==0) || (pDef->funcFlags & SQLITE_RESULT_SUBTYPE)!=0 ){
pWalker->eCode = 1;
return WRC_Prune;
}

View File

@@ -2813,7 +2813,7 @@ void sqlite3RegisterBuiltinFunctions(void){
MFUNCTION(sqrt, 1, sqrt, math1Func ),
MFUNCTION(radians, 1, degToRad, math1Func ),
MFUNCTION(degrees, 1, radToDeg, math1Func ),
FUNCTION(pi, 0, 0, 0, piFunc ),
MFUNCTION(pi, 0, 0, piFunc ),
#endif /* SQLITE_ENABLE_MATH_FUNCTIONS */
FUNCTION(sign, 1, 0, 0, signFunc ),
INLINE_FUNC(coalesce, -1, INLINEFUNC_coalesce, 0 ),