Fix of LP bug#706884: fill_record should be used for only one table (no need list).
sql/sql_base.cc: fill_record should be used for only one table (no need list).
This commit is contained in:
parent
7effc175ce
commit
e2bd1ee9df
@ -8256,11 +8256,9 @@ fill_record(THD * thd, List<Item> &fields, List<Item> &values,
|
|||||||
List_iterator_fast<Item> f(fields),v(values);
|
List_iterator_fast<Item> f(fields),v(values);
|
||||||
Item *value, *fld;
|
Item *value, *fld;
|
||||||
Item_field *field;
|
Item_field *field;
|
||||||
TABLE *table= 0;
|
TABLE *table= 0, *vcol_table= 0;
|
||||||
List<TABLE> tbl_list;
|
|
||||||
bool abort_on_warning_saved= thd->abort_on_warning;
|
bool abort_on_warning_saved= thd->abort_on_warning;
|
||||||
DBUG_ENTER("fill_record");
|
DBUG_ENTER("fill_record");
|
||||||
tbl_list.empty();
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Reset the table->auto_increment_field_not_null as it is valid for
|
Reset the table->auto_increment_field_not_null as it is valid for
|
||||||
@ -8283,7 +8281,7 @@ fill_record(THD * thd, List<Item> &fields, List<Item> &values,
|
|||||||
f.rewind();
|
f.rewind();
|
||||||
}
|
}
|
||||||
else if (thd->lex->unit.insert_table_with_stored_vcol)
|
else if (thd->lex->unit.insert_table_with_stored_vcol)
|
||||||
tbl_list.push_back(thd->lex->unit.insert_table_with_stored_vcol);
|
vcol_table= thd->lex->unit.insert_table_with_stored_vcol;
|
||||||
while ((fld= f++))
|
while ((fld= f++))
|
||||||
{
|
{
|
||||||
if (!(field= fld->filed_for_view_update()))
|
if (!(field= fld->filed_for_view_update()))
|
||||||
@ -8313,31 +8311,17 @@ fill_record(THD * thd, List<Item> &fields, List<Item> &values,
|
|||||||
my_message(ER_UNKNOWN_ERROR, ER(ER_UNKNOWN_ERROR), MYF(0));
|
my_message(ER_UNKNOWN_ERROR, ER(ER_UNKNOWN_ERROR), MYF(0));
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
tbl_list.push_back(table);
|
DBUG_ASSERT(vcol_table == 0 || vcol_table == table);
|
||||||
|
vcol_table= table;
|
||||||
}
|
}
|
||||||
/* Update virtual fields*/
|
/* Update virtual fields*/
|
||||||
thd->abort_on_warning= FALSE;
|
thd->abort_on_warning= FALSE;
|
||||||
if (tbl_list.head())
|
if (vcol_table)
|
||||||
{
|
{
|
||||||
List_iterator_fast<TABLE> it(tbl_list);
|
if (vcol_table->vfield)
|
||||||
TABLE *prev_table= 0;
|
|
||||||
while ((table= it++))
|
|
||||||
{
|
{
|
||||||
/*
|
if (update_virtual_fields(thd, vcol_table, TRUE))
|
||||||
Do simple optimization to prevent unnecessary re-generating
|
goto err;
|
||||||
values for virtual fields
|
|
||||||
*/
|
|
||||||
if (table != prev_table)
|
|
||||||
{
|
|
||||||
prev_table= table;
|
|
||||||
if (table->vfield)
|
|
||||||
{
|
|
||||||
if (update_virtual_fields(thd, table, TRUE))
|
|
||||||
{
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
thd->abort_on_warning= abort_on_warning_saved;
|
thd->abort_on_warning= abort_on_warning_saved;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user