1
1
/*****************************************************************************
3
Copyright (C) 2007, 2009, Innobase Oy. All Rights Reserved.
3
Copyright (c) 2007, 2009, Innobase Oy. All Rights Reserved.
5
5
This program is free software; you can redistribute it and/or modify it under
6
6
the terms of the GNU General Public License as published by the Free Software
45
44
i_s_trx_row_t::trx_query */
46
45
#define TRX_I_S_TRX_QUERY_MAX_LEN 1024
48
/** The maximum length of a string that can be stored in
49
i_s_trx_row_t::trx_operation_state */
50
#define TRX_I_S_TRX_OP_STATE_MAX_LEN 64
52
/** The maximum length of a string that can be stored in
53
i_s_trx_row_t::trx_foreign_key_error */
54
#define TRX_I_S_TRX_FK_ERROR_MAX_LEN 256
56
/** The maximum length of a string that can be stored in
57
i_s_trx_row_t::trx_isolation_level */
58
#define TRX_I_S_TRX_ISOLATION_LEVEL_MAX_LEN 16
60
/** Safely copy strings in to the INNODB_TRX table's
61
string based columns */
62
#define TRX_I_S_STRING_COPY(data, field, constraint, tcache) \
64
if (strlen(data) > constraint) { \
65
char buff[constraint + 1]; \
66
strncpy(buff, data, constraint); \
67
buff[constraint] = '\0'; \
69
field = static_cast<const char *>(ha_storage_put_memlim( \
70
(tcache)->storage, buff, constraint + 1,\
71
MAX_ALLOWED_FOR_STORAGE(tcache))); \
73
field = static_cast<const char *>(ha_storage_put_str_memlim( \
74
(tcache)->storage, data, \
75
MAX_ALLOWED_FOR_STORAGE(tcache))); \
79
47
/** A row of INFORMATION_SCHEMA.innodb_locks */
80
48
typedef struct i_s_locks_row_struct i_s_locks_row_t;
81
49
/** A row of INFORMATION_SCHEMA.innodb_trx */
97
65
/** This structure represents INFORMATION_SCHEMA.innodb_locks row */
98
66
struct i_s_locks_row_struct {
99
trx_id_t lock_trx_id; /*!< transaction identifier */
67
ullint lock_trx_id; /*!< transaction identifier */
100
68
const char* lock_mode; /*!< lock mode from
101
69
lock_get_mode_str() */
102
70
const char* lock_type; /*!< lock type from
128
96
/** This structure represents INFORMATION_SCHEMA.innodb_trx row */
129
97
struct i_s_trx_row_struct {
130
trx_id_t trx_id; /*!< transaction identifier */
98
ullint trx_id; /*!< transaction identifier */
131
99
const char* trx_state; /*!< transaction state from
132
100
trx_get_que_state_str() */
133
101
ib_time_t trx_started; /*!< trx_struct::start_time */
134
102
const i_s_locks_row_t* requested_lock_row;
135
/*!< pointer to a row
136
in innodb_locks if trx
137
is waiting, or NULL */
138
ib_time_t trx_wait_started; /*!< trx_struct::wait_started */
139
ullint trx_weight; /*!< TRX_WEIGHT() */
140
ulint trx_mysql_thread_id; /*!< thd_get_thread_id() */
141
const char* trx_query; /*!< MySQL statement being
142
executed in the transaction */
143
const char* trx_operation_state; /*!< trx_struct::op_info */
144
ulint trx_tables_in_use;/*!< n_mysql_tables_in_use in
146
ulint trx_tables_locked;
147
/*!< mysql_n_tables_locked in
149
ulint trx_lock_structs;/*!< list len of trx_locks in
151
ulint trx_lock_memory_bytes;
152
/*!< mem_heap_get_size(
154
ulint trx_rows_locked;/*!< lock_number_of_rows_locked() */
155
ullint trx_rows_modified;/*!< trx_struct::undo_no */
156
ulint trx_concurrency_tickets;
157
/*!< n_tickets_to_enter_innodb in
159
const char* trx_isolation_level;
160
/*!< isolation_level in trx_struct*/
161
ibool trx_unique_checks;
162
/*!< check_unique_secondary in
164
ibool trx_foreign_key_checks;
165
/*!< check_foreigns in trx_struct */
166
const char* trx_foreign_key_error;
167
/*!< detailed_error in trx_struct */
168
ibool trx_has_search_latch;
169
/*!< has_search_latch in trx_struct */
170
ulint trx_search_latch_timeout;
171
/*!< search_latch_timeout in
103
/*!< pointer to a row
104
in innodb_locks if trx
105
is waiting, or NULL */
106
ib_time_t trx_wait_started;
107
/*!< trx_struct::wait_started */
108
ullint trx_weight; /*!< TRX_WEIGHT() */
109
ulint trx_mysql_thread_id;
110
/*!< thd_get_thread_id() */
111
const char* trx_query; /*!< MySQL statement being
112
executed in the transaction */
175
115
/** This structure represents INFORMATION_SCHEMA.innodb_lock_waits row */