summaryrefslogtreecommitdiff
path: root/sql/sql_class.h
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2018-01-22 23:35:50 +0200
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2018-01-22 23:35:50 +0200
commit6e449d1ef0c79864d150090505d5b4e555ae6ab6 (patch)
treeb6119b2e18f56b79629b789cf96d665d907a95a9 /sql/sql_class.h
parent431607237d0d1438cdc69f5bf5a188253d7549cf (diff)
parentb20c3dc664314a3045fa31e2245d4613e9efa508 (diff)
downloadmariadb-git-6e449d1ef0c79864d150090505d5b4e555ae6ab6.tar.gz
Merge branch '5.5' into 10.0
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r--sql/sql_class.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 3aeb8127030..925260badc5 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -1096,6 +1096,30 @@ typedef struct st_xid_state {
bool in_thd;
/* Error reported by the Resource Manager (RM) to the Transaction Manager. */
uint rm_error;
+
+ /**
+ Check that XA transaction has an uncommitted work. Report an error
+ to the user in case when there is an uncommitted work for XA transaction.
+
+ @return result of check
+ @retval false XA transaction is NOT in state IDLE, PREPARED
+ or ROLLBACK_ONLY.
+ @retval true XA transaction is in state IDLE or PREPARED
+ or ROLLBACK_ONLY.
+ */
+
+ bool check_has_uncommitted_xa() const
+ {
+ if (xa_state == XA_IDLE ||
+ xa_state == XA_PREPARED ||
+ xa_state == XA_ROLLBACK_ONLY)
+ {
+ my_error(ER_XAER_RMFAIL, MYF(0), xa_state_names[xa_state]);
+ return true;
+ }
+ return false;
+ }
+
} XID_STATE;
extern mysql_mutex_t LOCK_xid_cache;