mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-15 11:41:13 +03:00
Revise the sqlite_set_authorizer API to provide more detailed information
about the SQL statement being authorized. Only partially tested so far. (CVS 830) FossilOrigin-Name: 45de93f913a18026a45de6254963dbcd1b0f1a19
This commit is contained in:
14
src/update.c
14
src/update.c
@@ -12,7 +12,7 @@
|
||||
** This file contains C code routines that are called by the parser
|
||||
** to handle UPDATE statements.
|
||||
**
|
||||
** $Id: update.c,v 1.52 2003/01/12 18:02:19 drh Exp $
|
||||
** $Id: update.c,v 1.53 2003/01/13 23:27:33 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
|
||||
@@ -53,7 +53,6 @@ void sqliteUpdate(
|
||||
int oldIdx = -1; /* index of trigger "old" temp table */
|
||||
|
||||
if( pParse->nErr || sqlite_malloc_failed ) goto update_cleanup;
|
||||
if( sqliteAuthCommand(pParse, "UPDATE", 0) ) goto update_cleanup;
|
||||
db = pParse->db;
|
||||
|
||||
/* Check for the special case of a VIEW with one or more ON UPDATE triggers
|
||||
@@ -148,8 +147,15 @@ void sqliteUpdate(
|
||||
goto update_cleanup;
|
||||
}
|
||||
#ifndef SQLITE_OMIT_AUTHORIZATION
|
||||
if( sqliteAuthWrite(pParse, pTab, j)==SQLITE_IGNORE ){
|
||||
aXRef[j] = -1;
|
||||
{
|
||||
int rc;
|
||||
rc = sqliteAuthCheck(pParse, SQLITE_UPDATE, pTab->zName,
|
||||
pTab->aCol[j].zName);
|
||||
if( rc==SQLITE_DENY ){
|
||||
goto update_cleanup;
|
||||
}else if( rc==SQLITE_IGNORE ){
|
||||
aXRef[j] = -1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user