summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-11-10 01:38:03 +0100
committerSergei Golubchik <serg@mariadb.org>2017-11-10 01:38:03 +0100
commit2a4e4335c4bcb7f7488c9b91bdc8a2da3da5cf61 (patch)
treeeadf9e2e8c0d2fccdd1db226395b8232b67737d6 /sql
parent7002291b8aa2e036a7adfd23d961dc09b4f01f46 (diff)
parent9572bbdc3791178b82d4c71a8e3948a3a35123d4 (diff)
downloadmariadb-git-2a4e4335c4bcb7f7488c9b91bdc8a2da3da5cf61.tar.gz
Merge branch 'github/10.0-galera' into 10.1
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_class.cc11
-rw-r--r--sql/sql_parse.cc18
-rw-r--r--sql/wsrep_hton.cc3
-rw-r--r--sql/wsrep_var.cc3
4 files changed, 30 insertions, 5 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index c12f1ec4dc8..2ebcea2d6f4 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -4858,11 +4858,14 @@ extern "C" int thd_non_transactional_update(const MYSQL_THD thd)
extern "C" int thd_binlog_format(const MYSQL_THD thd)
{
- if (((WSREP(thd) && wsrep_emulate_bin_log) || mysql_bin_log.is_open()) &&
- thd->variables.option_bits & OPTION_BIN_LOG)
+ if (WSREP(thd))
+ {
+ /* for wsrep binlog format is meaningful also when binlogging is off */
return (int) thd->wsrep_binlog_format();
- else
- return BINLOG_FORMAT_UNSPEC;
+ }
+ if (mysql_bin_log.is_open() && (thd->variables.option_bits & OPTION_BIN_LOG))
+ return (int) thd->variables.binlog_format;
+ return BINLOG_FORMAT_UNSPEC;
}
extern "C" void thd_mark_transaction_to_rollback(MYSQL_THD thd, bool all)
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index e14531a40f0..7337a8aeb21 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -5719,6 +5719,24 @@ finish:
}
if (thd->is_error() || (thd->variables.option_bits & OPTION_MASTER_SQL_ERROR))
trans_rollback_stmt(thd);
+#ifdef WITH_WSREP
+ else if (thd->spcont &&
+ (thd->wsrep_conflict_state == MUST_ABORT ||
+ thd->wsrep_conflict_state == CERT_FAILURE))
+ {
+ /*
+ The error was cleared, but THD was aborted by wsrep and
+ wsrep_conflict_state is still set accordingly. This
+ situation is expected if we are running a stored procedure
+ that declares a handler that catches ER_LOCK_DEADLOCK error.
+ In which case the error may have been cleared in method
+ sp_rcontext::handle_sql_condition().
+ */
+ trans_rollback_stmt(thd);
+ thd->wsrep_conflict_state= NO_CONFLICT;
+ thd->killed= NOT_KILLED;
+ }
+#endif /* WITH_WSREP */
else
{
/* If commit fails, we should be able to reset the OK status. */
diff --git a/sql/wsrep_hton.cc b/sql/wsrep_hton.cc
index 2733a91a3c9..75c1526cb15 100644
--- a/sql/wsrep_hton.cc
+++ b/sql/wsrep_hton.cc
@@ -505,6 +505,9 @@ wsrep_run_wsrep_commit(THD *thd, bool all)
}
mysql_mutex_lock(&thd->LOCK_wsrep_thd);
+
+ DEBUG_SYNC(thd, "wsrep_after_replication");
+
switch(rcode) {
case 0:
/*
diff --git a/sql/wsrep_var.cc b/sql/wsrep_var.cc
index 1d117766db4..b21041eb0f8 100644
--- a/sql/wsrep_var.cc
+++ b/sql/wsrep_var.cc
@@ -301,8 +301,9 @@ bool wsrep_provider_update (sys_var *self, THD* thd, enum_var_type type)
if (wsrep_inited == 1)
wsrep_deinit(false);
- char* tmp= strdup(wsrep_provider); // wsrep_init() rewrites provider
+ char* tmp= strdup(wsrep_provider); // wsrep_init() rewrites provider
//when fails
+
if (wsrep_init())
{
my_error(ER_CANT_OPEN_LIBRARY, MYF(0), tmp);