summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2017-09-28 10:38:02 +0000
committerVladislav Vaintroub <wlad@mariadb.com>2017-09-28 17:20:46 +0000
commit7354dc67737fdeb105656f5cec055da627bb9c29 (patch)
tree7cc2b5f975d5e32eb94cd1344b259ea1b24018d6 /plugin
parent509928718d52a14739fcfb2ebf0e68b4c8e01be5 (diff)
downloadmariadb-git-7354dc67737fdeb105656f5cec055da627bb9c29.tar.gz
MDEV-13384 - misc Windows warnings fixed
Diffstat (limited to 'plugin')
-rw-r--r--plugin/auth_ed25519/server_ed25519.c5
-rw-r--r--plugin/auth_pipe/auth_pipe.c4
-rw-r--r--plugin/feedback/feedback.cc2
-rw-r--r--plugin/feedback/sender_thread.cc2
-rw-r--r--plugin/feedback/utils.cc14
-rw-r--r--plugin/file_key_management/parser.cc4
-rw-r--r--plugin/file_key_management/parser.h3
-rw-r--r--plugin/query_response_time/query_response_time.cc2
-rw-r--r--plugin/server_audit/server_audit.c2
-rw-r--r--plugin/userstat/index_stats.cc6
10 files changed, 22 insertions, 22 deletions
diff --git a/plugin/auth_ed25519/server_ed25519.c b/plugin/auth_ed25519/server_ed25519.c
index 88760275b9b..e3f00409ae3 100644
--- a/plugin/auth_ed25519/server_ed25519.c
+++ b/plugin/auth_ed25519/server_ed25519.c
@@ -33,7 +33,6 @@ static int loaded= 0;
static int auth(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
{
- unsigned int i;
int pkt_len;
unsigned long nonce[CRYPTO_LONGS + NONCE_LONGS];
unsigned char *pkt, *reply= (unsigned char*)nonce;
@@ -51,8 +50,8 @@ static int auth(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
info->password_used= PASSWORD_USED_YES;
/* prepare random nonce */
- for (i=CRYPTO_LONGS; i < CRYPTO_LONGS + NONCE_LONGS; i++)
- nonce[i]= thd_rnd(info->thd) * ~0UL;
+ if (my_random_bytes((unsigned char *)nonce, (int)sizeof(nonce)))
+ return CR_AUTH_USER_CREDENTIALS;
/* send it */
if (vio->write_packet(vio, reply + CRYPTO_BYTES, NONCE_BYTES))
diff --git a/plugin/auth_pipe/auth_pipe.c b/plugin/auth_pipe/auth_pipe.c
index 20c33c07e84..a803653b31a 100644
--- a/plugin/auth_pipe/auth_pipe.c
+++ b/plugin/auth_pipe/auth_pipe.c
@@ -36,7 +36,7 @@ static int pipe_auth(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
unsigned char *pkt;
MYSQL_PLUGIN_VIO_INFO vio_info;
char username[UNLEN + 1];
- size_t username_length;
+ DWORD username_length;
int ret;
/* no user name yet ? read the client handshake packet with the user name */
@@ -54,7 +54,7 @@ static int pipe_auth(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
if (!ImpersonateNamedPipeClient(vio_info.handle))
return CR_ERROR;
- username_length= sizeof(username) - 1;
+ username_length=UNLEN;
ret= CR_ERROR;
if (GetUserName(username, &username_length))
{
diff --git a/plugin/feedback/feedback.cc b/plugin/feedback/feedback.cc
index bd433efa4d3..15a280f34bf 100644
--- a/plugin/feedback/feedback.cc
+++ b/plugin/feedback/feedback.cc
@@ -112,7 +112,7 @@ static COND* make_cond(THD *thd, TABLE_LIST *tables, LEX_STRING *filter)
Item_field *fld= new (thd->mem_root) Item_field(thd, &nrc, db, table,
field);
Item_string *pattern= new (thd->mem_root) Item_string(thd, filter->str,
- filter->length, cs);
+ (uint) filter->length, cs);
Item_string *escape= new (thd->mem_root) Item_string(thd, "\\", 1, cs);
if (!fld || !pattern || !escape)
diff --git a/plugin/feedback/sender_thread.cc b/plugin/feedback/sender_thread.cc
index 4742d5f4920..bcd10f6713f 100644
--- a/plugin/feedback/sender_thread.cc
+++ b/plugin/feedback/sender_thread.cc
@@ -238,7 +238,7 @@ static void send_report(const char *when)
Url *url= todo[i];
if (thd) // for nicer SHOW PROCESSLIST
- thd->set_query(const_cast<char*>(url->url()), url->url_length());
+ thd->set_query(const_cast<char*>(url->url()), (uint) url->url_length());
if (url->send(str.ptr(), str.length()))
i++;
diff --git a/plugin/feedback/utils.cc b/plugin/feedback/utils.cc
index 0805a6e1d76..b5b9d412f05 100644
--- a/plugin/feedback/utils.cc
+++ b/plugin/feedback/utils.cc
@@ -151,7 +151,7 @@ namespace feedback {
*/
#define INSERT2(NAME,LEN,VALUE) \
do { \
- table->field[0]->store(NAME, LEN, system_charset_info); \
+ table->field[0]->store(NAME, (uint) LEN, system_charset_info); \
table->field[1]->store VALUE; \
if (schema_table_store_record(thd, table)) \
return 1; \
@@ -159,7 +159,7 @@ namespace feedback {
#define INSERT1(NAME,VALUE) \
do { \
- table->field[0]->store(NAME, sizeof(NAME)-1, system_charset_info); \
+ table->field[0]->store(NAME, (uint) sizeof(NAME)-1, system_charset_info); \
table->field[1]->store VALUE; \
if (schema_table_store_record(thd, table)) \
return 1; \
@@ -186,7 +186,7 @@ static my_bool show_plugins(THD *thd, plugin_ref plugin, void *arg)
(plugin_decl(plugin)->version) & 0xff);
INSERT2(name, name_len,
- (version, version_len, system_charset_info));
+ (version, (uint)version_len, system_charset_info));
name_len= my_snprintf(name, sizeof(name), "%s used",
plugin_name(plugin)->str);
@@ -358,10 +358,10 @@ int fill_linux_info(THD *thd, TABLE_LIST *tables)
#ifdef HAVE_SYS_UTSNAME_H
if (have_ubuf)
{
- INSERT1("Uname_sysname", (ubuf.sysname, strlen(ubuf.sysname), cs));
- INSERT1("Uname_release", (ubuf.release, strlen(ubuf.release), cs));
- INSERT1("Uname_version", (ubuf.version, strlen(ubuf.version), cs));
- INSERT1("Uname_machine", (ubuf.machine, strlen(ubuf.machine), cs));
+ INSERT1("Uname_sysname", (ubuf.sysname, (uint) strlen(ubuf.sysname), cs));
+ INSERT1("Uname_release", (ubuf.release, (uint) strlen(ubuf.release), cs));
+ INSERT1("Uname_version", (ubuf.version, (uint) strlen(ubuf.version), cs));
+ INSERT1("Uname_machine", (ubuf.machine, (uint) strlen(ubuf.machine), cs));
}
#endif
diff --git a/plugin/file_key_management/parser.cc b/plugin/file_key_management/parser.cc
index ac78186a488..4700788bf83 100644
--- a/plugin/file_key_management/parser.cc
+++ b/plugin/file_key_management/parser.cc
@@ -230,9 +230,9 @@ bool Parser::parse_file(std::map<uint,keyentry> *keys, const char *secret)
return 0;
}
-void Parser::report_error(const char *reason, uint position)
+void Parser::report_error(const char *reason, size_t position)
{
- my_printf_error(EE_READ, "%s at %s line %u, column %u",
+ my_printf_error(EE_READ, "%s at %s line %u, column %zu",
ME_ERROR_LOG, reason, filename, line_number, position + 1);
}
diff --git a/plugin/file_key_management/parser.h b/plugin/file_key_management/parser.h
index 627b7fd84a6..044be0f5b95 100644
--- a/plugin/file_key_management/parser.h
+++ b/plugin/file_key_management/parser.h
@@ -23,6 +23,7 @@ Created 09/15/2014
#include <my_crypt.h>
#include <ctype.h>
#include <map>
+#include <stdlib.h> /* size_t */
struct keyentry {
unsigned int id;
@@ -43,7 +44,7 @@ class Parser
unsigned char *key, unsigned char *iv);
bool read_filekey(const char *filekey, char *secret);
bool parse_file(std::map<unsigned int ,keyentry> *keys, const char *secret);
- void report_error(const char *reason, unsigned int position);
+ void report_error(const char *reason, size_t position);
int parse_line(char **line_ptr, keyentry *key);
char* read_and_decrypt_file(const char *secret);
diff --git a/plugin/query_response_time/query_response_time.cc b/plugin/query_response_time/query_response_time.cc
index 10b9391d9da..5d6119d20ef 100644
--- a/plugin/query_response_time/query_response_time.cc
+++ b/plugin/query_response_time/query_response_time.cc
@@ -221,7 +221,7 @@ public:
print_time(total, sizeof(total), TOTAL_STRING_FORMAT, this->total(i));
}
fields[0]->store(time,strlen(time),system_charset_info);
- fields[1]->store(this->count(i));
+ fields[1]->store((longlong)this->count(i),true);
fields[2]->store(total,strlen(total),system_charset_info);
if (schema_table_store_record(thd, table))
{
diff --git a/plugin/server_audit/server_audit.c b/plugin/server_audit/server_audit.c
index 51f616b9af4..5ecacb79865 100644
--- a/plugin/server_audit/server_audit.c
+++ b/plugin/server_audit/server_audit.c
@@ -1423,7 +1423,7 @@ static size_t escape_string_hide_passwords(const char *str, unsigned int len,
}
next_s++;
}
- len-= next_s - str;
+ len-= (uint)(next_s - str);
str= next_s;
continue;
}
diff --git a/plugin/userstat/index_stats.cc b/plugin/userstat/index_stats.cc
index 236130d327f..87e6da63e38 100644
--- a/plugin/userstat/index_stats.cc
+++ b/plugin/userstat/index_stats.cc
@@ -35,11 +35,11 @@ static int index_stats_fill(THD *thd, TABLE_LIST *tables, COND *cond)
index_name_length= (index_stats->index_name_length - schema_name_length -
table_name_length - 3);
- table->field[0]->store(tmp_table.db, schema_name_length,
+ table->field[0]->store(tmp_table.db, (uint)schema_name_length,
system_charset_info);
- table->field[1]->store(tmp_table.table_name, table_name_length,
+ table->field[1]->store(tmp_table.table_name, (uint) table_name_length,
system_charset_info);
- table->field[2]->store(index_name, index_name_length, system_charset_info);
+ table->field[2]->store(index_name, (uint) index_name_length, system_charset_info);
table->field[3]->store((longlong)index_stats->rows_read, TRUE);
if (schema_table_store_record(thd, table))