mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-10 01:02:56 +03:00
Provide the SQLITE_DIRECTONLY flag for app-defined functions that prohibits
the use of those functions within triggers or views. FossilOrigin-Name: fc745845d8d76adc165575e2192f4176e3c28e614c72571d56f4011560499fe1
This commit is contained in:
@@ -823,6 +823,15 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
|
||||
** SQL is being compiled using sqlite3NestedParse() */
|
||||
no_such_func = 1;
|
||||
pDef = 0;
|
||||
}else
|
||||
if( (pDef->funcFlags & SQLITE_FUNC_DIRECT)!=0
|
||||
&& ExprHasProperty(pExpr, EP_Indirect)
|
||||
&& !IN_RENAME_OBJECT
|
||||
){
|
||||
/* Functions tagged with SQLITE_DIRECTONLY may not be used
|
||||
** inside of triggers and views */
|
||||
sqlite3ErrorMsg(pParse, "%s() prohibited in triggers and views",
|
||||
pDef->zName);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user