diff --git a/ext/fts3/fts3.c b/ext/fts3/fts3.c index 491a658871..6f8668534f 100644 --- a/ext/fts3/fts3.c +++ b/ext/fts3/fts3.c @@ -4010,18 +4010,26 @@ static int fts3Integrity(sqlite3_vtab *pVtab, char **pzErr){ Fts3Table *p = (Fts3Table*)pVtab; char *zSql; int rc; + char *zErr = 0; zSql = sqlite3_mprintf( "INSERT INTO \"%w\".\"%w\"(\"%w\") VALUES('integrity-check');", p->zDb, p->zName, p->zName); - rc = sqlite3_exec(p->db, zSql, 0, 0, 0); + if( zSql==0 ){ + return SQLITE_NOMEM; + } + rc = sqlite3_exec(p->db, zSql, 0, 0, &zErr); sqlite3_free(zSql); if( (rc&0xff)==SQLITE_CORRUPT ){ *pzErr = sqlite3_mprintf("malformed inverted index for FTS%d table %s.%s", p->bFts4 ? 4 : 3, p->zDb, p->zName); - rc = SQLITE_OK; + }else if( rc!=SQLITE_OK ){ + *pzErr = sqlite3_mprintf("unable to validate the inverted index for" + " FTS%d table %s.%s: %s", + p->bFts4 ? 4 : 3, p->zDb, p->zName, zErr); } - return rc; + sqlite3_free(zErr); + return SQLITE_OK; } diff --git a/ext/fts5/fts5_main.c b/ext/fts5/fts5_main.c index d4a36a22aa..c78af28b61 100644 --- a/ext/fts5/fts5_main.c +++ b/ext/fts5/fts5_main.c @@ -2918,19 +2918,24 @@ static int fts5Integrity(sqlite3_vtab *pVtab, char **pzErr){ Fts5FullTable *pTab = (Fts5FullTable*)pVtab; Fts5Config *pConfig = pTab->p.pConfig; char *zSql; + char *zErr = 0; int rc; zSql = sqlite3_mprintf( "INSERT INTO \"%w\".\"%w\"(\"%w\") VALUES('integrity-check');", pConfig->zDb, pConfig->zName, pConfig->zName); - rc = sqlite3_exec(pConfig->db, zSql, 0, 0, 0); + 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); - rc = SQLITE_OK; + }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); } - return rc; - + sqlite3_free(zErr); + return SQLITE_OK; } static int fts5Init(sqlite3 *db){ diff --git a/manifest b/manifest index 12227cf848..3a61ce457f 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\ssqlite3ExprDup()\salignment\sassertions\sso\sthat\sthey\swork\son\s32-bit\nplatforms. -D 2023-10-23T12:16:27.460 +C Improved\serror\smessages\sfor\sthe\sxIntegrity\smethod\sin\sFTS3/4\sand\sFTS5. +D 2023-10-23T13:46:22.734 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -60,7 +60,7 @@ F ext/fts3/README.content b9078d0843a094d86af0d48dffbff13c906702b4c3558012e67b9c F ext/fts3/README.syntax a19711dc5458c20734b8e485e75fb1981ec2427a F ext/fts3/README.tokenizers b92bdeb8b46503f0dd301d364efc5ef59ef9fa8e2758b8e742f39fa93a2e422d F ext/fts3/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d -F ext/fts3/fts3.c c409b5f9211dbe9336210435ef3bc936e54c4f2ad9b92c9a7cd5442cbbbf1411 +F ext/fts3/fts3.c 7e23ea4675ed55b54d33aeb6227da6fb19f072a81a93230a8866f3803e33f35a F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe F ext/fts3/fts3Int.h be688580701d41340de73384e3acc8c55be12a438583207444bd5e20f9ef426c F ext/fts3/fts3_aux.c 7eab82a9cf0830f6551ba3abfdbe73ed39e322a4d3940ee82fbf723674ecd9f3 @@ -95,7 +95,7 @@ F ext/fts5/fts5_config.c 054359543566cbff1ba65a188330660a5457299513ac71c53b3a07d F ext/fts5/fts5_expr.c bd3b81ce669c4104e34ffe66570af1999a317b142c15fccb112de9fb0caa57a6 F ext/fts5/fts5_hash.c 65e7707bc8774706574346d18c20218facf87de3599b995963c3e6d6809f203d F ext/fts5/fts5_index.c 730c9c32ada18ce1eb7ff847b36507f4b005d88d47af7b47db521e695a8ea4c7 -F ext/fts5/fts5_main.c 1ce6c8f446afbaaf22f4e1ccc0ec46d653168545b89a53bdbba0beddda820bec +F ext/fts5/fts5_main.c 0a0ddd6c6d1d790bacbba838efd7882e1986a283915cce9097c6e6513ccd8fb5 F ext/fts5/fts5_storage.c 5d10b9bdcce5b90656cad13c7d12ad4148677d4b9e3fca0481fca56d6601426d F ext/fts5/fts5_tcl.c b1445cbe69908c411df8084a10b2485500ac70a9c747cdc8cda175a3da59d8ae F ext/fts5/fts5_test_mi.c 08c11ec968148d4cb4119d96d819f8c1f329812c568bac3684f5464be177d3ee @@ -2137,8 +2137,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P a41b903d0fe489d20c4a7118a2c91f7c8a78568ce552225f64c2945bb811ea16 -R e0765559e351b53aa91cbdf72b53d175 +P 143f95efc7114455b1920f1d2f9a867392740f608d1dda4306005f01238103f8 +R e88ffdcda9c30f44a46dd8d1f3420363 U drh -Z 6584dbcb9c003dd886e6e044516719d0 +Z 143e40da451b35005514a48e6a805b55 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index d8ab30ae95..0422e95939 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -143f95efc7114455b1920f1d2f9a867392740f608d1dda4306005f01238103f8 \ No newline at end of file +df69abc0823f4dd9c051f8d5993d2f447ee0dadab5cef73d670107b1071db255 \ No newline at end of file