summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorRamil Kalimullin <ramil@mysql.com>2009-03-27 13:34:24 +0400
committerRamil Kalimullin <ramil@mysql.com>2009-03-27 13:34:24 +0400
commitad7e825d54d618957fe62027644c5173db67a7c8 (patch)
tree3c97f7a4db77ed478b48a99991c4b6ead65d5164 /sql/handler.cc
parent296390a20f25a1c7573cfa38d078f9b2be88f0fb (diff)
parentc2c47b67fd6f6130b941a0b50fa701b0bb105ba7 (diff)
downloadmariadb-git-ad7e825d54d618957fe62027644c5173db67a7c8.tar.gz
Merge
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc16
1 files changed, 13 insertions, 3 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 18c8e6c1f5a..d22ee220dc1 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -1184,6 +1184,16 @@ end:
if (rw_trans)
start_waiting_global_read_lock(thd);
}
+ else if (all)
+ {
+ /*
+ A COMMIT of an empty transaction. There may be savepoints.
+ Destroy them. If the transaction is not empty
+ savepoints are cleared in ha_commit_one_phase()
+ or ha_rollback_trans().
+ */
+ thd->transaction.cleanup();
+ }
#endif /* USING_TRANSACTIONS */
DBUG_RETURN(error);
}
@@ -1292,11 +1302,11 @@ int ha_rollback_trans(THD *thd, bool all)
thd->transaction.xid_state.xid.null();
}
if (all)
- {
thd->variables.tx_isolation=thd->session_tx_isolation;
- thd->transaction.cleanup();
- }
}
+ /* Always cleanup. Even if there nht==0. There may be savepoints. */
+ if (all)
+ thd->transaction.cleanup();
#endif /* USING_TRANSACTIONS */
if (all)
thd->transaction_rollback_request= FALSE;