The problem was that expression with field after transformation (on the first execution)

reached by fix_fields() (via reference) before row which it belongs to (on the second execution)
and fix_field for row did not follow usual protocol for Items with argument
(first check that the item fixed then call fix_fields).

Item_row::fix_field fixed.
This commit is contained in:
unknown 2013-01-25 16:56:57 +02:00
commit 298008dc4f
4 changed files with 52 additions and 1 deletions

View file

@ -68,7 +68,8 @@ bool Item_row::fix_fields(THD *thd, Item **ref)
Item **arg, **arg_end;
for (arg= items, arg_end= items+arg_count; arg != arg_end ; arg++)
{
if ((*arg)->fix_fields(thd, arg))
if (!(*arg)->fixed &&
(*arg)->fix_fields(thd, arg))
return TRUE;
// we can't assign 'item' before, because fix_fields() can change arg
Item *item= *arg;