Skip to content

Commit

Permalink
fixed #783 crash on many stars at select list for query into many dis…
Browse files Browse the repository at this point in the history
…tributed indexes; added regression to test 327
  • Loading branch information
tomatolog committed Apr 2, 2019
1 parent a2ae8cb commit 6967fed
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
11 changes: 10 additions & 1 deletion src/searchd.cpp
Expand Up @@ -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";

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

return tExpanded;
Expand Down

0 comments on commit 6967fed

Please sign in to comment.