Skip to content

Commit

Permalink
MDEV-28437: Assertion `!eliminated' failed: Part #2
Browse files Browse the repository at this point in the history
In SELECT_LEX::update_used_tables(),
do not run the loop setting tl->table->maybe_null
when tl is an eliminated table

(Rationale: First, with current table elimination, tl already
 has maybe_null=1. Second, one should not care what flags
 eliminated tables had)
  • Loading branch information
spetrunia committed May 5, 2022
1 parent 8dbfaa2 commit 84e32ef
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions sql/sql_lex.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4219,16 +4219,20 @@ void SELECT_LEX::update_used_tables()
while ((tl= ti++))
{
TABLE_LIST *embedding= tl;
do
if (!is_eliminated_table(join->eliminated_tables, tl))
{
bool maybe_null;
if ((maybe_null= MY_TEST(embedding->outer_join)))
do
{
tl->table->maybe_null= maybe_null;
break;
bool maybe_null;
if ((maybe_null= MY_TEST(embedding->outer_join)))
{
tl->table->maybe_null= maybe_null;
break;
}
}
while ((embedding= embedding->embedding));
}
while ((embedding= embedding->embedding));

if (tl->on_expr && !is_eliminated_table(join->eliminated_tables, tl))
{
tl->on_expr->update_used_tables();
Expand Down

0 comments on commit 84e32ef

Please sign in to comment.