Merge the improved incremental doclist loading test from the
broken-build branch (which is now fixed) into trunk. FossilOrigin-Name: f9750870ee04935f338e4d808900fee5a8b2b389
This commit is contained in:
commit
295b50ce1c
@ -3275,12 +3275,11 @@ static int fts3EvalDeferredPhrase(Fts3Cursor *pCsr, Fts3Phrase *pPhrase){
|
||||
nPoslist = nList;
|
||||
|
||||
}else{
|
||||
assert( iPrev>=0 );
|
||||
|
||||
char *aOut = pList;
|
||||
char *p1 = aPoslist;
|
||||
char *p2 = aOut;
|
||||
|
||||
assert( iPrev>=0 );
|
||||
fts3PoslistPhraseMerge(&aOut, iToken-iPrev, 0, 1, &p1, &p2);
|
||||
sqlite3_free(aPoslist);
|
||||
aPoslist = pList;
|
||||
|
@ -242,8 +242,79 @@ static int fts3_near_match_cmd(
|
||||
return rc;
|
||||
}
|
||||
|
||||
int Sqlitetestfts3_Init(Tcl_Interp *interp){
|
||||
Tcl_CreateObjCommand(interp, "fts3_near_match", fts3_near_match_cmd, 0, 0);
|
||||
/*
|
||||
** Tclcmd: fts3_configure_incr_load ?CHUNKSIZE THRESHOLD?
|
||||
**
|
||||
** Normally, FTS uses hard-coded values to determine the minimum doclist
|
||||
** size eligible for incremental loading, and the size of the chunks loaded
|
||||
** when a doclist is incrementally loaded. This command allows the built-in
|
||||
** values to be overridden for testing purposes.
|
||||
**
|
||||
** If present, the first argument is the chunksize in bytes to load doclists
|
||||
** in. The second argument is the minimum doclist size in bytes to use
|
||||
** incremental loading with.
|
||||
**
|
||||
** Whether or not the arguments are present, this command returns a list of
|
||||
** two integers - the initial chunksize and threshold when the command is
|
||||
** invoked. This can be used to restore the default behaviour after running
|
||||
** tests. For example:
|
||||
**
|
||||
** # Override incr-load settings for testing:
|
||||
** set cfg [fts3_configure_incr_load $new_chunksize $new_threshold]
|
||||
**
|
||||
** .... run tests ....
|
||||
**
|
||||
** # Restore initial incr-load settings:
|
||||
** eval fts3_configure_incr_load $cfg
|
||||
*/
|
||||
static int fts3_configure_incr_load_cmd(
|
||||
ClientData clientData,
|
||||
Tcl_Interp *interp,
|
||||
int objc,
|
||||
Tcl_Obj *CONST objv[]
|
||||
){
|
||||
#ifdef SQLITE_ENABLE_FTS3
|
||||
extern int test_fts3_node_chunksize;
|
||||
extern int test_fts3_node_chunk_threshold;
|
||||
int iArg1;
|
||||
int iArg2;
|
||||
Tcl_Obj *pRet;
|
||||
|
||||
if( objc!=1 && objc!=3 ){
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "?CHUNKSIZE THRESHOLD?");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
pRet = Tcl_NewObj();
|
||||
Tcl_IncrRefCount(pRet);
|
||||
Tcl_ListObjAppendElement(
|
||||
interp, pRet, Tcl_NewIntObj(test_fts3_node_chunksize));
|
||||
Tcl_ListObjAppendElement(
|
||||
interp, pRet, Tcl_NewIntObj(test_fts3_node_chunk_threshold));
|
||||
|
||||
if( objc==3 ){
|
||||
int iArg1;
|
||||
int iArg2;
|
||||
if( Tcl_GetIntFromObj(interp, objv[1], &iArg1)
|
||||
|| Tcl_GetIntFromObj(interp, objv[2], &iArg2)
|
||||
){
|
||||
Tcl_DecrRefCount(pRet);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
test_fts3_node_chunksize = iArg1;
|
||||
test_fts3_node_chunk_threshold = iArg2;
|
||||
}
|
||||
|
||||
Tcl_SetObjResult(interp, pRet);
|
||||
Tcl_DecrRefCount(pRet);
|
||||
#endif
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
int Sqlitetestfts3_Init(Tcl_Interp *interp){
|
||||
Tcl_CreateObjCommand(interp, "fts3_near_match", fts3_near_match_cmd, 0, 0);
|
||||
Tcl_CreateObjCommand(interp,
|
||||
"fts3_configure_incr_load", fts3_configure_incr_load_cmd, 0, 0
|
||||
);
|
||||
return TCL_OK;
|
||||
}
|
||||
|
@ -49,13 +49,19 @@
|
||||
** is 1. Clearly such small values would be inefficient, but can be useful
|
||||
** for testing purposes.
|
||||
**
|
||||
** TODO: Add a test interface to modify these "constants" from a script for
|
||||
** this purpose.
|
||||
** If this module is built with SQLITE_TEST defined, these constants may
|
||||
** be overridden at runtime for testing purposes. File fts3_test.c contains
|
||||
** a Tcl interface to read and write the values.
|
||||
*/
|
||||
#define FTS3_NODE_CHUNKSIZE (4*1024)
|
||||
#define FTS3_NODE_CHUNK_THRESHOLD (FTS3_NODE_CHUNKSIZE*4)
|
||||
/* #define FTS3_NODE_CHUNKSIZE 1 */
|
||||
/* #define FTS3_NODE_CHUNK_THRESHOLD 1 */
|
||||
#ifdef SQLITE_TEST
|
||||
int test_fts3_node_chunksize = (4*1024);
|
||||
int test_fts3_node_chunk_threshold = (4*1024)*4;
|
||||
# define FTS3_NODE_CHUNKSIZE test_fts3_node_chunksize
|
||||
# define FTS3_NODE_CHUNK_THRESHOLD test_fts3_node_chunk_threshold
|
||||
#else
|
||||
# define FTS3_NODE_CHUNKSIZE (4*1024)
|
||||
# define FTS3_NODE_CHUNK_THRESHOLD (FTS3_NODE_CHUNKSIZE*4)
|
||||
#endif
|
||||
|
||||
typedef struct PendingList PendingList;
|
||||
typedef struct SegmentNode SegmentNode;
|
||||
|
22
manifest
22
manifest
@ -1,5 +1,5 @@
|
||||
C Fix\sa\smemory\sleak\sthat\scan\sfollow\san\sOOM\serror\sin\sa\suser-function\sthat\suses\ssqlite3_set_auxdata().
|
||||
D 2011-06-14T14:18:45.331
|
||||
C Merge\sthe\simproved\sincremental\sdoclist\sloading\stest\sfrom\sthe\nbroken-build\sbranch\s(which\sis\snow\sfixed)\sinto\strunk.
|
||||
D 2011-06-15T13:11:06.128
|
||||
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
||||
F Makefile.in c1d7a7f4fd8da6b1815032efca950e3d5125407e
|
||||
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
||||
@ -61,7 +61,7 @@ F ext/fts2/mkfts2amal.tcl 974d5d438cb3f7c4a652639262f82418c1e4cff0
|
||||
F ext/fts3/README.syntax a19711dc5458c20734b8e485e75fb1981ec2427a
|
||||
F ext/fts3/README.tokenizers 998756696647400de63d5ba60e9655036cb966e9
|
||||
F ext/fts3/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d
|
||||
F ext/fts3/fts3.c ae3ae91d204d177fc37a22c7bc5a3a9df70e65a0
|
||||
F ext/fts3/fts3.c 6c7b588761082e3c5452fbff02c8a2004875ea26
|
||||
F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe
|
||||
F ext/fts3/fts3Int.h a999cfbf605efec293a88519f74192f5204c84d6
|
||||
F ext/fts3/fts3_aux.c baed9dab7fb4604ae8cafdb2d7700abe93beffbe
|
||||
@ -72,11 +72,11 @@ F ext/fts3/fts3_icu.c ac494aed69835008185299315403044664bda295
|
||||
F ext/fts3/fts3_porter.c d61cfd81fb0fd8fbcb25adcaee0ba671aefaa5c2
|
||||
F ext/fts3/fts3_snippet.c 82e2c1e420c871c02f6e85ea438570118d7105c8
|
||||
F ext/fts3/fts3_term.c 6c7f33ab732a2a0f281898685650e3a492e1e2f1
|
||||
F ext/fts3/fts3_test.c 9376cc865447e63c671f0f9ffd1a2c9a29678230
|
||||
F ext/fts3/fts3_test.c 4e833729c13cea9a6bb98d3b353f6e3b8f756004
|
||||
F ext/fts3/fts3_tokenizer.c 055f3dc7369585350b28db1ee0f3b214dca6724d
|
||||
F ext/fts3/fts3_tokenizer.h 13ffd9fcb397fec32a05ef5cd9e0fa659bf3dbd3
|
||||
F ext/fts3/fts3_tokenizer1.c 6e5cbaa588924ac578263a598e4fb9f5c9bb179d
|
||||
F ext/fts3/fts3_write.c bc24cec303d86aeb4b40fcbdf9f252f93ef78fc7
|
||||
F ext/fts3/fts3_write.c 4c008450666d6a1f45ba404cf654ebdb3d4da4cd
|
||||
F ext/fts3/fts3speed.tcl b54caf6a18d38174f1a6e84219950d85e98bb1e9
|
||||
F ext/fts3/mkfts3amal.tcl 252ecb7fe6467854f2aa237bf2c390b74e71f100
|
||||
F ext/icu/README.txt bf8461d8cdc6b8f514c080e4e10dc3b2bbdfefa9
|
||||
@ -135,7 +135,7 @@ F src/delete.c cecc926c70783452f3e8eb452c728291ce1a0b21
|
||||
F src/expr.c ab46ab0f0c44979a8164ca31728d7d10ae5e8106
|
||||
F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb
|
||||
F src/fkey.c 9fabba17a4d4778dc660f0cb9d781fc86d7b9d41
|
||||
F src/func.c d93772d9ffa51e4a8f275675bae1f61394c4ab80
|
||||
F src/func.c 59bb046d7e3df1ab512ac339ccb0a6f996a17cb7
|
||||
F src/global.c 29bfb85611dd816b04f10fba0ca910366e128d38
|
||||
F src/hash.c 458488dcc159c301b8e7686280ab209f1fb915af
|
||||
F src/hash.h 2894c932d84d9f892d4b4023a75e501f83050970
|
||||
@ -455,7 +455,7 @@ F test/fts3am.test 218aa6ba0dfc50c7c16b2022aac5c6be593d08d8
|
||||
F test/fts3an.test a49ccadc07a2f7d646ec1b81bc09da2d85a85b18
|
||||
F test/fts3ao.test b83f99f70e9eec85f27d75801a974b3f820e01f9
|
||||
F test/fts3atoken.test 402ef2f7c2fb4b3d4fa0587df6441c1447e799b3
|
||||
F test/fts3auto.test 2f86f2a0e8ffa26d81d570897e6cc1c2262256d5
|
||||
F test/fts3auto.test a98cc895bd92df14ce4a6e94f5c68d33edcc1372
|
||||
F test/fts3aux1.test 0b02743955d56fc0d4d66236a26177bd1b726de0
|
||||
F test/fts3b.test e93bbb653e52afde110ad53bbd793f14fe7a8984
|
||||
F test/fts3c.test fc723a9cf10b397fdfc2b32e73c53c8b1ec02958
|
||||
@ -945,7 +945,7 @@ F tool/split-sqlite3c.tcl d9be87f1c340285a3e081eb19b4a247981ed290c
|
||||
F tool/symbols.sh bc2a3709940d47c8ac8e0a1fdf17ec801f015a00
|
||||
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
|
||||
F tool/warnings.sh 347d974d143cf132f953b565fbc03026f19fcb4d
|
||||
P b1f9c1e0ac51cedfb05ac073a603343f6df865b5
|
||||
R 915dabb427b7d44a9631a4d5ac3ba884
|
||||
U dan
|
||||
Z 905532115e84db070a1615e7e8131374
|
||||
P 0185c4b689d18d66e6aa39b4a7bddc279e3c9d17 63ebcb52a1909aca80f2fef3e982f8fb5929b73b
|
||||
R fc57a2e2686d2dead5f714ec2e85c3f0
|
||||
U drh
|
||||
Z ece8b2c59ad0a86fa0f8629e77710c29
|
||||
|
@ -1 +1 @@
|
||||
0185c4b689d18d66e6aa39b4a7bddc279e3c9d17
|
||||
f9750870ee04935f338e4d808900fee5a8b2b389
|
@ -608,7 +608,7 @@ static int patternCompare(
|
||||
return 0;
|
||||
}
|
||||
}else if( c==matchSet ){
|
||||
int prior_c = 0;
|
||||
u32 prior_c = 0;
|
||||
assert( esc==0 ); /* This only occurs for GLOB, not LIKE */
|
||||
seen = 0;
|
||||
invert = 0;
|
||||
|
@ -530,6 +530,53 @@ foreach {tn create} {
|
||||
do_fts3query_test 4.$tn.4.5 -deferred fi* t1 {on* NEAR/3 fi*}
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
# The following test cases - fts3auto-5.* - focus on using prefix indexes.
|
||||
#
|
||||
set chunkconfig [fts3_configure_incr_load 1 1]
|
||||
foreach {tn create} {
|
||||
1 "fts4(a, b)"
|
||||
2 "fts4(a, b, order=DESC, prefix=1)"
|
||||
3 "fts4(a, b, order=ASC, prefix=1,3)"
|
||||
4 "fts4(a, b, order=DESC, prefix=2,4)"
|
||||
} {
|
||||
|
||||
execsql [subst {
|
||||
DROP TABLE t1;
|
||||
CREATE VIRTUAL TABLE t1 USING $create;
|
||||
}]
|
||||
|
||||
foreach {a b} {
|
||||
"the song of songs which is solomons"
|
||||
"let him kiss me with the kisses of his mouth for thy love is better than wine"
|
||||
"because of the savour of thy good ointments thy name is as ointment poured forth therefore do the virgins love thee"
|
||||
"draw me we will run after thee the king hath brought me into his chambers we will be glad and rejoice in thee we will remember thy love more than wine the upright love thee"
|
||||
"i am black but comely o ye daughters of jerusalem as the tents of kedar as the curtains of solomon"
|
||||
"look not upon me because i am black because the sun hath looked upon me my mothers children were angry with me they made me the keeper of the vineyards but mine own vineyard have i not kept"
|
||||
"tell me o thou whom my soul loveth where thou feedest where thou makest thy flock to rest at noon for why should i be as one that turneth aside by the flocks of thy companions?"
|
||||
"if thou know not o thou fairest among women go thy way forth by the footsteps of the flock and feed thy kids beside the shepherds tents"
|
||||
"i have compared thee o my love to a company of horses in pharaohs chariots"
|
||||
"thy cheeks are comely with rows of jewels thy neck with chains of gold"
|
||||
"we will make thee borders of gold with studs of silver"
|
||||
"while the king sitteth at his table my spikenard sendeth forth the smell thereof"
|
||||
"a bundle of myrrh is my wellbeloved unto me he shall lie all night betwixt my breasts"
|
||||
"my beloved is unto me as a cluster of camphire in the vineyards of en gedi"
|
||||
"behold thou art fair my love behold thou art fair thou hast doves eyes"
|
||||
"behold thou art fair my beloved yea pleasant also our bed is green"
|
||||
"the beams of our house are cedar and our rafters of fir"
|
||||
} {
|
||||
execsql {INSERT INTO t1(a, b) VALUES($a, $b)}
|
||||
}
|
||||
|
||||
do_fts3query_test 5.$tn.1.1 t1 {s*}
|
||||
do_fts3query_test 5.$tn.1.2 t1 {so*}
|
||||
do_fts3query_test 5.$tn.1.3 t1 {"s* o*"}
|
||||
do_fts3query_test 5.$tn.1.4 t1 {b* NEAR/3 a*}
|
||||
do_fts3query_test 5.$tn.1.5 t1 {th* NEAR/5 a* NEAR/5 w*}
|
||||
do_fts3query_test 5.$tn.1.6 t1 {"b* th* art* fair*"}
|
||||
}
|
||||
eval fts3_configure_incr_load $chunkconfig
|
||||
|
||||
set sqlite_fts3_enable_parentheses $sfep
|
||||
finish_test
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user