#At file:///data/src/bzr/mysql-trunk-merge/ based on revid:alexey.kopytov@stripped
2988 Alexey Kopytov 2010-03-12
Post-merge fix for main.xa failures.
modified:
sql/set_var.cc
=== modified file 'sql/set_var.cc'
--- a/sql/set_var.cc 2010-03-12 09:51:53 +0000
+++ b/sql/set_var.cc 2010-03-12 10:13:02 +0000
@@ -3203,9 +3203,17 @@ static bool set_option_autocommit(THD *t
need to commit any outstanding transactions.
*/
if (var->save_result.ulong_value != 0 &&
- (thd->options & OPTION_NOT_AUTOCOMMIT) &&
- ha_commit(thd))
- return 1;
+ (thd->options & OPTION_NOT_AUTOCOMMIT))
+ {
+ if (thd->transaction.xid_state.xa_state != XA_NOTR)
+ {
+ my_error(ER_XAER_RMFAIL, MYF(0),
+ xa_state_names[thd->transaction.xid_state.xa_state]);
+ return 1;
+ }
+ if (ha_commit(thd))
+ return 1;
+ }
if (var->save_result.ulong_value != 0)
thd->options&= ~((sys_var_thd_bit*) var->var)->bit_flag;
@@ -3217,13 +3225,6 @@ static bool set_option_autocommit(THD *t
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;
Attachment: [text/bzr-bundle] bzr/alexey.kopytov@sun.com-20100312101302-6hhx71wr7185tkgo.bundle
| Thread |
|---|
| • bzr commit into mysql-trunk branch (Alexey.Kopytov:2988) | Alexey Kopytov | 12 Mar 2010 |