mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-8829: Assertion `0' failed in Explain_table_access::tag_to_json
- Add EXPLAIN/ANALYZE FORMAT=JSON handling for a few special cases.
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user