summaryrefslogtreecommitdiff
path: root/ext/pdo_sqlite/sqlite/src/vtab.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pdo_sqlite/sqlite/src/vtab.c')
-rw-r--r--ext/pdo_sqlite/sqlite/src/vtab.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/ext/pdo_sqlite/sqlite/src/vtab.c b/ext/pdo_sqlite/sqlite/src/vtab.c
index 862b3835eb..540940e7ce 100644
--- a/ext/pdo_sqlite/sqlite/src/vtab.c
+++ b/ext/pdo_sqlite/sqlite/src/vtab.c
@@ -132,10 +132,12 @@ void sqlite3VtabBeginParse(
int iDb; /* The database the table is being created in */
Table *pTable; /* The new virtual table */
+#ifndef SQLITE_OMIT_SHARED_CACHE
if( sqlite3ThreadDataReadOnly()->useSharedData ){
sqlite3ErrorMsg(pParse, "Cannot use virtual tables in shared-cache mode");
return;
}
+#endif
sqlite3StartTable(pParse, pName1, pName2, 0, 0, 1, 0);
pTable = pParse->pNewTable;
@@ -531,16 +533,18 @@ int sqlite3VtabCallDestroy(sqlite3 *db, int iDb, const char *zTab)
*/
static void callFinaliser(sqlite3 *db, int offset){
int i;
- for(i=0; i<db->nVTrans && db->aVTrans[i]; i++){
- sqlite3_vtab *pVtab = db->aVTrans[i];
- int (*x)(sqlite3_vtab *);
- x = *(int (**)(sqlite3_vtab *))((char *)pVtab->pModule + offset);
- if( x ) x(pVtab);
- sqlite3VtabUnlock(db, pVtab);
+ if( db->aVTrans ){
+ for(i=0; i<db->nVTrans && db->aVTrans[i]; i++){
+ sqlite3_vtab *pVtab = db->aVTrans[i];
+ int (*x)(sqlite3_vtab *);
+ x = *(int (**)(sqlite3_vtab *))((char *)pVtab->pModule + offset);
+ if( x ) x(pVtab);
+ sqlite3VtabUnlock(db, pVtab);
+ }
+ sqliteFree(db->aVTrans);
+ db->nVTrans = 0;
+ db->aVTrans = 0;
}
- sqliteFree(db->aVTrans);
- db->nVTrans = 0;
- db->aVTrans = 0;
}
/*