summaryrefslogtreecommitdiff
path: root/storage/xtradb/log
diff options
context:
space:
mode:
Diffstat (limited to 'storage/xtradb/log')
-rw-r--r--storage/xtradb/log/log0log.cc4
-rw-r--r--storage/xtradb/log/log0online.cc4
-rw-r--r--storage/xtradb/log/log0recv.cc52
3 files changed, 37 insertions, 23 deletions
diff --git a/storage/xtradb/log/log0log.cc b/storage/xtradb/log/log0log.cc
index a19cb70e747..0b5d27b8fd1 100644
--- a/storage/xtradb/log/log0log.cc
+++ b/storage/xtradb/log/log0log.cc
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2009, Google Inc.
Copyright (C) 2014, 2016, MariaDB Corporation. All Rights Reserved.
@@ -2641,7 +2641,7 @@ log_archived_file_name_gen(
/*=======================*/
char* buf, /*!< in: buffer where to write */
ulint buf_len,/*!< in: buffer length */
- ulint id __attribute__((unused)),
+ ulint id MY_ATTRIBUTE((unused)),
/*!< in: group id;
currently we only archive the first group */
lsn_t file_no)/*!< in: file number */
diff --git a/storage/xtradb/log/log0online.cc b/storage/xtradb/log/log0online.cc
index 3f53791ed4c..63f1ef39568 100644
--- a/storage/xtradb/log/log0online.cc
+++ b/storage/xtradb/log/log0online.cc
@@ -11,8 +11,8 @@ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
-this program; if not, write to the Free Software Foundation, Inc., 59 Temple
-Place, Suite 330, Boston, MA 02111-1307 USA
+this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
+Street, Fifth Floor, Boston, MA 02110-1301, USA
*****************************************************************************/
diff --git a/storage/xtradb/log/log0recv.cc b/storage/xtradb/log/log0recv.cc
index 67f4050a1f1..759687e3fe5 100644
--- a/storage/xtradb/log/log0recv.cc
+++ b/storage/xtradb/log/log0recv.cc
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1997, 2015, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
Copyright (c) 2013, 2016, MariaDB Corporation. All Rights Reserved.
@@ -333,7 +333,7 @@ extern "C" UNIV_INTERN
os_thread_ret_t
DECLARE_THREAD(recv_writer_thread)(
/*===============================*/
- void* arg __attribute__((unused)))
+ void* arg MY_ATTRIBUTE((unused)))
/*!< in: a dummy parameter required by
os_thread_create */
{
@@ -752,7 +752,7 @@ recv_check_cp_is_consistent(
/********************************************************//**
Looks for the maximum consistent checkpoint from the log groups.
@return error code or DB_SUCCESS */
-static __attribute__((nonnull, warn_unused_result))
+static MY_ATTRIBUTE((nonnull, warn_unused_result))
dberr_t
recv_find_max_checkpoint(
/*=====================*/
@@ -775,8 +775,38 @@ recv_find_max_checkpoint(
buf = log_sys->checkpoint_buf;
while (group) {
+
+ ulint log_hdr_log_block_size;
+
group->state = LOG_GROUP_CORRUPTED;
+ /* Assert that we can reuse log_sys->checkpoint_buf to read the
+ part of the header that contains the log block size. */
+ ut_ad(LOG_FILE_OS_FILE_LOG_BLOCK_SIZE + 4
+ < OS_FILE_LOG_BLOCK_SIZE);
+
+ fil_io(OS_FILE_READ | OS_FILE_LOG, true, group->space_id, 0,
+ 0, 0, OS_FILE_LOG_BLOCK_SIZE,
+ log_sys->checkpoint_buf, NULL, NULL);
+ log_hdr_log_block_size
+ = mach_read_from_4(log_sys->checkpoint_buf
+ + LOG_FILE_OS_FILE_LOG_BLOCK_SIZE);
+ if (log_hdr_log_block_size == 0) {
+ /* 0 means default value */
+ log_hdr_log_block_size = 512;
+ }
+ if (UNIV_UNLIKELY(log_hdr_log_block_size
+ != srv_log_block_size)) {
+ fprintf(stderr,
+ "InnoDB: Error: The block size of ib_logfile "
+ "%lu is not equal to innodb_log_block_size "
+ "%lu.\n"
+ "InnoDB: Error: Suggestion - Recreate log "
+ "files.\n",
+ log_hdr_log_block_size, srv_log_block_size);
+ return(DB_ERROR);
+ }
+
for (field = LOG_CHECKPOINT_1; field <= LOG_CHECKPOINT_2;
field += LOG_CHECKPOINT_2 - LOG_CHECKPOINT_1) {
@@ -3097,7 +3127,6 @@ recv_recovery_from_checkpoint_start_func(
log_group_t* group;
log_group_t* max_cp_group;
ulint max_cp_field;
- ulint log_hdr_log_block_size;
lsn_t checkpoint_lsn;
ib_uint64_t checkpoint_no;
lsn_t group_scanned_lsn = 0;
@@ -3204,21 +3233,6 @@ recv_recovery_from_checkpoint_start_func(
log_hdr_buf, max_cp_group, 0);
}
- log_hdr_log_block_size
- = mach_read_from_4(log_hdr_buf + LOG_FILE_OS_FILE_LOG_BLOCK_SIZE);
- if (log_hdr_log_block_size == 0) {
- /* 0 means default value */
- log_hdr_log_block_size = 512;
- }
- if (UNIV_UNLIKELY(log_hdr_log_block_size != srv_log_block_size)) {
- fprintf(stderr,
- "InnoDB: Error: The block size of ib_logfile (" ULINTPF
- ") is not equal to innodb_log_block_size.\n"
- "InnoDB: Error: Suggestion - Recreate log files.\n",
- log_hdr_log_block_size);
- return(DB_ERROR);
- }
-
#ifdef UNIV_LOG_ARCHIVE
group = UT_LIST_GET_FIRST(log_sys->log_groups);