1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +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

@ -3503,7 +3503,7 @@ static int rtreeShadowName(const char *zName){
}
/* Forward declaration */
static char *rtreeIntegrity(sqlite3_vtab*);
static int rtreeIntegrity(sqlite3_vtab*, char**);
static sqlite3_module rtreeModule = {
4, /* iVersion */
@ -4367,21 +4367,15 @@ static int rtreeCheckTable(
/*
** Implementation of the xIntegrity method for Rtree.
*/
static char *rtreeIntegrity(sqlite3_vtab *pVtab){
static int rtreeIntegrity(sqlite3_vtab *pVtab, char **pzErr){
Rtree *pRtree = (Rtree*)pVtab;
char *zErr = 0;
int rc;
rc = rtreeCheckTable(pRtree->db, pRtree->zDb, pRtree->zName, &zErr);
if( rc ){
sqlite3_free(zErr);
zErr = sqlite3_mprintf("error code %d while checking RTree %s.%s",
rc, pRtree->zDb, pRtree->zName);
}else if( zErr ){
zErr = sqlite3_mprintf("In RTree %s.%s:\n%z",
pRtree->zDb, pRtree->zName, zErr);
rc = rtreeCheckTable(pRtree->db, pRtree->zDb, pRtree->zName, pzErr);
if( rc==SQLITE_OK && *pzErr ){
*pzErr = sqlite3_mprintf("In RTree %s.%s:\n%z",
pRtree->zDb, pRtree->zName, *pzErr);
}
return zErr;
return rc;
}
/*