diff options
author | drh <> | 2023-09-06 14:00:01 +0000 |
---|---|---|
committer | drh <> | 2023-09-06 14:00:01 +0000 |
commit | d5ab4dd9e4022a2ea3155506498c1b10e3e84aa5 (patch) | |
tree | e63e1c4f54ab2395bc6dcd9ec6e37a7604d6584d /src | |
parent | 961c2a9f364e2a56ad1c718791e2a117bb2c65b7 (diff) | |
download | sqlite-d5ab4dd9e4022a2ea3155506498c1b10e3e84aa5.tar.gz sqlite-d5ab4dd9e4022a2ea3155506498c1b10e3e84aa5.zip |
Change the xIntegrity virtual table method signature so that it returns
an integer error code and writes the error message into a parameter.
FossilOrigin-Name: f1d4024a8ca06cf954aaf1f612684d1a5d28492bde757695db3f22c50c649709
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); } |