1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Bug #18080: INSERT ... SELECT ... JOIN results in ambiguous field list error

There was an incomplete reset of the name resolution context, that caused 
INSERT ... SELECT ... JOIN statements to resolve not by joint row type calculated
for the join.
Removed the redundant re-initialization of the context, because 
mysql_insert_select_prepare() now correctly saves/restores the context.
This commit is contained in:
gkodinov@mysql.com
2006-06-19 17:34:12 +03:00
parent 92b4a73a20
commit 5508df251f
3 changed files with 14 additions and 9 deletions

View File

@ -3333,15 +3333,6 @@ end_with_restore_list:
&lex->value_list,
lex->duplicates, lex->ignore)))
{
/*
Skip first table, which is the table we are inserting in.
Below we set context.table_list again because the call above to
mysql_insert_select_prepare() calls resolve_in_table_list_only(),
which in turn resets context.table_list and
context.first_name_resolution_table.
*/
select_lex->context.table_list=
select_lex->context.first_name_resolution_table= second_table;
res= handle_select(thd, lex, result, OPTION_SETUP_TABLES_DONE);
/*
Invalidate the table in the query cache if something changed