1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-31 22:22:30 +03:00

Fix bug #9728 decreased functionality in "on duplicate key update"

Remove changes made by bug fix #8147. They strips list of insert_table_list to
only insert table, which results in error reported in bug #9728.
Added flag to Item to resolve ambigous fields reported in bug #8147.
This commit is contained in:
evgen@moonbone.local
2005-06-22 07:18:42 +04:00
parent a24336cdcb
commit 2235ea9593
7 changed files with 66 additions and 9 deletions

View File

@@ -2856,17 +2856,14 @@ unsent_create_error:
if ((res= open_and_lock_tables(thd, tables)))
break;
TABLE *table= tables->table;
/* Skip first table, which is the table we are inserting in */
select_lex->table_list.first= (byte*) first_local_table->next;
tables= (TABLE_LIST *) select_lex->table_list.first;
first_local_table->next= 0;
if (!(res= mysql_prepare_insert(thd, tables, first_local_table,
table, lex->field_list, 0,
tables->table, lex->field_list, 0,
lex->update_list, lex->value_list,
lex->duplicates)) &&
(result= new select_insert(table, &lex->field_list,
(result= new select_insert(tables->table, &lex->field_list,
&lex->update_list, &lex->value_list,
lex->duplicates, lex->ignore)))
{
@@ -2879,7 +2876,7 @@ unsent_create_error:
/* revert changes for SP */
lex->select_lex.resolve_mode= SELECT_LEX::INSERT_MODE;
delete result;
table->insert_values= 0;
tables->table->insert_values= 0;
if (thd->net.report_error)
res= -1;
}