mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-15 11:41:13 +03:00
Initial check-in of the code for the new sqlite_set_authorizer() API function.
The code is mostly untested at this point. (CVS 827) FossilOrigin-Name: 52d5007f64d0af5286b2a0e1f0b9e53c86bece3f
This commit is contained in:
12
src/update.c
12
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.51 2003/01/11 13:30:58 drh Exp $
|
||||
** $Id: update.c,v 1.52 2003/01/12 18:02:19 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
|
||||
@@ -53,6 +53,7 @@ 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
|
||||
@@ -110,7 +111,9 @@ void sqliteUpdate(
|
||||
|
||||
/* Resolve the column names in all the expressions in both the
|
||||
** WHERE clause and in the new values. Also find the column index
|
||||
** for each column to be updated in the pChanges array.
|
||||
** for each column to be updated in the pChanges array. For each
|
||||
** column to be updated, make sure we have authorization to change
|
||||
** that column.
|
||||
*/
|
||||
if( pWhere ){
|
||||
if( sqliteExprResolveIds(pParse, base, pTabList, 0, pWhere) ){
|
||||
@@ -144,6 +147,11 @@ void sqliteUpdate(
|
||||
pParse->nErr++;
|
||||
goto update_cleanup;
|
||||
}
|
||||
#ifndef SQLITE_OMIT_AUTHORIZATION
|
||||
if( sqliteAuthWrite(pParse, pTab, j)==SQLITE_IGNORE ){
|
||||
aXRef[j] = -1;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Allocate memory for the array apIdx[] and fill it with pointers to every
|
||||
|
||||
Reference in New Issue
Block a user