diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2018-02-06 12:55:58 +0000 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2018-02-06 12:55:58 +0000 |
commit | 6c279ad6a71c63cb595fde7c951aadb31c3dbebc (patch) | |
tree | 3603f88e1b3bd1e622edb182cccd882dd31ddc8a /sql/semisync_slave.cc | |
parent | f271100836d8a91a775894ec36b869a66a3145e5 (diff) | |
download | mariadb-git-6c279ad6a71c63cb595fde7c951aadb31c3dbebc.tar.gz |
MDEV-15091 : Windows, 64bit: reenable and fix warning C4267 (conversion from 'size_t' to 'type', possible loss of data)
Handle string length as size_t, consistently (almost always:))
Change function prototypes to accept size_t, where in the past
ulong or uint were used. change local/member variables to size_t
when appropriate.
This fix excludes rocksdb, spider,spider, sphinx and connect for now.
Diffstat (limited to 'sql/semisync_slave.cc')
-rw-r--r-- | sql/semisync_slave.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sql/semisync_slave.cc b/sql/semisync_slave.cc index 2d77ee7b10c..86d0176dac1 100644 --- a/sql/semisync_slave.cc +++ b/sql/semisync_slave.cc @@ -148,9 +148,9 @@ void Repl_semi_sync_slave::kill_connection(MYSQL *mysql) mysql_close(kill_mysql); return; } - uint kill_buffer_length = my_snprintf(kill_buffer, 30, "KILL %lu", + size_t kill_buffer_length = my_snprintf(kill_buffer, 30, "KILL %lu", mysql->thread_id); - mysql_real_query(kill_mysql, kill_buffer, kill_buffer_length); + mysql_real_query(kill_mysql, kill_buffer, (ulong)kill_buffer_length); mysql_close(kill_mysql); } @@ -165,7 +165,7 @@ int Repl_semi_sync_slave::request_transmit(Master_info *mi) return 0; query= "SHOW VARIABLES LIKE 'rpl_semi_sync_master_enabled'"; - if (mysql_real_query(mysql, query, strlen(query)) || + if (mysql_real_query(mysql, query, (ulong)strlen(query)) || !(res= mysql_store_result(mysql))) { sql_print_error("Execution failed on master: %s, error :%s", query, mysql_error(mysql)); @@ -190,7 +190,7 @@ int Repl_semi_sync_slave::request_transmit(Master_info *mi) replication */ query= "SET @rpl_semi_sync_slave= 1"; - if (mysql_real_query(mysql, query, strlen(query))) + if (mysql_real_query(mysql, query, (ulong)strlen(query))) { sql_print_error("Set 'rpl_semi_sync_slave=1' on master failed"); return 1; @@ -212,7 +212,7 @@ int Repl_semi_sync_slave::slave_reply(Master_info *mi) + REPLY_BINLOG_POS_LEN + REPLY_BINLOG_NAME_LEN]; int reply_res = 0; - int name_len = strlen(binlog_filename); + size_t name_len = strlen(binlog_filename); DBUG_ENTER("Repl_semi_sync_slave::slave_reply"); |