mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Remove clear_insert_values() because it was far from trivial to handle the cleanup in all cases
(Old code failed for INSERT ... ON DUPLICATE with prepared statements) Instead, always reset table->insert_values on open. mysql-test/t/trigger.test: Fix test for --ps-protocol sql/sql_base.cc: Clear insert_values on open_table sql/sql_insert.cc: Remove clear_insert_values() sql/sql_parse.cc: Remove clear_insert_values() sql/sql_prepare.cc: Remove clear_insert_values() sql/table.cc: Remove clear_insert_values() sql/table.h: Remove clear_insert_values()
This commit is contained in:
@@ -908,7 +908,11 @@ static bool mysql_test_insert(Prepared_statement *stmt,
|
||||
Item *unused_conds= 0;
|
||||
|
||||
if (table_list->table)
|
||||
table_list->table->insert_values=(byte *)1; // don't allocate insert_values
|
||||
{
|
||||
// don't allocate insert_values
|
||||
table_list->table->insert_values=(byte *)1;
|
||||
}
|
||||
|
||||
if ((res= mysql_prepare_insert(thd, table_list, table_list->table,
|
||||
fields, values, update_fields,
|
||||
update_values, duplic,
|
||||
@@ -934,8 +938,7 @@ static bool mysql_test_insert(Prepared_statement *stmt,
|
||||
res= 0;
|
||||
error:
|
||||
lex->unit.cleanup();
|
||||
if (table_list->table)
|
||||
table_list->table->insert_values=0;
|
||||
/* insert_values is cleared in open_table */
|
||||
DBUG_RETURN(res);
|
||||
}
|
||||
|
||||
@@ -1401,6 +1404,11 @@ static int mysql_test_insert_select(Prepared_statement *stmt,
|
||||
DBUG_ASSERT(first_local_table != 0);
|
||||
/* Skip first table, which is the table we are inserting in */
|
||||
lex->select_lex.table_list.first= (byte*) first_local_table->next_local;
|
||||
if (tables->table)
|
||||
{
|
||||
// don't allocate insert_values
|
||||
tables->table->insert_values=(byte *)1;
|
||||
}
|
||||
|
||||
/*
|
||||
insert/replace from SELECT give its SELECT_LEX for SELECT,
|
||||
|
Reference in New Issue
Block a user