summaryrefslogtreecommitdiff
path: root/storage/innobase
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-02-11 09:45:34 +0100
committerSergei Golubchik <serg@mariadb.org>2017-02-11 09:45:34 +0100
commitf3914d10b61eb4bc4184b2a9aa92a998e1abd779 (patch)
tree0f973c0dc2fb1f667ed852e4177b17938e28b6b9 /storage/innobase
parent559345806216369bad999539018bd3943860a5d5 (diff)
parent2195bb4e416232ab807ff67eecf03b1223bf6bff (diff)
downloadmariadb-git-f3914d10b61eb4bc4184b2a9aa92a998e1abd779.tar.gz
Merge branch 'bb-10.2-serg-merge' into 10.2
Diffstat (limited to 'storage/innobase')
-rw-r--r--storage/innobase/buf/buf0buf.cc22
-rw-r--r--storage/innobase/handler/ha_innodb.cc2
-rw-r--r--storage/innobase/os/os0thread.cc1
-rw-r--r--storage/innobase/srv/srv0start.cc6
4 files changed, 18 insertions, 13 deletions
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index 90ddf473232..d6a2d9ba9e0 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -841,11 +841,15 @@ buf_page_is_corrupted(
{
ulint checksum_field1;
ulint checksum_field2;
- bool page_encrypted = false;
+ bool no_checksum = false;
#ifndef UNIV_INNOCHECKSUM
ulint space_id = mach_read_from_4(
read_buf + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID);
+ ulint page_type = mach_read_from_4(
+ read_buf + FIL_PAGE_TYPE);
+ no_checksum = (page_type == FIL_PAGE_PAGE_COMPRESSED ||
+ page_type == FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED);
fil_space_crypt_t* crypt_data = fil_space_get_crypt_data(space_id);
/* Page is encrypted if encryption information is found from
@@ -854,19 +858,24 @@ buf_page_is_corrupted(
if (crypt_data &&
crypt_data->type != CRYPT_SCHEME_UNENCRYPTED &&
fil_page_is_encrypted(read_buf)) {
- page_encrypted = true;
+ no_checksum = true;
+ }
+
+ /* Return early if there is no checksum or END_LSN */
+ if (no_checksum) {
+ return (FALSE);
}
#else
if (mach_read_from_4(read_buf+FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION) != 0
|| mach_read_from_2(read_buf+FIL_PAGE_TYPE) == FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED) {
- page_encrypted = true;
+ no_checksum= true;
}
#endif
DBUG_EXECUTE_IF("buf_page_is_corrupt_failure", return(TRUE); );
- if (!page_encrypted && !page_size.is_compressed()
+ if (!no_checksum && !page_size.is_compressed()
&& memcmp(read_buf + FIL_PAGE_LSN + 4,
read_buf + page_size.logical()
- FIL_PAGE_END_LSN_OLD_CHKSUM + 4, 4)) {
@@ -934,9 +943,6 @@ buf_page_is_corrupted(
page_size.physical()));
#endif /* UNIV_INNOCHECKSUM */
}
- if (page_encrypted) {
- return (FALSE);
- }
checksum_field1 = mach_read_from_4(
read_buf + FIL_PAGE_SPACE_OR_CHKSUM);
@@ -1969,7 +1975,7 @@ buf_pool_init_instance(
/* Initialize the temporal memory array and slots */
buf_pool->tmp_arr = (buf_tmp_array_t *)ut_malloc_nokey(sizeof(buf_tmp_array_t));
memset(buf_pool->tmp_arr, 0, sizeof(buf_tmp_array_t));
- ulint n_slots = srv_n_read_io_threads * srv_n_write_io_threads * (8 * OS_AIO_N_PENDING_IOS_PER_THREAD);
+ ulint n_slots = (srv_n_read_io_threads + srv_n_write_io_threads) * (8 * OS_AIO_N_PENDING_IOS_PER_THREAD);
buf_pool->tmp_arr->n_slots = n_slots;
buf_pool->tmp_arr->slots = (buf_tmp_buffer_t*)ut_malloc_nokey(sizeof(buf_tmp_buffer_t) * n_slots);
memset(buf_pool->tmp_arr->slots, 0, (sizeof(buf_tmp_buffer_t) * n_slots));
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 5df46bc7a8f..34ab49bfd0d 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -21786,7 +21786,7 @@ static MYSQL_SYSVAR_ENUM(compression_algorithm, innodb_compression_algorithm,
/* We use here the largest number of supported compression method to
enable all those methods that are available. Availability of compression
method is verified on innodb_compression_algorithm_validate function. */
- PAGE_UNCOMPRESSED,
+ PAGE_ZLIB_ALGORITHM,
&page_compression_algorithms_typelib);
static MYSQL_SYSVAR_LONG(mtflush_threads, srv_mtflush_threads,
diff --git a/storage/innobase/os/os0thread.cc b/storage/innobase/os/os0thread.cc
index fd88fafa69d..8039c2e4f46 100644
--- a/storage/innobase/os/os0thread.cc
+++ b/storage/innobase/os/os0thread.cc
@@ -279,4 +279,3 @@ os_thread_free()
mutex_destroy(&thread_mutex);
}
-
diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc
index 00acaed1555..06feb5d25ef 100644
--- a/storage/innobase/srv/srv0start.cc
+++ b/storage/innobase/srv/srv0start.cc
@@ -1427,12 +1427,12 @@ innobase_start_or_create_for_mysql(void)
size_t dirnamelen;
unsigned i = 0;
- /* Reset the start state. */
- srv_start_state = SRV_START_STATE_NONE;
-
high_level_read_only = srv_read_only_mode
|| srv_force_recovery > SRV_FORCE_NO_TRX_UNDO;
+ /* Reset the start state. */
+ srv_start_state = SRV_START_STATE_NONE;
+
if (srv_read_only_mode) {
ib::info() << "Started in read only mode";