diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/sqlite.h.in | 2 | ||||
-rw-r--r-- | src/vdbe.c | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/sqlite.h.in b/src/sqlite.h.in index e2afe5b66..9ffbb63b2 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -7219,7 +7219,7 @@ struct sqlite3_module { int (*xShadowName)(const char*); /* The methods above are in versions 1 through 3 of the sqlite_module object. ** Those below are for version 4 and greater. */ - char *(*xIntegrity)(sqlite3_vtab *pVTab); + int (*xIntegrity)(sqlite3_vtab *pVTab, char**); }; /* diff --git a/src/vdbe.c b/src/vdbe.c index 73682be85..eccd5291e 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -8141,7 +8141,7 @@ case OP_VCheck: { /* out2 */ Table *pTab; sqlite3_vtab *pVtab; const sqlite3_module *pModule; - char *zErr; + char *zErr = 0; pOut = &aMem[pOp->p2]; sqlite3VdbeMemSetNull(pOut); /* Innocent until proven guilty */ @@ -8156,7 +8156,11 @@ case OP_VCheck: { /* out2 */ assert( pModule!=0 ); assert( pModule->iVersion>=4 ); assert( pModule->xIntegrity!=0 ); - zErr = pModule->xIntegrity(pVtab); + rc = pModule->xIntegrity(pVtab, &zErr); + if( rc ){ + sqlite3_free(zErr); + goto abort_due_to_error; + } if( zErr ){ sqlite3VdbeMemSetStr(pOut, zErr, -1, SQLITE_UTF8, sqlite3_free); } |