From 2ef2e33cb8657bebc911611983a0a5d04e56a6c7 Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Fri, 17 Jan 2025 17:39:43 +0100 Subject: [PATCH] MDEV-34705: Binlog-in-engine: Buildbot fixes Signed-off-by: Kristian Nielsen --- .../suite/sys_vars/r/sysvars_server_embedded.result | 10 ++++++++++ storage/innobase/fsp/fsp_binlog.cc | 10 +++++----- storage/innobase/include/fsp_binlog.h | 4 +++- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result index b511a77117d40..a17dbdd7fbba9 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result @@ -392,6 +392,16 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED +VARIABLE_NAME BINLOG_DIRECTORY +VARIABLE_SCOPE GLOBAL +VARIABLE_TYPE VARCHAR +VARIABLE_COMMENT Directory path (absolute or relative to datadir) where binlog files are stored. If this is used, must not specify a directory path for --log-bin +NUMERIC_MIN_VALUE NULL +NUMERIC_MAX_VALUE NULL +NUMERIC_BLOCK_SIZE NULL +ENUM_VALUE_LIST NULL +READ_ONLY YES +COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME BINLOG_DIRECT_NON_TRANSACTIONAL_UPDATES VARIABLE_SCOPE SESSION VARIABLE_TYPE BOOLEAN diff --git a/storage/innobase/fsp/fsp_binlog.cc b/storage/innobase/fsp/fsp_binlog.cc index 22ba16acd0952..085bd714a762d 100644 --- a/storage/innobase/fsp/fsp_binlog.cc +++ b/storage/innobase/fsp/fsp_binlog.cc @@ -121,7 +121,7 @@ fsp_binlog_tablespace_close(uint64_t file_no) mtr_t mtr; dberr_t res; - uint32_t space_id= SRV_SPACE_ID_BINLOG0 + (file_no & 1); + uint32_t space_id= SRV_SPACE_ID_BINLOG0 + (uint32_t)(file_no & 1); mysql_mutex_lock(&fil_system.mutex); fil_space_t *space= fil_space_get_by_id(space_id); mysql_mutex_unlock(&fil_system.mutex); @@ -200,7 +200,7 @@ fsp_binlog_open(const char *file_name, pfs_os_file_t fh, return nullptr; } - uint32_t space_id= SRV_SPACE_ID_BINLOG0 + (file_no & 1); + uint32_t space_id= SRV_SPACE_ID_BINLOG0 + (uint32_t)(file_no & 1); if (!open_empty) { page_t *page_buf= static_cast(aligned_malloc(page_size, page_size)); @@ -306,7 +306,7 @@ dberr_t fsp_binlog_tablespace_create(uint64_t file_no, fil_space_t **new_space) mysql_mutex_lock(&fil_system.mutex); /* ToDo: Need to ensure file (N-2) is no longer active before creating (N). */ - uint32_t space_id= SRV_SPACE_ID_BINLOG0 + (file_no & 1); + uint32_t space_id= SRV_SPACE_ID_BINLOG0 + (uint32_t)(file_no & 1); if (!(*new_space= fil_space_t::create(space_id, ( FSP_FLAGS_FCRC32_MASK_MARKER | FSP_FLAGS_FCRC32_PAGE_SSIZE()), @@ -564,7 +564,7 @@ bool fsp_binlog_flush() { uint64_t file_no= active_binlog_file_no.load(std::memory_order_relaxed); - uint32_t space_id= SRV_SPACE_ID_BINLOG0 + (file_no & 1); + uint32_t space_id= SRV_SPACE_ID_BINLOG0 + (uint32_t)(file_no & 1); uint32_t page_no= binlog_cur_page_no; fil_space_t *space= active_binlog_space; chunk_data_flush dummy_data; @@ -670,7 +670,7 @@ binlog_chunk_reader::fetch_current_page() case. */ buf_block_t *hint_block= nullptr; - uint32_t space_id= SRV_SPACE_ID_BINLOG0 + (s.file_no & 1); + uint32_t space_id= SRV_SPACE_ID_BINLOG0 + (uint32_t)(s.file_no & 1); dberr_t err= DB_SUCCESS; block= buf_page_get_gen(page_id_t{space_id, s.page_no}, 0, RW_S_LATCH, hint_block, BUF_GET_IF_IN_POOL, diff --git a/storage/innobase/include/fsp_binlog.h b/storage/innobase/include/fsp_binlog.h index c1e3566d2a36d..b6c4a393d7bf1 100644 --- a/storage/innobase/include/fsp_binlog.h +++ b/storage/innobase/include/fsp_binlog.h @@ -79,7 +79,9 @@ static constexpr uint64_t ALLOWED_NESTED_RECORDS= ((uint64_t)1 << FSP_BINLOG_TYPE_DUMMY) ; /* Ensure that all types fit in the ALLOWED_NESTED_RECORDS bitmask. */ -static_assert(FSP_BINLOG_TYPE_END <= 8*sizeof(ALLOWED_NESTED_RECORDS)); +static_assert(FSP_BINLOG_TYPE_END <= 8*sizeof(ALLOWED_NESTED_RECORDS), + "Binlog types must be <64 to fit " + "in ALLOWED_NESTED_RECORDS bitmask"); class binlog_chunk_reader {