diff options
Diffstat (limited to 'ext/fts5/fts5_main.c')
-rw-r--r-- | ext/fts5/fts5_main.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/ext/fts5/fts5_main.c b/ext/fts5/fts5_main.c index c78af28b6..6e86ca595 100644 --- a/ext/fts5/fts5_main.c +++ b/ext/fts5/fts5_main.c @@ -2914,25 +2914,33 @@ static int fts5ShadowName(const char *zName){ ** if anything is found amiss. Return a NULL pointer if everything is ** OK. */ -static int fts5Integrity(sqlite3_vtab *pVtab, char **pzErr){ +static int fts5Integrity( + sqlite3_vtab *pVtab, /* the FTS5 virtual table to check */ + const char *zSchema, /* Name of schema in which this table lives */ + const char *zTabname, /* Name of the table itself */ + int isQuick, /* True if this is a quick-check */ + char **pzErr /* Write error message here */ +){ Fts5FullTable *pTab = (Fts5FullTable*)pVtab; Fts5Config *pConfig = pTab->p.pConfig; char *zSql; char *zErr = 0; int rc; + assert( pzErr!=0 && *pzErr==0 ); + UNUSED_PARAM(isQuick); zSql = sqlite3_mprintf( "INSERT INTO \"%w\".\"%w\"(\"%w\") VALUES('integrity-check');", - pConfig->zDb, pConfig->zName, pConfig->zName); + zSchema, zTabname, pConfig->zName); if( zSql==0 ) return SQLITE_NOMEM; rc = sqlite3_exec(pConfig->db, zSql, 0, 0, &zErr); sqlite3_free(zSql); if( (rc&0xff)==SQLITE_CORRUPT ){ *pzErr = sqlite3_mprintf("malformed inverted index for FTS5 table %s.%s", - pConfig->zDb, pConfig->zName); + zSchema, zTabname); }else if( rc!=SQLITE_OK ){ *pzErr = sqlite3_mprintf("unable to validate the inverted index for" " FTS5 table %s.%s: %s", - pConfig->zDb, pConfig->zName, zErr); + zSchema, zTabname, zErr); } sqlite3_free(zErr); return SQLITE_OK; |