summaryrefslogtreecommitdiff
path: root/sql/semisync_slave.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2021-01-26 02:20:05 +0200
committerSergei Golubchik <serg@mariadb.org>2021-05-19 22:54:12 +0200
commit85d6278fed9e2279117854d86219408f9787bd97 (patch)
tree5d34017eac64d94fd89fe9fe9a595c44d3576b53 /sql/semisync_slave.cc
parentdb9398ba5e385143e6c64af472962f62fa892959 (diff)
downloadmariadb-git-85d6278fed9e2279117854d86219408f9787bd97.tar.gz
Change replication to use uchar for all buffers instead of char
This change is to get rid of randomly failing tests, especially those that reads random position of the binary log. From looking at the logs it's clear that some failures is because of a read char (with value >= 128) is converted to a big long value. Using uchar everywhere makes this much less likely to happen. Another benefit is that a lot of cast of char to uchar could be removed. Other things: - Removed some extra space before '=' and '+=' in assignments - Fixed indentations and lines > 80 characters - Replace '16' with 'element_size' (from class definition) in Gtid_list_log_event()
Diffstat (limited to 'sql/semisync_slave.cc')
-rw-r--r--sql/semisync_slave.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/semisync_slave.cc b/sql/semisync_slave.cc
index df8baf045ac..ccfda7576c2 100644
--- a/sql/semisync_slave.cc
+++ b/sql/semisync_slave.cc
@@ -52,10 +52,10 @@ int Repl_semi_sync_slave::init_object()
return result;
}
-int Repl_semi_sync_slave::slave_read_sync_header(const char *header,
+int Repl_semi_sync_slave::slave_read_sync_header(const uchar *header,
unsigned long total_len,
int *semi_flags,
- const char **payload,
+ const uchar **payload,
unsigned long *payload_len)
{
int read_res = 0;
@@ -64,7 +64,7 @@ int Repl_semi_sync_slave::slave_read_sync_header(const char *header,
if (rpl_semi_sync_slave_status)
{
if (DBUG_EVALUATE_IF("semislave_corrupt_log", 0, 1)
- && (unsigned char)(header[0]) == k_packet_magic_num)
+ && header[0] == k_packet_magic_num)
{
semi_sync_need_reply = (header[1] & k_packet_flag_sync);
*payload_len = total_len - 2;