Don't do anything when input doclists are both empty. Ticket #2774 (CVS 4546)

FossilOrigin-Name: 75cb46f82a6a95dbe9e279dede299bafa2e91cae
This commit is contained in:
shess 2007-11-16 00:23:07 +00:00
parent a185ddbfba
commit cd7274ceb0
6 changed files with 29 additions and 17 deletions

View File

@ -1351,7 +1351,7 @@ static void docListUnion(
DLWriter writer;
if( nLeft==0 ){
dataBufferAppend(pOut, pRight, nRight);
if( nRight!=0) dataBufferAppend(pOut, pRight, nRight);
return;
}
if( nRight==0 ){
@ -1532,7 +1532,7 @@ static void docListOrMerge(
DLWriter writer;
if( nLeft==0 ){
dataBufferAppend(pOut, pRight, nRight);
if( nRight!=0 ) dataBufferAppend(pOut, pRight, nRight);
return;
}
if( nRight==0 ){

View File

@ -1335,7 +1335,7 @@ static void docListUnion(
DLWriter writer;
if( nLeft==0 ){
dataBufferAppend(pOut, pRight, nRight);
if( nRight!=0) dataBufferAppend(pOut, pRight, nRight);
return;
}
if( nRight==0 ){
@ -1633,7 +1633,7 @@ static void docListOrMerge(
DLWriter writer;
if( nLeft==0 ){
dataBufferAppend(pOut, pRight, nRight);
if( nRight!=0 ) dataBufferAppend(pOut, pRight, nRight);
return;
}
if( nRight==0 ){

View File

@ -1,5 +1,5 @@
C Return\sSQLITE_MISUSE\sinstead\sof\scrashing\sif\sNULL\sis\s(incorrectly)\spassed\sto\ssqlite3_step().\sTicket\s#2773.\s(CVS\s4545)
D 2007-11-15T16:04:15
C Don't\sdo\sanything\swhen\sinput\sdoclists\sare\sboth\sempty.\s\sTicket\s#2774\s(CVS\s4546)
D 2007-11-16T00:23:08
F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7
F Makefile.in 30c7e3ba426ddb253b8ef037d1873425da6009a8
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@ -38,7 +38,7 @@ F ext/fts1/simple_tokenizer.c 1844d72f7194c3fd3d7e4173053911bf0661b70d
F ext/fts1/tokenizer.h 0c53421b832366d20d720d21ea3e1f6e66a36ef9
F ext/fts2/README.tokenizers 2ff290e0a130f6e7611f2e608cb3b5aaea721abc
F ext/fts2/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d
F ext/fts2/fts2.c 02720dd6e35c1ec836d17de2c9941ee1c369d884
F ext/fts2/fts2.c 9c7d635a3d48874c326d2376d900abf66a298d0f
F ext/fts2/fts2.h da5f76c65163301d1068a971fd32f4119e3c95fa
F ext/fts2/fts2_hash.c cafebb4620d19684c4c9872530012441df60f503
F ext/fts2/fts2_hash.h e283308156018329f042816eb09334df714e105e
@ -50,7 +50,7 @@ F ext/fts2/fts2_tokenizer1.c 8a545c232bdffafd117c4eeaf59789691909f26a
F ext/fts2/mkfts2amal.tcl 974d5d438cb3f7c4a652639262f82418c1e4cff0
F ext/fts3/README.tokenizers a97c9a55b3422f6cb04af9de9296fe2447ea4a78
F ext/fts3/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d
F ext/fts3/fts3.c 80b5eb9081232712e204614734bc30a8dbbd2140
F ext/fts3/fts3.c 2e77742df5822f14f835442e799e9d13cfb281d5
F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe
F ext/fts3/fts3_hash.c 1c2dc969a5b485848fb804c0ac41a046f18a09c9
F ext/fts3/fts3_hash.h 004b759e1602ff16dfa02fea3ca1c77336ad6798
@ -282,7 +282,7 @@ F test/fts2c.test ffb5a35230ac72c4354535c547965ce6824537c0
F test/fts2d.test b7eaa671ca9a16997f3e5b158ee777ae21052b0b
F test/fts2e.test 2da13dbc2d009105f42196845c1e1ce136c03d38
F test/fts2f.test cf84096235991709c1e61caa389632aa0a4f976d
F test/fts2g.test 2638452a2ea809ae30e98acc3c063fe54c381d0a
F test/fts2g.test d49d6f6c900e6e20a0fb980ec1cd568dee12af76
F test/fts2h.test 223af921323b409d4b5b18ff4e51619541b174bb
F test/fts2i.test 1b22451d1f13f7c509baec620dc3a4a754885dd6
F test/fts2j.test f68d7611f76309bc8b94170f3740d9fbbc061d9b
@ -298,7 +298,7 @@ F test/fts3ac.test 356280144a2c92aa7b11474afadfe62a437fcd69
F test/fts3ad.test 32a114c6f214081f244f642bde9fd5517938788e
F test/fts3ae.test 31d8137fc7c14b5b991e3c4fa041ad2ac1255c7b
F test/fts3af.test d394978c534eabf22dd0837e718b913fd66b499c
F test/fts3ag.test 107664eed6c42cf6886f2cdcd3afbf3950370b8b
F test/fts3ag.test 1c316bedb40a7c962e38998df854ea3ae26a3daa
F test/fts3ah.test ba181d6a3dee0c929f0d69df67cac9c47cda6bff
F test/fts3ai.test d29cee6ed653e30de478066881cec8aa766531b2
F test/fts3aj.test 584facbc9ac4381a7ec624bfde677340ffc2a5a4
@ -587,7 +587,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
P d05eb67dd6e171cfe8b9528aa3c7c953780d8c82
R 9acff769b3adb7f693b9b5ea49173f93
U danielk1977
Z 8d55885cb813c4feb6a2a8686164b3b8
P 3bfee76fa6191c6e3aaa4632949b53253c612f36
R 71e33fb18b19046ee138d1704767511a
U shess
Z 2e4be0fc57c5fedb87f3cd5c96e1d006

View File

@ -1 +1 @@
3bfee76fa6191c6e3aaa4632949b53253c612f36
75cb46f82a6a95dbe9e279dede299bafa2e91cae

View File

@ -7,7 +7,7 @@
# of this script is testing handling of edge cases for various doclist
# merging functions in the FTS2 module query logic.
#
# $Id: fts2g.test,v 1.2 2007/04/19 18:36:32 shess Exp $
# $Id: fts2g.test,v 1.3 2007/11/16 00:23:08 shess Exp $
#
set testdir [file dirname $argv0]
@ -84,4 +84,10 @@ do_test fts2g-1.12 {
execsql {SELECT rowid FROM t1 WHERE t1 MATCH 'also OR this'}
} {1 2}
# Empty left and right in docListOrMerge(). Each term matches neither
# row, and when combined there was an assertion failure.
do_test fts2g-1.13 {
execsql {SELECT rowid FROM t1 WHERE t1 MATCH 'something OR nothing'}
} {}
finish_test

View File

@ -7,7 +7,7 @@
# of this script is testing handling of edge cases for various doclist
# merging functions in the FTS3 module query logic.
#
# $Id: fts3ag.test,v 1.1 2007/08/20 17:38:42 shess Exp $
# $Id: fts3ag.test,v 1.2 2007/11/16 00:23:08 shess Exp $
#
set testdir [file dirname $argv0]
@ -84,4 +84,10 @@ do_test fts3ag-1.12 {
execsql {SELECT rowid FROM t1 WHERE t1 MATCH 'also OR this'}
} {1 2}
# Empty left and right in docListOrMerge(). Each term matches neither
# row, and when combined there was an assertion failure.
do_test fts3ag-1.13 {
execsql {SELECT rowid FROM t1 WHERE t1 MATCH 'something OR nothing'}
} {}
finish_test