diff options
author | Jon Olav Hauglid <jon.hauglid@oracle.com> | 2011-04-12 12:57:02 +0200 |
---|---|---|
committer | Jon Olav Hauglid <jon.hauglid@oracle.com> | 2011-04-12 12:57:02 +0200 |
commit | 94cffe7218ed6f53bb86fdc429b8a41158af031a (patch) | |
tree | 7b9ec673dc66c39e998d4f34ac50d029bacbd60b /sql/transaction.cc | |
parent | d14729c4a6a7c918a70d523d6b7d3a2b0eabb389 (diff) | |
download | mariadb-git-94cffe7218ed6f53bb86fdc429b8a41158af031a.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.cc | 14 |
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) || |