Commit 7d60030c authored by Sergey Petrunya's avatar Sergey Petrunya

MDEV-5060 Server crashes on EXPLAIN EXTENDED or EXPLAIN PARTITIONS with explain in slow_log

- If we're running explain with flags, use the same set of flags to make EXPLAIN columns 
  and contents.
parent ac54df04
......@@ -20,3 +20,9 @@ Error 1146 Table 'test.nonexisting' doesn't exist
SELECT 1;
1
1
#
# MDEV-5060 Server crashes on EXPLAIN EXTENDED or EXPLAIN PARTITIONS with explain in slow_log
#
EXPLAIN PARTITIONS SELECT 1 ;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
......@@ -28,3 +28,10 @@ SHOW WARNINGS;
--disconnect con1
--connection default
SELECT 1;
--echo #
--echo # MDEV-5060 Server crashes on EXPLAIN EXTENDED or EXPLAIN PARTITIONS with explain in slow_log
--echo #
EXPLAIN PARTITIONS SELECT 1 ;
......@@ -122,11 +122,13 @@ int QPF_query::print_explain(select_result_sink *output,
}
}
bool print_qpf_query(LEX *lex, THD *thd, String *str)
{
return lex->query_plan_footprint->print_explain_str(thd, str);
}
bool QPF_query::print_explain_str(THD *thd, String *out_str)
{
List<Item> fields;
......@@ -134,7 +136,7 @@ bool QPF_query::print_explain_str(THD *thd, String *out_str)
select_result_text_buffer output_buf(thd);
output_buf.send_result_set_metadata(fields, thd->lex->describe);
if (print_explain(&output_buf, 0))
if (print_explain(&output_buf, thd->lex->describe))
return true;
output_buf.save_to(out_str);
return false;
......
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