diff options
author | drh <drh@noemail.net> | 2003-04-25 17:52:11 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2003-04-25 17:52:11 +0000 |
commit | 85e2096fb60de90ff32830cf7b9a4689370d723e (patch) | |
tree | b92674526394998c76d05def3f9188c2c5aab8ef /src/delete.c | |
parent | 2e6d11bc07ca73239a49d25fd8313713f6eeb75e (diff) | |
download | sqlite-85e2096fb60de90ff32830cf7b9a4689370d723e.tar.gz sqlite-85e2096fb60de90ff32830cf7b9a4689370d723e.zip |
Report the correct authorization context in the authorization callback
when coding an INSTEAD OF trigger on an update or delete. (CVS 936)
FossilOrigin-Name: 67746833fc8de3afff80db413bd63a362bb28218
Diffstat (limited to 'src/delete.c')
-rw-r--r-- | src/delete.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/delete.c b/src/delete.c index 7d0003578..14c7a20e1 100644 --- a/src/delete.c +++ b/src/delete.c @@ -12,7 +12,7 @@ ** This file contains C code routines that are called by the parser ** to handle DELETE FROM statements. ** -** $Id: delete.c,v 1.54 2003/04/24 01:45:04 drh Exp $ +** $Id: delete.c,v 1.55 2003/04/25 17:52:11 drh Exp $ */ #include "sqliteInt.h" @@ -68,12 +68,14 @@ void sqliteDeleteFrom( int base; /* Index of the first available table cursor */ sqlite *db; /* Main database structure */ int isView; /* True if attempting to delete from a view */ + AuthContext sContext; /* Authorization context */ int row_triggers_exist = 0; /* True if any triggers exist */ int before_triggers; /* True if there are BEFORE triggers */ int after_triggers; /* True if there are AFTER triggers */ int oldIdx = -1; /* Cursor for the OLD table of AFTER triggers */ + sContext.pParse = 0; if( pParse->nErr || sqlite_malloc_failed ){ pTabList = 0; goto delete_from_cleanup; @@ -127,6 +129,12 @@ void sqliteDeleteFrom( } } + /* Start the view context + */ + if( isView ){ + sqliteAuthContextPush(pParse, &sContext, pTab->zName); + } + /* Begin generating code. */ v = sqliteGetVdbe(pParse); @@ -303,6 +311,7 @@ void sqliteDeleteFrom( } delete_from_cleanup: + sqliteAuthContextPop(&sContext); sqliteSrcListDelete(pTabList); sqliteExprDelete(pWhere); return; |