Commit 976c562f authored by vasil's avatar vasil

branches/zip:

 
Make lock_get_type_str() to also indicate if it is a gap lock.
 
Suggested by:	Heikki
Approved by:	Marko
parent dd7f7021
......@@ -416,7 +416,8 @@ static ST_FIELD_INFO innodb_locks_fields_info[] =
#define IDX_LOCK_MODE 2
{STRUCT_FLD(field_name, "lock_mode"),
STRUCT_FLD(field_length, 32 /* S|X|IS|IX|AUTO_INC|UNKNOWN */),
/* S[,GAP] X[,GAP] IS[,GAP] IX[,GAP] AUTO_INC UNKNOWN */
STRUCT_FLD(field_length, 32),
STRUCT_FLD(field_type, MYSQL_TYPE_STRING),
STRUCT_FLD(value, 0),
STRUCT_FLD(field_flags, 0),
......
......@@ -5382,15 +5382,36 @@ lock_get_mode_str(
/* out: lock mode */
const lock_t* lock) /* in: lock */
{
ibool is_gap_lock;
is_gap_lock = lock_get_type_low(lock) == LOCK_REC
&& lock_rec_get_gap(lock);
switch (lock_get_mode(lock)) {
case LOCK_S:
if (is_gap_lock) {
return("S,GAP");
} else {
return("S");
}
case LOCK_X:
if (is_gap_lock) {
return("X,GAP");
} else {
return("X");
}
case LOCK_IS:
if (is_gap_lock) {
return("IS,GAP");
} else {
return("IS");
}
case LOCK_IX:
if (is_gap_lock) {
return("IX,GAP");
} else {
return("IX");
}
case LOCK_AUTO_INC:
return("AUTO_INC");
default:
......
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