Commit 64a02e4f authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-19586: Add const qualifiers

Except for fil_name_process(), which invokes os_normalize_path(),
the redo log record parser will not modify the redo log records.
Add const qualifiers accordingly.
parent 9d1bbdc5
......@@ -1710,11 +1710,11 @@ btr_page_reorganize(
/***********************************************************//**
Parses a redo log record of reorganizing a page.
@return end of log record or NULL */
byte*
const byte*
btr_parse_page_reorganize(
/*======================*/
byte* ptr, /*!< in: buffer */
byte* end_ptr,/*!< in: buffer end */
const byte* ptr, /*!< in: buffer */
const byte* end_ptr,/*!< in: buffer end */
dict_index_t* index, /*!< in: record descriptor */
bool compressed,/*!< in: true if compressed page */
buf_block_t* block, /*!< in: page to be reorganized, or NULL */
......@@ -3274,14 +3274,14 @@ btr_set_min_rec_mark_log(
Parses the redo log record for setting an index record as the predefined
minimum record.
@return end of log record or NULL */
byte*
const byte*
btr_parse_set_min_rec_mark(
/*=======================*/
byte* ptr, /*!< in: buffer */
byte* end_ptr,/*!< in: buffer end */
ulint comp, /*!< in: nonzero=compact page format */
page_t* page, /*!< in: page or NULL */
mtr_t* mtr) /*!< in: mtr or NULL */
const byte* ptr, /*!< in: buffer */
const byte* end_ptr,/*!< in: buffer end */
ulint comp, /*!< in: nonzero=compact page format */
page_t* page, /*!< in: page or NULL */
mtr_t* mtr) /*!< in: mtr or NULL */
{
rec_t* rec;
......
......@@ -3927,11 +3927,11 @@ btr_cur_update_in_place_log(
/***********************************************************//**
Parses a redo log record of updating a record in-place.
@return end of log record or NULL */
byte*
const byte*
btr_cur_parse_update_in_place(
/*==========================*/
byte* ptr, /*!< in: buffer */
byte* end_ptr,/*!< in: buffer end */
const byte* ptr, /*!< in: buffer */
const byte* end_ptr,/*!< in: buffer end */
page_t* page, /*!< in/out: page or NULL */
page_zip_des_t* page_zip,/*!< in/out: compressed page, or NULL */
dict_index_t* index) /*!< in: index corresponding to page */
......@@ -5240,11 +5240,11 @@ btr_cur_del_mark_set_clust_rec_log(
Parses the redo log record for delete marking or unmarking of a clustered
index record.
@return end of log record or NULL */
byte*
const byte*
btr_cur_parse_del_mark_set_clust_rec(
/*=================================*/
byte* ptr, /*!< in: buffer */
byte* end_ptr,/*!< in: buffer end */
const byte* ptr, /*!< in: buffer */
const byte* end_ptr,/*!< in: buffer end */
page_t* page, /*!< in/out: page or NULL */
page_zip_des_t* page_zip,/*!< in/out: compressed page, or NULL */
dict_index_t* index) /*!< in: index corresponding to page */
......@@ -5456,11 +5456,11 @@ btr_cur_del_mark_set_sec_rec_log(
Parses the redo log record for delete marking or unmarking of a secondary
index record.
@return end of log record or NULL */
byte*
const byte*
btr_cur_parse_del_mark_set_sec_rec(
/*===============================*/
byte* ptr, /*!< in: buffer */
byte* end_ptr,/*!< in: buffer end */
const byte* ptr, /*!< in: buffer */
const byte* end_ptr,/*!< in: buffer end */
page_t* page, /*!< in/out: page or NULL */
page_zip_des_t* page_zip)/*!< in/out: compressed page, or NULL */
{
......
......@@ -451,9 +451,9 @@ Parse a MLOG_FILE_WRITE_CRYPT_DATA log entry
@param[in] block buffer block
@return position on log buffer */
UNIV_INTERN
byte*
const byte*
fil_parse_write_crypt_data(
byte* ptr,
const byte* ptr,
const byte* end_ptr,
dberr_t* err)
{
......
......@@ -584,23 +584,23 @@ btr_discard_page(
Parses the redo log record for setting an index record as the predefined
minimum record.
@return end of log record or NULL */
byte*
const byte*
btr_parse_set_min_rec_mark(
/*=======================*/
byte* ptr, /*!< in: buffer */
byte* end_ptr,/*!< in: buffer end */
ulint comp, /*!< in: nonzero=compact page format */
page_t* page, /*!< in: page or NULL */
mtr_t* mtr) /*!< in: mtr or NULL */
const byte* ptr, /*!< in: buffer */
const byte* end_ptr,/*!< in: buffer end */
ulint comp, /*!< in: nonzero=compact page format */
page_t* page, /*!< in: page or NULL */
mtr_t* mtr) /*!< in: mtr or NULL */
MY_ATTRIBUTE((nonnull(1,2), warn_unused_result));
/***********************************************************//**
Parses a redo log record of reorganizing a page.
@return end of log record or NULL */
byte*
const byte*
btr_parse_page_reorganize(
/*======================*/
byte* ptr, /*!< in: buffer */
byte* end_ptr,/*!< in: buffer end */
const byte* ptr, /*!< in: buffer */
const byte* end_ptr,/*!< in: buffer end */
dict_index_t* index, /*!< in: record descriptor */
bool compressed,/*!< in: true if compressed page */
buf_block_t* block, /*!< in: page to be reorganized, or NULL */
......
......@@ -566,11 +566,11 @@ void btr_cur_node_ptr_delete(btr_cur_t* parent, mtr_t* mtr)
/***********************************************************//**
Parses a redo log record of updating a record in-place.
@return end of log record or NULL */
byte*
const byte*
btr_cur_parse_update_in_place(
/*==========================*/
byte* ptr, /*!< in: buffer */
byte* end_ptr,/*!< in: buffer end */
const byte* ptr, /*!< in: buffer */
const byte* end_ptr,/*!< in: buffer end */
page_t* page, /*!< in/out: page or NULL */
page_zip_des_t* page_zip,/*!< in/out: compressed page, or NULL */
dict_index_t* index); /*!< in: index corresponding to page */
......@@ -578,11 +578,11 @@ btr_cur_parse_update_in_place(
Parses the redo log record for delete marking or unmarking of a clustered
index record.
@return end of log record or NULL */
byte*
const byte*
btr_cur_parse_del_mark_set_clust_rec(
/*=================================*/
byte* ptr, /*!< in: buffer */
byte* end_ptr,/*!< in: buffer end */
const byte* ptr, /*!< in: buffer */
const byte* end_ptr,/*!< in: buffer end */
page_t* page, /*!< in/out: page or NULL */
page_zip_des_t* page_zip,/*!< in/out: compressed page, or NULL */
dict_index_t* index); /*!< in: index corresponding to page */
......@@ -590,11 +590,11 @@ btr_cur_parse_del_mark_set_clust_rec(
Parses the redo log record for delete marking or unmarking of a secondary
index record.
@return end of log record or NULL */
byte*
const byte*
btr_cur_parse_del_mark_set_sec_rec(
/*===============================*/
byte* ptr, /*!< in: buffer */
byte* end_ptr,/*!< in: buffer end */
const byte* ptr, /*!< in: buffer */
const byte* end_ptr,/*!< in: buffer end */
page_t* page, /*!< in/out: page or NULL */
page_zip_des_t* page_zip);/*!< in/out: compressed page, or NULL */
......
......@@ -301,9 +301,9 @@ Parse a MLOG_FILE_WRITE_CRYPT_DATA log entry
@param[out] err DB_SUCCESS or DB_DECRYPTION_FAILED
@return position on log buffer */
UNIV_INTERN
byte*
const byte*
fil_parse_write_crypt_data(
byte* ptr,
const byte* ptr,
const byte* end_ptr,
dberr_t* err)
MY_ATTRIBUTE((warn_unused_result));
......
......@@ -330,7 +330,7 @@ struct recv_sys_t{
@param lsn start LSN of the mini-transaction
@param end_lsn end LSN of the mini-transaction */
inline void add(mlog_id_t type, const page_id_t page_id,
byte* body, byte* rec_end, lsn_t lsn,
const byte* body, const byte* rec_end, lsn_t lsn,
lsn_t end_lsn);
/** Clear a fully processed set of stored redo log records. */
......
/*****************************************************************************
Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2018, MariaDB Corporation.
Copyright (c) 2018, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
......@@ -197,7 +197,7 @@ mlog_write_initial_log_record_fast(
/********************************************************//**
Parses an initial log record written by mlog_write_initial_log_record.
@return parsed record end, NULL if not a complete record */
byte*
const byte*
mlog_parse_initial_log_record(
/*==========================*/
const byte* ptr, /*!< in: buffer */
......@@ -208,7 +208,7 @@ mlog_parse_initial_log_record(
/********************************************************//**
Parses a log record written by mlog_write_ulint, mlog_write_ull, mlog_memset.
@return parsed record end, NULL if not a complete record */
byte*
const byte*
mlog_parse_nbytes(
/*==============*/
mlog_id_t type, /*!< in: log record type: MLOG_1BYTE, ... */
......@@ -220,13 +220,14 @@ mlog_parse_nbytes(
/********************************************************//**
Parses a log record written by mlog_write_string.
@return parsed record end, NULL if not a complete record */
byte*
const byte*
mlog_parse_string(
/*==============*/
byte* ptr, /*!< in: buffer */
byte* end_ptr,/*!< in: buffer end */
byte* page, /*!< in: page where to apply the log record, or NULL */
void* page_zip);/*!< in/out: compressed page, or NULL */
const byte* ptr, /*!< in: buffer */
const byte* end_ptr,/*!< in: buffer end */
byte* page, /*!< in: page where to apply the log record,
or NULL */
void* page_zip);/*!< in/out: compressed page, or NULL */
/********************************************************//**
Opens a buffer for mlog, writes the initial log record and,
......@@ -248,12 +249,12 @@ mlog_open_and_write_index(
/********************************************************//**
Parses a log record written by mlog_open_and_write_index.
@return parsed record end, NULL if not a complete record */
byte*
const byte*
mlog_parse_index(
/*=============*/
byte* ptr, /*!< in: buffer */
const byte* ptr, /*!< in: buffer */
const byte* end_ptr,/*!< in: buffer end */
ibool comp, /*!< in: TRUE=compact record format */
bool comp, /*!< in: TRUE=compact record format */
dict_index_t** index); /*!< out, own: dummy index */
/** Insert, update, and maybe other functions may use this value to define an
......
/*****************************************************************************
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2018, MariaDB Corporation.
Copyright (c) 2018, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
......@@ -343,10 +343,10 @@ page_cur_insert_rec_write_log(
/***********************************************************//**
Parses a log record of a record insert on a page.
@return end of log record or NULL */
byte*
const byte*
page_cur_parse_insert_rec(
/*======================*/
ibool is_short,/*!< in: TRUE if short inserts */
bool is_short,/*!< in: true if short inserts */
const byte* ptr, /*!< in: buffer */
const byte* end_ptr,/*!< in: buffer end */
buf_block_t* block, /*!< in: page or NULL */
......@@ -355,22 +355,22 @@ page_cur_parse_insert_rec(
/**********************************************************//**
Parses a log record of copying a record list end to a new created page.
@return end of log record or NULL */
byte*
const byte*
page_parse_copy_rec_list_to_created_page(
/*=====================================*/
byte* ptr, /*!< in: buffer */
byte* end_ptr,/*!< in: buffer end */
const byte* ptr, /*!< in: buffer */
const byte* end_ptr,/*!< in: buffer end */
buf_block_t* block, /*!< in: page or NULL */
dict_index_t* index, /*!< in: record descriptor */
mtr_t* mtr); /*!< in: mtr or NULL */
/***********************************************************//**
Parses log record of a record delete on a page.
@return pointer to record end or NULL */
byte*
const byte*
page_cur_parse_delete_rec(
/*======================*/
byte* ptr, /*!< in: buffer */
byte* end_ptr,/*!< in: buffer end */
const byte* ptr, /*!< in: buffer */
const byte* end_ptr,/*!< in: buffer end */
buf_block_t* block, /*!< in: page or NULL */
dict_index_t* index, /*!< in: record descriptor */
mtr_t* mtr); /*!< in: mtr or NULL */
......
......@@ -1137,15 +1137,15 @@ page_move_rec_list_start(
/**********************************************************//**
Parses a log record of a record list end or start deletion.
@return end of log record or NULL */
byte*
const byte*
page_parse_delete_rec_list(
/*=======================*/
mlog_id_t type, /*!< in: MLOG_LIST_END_DELETE,
MLOG_LIST_START_DELETE,
MLOG_COMP_LIST_END_DELETE or
MLOG_COMP_LIST_START_DELETE */
byte* ptr, /*!< in: buffer */
byte* end_ptr,/*!< in: buffer end */
const byte* ptr, /*!< in: buffer */
const byte* end_ptr,/*!< in: buffer end */
buf_block_t* block, /*!< in/out: buffer block or NULL */
dict_index_t* index, /*!< in: record descriptor */
mtr_t* mtr); /*!< in: mtr or NULL */
......
......@@ -264,11 +264,11 @@ page_zip_write_rec(
/***********************************************************//**
Parses a log record of writing a BLOB pointer of a record.
@return end of log record or NULL */
byte*
const byte*
page_zip_parse_write_blob_ptr(
/*==========================*/
byte* ptr, /*!< in: redo log buffer */
byte* end_ptr,/*!< in: redo log buffer end */
const byte* ptr, /*!< in: redo log buffer */
const byte* end_ptr,/*!< in: redo log buffer end */
page_t* page, /*!< in/out: uncompressed page */
page_zip_des_t* page_zip);/*!< in/out: compressed page */
......@@ -290,11 +290,11 @@ page_zip_write_blob_ptr(
/***********************************************************//**
Parses a log record of writing the node pointer of a record.
@return end of log record or NULL */
byte*
const byte*
page_zip_parse_write_node_ptr(
/*==========================*/
byte* ptr, /*!< in: redo log buffer */
byte* end_ptr,/*!< in: redo log buffer end */
const byte* ptr, /*!< in: redo log buffer */
const byte* end_ptr,/*!< in: redo log buffer end */
page_t* page, /*!< in/out: uncompressed page */
page_zip_des_t* page_zip);/*!< in/out: compressed page */
......@@ -335,10 +335,10 @@ page_zip_write_trx_id_and_roll_ptr(
@param[in,out] page_zip compressed page
@return end of log record
@retval NULL if the log record is incomplete */
byte*
const byte*
page_zip_parse_write_trx_id(
byte* ptr,
byte* end_ptr,
const byte* ptr,
const byte* end_ptr,
page_t* page,
page_zip_des_t* page_zip)
MY_ATTRIBUTE((nonnull(1,2), warn_unused_result));
......@@ -403,11 +403,11 @@ page_zip_dir_add_slot(
/***********************************************************//**
Parses a log record of writing to the header of a page.
@return end of log record or NULL */
byte*
const byte*
page_zip_parse_write_header(
/*========================*/
byte* ptr, /*!< in: redo log buffer */
byte* end_ptr,/*!< in: redo log buffer end */
const byte* ptr, /*!< in: redo log buffer */
const byte* end_ptr,/*!< in: redo log buffer end */
page_t* page, /*!< in/out: uncompressed page */
page_zip_des_t* page_zip);/*!< in/out: compressed page */
......@@ -468,8 +468,8 @@ page_zip_copy_recs(
@param[in,out] block ROW_FORMAT=COMPRESSED block, or NULL for parsing only
@return end of log record
@retval NULL if the log record is incomplete */
byte* page_zip_parse_compress(const byte* ptr, const byte* end_ptr,
buf_block_t* block);
const byte* page_zip_parse_compress(const byte* ptr, const byte* end_ptr,
buf_block_t* block);
#endif /* !UNIV_INNOCHECKSUM */
......
......@@ -362,11 +362,7 @@ inline void recv_sys_t::trim(const page_id_t page_id, lsn_t lsn)
@param[in] deleted whether this is a MLOG_FILE_DELETE record */
static
void
fil_name_process(
char* name,
ulint len,
ulint space_id,
bool deleted)
fil_name_process(char* name, ulint len, ulint space_id, bool deleted)
{
if (srv_operation == SRV_OPERATION_BACKUP) {
return;
......@@ -492,7 +488,7 @@ fil_name_process(
}
/** Parse or process a MLOG_FILE_* record.
@param[in] ptr redo log record
@param[in,out] ptr redo log record
@param[in] end end of the redo log buffer
@param[in] space_id the tablespace ID
@param[in] first_page_no first page number in the file
......@@ -502,7 +498,7 @@ or MLOG_FILE_CREATE2 or MLOG_FILE_RENAME2
@return pointer to next redo log record
@retval NULL if this log record was truncated */
static
byte*
const byte*
fil_name_parse(
byte* ptr,
const byte* end,
......@@ -1277,11 +1273,11 @@ or if it is a MLOG_FILE_ operation
a page log record should not be applied
@return log record end, NULL if not a complete record */
static
byte*
const byte*
recv_parse_or_apply_log_rec_body(
mlog_id_t type,
byte* ptr,
byte* end_ptr,
const byte* ptr,
const byte* end_ptr,
ulint space_id,
ulint page_no,
bool apply,
......@@ -1299,8 +1295,8 @@ recv_parse_or_apply_log_rec_body(
ut_ad(block == NULL);
/* Collect the file names when parsing the log,
before applying any log records. */
return(fil_name_parse(ptr, end_ptr, space_id, page_no, type,
apply));
return fil_name_parse(const_cast<byte*>(ptr), end_ptr,
space_id, page_no, type, apply);
case MLOG_INDEX_LOAD:
if (end_ptr < ptr + 8) {
return(NULL);
......@@ -1489,7 +1485,7 @@ recv_parse_or_apply_log_rec_body(
ut_a(!page
|| (ibool)!!page_is_comp(page)
== dict_table_is_comp(index->table));
ptr = page_cur_parse_insert_rec(FALSE, ptr, end_ptr,
ptr = page_cur_parse_insert_rec(false, ptr, end_ptr,
block, index, mtr);
}
break;
......@@ -1690,7 +1686,7 @@ recv_parse_or_apply_log_rec_body(
break;
case MLOG_FILE_WRITE_CRYPT_DATA:
dberr_t err;
ptr = const_cast<byte*>(fil_parse_write_crypt_data(ptr, end_ptr, &err));
ptr = fil_parse_write_crypt_data(ptr, end_ptr, &err);
if (err != DB_SUCCESS) {
recv_sys.found_corrupt_log = TRUE;
......@@ -1722,7 +1718,7 @@ recv_parse_or_apply_log_rec_body(
@param lsn start LSN of the mini-transaction
@param end_lsn end LSN of the mini-transaction */
inline void recv_sys_t::add(mlog_id_t type, const page_id_t page_id,
byte* body, byte* rec_end, lsn_t lsn,
const byte* body, const byte* rec_end, lsn_t lsn,
lsn_t end_lsn)
{
ut_ad(type != MLOG_FILE_DELETE);
......@@ -2325,14 +2321,14 @@ static
ulint
recv_parse_log_rec(
mlog_id_t* type,
byte* ptr,
byte* end_ptr,
const byte* ptr,
const byte* end_ptr,
ulint* space,
ulint* page_no,
bool apply,
byte** body)
const byte** body)
{
byte* new_ptr;
const byte* new_ptr;
*body = NULL;
......@@ -2523,8 +2519,6 @@ hash table to wait merging to file pages.
or corruption was noticed */
bool recv_parse_log_recs(lsn_t checkpoint_lsn, store_t store, bool apply)
{
byte* ptr;
byte* end_ptr;
bool single_rec;
ulint len;
lsn_t new_recovered_lsn;
......@@ -2532,15 +2526,14 @@ bool recv_parse_log_recs(lsn_t checkpoint_lsn, store_t store, bool apply)
mlog_id_t type;
ulint space;
ulint page_no;
byte* body;
const byte* body;
ut_ad(log_mutex_own());
ut_ad(mutex_own(&recv_sys.mutex));
ut_ad(recv_sys.parse_start_lsn != 0);
loop:
ptr = recv_sys.buf + recv_sys.recovered_offset;
end_ptr = recv_sys.buf + recv_sys.len;
const byte* ptr = recv_sys.buf + recv_sys.recovered_offset;
const byte* end_ptr = recv_sys.buf + recv_sys.len;
if (ptr == end_ptr) {
......
/*****************************************************************************
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, 2018, MariaDB Corporation.
Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
......@@ -83,7 +83,7 @@ mlog_write_initial_log_record(
/********************************************************//**
Parses an initial log record written by mlog_write_initial_log_record.
@return parsed record end, NULL if not a complete record */
byte*
const byte*
mlog_parse_initial_log_record(
/*==========================*/
const byte* ptr, /*!< in: buffer */
......@@ -123,7 +123,7 @@ mlog_parse_initial_log_record(
/********************************************************//**
Parses a log record written by mlog_write_ulint, mlog_write_ull, mlog_memset.
@return parsed record end, NULL if not a complete record or a corrupt record */
byte*
const byte*
mlog_parse_nbytes(
/*==============*/
mlog_id_t type, /*!< in: log record type: MLOG_1BYTE, ... */
......@@ -375,13 +375,14 @@ mlog_log_string(
/********************************************************//**
Parses a log record written by mlog_write_string.
@return parsed record end, NULL if not a complete record */
byte*
const byte*
mlog_parse_string(
/*==============*/
byte* ptr, /*!< in: buffer */
byte* end_ptr,/*!< in: buffer end */
byte* page, /*!< in: page where to apply the log record, or NULL */
void* page_zip)/*!< in/out: compressed page, or NULL */
const byte* ptr, /*!< in: buffer */
const byte* end_ptr,/*!< in: buffer end */
byte* page, /*!< in: page where to apply the log record,
or NULL */
void* page_zip)/*!< in/out: compressed page, or NULL */
{
ulint offset;
ulint len;
......@@ -614,12 +615,12 @@ mlog_open_and_write_index(
/********************************************************//**
Parses a log record written by mlog_open_and_write_index.
@return parsed record end, NULL if not a complete record */
byte*
const byte*
mlog_parse_index(
/*=============*/
byte* ptr, /*!< in: buffer */
const byte* ptr, /*!< in: buffer */
const byte* end_ptr,/*!< in: buffer end */
ibool comp, /*!< in: TRUE=compact row format */
bool comp, /*!< in: TRUE=compact row format */
dict_index_t** index) /*!< out, own: dummy index */
{
ulint i, n, n_uniq;
......@@ -627,8 +628,6 @@ mlog_parse_index(
dict_index_t* ind;
ulint n_core_fields = 0;
ut_ad(comp == FALSE || comp == TRUE);
if (comp) {
if (end_ptr < ptr + 4) {
return(NULL);
......
......@@ -1016,10 +1016,10 @@ page_cur_insert_rec_write_log(
/***********************************************************//**
Parses a log record of a record insert on a page.
@return end of log record or NULL */
byte*
const byte*
page_cur_parse_insert_rec(
/*======================*/
ibool is_short,/*!< in: TRUE if short inserts */
bool is_short,/*!< in: true if short inserts */
const byte* ptr, /*!< in: buffer */
const byte* end_ptr,/*!< in: buffer end */
buf_block_t* block, /*!< in: page or NULL */
......@@ -2077,16 +2077,15 @@ page_copy_rec_list_to_created_page_write_log(
/**********************************************************//**
Parses a log record of copying a record list end to a new created page.
@return end of log record or NULL */
byte*
const byte*
page_parse_copy_rec_list_to_created_page(
/*=====================================*/
byte* ptr, /*!< in: buffer */
byte* end_ptr,/*!< in: buffer end */
const byte* ptr, /*!< in: buffer */
const byte* end_ptr,/*!< in: buffer end */
buf_block_t* block, /*!< in: page or NULL */
dict_index_t* index, /*!< in: record descriptor */
mtr_t* mtr) /*!< in: mtr or NULL */
{
byte* rec_end;
ulint log_data_len;
page_t* page;
page_zip_des_t* page_zip;
......@@ -2101,7 +2100,7 @@ page_parse_copy_rec_list_to_created_page(
log_data_len = mach_read_from_4(ptr);
ptr += 4;
rec_end = ptr + log_data_len;
const byte* rec_end = ptr + log_data_len;
if (rec_end > end_ptr) {
......@@ -2123,7 +2122,7 @@ page_parse_copy_rec_list_to_created_page(
|| !page_has_siblings(block->frame));
while (ptr < rec_end) {
ptr = page_cur_parse_insert_rec(TRUE, ptr, end_ptr,
ptr = page_cur_parse_insert_rec(true, ptr, end_ptr,
block, index, mtr);
}
......@@ -2364,11 +2363,11 @@ page_cur_delete_rec_write_log(
/***********************************************************//**
Parses log record of a record delete on a page.
@return pointer to record end or NULL */
byte*
const byte*
page_cur_parse_delete_rec(
/*======================*/
byte* ptr, /*!< in: buffer */
byte* end_ptr,/*!< in: buffer end */
const byte* ptr, /*!< in: buffer */
const byte* end_ptr,/*!< in: buffer end */
buf_block_t* block, /*!< in: page or NULL */
dict_index_t* index, /*!< in: record descriptor */
mtr_t* mtr) /*!< in: mtr or NULL */
......
......@@ -914,15 +914,15 @@ page_delete_rec_list_write_log(
/**********************************************************//**
Parses a log record of a record list end or start deletion.
@return end of log record or NULL */
byte*
const byte*
page_parse_delete_rec_list(
/*=======================*/
mlog_id_t type, /*!< in: MLOG_LIST_END_DELETE,
MLOG_LIST_START_DELETE,
MLOG_COMP_LIST_END_DELETE or
MLOG_COMP_LIST_START_DELETE */
byte* ptr, /*!< in: buffer */
byte* end_ptr,/*!< in: buffer end */
const byte* ptr, /*!< in: buffer */
const byte* end_ptr,/*!< in: buffer end */
buf_block_t* block, /*!< in/out: buffer block or NULL */
dict_index_t* index, /*!< in: record descriptor */
mtr_t* mtr) /*!< in: mtr or NULL */
......
......@@ -3813,11 +3813,11 @@ page_zip_write_rec(
/***********************************************************//**
Parses a log record of writing a BLOB pointer of a record.
@return end of log record or NULL */
byte*
const byte*
page_zip_parse_write_blob_ptr(
/*==========================*/
byte* ptr, /*!< in: redo log buffer */
byte* end_ptr,/*!< in: redo log buffer end */
const byte* ptr, /*!< in: redo log buffer */
const byte* end_ptr,/*!< in: redo log buffer end */
page_t* page, /*!< in/out: uncompressed page */
page_zip_des_t* page_zip)/*!< in/out: compressed page */
{
......@@ -3956,11 +3956,11 @@ page_zip_write_blob_ptr(
/***********************************************************//**
Parses a log record of writing the node pointer of a record.
@return end of log record or NULL */
byte*
const byte*
page_zip_parse_write_node_ptr(
/*==========================*/
byte* ptr, /*!< in: redo log buffer */
byte* end_ptr,/*!< in: redo log buffer end */
const byte* ptr, /*!< in: redo log buffer */
const byte* end_ptr,/*!< in: redo log buffer end */
page_t* page, /*!< in/out: uncompressed page */
page_zip_des_t* page_zip)/*!< in/out: compressed page */
{
......@@ -4178,14 +4178,15 @@ page_zip_write_trx_id_and_roll_ptr(
@param[in,out] page_zip compressed page
@return end of log record
@retval NULL if the log record is incomplete */
byte*
const byte*
page_zip_parse_write_trx_id(
byte* ptr,
byte* end_ptr,
const byte* ptr,
const byte* end_ptr,
page_t* page,
page_zip_des_t* page_zip)
{
byte* const end = 2 + 2 + DATA_TRX_ID_LEN + DATA_ROLL_PTR_LEN + ptr;
const byte* const end = 2 + 2 + DATA_TRX_ID_LEN + DATA_ROLL_PTR_LEN
+ ptr;
if (UNIV_UNLIKELY(end_ptr < end)) {
return(NULL);
......@@ -4590,11 +4591,11 @@ page_zip_dir_add_slot(
/***********************************************************//**
Parses a log record of writing to the header of a page.
@return end of log record or NULL */
byte*
const byte*
page_zip_parse_write_header(
/*========================*/
byte* ptr, /*!< in: redo log buffer */
byte* end_ptr,/*!< in: redo log buffer end */
const byte* ptr, /*!< in: redo log buffer */
const byte* end_ptr,/*!< in: redo log buffer end */
page_t* page, /*!< in/out: uncompressed page */
page_zip_des_t* page_zip)/*!< in/out: compressed page */
{
......@@ -4862,8 +4863,8 @@ page_zip_copy_recs(
@param[in,out] block ROW_FORMAT=COMPRESSED block, or NULL for parsing only
@return end of log record
@retval NULL if the log record is incomplete */
byte* page_zip_parse_compress(const byte* ptr, const byte* end_ptr,
buf_block_t* block)
const byte* page_zip_parse_compress(const byte* ptr, const byte* end_ptr,
buf_block_t* block)
{
ulint size;
ulint trailer_size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment