summaryrefslogtreecommitdiff
path: root/sql/sql_insert.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r--sql/sql_insert.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 6c6a4721369..36623c1a10f 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -426,7 +426,6 @@ void upgrade_lock_type(THD *thd, thr_lock_type *lock_type,
client connection and the delayed thread.
*/
if (specialflag & (SPECIAL_NO_NEW_FUNC | SPECIAL_SAFE_MODE) ||
- thd->slave_thread ||
thd->variables.max_insert_delayed_threads == 0 ||
thd->prelocked_mode ||
thd->lex->uses_stored_routines())
@@ -434,6 +433,14 @@ void upgrade_lock_type(THD *thd, thr_lock_type *lock_type,
*lock_type= TL_WRITE;
return;
}
+ if (thd->slave_thread)
+ {
+ /* Try concurrent insert */
+ *lock_type= (duplic == DUP_UPDATE || duplic == DUP_REPLACE) ?
+ TL_WRITE : TL_WRITE_CONCURRENT_INSERT;
+ return;
+ }
+
bool log_on= (thd->options & OPTION_BIN_LOG ||
! (thd->security_ctx->master_access & SUPER_ACL));
if (global_system_variables.binlog_format == BINLOG_FORMAT_STMT &&
@@ -2226,7 +2233,7 @@ pthread_handler_t handle_delayed_insert(void *arg)
/* Add thread to THD list so that's it's visible in 'show processlist' */
pthread_mutex_lock(&LOCK_thread_count);
thd->thread_id= thd->variables.pseudo_thread_id= thread_id++;
- thd->end_time();
+ thd->set_current_time();
threads.append(thd);
thd->killed=abort_loop ? THD::KILL_CONNECTION : THD::NOT_KILLED;
pthread_mutex_unlock(&LOCK_thread_count);