From 94cffe7218ed6f53bb86fdc429b8a41158af031a Mon Sep 17 00:00:00 2001 From: Jon Olav Hauglid Date: Tue, 12 Apr 2011 12:57:02 +0200 Subject: 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. --- sql/transaction.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'sql/transaction.cc') 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) || -- cgit v1.2.1