1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

do not use Item_ref for view fields if it is UPDATE of INSERT (BUG#5263)

This commit is contained in:
bell@sanja.is.com.ua
2004-09-06 14:37:10 +03:00
parent bb62c80201
commit ebd03ae4a8
3 changed files with 25 additions and 1 deletions

View File

@ -582,6 +582,7 @@ int mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, TABLE *table,
bool insert_into_view= (table_list->view != 0);
/* TODO: use this condition for 'WITH CHECK OPTION' */
Item *unused_conds= 0;
int res;
DBUG_ENTER("mysql_prepare_insert");
if (mysql_prepare_insert_check_table(thd, table_list, fields, &unused_conds))
@ -591,7 +592,10 @@ int mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, TABLE *table,
!insert_into_view) ||
setup_fields(thd, 0, table_list, *values, 0, 0, 0) ||
(duplic == DUP_UPDATE &&
(setup_fields(thd, 0, table_list, update_fields, 0, 0, 0) ||
((thd->lex->select_lex.no_wrap_view_item= 1,
(res= setup_fields(thd, 0, table_list, update_fields, 0, 0, 0)),
thd->lex->select_lex.no_wrap_view_item= 0,
res) ||
setup_fields(thd, 0, table_list, update_values, 0, 0, 0))))
DBUG_RETURN(-1);