diff options
Diffstat (limited to 'src/insert.c')
-rw-r--r-- | src/insert.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/insert.c b/src/insert.c index f7773314c..940536f56 100644 --- a/src/insert.c +++ b/src/insert.c @@ -12,7 +12,7 @@ ** This file contains C code routines that are called by the parser ** to handle INSERT statements in SQLite. ** -** $Id: insert.c,v 1.80 2003/04/20 17:29:24 drh Exp $ +** $Id: insert.c,v 1.81 2003/04/22 20:30:39 drh Exp $ */ #include "sqliteInt.h" @@ -93,6 +93,7 @@ void sqliteInsert( ){ Table *pTab; /* The table to insert into */ char *zTab; /* Name of the table into which we are inserting */ + const char *zDb; /* Name of the database holding this table */ int i, j, idx; /* Loop counters */ Vdbe *v; /* Generate code into this virtual machine */ Index *pIdx; /* For looping over indices of the table */ @@ -126,7 +127,9 @@ void sqliteInsert( if( pTab==0 ){ goto insert_cleanup; } - if( sqliteAuthCheck(pParse, SQLITE_INSERT, pTab->zName, 0) ){ + assert( pTab->iDb<db->nDb ); + zDb = db->aDb[pTab->iDb].zName; + if( sqliteAuthCheck(pParse, SQLITE_INSERT, pTab->zName, 0, zDb) ){ goto insert_cleanup; } |