aboutsummaryrefslogtreecommitdiff
path: root/src/resolve.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2016-08-04 12:35:17 +0000
committerdrh <drh@noemail.net>2016-08-04 12:35:17 +0000
commitcc15313cc9a8b6713dc9f995ccc4d4c088da55d7 (patch)
tree740036f8cd1111a679a63acbe69eb41dc87537e4 /src/resolve.c
parentdd545d3bf219c13f839cfb21d0bc122c3b431d2b (diff)
downloadsqlite-cc15313cc9a8b6713dc9f995ccc4d4c088da55d7.tar.gz
sqlite-cc15313cc9a8b6713dc9f995ccc4d4c088da55d7.zip
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
Diffstat (limited to 'src/resolve.c')
-rw-r--r--src/resolve.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/resolve.c b/src/resolve.c
index 77ce37f6d..8ae7f0919 100644
--- a/src/resolve.c
+++ b/src/resolve.c
@@ -718,7 +718,11 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
sqlite3ErrorMsg(pParse, "misuse of aggregate function %.*s()", nId,zId);
pNC->nErr++;
is_agg = 0;
- }else if( no_such_func && pParse->db->init.busy==0 ){
+ }else if( no_such_func && pParse->db->init.busy==0
+#ifdef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
+ && pParse->explain==0
+#endif
+ ){
sqlite3ErrorMsg(pParse, "no such function: %.*s", nId, zId);
pNC->nErr++;
}else if( wrong_num_args ){