• Alfranio Correia's avatar
    BUG#43949 Initialization of slave produces a warning message in Valgrind · f6eb9426
    Alfranio Correia authored
    In order to define the --slave-load-tmpdir, the init_relay_log_file()
    was calling fn_format(MY_PACK_FILENAME) which internally was indirectly
    calling strmov_overlapp() (through pack_dirname) and the following
    warning message was being printed out while running in Valgrind:
    "source and destination overlap in strcpy".
    
    We fixed the issue by removing the flag MY_PACK_FILENAME as it was not
    necessary. In a nutshell, with this flag the function fn_format() tried
    to replace a directory by either "~", "." or "..". However, we wanted
    exactly to remove such strings.
    
    In this patch, we also refactored the functions init_relay_log_file()
    and check_temp_dir(). The former was refactored to call the fn_format()
    with the flag MY_SAFE_PATH along with the MY_RETURN_REAL_PATH,  in order
    to avoid issues with long directories and return an absolute path,
    respectively. The flag MY_SAFE_UNPACK_FILENAME was removed too as it was
    responsible for removing "~", "." or ".." only from the file parameter
    and we wanted to remove such strings from the directory parameter in
    the fn_format(). This result is stored in an rli variable, which is then
    processed by the other function in order to verify if the directory exists
    and if we are able to create files in it.
    
    
    mysql-test/suite/rpl/t/rpl_slave_load_tmpdir_not_exist.test:
      Changed the output to make it consistent among different runs.
    mysys/mf_format.c:
      Replaced a return for DBUG_RETURN.
    f6eb9426
rpl_rli.cc 41.5 KB