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)

This commit is contained in:
bell@sanja.is.com.ua
2004-06-13 22:39:09 +03:00
parent 2f76413e5a
commit d2c585df31
4 changed files with 64 additions and 3 deletions

View File

@ -1308,6 +1308,7 @@ static int mysql_test_create_table(Prepared_statement *stmt,
DBUG_ENTER("mysql_test_create_table");
THD *thd= stmt->thd;
LEX *lex= stmt->lex;
SELECT_LEX *select_lex= &lex->select_lex;
int res= 0;
/* Skip first table, which is the table we are creating */
@ -1316,8 +1317,12 @@ static int mysql_test_create_table(Prepared_statement *stmt,
&create_table_local);
if (!(res= create_table_precheck(thd, tables, create_table)) &&
lex->select_lex.item_list.elements)
select_lex->item_list.elements)
{
select_lex->resolve_mode= SELECT_LEX::SELECT_MODE;
res= select_like_statement_test(stmt, tables);
select_lex->resolve_mode= SELECT_LEX::NOMATTER_MODE;
}
/* put tables back for PS rexecuting */
tables= lex->link_first_table_back(tables, create_table,
@ -1401,7 +1406,11 @@ static int mysql_test_insert_select(Prepared_statement *stmt,
(TABLE_LIST *)lex->select_lex.table_list.first;
/* 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= select_like_statement_test(stmt, tables);
/* revert changes*/
lex->select_lex.table_list.first= (byte*) first_local_table;