aboutsummaryrefslogtreecommitdiff
path: root/src/vtab.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2008-07-23 18:17:32 +0000
committerdrh <drh@noemail.net>2008-07-23 18:17:32 +0000
commit4dc754d96d02536e9c70e225006fd74f40760ce9 (patch)
treed700f06b5fb1995e474ef3305c10ab4aa6c7dca5 /src/vtab.c
parentb25f9d84cd583623a9bba8d398a4a31ccbff3c34 (diff)
downloadsqlite-4dc754d96d02536e9c70e225006fd74f40760ce9.tar.gz
sqlite-4dc754d96d02536e9c70e225006fd74f40760ce9.zip
Read the sqlite3_vtab.zErrMsg after each call to a virtual table
method and transfer any error into the database connection. Fix the fts2.test and fts3.test scripts to that they return silently rather than failing the test sequence if the appropriate FTS implementation is unavailable. (CVS 5463) FossilOrigin-Name: e2c6771d44f1b4fee16ef90e91c3498be2a7d2b1
Diffstat (limited to 'src/vtab.c')
-rw-r--r--src/vtab.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/vtab.c b/src/vtab.c
index ab960236e..2c71215de 100644
--- a/src/vtab.c
+++ b/src/vtab.c
@@ -11,7 +11,7 @@
*************************************************************************
** This file contains code used to help implement virtual tables.
**
-** $Id: vtab.c,v 1.70 2008/06/23 17:44:19 danielk1977 Exp $
+** $Id: vtab.c,v 1.71 2008/07/23 18:17:32 drh Exp $
*/
#ifndef SQLITE_OMIT_VIRTUALTABLE
#include "sqliteInt.h"
@@ -726,6 +726,7 @@ int sqlite3VtabBegin(sqlite3 *db, sqlite3_vtab *pVtab){
/* Invoke the xBegin method */
rc = pModule->xBegin(pVtab);
+ sqlite3VtabTransferError(db, rc, pVtab);
if( rc!=SQLITE_OK ){
return rc;
}
@@ -787,6 +788,7 @@ FuncDef *sqlite3VtabOverloadFunction(
}
rc = pMod->xFindFunction(pVtab, nArg, zLowerName, &xFunc, &pArg);
sqlite3_free(zLowerName);
+ sqlite3VtabTransferError(db, rc, pVtab);
}
if( rc==0 ){
return pDef;
@@ -827,4 +829,15 @@ void sqlite3VtabMakeWritable(Parse *pParse, Table *pTab){
}
}
+/*
+** Transfer a virtual table error into the database connection.
+*/
+void sqlite3VtabTransferError(sqlite3 *db, int rc, sqlite3_vtab *pVtab){
+ if( pVtab->zErrMsg ){
+ sqlite3Error(db, rc, "%s", pVtab->zErrMsg);
+ sqlite3_free(pVtab->zErrMsg);
+ pVtab->zErrMsg = 0;
+ }
+}
+
#endif /* SQLITE_OMIT_VIRTUALTABLE */