summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorDaniele Sciascia <daniele.sciascia@galeracluster.com>2016-05-05 13:20:32 +0200
committerNirbhay Choubey <nirbhay@mariadb.com>2016-07-25 11:24:23 -0400
commit5197fcf6b4611a26b3847d1101f1a4fb6d17570a (patch)
tree7fa1eb57f7acac2e2adaef9f1b3fff06c3355aa8 /sql
parente373f60fd161eaf050eb117c9a05d8d83fe0e501 (diff)
downloadmariadb-git-5197fcf6b4611a26b3847d1101f1a4fb6d17570a.tar.gz
MW-269 Fix outstanding issues with wsrep_max_ws_rows
This patch includes two fixes: 1) Rollback when wsrep_max_ws_rows is exceeded would not switch back to previous autocommit mode; and 2) Internal rows counter would not be reset on implicit commits.
Diffstat (limited to 'sql')
-rw-r--r--sql/handler.cc6
-rw-r--r--sql/wsrep_hton.cc1
2 files changed, 4 insertions, 3 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 6fa937faa84..0eef23ad753 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -6104,7 +6104,7 @@ int handler::ha_write_row(uchar *buf)
current_thd->wsrep_exec_mode != REPL_RECV &&
current_thd->wsrep_affected_rows > wsrep_max_ws_rows)
{
- current_thd->transaction_rollback_request= TRUE;
+ trans_rollback_stmt(current_thd) || trans_rollback(current_thd);
my_message(ER_ERROR_DURING_COMMIT, "wsrep_max_ws_rows exceeded", MYF(0));
DBUG_RETURN(ER_ERROR_DURING_COMMIT);
}
@@ -6148,7 +6148,7 @@ int handler::ha_update_row(const uchar *old_data, uchar *new_data)
current_thd->wsrep_exec_mode != REPL_RECV &&
current_thd->wsrep_affected_rows > wsrep_max_ws_rows)
{
- current_thd->transaction_rollback_request= TRUE;
+ trans_rollback_stmt(current_thd) || trans_rollback(current_thd);
my_message(ER_ERROR_DURING_COMMIT, "wsrep_max_ws_rows exceeded", MYF(0));
return ER_ERROR_DURING_COMMIT;
}
@@ -6186,7 +6186,7 @@ int handler::ha_delete_row(const uchar *buf)
current_thd->wsrep_exec_mode != REPL_RECV &&
current_thd->wsrep_affected_rows > wsrep_max_ws_rows)
{
- current_thd->transaction_rollback_request= TRUE;
+ trans_rollback_stmt(current_thd) || trans_rollback(current_thd);
my_message(ER_ERROR_DURING_COMMIT, "wsrep_max_ws_rows exceeded", MYF(0));
return ER_ERROR_DURING_COMMIT;
}
diff --git a/sql/wsrep_hton.cc b/sql/wsrep_hton.cc
index e5ff462eb19..e1bf63cd31f 100644
--- a/sql/wsrep_hton.cc
+++ b/sql/wsrep_hton.cc
@@ -42,6 +42,7 @@ void wsrep_cleanup_transaction(THD *thd)
thd->wsrep_trx_meta.gtid= WSREP_GTID_UNDEFINED;
thd->wsrep_trx_meta.depends_on= WSREP_SEQNO_UNDEFINED;
thd->wsrep_exec_mode= LOCAL_STATE;
+ thd->wsrep_affected_rows= 0;
return;
}