summaryrefslogtreecommitdiff
path: root/sql/sql_explain.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-04-21 17:46:40 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2022-04-21 17:46:40 +0300
commitfae0ccad6ec391bf85c39070f784589d48e11951 (patch)
treeb6a20ffe8c11a13edce1f0c7c46eb9c5ac3d2bab /sql/sql_explain.cc
parent1b558dd462d34e948f3a4d9e54af973e37a9746e (diff)
parent620c55e708b9ea94ef8ba309267a6f2f32ed8104 (diff)
downloadmariadb-git-fae0ccad6ec391bf85c39070f784589d48e11951.tar.gz
Merge 10.5 into 10.6
Diffstat (limited to 'sql/sql_explain.cc')
-rw-r--r--sql/sql_explain.cc38
1 files changed, 20 insertions, 18 deletions
diff --git a/sql/sql_explain.cc b/sql/sql_explain.cc
index 1dd525b7345..616a545aa0e 100644
--- a/sql/sql_explain.cc
+++ b/sql/sql_explain.cc
@@ -604,27 +604,29 @@ void Explain_union::print_explain_json(Explain_query *query,
else
writer->add_member("union_result").start_object();
- // using_temporary_table
- make_union_table_name(table_name_buffer);
- writer->add_member("table_name").add_str(table_name_buffer);
- writer->add_member("access_type").add_str("ALL"); // not very useful
-
- /* r_loops (not present in tabular output) */
- if (is_analyze)
+ if (using_tmp)
{
- writer->add_member("r_loops").add_ll(fake_select_lex_tracker.get_loops());
- }
+ make_union_table_name(table_name_buffer);
+ writer->add_member("table_name").add_str(table_name_buffer);
+ writer->add_member("access_type").add_str("ALL"); // not very useful
- /* `r_rows` */
- if (is_analyze)
- {
- writer->add_member("r_rows");
- if (fake_select_lex_tracker.has_scans())
- writer->add_double(fake_select_lex_tracker.get_avg_rows());
- else
- writer->add_null();
- }
+ /* r_loops (not present in tabular output) */
+ if (is_analyze)
+ {
+ writer->add_member("r_loops").add_ll(
+ fake_select_lex_tracker.get_loops());
+ }
+ /* `r_rows` */
+ if (is_analyze)
+ {
+ writer->add_member("r_rows");
+ if (fake_select_lex_tracker.has_scans())
+ writer->add_double(fake_select_lex_tracker.get_avg_rows());
+ else
+ writer->add_null();
+ }
+ }
writer->add_member("query_specifications").start_array();
for (int i= 0; i < (int) union_members.elements(); i++)