• Olav Sandstaa's avatar
    Fix for Bug#49506 Valgrind error in make_cond_for_table_from_pred · 9060aa68
    Olav Sandstaa authored
          
    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).
    
    
    sql/sql_select.cc:
      In add_cond_and_fix() add a call to update_used_tables() to ensure
      the table map is updated.
    9060aa68
sql_select.cc 537 KB