Fix an fts3 problem caused by reducing the page size using the undocumented "nodesize" option, then running an incremental-merge.

FossilOrigin-Name: 2875dcb1ac86db2704ad377d719f308c8837e196b49c98b20ceda1324f2d27ea
This commit is contained in:
dan committed 2023-10-19 18:23:17 +00:00
1 parent 4e254641ff
commit ee3c55471c
4 files changed
+44 -13

No files matched your search

+8 -4
View File
@@ -4034,9 +4034,13 @@ static int fts3IncrmergeAppend(
nSpace += sqlite3Fts3VarintLen(nDoclist) + nDoclist;
/* If the current block is not empty, and if adding this term/doclist
** to the current block would make it larger than Fts3Table.nNodeSize
** bytes, write this block out to the database. */
if( pLeaf->block.n>0 && (pLeaf->block.n + nSpace)>p->nNodeSize ){
** to the current block would make it larger than Fts3Table.nNodeSize bytes,
** and if there is still room for another leaf page, write this block out to
** the database. */
if( pLeaf->block.n>0
&& (pLeaf->block.n + nSpace)>p->nNodeSize
&& pLeaf->iBlock < (pWriter->iStart + pWriter->nLeafEst)
){
rc = fts3WriteSegment(p, pLeaf->iBlock, pLeaf->block.a, pLeaf->block.n);
pWriter->nWork++;
@@ -4368,7 +4372,7 @@ static int fts3IncrmergeLoad(
rc = sqlite3Fts3ReadBlock(p, reader.iChild, &aBlock, &nBlock,0);
blobGrowBuffer(&pNode->block,
MAX(nBlock, p->nNodeSize)+FTS3_NODE_PADDING, &rc
);
);
if( rc==SQLITE_OK ){
memcpy(pNode->block.a, aBlock, nBlock);
pNode->block.n = nBlock;
+8 -8
View File
@@ -1,5 +1,5 @@
C Simplify\sthe\sExpr\scompression\slogic\sslightly\sby\sadding\sthe\snew\sEP_FullSize\nproperty\sto\sexpressions\sthat\sare\sexceptions\sto\sthe\srule\sand\sshould\snot\sbe\ncompressed.
D 2023-10-19T18:07:58.432
C Fix\san\sfts3\sproblem\scaused\sby\sreducing\sthe\spage\ssize\susing\sthe\sundocumented\s"nodesize"\soption,\sthen\srunning\san\sincremental-merge.
D 2023-10-19T18:23:17.869
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@@ -78,7 +78,7 @@ F ext/fts3/fts3_tokenizer.h 64c6ef6c5272c51ebe60fc607a896e84288fcbc3
F ext/fts3/fts3_tokenizer1.c c1de4ae28356ad98ccb8b2e3388a7fdcce7607b5523738c9afb6275dab765154
F ext/fts3/fts3_unicode.c de426ff05c1c2e7bce161cf6b706638419c3a1d9c2667de9cb9dc0458c18e226
F ext/fts3/fts3_unicode2.c 416eb7e1e81142703520d284b768ca2751d40e31fa912cae24ba74860532bf0f
F ext/fts3/fts3_write.c b28f4cde90ed560245ecb76a882b45aa62da16ff6f61e9884eae5c7c5eff16ea
F ext/fts3/fts3_write.c 3a0043bb527c5d11e90493fd9fead30836e161a5330ba2ba739b372b03ea0459
F ext/fts3/fts3speed.tcl b54caf6a18d38174f1a6e84219950d85e98bb1e9
F ext/fts3/tool/fts3cov.sh c331d006359456cf6f8f953e37f2b9c7d568f3863f00bb5f7eb87fea4ac01b73
F ext/fts3/tool/fts3view.c 413c346399159df81f86c4928b7c4a455caab73bfbc8cd68f950f632e5751674
@@ -1148,7 +1148,7 @@ F test/fts3f.test 8c438d5e1cab526b0021988fb1dc70cf3597b006a33ffd6c955ee89929077f
F test/fts3fault.test f4e1342acfe6d216a001490e8cd52afac1f9ffe4a11bbcdcb296129a45c5df45
F test/fts3fault2.test 7b2741e5095367238380b0fcdb837f36c24484c7a5f353659b387df63cf039ec
F test/fts3first.test dbdedd20914c8d539aa3206c9b34a23775644641
F test/fts3fuzz001.test e3c7b0ce9b04cc02281dcc96812a277f02df03cd7dc082055d87e11eb18aaf56
F test/fts3fuzz001.test c78afcd8ad712ea0b8d2ed50851a8aab3bc9dc52c64a536291e07112f519357c
F test/fts3join.test 1a4d786539b2b79a41c28ef2ac22cacd92a8ee830249b68a7dee4a020848e3bb
F test/fts3malloc.test b0e4c133b8d61d4f6d112d8110f8320e9e453ef6
F test/fts3matchinfo.test aa66cc50615578b30f6df9984819ae5b702511cf8a94251ec7c594096a703a4a
@@ -2133,8 +2133,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 89862c51ad9715bedf5b029db484602e740f0db7404970d482ce503c1b9a0ed2
R cafbded15ce259abcd81ee283e9b7816
U drh
Z f727cd73dc6d9e2bf2cf8af2294d32ea
P d5ae82ec52eafed5e3dc8c9d99685f6523fce7d973ef7e8d9d75ed9b8912426a
R 02c4f3ff3085bada857f44e872f54862
U dan
Z ffd740135c1cbc63e13e90b6f1ec66d6
# Remove this line to create a well-formed Fossil manifest.
+1 -1
View File
@@ -1 +1 @@
d5ae82ec52eafed5e3dc8c9d99685f6523fce7d973ef7e8d9d75ed9b8912426a
2875dcb1ac86db2704ad377d719f308c8837e196b49c98b20ceda1324f2d27ea
+27
View File
@@ -13,6 +13,7 @@
set testdir [file dirname $argv0]
source $testdir/tester.tcl
set testprefix fts3fuzz001
ifcapable !deserialize||!fts3 {
finish_test
@@ -110,5 +111,31 @@ do_test fts3fuzz001-121 {
}
} {1 {database disk image is malformed}}
#-------------------------------------------------------------------------
reset_db
do_execsql_test 200 {
CREATE VIRTUAL TABLE x1 USING fts3(x);
INSERT INTO x1 VALUES('braes brag bragged bragger bragging');
INSERT INTO x1 VALUES('brags braid braided braiding braids');
INSERT INTO x1 VALUES('brain brainchild brained braining brains');
INSERT INTO x1 VALUES('brainstem brainstems brainstorm brainstorms');
INSERT INTO x1(x1) VALUES('nodesize=24');
}
do_execsql_test 210 {
PRAGMA integrity_check;
} {ok}
do_execsql_test 220 {
INSERT INTO x1(x1) VALUES('merge=10,2')
}
do_execsql_test 220 {
PRAGMA integrity_check;
} {ok}
finish_test