summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2021-07-21 20:11:07 +0200
committerSergei Golubchik <serg@mariadb.org>2021-07-21 20:11:07 +0200
commit6190a02f3593f82e2d4916ed660afb5e5d631a5a (patch)
treef6fc56fd7aad1a332f9fc6850b2d579198d09ff8 /extra
parentcf6d83e7d68bd2bc0af0404bf4dd15218847074d (diff)
parent4c387945f0f8d5df84ae987c4a4bba7675815c72 (diff)
downloadmariadb-git-6190a02f3593f82e2d4916ed660afb5e5d631a5a.tar.gz
Merge branch '10.2' into 10.3
Diffstat (limited to 'extra')
-rw-r--r--extra/innochecksum.cc32
-rw-r--r--extra/mariabackup/innobackupex.cc2
-rw-r--r--extra/mariabackup/xtrabackup.cc2
3 files changed, 21 insertions, 15 deletions
diff --git a/extra/innochecksum.cc b/extra/innochecksum.cc
index 583a0db04f9..1af2d6e54a4 100644
--- a/extra/innochecksum.cc
+++ b/extra/innochecksum.cc
@@ -815,6 +815,16 @@ write_file(
return(true);
}
+// checks using current xdes page whether the page is free
+static bool page_is_free(const byte *xdes, page_size_t page_size,
+ ulonglong page_no)
+{
+ const byte *des=
+ xdes + XDES_ARR_OFFSET +
+ XDES_SIZE * ((page_no & (page_size.physical() - 1)) / FSP_EXTENT_SIZE);
+ return xdes_get_bit(des, XDES_FREE_BIT, page_no % FSP_EXTENT_SIZE);
+}
+
/*
Parse the page and collect/dump the information about page type
@param [in] page buffer page
@@ -900,17 +910,8 @@ parse_page(
}
/* update per-index statistics */
{
- if (index_ids.count(id) == 0) {
- index_ids[id] = per_index_stats();
- }
- std::map<unsigned long long, per_index_stats>::iterator it;
- it = index_ids.find(id);
- per_index_stats &index = (it->second);
- const byte* des = xdes + XDES_ARR_OFFSET
- + XDES_SIZE * ((page_no & (page_size.physical() - 1))
- / FSP_EXTENT_SIZE);
- if (xdes_get_bit(des, XDES_FREE_BIT,
- page_no % FSP_EXTENT_SIZE)) {
+ per_index_stats &index = index_ids[id];
+ if (page_is_free(xdes, page_size, page_no)) {
index.free_pages++;
return;
}
@@ -1048,7 +1049,6 @@ parse_page(
case FIL_PAGE_TYPE_FSP_HDR:
page_type.n_fil_page_type_fsp_hdr++;
- memcpy(xdes, page, page_size.physical());
if (page_type_dump) {
fprintf(file, "#::%llu\t\t|\t\tFile Space "
"Header\t\t|\t%s\n", cur_page_num, str);
@@ -1057,7 +1057,6 @@ parse_page(
case FIL_PAGE_TYPE_XDES:
page_type.n_fil_page_type_xdes++;
- memcpy(xdes, page, page_size.physical());
if (page_type_dump) {
fprintf(file, "#::%llu\t\t|\t\tExtent descriptor "
"page\t\t|\t%s\n", cur_page_num, str);
@@ -1784,6 +1783,8 @@ int main(
printf("page %llu ", cur_page_num);
}
+ memcpy(xdes, buf, physical_page_size);
+
if (page_type_summary || page_type_dump) {
parse_page(buf, xdes, fil_page_type, page_size, is_encrypted);
}
@@ -1962,6 +1963,7 @@ first_non_zero:
/* If no-check is enabled, skip the
checksum verification.*/
if (!no_check
+ && !page_is_free(xdes, page_size, cur_page_num)
&& !skip_page
&& (exit_status = verify_checksum(
buf, page_size,
@@ -1984,6 +1986,10 @@ first_non_zero:
printf("page %llu ", cur_page_num);
}
+ if (page_get_page_no(buf) % physical_page_size == 0) {
+ memcpy(xdes, buf, physical_page_size);
+ }
+
if (page_type_summary || page_type_dump) {
parse_page(buf, xdes, fil_page_type, page_size, is_encrypted);
}
diff --git a/extra/mariabackup/innobackupex.cc b/extra/mariabackup/innobackupex.cc
index 324bd9a4b14..0a963c25ee3 100644
--- a/extra/mariabackup/innobackupex.cc
+++ b/extra/mariabackup/innobackupex.cc
@@ -307,7 +307,7 @@ static struct my_option ibx_long_options[] =
{"force-non-empty-directories", OPT_FORCE_NON_EMPTY_DIRS, "This "
"option, when specified, makes --copy-back or --move-back transfer "
"files to non-empty directories. Note that no existing files will be "
- "overwritten. If --copy-back or --nove-back has to copy a file from "
+ "overwritten. If --copy-back or --move-back has to copy a file from "
"the backup directory which already exists in the destination "
"directory, it will still fail with an error.",
(uchar *) &opt_ibx_force_non_empty_dirs,
diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc
index aa0f62fefaa..3ab9a5f7c9f 100644
--- a/extra/mariabackup/xtrabackup.cc
+++ b/extra/mariabackup/xtrabackup.cc
@@ -1277,7 +1277,7 @@ struct my_option xb_client_options[]= {
"This "
"option, when specified, makes --copy-back or --move-back transfer "
"files to non-empty directories. Note that no existing files will be "
- "overwritten. If --copy-back or --nove-back has to copy a file from "
+ "overwritten. If --copy-back or --move-back has to copy a file from "
"the backup directory which already exists in the destination "
"directory, it will still fail with an error.",
(uchar *) &opt_force_non_empty_dirs, (uchar *) &opt_force_non_empty_dirs,