Skip to content
Permalink
Browse files

fixed #611 crash of daemon at delete query to RT index with field fil…

…ters; added regression to test 194
  • Loading branch information
tomatolog committed Dec 21, 2018
1 parent 63b7873 commit cd9e4f1709a48ddafc128c450c2d882bc11ba50e
Showing with 6 additions and 3 deletions.
  1. +1 −1 src/sphinx.cpp
  2. +1 −1 src/sphinxrt.cpp
  3. +1 −1 test/test_194/model.bin
  4. +3 −0 test/test_194/test.xml
@@ -17837,7 +17837,7 @@ bool CSphIndex_VLN::MultiQuery ( const CSphQuery * pQuery, CSphQueryResult * pRe
const BYTE * sModifiedQuery = (BYTE *)pQuery->m_sQuery.cstr();

ISphFieldFilterRefPtr_c pFieldFilter;
if ( m_pFieldFilter )
if ( m_pFieldFilter && sModifiedQuery )
{
pFieldFilter = m_pFieldFilter->Clone();
if ( pFieldFilter && pFieldFilter->Apply ( sModifiedQuery, strlen ( (char*)sModifiedQuery ), dFiltered, true ) )
@@ -7014,7 +7014,7 @@ bool RtIndex_t::MultiQuery ( const CSphQuery * pQuery, CSphQueryResult * pResult
const BYTE * sModifiedQuery = (BYTE *)pQuery->m_sQuery.cstr();

ISphFieldFilterRefPtr_c pFieldFilter;
if ( m_pFieldFilter )
if ( m_pFieldFilter && sModifiedQuery )
{
pFieldFilter = m_pFieldFilter->Clone();
if ( pFieldFilter && pFieldFilter->Apply ( sModifiedQuery, strlen ( (char*)sModifiedQuery ), dFiltered, true ) )
@@ -1 +1 @@
a:1:{i:0;a:17:{i:0;a:3:{s:8:"sphinxql";s:41:"select * from test where match('як-42')";s:10:"total_rows";i:2;s:4:"rows";a:2:{i:0;a:1:{s:2:"id";s:3:"102";}i:1;a:1:{s:2:"id";s:3:"103";}}}i:1;a:3:{s:8:"sphinxql";s:40:"select * from test where match('як42')";s:10:"total_rows";i:2;s:4:"rows";a:2:{i:0;a:1:{s:2:"id";s:3:"102";}i:1;a:1:{s:2:"id";s:3:"103";}}}i:2;a:3:{s:8:"sphinxql";s:37:"select * from test where match('21"')";s:10:"total_rows";i:2;s:4:"rows";a:2:{i:0;a:1:{s:2:"id";s:3:"100";}i:1;a:1:{s:2:"id";s:3:"101";}}}i:3;a:3:{s:8:"sphinxql";s:40:"select * from test where match('21inch')";s:10:"total_rows";i:2;s:4:"rows";a:2:{i:0;a:1:{s:2:"id";s:3:"100";}i:1;a:1:{s:2:"id";s:3:"101";}}}i:4;a:2:{s:8:"sphinxql";s:38:"select * from test where match('inch')";s:10:"total_rows";i:0;}i:5;a:3:{s:8:"sphinxql";s:39:"select * from test where match('color')";s:10:"total_rows";i:2;s:4:"rows";a:2:{i:0;a:1:{s:2:"id";s:3:"100";}i:1;a:1:{s:2:"id";s:3:"104";}}}i:6;a:3:{s:8:"sphinxql";s:38:"select * from test where match('blue')";s:10:"total_rows";i:2;s:4:"rows";a:2:{i:0;a:1:{s:2:"id";s:3:"100";}i:1;a:1:{s:2:"id";s:3:"104";}}}i:7;a:2:{s:8:"sphinxql";s:39:"select * from test where match('file1')";s:10:"total_rows";i:0;}i:8;a:2:{s:8:"sphinxql";s:39:"select * from test where match('file2')";s:10:"total_rows";i:0;}i:9;a:3:{s:8:"sphinxql";s:39:"select * from test where match('fx-35')";s:10:"total_rows";i:1;s:4:"rows";a:1:{i:0;a:1:{s:2:"id";s:3:"101";}}}i:10;a:3:{s:8:"sphinxql";s:38:"select * from test where match('fx35')";s:10:"total_rows";i:1;s:4:"rows";a:1:{i:0;a:1:{s:2:"id";s:3:"101";}}}i:11;a:3:{s:8:"sphinxql";s:37:"select * from test where match('car')";s:10:"total_rows";i:1;s:4:"rows";a:1:{i:0;a:1:{s:2:"id";s:3:"101";}}}i:12;a:3:{s:8:"sphinxql";s:45:"select * from test_large where match('color')";s:10:"total_rows";i:1;s:4:"rows";a:1:{i:0;a:2:{s:2:"id";s:1:"1";s:3:"idd";s:2:"11";}}}i:13;a:2:{s:8:"sphinxql";s:71:"INSERT INTO rt1 ( id, idd, title ) VALUES ( 1, 11, 'test another test')";s:14:"total_affected";i:1;}i:14;a:2:{s:8:"sphinxql";s:18:"FLUSH RAMCHUNK rt1";s:14:"total_affected";i:0;}i:15;a:2:{s:8:"sphinxql";s:58:"INSERT INTO rt1 ( id, idd, title ) VALUES ( 2, 22, 'test')";s:14:"total_affected";i:1;}i:16;a:3:{s:8:"sphinxql";s:34:"CALL KEYWORDS ( 'test', 'rt1', 1 )";s:10:"total_rows";i:1;s:4:"rows";a:1:{i:0;a:5:{s:4:"qpos";s:1:"1";s:9:"tokenized";s:4:"test";s:10:"normalized";s:4:"test";s:4:"docs";s:1:"2";s:4:"hits";s:1:"3";}}}}}
a:1:{i:0;a:18:{i:0;a:3:{s:8:"sphinxql";s:41:"select * from test where match('як-42')";s:10:"total_rows";i:2;s:4:"rows";a:2:{i:0;a:1:{s:2:"id";s:3:"102";}i:1;a:1:{s:2:"id";s:3:"103";}}}i:1;a:3:{s:8:"sphinxql";s:40:"select * from test where match('як42')";s:10:"total_rows";i:2;s:4:"rows";a:2:{i:0;a:1:{s:2:"id";s:3:"102";}i:1;a:1:{s:2:"id";s:3:"103";}}}i:2;a:3:{s:8:"sphinxql";s:37:"select * from test where match('21"')";s:10:"total_rows";i:2;s:4:"rows";a:2:{i:0;a:1:{s:2:"id";s:3:"100";}i:1;a:1:{s:2:"id";s:3:"101";}}}i:3;a:3:{s:8:"sphinxql";s:40:"select * from test where match('21inch')";s:10:"total_rows";i:2;s:4:"rows";a:2:{i:0;a:1:{s:2:"id";s:3:"100";}i:1;a:1:{s:2:"id";s:3:"101";}}}i:4;a:2:{s:8:"sphinxql";s:38:"select * from test where match('inch')";s:10:"total_rows";i:0;}i:5;a:3:{s:8:"sphinxql";s:39:"select * from test where match('color')";s:10:"total_rows";i:2;s:4:"rows";a:2:{i:0;a:1:{s:2:"id";s:3:"100";}i:1;a:1:{s:2:"id";s:3:"104";}}}i:6;a:3:{s:8:"sphinxql";s:38:"select * from test where match('blue')";s:10:"total_rows";i:2;s:4:"rows";a:2:{i:0;a:1:{s:2:"id";s:3:"100";}i:1;a:1:{s:2:"id";s:3:"104";}}}i:7;a:2:{s:8:"sphinxql";s:39:"select * from test where match('file1')";s:10:"total_rows";i:0;}i:8;a:2:{s:8:"sphinxql";s:39:"select * from test where match('file2')";s:10:"total_rows";i:0;}i:9;a:3:{s:8:"sphinxql";s:39:"select * from test where match('fx-35')";s:10:"total_rows";i:1;s:4:"rows";a:1:{i:0;a:1:{s:2:"id";s:3:"101";}}}i:10;a:3:{s:8:"sphinxql";s:38:"select * from test where match('fx35')";s:10:"total_rows";i:1;s:4:"rows";a:1:{i:0;a:1:{s:2:"id";s:3:"101";}}}i:11;a:3:{s:8:"sphinxql";s:37:"select * from test where match('car')";s:10:"total_rows";i:1;s:4:"rows";a:1:{i:0;a:1:{s:2:"id";s:3:"101";}}}i:12;a:3:{s:8:"sphinxql";s:45:"select * from test_large where match('color')";s:10:"total_rows";i:1;s:4:"rows";a:1:{i:0;a:2:{s:2:"id";s:1:"1";s:3:"idd";s:2:"11";}}}i:13;a:2:{s:8:"sphinxql";s:71:"INSERT INTO rt1 ( id, idd, title ) VALUES ( 1, 11, 'test another test')";s:14:"total_affected";i:1;}i:14;a:2:{s:8:"sphinxql";s:18:"FLUSH RAMCHUNK rt1";s:14:"total_affected";i:0;}i:15;a:2:{s:8:"sphinxql";s:58:"INSERT INTO rt1 ( id, idd, title ) VALUES ( 2, 22, 'test')";s:14:"total_affected";i:1;}i:16;a:3:{s:8:"sphinxql";s:34:"CALL KEYWORDS ( 'test', 'rt1', 1 )";s:10:"total_rows";i:1;s:4:"rows";a:1:{i:0;a:5:{s:4:"qpos";s:1:"1";s:9:"tokenized";s:4:"test";s:10:"normalized";s:4:"test";s:4:"docs";s:1:"2";s:4:"hits";s:1:"3";}}}i:17;a:2:{s:8:"sphinxql";s:30:"DELETE FROM rt1 WHERE idd>1000";s:14:"total_affected";i:0;}}}
@@ -111,6 +111,9 @@ INSERT INTO test_table VALUES
<sphinxql>INSERT INTO rt1 ( id, idd, title ) VALUES ( 2, 22, 'test')</sphinxql>
<sphinxql>CALL KEYWORDS ( 'test', 'rt1', 1 )</sphinxql>

<!-- regression crash of daemon at delete query to RT index with field filter -->
<sphinxql>DELETE FROM rt1 WHERE idd>1000</sphinxql>

</sphqueries>

</test>

0 comments on commit cd9e4f1

Please sign in to comment.