diff options
Diffstat (limited to 'sql/handler.cc')
-rw-r--r-- | sql/handler.cc | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/sql/handler.cc b/sql/handler.cc index 930bfa2ed28..08cc3db7628 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -191,16 +191,13 @@ int ha_autocommit_or_rollback(THD *thd, int error) { DBUG_ENTER("ha_autocommit_or_rollback"); #ifdef USING_TRANSACTIONS - if (!(thd->options & (OPTION_NOT_AUTO_COMMIT | OPTION_BEGIN))) + if (!error) { - if (!error) - { - if (ha_commit_stmt(thd)) - error=1; - } - else - (void) ha_rollback_stmt(thd); + if (ha_commit_stmt(thd)) + error=1; } + else + (void) ha_rollback_stmt(thd); #endif DBUG_RETURN(error); } @@ -232,6 +229,7 @@ int ha_commit_trans(THD *thd, THD_TRANS* trans) } #endif #ifdef HAVE_INNOBASE_DB + if (trans->innobase_tid) { if ((error=innobase_commit(thd,trans->innobase_tid))) { |