1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

fixed field resolving mode fo INSERT/REPLACE and CRETE with SELECT (BUG#4090)

mysql-test/r/subselect.result:
  outer fields resolving in INSERT/REPLACE and CRETE with SELECT
mysql-test/t/subselect.test:
  outer fields resolving in INSERT/REPLACE and CRETE with SELECT
sql/sql_parse.cc:
  fixed field resolving mode fo INSERT/REPLACE and CRETE with SELECT
sql/sql_prepare.cc:
  fixed field resolving mode fo INSERT/REPLACE and CRETE with SELECT
This commit is contained in:
unknown
2004-06-13 22:39:09 +03:00
parent 400648ebd0
commit 6f364111cb
4 changed files with 64 additions and 3 deletions

View File

@ -2334,7 +2334,15 @@ mysql_execute_command(THD *thd)
lex->create_list,
lex->key_list,
select_lex->item_list,lex->duplicates)))
{
/*
CREATE from SELECT give its SELECT_LEX for SELECT,
and item_list belong to SELECT
*/
select_lex->resolve_mode= SELECT_LEX::SELECT_MODE;
res=handle_select(thd, lex, result);
select_lex->resolve_mode= SELECT_LEX::NOMATTER_MODE;
}
//reset for PS
lex->create_list.empty();
lex->key_list.empty();
@ -2685,7 +2693,11 @@ unsent_create_error:
lex->duplicates)))
/* Skip first table, which is the table we are inserting in */
lex->select_lex.table_list.first= (byte*) first_local_table->next;
lex->select_lex.resolve_mode= SELECT_LEX::NOMATTER_MODE;
/*
insert/replace from SELECT give its SELECT_LEX for SELECT,
and item_list belong to SELECT
*/
lex->select_lex.resolve_mode= SELECT_LEX::SELECT_MODE;
res=handle_select(thd,lex,result);
/* revert changes for SP */
lex->select_lex.table_list.first= (byte*) first_local_table;