• Raghav Kapoor's avatar
    BUG#15978766 - TEST VALGRIND_REPORT FAILS INNODB TESTS · 0d67ea37
    Raghav Kapoor authored
    BACKGROUND:
    The testcase i_innodb.innodb_bug14036214 when run under valgrind
    leaks memory.
    
    ANALYSIS:
    In the code path of mysql_update, a temporary file is opened
    using open_cached_file().
    When an error has occured in that code path, this temporary
    file was not closed since call to close_cached_file() was 
    missing.
    This problem exists in 5.5 but it does not exists in 5.6 and 
    trunk. 
    This is because in 5.6 and trunk, when we issue the update
    statement in the test case, it does not take the same code path
    as in 5.5. The code path is different because a different plan 
    is chosen by optimizer. 
    See Bug#14036214 for details.
    However, the problem can still be examined in 5.6 and trunk
    by code inspection.
    
    FIX:
    The file opened by open_cached_file() has been closed by calling
    close_cached_file() when an error occurs so that it does not 
    results in a memory leak.
    0d67ea37
sql_update.cc 71.3 KB