Skip to content

Commit 9d5a8bd

Browse files
committed
MDEV-33665: MSAN failure due to uninitialized Item_func::not_null_tables_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.
1 parent 49cf702 commit 9d5a8bd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sql/sql_select.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16209,6 +16209,7 @@ Item *eliminate_item_equal(THD *thd, COND *cond, COND_EQUAL *upper_levels,
1620916209

1621016210
if (!eq_item || eq_item->set_cmp_func(thd))
1621116211
return 0;
16212+
eq_item->eval_not_null_tables(0);
1621216213
eq_item->quick_fix_field();
1621316214
}
1621416215
current_sjm= field_sjm;
@@ -16266,6 +16267,7 @@ Item *eliminate_item_equal(THD *thd, COND *cond, COND_EQUAL *upper_levels,
1626616267
{
1626716268
res->quick_fix_field();
1626816269
res->update_used_tables();
16270+
res->eval_not_null_tables(0);
1626916271
}
1627016272

1627116273
return res;

0 commit comments

Comments
 (0)