mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-11 01:42:22 +03:00
Enforce SQLITE_VTABRISK restrictions.
FossilOrigin-Name: 3d87ff312e617a26846d482b423163cad9c222513f33e128f0fe348dda27c7c9
This commit is contained in:
10
src/select.c
10
src/select.c
@@ -4964,7 +4964,15 @@ static int selectExpander(Walker *pWalker, Select *p){
|
||||
assert( pFrom->pSelect==0 );
|
||||
if( pTab->pSelect && (db->flags & SQLITE_EnableView)==0 ){
|
||||
sqlite3ErrorMsg(pParse, "access to view \"%s\" prohibited",
|
||||
pTab->zName);
|
||||
pTab->zName);
|
||||
}
|
||||
if( IsVirtual(pTab)
|
||||
&& pFrom->fg.fromDDL
|
||||
&& ALWAYS(pTab->pVTable!=0)
|
||||
&& pTab->pVTable->eVtabRisk > ((db->flags & SQLITE_TrustedSchema)!=0)
|
||||
){
|
||||
sqlite3ErrorMsg(pParse, "cannot access \"%s\" from within a trigger"
|
||||
" or view", pTab->zName);
|
||||
}
|
||||
pFrom->pSelect = sqlite3SelectDup(db, pTab->pSelect, 0);
|
||||
nCol = pTab->nCol;
|
||||
|
||||
Reference in New Issue
Block a user