summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-07-07 11:30:03 +0200
committerSergei Golubchik <serg@mariadb.org>2017-07-07 11:30:03 +0200
commit9e11e055ce1461caecbb30e8300dfdcd48af22f1 (patch)
tree48f5dc07a29e44a106c37e7e8e3234c62abbebf6 /client
parent2b5c9bc2c813ea7963959e515da5d60392c35431 (diff)
parent6b99859fff6b8c0a52ea45965834c9c3fdfc4cb3 (diff)
downloadmariadb-git-9e11e055ce1461caecbb30e8300dfdcd48af22f1.tar.gz
Merge branch '10.0' into 10.1
Diffstat (limited to 'client')
-rw-r--r--client/mysql.cc5
-rw-r--r--client/mysql_upgrade.c2
-rw-r--r--client/mysqldump.c5
-rw-r--r--client/mysqlimport.c2
-rw-r--r--client/mysqltest.cc10
5 files changed, 13 insertions, 11 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 0a0fca286e1..28d781aff8b 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -4798,10 +4798,11 @@ com_status(String *buffer __attribute__((unused)),
tee_fprintf(stdout, "Protocol:\t\tCompressed\n");
#endif
- if ((status_str= mysql_stat(&mysql)) && !mysql_error(&mysql)[0])
+ const char *pos;
+ if ((status_str= mysql_stat(&mysql)) && !mysql_error(&mysql)[0] &&
+ (pos= strchr(status_str,' ')))
{
ulong sec;
- const char *pos= strchr(status_str,' ');
/* print label */
tee_fprintf(stdout, "%.*s\t\t\t", (int) (pos-status_str), status_str);
if ((status_str= str2int(pos,10,0,LONG_MAX,(long*) &sec)))
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index 4e4970bacab..c10dc20e7d7 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -1171,6 +1171,8 @@ int main(int argc, char **argv)
{
int fd= create_temp_file(cnf_file_path, opt_tmpdir[0] ? opt_tmpdir : NULL,
"mysql_upgrade-", O_CREAT | O_WRONLY, MYF(MY_FAE));
+ if (fd < 0)
+ die(NULL);
my_write(fd, USTRING_WITH_LEN( "[client]\n"), MYF(MY_FAE));
my_write(fd, (uchar*)ds_args.str, ds_args.length, MYF(MY_FAE));
my_close(fd, MYF(0));
diff --git a/client/mysqldump.c b/client/mysqldump.c
index ca47f89268e..aead4caf506 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -92,8 +92,7 @@
static void add_load_option(DYNAMIC_STRING *str, const char *option,
const char *option_value);
-static ulong find_set(TYPELIB *lib, const char *x, size_t length,
- char **err_pos, uint *err_len);
+static ulong find_set(TYPELIB *, const char *, size_t, char **, uint *);
static char *alloc_query_str(ulong size);
static void field_escape(DYNAMIC_STRING* in, const char *from);
@@ -5471,7 +5470,7 @@ static ulong find_set(TYPELIB *lib, const char *x, size_t length,
var_len= (uint) (pos - start);
strmake(buff, start, MY_MIN(sizeof(buff) - 1, var_len));
find= find_type(buff, lib, FIND_TYPE_BASIC);
- if (!find)
+ if (find <= 0)
{
*err_pos= (char*) start;
*err_len= var_len;
diff --git a/client/mysqlimport.c b/client/mysqlimport.c
index 216359c82ec..7f03cb355f8 100644
--- a/client/mysqlimport.c
+++ b/client/mysqlimport.c
@@ -675,7 +675,7 @@ int main(int argc, char **argv)
MYF(0))))
return -2;
- for (counter= 0; *argv != NULL; argv++) /* Loop through tables */
+ for (; *argv != NULL; argv++) /* Loop through tables */
{
pthread_mutex_lock(&counter_mutex);
while (counter == opt_use_threads)
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 504eadcf2a8..99e4e4dfc66 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -600,7 +600,7 @@ void do_eval(DYNAMIC_STRING *query_eval, const char *query,
void str_to_file(const char *fname, char *str, int size);
void str_to_file2(const char *fname, char *str, int size, my_bool append);
-void fix_win_paths(const char *val, int len);
+void fix_win_paths(const char *val, size_t len);
const char *get_errname_from_code (uint error_code);
int multi_reg_replace(struct st_replace_regex* r,char* val);
@@ -814,8 +814,7 @@ public:
LogFile log_file;
LogFile progress_file;
-void replace_dynstr_append_mem(DYNAMIC_STRING *ds, const char *val,
- int len);
+void replace_dynstr_append_mem(DYNAMIC_STRING *ds, const char *val, size_t len);
void replace_dynstr_append(DYNAMIC_STRING *ds, const char *val);
void replace_dynstr_append_uint(DYNAMIC_STRING *ds, uint val);
void dynstr_append_sorted(DYNAMIC_STRING* ds, DYNAMIC_STRING* ds_input,
@@ -2653,6 +2652,7 @@ void var_query_set(VAR *var, const char *query, const char** query_end)
if (!mysql)
{
struct st_command command;
+ DBUG_ASSERT(query_end);
memset(&command, 0, sizeof(command));
command.query= (char*)query;
command.first_word_len= (*query_end - query);
@@ -7488,7 +7488,7 @@ void free_win_path_patterns()
=> all \ from c:\mysql\m... until next space is converted into /
*/
-void fix_win_paths(const char *val, int len)
+void fix_win_paths(const char *val, size_t len)
{
uint i;
char *p;
@@ -11013,7 +11013,7 @@ void free_pointer_array(POINTER_ARRAY *pa)
/* Append the string to ds, with optional replace */
void replace_dynstr_append_mem(DYNAMIC_STRING *ds,
- const char *val, int len)
+ const char *val, size_t len)
{
char lower[512];
#ifdef __WIN__