| 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 | |
| 25 | class THD; |
| 26 | |
| 27 | bool trans_begin(THD *thd, uint flags= 0); |
| 28 | bool trans_commit(THD *thd); |
| 29 | bool trans_commit_implicit(THD *thd); |
| 30 | bool trans_rollback(THD *thd); |
| 31 | bool trans_rollback_implicit(THD *thd); |
| 32 | |
| 33 | bool trans_commit_stmt(THD *thd); |
| 34 | bool trans_rollback_stmt(THD *thd); |
| 35 | |
| 36 | bool trans_savepoint(THD *thd, LEX_CSTRING name); |
| 37 | bool trans_rollback_to_savepoint(THD *thd, LEX_CSTRING name); |
| 38 | bool trans_release_savepoint(THD *thd, LEX_CSTRING name); |
| 39 | |
| 40 | bool trans_xa_start(THD *thd); |
| 41 | bool trans_xa_end(THD *thd); |
| 42 | bool trans_xa_prepare(THD *thd); |
| 43 | bool trans_xa_commit(THD *thd); |
| 44 | bool trans_xa_rollback(THD *thd); |
| 45 | |
| 46 | void trans_reset_one_shot_chistics(THD *thd); |
| 47 | |
| 48 | #endif /* TRANSACTION_H */ |
| 49 | |