1/* Copyright (C) 2008-2014 Kentoku Shiba
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
15
16int spider_free_trx_conn(
17 SPIDER_TRX *trx,
18 bool trx_free
19);
20
21int spider_free_trx_another_conn(
22 SPIDER_TRX *trx,
23 bool lock
24);
25
26int spider_trx_another_lock_tables(
27 SPIDER_TRX *trx
28);
29
30int spider_trx_another_flush_tables(
31 SPIDER_TRX *trx
32);
33
34int spider_trx_all_flush_tables(
35 SPIDER_TRX *trx
36);
37
38int spider_trx_all_unlock_tables(
39 SPIDER_TRX *trx
40);
41
42int spider_trx_all_start_trx(
43 SPIDER_TRX *trx
44);
45
46int spider_trx_all_flush_logs(
47 SPIDER_TRX *trx
48);
49
50int spider_free_trx_alloc(
51 SPIDER_TRX *trx
52);
53
54void spider_free_trx_alter_table_alloc(
55 SPIDER_TRX *trx,
56 SPIDER_ALTER_TABLE *alter_table
57);
58
59int spider_free_trx_alter_table(
60 SPIDER_TRX *trx
61);
62
63int spider_create_trx_alter_table(
64 SPIDER_TRX *trx,
65 SPIDER_SHARE *share,
66 bool now_create
67);
68
69bool spider_cmp_trx_alter_table(
70 SPIDER_ALTER_TABLE *cmp1,
71 SPIDER_ALTER_TABLE *cmp2
72);
73
74SPIDER_TRX *spider_get_trx(
75 THD *thd,
76 bool regist_allocated_thds,
77 int *error_num
78);
79
80int spider_free_trx(
81 SPIDER_TRX *trx,
82 bool need_lock
83);
84
85int spider_check_and_set_trx_isolation(
86 SPIDER_CONN *conn,
87 int *need_mon
88);
89
90int spider_check_and_set_autocommit(
91 THD *thd,
92 SPIDER_CONN *conn,
93 int *need_mon
94);
95
96int spider_check_and_set_sql_log_off(
97 THD *thd,
98 SPIDER_CONN *conn,
99 int *need_mon
100);
101
102int spider_check_and_set_time_zone(
103 THD *thd,
104 SPIDER_CONN *conn,
105 int *need_mon
106);
107
108int spider_xa_lock(
109 XID_STATE *xid_state
110);
111
112int spider_xa_unlock(
113 XID_STATE *xid_state
114);
115
116int spider_start_internal_consistent_snapshot(
117 SPIDER_TRX *trx,
118 SPIDER_CONN *conn,
119 int *need_mon
120);
121
122int spider_internal_start_trx(
123 ha_spider *spider,
124 SPIDER_CONN *conn,
125 int link_idx
126);
127
128int spider_internal_xa_commit(
129 THD* thd,
130 SPIDER_TRX *trx,
131 XID* xid,
132 TABLE *table_xa,
133 TABLE *table_xa_member
134);
135
136int spider_internal_xa_rollback(
137 THD* thd,
138 SPIDER_TRX *trx
139);
140
141int spider_internal_xa_prepare(
142 THD* thd,
143 SPIDER_TRX *trx,
144 TABLE *table_xa,
145 TABLE *table_xa_member,
146 bool internal_xa
147);
148
149int spider_internal_xa_recover(
150 THD* thd,
151 XID* xid_list,
152 uint len
153);
154
155int spider_initinal_xa_recover(
156 XID* xid_list,
157 uint len
158);
159
160int spider_internal_xa_commit_by_xid(
161 THD* thd,
162 SPIDER_TRX *trx,
163 XID* xid
164);
165
166int spider_internal_xa_rollback_by_xid(
167 THD* thd,
168 SPIDER_TRX *trx,
169 XID* xid
170);
171
172int spider_start_consistent_snapshot(
173 handlerton *hton,
174 THD* thd
175);
176
177int spider_commit(
178 handlerton *hton,
179 THD *thd,
180 bool all
181);
182
183int spider_rollback(
184 handlerton *hton,
185 THD *thd,
186 bool all
187);
188
189int spider_xa_prepare(
190 handlerton *hton,
191 THD* thd,
192 bool all
193);
194
195int spider_xa_recover(
196 handlerton *hton,
197 XID* xid_list,
198 uint len
199);
200
201int spider_xa_commit_by_xid(
202 handlerton *hton,
203 XID* xid
204);
205
206int spider_xa_rollback_by_xid(
207 handlerton *hton,
208 XID* xid
209);
210
211void spider_copy_table_free_trx_conn(
212 SPIDER_TRX *trx
213);
214
215int spider_end_trx(
216 SPIDER_TRX *trx,
217 SPIDER_CONN *conn
218);
219
220int spider_check_trx_and_get_conn(
221 THD *thd,
222 ha_spider *spider,
223 bool use_conn_kind
224);
225
226THD *spider_create_tmp_thd();
227
228void spider_free_tmp_thd(
229 THD *thd
230);
231
232int spider_create_trx_ha(
233 SPIDER_TRX *trx,
234 ha_spider *spider,
235 SPIDER_TRX_HA *trx_ha
236);
237
238SPIDER_TRX_HA *spider_check_trx_ha(
239 SPIDER_TRX *trx,
240 ha_spider *spider
241);
242
243void spider_free_trx_ha(
244 SPIDER_TRX *trx
245);
246
247void spider_reuse_trx_ha(
248 SPIDER_TRX *trx
249);
250
251void spider_trx_set_link_idx_for_all(
252 ha_spider *spider
253);
254
255int spider_trx_check_link_idx_failed(
256 ha_spider *spider
257);
258
259#ifdef HA_CAN_BULK_ACCESS
260void spider_trx_add_bulk_access_conn(
261 SPIDER_TRX *trx,
262 SPIDER_CONN *conn
263);
264#endif
265