1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-27238: Assertion `got_name == named_item_expected()' failed in Json_writer

make_join_select() calls const_cond->val_int(). There are edge cases
where const_cond may have a not-yet optimized subquery.

(The subquery will have used_tables() covered by join->const_tables. It
will still have const_item()==false, so other parts of the optimizer
will not try to evaluate it.  We should probably mark such subqueries
as constant but that is outside the scope of this MDEV)
This commit is contained in:
Sergei Petrunia
2021-12-23 12:00:05 +03:00
parent 0165a06322
commit 397f5cf71e
3 changed files with 36 additions and 7 deletions

View File

@ -11409,7 +11409,11 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
}
else
{
const bool const_cond_result = const_cond->val_int() != 0;
bool const_cond_result;
{
Json_writer_array a(thd, "computing_condition");
const_cond_result= const_cond->val_int() != 0;
}
if (!const_cond_result)
{
DBUG_PRINT("info",("Found impossible WHERE condition"));