Skip to content

Commit

Permalink
MDEV-14425 fixup for MDEV-25312: Remove dead code
Browse files Browse the repository at this point in the history
In commit cf552f5 we removed the
function os_normalize_path() and started writing file names to the
InnoDB redo log always using the same path separator, even on
Microsoft Windows.

In commit 685d958 the ability to
recover from previous log file formats was removed. Thus, the log file
can never contain the Microsoft specific path separator and the
conversion code can be removed.

Note: *.isl files may still contain Microsoft Windows path separators.
They will be replaced with standard ones in read_link_file().
  • Loading branch information
dr-m committed Nov 25, 2022
1 parent c0439b1 commit 035c4dd
Showing 1 changed file with 5 additions and 27 deletions.
32 changes: 5 additions & 27 deletions storage/innobase/log/log0recv.cc
Expand Up @@ -651,22 +651,12 @@ static struct
{
/* Replace absolute DATA DIRECTORY file paths with
short names relative to the backup directory. */
const char *name= strrchr(filename, '/');
#ifdef _WIN32
if (const char *last= strrchr(filename, '\\'))
if (last > name)
name= last;
#endif
if (name)
if (const char *name= strrchr(filename, '/'))
{
while (--name > filename &&
#ifdef _WIN32
*name != '\\' &&
#endif
*name != '/');
while (--name > filename && *name != '/');
if (name > filename)
filename= name + 1;
}
}
}

char *fil_path= fil_make_filepath(nullptr, {filename, strlen(filename)},
Expand Down Expand Up @@ -832,21 +822,9 @@ static struct
const char *filename= name.c_str();
if (srv_operation == SRV_OPERATION_RESTORE)
{
const char* tbl_name = strrchr(filename, '/');
#ifdef _WIN32
if (const char *last = strrchr(filename, '\\'))
if (const char *tbl_name= strrchr(filename, '/'))
{
if (last > tbl_name)
tbl_name = last;
}
#endif
if (tbl_name)
{
while (--tbl_name > filename &&
#ifdef _WIN32
*tbl_name != '\\' &&
#endif
*tbl_name != '/');
while (--tbl_name > filename && *tbl_name != '/');
if (tbl_name > filename)
filename= tbl_name + 1;
}
Expand Down

0 comments on commit 035c4dd

Please sign in to comment.