diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:07:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:07:14 +0000 |
commit | a175314c3e5827eb193872241446f2f8f5c9d33c (patch) | |
tree | cd3d60ca99ae00829c52a6ca79150a5b6e62528b /sql/xa.h | |
parent | Initial commit. (diff) | |
download | mariadb-10.5-a175314c3e5827eb193872241446f2f8f5c9d33c.tar.xz mariadb-10.5-a175314c3e5827eb193872241446f2f8f5c9d33c.zip |
Adding upstream version 1:10.5.12.upstream/1%10.5.12upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | sql/xa.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/sql/xa.h b/sql/xa.h new file mode 100644 index 00000000..0b2d0696 --- /dev/null +++ b/sql/xa.h @@ -0,0 +1,56 @@ +#ifndef XA_INCLUDED +#define XA_INCLUDED +/* + Copyright (c) 2000, 2016, Oracle and/or its affiliates. + Copyright (c) 2009, 2019, MariaDB Corporation. + + 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA +*/ + +class XID_cache_element; +enum xa_states +{ + XA_ACTIVE= 0, + XA_IDLE, + XA_PREPARED, + XA_ROLLBACK_ONLY, + XA_NO_STATE +}; + +struct XID_STATE { + XID_cache_element *xid_cache_element; + + bool check_has_uncommitted_xa() const; + bool is_explicit_XA() const { return xid_cache_element != 0; } + void set_error(uint error); + void er_xaer_rmfail() const; + XID *get_xid() const; + enum xa_states get_state_code() const; +}; + +void xid_cache_init(void); +void xid_cache_free(void); +bool xid_cache_insert(XID *xid); +bool xid_cache_insert(THD *thd, XID_STATE *xid_state, XID *xid); +void xid_cache_delete(THD *thd, XID_STATE *xid_state); + +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); +bool trans_xa_detach(THD *thd); +bool mysql_xa_recover(THD *thd); + +#endif /* XA_INCLUDED */ |