diff options
author | Konstantin Osipov <kostja@sun.com> | 2009-12-04 01:46:14 +0300 |
---|---|---|
committer | Konstantin Osipov <kostja@sun.com> | 2009-12-04 01:46:14 +0300 |
commit | 411a81954ecab031d58b99aaac3e2ee6518b6d80 (patch) | |
tree | 533eabae94267d1db186e6a8a0ef840caca311cf /sql/transaction.cc | |
parent | cd155be564a6e42c3a08781ba0d30458e241cdf0 (diff) | |
download | mariadb-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.cc | 7 |
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); |