diff options
author | Konstantin Osipov <kostja@sun.com> | 2009-12-03 21:37:38 +0300 |
---|---|---|
committer | Konstantin Osipov <kostja@sun.com> | 2009-12-03 21:37:38 +0300 |
commit | c52d4830bf167cfe0b536be28a0adca121ae5d72 (patch) | |
tree | e72864841720da65102a5acd0ba5cc908cc8dec8 /sql/transaction.h | |
parent | 6a5bbd4bdc5535d524b7e1f009fd81b2cc21544c (diff) | |
download | mariadb-git-c52d4830bf167cfe0b536be28a0adca121ae5d72.tar.gz |
Backport of:
------------------------------------------------------------
revno: 2630.22.3
committer: Davi Arnaut <Davi.Arnaut@Sun.COM>
branch nick: 4284-6.0
timestamp: Thu 2008-08-07 22:33:43 -0300
message:
WL#4284: Transactional DDL locking
Make transaction management more modular through a new interface.
The overall objective of this change is to provide groundwork
for the design of transactional DDL locking by cleaning up the
transaction high level API to better distinguish operations implicit
and explicit, and single statement transaction from operations on
the normal transaction.
Having a a high-level interface for transaction management provides
a better base for implementing transactional concepts that are not
always tied to storage engines and also makes it easier to interect
with other higher level modules of the server.
client/Makefile.am:
Add new file to the build.
libmysqld/CMakeLists.txt:
Add new file to the build.
libmysqld/Makefile.am:
Add new file to the build.
sql/CMakeLists.txt:
Add new file to the build.
sql/Makefile.am:
Add new file to the build.
sql/handler.cc:
Remove multiplexer commit or rollback function. Most callers already
have enough information to decided whether to rollback or commit.
Having plain and well named functions makes it easier to read
and understand code.
sql/handler.h:
Remove wrapper function as the low level transaction functions
shouldn't be called directly anymore.
sql/log_event.cc:
Rename transaction management functions to the new names.
sql/log_event_old.cc:
Rename transaction management functions to the new names.
sql/mysql_priv.h:
Remove obsolete functions for implicit and explicit commit.
sql/rpl_injector.cc:
Rename transaction management functions to the new names.
sql/rpl_rli.cc:
Rename transaction management functions to the new names.
sql/set_var.cc:
Rename transaction management functions to the new names.
sql/slave.cc:
Rename transaction management functions to the new names.
sql/sql_base.cc:
Rename transaction management functions to the new names.
sql/sql_class.cc:
Rename transaction management functions to the new names.
sql/sql_delete.cc:
Rename transaction management functions to the new names.
sql/sql_do.cc:
Rename transaction management functions to the new names.
sql/sql_insert.cc:
Rename transaction management functions to the new names.
sql/sql_parse.cc:
Rename transaction management functions to the new names.
sql/sql_partition.cc:
Rename transaction management functions to the new names.
sql/sql_table.cc:
Rename transaction management functions to the new names.
sql/transaction.cc:
Implement wrapper functions to differentiate operations on
the single statement transaction from the ones operating
on the normal transaction.
sql/transaction.h:
Export new functions for dealing with transaction commands.
Diffstat (limited to 'sql/transaction.h')
-rw-r--r-- | sql/transaction.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/sql/transaction.h b/sql/transaction.h new file mode 100644 index 00000000000..135e6cae73f --- /dev/null +++ b/sql/transaction.h @@ -0,0 +1,46 @@ +/* Copyright (C) 2008 Sun/MySQL + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TRANSACTION_H +#define TRANSACTION_H + +#ifdef USE_PRAGMA_INTERFACE +#pragma interface /* gcc class implementation */ +#endif + +#include <my_global.h> +#include <m_string.h> + +class THD; + +bool trans_begin(THD *thd, uint flags= 0); +bool trans_commit(THD *thd); +bool trans_commit_implicit(THD *thd); +bool trans_rollback(THD *thd); + +bool trans_commit_stmt(THD *thd); +bool trans_rollback_stmt(THD *thd); + +bool trans_savepoint(THD *thd, LEX_STRING name); +bool trans_rollback_to_savepoint(THD *thd, LEX_STRING name); +bool trans_release_savepoint(THD *thd, LEX_STRING name); + +bool trans_xa_start(THD *thd); +bool trans_xa_end(THD *thd); +bool trans_xa_prepare(THD *thd); +bool trans_xa_commit(THD *thd); +bool trans_xa_rollback(THD *thd); + +#endif /* TRANSACTION_H */ |