summaryrefslogtreecommitdiff
path: root/sql/transaction.cc
diff options
context:
space:
mode:
authorKonstantin Osipov <kostja@sun.com>2009-12-04 01:46:14 +0300
committerKonstantin Osipov <kostja@sun.com>2009-12-04 01:46:14 +0300
commit411a81954ecab031d58b99aaac3e2ee6518b6d80 (patch)
tree533eabae94267d1db186e6a8a0ef840caca311cf /sql/transaction.cc
parentcd155be564a6e42c3a08781ba0d30458e241cdf0 (diff)
downloadmariadb-git-411a81954ecab031d58b99aaac3e2ee6518b6d80.tar.gz
------------------------------------------------------------
revno: 2617.22.4 committer: Davi Arnaut <Davi.Arnaut@Sun.COM> branch nick: mysql-6.0-runtime timestamp: Mon 2009-01-26 15:19:14 -0200 message: Move checks for OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN to a separate helper function. sql/ha_ndbcluster.cc: Use helper method to check transaction mode. sql/log.cc: Use helper method to check transaction mode. sql/sql_cache.cc: Use helper method to check transaction mode. sql/sql_class.cc: Use helper method to check transaction mode. sql/sql_class.h: Add helper method to check whether session is in a multi-statement transaction. sql/sql_parse.cc: Use helper method to check transaction mode. sql/transaction.cc: Use helper method to check transaction mode.
Diffstat (limited to 'sql/transaction.cc')
-rw-r--r--sql/transaction.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/sql/transaction.cc b/sql/transaction.cc
index f4a616ead6b..7bfaf4846cf 100644
--- a/sql/transaction.cc
+++ b/sql/transaction.cc
@@ -163,8 +163,7 @@ bool trans_commit_implicit(THD *thd)
if (trans_check(thd))
DBUG_RETURN(TRUE);
- if (thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN |
- OPTION_TABLE_LOCK))
+ if (thd->in_multi_stmt_transaction() || (thd->options & OPTION_TABLE_LOCK))
{
/* Safety if one did "drop table" on locked tables */
if (!thd->locked_tables_mode)
@@ -299,8 +298,8 @@ bool trans_savepoint(THD *thd, LEX_STRING name)
SAVEPOINT **sv, *newsv;
DBUG_ENTER("trans_savepoint");
- if (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN) ||
- thd->in_sub_stmt) || !opt_using_transactions)
+ if (!(thd->in_multi_stmt_transaction() || thd->in_sub_stmt) ||
+ !opt_using_transactions)
DBUG_RETURN(FALSE);
sv= find_savepoint(thd, name);