Skip to content

Commit

Permalink
MDEV-33665: MSAN failure due to uninitialized Item_func::not_null_tab…
Browse files Browse the repository at this point in the history
…les_cache

eliminate_item_equal() uses quick_fix_field() for Item objects it creates.
It computes some of their attributes on its own (see update_used_tables()
call) but it doesn't update not_null_tables_cache.

Recompute not_null_tables_cache also. Not computing it is currently
harmless, except for producing MSAN error when some other code
propagates the wrong value of not_null_tables_cache to other item.
  • Loading branch information
spetrunia committed Mar 14, 2024
1 parent 49cf702 commit 9d5a8bd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sql/sql_select.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16209,6 +16209,7 @@ Item *eliminate_item_equal(THD *thd, COND *cond, COND_EQUAL *upper_levels,

if (!eq_item || eq_item->set_cmp_func(thd))
return 0;
eq_item->eval_not_null_tables(0);
eq_item->quick_fix_field();
}
current_sjm= field_sjm;
Expand Down Expand Up @@ -16266,6 +16267,7 @@ Item *eliminate_item_equal(THD *thd, COND *cond, COND_EQUAL *upper_levels,
{
res->quick_fix_field();
res->update_used_tables();
res->eval_not_null_tables(0);
}

return res;
Expand Down

0 comments on commit 9d5a8bd

Please sign in to comment.