InnoDB Plugin  1.0
trx0i_s.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3 Copyright (c) 2007, 2011, Oracle and/or its affiliates. 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.,
15 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
16 
17 *****************************************************************************/
18 
19 /**************************************************/
28 #ifndef trx0i_s_h
29 #define trx0i_s_h
30 
31 #include "univ.i"
32 #include "trx0types.h"
33 #include "dict0types.h"
34 #include "ut0ut.h"
35 
38 #define TRX_I_S_MEM_LIMIT 16777216 /* 16 MiB */
39 
42 #define TRX_I_S_LOCK_DATA_MAX_LEN 8192
43 
46 #define TRX_I_S_TRX_QUERY_MAX_LEN 1024
47 
50 #define TRX_I_S_TRX_OP_STATE_MAX_LEN 64
51 
54 #define TRX_I_S_TRX_FK_ERROR_MAX_LEN 256
55 
58 #define TRX_I_S_TRX_ISOLATION_LEVEL_MAX_LEN 16
59 
62 #define TRX_I_S_STRING_COPY(data, field, constraint, tcache) \
63 do { \
64  if (strlen(data) > constraint) { \
65  char buff[constraint + 1]; \
66  strncpy(buff, data, constraint); \
67  buff[constraint] = '\0'; \
68  \
69  field = static_cast<const char*>( \
70  ha_storage_put_memlim( \
71  (tcache)->storage, buff, constraint + 1,\
72  MAX_ALLOWED_FOR_STORAGE(tcache))); \
73  } else { \
74  field = static_cast<const char*>( \
75  ha_storage_put_str_memlim( \
76  (tcache)->storage, data, \
77  MAX_ALLOWED_FOR_STORAGE(tcache))); \
78  } \
79 } while (0)
80 
82 struct i_s_locks_row_t;
83 
85 struct i_s_hash_chain_t;
86 
93 };
94 
98  const char* lock_mode;
100  const char* lock_type;
102  const char* lock_table;
104  const char* lock_index;
108  /* @{ */
109  ulint lock_space;
110  ulint lock_page;
111  ulint lock_rec;
113  const char* lock_data;
114  /* @} */
115 
117  /* @{ */
118  table_id_t lock_table_id;
123  /* @} */
124 };
125 
129  const char* trx_state;
137  ullint trx_weight;
139  const char* trx_query;
141  struct charset_info_st* trx_query_cs;
144  const char* trx_operation_state;
147  ulint trx_tables_locked;
152  ulint trx_lock_memory_bytes;
160  const char* trx_isolation_level;
166  const char* trx_foreign_key_error;
172  ulint trx_is_read_only;
177 };
178 
183 };
184 
186 struct trx_i_s_cache_t;
187 
190 enum i_s_table {
194 };
195 
199 extern trx_i_s_cache_t* trx_i_s_cache;
200 
201 /*******************************************************************/
203 UNIV_INTERN
204 void
206 /*===============*/
207  trx_i_s_cache_t* cache);
208 /*******************************************************************/
210 UNIV_INTERN
211 void
213 /*===============*/
214  trx_i_s_cache_t* cache);
216 /*******************************************************************/
218 UNIV_INTERN
219 void
221 /*=====================*/
222  trx_i_s_cache_t* cache);
224 /*******************************************************************/
226 UNIV_INTERN
227 void
229 /*===================*/
230  trx_i_s_cache_t* cache);
232 /*******************************************************************/
234 UNIV_INTERN
235 void
237 /*======================*/
238  trx_i_s_cache_t* cache);
240 /*******************************************************************/
242 UNIV_INTERN
243 void
245 /*====================*/
246  trx_i_s_cache_t* cache);
249 /*******************************************************************/
253 UNIV_INTERN
254 ulint
256 /*========================*/
257  trx_i_s_cache_t* cache,
258  enum i_s_table table);
260 /*******************************************************************/
264 UNIV_INTERN
265 void*
267 /*======================*/
268  trx_i_s_cache_t* cache,
269  enum i_s_table table,
270  ulint n);
272 /*******************************************************************/
275 UNIV_INTERN
276 int
278 /*===================================*/
279  trx_i_s_cache_t* cache);
281 /*******************************************************************/
285 UNIV_INTERN
286 ibool
288 /*=======================*/
289  trx_i_s_cache_t* cache);
294 #define TRX_I_S_LOCK_ID_MAX_LEN (TRX_ID_MAX_LEN + 63)
295 
296 /*******************************************************************/
302 UNIV_INTERN
303 char*
305 /*===================*/
306  const i_s_locks_row_t* row,
307  char* lock_id,
308  ulint lock_id_size);
311 #endif /* trx0i_s_h */