Drizzled Public API Documentation

trx0i_s.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3 Copyright (C) 2007, 2009, Innobase Oy. All Rights Reserved.
4 
5 This program is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free Software
7 Foundation; version 2 of the License.
8 
9 This program is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12 
13 You should have received a copy of the GNU General Public License along with
14 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15 St, Fifth Floor, Boston, MA 02110-1301 USA
16 
17 *****************************************************************************/
18 
19 /**************************************************/
28 #pragma once
29 #ifndef trx0i_s_h
30 #define trx0i_s_h
31 
32 #include "univ.i"
33 #include "trx0types.h"
34 #include "dict0types.h"
35 #include "ut0ut.h"
36 
39 #define TRX_I_S_MEM_LIMIT 16777216 /* 16 MiB */
40 
43 #define TRX_I_S_LOCK_DATA_MAX_LEN 8192
44 
47 #define TRX_I_S_TRX_QUERY_MAX_LEN 1024
48 
51 #define TRX_I_S_TRX_OP_STATE_MAX_LEN 64
52 
55 #define TRX_I_S_TRX_FK_ERROR_MAX_LEN 256
56 
59 #define TRX_I_S_TRX_ISOLATION_LEVEL_MAX_LEN 16
60 
63 #define TRX_I_S_STRING_COPY(data, field, constraint, tcache) \
64 do { \
65  if (strlen(data) > constraint) { \
66  char buff[constraint + 1]; \
67  strncpy(buff, data, constraint); \
68  buff[constraint] = '\0'; \
69  \
70  field = static_cast<const char *>(ha_storage_put_memlim( \
71  (tcache)->storage, buff, constraint + 1,\
72  MAX_ALLOWED_FOR_STORAGE(tcache))); \
73  } else { \
74  field = static_cast<const char *>(ha_storage_put_str_memlim( \
75  (tcache)->storage, data, \
76  MAX_ALLOWED_FOR_STORAGE(tcache))); \
77  } \
78 } while (0)
79 
86 
89 
96 };
97 
101  const char* lock_mode;
103  const char* lock_type;
105  const char* lock_table;
107  const char* lock_index;
111  /* @{ */
112  ulint lock_space;
113  ulint lock_page;
114  ulint lock_rec;
116  const char* lock_data;
117  /* @} */
118 
120  /* @{ */
121  table_id_t lock_table_id;
126  /* @} */
127 };
128 
132  const char* trx_state;
140  ullint trx_weight;
142  const char* trx_query;
144  const char* trx_operation_state;
147  ulint trx_tables_locked;
152  ulint trx_lock_memory_bytes;
160  const char* trx_isolation_level;
162  ibool trx_unique_checks;
167  const char* trx_foreign_key_error;
169  ibool trx_has_search_latch;
174 };
175 
180 };
181 
184 
187 enum i_s_table {
191 };
192 
197 
198 /*******************************************************************/
200 UNIV_INTERN
201 void
203 /*===============*/
204  trx_i_s_cache_t* cache);
205 /*******************************************************************/
207 UNIV_INTERN
208 void
210 /*===============*/
211  trx_i_s_cache_t* cache);
213 /*******************************************************************/
215 UNIV_INTERN
216 void
218 /*=====================*/
219  trx_i_s_cache_t* cache);
221 /*******************************************************************/
223 UNIV_INTERN
224 void
226 /*===================*/
227  trx_i_s_cache_t* cache);
229 /*******************************************************************/
231 UNIV_INTERN
232 void
234 /*======================*/
235  trx_i_s_cache_t* cache);
237 /*******************************************************************/
239 UNIV_INTERN
240 void
242 /*====================*/
243  trx_i_s_cache_t* cache);
246 /*******************************************************************/
250 UNIV_INTERN
251 ulint
253 /*========================*/
254  trx_i_s_cache_t* cache,
255  enum i_s_table table);
257 /*******************************************************************/
261 UNIV_INTERN
262 void*
264 /*======================*/
265  trx_i_s_cache_t* cache,
266  enum i_s_table table,
267  ulint n);
269 /*******************************************************************/
272 UNIV_INTERN
273 int
275 /*===================================*/
276  trx_i_s_cache_t* cache);
278 /*******************************************************************/
282 UNIV_INTERN
283 ibool
285 /*=======================*/
286  trx_i_s_cache_t* cache);
291 #define TRX_I_S_LOCK_ID_MAX_LEN (TRX_ID_MAX_LEN + 63)
292 
293 /*******************************************************************/
299 UNIV_INTERN
300 char*
302 /*===================*/
303  const i_s_locks_row_t* row,
304  char* lock_id,
305  ulint lock_id_size);
308 #endif /* trx0i_s_h */