summaryrefslogtreecommitdiff
path: root/extra/mariabackup/fil_cur.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-04-07 18:01:13 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-04-07 18:01:13 +0300
commitcf552f5886968fc022122960d3a9274ce9f27819 (patch)
tree07e6d40bdd128c9c12ccd9f21a382371a65eb7c4 /extra/mariabackup/fil_cur.cc
parentc2a63ac526bf4cd269def30a3d55ff29fdba8f86 (diff)
downloadmariadb-git-cf552f5886968fc022122960d3a9274ce9f27819.tar.gz
MDEV-25312 Replace fil_space_t::name with fil_space_t::name()bb-10.6-MDEV-25312
A consistency check for fil_space_t::name is causing recovery failures in MDEV-25180 (Atomic ALTER TABLE). So, we'd better remove that field altogether. fil_space_t::name was more or less a copy of dict_table_t::name (except for some special cases), and it was not being used for anything useful. There used to be a name_hash, but it had been removed already in commit a75dbfd7183cc96680f3e3e684fd36500dac8158 (MDEV-12266). We will also remove os_normalize_path(), OS_PATH_SEPARATOR, OS_PATH_SEPATOR_ALT. On Microsoft Windows, we will treat \ and / roughly in the same way. The intention is that for per-table tablespaces, the filenames will always follow the pattern prefix/databasename/tablename.ibd. (Any \ in the prefix must not be converted.) ut_basename_noext(): Remove (unused function). read_link_file(): Replaces RemoteDatafile::read_link_file(). We will ensure that the last two path component separators are forward slashes (converting up to 2 trailing backslashes on Microsoft Windows), so that everywhere else we can assume that data file names end in "/databasename/tablename.ibd". Note: On Microsoft Windows, path names that start with \\?\ must not contain / as path component separators. Previously, such paths did work in the DATA DIRECTORY argument of InnoDB tables. Reviewed by: Vladislav Vaintroub
Diffstat (limited to 'extra/mariabackup/fil_cur.cc')
-rw-r--r--extra/mariabackup/fil_cur.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/extra/mariabackup/fil_cur.cc b/extra/mariabackup/fil_cur.cc
index c502c8bac78..99aeb45ccd1 100644
--- a/extra/mariabackup/fil_cur.cc
+++ b/extra/mariabackup/fil_cur.cc
@@ -65,17 +65,21 @@ xb_get_relative_path(
prev = NULL;
cur = path;
- while ((next = strchr(cur, OS_PATH_SEPARATOR)) != NULL) {
+#ifdef _WIN32
+ while ((next = strchr(cur, '\\')) != NULL) {
+ prev = cur;
+ cur = next + 1;
+ }
+#endif
+ while ((next = strchr(cur, '/')) != NULL) {
prev = cur;
cur = next + 1;
}
if (is_system) {
-
return(cur);
} else {
-
return((prev == NULL) ? cur : prev);
}
@@ -462,7 +466,8 @@ read_retry:
goto read_retry;
}
}
- DBUG_EXECUTE_FOR_KEY("add_corrupted_page_for", cursor->node->space->name,
+ DBUG_EXECUTE_FOR_KEY("add_corrupted_page_for",
+ cursor->node->space->name(),
{
unsigned corrupted_page_no =
static_cast<unsigned>(strtoul(dbug_val, NULL, 10));