1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

Bug#10109

"INSERT .. SELECT ... ON DUPLICATE KEY UPDATE fails"
  Ensure that check_insert_fields() is only called once when
  doing an INSERT..SELECT


mysql-test/r/insert_update.result:
  Test for bug 10109
mysql-test/t/insert_update.test:
  Test for bug 10109
sql/sql_class.h:
  select_insert needs more state
sql/sql_insert.cc:
  ensure that check_insert_fields() is only called once when
  doing an INSERT...SELECT
sql/sql_parse.cc:
  more args for select_insert constructor
This commit is contained in:
unknown
2005-08-07 03:16:15 +01:00
parent 75c06af277
commit fdb4d307ab
5 changed files with 58 additions and 15 deletions

View File

@@ -1236,19 +1236,27 @@ class select_insert :public select_result_interceptor {
List<Item> *fields;
ulonglong last_insert_id;
COPY_INFO info;
TABLE_LIST *insert_table_list;
TABLE_LIST *dup_table_list;
select_insert(TABLE *table_par, List<Item> *fields_par,
enum_duplicates duplic, bool ignore)
:table(table_par), fields(fields_par), last_insert_id(0)
:table(table_par), fields(fields_par), last_insert_id(0),
insert_table_list(0), dup_table_list(0)
{
bzero((char*) &info,sizeof(info));
info.ignore= ignore;
info.handle_duplicates=duplic;
}
select_insert(TABLE *table_par, List<Item> *fields_par,
select_insert(TABLE *table_par,
TABLE_LIST *insert_table_list_par,
TABLE_LIST *dup_table_list_par,
List<Item> *fields_par,
List<Item> *update_fields, List<Item> *update_values,
enum_duplicates duplic, bool ignore)
:table(table_par), fields(fields_par), last_insert_id(0)
:table(table_par), fields(fields_par), last_insert_id(0),
insert_table_list(insert_table_list_par),
dup_table_list(dup_table_list_par)
{
bzero((char*) &info,sizeof(info));
info.ignore= ignore;