1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-27021 Add support of FORMAT=JSON for SHOW ANALYZE

This commit is contained in:
Oleg Smirnov
2022-02-02 19:44:43 +07:00
committed by Sergei Petrunia
parent e7fcd496d4
commit d1a1ad4c28
6 changed files with 1634 additions and 23 deletions

View File

@@ -3242,13 +3242,14 @@ int fill_show_explain_tabular(THD *thd, TABLE_LIST *table, COND *cond)
int fill_show_explain_json(THD *thd, TABLE_LIST *table, COND *cond)
{
return fill_show_explain_or_analyze(
thd, table, cond, TRUE /* json_format */, TRUE /* is_analyze */);
thd, table, cond, TRUE /* json_format */, FALSE /* is_analyze */);
}
int fill_show_analyze_tabular(THD * thd, TABLE_LIST * table, COND * cond)
{
return fill_show_explain_or_analyze(
thd, table, cond, FALSE /* json_format */, TRUE /* is_analyze */);
thd, table, cond, FALSE /* json_format */, TRUE /* is_analyze */);
}
@@ -9676,7 +9677,7 @@ ST_FIELD_INFO show_explain_json_fields_info[]=
};
ST_FIELD_INFO show_analyze_fields_info[]=
ST_FIELD_INFO show_analyze_tabular_fields_info[]=
{
Column("id", SLonglong(3), NULLABLE, "id"),
Column("select_type", Varchar(19), NOT_NULL, "select_type"),
@@ -9699,6 +9700,11 @@ ST_FIELD_INFO show_analyze_fields_info[]=
};
ST_FIELD_INFO show_analyze_json_fields_info[]= {
Column("EXPLAIN", Longtext(MAX_FIELD_VARCHARLENGTH), NOT_NULL, "ANALYZE"),
CEnd()};
ST_FIELD_INFO check_constraints_fields_info[]=
{
Column("CONSTRAINT_CATALOG", Catalog(), NOT_NULL, OPEN_FULL_TABLE),
@@ -9759,12 +9765,18 @@ ST_SCHEMA_TABLE schema_tables[]=
{"EVENTS", Show::events_fields_info, 0,
0, make_old_format, 0, -1, -1, 0, 0},
#endif
{"EXPLAIN", Show::show_explain_tabular_fields_info, 0, fill_show_explain_tabular,
make_old_format, 0, -1, -1, TRUE /*hidden*/ , 0},
{"EXPLAIN_JSON", Show::show_explain_json_fields_info, 0, fill_show_explain_json,
make_old_format, 0, -1, -1, TRUE /*hidden*/, 0},
{"ANALYZE", Show::show_analyze_fields_info, 0, fill_show_analyze_tabular,
make_old_format, 0, -1, -1, TRUE /*hidden*/, 0},
{"EXPLAIN", Show::show_explain_tabular_fields_info, 0,
fill_show_explain_tabular, make_old_format, 0, -1, -1,
TRUE /*hidden*/ , 0},
{"EXPLAIN_JSON", Show::show_explain_json_fields_info, 0,
fill_show_explain_json, make_old_format, 0, -1, -1,
TRUE /*hidden*/ , 0},
{"ANALYZE", Show::show_analyze_tabular_fields_info, 0,
fill_show_analyze_tabular, make_old_format, 0, -1, -1,
TRUE /*hidden*/, 0},
{"ANALYZE_JSON", Show::show_analyze_json_fields_info, 0,
fill_show_analyze_json, make_old_format, 0, -1, -1,
TRUE /*hidden*/, 0},
{"FILES", Show::files_fields_info, 0,
hton_fill_schema_table, 0, 0, -1, -1, 0, 0},
{"GLOBAL_STATUS", Show::variables_fields_info, 0,