Commit 97025c3a authored by vasil's avatar vasil

branches/zip:

Non-functional change:
Do not include the terminating '\0' in TRX_I_S_LOCK_ID_MAX_LEN.
parent 807c2807
...@@ -226,7 +226,7 @@ static ST_FIELD_INFO innodb_trx_fields_info[] = ...@@ -226,7 +226,7 @@ static ST_FIELD_INFO innodb_trx_fields_info[] =
#define IDX_TRX_REQUESTED_LOCK_ID 4 #define IDX_TRX_REQUESTED_LOCK_ID 4
{STRUCT_FLD(field_name, "trx_requested_lock_id"), {STRUCT_FLD(field_name, "trx_requested_lock_id"),
STRUCT_FLD(field_length, TRX_I_S_LOCK_ID_MAX_LEN), STRUCT_FLD(field_length, TRX_I_S_LOCK_ID_MAX_LEN + 1),
STRUCT_FLD(field_type, MYSQL_TYPE_STRING), STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
STRUCT_FLD(value, 0), STRUCT_FLD(value, 0),
STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL), STRUCT_FLD(field_flags, MY_I_S_MAYBE_NULL),
...@@ -278,7 +278,7 @@ fill_innodb_trx_from_cache( ...@@ -278,7 +278,7 @@ fill_innodb_trx_from_cache(
{ {
Field** fields; Field** fields;
ulint rows_num; ulint rows_num;
char lock_id[TRX_I_S_LOCK_ID_MAX_LEN]; char lock_id[TRX_I_S_LOCK_ID_MAX_LEN + 1];
ulint i; ulint i;
DBUG_ENTER("fill_innodb_trx_from_cache"); DBUG_ENTER("fill_innodb_trx_from_cache");
...@@ -425,7 +425,7 @@ static ST_FIELD_INFO innodb_locks_fields_info[] = ...@@ -425,7 +425,7 @@ static ST_FIELD_INFO innodb_locks_fields_info[] =
{ {
#define IDX_LOCK_ID 0 #define IDX_LOCK_ID 0
{STRUCT_FLD(field_name, "lock_id"), {STRUCT_FLD(field_name, "lock_id"),
STRUCT_FLD(field_length, TRX_I_S_LOCK_ID_MAX_LEN), STRUCT_FLD(field_length, TRX_I_S_LOCK_ID_MAX_LEN + 1),
STRUCT_FLD(field_type, MYSQL_TYPE_STRING), STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
STRUCT_FLD(value, 0), STRUCT_FLD(value, 0),
STRUCT_FLD(field_flags, 0), STRUCT_FLD(field_flags, 0),
...@@ -531,7 +531,7 @@ fill_innodb_locks_from_cache( ...@@ -531,7 +531,7 @@ fill_innodb_locks_from_cache(
{ {
Field** fields; Field** fields;
ulint rows_num; ulint rows_num;
char lock_id[TRX_I_S_LOCK_ID_MAX_LEN]; char lock_id[TRX_I_S_LOCK_ID_MAX_LEN + 1];
ulint i; ulint i;
DBUG_ENTER("fill_innodb_locks_from_cache"); DBUG_ENTER("fill_innodb_locks_from_cache");
...@@ -705,7 +705,7 @@ static ST_FIELD_INFO innodb_lock_waits_fields_info[] = ...@@ -705,7 +705,7 @@ static ST_FIELD_INFO innodb_lock_waits_fields_info[] =
#define IDX_REQUESTED_LOCK_ID 1 #define IDX_REQUESTED_LOCK_ID 1
{STRUCT_FLD(field_name, "requested_lock_id"), {STRUCT_FLD(field_name, "requested_lock_id"),
STRUCT_FLD(field_length, TRX_I_S_LOCK_ID_MAX_LEN), STRUCT_FLD(field_length, TRX_I_S_LOCK_ID_MAX_LEN + 1),
STRUCT_FLD(field_type, MYSQL_TYPE_STRING), STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
STRUCT_FLD(value, 0), STRUCT_FLD(value, 0),
STRUCT_FLD(field_flags, 0), STRUCT_FLD(field_flags, 0),
...@@ -723,7 +723,7 @@ static ST_FIELD_INFO innodb_lock_waits_fields_info[] = ...@@ -723,7 +723,7 @@ static ST_FIELD_INFO innodb_lock_waits_fields_info[] =
#define IDX_BLOCKING_LOCK_ID 3 #define IDX_BLOCKING_LOCK_ID 3
{STRUCT_FLD(field_name, "blocking_lock_id"), {STRUCT_FLD(field_name, "blocking_lock_id"),
STRUCT_FLD(field_length, TRX_I_S_LOCK_ID_MAX_LEN), STRUCT_FLD(field_length, TRX_I_S_LOCK_ID_MAX_LEN + 1),
STRUCT_FLD(field_type, MYSQL_TYPE_STRING), STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
STRUCT_FLD(value, 0), STRUCT_FLD(value, 0),
STRUCT_FLD(field_flags, 0), STRUCT_FLD(field_flags, 0),
...@@ -748,8 +748,8 @@ fill_innodb_lock_waits_from_cache( ...@@ -748,8 +748,8 @@ fill_innodb_lock_waits_from_cache(
{ {
Field** fields; Field** fields;
ulint rows_num; ulint rows_num;
char requested_lock_id[TRX_I_S_LOCK_ID_MAX_LEN]; char requested_lock_id[TRX_I_S_LOCK_ID_MAX_LEN + 1];
char blocking_lock_id[TRX_I_S_LOCK_ID_MAX_LEN]; char blocking_lock_id[TRX_I_S_LOCK_ID_MAX_LEN + 1];
ulint i; ulint i;
DBUG_ENTER("fill_innodb_lock_waits_from_cache"); DBUG_ENTER("fill_innodb_lock_waits_from_cache");
......
...@@ -172,16 +172,16 @@ trx_i_s_cache_is_truncated( ...@@ -172,16 +172,16 @@ trx_i_s_cache_is_truncated(
/* out: TRUE if truncated */ /* out: TRUE if truncated */
trx_i_s_cache_t* cache); /* in: cache */ trx_i_s_cache_t* cache); /* in: cache */
/* The maximum length that may be required by lock_id_size in /* The maximum length of a resulting lock_id_size in
trx_i_s_create_lock_id(). "%llu:%lu:%lu:%lu" -> 84 chars */ trx_i_s_create_lock_id(), not including the terminating '\0'.
"%llu:%lu:%lu:%lu" -> 83 chars */
#define TRX_I_S_LOCK_ID_MAX_LEN 84 #define TRX_I_S_LOCK_ID_MAX_LEN 83
/*********************************************************************** /***********************************************************************
Crafts a lock id string from a i_s_locks_row_t object. Returns its Crafts a lock id string from a i_s_locks_row_t object. Returns its
second argument. This function aborts if there is not enough space in second argument. This function aborts if there is not enough space in
lock_id. Be sure to provide at least TRX_I_S_LOCK_ID_MAX_LEN if you want lock_id. Be sure to provide at least TRX_I_S_LOCK_ID_MAX_LEN + 1 if you
to be 100% sure that it will not abort. */ want to be 100% sure that it will not abort. */
char* char*
trx_i_s_create_lock_id( trx_i_s_create_lock_id(
......
...@@ -1360,8 +1360,8 @@ trx_i_s_cache_get_nth_row( ...@@ -1360,8 +1360,8 @@ trx_i_s_cache_get_nth_row(
/*********************************************************************** /***********************************************************************
Crafts a lock id string from a i_s_locks_row_t object. Returns its Crafts a lock id string from a i_s_locks_row_t object. Returns its
second argument. This function aborts if there is not enough space in second argument. This function aborts if there is not enough space in
lock_id. Be sure to provide at least TRX_I_S_LOCK_ID_MAX_LEN if you want lock_id. Be sure to provide at least TRX_I_S_LOCK_ID_MAX_LEN + 1 if you
to be 100% sure that it will not abort. */ want to be 100% sure that it will not abort. */
char* char*
trx_i_s_create_lock_id( trx_i_s_create_lock_id(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment