diff options
author | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2019-01-31 02:20:51 +0530 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-02-01 08:53:50 +0200 |
commit | f669cecbe30da820b93ebff0d3ed27d578627e47 (patch) | |
tree | 131e489c964bb37f59143e221d22943bf7808b82 /storage | |
parent | 20e19f69750466ac2c9bbf82ef5ba396fc842a08 (diff) | |
download | mariadb-git-f669cecbe30da820b93ebff0d3ed27d578627e47.tar.gz |
MDEV-18415 mariabackup.mdev-14447 test case fails with Table 'test.t' doesn't exist in engine
- Added retry logic if validation of first page fails with checksum
mismatch.
Diffstat (limited to 'storage')
-rw-r--r-- | storage/innobase/buf/buf0buf.cc | 10 | ||||
-rw-r--r-- | storage/innobase/include/fsp0file.h | 19 |
2 files changed, 29 insertions, 0 deletions
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index 8dc2fd20dbe..e97a36efa56 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -1103,6 +1103,16 @@ buf_page_is_corrupted( if (srv_checksum_algorithm == SRV_CHECKSUM_ALGORITHM_CRC32) { + + DBUG_EXECUTE_IF( + "page_intermittent_checksum_mismatch", { + static int page_counter; + if (page_counter++ == 2) { + checksum_field2++; + } + }); + + crc32 = buf_page_check_crc32(read_buf, checksum_field2); crc32_inited = true; diff --git a/storage/innobase/include/fsp0file.h b/storage/innobase/include/fsp0file.h index 9bc7b4bf9c9..0cb6ccaf86c 100644 --- a/storage/innobase/include/fsp0file.h +++ b/storage/innobase/include/fsp0file.h @@ -314,6 +314,25 @@ public: return(m_last_os_error); } + /** Check whether the file is empty. + @return true if file is empty */ + bool is_empty_file() const + { +#ifdef _WIN32 + os_offset_t offset = + (os_offset_t) m_file_info.nFileSizeLow + | ((os_offset_t) m_file_info.nFileSizeHigh << 32); + + return (offset == 0); +#else + return (m_file_info.st_size == 0); +#endif + } + + /** Check if the file exist. + @return true if file exists. */ + bool exists() const { return m_exists; } + /** Test if the filepath provided looks the same as this filepath by string comparison. If they are two different paths to the same file, same_as() will be used to show that after the files are opened. |