summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2017-10-04 08:24:06 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2017-10-04 08:24:06 +0300
commit2c1067166d7e8a9541578220b408f1e553e23916 (patch)
tree2ba0932f92d88e01d51393de63dda842f6daf320 /client
parent2cf3e2ea2fca3d3613309de94d55c88dedb3831a (diff)
parent61b2618d3aae78950f1b8dbe8d4482573c77875d (diff)
downloadmariadb-git-2c1067166d7e8a9541578220b408f1e553e23916.tar.gz
Merge bb-10.2-ext into 10.3
Diffstat (limited to 'client')
-rw-r--r--client/mysql_upgrade.c2
-rw-r--r--client/mysqlbinlog.cc2
-rw-r--r--client/mysqldump.c10
-rw-r--r--client/mysqlslap.c6
-rw-r--r--client/mysqltest.cc26
5 files changed, 24 insertions, 22 deletions
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index 8163596653b..a6215d0a977 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -501,7 +501,7 @@ static void find_tool(char *tool_executable_name, const char *tool_name,
last_fn_libchar -= 6;
}
- len= last_fn_libchar - self_name;
+ len= (int)(last_fn_libchar - self_name);
my_snprintf(tool_executable_name, FN_REFLEN, "%.*s%c%s",
len, self_name, FN_LIBCHAR, tool_name);
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index b0b0111c865..30d00706a9f 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -607,7 +607,7 @@ Exit_status Load_log_processor::process_first_event(const char *bname,
Exit_status Load_log_processor::process(Create_file_log_event *ce)
{
const char *bname= ce->fname + dirname_length(ce->fname);
- uint blen= ce->fname_len - (bname-ce->fname);
+ size_t blen= ce->fname_len - (bname-ce->fname);
return process_first_event(bname, blen, ce->block, ce->block_len,
ce->file_id, ce);
diff --git a/client/mysqldump.c b/client/mysqldump.c
index c8ebd2217a3..a260065c64c 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -247,8 +247,8 @@ static struct my_option my_long_options[] =
&opt_slave_apply, &opt_slave_apply, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR,
- "Directory for character set files.", &charsets_dir,
- &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ "Directory for character set files.", (char **)&charsets_dir,
+ (char **)&charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"comments", 'i', "Write additional information.",
&opt_comments, &opt_comments, 0, GET_BOOL, NO_ARG,
1, 0, 0, 0, 0, 0},
@@ -285,8 +285,8 @@ static struct my_option my_long_options[] =
{"debug", '#', "This is a non-debug version. Catch this and exit.",
0,0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0},
#else
- {"debug", '#', "Output debug log.", &default_dbug_option,
- &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+ {"debug", '#', "Output debug log.", (char *)&default_dbug_option,
+ (char *)&default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit.",
&debug_check_flag, &debug_check_flag, 0,
@@ -5733,7 +5733,7 @@ static int replace(DYNAMIC_STRING *ds_str,
return 1;
init_dynamic_string_checked(&ds_tmp, "",
ds_str->length + replace_len, 256);
- dynstr_append_mem_checked(&ds_tmp, ds_str->str, start - ds_str->str);
+ dynstr_append_mem_checked(&ds_tmp, ds_str->str, (uint)(start - ds_str->str));
dynstr_append_mem_checked(&ds_tmp, replace_str, replace_len);
dynstr_append_checked(&ds_tmp, start + search_len);
dynstr_set_checked(ds_str, ds_tmp.str);
diff --git a/client/mysqlslap.c b/client/mysqlslap.c
index a78bf35d51b..60e0939491c 100644
--- a/client/mysqlslap.c
+++ b/client/mysqlslap.c
@@ -587,8 +587,8 @@ static struct my_option my_long_options[] =
&auto_generate_sql_number, &auto_generate_sql_number,
0, GET_ULL, REQUIRED_ARG, 100, 0, 0, 0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR,
- "Directory for character set files.", &charsets_dir,
- &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ "Directory for character set files.", (char **)&charsets_dir,
+ (char **)&charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"commit", OPT_SLAP_COMMIT, "Commit records every X number of statements.",
&commit_rate, &commit_rate, 0, GET_UINT, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
@@ -817,7 +817,7 @@ get_random_string(char *buf)
DBUG_ENTER("get_random_string");
for (x= RAND_STRING_SIZE; x > 0; x--)
*buf_ptr++= ALPHANUMERICS[random() % ALPHANUMERICS_SIZE];
- DBUG_RETURN(buf_ptr - buf);
+ DBUG_RETURN((uint)(buf_ptr - buf));
}
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 84d3164baa3..914c0ac8621 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -767,7 +767,7 @@ public:
if (show_from != buf)
{
// The last new line was found in this buf, adjust offset
- show_offset+= (show_from - buf) + 1;
+ show_offset+= (int)(show_from - buf) + 1;
DBUG_PRINT("info", ("adjusted offset to %d", show_offset));
}
DBUG_PRINT("info", ("show_offset: %d", show_offset));
@@ -2700,7 +2700,7 @@ void var_query_set(VAR *var, const char *query, const char** query_end)
DBUG_ASSERT(query_end);
memset(&command, 0, sizeof(command));
command.query= (char*)query;
- command.first_word_len= (*query_end - query);
+ command.first_word_len= (int)(*query_end - query);
command.first_argument= command.query + command.first_word_len;
command.end= (char*)*query_end;
command.abort_on_error= 1; /* avoid uninitialized variables */
@@ -6530,7 +6530,7 @@ void do_delimiter(struct st_command* command)
if (!(*p))
die("Can't set empty delimiter");
- delimiter_length= strmake_buf(delimiter, p) - delimiter;
+ delimiter_length= (uint)(strmake_buf(delimiter, p) - delimiter);
DBUG_PRINT("exit", ("delimiter: %s", delimiter));
command->last_argument= p + delimiter_length;
@@ -7016,7 +7016,7 @@ int read_command(struct st_command** command_ptr)
command->first_argument= p;
command->end= strend(command->query);
- command->query_len= (command->end - command->query);
+ command->query_len= (int)(command->end - command->query);
parser.read_lines++;
DBUG_RETURN(0);
}
@@ -7561,7 +7561,7 @@ void fix_win_paths(char *val, size_t len)
DBUG_PRINT("info", ("Converted \\ to /, p: %s", p));
}
}
- DBUG_PRINT("exit", (" val: %s, len: %d", val, len));
+ DBUG_PRINT("exit", (" val: %s, len: %zu", val, len));
DBUG_VOID_RETURN;
#endif
}
@@ -7573,7 +7573,7 @@ void fix_win_paths(char *val, size_t len)
*/
void append_field(DYNAMIC_STRING *ds, uint col_idx, MYSQL_FIELD* field,
- char* val, ulonglong len, my_bool is_null)
+ char* val, size_t len, my_bool is_null)
{
char null[]= "NULL";
@@ -8569,7 +8569,7 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
if (flags & QUERY_PRINT_ORIGINAL_FLAG)
{
print_query= command->query;
- print_len= command->end - command->query;
+ print_len= (int)(command->end - command->query);
}
replace_dynstr_append_mem(ds, print_query, print_len);
dynstr_append_mem(ds, delimiter, delimiter_length);
@@ -10266,7 +10266,7 @@ void free_replace_regex()
*/
#define SECURE_REG_BUF if (buf_len < need_buf_len) \
{ \
- int off= res_p - buf; \
+ ssize_t off= res_p - buf; \
buf= (char*)my_realloc(buf,need_buf_len,MYF(MY_WME+MY_FAE)); \
res_p= buf + off; \
buf_len= need_buf_len; \
@@ -10291,13 +10291,15 @@ int reg_replace(char** buf_p, int* buf_len_p, char *pattern,
regmatch_t *subs;
char *replace_end;
char *buf= *buf_p;
- int len;
- int buf_len, need_buf_len;
+ size_t len;
+ size_t buf_len, need_buf_len;
int cflags= REG_EXTENDED | REG_DOTALL;
int err_code;
char *res_p,*str_p,*str_end;
- buf_len= *buf_len_p;
+ DBUG_ASSERT(*buf_len_p > 0);
+
+ buf_len= (size_t)*buf_len_p;
len= strlen(string);
str_end= string + len;
@@ -10440,7 +10442,7 @@ int reg_replace(char** buf_p, int* buf_len_p, char *pattern,
}
else /* no match this time, just copy the string as is */
{
- int left_in_str= str_end-str_p;
+ size_t left_in_str= str_end-str_p;
need_buf_len= (res_p-buf) + left_in_str;
SECURE_REG_BUF
memcpy(res_p,str_p,left_in_str);