1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

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
This commit is contained in:
drh
2023-09-06 14:00:01 +00:00
parent 961c2a9f36
commit d5ab4dd9e4
7 changed files with 37 additions and 43 deletions

View File

@@ -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);
}