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

Invert the SQLITE_FUNC_SAFE bit to be SQLITE_FUNC_UNSAFE. The external

bit is still SQLITE_INNOCUOUS.  It gets inverted as the appdef function
is registered.

FossilOrigin-Name: 1c266cb3be46d26e640752a99979acb1a1809361ba70ca3fca981c42383c360e
This commit is contained in:
drh
2020-01-03 21:57:53 +00:00
parent c4ad849921
commit 4be621e1ba
5 changed files with 28 additions and 27 deletions

View File

@@ -886,8 +886,7 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
no_such_func = 1;
pDef = 0;
}else
if( (pDef->funcFlags & (SQLITE_FUNC_DIRECT|SQLITE_FUNC_SAFE))
!= SQLITE_FUNC_SAFE
if( (pDef->funcFlags & (SQLITE_FUNC_DIRECT|SQLITE_FUNC_UNSAFE))!=0
&& ExprHasProperty(pExpr, EP_Indirect)
&& !IN_RENAME_OBJECT
){
@@ -896,7 +895,8 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
){
/* Functions prohibited in triggers and views if:
** (1) tagged with SQLITE_DIRECTONLY
** (2) not tagged with SQLITE_INNOCUOUS and
** (2) not tagged with SQLITE_INNOCUOUS (which means it
** is tagged with SQLITE_FUNC_UNSAFE) and
** SQLITE_DBCONFIG_UNSAFE_IN_VIEW is off
*/
sqlite3ErrorMsg(pParse, "%s() prohibited in triggers and views",