summaryrefslogtreecommitdiff
path: root/sql/sql_explain.cc
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2015-09-24 15:43:01 +0300
committerSergei Petrunia <psergey@askmonty.org>2015-09-24 15:45:54 +0300
commit7016621596d4700a8cf2c228f958edf8d8932d38 (patch)
treea48162f6de7080fc1f2901355e0782fddd219a38 /sql/sql_explain.cc
parent428f03c0b5cb9b0d85a7d70772dbf2b430672e83 (diff)
downloadmariadb-git-7016621596d4700a8cf2c228f958edf8d8932d38.tar.gz
MDEV-8829: Assertion `0' failed in Explain_table_access::tag_to_json
- Add EXPLAIN/ANALYZE FORMAT=JSON handling for a few special cases.
Diffstat (limited to 'sql/sql_explain.cc')
-rw-r--r--sql/sql_explain.cc38
1 files changed, 38 insertions, 0 deletions
diff --git a/sql/sql_explain.cc b/sql/sql_explain.cc
index 1d804b15390..ba035ab2343 100644
--- a/sql/sql_explain.cc
+++ b/sql/sql_explain.cc
@@ -1381,6 +1381,10 @@ void Explain_table_access::tag_to_json(Json_writer *writer, enum explain_extra_t
writer->add_member("index_condition");
write_item(writer, pushed_index_cond);
break;
+ case ET_USING_INDEX_CONDITION_BKA:
+ writer->add_member("index_condition_bka");
+ write_item(writer, pushed_index_cond);
+ break;
case ET_USING_WHERE:
{
/*
@@ -1429,6 +1433,40 @@ void Explain_table_access::tag_to_json(Json_writer *writer, enum explain_extra_t
else
writer->add_bool(true);
break;
+
+ /*new:*/
+ case ET_CONST_ROW_NOT_FOUND:
+ writer->add_member("const_row_not_found").add_bool(true);
+ break;
+ case ET_UNIQUE_ROW_NOT_FOUND:
+ /*
+ Currently, we never get here. All SELECTs that have
+ ET_UNIQUE_ROW_NOT_FOUND for a table are converted into degenerate
+ SELECTs with message="Impossible WHERE ...".
+ MySQL 5.6 has the same property.
+ I'm leaving the handling in just for the sake of covering all enum
+ members and safety.
+ */
+ writer->add_member("unique_row_not_found").add_bool(true);
+ break;
+ case ET_IMPOSSIBLE_ON_CONDITION:
+ writer->add_member("impossible_on_condition").add_bool(true);
+ break;
+ case ET_USING_WHERE_WITH_PUSHED_CONDITION:
+ /*
+ It would be nice to print the pushed condition, but current Storage
+ Engine API doesn't provide any way to do that
+ */
+ writer->add_member("pushed_condition").add_bool(true);
+ break;
+
+ case ET_NOT_EXISTS:
+ writer->add_member("not_exists").add_bool(true);
+ break;
+ case ET_DISTINCT:
+ writer->add_member("distinct").add_bool(true);
+ break;
+
default:
DBUG_ASSERT(0);
}