Skip to content
Permalink
Browse files
fixed #201 github#54 empty FACET result set with wrong NULL row; adde…
…d regression to test 327
  • Loading branch information
tomatolog committed Feb 9, 2018
1 parent bcd390e commit 2376e8fc4508944b96959bd10686c6d51f5145e8
Showing with 15 additions and 7 deletions.
  1. +7 −5 src/searchd.cpp
  2. +2 −2 test/test_327/model.bin
  3. +6 −0 test/test_327/test.xml
@@ -8327,16 +8327,18 @@ void SearchHandler_c::RunSubset ( int iStart, int iEnd )
if ( m_bMaster && !tQuery.m_tHaving.m_sAttrName.IsEmpty() )
pAggrFilter = &tQuery.m_tHaving;

if ( tRes.m_iSuccesses>1 || tQuery.m_dItems.GetLength() || pAggrFilter )
const CSphVector<CSphQueryItem> & dItems = ( tQuery.m_dRefItems.GetLength() ? tQuery.m_dRefItems : tQuery.m_dItems );

if ( tRes.m_iSuccesses>1 || dItems.GetLength() || pAggrFilter )
{
if ( pExtraSchema )
pExtraSchema->RLock();
if ( m_bMaster && tRes.m_iSuccesses && tQuery.m_dItems.GetLength() && tQuery.m_sGroupBy.IsEmpty() && tRes.m_dMatches.GetLength()==0 )
if ( m_bMaster && tRes.m_iSuccesses && dItems.GetLength() && tQuery.m_sGroupBy.IsEmpty() && tRes.m_dMatches.GetLength()==0 )
{
ARRAY_FOREACH ( i, tQuery.m_dItems )
ARRAY_FOREACH ( i, dItems )
{
if ( tQuery.m_dItems[i].m_sExpr=="count(*)" || ( tQuery.m_dItems[i].m_sExpr=="@distinct" ) )
tRes.m_dZeroCount.Add ( tQuery.m_dItems[i].m_sAlias );
if ( dItems[i].m_sExpr=="count(*)" || ( dItems[i].m_sExpr=="@distinct" ) )
tRes.m_dZeroCount.Add ( dItems[i].m_sAlias );
}
}

Loading

0 comments on commit 2376e8f

Please sign in to comment.