diff options
author | Sergey Vojtovich <svoj@sun.com> | 2010-03-10 16:26:39 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@sun.com> | 2010-03-10 16:26:39 +0400 |
commit | 64c6882ea9a18820abc75b7a5993953e06bbbcdb (patch) | |
tree | 5f4671ae771c04d2e81f96f1379732be95dcb817 /sql/set_var.cc | |
parent | c8d90775051f60f97c4bbfa65777a38eb1e588a7 (diff) | |
parent | f4fe07f21f4e8346e55010a604ff832a165268ee (diff) | |
download | mariadb-git-64c6882ea9a18820abc75b7a5993953e06bbbcdb.tar.gz |
Merge fix for BUG51342 to 5.1-bugteam.
Diffstat (limited to 'sql/set_var.cc')
-rw-r--r-- | sql/set_var.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc index 2c00d76b0f1..0a9541b9f2c 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -3078,6 +3078,13 @@ static bool set_option_autocommit(THD *thd, set_var *var) if ((org_options & OPTION_NOT_AUTOCOMMIT)) { /* We changed to auto_commit mode */ + if (thd->transaction.xid_state.xa_state != XA_NOTR) + { + thd->options= org_options; + my_error(ER_XAER_RMFAIL, MYF(0), + xa_state_names[thd->transaction.xid_state.xa_state]); + return 1; + } thd->options&= ~(ulonglong) (OPTION_BEGIN | OPTION_KEEP_LOG); thd->transaction.all.modified_non_trans_table= FALSE; thd->server_status|= SERVER_STATUS_AUTOCOMMIT; |