summaryrefslogtreecommitdiff
path: root/innobase/include/log0log.ic
diff options
context:
space:
mode:
Diffstat (limited to 'innobase/include/log0log.ic')
-rw-r--r--innobase/include/log0log.ic29
1 files changed, 26 insertions, 3 deletions
diff --git a/innobase/include/log0log.ic b/innobase/include/log0log.ic
index e5c313d129b..36e65239374 100644
--- a/innobase/include/log0log.ic
+++ b/innobase/include/log0log.ic
@@ -179,7 +179,7 @@ log_block_get_trl_no(
trailer */
byte* log_block) /* in: log block */
{
- return(mach_read_from_4(log_block + OS_FILE_LOG_BLOCK_SIZE
+ return(mach_read_from_3(log_block + OS_FILE_LOG_BLOCK_SIZE
- LOG_BLOCK_TRL_NO));
}
@@ -192,8 +192,8 @@ log_block_set_trl_no(
byte* log_block, /* in: log block */
ulint n) /* in: log block number */
{
- mach_write_to_4(log_block + OS_FILE_LOG_BLOCK_SIZE - LOG_BLOCK_TRL_NO,
- n);
+ mach_write_to_3(log_block + OS_FILE_LOG_BLOCK_SIZE - LOG_BLOCK_TRL_NO,
+ n & 0xFFFFFF);
}
/****************************************************************
@@ -237,6 +237,29 @@ log_block_init(
log_block_set_data_len(log_block, LOG_BLOCK_HDR_SIZE);
log_block_set_first_rec_group(log_block, 0);
}
+
+/****************************************************************
+Initializes a log block in the log buffer in the old format, where there
+was no checksum yet. */
+UNIV_INLINE
+void
+log_block_init_in_old_format(
+/*=========================*/
+ byte* log_block, /* in: pointer to the log buffer */
+ dulint lsn) /* in: lsn within the log block */
+{
+ ulint no;
+
+ ut_ad(mutex_own(&(log_sys->mutex)));
+
+ no = log_block_convert_lsn_to_no(lsn);
+
+ log_block_set_hdr_no(log_block, no);
+ mach_write_to_4(log_block + OS_FILE_LOG_BLOCK_SIZE
+ - LOG_BLOCK_TRL_NO - 1, no);
+ log_block_set_data_len(log_block, LOG_BLOCK_HDR_SIZE);
+ log_block_set_first_rec_group(log_block, 0);
+}
/****************************************************************
Writes to the log the string given. The log must be released with