summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorunknown <heikki@hundin.mysql.fi>2003-06-05 15:58:23 +0300
committerunknown <heikki@hundin.mysql.fi>2003-06-05 15:58:23 +0300
commit6d4ed167872eb6c29693fb0cbeaa79e0aecbe627 (patch)
tree844a81e1a24550dab23f781f72f3533f4fc13de3 /sql/handler.cc
parentd6f2e8c1731b79765addac5c10f256ce91b7f0f7 (diff)
downloadmariadb-git-6d4ed167872eb6c29693fb0cbeaa79e0aecbe627.tar.gz
ha_innodb.cc, handler.cc:
Fix the BDB crash in the previous push; to save CPU remove duplicate calls of commit in InnoDB sql/handler.cc: Fix the BDB crash in the previous push; to save CPU remove duplicate calls of commit in InnoDB sql/ha_innodb.cc: Fix the BDB crash in the previous push; to save CPU remove duplicate calls of commit in InnoDB
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc34
1 files changed, 8 insertions, 26 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 6ee0b1f9c55..cae1777e958 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -209,44 +209,26 @@ void ha_close_connection(THD* thd)
/*
This is used to commit or rollback a single statement depending on the value
- of error. If the autocommit is on, then we will commit or rollback the whole
- transaction (= the statement). The autocommit mechanism built into handlers
- is based on counting locks, but if the user has used LOCK TABLES then that
- mechanism does not know to do the commit.
+ of error. Note that if the autocommit is on, then the following call inside
+ InnoDB will commit or rollback the whole transaction (= the statement). The
+ autocommit mechanism built into InnoDB is based on counting locks, but if
+ the user has used LOCK TABLES then that mechanism does not know to do the
+ commit.
*/
int ha_autocommit_or_rollback(THD *thd, int error)
{
- bool do_autocommit=FALSE;
-
DBUG_ENTER("ha_autocommit_or_rollback");
#ifdef USING_TRANSACTIONS
-
- if (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
- do_autocommit=TRUE; /* We can commit or rollback the whole transaction */
-
if (opt_using_transactions)
{
if (!error)
{
- if (do_autocommit)
- {
- if (ha_commit(thd))
- error=1;
- }
- else
- {
- if (ha_commit_stmt(thd))
- error=1;
- }
+ if (ha_commit_stmt(thd))
+ error=1;
}
else
- {
- if (do_autocommit)
- (void) ha_rollback(thd);
- else
- (void) ha_rollback_stmt(thd);
- }
+ (void) ha_rollback_stmt(thd);
thd->variables.tx_isolation=thd->session_tx_isolation;
}