summaryrefslogtreecommitdiffstats
path: root/ext/fts5
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fts5')
-rw-r--r--ext/fts5/fts5.h4
-rw-r--r--ext/fts5/fts5_main.c3
-rw-r--r--ext/fts5/test/fts5fault8.test14
3 files changed, 17 insertions, 4 deletions
diff --git a/ext/fts5/fts5.h b/ext/fts5/fts5.h
index 250d2ee..551618e 100644
--- a/ext/fts5/fts5.h
+++ b/ext/fts5/fts5.h
@@ -55,8 +55,8 @@ struct Fts5PhraseIter {
** EXTENSION API FUNCTIONS
**
** xUserData(pFts):
-** Return a copy of the context pointer the extension function was
-** registered with.
+** Return a copy of the pUserData pointer passed to the xCreateFunction()
+** API when the extension function was registered.
**
** xColumnTotalSize(pFts, iCol, pnToken):
** If parameter iCol is less than zero, set output variable *pnToken
diff --git a/ext/fts5/fts5_main.c b/ext/fts5/fts5_main.c
index 7c818ce..f609f7f 100644
--- a/ext/fts5/fts5_main.c
+++ b/ext/fts5/fts5_main.c
@@ -2979,6 +2979,7 @@ static int fts5IntegrityMethod(
if( (rc&0xff)==SQLITE_CORRUPT ){
*pzErr = sqlite3_mprintf("malformed inverted index for FTS5 table %s.%s",
zSchema, zTabname);
+ rc = (*pzErr) ? SQLITE_OK : SQLITE_NOMEM;
}else if( rc!=SQLITE_OK ){
*pzErr = sqlite3_mprintf("unable to validate the inverted index for"
" FTS5 table %s.%s: %s",
@@ -2986,7 +2987,7 @@ static int fts5IntegrityMethod(
}
sqlite3Fts5IndexCloseReader(pTab->p.pIndex);
- return SQLITE_OK;
+ return rc;
}
static int fts5Init(sqlite3 *db){
diff --git a/ext/fts5/test/fts5fault8.test b/ext/fts5/test/fts5fault8.test
index 5afab77..dc060a1 100644
--- a/ext/fts5/test/fts5fault8.test
+++ b/ext/fts5/test/fts5fault8.test
@@ -57,7 +57,6 @@ foreach_detail_mode $testprefix {
} ;# foreach_detail_mode...
-
do_execsql_test 4.0 {
CREATE VIRTUAL TABLE x2 USING fts5(a);
INSERT INTO x2(x2, rank) VALUES('crisismerge', 2);
@@ -80,5 +79,18 @@ do_faultsim_test 4 -faults oom-* -prep {
faultsim_test_result {0 {}} {1 SQLITE_NOMEM}
}
+set TMPDBERROR {1 {unable to open a temporary database file for storing temporary tables}}
+
+do_faultsim_test 5 -faults oom-t* -prep {
+ faultsim_restore_and_reopen
+ execsql { PRAGMA temp_store = memory }
+} -body {
+ execsql { PRAGMA integrity_check }
+} -test {
+ if {[string match {*error code=7*} $testresult]==0} {
+ faultsim_test_result {0 ok} {1 SQLITE_NOMEM} $::TMPDBERROR
+ }
+}
+
finish_test