mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
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.
This commit is contained in:
@ -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; }
|
||||
|
Reference in New Issue
Block a user