Some strange names in columns....
SELECT GET_LOCK('abc',1000);
select * from METADATA_LOCK_INFO
you will get DB = 'abc', that's not a true information, the 'abc' is the key of the MDL lock, not the database (DB), maybe we should have a "KEY" and a "SUB_KEY" here? example... DB and TABLE, when a table lock, or GET_LOCK key name and '' for sub key
maybe we could change somethings...
instead of "ID", put "THREAD_ID", since it's not a lock id and it's not the query id, (if there's a global unique mdl id could be nice put it here)
instead of "DB" put "KEY"?
instead of "TABLE" put "SUB KEY"?
from mdl.h
@remark The key for a table is <mdl_namespace><database name><table name>
maybe we should call LOCK_TYPE as "MDL_NAMESPACE" ? but it don't tell what name is used for GET_LOCK for example...
from mdl.cc, why not use "m_namespace_to_wait_state_name" names, or maybe add this information to mdl.h ? the "lock_type" (namescape) don't have a name in mdl.h yet, maybe should be nice one there?
PSI_stage_info MDL_key::m_namespace_to_wait_state_name[NAMESPACE_END]=
{
{0, "Waiting for global read lock", 0}
,
{0, "Waiting for schema metadata lock", 0}
,
{0, "Waiting for table metadata lock", 0}
,
{0, "Waiting for stored function metadata lock", 0}
,
{0, "Waiting for stored procedure metadata lock", 0}
,
{0, "Waiting for trigger metadata lock", 0}
,
{0, "Waiting for event metadata lock", 0}
,
{0, "Waiting for commit lock", 0}
,
{0, "User lock", 0}
/* Be compatible with old status. */
};
well
nice plugin, i'm using it now at production
and it's very nice to know what is blocking my queries 
thanks!
Some strange names in columns....
SELECT GET_LOCK('abc',1000);
select * from METADATA_LOCK_INFO
you will get DB = 'abc', that's not a true information, the 'abc' is the key of the MDL lock, not the database (DB), maybe we should have a "KEY" and a "SUB_KEY" here? example... DB and TABLE, when a table lock, or GET_LOCK key name and '' for sub key
maybe we could change somethings...
instead of "ID", put "THREAD_ID", since it's not a lock id and it's not the query id, (if there's a global unique mdl id could be nice put it here)
instead of "DB" put "KEY"?
instead of "TABLE" put "SUB KEY"?
from mdl.h
@remark The key for a table is <mdl_namespace><database name><table name>
maybe we should call LOCK_TYPE as "MDL_NAMESPACE" ? but it don't tell what name is used for GET_LOCK for example...
from mdl.cc, why not use "m_namespace_to_wait_state_name" names, or maybe add this information to mdl.h ? the "lock_type" (namescape) don't have a name in mdl.h yet, maybe should be nice one there?
PSI_stage_info MDL_key::m_namespace_to_wait_state_name[NAMESPACE_END]=
{0, "Waiting for global read lock", 0}{
,
{0, "Waiting for schema metadata lock", 0},
{0, "Waiting for table metadata lock", 0},
{0, "Waiting for stored function metadata lock", 0},
{0, "Waiting for stored procedure metadata lock", 0},
{0, "Waiting for trigger metadata lock", 0},
{0, "Waiting for event metadata lock", 0},
{0, "Waiting for commit lock", 0},
{0, "User lock", 0}/* Be compatible with old status. */
};
well
nice plugin, i'm using it now at production
and it's very nice to know what is blocking my queries 
thanks!