summaryrefslogtreecommitdiffstats
path: root/ext/fts3/fts3.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fts3/fts3.c')
-rw-r--r--ext/fts3/fts3.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/ext/fts3/fts3.c b/ext/fts3/fts3.c
index 3795901..f977aab 100644
--- a/ext/fts3/fts3.c
+++ b/ext/fts3/fts3.c
@@ -4014,22 +4014,24 @@ static int fts3IntegrityMethod(
char **pzErr /* Write error message here */
){
Fts3Table *p = (Fts3Table*)pVtab;
- int rc;
+ int rc = SQLITE_OK;
int bOk = 0;
UNUSED_PARAMETER(isQuick);
rc = sqlite3Fts3IntegrityCheck(p, &bOk);
- assert( rc!=SQLITE_CORRUPT_VTAB || bOk==0 );
- if( rc!=SQLITE_OK && rc!=SQLITE_CORRUPT_VTAB ){
+ assert( rc!=SQLITE_CORRUPT_VTAB );
+ if( rc==SQLITE_ERROR || (rc&0xFF)==SQLITE_CORRUPT ){
*pzErr = sqlite3_mprintf("unable to validate the inverted index for"
" FTS%d table %s.%s: %s",
p->bFts4 ? 4 : 3, zSchema, zTabname, sqlite3_errstr(rc));
- }else if( bOk==0 ){
+ if( *pzErr ) rc = SQLITE_OK;
+ }else if( rc==SQLITE_OK && bOk==0 ){
*pzErr = sqlite3_mprintf("malformed inverted index for FTS%d table %s.%s",
p->bFts4 ? 4 : 3, zSchema, zTabname);
+ if( *pzErr==0 ) rc = SQLITE_NOMEM;
}
sqlite3Fts3SegmentsClose(p);
- return SQLITE_OK;
+ return rc;
}