From 035c4dd3e99a2f33dd6d94dcc7d11d64a8acce1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 25 Nov 2022 17:20:29 +0200 Subject: [PATCH] MDEV-14425 fixup for MDEV-25312: Remove dead code In commit cf552f5886968fc022122960d3a9274ce9f27819 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 685d958e38b825ad9829be311f26729cccf37c46 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(). --- storage/innobase/log/log0recv.cc | 32 +++++--------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc index d2419a817612a..00fb22e162586 100644 --- a/storage/innobase/log/log0recv.cc +++ b/storage/innobase/log/log0recv.cc @@ -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)}, @@ -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; }