aboutsummaryrefslogtreecommitdiff
path: root/src/copy.c
diff options
context:
space:
mode:
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);