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;
160  const char* trx_isolation_level;
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 */
UNIV_INTERN void trx_i_s_cache_start_write(trx_i_s_cache_t *cache)
Definition: trx0i_s.cc:1458
UNIV_INTERN void trx_i_s_cache_free(trx_i_s_cache_t *cache)
Definition: trx0i_s.cc:1408
const char * lock_table
Definition: trx0i_s.h:105
UNIV_INTERN ulint trx_i_s_cache_get_rows_used(trx_i_s_cache_t *cache, enum i_s_table table)
Definition: trx0i_s.cc:1520
i_s_table
Definition: trx0i_s.h:187
const char * lock_type
Definition: trx0i_s.h:103
const char * trx_state
Definition: trx0i_s.h:132
i_s_locks_row_t * value
Definition: trx0i_s.h:93
table_id_t lock_table_id
Definition: trx0i_s.h:121
UNIV_INTERN void * trx_i_s_cache_get_nth_row(trx_i_s_cache_t *cache, enum i_s_table table, ulint n)
Definition: trx0i_s.cc:1538
UNIV_INTERN void trx_i_s_cache_end_write(trx_i_s_cache_t *cache)
Definition: trx0i_s.cc:1469
const i_s_locks_row_t * blocking_lock_row
Definition: trx0i_s.h:179
time_t ib_time_t
Definition: ut0ut.h:56
UNIV_INTERN int trx_i_s_possibly_fetch_data_into_cache(trx_i_s_cache_t *cache)
Definition: trx0i_s.cc:1331
const char * trx_isolation_level
Definition: trx0i_s.h:160
UNIV_INTERN char * trx_i_s_create_lock_id(const i_s_locks_row_t *row, char *lock_id, ulint lock_id_size)
Definition: trx0i_s.cc:1579
ibool trx_has_search_latch
Definition: trx0i_s.h:169
const char * trx_operation_state
Definition: trx0i_s.h:144
trx_id_t trx_id
Definition: trx0i_s.h:131
trx_i_s_cache_t * trx_i_s_cache
Definition: trx0i_s.cc:197
ullint trx_weight
Definition: trx0i_s.h:140
const char * trx_query
Definition: trx0i_s.h:142
ulint trx_search_latch_timeout
Definition: trx0i_s.h:171
i_s_hash_chain_t * next
Definition: trx0i_s.h:95
UNIV_INTERN void trx_i_s_cache_start_read(trx_i_s_cache_t *cache)
Definition: trx0i_s.cc:1424
ulint trx_tables_in_use
Definition: trx0i_s.h:145
ibool trx_unique_checks
Definition: trx0i_s.h:162
ullint trx_rows_modified
Definition: trx0i_s.h:156
UNIV_INTERN void trx_i_s_cache_end_read(trx_i_s_cache_t *cache)
Definition: trx0i_s.cc:1435
ulint trx_concurrency_tickets
Definition: trx0i_s.h:157
ib_id_t trx_id_t
Definition: trx0types.h:85
UNIV_INTERN void trx_i_s_cache_init(trx_i_s_cache_t *cache)
Definition: trx0i_s.cc:1367
trx_id_t lock_trx_id
Definition: trx0i_s.h:100
UNIV_INTERN ibool trx_i_s_cache_is_truncated(trx_i_s_cache_t *cache)
Definition: trx0i_s.cc:1356
ulint trx_rows_locked
Definition: trx0i_s.h:155
const char * lock_mode
Definition: trx0i_s.h:101
const i_s_locks_row_t * requested_lock_row
Definition: trx0i_s.h:135
const char * trx_foreign_key_error
Definition: trx0i_s.h:167
ulint trx_lock_memory_bytes
Definition: trx0i_s.h:152
i_s_hash_chain_t hash_chain
Definition: trx0i_s.h:124
ulint trx_lock_structs
Definition: trx0i_s.h:150
ulint trx_mysql_thread_id
Definition: trx0i_s.h:141
const char * lock_data
Definition: trx0i_s.h:116
const i_s_locks_row_t * requested_lock_row
Definition: trx0i_s.h:178
ib_time_t trx_started
Definition: trx0i_s.h:134
ibool trx_foreign_key_checks
Definition: trx0i_s.h:165
ib_time_t trx_wait_started
Definition: trx0i_s.h:139
const char * lock_index
Definition: trx0i_s.h:107
ulint trx_tables_locked
Definition: trx0i_s.h:147