Skip to content
Permalink
Browse files

fixed #783 crash on many stars at select list for query into many dis…

…tributed indexes; added regression to test 327
  • Loading branch information...
tomatolog committed Apr 2, 2019
1 parent a2ae8cb commit 6967fedb2ef818ec1c825d482563edd05e1c9245
Showing with 15 additions and 3 deletions.
  1. +10 −1 src/searchd.cpp
  2. +2 −2 test/test_327/model.bin
  3. +3 −0 test/test_327/test.xml
@@ -5217,10 +5217,17 @@ const CSphVector<CSphQueryItem> & ExpandAsterisk ( const ISphSchema & tSchema,
dItemsLeftInSchema.Add(i);
}

bool bExpandedAsterisk = false;
ARRAY_FOREACH ( i, tItems )
{
if ( tItems[i].m_sExpr=="*" )
{ // asterisk expands to 'id' + all the items from the schema
{
if ( bExpandedAsterisk )
continue;

bExpandedAsterisk = true;

// asterisk expands to 'id' + all the items from the schema
if ( tSchema.GetAttrIndex ( "id" )<0 && !bNoID )
tExpanded.Add().m_sExpr = "id";

@@ -5233,7 +5240,9 @@ const CSphVector<CSphQueryItem> & ExpandAsterisk ( const ISphSchema & tSchema,
tExpanded.Add().m_sExpr = sName;
}
} else
{
tExpanded.Add ( tItems[i] );
}
}

return tExpanded;
Oops, something went wrong.

0 comments on commit 6967fed

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