Commit 2b0642a6 authored by Olav Sandstaa's avatar Olav Sandstaa

Fix for Bug#49506 Valgrind error in make_cond_for_table_from_pred

      
This fix has been proposed by Sergey Petrunya and has been contributed
under SCA by sca@askmonty.org.
      
The cause for this valgrind error is that in the function
add_cond_and_fix() in sql_select.cc an Item_cond_and object is
created. This is marked as fixed but does not have a correct
table_map() attribute. Later, in make_join_select(), if
engine_condition_pushdown is in use, this table map is used and
results in the valgrind error.
      
The fix is to add a call to update_used_tables() in add_cond_and_fix()
so that the table map is updated correctly.
      
This patch is tested by multiple existing tests (e.g. the tests
innodb_mysql, innodb, fulltext, compress all produces this valgrind
warning/error without this fix).
parent 514f4814
......@@ -5859,6 +5859,7 @@ inline void add_cond_and_fix(Item **e1, Item *e2)
{
*e1= res;
res->quick_fix_field();
res->update_used_tables();
}
}
else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment