1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-7970: EXPLAIN FORMAT=JSON does not print HAVING

Printing non-trivial HAVING added.
This commit is contained in:
Oleksandr Byelkin
2015-09-09 16:29:50 +02:00
parent 79140b0383
commit da3ec3d421
7 changed files with 271 additions and 3 deletions

View File

@ -862,7 +862,20 @@ void Explain_select::print_explain_json(Explain_query *query,
writer->add_member("const_condition");
write_item(writer, exec_const_cond);
}
/* we do not print HAVING which always evaluates to TRUE */
if (having || (having_value == Item::COND_FALSE))
{
writer->add_member("having_condition");
if (likely(having))
write_item(writer, having);
else
{
/* Normally we should not go this branch, left just for safety */
DBUG_ASSERT(having_value == Item::COND_FALSE);
writer->add_str("0");
}
}
Filesort_tracker *first_table_sort= NULL;
bool first_table_sort_used= false;
int started_objects= 0;