mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 13:32:33 +01:00
branches/zip:
Move the column trx_weight near the end in the information_schema.innodb_trx table. Suggested by: Ken Approved by: Marko
This commit is contained in:
parent
d4de2116e0
commit
12c03b4306
3 changed files with 19 additions and 18 deletions
|
@ -197,16 +197,7 @@ static ST_FIELD_INFO innodb_trx_fields_info[] =
|
|||
STRUCT_FLD(old_name, ""),
|
||||
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
|
||||
|
||||
#define IDX_TRX_WEIGHT 1
|
||||
{STRUCT_FLD(field_name, "trx_weight"),
|
||||
STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
|
||||
STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
|
||||
STRUCT_FLD(value, 0),
|
||||
STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
|
||||
STRUCT_FLD(old_name, ""),
|
||||
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
|
||||
|
||||
#define IDX_TRX_STATE 2
|
||||
#define IDX_TRX_STATE 1
|
||||
{STRUCT_FLD(field_name, "trx_state"),
|
||||
STRUCT_FLD(field_length, TRX_QUE_STATE_STR_MAX_LEN + 1),
|
||||
STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
|
||||
|
@ -215,7 +206,7 @@ static ST_FIELD_INFO innodb_trx_fields_info[] =
|
|||
STRUCT_FLD(old_name, ""),
|
||||
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
|
||||
|
||||
#define IDX_TRX_STARTED 3
|
||||
#define IDX_TRX_STARTED 2
|
||||
{STRUCT_FLD(field_name, "trx_started"),
|
||||
STRUCT_FLD(field_length, 0),
|
||||
STRUCT_FLD(field_type, MYSQL_TYPE_DATETIME),
|
||||
|
@ -224,7 +215,7 @@ static ST_FIELD_INFO innodb_trx_fields_info[] =
|
|||
STRUCT_FLD(old_name, ""),
|
||||
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
|
||||
|
||||
#define IDX_TRX_REQUESTED_LOCK_ID 4
|
||||
#define IDX_TRX_REQUESTED_LOCK_ID 3
|
||||
{STRUCT_FLD(field_name, "trx_requested_lock_id"),
|
||||
STRUCT_FLD(field_length, TRX_I_S_LOCK_ID_MAX_LEN + 1),
|
||||
STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
|
||||
|
@ -233,7 +224,7 @@ static ST_FIELD_INFO innodb_trx_fields_info[] =
|
|||
STRUCT_FLD(old_name, ""),
|
||||
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
|
||||
|
||||
#define IDX_TRX_WAIT_STARTED 5
|
||||
#define IDX_TRX_WAIT_STARTED 4
|
||||
{STRUCT_FLD(field_name, "trx_wait_started"),
|
||||
STRUCT_FLD(field_length, 0),
|
||||
STRUCT_FLD(field_type, MYSQL_TYPE_DATETIME),
|
||||
|
@ -242,6 +233,15 @@ static ST_FIELD_INFO innodb_trx_fields_info[] =
|
|||
STRUCT_FLD(old_name, ""),
|
||||
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
|
||||
|
||||
#define IDX_TRX_WEIGHT 5
|
||||
{STRUCT_FLD(field_name, "trx_weight"),
|
||||
STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
|
||||
STRUCT_FLD(field_type, MYSQL_TYPE_LONGLONG),
|
||||
STRUCT_FLD(value, 0),
|
||||
STRUCT_FLD(field_flags, MY_I_S_UNSIGNED),
|
||||
STRUCT_FLD(old_name, ""),
|
||||
STRUCT_FLD(open_method, SKIP_OPEN_TABLE)},
|
||||
|
||||
#define IDX_TRX_MYSQL_THREAD_ID 6
|
||||
{STRUCT_FLD(field_name, "trx_mysql_thread_id"),
|
||||
STRUCT_FLD(field_length, MY_INT64_NUM_DECIMAL_DIGITS),
|
||||
|
@ -301,9 +301,6 @@ fill_innodb_trx_from_cache(
|
|||
ut_snprintf(trx_id, sizeof(trx_id), TRX_ID_FMT, row->trx_id);
|
||||
OK(field_store_string(fields[IDX_TRX_ID], trx_id));
|
||||
|
||||
/* trx_weight */
|
||||
OK(fields[IDX_TRX_WEIGHT]->store(row->trx_weight));
|
||||
|
||||
/* trx_state */
|
||||
OK(field_store_string(fields[IDX_TRX_STATE],
|
||||
row->trx_state));
|
||||
|
@ -333,6 +330,9 @@ fill_innodb_trx_from_cache(
|
|||
fields[IDX_TRX_WAIT_STARTED]->set_null();
|
||||
}
|
||||
|
||||
/* trx_weight */
|
||||
OK(fields[IDX_TRX_WEIGHT]->store(row->trx_weight));
|
||||
|
||||
/* trx_mysql_thread_id */
|
||||
OK(fields[IDX_TRX_MYSQL_THREAD_ID]->store(
|
||||
row->trx_mysql_thread_id));
|
||||
|
|
|
@ -59,11 +59,11 @@ struct i_s_locks_row_struct {
|
|||
/* This structure represents INFORMATION_SCHEMA.innodb_trx row */
|
||||
typedef struct i_s_trx_row_struct {
|
||||
ullint trx_id;
|
||||
ullint trx_weight;
|
||||
const char* trx_state;
|
||||
ib_time_t trx_started;
|
||||
const i_s_locks_row_t* requested_lock_row;
|
||||
ib_time_t trx_wait_started;
|
||||
ullint trx_weight;
|
||||
ulint trx_mysql_thread_id;
|
||||
const char* trx_query;
|
||||
} i_s_trx_row_t;
|
||||
|
|
|
@ -372,7 +372,6 @@ fill_trx_row(
|
|||
strings */
|
||||
{
|
||||
row->trx_id = trx_get_id(trx);
|
||||
row->trx_weight = (ullint) ut_conv_dulint_to_longlong(TRX_WEIGHT(trx));
|
||||
row->trx_started = (ib_time_t) trx->start_time;
|
||||
row->trx_state = trx_get_que_state_str(trx);
|
||||
|
||||
|
@ -390,6 +389,8 @@ fill_trx_row(
|
|||
row->trx_wait_started = 0;
|
||||
}
|
||||
|
||||
row->trx_weight = (ullint) ut_conv_dulint_to_longlong(TRX_WEIGHT(trx));
|
||||
|
||||
row->trx_mysql_thread_id = ib_thd_get_thread_id(trx->mysql_thd);
|
||||
|
||||
if (trx->mysql_query_str != NULL && *trx->mysql_query_str != NULL) {
|
||||
|
|
Loading…
Reference in a new issue