Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
00321709
Commit
00321709
authored
Dec 18, 2018
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.1 into 10.2
parents
ed13a0d2
84f119f2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
41 deletions
+42
-41
storage/innobase/fil/fil0crypt.cc
storage/innobase/fil/fil0crypt.cc
+28
-22
storage/xtradb/fil/fil0crypt.cc
storage/xtradb/fil/fil0crypt.cc
+14
-19
No files found.
storage/innobase/fil/fil0crypt.cc
View file @
00321709
...
...
@@ -2552,15 +2552,19 @@ fil_space_verify_crypt_checksum(const byte* page, const page_size_t& page_size)
/* If stored checksum matches one of the calculated checksums
page is not corrupted. */
srv_checksum_algorithm_t
algorithm
=
srv_checksum_algorithm_t
(
srv_checksum_algorithm
);
switch
(
algorithm
)
{
switch
(
srv_checksum_algorithm_t
(
srv_checksum_algorithm
)
)
{
case
SRV_CHECKSUM_ALGORITHM_STRICT_CRC32
:
if
(
page_size
.
is_compressed
())
{
return
checksum
==
page_zip_calc_checksum
(
page
,
page_size
.
physical
(),
SRV_CHECKSUM_ALGORITHM_CRC32
);
SRV_CHECKSUM_ALGORITHM_CRC32
)
#ifdef INNODB_BUG_ENDIAN_CRC32
||
checksum
==
page_zip_calc_checksum
(
page
,
page_size
.
physical
(),
SRV_CHECKSUM_ALGORITHM_CRC32
,
true
)
#endif
;
}
return
checksum
==
buf_calc_page_crc32
(
page
)
...
...
@@ -2568,33 +2572,35 @@ fil_space_verify_crypt_checksum(const byte* page, const page_size_t& page_size)
||
checksum
==
buf_calc_page_crc32
(
page
,
true
)
#endif
;
case
SRV_CHECKSUM_ALGORITHM_STRICT_INNODB
:
if
(
page_size
.
is_compressed
())
{
return
checksum
==
page_zip_calc_checksum
(
page
,
page_size
.
physical
(),
SRV_CHECKSUM_ALGORITHM_INNODB
);
}
return
checksum
==
buf_calc_page_new_checksum
(
page
);
case
SRV_CHECKSUM_ALGORITHM_STRICT_NONE
:
return
checksum
==
BUF_NO_CHECKSUM_MAGIC
;
/* Starting with MariaDB 10.1.25, 10.2.7, 10.3.1,
due to MDEV-12114, fil_crypt_calculate_checksum()
is only using CRC32 for the encrypted pages.
Due to this, we must treat "strict_none" as "none". */
case
SRV_CHECKSUM_ALGORITHM_NONE
:
return
true
;
case
SRV_CHECKSUM_ALGORITHM_STRICT_INNODB
:
/* Starting with MariaDB 10.1.25, 10.2.7, 10.3.1,
due to MDEV-12114, fil_crypt_calculate_checksum()
is only using CRC32 for the encrypted pages.
Due to this, we must treat "strict_innodb" as "innodb". */
case
SRV_CHECKSUM_ALGORITHM_INNODB
:
case
SRV_CHECKSUM_ALGORITHM_CRC32
:
if
(
checksum
==
BUF_NO_CHECKSUM_MAGIC
)
{
return
true
;
}
if
(
page_size
.
is_compressed
())
{
if
(
checksum
==
page_zip_calc_checksum
(
page
,
page_size
.
physical
(),
algorithm
))
{
return
true
;
}
algorithm
=
algorithm
==
SRV_CHECKSUM_ALGORITHM_INNODB
?
SRV_CHECKSUM_ALGORITHM_CRC32
:
SRV_CHECKSUM_ALGORITHM_INNODB
;
if
(
zip_size
)
{
return
checksum
==
page_zip_calc_checksum
(
page
,
page_size
.
physical
(),
algorithm
);
page
,
page_size
.
physical
(),
SRV_CHECKSUM_ALGORITHM_CRC32
)
#ifdef INNODB_BUG_ENDIAN_CRC32
||
checksum
==
page_zip_calc_checksum
(
page
,
page_size
.
physical
(),
SRV_CHECKSUM_ALGORITHM_CRC32
,
true
)
#endif
||
checksum
==
page_zip_calc_checksum
(
page
,
page_size
.
physical
(),
SRV_CHECKSUM_ALGORITHM_INNODB
);
}
return
checksum
==
buf_calc_page_crc32
(
page
)
...
...
storage/xtradb/fil/fil0crypt.cc
View file @
00321709
...
...
@@ -2588,10 +2588,8 @@ bool fil_space_verify_crypt_checksum(const byte* page, ulint zip_size)
/* If stored checksum matches one of the calculated checksums
page is not corrupted. */
srv_checksum_algorithm_t
algorithm
=
srv_checksum_algorithm_t
(
srv_checksum_algorithm
);
switch
(
algorithm
)
{
switch
(
srv_checksum_algorithm_t
(
srv_checksum_algorithm
)
)
{
case
SRV_CHECKSUM_ALGORITHM_STRICT_CRC32
:
if
(
zip_size
)
{
return
checksum
==
page_zip_calc_checksum
(
...
...
@@ -2599,32 +2597,29 @@ bool fil_space_verify_crypt_checksum(const byte* page, ulint zip_size)
}
return
checksum
==
buf_calc_page_crc32
(
page
);
case
SRV_CHECKSUM_ALGORITHM_STRICT_INNODB
:
if
(
zip_size
)
{
return
checksum
==
page_zip_calc_checksum
(
page
,
zip_size
,
SRV_CHECKSUM_ALGORITHM_INNODB
);
}
return
checksum
==
buf_calc_page_new_checksum
(
page
);
case
SRV_CHECKSUM_ALGORITHM_STRICT_NONE
:
return
checksum
==
BUF_NO_CHECKSUM_MAGIC
;
/* Starting with MariaDB 10.1.25, 10.2.7, 10.3.1,
due to MDEV-12114, fil_crypt_calculate_checksum()
is only using CRC32 for the encrypted pages.
Due to this, we must treat "strict_none" as "none". */
case
SRV_CHECKSUM_ALGORITHM_NONE
:
return
true
;
case
SRV_CHECKSUM_ALGORITHM_STRICT_INNODB
:
/* Starting with MariaDB 10.1.25, 10.2.7, 10.3.1,
due to MDEV-12114, fil_crypt_calculate_checksum()
is only using CRC32 for the encrypted pages.
Due to this, we must treat "strict_innodb" as "innodb". */
case
SRV_CHECKSUM_ALGORITHM_INNODB
:
case
SRV_CHECKSUM_ALGORITHM_CRC32
:
if
(
checksum
==
BUF_NO_CHECKSUM_MAGIC
)
{
return
true
;
}
if
(
zip_size
)
{
if
(
checksum
==
page_zip_calc_checksum
(
page
,
zip_size
,
algorithm
))
{
return
true
;
}
algorithm
=
algorithm
==
SRV_CHECKSUM_ALGORITHM_INNODB
?
SRV_CHECKSUM_ALGORITHM_CRC32
:
SRV_CHECKSUM_ALGORITHM_INNODB
;
return
checksum
==
page_zip_calc_checksum
(
page
,
zip_size
,
algorithm
);
page
,
zip_size
,
SRV_CHECKSUM_ALGORITHM_CRC32
)
||
checksum
==
page_zip_calc_checksum
(
page
,
zip_size
,
SRV_CHECKSUM_ALGORITHM_INNODB
);
}
return
checksum
==
buf_calc_page_crc32
(
page
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment