mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
Add the experimental SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION compile-time option.
When enabled, the "unknown function" error is suppressed for EXPLAIN and a no-op function named "unknown()" is substituted. This facilitiates using the command-line shell to analyze queries from applications that contain many application-defined functions that are not normally available to the shell. FossilOrigin-Name: b7f30a9ff20d580fdaecdcf2b644d09ad6c2575e
This commit is contained in:
@@ -2943,6 +2943,11 @@ int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target){
|
||||
assert( !ExprHasProperty(pExpr, EP_IntValue) );
|
||||
zId = pExpr->u.zToken;
|
||||
pDef = sqlite3FindFunction(db, zId, nFarg, enc, 0);
|
||||
#ifdef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
|
||||
if( pDef==0 && pParse->explain ){
|
||||
pDef = sqlite3FindFunction(db, "unknown", nFarg, enc, 0);
|
||||
}
|
||||
#endif
|
||||
if( pDef==0 || pDef->xFinalize!=0 ){
|
||||
sqlite3ErrorMsg(pParse, "unknown function: %s()", zId);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user