Commit 1cbbe354 authored by Alexander Barkov's avatar Alexander Barkov

MDEV-19832 Reuse new I_S table definition helper classes for Spider

parent 1c27a050
...@@ -44,25 +44,21 @@ extern ulonglong spider_free_mem_count[SPIDER_MEM_CALC_LIST_NUM]; ...@@ -44,25 +44,21 @@ extern ulonglong spider_free_mem_count[SPIDER_MEM_CALC_LIST_NUM];
static struct st_mysql_storage_engine spider_i_s_info = static struct st_mysql_storage_engine spider_i_s_info =
{ MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION }; { MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION };
namespace Show {
static ST_FIELD_INFO spider_i_s_alloc_mem_fields_info[] = static ST_FIELD_INFO spider_i_s_alloc_mem_fields_info[] =
{ {
{"ID", 10, MYSQL_TYPE_LONG, 0, MY_I_S_UNSIGNED, "id", SKIP_OPEN_TABLE}, Column("ID", ULong(10), NOT_NULL, "id"),
{"FUNC_NAME", 64, MYSQL_TYPE_STRING, 0, Column("FUNC_NAME", Varchar(64), NULLABLE, "func_name"),
MY_I_S_MAYBE_NULL, "func_name", SKIP_OPEN_TABLE}, Column("FILE_NAME", Varchar(64), NULLABLE, "file_name"),
{"FILE_NAME", 64, MYSQL_TYPE_STRING, 0, Column("LINE_NO", ULong(10), NULLABLE, "line_no"),
MY_I_S_MAYBE_NULL, "file_name", SKIP_OPEN_TABLE}, Column("TOTAL_ALLOC_MEM", ULonglong(20), NULLABLE, "total_alloc_mem"),
{"LINE_NO", 10, MYSQL_TYPE_LONG, 0, Column("CURRENT_ALLOC_MEM", SLonglong(20), NULLABLE, "current_alloc_mem"),
MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL, "line_no", SKIP_OPEN_TABLE}, Column("ALLOC_MEM_COUNT", ULonglong(20), NULLABLE, "alloc_mem_count"),
{"TOTAL_ALLOC_MEM", 20, MYSQL_TYPE_LONGLONG, 0, Column("FREE_MEM_COUNT", ULonglong(20), NULLABLE, "free_mem_count"),
MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL, "total_alloc_mem", SKIP_OPEN_TABLE}, CEnd()
{"CURRENT_ALLOC_MEM", 20, MYSQL_TYPE_LONGLONG, 0,
MY_I_S_MAYBE_NULL, "current_alloc_mem", SKIP_OPEN_TABLE},
{"ALLOC_MEM_COUNT", 20, MYSQL_TYPE_LONGLONG, 0,
MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL, "alloc_mem_count", SKIP_OPEN_TABLE},
{"FREE_MEM_COUNT", 20, MYSQL_TYPE_LONGLONG, 0,
MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL, "free_mem_count", SKIP_OPEN_TABLE},
{NULL, 0, MYSQL_TYPE_STRING, 0, 0, NULL, 0}
}; };
} // namespace Show
static int spider_i_s_alloc_mem_fill_table( static int spider_i_s_alloc_mem_fill_table(
THD *thd, THD *thd,
...@@ -117,7 +113,7 @@ static int spider_i_s_alloc_mem_init( ...@@ -117,7 +113,7 @@ static int spider_i_s_alloc_mem_init(
) { ) {
ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE *) p; ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE *) p;
DBUG_ENTER("spider_i_s_alloc_mem_init"); DBUG_ENTER("spider_i_s_alloc_mem_init");
schema->fields_info = spider_i_s_alloc_mem_fields_info; schema->fields_info = Show::spider_i_s_alloc_mem_fields_info;
schema->fill_table = spider_i_s_alloc_mem_fill_table; schema->fill_table = spider_i_s_alloc_mem_fill_table;
schema->idx_field1 = 0; schema->idx_field1 = 0;
DBUG_RETURN(0); DBUG_RETURN(0);
......
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