Permalink
Browse files

fixed #509 crash on adding full-scan query to PQ index with regexp or…

… rlp options set; added regression to test 358
  • Loading branch information...
tomatolog committed Sep 14, 2018
1 parent 76a35cc commit ae4b3202cbdb8014cabe2b90e269d5cf74f49871
Showing with 19 additions and 2 deletions.
  1. +1 −1 src/sphinxrt.cpp
  2. +1 −1 test/test_358/model.bin
  3. +17 −0 test/test_358/test.xml
@@ -11962,7 +11962,7 @@ bool PercolateIndex_c::AddQuery ( const char * sQuery, const char * sTags, const
const ISphTokenizer * pTokenizer, CSphDict * pDict, CSphString & sError )
{
CSphVector<BYTE> dFiltered;
if ( m_pFieldFilter )
if ( m_pFieldFilter && sQuery )
{
ISphFieldFilterRefPtr_c pFieldFilter { m_pFieldFilter->Clone() };
if ( pFieldFilter && pFieldFilter->Apply ( (const BYTE *)sQuery, strlen ( sQuery ), dFiltered, true ) )
@@ -1 +1 @@
a:1:{i:0;a:4:{i:0;a:2:{s:8:"sphinxql";s:40:"INSERT INTO pq_re VALUES ( 'test blue' )";s:14:"total_affected";i:1;}i:1;a:3:{s:8:"sphinxql";s:76:"CALL PQ ('pq_re', ('test of red', 'color test'), 1 as docs, 0 as docs_json )";s:10:"total_rows";i:1;s:4:"rows";a:1:{i:0;a:2:{s:3:"UID";s:1:"1";s:9:"Documents";s:3:"1,2";}}}i:2;a:1:{s:8:"sphinxql";s:65:"restart-daemon => stop=ok, return code=0; start=ok, return code=2";}i:3;a:3:{s:8:"sphinxql";s:76:"CALL PQ ('pq_re', ('test of red', 'color test'), 1 as docs, 0 as docs_json )";s:10:"total_rows";i:1;s:4:"rows";a:1:{i:0;a:2:{s:3:"UID";s:1:"1";s:9:"Documents";s:3:"1,2";}}}}}
a:1:{i:0;a:8:{i:0;a:2:{s:8:"sphinxql";s:40:"INSERT INTO pq_re VALUES ( 'test blue' )";s:14:"total_affected";i:1;}i:1;a:3:{s:8:"sphinxql";s:76:"CALL PQ ('pq_re', ('test of red', 'color test'), 1 as docs, 0 as docs_json )";s:10:"total_rows";i:1;s:4:"rows";a:1:{i:0;a:2:{s:3:"UID";s:1:"1";s:9:"Documents";s:3:"1,2";}}}i:2;a:1:{s:8:"sphinxql";s:65:"restart-daemon => stop=ok, return code=0; start=ok, return code=2";}i:3;a:3:{s:8:"sphinxql";s:76:"CALL PQ ('pq_re', ('test of red', 'color test'), 1 as docs, 0 as docs_json )";s:10:"total_rows";i:1;s:4:"rows";a:1:{i:0;a:2:{s:3:"UID";s:1:"1";s:9:"Documents";s:3:"1,2";}}}i:4;a:2:{s:8:"sphinxql";s:58:"INSERT INTO pq_re_1 (query, filters) VALUES ('', 'j.a=10')";s:14:"total_affected";i:1;}i:5;a:3:{s:8:"sphinxql";s:21:"SELECT * FROM pq_re_1";s:10:"total_rows";i:1;s:4:"rows";a:1:{i:0;a:4:{s:3:"UID";s:1:"1";s:5:"Query";s:0:"";s:4:"Tags";s:0:"";s:7:"Filters";s:7:" j.a=10";}}}i:6;a:1:{s:8:"sphinxql";s:65:"restart-daemon => stop=ok, return code=0; start=ok, return code=2";}i:7;a:3:{s:8:"sphinxql";s:21:"SELECT * FROM pq_re_1";s:10:"total_rows";i:1;s:4:"rows";a:1:{i:0;a:4:{s:3:"UID";s:1:"1";s:5:"Query";s:0:"";s:4:"Tags";s:0:"";s:7:"Filters";s:7:" j.a=10";}}}}}
@@ -41,6 +41,16 @@ index pq_re
regexp_filter = (blue|red) => color
}
index pq_re_1
{
type = percolate
path = <data_path/>/pq_re_1
rt_field = title
rt_attr_json = j
regexp_filter = (blue|red) => color
}
</config>
<db_create>
@@ -59,6 +69,13 @@ CREATE TABLE `test_table` (
<sphinxql>CALL PQ ('pq_re', ('test of red', 'color test'), 1 as docs, 0 as docs_json )</sphinxql>
<sphinxql system="restart-daemon"/>
<sphinxql>CALL PQ ('pq_re', ('test of red', 'color test'), 1 as docs, 0 as docs_json )</sphinxql>
<!--crash on adding full-scan query to index with field filter -->
<sphinxql>INSERT INTO pq_re_1 (query, filters) VALUES ('', 'j.a=10')</sphinxql>
<sphinxql>SELECT * FROM pq_re_1</sphinxql>
<sphinxql system="restart-daemon"/>
<sphinxql>SELECT * FROM pq_re_1</sphinxql>
</sphqueries>
</test>

0 comments on commit ae4b320

Please sign in to comment.