summaryrefslogtreecommitdiff
path: root/sql/sql_prepare.cc
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2005-01-03 13:56:23 +0200
committerunknown <monty@mysql.com>2005-01-03 13:56:23 +0200
commite055be6658fff00587999a1aab7dae522ba99cfc (patch)
treef27a4a08cde5c6ad67311ca316ad5011ad1759dd /sql/sql_prepare.cc
parent3652c4edd94af2b0ae0a9f7bb06e58dea7cfdc15 (diff)
downloadmariadb-git-e055be6658fff00587999a1aab7dae522ba99cfc.tar.gz
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()
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r--sql/sql_prepare.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 92d92b73813..0a35b2dda8a 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -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,