1/* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; version 2 of the License.
6
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 GNU General Public License for more details.
11
12 You should have received a copy of the GNU General Public License
13 along with this program; if not, write to the Free Software
14 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
15
16#ifndef TRANSACTION_H
17#define TRANSACTION_H
18
19#ifdef USE_PRAGMA_INTERFACE
20#pragma interface /* gcc class implementation */
21#endif
22
23#include <m_string.h>
24
25class THD;
26
27bool trans_begin(THD *thd, uint flags= 0);
28bool trans_commit(THD *thd);
29bool trans_commit_implicit(THD *thd);
30bool trans_rollback(THD *thd);
31bool trans_rollback_implicit(THD *thd);
32
33bool trans_commit_stmt(THD *thd);
34bool trans_rollback_stmt(THD *thd);
35
36bool trans_savepoint(THD *thd, LEX_CSTRING name);
37bool trans_rollback_to_savepoint(THD *thd, LEX_CSTRING name);
38bool trans_release_savepoint(THD *thd, LEX_CSTRING name);
39
40bool trans_xa_start(THD *thd);
41bool trans_xa_end(THD *thd);
42bool trans_xa_prepare(THD *thd);
43bool trans_xa_commit(THD *thd);
44bool trans_xa_rollback(THD *thd);
45
46void trans_reset_one_shot_chistics(THD *thd);
47
48#endif /* TRANSACTION_H */
49