summaryrefslogtreecommitdiff
path: root/sql/transaction.cc
diff options
context:
space:
mode:
authorJon Olav Hauglid <jon.hauglid@oracle.com>2011-04-12 12:57:02 +0200
committerJon Olav Hauglid <jon.hauglid@oracle.com>2011-04-12 12:57:02 +0200
commitba82398dab6f86ff8088c40b90e3a78178cf1f97 (patch)
tree7b9ec673dc66c39e998d4f34ac50d029bacbd60b /sql/transaction.cc
parent4e8e373fb15cc29a0b8521312191f71323c2235b (diff)
downloadmariadb-git-ba82398dab6f86ff8088c40b90e3a78178cf1f97.tar.gz
Bug#12348348 - ASSERTION IN ROW0SEL.C LINE 3698:
TRX->CONC_STATE == 0 || TRX->CONC_STATE == 1 This bug was a different manifestation of Bug#11766752, which was previously only fixed on mysql-trunk. This patch backports the fix for Bug#11766752 to mysql-5.5, which fixes the problem. The patch also adds some extra test coverage.
Diffstat (limited to 'sql/transaction.cc')
-rw-r--r--sql/transaction.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/sql/transaction.cc b/sql/transaction.cc
index 85686810893..cd783e44792 100644
--- a/sql/transaction.cc
+++ b/sql/transaction.cc
@@ -362,6 +362,13 @@ bool trans_savepoint(THD *thd, LEX_STRING name)
!opt_using_transactions)
DBUG_RETURN(FALSE);
+ enum xa_states xa_state= thd->transaction.xid_state.xa_state;
+ if (xa_state != XA_NOTR)
+ {
+ my_error(ER_XAER_RMFAIL, MYF(0), xa_state_names[xa_state]);
+ DBUG_RETURN(TRUE);
+ }
+
sv= find_savepoint(thd, name);
if (*sv) /* old savepoint of the same name exists */
@@ -435,6 +442,13 @@ bool trans_rollback_to_savepoint(THD *thd, LEX_STRING name)
DBUG_RETURN(TRUE);
}
+ enum xa_states xa_state= thd->transaction.xid_state.xa_state;
+ if (xa_state != XA_NOTR)
+ {
+ my_error(ER_XAER_RMFAIL, MYF(0), xa_state_names[xa_state]);
+ DBUG_RETURN(TRUE);
+ }
+
if (ha_rollback_to_savepoint(thd, sv))
res= TRUE;
else if (((thd->variables.option_bits & OPTION_KEEP_LOG) ||