diff options
author | Monty <monty@mariadb.org> | 2021-01-26 02:20:05 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2021-05-19 22:54:12 +0200 |
commit | 85d6278fed9e2279117854d86219408f9787bd97 (patch) | |
tree | 5d34017eac64d94fd89fe9fe9a595c44d3576b53 /sql/sql_binlog.cc | |
parent | db9398ba5e385143e6c64af472962f62fa892959 (diff) | |
download | mariadb-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/sql_binlog.cc')
-rw-r--r-- | sql/sql_binlog.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/sql_binlog.cc b/sql/sql_binlog.cc index 0011487f1dc..5cd70199645 100644 --- a/sql/sql_binlog.cc +++ b/sql/sql_binlog.cc @@ -207,7 +207,7 @@ void mysql_client_binlog_statement(THD* thd) int err; Relay_log_info *rli; rpl_group_info *rgi; - char *buf= NULL; + uchar *buf= NULL; size_t coded_len= 0, decoded_len= 0; rli= thd->rli_fake; @@ -243,7 +243,7 @@ void mysql_client_binlog_statement(THD* thd) } decoded_len= my_base64_needed_decoded_length((int)coded_len); - if (!(buf= (char *) my_malloc(key_memory_binlog_statement_buffer, + if (!(buf= (uchar *) my_malloc(key_memory_binlog_statement_buffer, decoded_len, MYF(MY_WME)))) { my_error(ER_OUTOFMEMORY, MYF(ME_FATAL), 1); @@ -299,7 +299,7 @@ void mysql_client_binlog_statement(THD* thd) Now we start to read events of the buffer, until there are no more. */ - for (char *bufptr= buf ; bytes_decoded > 0 ; ) + for (uchar *bufptr= buf ; bytes_decoded > 0 ; ) { /* Checking that the first event in the buffer is not truncated. |