mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
fixed using VIEW fields (BUG#4617)
mysql-test/r/view.result: using VIEW fields several times in query resolved via temporary tables mysql-test/t/view.test: using VIEW fields several times in query resolved via temporary tables sql/item.h: fixed using of result_field by Item_ref sql/sql_base.cc: Create Item_ref as reference on VIEW fields expression reference sql/sql_insert.cc: privent creating Item_ref in insert list (where Item_fields should be) sql/sql_lex.cc: Item_ref creation control sql/sql_lex.h: Item_ref creation control sql/sql_update.cc: privent creating Item_ref in insert list (where Item_fields should be) and creation Item_fields for UPDATE list sql/table.cc: Do not create Item_ref for internal view of view processing
This commit is contained in:
@@ -76,6 +76,7 @@ check_insert_fields(THD *thd, TABLE_LIST *table_list, List<Item> &fields,
|
||||
else
|
||||
{ // Part field list
|
||||
TABLE_LIST *save_next= table_list->next_local;
|
||||
int res;
|
||||
if (fields.elements != values.elements)
|
||||
{
|
||||
my_printf_error(ER_WRONG_VALUE_COUNT_ON_ROW,
|
||||
@@ -86,12 +87,14 @@ check_insert_fields(THD *thd, TABLE_LIST *table_list, List<Item> &fields,
|
||||
|
||||
table_list->next_local= 0;
|
||||
thd->dupp_field=0;
|
||||
if (setup_fields(thd, 0, table_list, fields, 1, 0, 0))
|
||||
thd->lex->select_lex.no_wrap_view_item= 1;
|
||||
res= setup_fields(thd, 0, table_list, fields, 1, 0, 0);
|
||||
thd->lex->select_lex.no_wrap_view_item= 0;
|
||||
table_list->next_local= save_next;
|
||||
if (res)
|
||||
{
|
||||
table_list->next_local= save_next;
|
||||
return -1;
|
||||
}
|
||||
table_list->next_local= save_next;
|
||||
|
||||
if (check_unique && thd->dupp_field)
|
||||
{
|
||||
|
Reference in New Issue
Block a user