Commit 111fdcdd authored by unknown's avatar unknown

Fixes bug #11815. Convert file path to UNIX format to build correct query

string while replicating LOAD DATA INFILE statement.


VC++Files/mysys/mysys.dsp:
  added mf_unixpath.c into mysys.dsp
include/my_sys.h:
  Added an option for fn_format function to convert path from system representation
  to UNIX format.
mysys/mf_format.c:
  Added an option for fn_format function to convert path from system
  representation to UNIX format.
sql/log_event.cc:
  Convert file path to UNIX format to build correct query string while replicating
  LOAD DATA INFILE statement.
parent 098cb6f4
...@@ -317,6 +317,10 @@ SOURCE=.\mf_tempfile.c ...@@ -317,6 +317,10 @@ SOURCE=.\mf_tempfile.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\mf_unixpath.c
# End Source File
# Begin Source File
SOURCE=.\mf_wcomp.c SOURCE=.\mf_wcomp.c
# End Source File # End Source File
# Begin Source File # Begin Source File
......
...@@ -98,6 +98,7 @@ extern int NEAR my_errno; /* Last error in mysys */ ...@@ -98,6 +98,7 @@ extern int NEAR my_errno; /* Last error in mysys */
#define MY_RETURN_REAL_PATH 32 /* return full path for file */ #define MY_RETURN_REAL_PATH 32 /* return full path for file */
#define MY_SAFE_PATH 64 /* Return NULL if too long path */ #define MY_SAFE_PATH 64 /* Return NULL if too long path */
#define MY_RELATIVE_PATH 128 /* name is relative to 'dir' */ #define MY_RELATIVE_PATH 128 /* name is relative to 'dir' */
#define MY_UNIX_PATH 256 /* convert path to UNIX format */
/* My seek flags */ /* My seek flags */
#define MY_SEEK_SET 0 #define MY_SEEK_SET 0
......
...@@ -54,6 +54,8 @@ my_string fn_format(my_string to, const char *name, const char *dir, ...@@ -54,6 +54,8 @@ my_string fn_format(my_string to, const char *name, const char *dir,
pack_dirname(dev,dev); /* Put in ./.. and ~/.. */ pack_dirname(dev,dev); /* Put in ./.. and ~/.. */
if (flag & MY_UNPACK_FILENAME) if (flag & MY_UNPACK_FILENAME)
(void) unpack_dirname(dev,dev); /* Replace ~/.. with dir */ (void) unpack_dirname(dev,dev); /* Replace ~/.. with dir */
if (flag & MY_UNIX_PATH)
to_unix_path(dev); /* Fix to MySQL representation */
if ((pos= (char*) strchr(name,FN_EXTCHAR)) != NullS) if ((pos= (char*) strchr(name,FN_EXTCHAR)) != NullS)
{ {
if ((flag & MY_REPLACE_EXT) == 0) /* If we should keep old ext */ if ((flag & MY_REPLACE_EXT) == 0) /* If we should keep old ext */
......
...@@ -121,7 +121,8 @@ static char *pretty_print_str(char *packet, char *str, int len) ...@@ -121,7 +121,8 @@ static char *pretty_print_str(char *packet, char *str, int len)
static inline char* slave_load_file_stem(char*buf, uint file_id, static inline char* slave_load_file_stem(char*buf, uint file_id,
int event_server_id) int event_server_id)
{ {
fn_format(buf,"SQL_LOAD-",slave_load_tmpdir, "", MY_UNPACK_FILENAME); fn_format(buf,"SQL_LOAD-",slave_load_tmpdir, "",
MY_UNPACK_FILENAME | MY_UNIX_PATH);
buf = strend(buf); buf = strend(buf);
buf = int10_to_str(::server_id, buf, 10); buf = int10_to_str(::server_id, buf, 10);
*buf++ = '-'; *buf++ = '-';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment