diff --git a/mysql-test/r/mysqld--help.result b/mysql-test/r/mysqld--help.result index 861798aab2e..13139996e61 100644 --- a/mysql-test/r/mysqld--help.result +++ b/mysql-test/r/mysqld--help.result @@ -878,9 +878,10 @@ The following options may be given as the first argument: relay log looking for opportunities for parallel replication. Only used when --slave-parallel-threads > 0. --slave-parallel-threads=# - If non-zero, number of threads to spawn to apply in - parallel events on the slave that were group-committed on - the master or were logged with GTID in different + Alpha feature, to only be used by developers doing + testing! If non-zero, number of threads to spawn to apply + in parallel events on the slave that were group-committed + on the master or were logged with GTID in different replication domains. --slave-skip-errors=name Tells the slave thread to continue replication when a diff --git a/sql/slave.cc b/sql/slave.cc index 1ba8cd0630d..8780debb375 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -3498,6 +3498,7 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli, slave_sleep(thd, MY_MIN(serial_rgi->trans_retries, MAX_SLAVE_RETRY_PAUSE), sql_slave_killed, serial_rgi); + serial_rgi->trans_retries++; mysql_mutex_lock(&rli->data_lock); // because of SHOW STATUS rli->retried_trans++; statistic_increment(slave_retried_transactions, LOCK_status); diff --git a/sql/sql_base.cc b/sql/sql_base.cc index f2f459a3cee..0eed69e093e 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1500,26 +1500,16 @@ TABLE *find_temporary_table(THD *thd, const char *db, const char *table_name) TABLE *find_temporary_table(THD *thd, const TABLE_LIST *tl) { - const char *key; + const char *tmp_key; + char key[MAX_DBKEY_LENGTH]; uint key_length; - char key_suffix[TMP_TABLE_KEY_EXTRA]; - TABLE *table; - key_length= get_table_def_key(tl, &key); + key_length= get_table_def_key(tl, &tmp_key); + memcpy(key, tmp_key, key_length); + int4store(key + key_length, thd->variables.server_id); + int4store(key + key_length + 4, thd->variables.pseudo_thread_id); - int4store(key_suffix, thd->variables.server_id); - int4store(key_suffix + 4, thd->variables.pseudo_thread_id); - - for (table= thd->temporary_tables; table; table= table->next) - { - if ((table->s->table_cache_key.length == key_length + - TMP_TABLE_KEY_EXTRA) && - !memcmp(table->s->table_cache_key.str, key, key_length) && - !memcmp(table->s->table_cache_key.str + key_length, key_suffix, - TMP_TABLE_KEY_EXTRA)) - return table; - } - return NULL; + return find_temporary_table(thd, key, key_length + TMP_TABLE_KEY_EXTRA); } @@ -5606,9 +5596,9 @@ bool open_temporary_table(THD *thd, TABLE_LIST *tl) */ DBUG_ASSERT(!tl->derived && !tl->schema_table); - if (tl->open_type == OT_BASE_ONLY) + if (tl->open_type == OT_BASE_ONLY || !thd->have_temporary_tables()) { - DBUG_PRINT("info", ("skip_temporary is set")); + DBUG_PRINT("info", ("skip_temporary is set or no temporary tables")); DBUG_RETURN(FALSE); } diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index c81c2d6366a..bf44581ed73 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -1726,6 +1726,7 @@ fix_slave_parallel_threads(sys_var *self, THD *thd, enum_var_type type) static Sys_var_ulong Sys_slave_parallel_threads( "slave_parallel_threads", + "Alpha feature, to only be used by developers doing testing! " "If non-zero, number of threads to spawn to apply in parallel events " "on the slave that were group-committed on the master or were logged " "with GTID in different replication domains.",