summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-11-02 14:17:19 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2018-11-02 18:52:39 +0200
commit8a346f31b913daa011085afec2b2d38450c73e00 (patch)
tree825134ba042ee4d24ad453ab0074afaad179950f /sql/sql_class.cc
parentcfa047069e7466a2ff9c99a266b67360bbdb22ba (diff)
downloadmariadb-git-8a346f31b913daa011085afec2b2d38450c73e00.tar.gz
MDEV-17073 INSERT…ON DUPLICATE KEY UPDATE became more deadlock-prone
thd_rpl_stmt_based(): A new predicate to check if statement-based replication is active. (This can also hold when replication is not in use, but binlog is.) que_thr_stop(), row_ins_duplicate_error_in_clust(), row_ins_sec_index_entry_low(), row_ins(): On a duplicate key error, only lock all index records when statement-based replication is in use.
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index e581ed0af25..71d5b80eaa3 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -4523,6 +4523,11 @@ extern "C" int thd_rpl_is_parallel(const MYSQL_THD thd)
return thd->rgi_slave && thd->rgi_slave->is_parallel_exec;
}
+extern "C" int thd_rpl_stmt_based(const MYSQL_THD thd)
+{
+ return !thd->is_current_stmt_binlog_format_row() &&
+ !thd->is_current_stmt_binlog_disabled();
+}
/* Returns high resolution timestamp for the start
of the current query. */