#At file:///export/home/tmp/olav/bug-XXX-6/ based on revid:zhenxing.he@stripped
3760 Olav Sandstaa 2009-12-08
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@stripped.
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).
@ sql/sql_select.cc
In add_cond_and_fix() add a call to update_used_tables() to ensure
the table map is updated.
modified:
sql/sql_select.cc
=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc 2009-12-02 13:21:27 +0000
+++ b/sql/sql_select.cc 2009-12-08 07:53:29 +0000
@@ -8486,6 +8486,7 @@ inline void add_cond_and_fix(Item **e1,
{
*e1= res;
res->quick_fix_field();
+ res->update_used_tables();
}
}
else
Attachment: [text/bzr-bundle] bzr/olav@sun.com-20091208075329-mzg01h2jkryt740k.bundle