← Back to team overview

maria-developers team mailing list archive

Item_func_group_concat::fix_fields - indentation and check positioning?


I came across the following gcc warning (6.3.1)

sql/item_sum.cc: In member function ‘virtual bool
Item_func_group_concat::fix_fields(THD*, Item**)’:
sql/item_sum.cc:3478:5: warning: this ‘if’ clause does not guard...
     if ((!args[i]->fixed &&
sql/item_sum.cc:3482:7: note: ...this statement, but the latter is
misleadingly indented as if it is guarded by the ‘if’
       with_subselect|= args[i]->with_subselect;

The with_subselect line was added in 950abd526

In context it is:

Item_func_group_concat::fix_fields(THD *thd, Item **ref)
  for (i=0 ; i < arg_count ; i++)
    if ((!args[i]->fixed &&
         args[i]->fix_fields(thd, args + i)) ||
      return TRUE;
      with_subselect|= args[i]->with_subselect;

While removing the indent would fix the warning, I'd like someone to
check this line should be after the IF statement rather than before.

Follow ups