Commit e843297d authored by Michael Widenius's avatar Michael Widenius

Fixed compiler warnings

parent 183d6b70
...@@ -2815,9 +2815,9 @@ bool MYSQL_BIN_LOG::open(const char *log_name, ...@@ -2815,9 +2815,9 @@ bool MYSQL_BIN_LOG::open(const char *log_name,
relay_log_checksum_alg : relay_log_checksum_alg :
/* otherwise use slave's local preference of RL events verification */ /* otherwise use slave's local preference of RL events verification */
(opt_slave_sql_verify_checksum == 0) ? (opt_slave_sql_verify_checksum == 0) ?
(uint8) BINLOG_CHECKSUM_ALG_OFF : binlog_checksum_options): (uint8) BINLOG_CHECKSUM_ALG_OFF : (uint8) binlog_checksum_options):
/* binlog */ /* binlog */
binlog_checksum_options; (uint8) binlog_checksum_options;
DBUG_ASSERT(s.checksum_alg != BINLOG_CHECKSUM_ALG_UNDEF); DBUG_ASSERT(s.checksum_alg != BINLOG_CHECKSUM_ALG_UNDEF);
if (!s.is_valid()) if (!s.is_valid())
goto err; goto err;
...@@ -5699,7 +5699,7 @@ void MYSQL_BIN_LOG::close(uint exiting) ...@@ -5699,7 +5699,7 @@ void MYSQL_BIN_LOG::close(uint exiting)
Stop_log_event s; Stop_log_event s;
// the checksumming rule for relay-log case is similar to Rotate // the checksumming rule for relay-log case is similar to Rotate
s.checksum_alg= is_relay_log ? s.checksum_alg= is_relay_log ?
relay_log_checksum_alg : binlog_checksum_options; (uint8) relay_log_checksum_alg : (uint8) binlog_checksum_options;
DBUG_ASSERT(!is_relay_log || DBUG_ASSERT(!is_relay_log ||
relay_log_checksum_alg != BINLOG_CHECKSUM_ALG_UNDEF); relay_log_checksum_alg != BINLOG_CHECKSUM_ALG_UNDEF);
s.pre_55_writing_direct(); s.pre_55_writing_direct();
......
...@@ -955,18 +955,17 @@ my_bool Log_event::need_checksum() ...@@ -955,18 +955,17 @@ my_bool Log_event::need_checksum()
{ {
DBUG_ENTER("Log_event::need_checksum"); DBUG_ENTER("Log_event::need_checksum");
my_bool ret; my_bool ret;
extern ulong binlog_checksum_options;
/* /*
few callers of Log_event::write few callers of Log_event::write
(incl FD::write, FD constructing code on the slave side, Rotate relay log (incl FD::write, FD constructing code on the slave side, Rotate relay log
and Stop event) and Stop event)
provides their checksum alg preference through Log_event::checksum_alg. provides their checksum alg preference through Log_event::checksum_alg.
*/ */
ret= (checksum_alg != BINLOG_CHECKSUM_ALG_UNDEF) ? ret= ((checksum_alg != BINLOG_CHECKSUM_ALG_UNDEF) ?
(checksum_alg != BINLOG_CHECKSUM_ALG_OFF) : (checksum_alg != BINLOG_CHECKSUM_ALG_OFF) :
((binlog_checksum_options != BINLOG_CHECKSUM_ALG_OFF) && ((binlog_checksum_options != BINLOG_CHECKSUM_ALG_OFF) &&
(cache_type == Log_event::EVENT_NO_CACHE))? binlog_checksum_options : (cache_type == Log_event::EVENT_NO_CACHE)) ?
FALSE; test(binlog_checksum_options) : FALSE);
/* /*
FD calls the methods before data_written has been calculated. FD calls the methods before data_written has been calculated.
...@@ -980,7 +979,7 @@ my_bool Log_event::need_checksum() ...@@ -980,7 +979,7 @@ my_bool Log_event::need_checksum()
if (checksum_alg == BINLOG_CHECKSUM_ALG_UNDEF) if (checksum_alg == BINLOG_CHECKSUM_ALG_UNDEF)
checksum_alg= ret ? // calculated value stored checksum_alg= ret ? // calculated value stored
binlog_checksum_options : (uint8) BINLOG_CHECKSUM_ALG_OFF; (uint8) binlog_checksum_options : (uint8) BINLOG_CHECKSUM_ALG_OFF;
DBUG_ASSERT(!ret || DBUG_ASSERT(!ret ||
((checksum_alg == binlog_checksum_options || ((checksum_alg == binlog_checksum_options ||
......
...@@ -2067,6 +2067,7 @@ extern ulong MYSQL_PLUGIN_IMPORT specialflag; ...@@ -2067,6 +2067,7 @@ extern ulong MYSQL_PLUGIN_IMPORT specialflag;
#ifdef MYSQL_SERVER #ifdef MYSQL_SERVER
extern ulong current_pid; extern ulong current_pid;
extern ulong expire_logs_days, sync_binlog_period, sync_binlog_counter; extern ulong expire_logs_days, sync_binlog_period, sync_binlog_counter;
extern ulong binlog_checksum_options;
extern ulong opt_tc_log_size, tc_log_max_pages_used, tc_log_page_size; extern ulong opt_tc_log_size, tc_log_max_pages_used, tc_log_page_size;
extern ulong tc_log_page_waits; extern ulong tc_log_page_waits;
extern my_bool relay_log_purge, opt_innodb_safe_binlog, opt_innodb; extern my_bool relay_log_purge, opt_innodb_safe_binlog, opt_innodb;
......
...@@ -279,7 +279,7 @@ bool event_checksum_test(uchar *event_buf, ulong event_len, uint8 alg) ...@@ -279,7 +279,7 @@ bool event_checksum_test(uchar *event_buf, ulong event_len, uint8 alg)
{ {
/* restoring the orig value of flags of FD */ /* restoring the orig value of flags of FD */
DBUG_ASSERT(event_buf[EVENT_TYPE_OFFSET] == FORMAT_DESCRIPTION_EVENT); DBUG_ASSERT(event_buf[EVENT_TYPE_OFFSET] == FORMAT_DESCRIPTION_EVENT);
event_buf[FLAGS_OFFSET]= flags; event_buf[FLAGS_OFFSET]= (uchar) flags;
} }
res= !(computed == incoming); res= !(computed == incoming);
} }
......
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