diff options
Diffstat (limited to 'plugin/metadata_lock_info/metadata_lock_info.cc')
-rw-r--r-- | plugin/metadata_lock_info/metadata_lock_info.cc | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/plugin/metadata_lock_info/metadata_lock_info.cc b/plugin/metadata_lock_info/metadata_lock_info.cc index a4c1d8ef205..46c31ca3a96 100644 --- a/plugin/metadata_lock_info/metadata_lock_info.cc +++ b/plugin/metadata_lock_info/metadata_lock_info.cc @@ -18,7 +18,7 @@ #include "mysql_version.h" #include "mysql/plugin.h" #include "sql_class.h" -#include "sql_show.h" +#include "sql_i_s.h" static const LEX_STRING metadata_lock_info_lock_name[] = { { C_STRING_WITH_LEN("Backup lock") }, @@ -32,23 +32,22 @@ static const LEX_STRING metadata_lock_info_lock_name[] = { { C_STRING_WITH_LEN("User lock") }, }; +namespace Show { + static ST_FIELD_INFO i_s_metadata_lock_info_fields_info[] = { - {"THREAD_ID", 20, MYSQL_TYPE_LONGLONG, 0, - MY_I_S_UNSIGNED, "thread_id", SKIP_OPEN_TABLE}, - {"LOCK_MODE", 24, MYSQL_TYPE_STRING, 0, - MY_I_S_MAYBE_NULL, "lock_mode", SKIP_OPEN_TABLE}, - {"LOCK_DURATION", 30, MYSQL_TYPE_STRING, 0, - MY_I_S_MAYBE_NULL, "lock_duration", SKIP_OPEN_TABLE}, - {"LOCK_TYPE", 33, MYSQL_TYPE_STRING, 0, - MY_I_S_MAYBE_NULL, "lock_type", SKIP_OPEN_TABLE}, - {"TABLE_SCHEMA", 64, MYSQL_TYPE_STRING, 0, - MY_I_S_MAYBE_NULL, "table_schema", SKIP_OPEN_TABLE}, - {"TABLE_NAME", 64, MYSQL_TYPE_STRING, 0, - MY_I_S_MAYBE_NULL, "table_name", SKIP_OPEN_TABLE}, - {NULL, 0, MYSQL_TYPE_STRING, 0, 0, NULL, 0} + Column("THREAD_ID", ULonglong(20), NOT_NULL, "thread_id"), + Column("LOCK_MODE", Varchar(24), NULLABLE, "lock_mode"), + Column("LOCK_DURATION", Varchar(30), NULLABLE, "lock_duration"), + Column("LOCK_TYPE", Varchar(33), NULLABLE, "lock_type"), + Column("TABLE_SCHEMA", Name(), NULLABLE, "table_schema"), + Column("TABLE_NAME", Name(), NULLABLE, "table_name"), + CEnd() }; +} // namespace Show + + struct st_i_s_metadata_param { THD *thd; @@ -110,7 +109,7 @@ static int i_s_metadata_lock_info_init( ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE *) p; DBUG_ENTER("i_s_metadata_lock_info_init"); - schema->fields_info = i_s_metadata_lock_info_fields_info; + schema->fields_info = Show::i_s_metadata_lock_info_fields_info; schema->fill_table = i_s_metadata_lock_info_fill_table; schema->idx_field1 = 0; DBUG_RETURN(0); |