1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge 10.4 into 10.5

This commit is contained in:
Marko Mäkelä
2020-12-02 18:29:49 +02:00
123 changed files with 2481 additions and 450 deletions

View File

@ -1769,7 +1769,7 @@ int write_record(THD *thd, TABLE *table, COPY_INFO *info, select_result *sink)
int error, trg_error= 0;
char *key=0;
MY_BITMAP *save_read_set, *save_write_set;
table->file->store_auto_increment();
ulonglong prev_insert_id= table->file->next_insert_id;
ulonglong insert_id_for_cur_row= 0;
ulonglong prev_insert_id_for_cur_row= 0;
DBUG_ENTER("write_record");
@ -1918,7 +1918,7 @@ int write_record(THD *thd, TABLE *table, COPY_INFO *info, select_result *sink)
if (res == VIEW_CHECK_ERROR)
goto before_trg_err;
table->file->restore_auto_increment();
table->file->restore_auto_increment(prev_insert_id);
info->touched++;
if (different_records)
{
@ -2110,7 +2110,7 @@ int write_record(THD *thd, TABLE *table, COPY_INFO *info, select_result *sink)
if (!(thd->variables.old_behavior &
OLD_MODE_NO_DUP_KEY_WARNINGS_WITH_IGNORE))
table->file->print_error(error, MYF(ME_WARNING));
table->file->restore_auto_increment();
table->file->restore_auto_increment(prev_insert_id);
goto after_trg_or_ignored_err;
}
@ -2143,7 +2143,7 @@ err:
table->file->print_error(error,MYF(0));
before_trg_err:
table->file->restore_auto_increment();
table->file->restore_auto_increment(prev_insert_id);
if (key)
my_safe_afree(key, table->s->max_unique_length);
table->column_bitmaps_set(save_read_set, save_write_set);
@ -2297,7 +2297,7 @@ public:
if (table)
{
close_thread_tables(&thd);
thd.mdl_context.release_transactional_locks();
thd.mdl_context.release_transactional_locks(&thd);
}
mysql_mutex_destroy(&mutex);
mysql_cond_destroy(&cond);
@ -3130,7 +3130,7 @@ pthread_handler_t handle_delayed_insert(void *arg)
if (thd->mdl_context.clone_ticket(&di->grl_protection) ||
thd->mdl_context.clone_ticket(&di->table_list.mdl_request))
{
thd->mdl_context.release_transactional_locks();
thd->release_transactional_locks();
di->handler_thread_initialized= TRUE;
goto err;
}
@ -3356,7 +3356,7 @@ pthread_handler_t handle_delayed_insert(void *arg)
thd->set_killed(KILL_CONNECTION_HARD); // If error
close_thread_tables(thd); // Free the table
thd->mdl_context.release_transactional_locks();
thd->release_transactional_locks();
mysql_cond_broadcast(&di->cond_client); // Safety
mysql_mutex_lock(&LOCK_delayed_create); // Because of delayed_get_table
@ -4971,6 +4971,7 @@ bool select_create::send_eof()
WSREP_ERROR("Appending table key for CTAS failed: %s, %d",
(wsrep_thd_query(thd)) ?
wsrep_thd_query(thd) : "void", rcode);
abort_result_set();
DBUG_RETURN(true);
}
/* If commit fails, we should be able to reset the OK status. */