diff options
author | Daniel Black <daniel@mariadb.org> | 2022-09-16 11:20:41 +1000 |
---|---|---|
committer | Daniel Black <daniel@mariadb.org> | 2022-10-19 08:15:42 +1100 |
commit | 8c389393695f052990610f8d4fe6935e5cb94c66 (patch) | |
tree | 611ac8b27e55aa79e6b5c35f1b16aedc7a6fdce0 /sql/sql_class.h | |
parent | d6707ab11f65aec04014bb5a550324eba6ae0200 (diff) | |
download | mariadb-git-8c389393695f052990610f8d4fe6935e5cb94c66.tar.gz |
MDEV-29540 Incorrect sequence values in INSERT SELECT
The population of default values in INSERT SELECT was being
performed twice. With sequences, this resulted in every
second sequence value being used.
With SELECT INSERT we remove the second invokation of
table->update_default_fields(). This was already performed
in store_values() invoking fill_record_n_invoke_before_triggers()
which invoked update_default_fields() previously.
We do need to return an error on duplicate values, so the
::store_values is extended to take the ignore option.
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r-- | sql/sql_class.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h index 4d1f5b40db5..9ac973dc640 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -5455,7 +5455,7 @@ class select_insert :public select_result_interceptor { int prepare(List<Item> &list, SELECT_LEX_UNIT *u); virtual int prepare2(JOIN *join); virtual int send_data(List<Item> &items); - virtual void store_values(List<Item> &values); + virtual bool store_values(List<Item> &values, bool ignore_errors); virtual bool can_rollback_data() { return 0; } bool prepare_eof(); bool send_ok_packet(); @@ -5497,7 +5497,7 @@ public: int prepare(List<Item> &list, SELECT_LEX_UNIT *u); int binlog_show_create_table(TABLE **tables, uint count); - void store_values(List<Item> &values); + bool store_values(List<Item> &values, bool ignore_errors); bool send_eof(); virtual void abort_result_set(); virtual bool can_rollback_data() { return 1; } |