From f6eb9426ce9ba72e5a6d74755734d22aadba32e0 Mon Sep 17 00:00:00 2001 From: Alfranio Correia Date: Sun, 19 Apr 2009 02:21:33 +0100 Subject: BUG#43949 Initialization of slave produces a warning message in Valgrind 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. --- mysys/mf_format.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysys') diff --git a/mysys/mf_format.c b/mysys/mf_format.c index f199132626b..6afa2938fa3 100644 --- a/mysys/mf_format.c +++ b/mysys/mf_format.c @@ -79,7 +79,7 @@ char * fn_format(char * to, const char *name, const char *dir, /* To long path, return original or NULL */ size_t tmp_length; if (flag & MY_SAFE_PATH) - return NullS; + DBUG_RETURN(NullS); tmp_length= strlength(startpos); DBUG_PRINT("error",("dev: '%s' ext: '%s' length: %u",dev,ext, (uint) length)); -- cgit v1.2.1