drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
trx0i_s.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (C) 2007, 2009, Innobase Oy. All Rights Reserved.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License as published by the Free Software
7Foundation; version 2 of the License.
8
9This program is distributed in the hope that it will be useful, but WITHOUT
10ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
13You should have received a copy of the GNU General Public License along with
14this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15St, Fifth Floor, Boston, MA 02110-1301 USA
16
17*****************************************************************************/
18
19/**************************************************/
27
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) \
64do { \
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
97
101 const char* lock_mode;
103 const char* lock_type;
105 const char* lock_table;
107 const char* lock_index;
111 /* @{ */
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
175
181
184
192
197
198/*******************************************************************/
200UNIV_INTERN
201void
203/*===============*/
204 trx_i_s_cache_t* cache);
205/*******************************************************************/
207UNIV_INTERN
208void
210/*===============*/
211 trx_i_s_cache_t* cache);
212
213/*******************************************************************/
215UNIV_INTERN
216void
218/*=====================*/
219 trx_i_s_cache_t* cache);
220
221/*******************************************************************/
223UNIV_INTERN
224void
226/*===================*/
227 trx_i_s_cache_t* cache);
228
229/*******************************************************************/
231UNIV_INTERN
232void
234/*======================*/
235 trx_i_s_cache_t* cache);
236
237/*******************************************************************/
239UNIV_INTERN
240void
242/*====================*/
243 trx_i_s_cache_t* cache);
244
245
246/*******************************************************************/
250UNIV_INTERN
251ulint
253/*========================*/
254 trx_i_s_cache_t* cache,
255 enum i_s_table table);
256
257/*******************************************************************/
261UNIV_INTERN
262void*
264/*======================*/
265 trx_i_s_cache_t* cache,
266 enum i_s_table table,
267 ulint n);
268
269/*******************************************************************/
272UNIV_INTERN
273int
275/*===================================*/
276 trx_i_s_cache_t* cache);
277
278/*******************************************************************/
282UNIV_INTERN
283ibool
285/*=======================*/
286 trx_i_s_cache_t* cache);
287
291#define TRX_I_S_LOCK_ID_MAX_LEN (TRX_ID_MAX_LEN + 63)
292
293/*******************************************************************/
299UNIV_INTERN
300char*
302/*===================*/
303 const i_s_locks_row_t* row,
304 char* lock_id,
305 ulint lock_id_size);
307
308#endif /* trx0i_s_h */
i_s_hash_chain_t * next
Definition trx0i_s.h:95
i_s_locks_row_t * value
Definition trx0i_s.h:93
const i_s_locks_row_t * blocking_lock_row
Definition trx0i_s.h:179
const i_s_locks_row_t * requested_lock_row
Definition trx0i_s.h:178
trx_id_t lock_trx_id
Definition trx0i_s.h:100
const char * lock_data
Definition trx0i_s.h:116
const char * lock_mode
Definition trx0i_s.h:101
table_id_t lock_table_id
Definition trx0i_s.h:121
const char * lock_index
Definition trx0i_s.h:107
const char * lock_table
Definition trx0i_s.h:105
i_s_hash_chain_t hash_chain
Definition trx0i_s.h:124
const char * lock_type
Definition trx0i_s.h:103
ulint trx_search_latch_timeout
Definition trx0i_s.h:171
ulint trx_lock_structs
Definition trx0i_s.h:150
ibool trx_unique_checks
Definition trx0i_s.h:162
const char * trx_query
Definition trx0i_s.h:142
trx_id_t trx_id
Definition trx0i_s.h:131
ulint trx_tables_in_use
Definition trx0i_s.h:145
const i_s_locks_row_t * requested_lock_row
Definition trx0i_s.h:135
const char * trx_operation_state
Definition trx0i_s.h:144
ulint trx_lock_memory_bytes
Definition trx0i_s.h:152
ib_time_t trx_wait_started
Definition trx0i_s.h:139
ibool trx_foreign_key_checks
Definition trx0i_s.h:165
const char * trx_foreign_key_error
Definition trx0i_s.h:167
const char * trx_state
Definition trx0i_s.h:132
ulint trx_tables_locked
Definition trx0i_s.h:147
ulint trx_concurrency_tickets
Definition trx0i_s.h:157
ulint trx_mysql_thread_id
Definition trx0i_s.h:141
const char * trx_isolation_level
Definition trx0i_s.h:160
ib_time_t trx_started
Definition trx0i_s.h:134
ibool trx_has_search_latch
Definition trx0i_s.h:169
ulint trx_rows_locked
Definition trx0i_s.h:155
ullint trx_rows_modified
Definition trx0i_s.h:156
UNIV_INTERN int trx_i_s_possibly_fetch_data_into_cache(trx_i_s_cache_t *cache)
Definition trx0i_s.cc:1331
UNIV_INTERN void trx_i_s_cache_start_write(trx_i_s_cache_t *cache)
Definition trx0i_s.cc:1458
struct trx_i_s_cache_struct trx_i_s_cache_t
Definition trx0i_s.h:183
UNIV_INTERN void trx_i_s_cache_start_read(trx_i_s_cache_t *cache)
Definition trx0i_s.cc:1424
UNIV_INTERN void trx_i_s_cache_end_read(trx_i_s_cache_t *cache)
Definition trx0i_s.cc:1435
struct i_s_trx_row_struct i_s_trx_row_t
Definition trx0i_s.h:83
trx_i_s_cache_t * trx_i_s_cache
Definition trx0i_s.cc:197
struct i_s_hash_chain_struct i_s_hash_chain_t
Definition trx0i_s.h:88
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
struct i_s_locks_row_struct i_s_locks_row_t
Definition trx0i_s.h:81
UNIV_INTERN void trx_i_s_cache_end_write(trx_i_s_cache_t *cache)
Definition trx0i_s.cc:1469
UNIV_INTERN void trx_i_s_cache_free(trx_i_s_cache_t *cache)
Definition trx0i_s.cc:1408
UNIV_INTERN ibool trx_i_s_cache_is_truncated(trx_i_s_cache_t *cache)
Definition trx0i_s.cc:1356
struct i_s_lock_waits_row_struct i_s_lock_waits_row_t
Definition trx0i_s.h:85
UNIV_INTERN void trx_i_s_cache_init(trx_i_s_cache_t *cache)
Definition trx0i_s.cc:1367
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
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
@ I_S_INNODB_TRX
Definition trx0i_s.h:188
@ I_S_INNODB_LOCK_WAITS
Definition trx0i_s.h:190
@ I_S_INNODB_LOCKS
Definition trx0i_s.h:189
ib_id_t trx_id_t
Definition trx0types.h:85
time_t ib_time_t
Definition ut0ut.h:56