Skip to content
Permalink
Browse files

fixed #552; crash of daemon on FACET with multiple attribute wide typ…

…es; added regression to test 226
  • Loading branch information
tomatolog committed Nov 9, 2018
1 parent 28ea98f commit eb3c7683b9740cff4cc4cadd2ab9f990b9f7d173
Showing with 22 additions and 3 deletions.
  1. +3 −1 src/sphinxsort.cpp
  2. +2 −2 test/test_226/model.bin
  3. +17 −0 test/test_226/test.xml
@@ -5421,6 +5421,7 @@ ISphMatchSorter * sphCreateQueue ( SphQueueSettings_t & tQueue )
bool bImplicit = false;
// need schema with group related columns however not need grouper
bool bHeadWOGroup = ( pQuery->m_sGroupBy.IsEmpty() && pQuery->m_bFacetHead );
bool bFacet = ( pQuery->m_bFacetHead || pQuery->m_bFacet );

if ( pQuery->m_sGroupBy.IsEmpty() )
ARRAY_FOREACH_COND ( i, pQuery->m_dItems, !bImplicit )
@@ -5477,7 +5478,8 @@ ISphMatchSorter * sphCreateQueue ( SphQueueSettings_t & tQueue )
if ( bGotGroupby && tSorterSchema.GetAttrIndex ( "@groupby" )<0 )
{
ESphAttr eGroupByResult = ( !tSettings.m_bImplicit ) ? tSettings.m_pGrouper->GetResultType() : SPH_ATTR_INTEGER; // implicit do not have grouper
if ( tSettings.m_bMva64 )
// all FACET group by should be widest possible type
if ( tSettings.m_bMva64 || bFacet )
eGroupByResult = SPH_ATTR_BIGINT;

CSphColumnInfo tGroupby ( "@groupby", eGroupByResult );

Large diffs are not rendered by default.

@@ -55,6 +55,21 @@ index facetdemo4
agent = <my_address/>:facetdemo
}

source src10
{
type = mysql
<sql_settings/>
sql_query = SELECT *, price as price_i, price as price_b FROM test_table
sql_attr_uint = price_i
sql_attr_bigint = price_b
}

index facet_gr1
{
source = src10
path = <data_path/>/facet_gr1
}

</config>

<db_create>
@@ -199,6 +214,8 @@ insert into facetdemo (id,price,brand_id,title,brand_name,property,categories,j)
<sphinxql>select id, price from facetdemo facet brand_id as price order by count(*) asc;</sphinxql>
<sphinxql>select * from facetdemo facet brand_id as price order by count(*) asc;</sphinxql>

<!-- regression crash on FACET\group by with different attribute sizes -->
<sphinxql>select * from facet_gr1 order by id asc facet price_i order by id asc facet price_b order by id asc; show meta</sphinxql>

</sphqueries>

0 comments on commit eb3c768

Please sign in to comment.
You can’t perform that action at this time.