Skip to content

Commit

Permalink
MDEV-34705: Binlog-in-engine: Buildbot fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
  • Loading branch information
knielsen committed Jan 17, 2025
1 parent c60bea9 commit 18932be
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 14 deletions.
10 changes: 10 additions & 0 deletions mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions sql/sql_repl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3279,6 +3279,7 @@ static int send_one_binlog_file(binlog_send_info *info,
{
if (opt_binlog_engine_hton)
{
info->dirlen= 0;
if (send_engine_events(info))
return 1;
}
Expand Down
10 changes: 5 additions & 5 deletions storage/innobase/fsp/fsp_binlog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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<byte*>(aligned_malloc(page_size, page_size));
Expand Down Expand Up @@ -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()),
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down
10 changes: 6 additions & 4 deletions storage/innobase/handler/innodb_binlog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ serialize_gtid_state(rpl_binlog_state_base *state, byte *buf, size_t buf_size,
p + (buf_size - (2*COMPR_INT_MAX32 + COMPR_INT_MAX64));

if (state->iterate(
[buf, buf_size, pmax, &p] (const rpl_gtid *gtid) {
[pmax, &p] (const rpl_gtid *gtid) {
if (UNIV_UNLIKELY(p > pmax))
return true;
p= compr_int_write(p, gtid->domain_id);
Expand Down Expand Up @@ -1498,7 +1498,8 @@ innodb_binlog_oob_reader::read_data(binlog_chunk_reader *chunk_rd,
{
case ST_initial:
chunk_rd->seek(e->file_no, e->offset);
static_assert(sizeof(e->rd_buf) == 5*COMPR_INT_MAX64);
static_assert(sizeof(e->rd_buf) == 5*COMPR_INT_MAX64,
"rd_buf size must match code using it");
res= chunk_rd->read_data(e->rd_buf, 5*COMPR_INT_MAX64, true);
if (res < 0)
return -1;
Expand Down Expand Up @@ -1665,7 +1666,8 @@ int ha_innodb_binlog_reader::read_data(uchar *buf, uint32_t len)
switch (state)
{
case ST_read_next_event_group:
static_assert(sizeof(rd_buf) == 5*COMPR_INT_MAX64);
static_assert(sizeof(rd_buf) == 5*COMPR_INT_MAX64,
"rd_buf size must match code using it");
res= chunk_rd.read_data(rd_buf, 5*COMPR_INT_MAX64, true);
if (res <= 0)
return res;
Expand Down Expand Up @@ -1849,7 +1851,7 @@ gtid_search::read_gtid_state_file_no(rpl_binlog_state_base *state,
*/
mtr.start();
mtr_started= true;
uint32_t space_id= SRV_SPACE_ID_BINLOG0 + (file_no & 1);
uint32_t space_id= SRV_SPACE_ID_BINLOG0 + (uint32_t)(file_no & 1);
dberr_t err= DB_SUCCESS;
block= buf_page_get_gen(page_id_t{space_id, page_no}, 0, RW_S_LATCH,
nullptr, BUF_GET_IF_IN_POOL, &mtr, &err);
Expand Down
4 changes: 3 additions & 1 deletion storage/innobase/include/fsp_binlog.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions storage/innobase/include/small_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ this program; if not, write to the Free Software Foundation, Inc.,
#include "my_valgrind.h"
#include <iterator>
#include <memory>
#include <algorithm>

class small_vector_base
{
Expand Down
10 changes: 6 additions & 4 deletions storage/innobase/ut/ut0compr_int.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,14 @@ unsigned char *compr_int_write(unsigned char *p, uint64_t v) {
ToDo: On big-endian can use more efficient little-endian conversion, since
we know the pointer is 8-byte aligned.
*/
int8store(p1, (uint8korr(p1) & ~mask1) | v1);
int8store((unsigned char *)p1,
(uint8korr((unsigned char *)p1) & ~mask1) | v1);
#else
*p1= (*p1 & ~mask1) | v1;
#endif
if (offset + bytes >= 8) {
#ifdef WORDS_BIGENDIAN
int8store(p2, v2);
int8store((unsigned char *)p2, v2);
#else
*p2= v2;
#endif
Expand All @@ -91,7 +92,7 @@ compr_int_read(const unsigned char *p)
ToDo: On big-endian can use more efficient little-endian conversion, since
we know the pointer is 8-byte aligned.
*/
uint64_t v1= uint8korr(p_align);
uint64_t v1= uint8korr((unsigned char *)p_align);
#else
uint64_t v1= p_align[0];
#endif
Expand All @@ -103,7 +104,8 @@ compr_int_read(const unsigned char *p)
uint64_t mask2= (~(uint64_t)0) >> ((16 - (offset + bytes)) << 3);
#ifdef WORDS_BIGENDIAN
v= (v1 >> (3 + offset_bits)) |
((uint8korr(p_align + 1) & mask2) << (61 - offset_bits));
((uint8korr((unsigned char *)(p_align + 1)) & mask2) <<
(61 - offset_bits));
#else
v= (v1 >> (3 + offset_bits)) | ((p_align[1] & mask2) << (61 - offset_bits));
#endif
Expand Down

0 comments on commit 18932be

Please sign in to comment.