aboutsummaryrefslogtreecommitdiff
path: root/src/copy.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2003-04-22 20:30:37 +0000
committerdrh <drh@noemail.net>2003-04-22 20:30:37 +0000
commite22a334b782e5434cc1858eeb2f90c0148ff802d (patch)
tree6f4753183edc52c0c3c0259713c2e26da42c2863 /src/copy.c
parent383723795905cdc580dc04374b99f4539bfac1a6 (diff)
downloadsqlite-e22a334b782e5434cc1858eeb2f90c0148ff802d.tar.gz
sqlite-e22a334b782e5434cc1858eeb2f90c0148ff802d.zip
Update the authorizer API so that it reports the database that table and
indices belong to and so that it reports when actions are taken in response to a trigger. (CVS 928) FossilOrigin-Name: c675a5504138f34cae6def782b5d3add2c67d2bc
Diffstat (limited to 'src/copy.c')
-rw-r--r--src/copy.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/copy.c b/src/copy.c
index 076b0a478..69711dca6 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -11,7 +11,7 @@
*************************************************************************
** This file contains code used to implement the COPY command.
**
-** $Id: copy.c,v 1.2 2003/04/15 19:22:23 drh Exp $
+** $Id: copy.c,v 1.3 2003/04/22 20:30:39 drh Exp $
*/
#include "sqliteInt.h"
@@ -39,6 +39,7 @@ void sqliteCopy(
int addr, end;
Index *pIdx;
char *zFile = 0;
+ const char *zDb;
sqlite *db = pParse->db;
@@ -48,8 +49,10 @@ void sqliteCopy(
if( pTab==0 || sqliteIsReadOnly(pParse, pTab) ) goto copy_cleanup;
zFile = sqliteStrNDup(pFilename->z, pFilename->n);
sqliteDequote(zFile);
- if( sqliteAuthCheck(pParse, SQLITE_INSERT, pTab->zName, zFile)
- || sqliteAuthCheck(pParse, SQLITE_COPY, pTab->zName, zFile) ){
+ assert( pTab->iDb>=0 && pTab->iDb<db->nDb );
+ zDb = db->aDb[pTab->iDb].zName;
+ if( sqliteAuthCheck(pParse, SQLITE_INSERT, pTab->zName, 0, zDb)
+ || sqliteAuthCheck(pParse, SQLITE_COPY, pTab->zName, zFile, zDb) ){
goto copy_cleanup;
}
v = sqliteGetVdbe(pParse);