mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
MDEV-11975: SQLCOM_PREPARE of EXPLAIN & ANALYZE statement do not return correct metadata info
Added metadate info after prepare EXPLAIN/ANALYZE.
This commit is contained in:
committed by
Sergei Golubchik
parent
01c49e66b5
commit
83123412f0
@ -2405,18 +2405,31 @@ CHANGED_TABLE_LIST* THD::changed_table_dup(const char *key, long key_length)
|
||||
}
|
||||
|
||||
|
||||
int THD::send_explain_fields(select_result *result, uint8 explain_flags, bool is_analyze)
|
||||
void THD::prepare_explain_fields(select_result *result,
|
||||
List<Item> *field_list,
|
||||
uint8 explain_flags,
|
||||
bool is_analyze)
|
||||
{
|
||||
if (lex->explain_json)
|
||||
make_explain_json_field_list(*field_list, is_analyze);
|
||||
else
|
||||
make_explain_field_list(*field_list, explain_flags, is_analyze);
|
||||
|
||||
result->prepare(*field_list, NULL);
|
||||
}
|
||||
|
||||
|
||||
int THD::send_explain_fields(select_result *result,
|
||||
uint8 explain_flags,
|
||||
bool is_analyze)
|
||||
{
|
||||
List<Item> field_list;
|
||||
if (lex->explain_json)
|
||||
make_explain_json_field_list(field_list, is_analyze);
|
||||
else
|
||||
make_explain_field_list(field_list, explain_flags, is_analyze);
|
||||
|
||||
result->prepare(field_list, NULL);
|
||||
return (result->send_result_set_metadata(field_list,
|
||||
Protocol::SEND_NUM_ROWS |
|
||||
Protocol::SEND_EOF));
|
||||
int rc;
|
||||
prepare_explain_fields(result, &field_list, explain_flags, is_analyze);
|
||||
rc= result->send_result_set_metadata(field_list,
|
||||
Protocol::SEND_NUM_ROWS |
|
||||
Protocol::SEND_EOF);
|
||||
return(rc);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user