diff options
author | Sergei Golubchik <serg@mariadb.org> | 2017-07-08 09:56:28 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2017-07-08 09:56:28 +0200 |
commit | c9801135c10d132304b03195b0b0ea0141347a45 (patch) | |
tree | 38e50be2f2a0089dbfecc1d14140953ded9149b7 /client | |
parent | 5789934fda10aeba1ea2a562e503767e950a322d (diff) | |
parent | 9e11e055ce1461caecbb30e8300dfdcd48af22f1 (diff) | |
download | mariadb-git-c9801135c10d132304b03195b0b0ea0141347a45.tar.gz |
Merge branch '10.1' into 10.2
Diffstat (limited to 'client')
-rw-r--r-- | client/mysql.cc | 5 | ||||
-rw-r--r-- | client/mysql_upgrade.c | 2 | ||||
-rw-r--r-- | client/mysqldump.c | 5 | ||||
-rw-r--r-- | client/mysqlimport.c | 2 | ||||
-rw-r--r-- | client/mysqltest.cc | 5 |
5 files changed, 11 insertions, 8 deletions
diff --git a/client/mysql.cc b/client/mysql.cc index d81d8abfcfd..213cdfd0e8d 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -4805,10 +4805,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 2028606cd5a..c8ebd2217a3 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); @@ -5485,7 +5484,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 092ae555318..38b2eb5f672 100644 --- a/client/mysqlimport.c +++ b/client/mysqlimport.c @@ -677,7 +677,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 66e17673f08..f8f9721d583 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -602,7 +602,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(char *val, int len); +void fix_win_paths(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); @@ -2652,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); @@ -7468,7 +7469,7 @@ void free_win_path_patterns() => all \ from c:\mysql\m... until next space is converted into / */ -void fix_win_paths(char *val, int len) +void fix_win_paths(char *val, size_t len) { #ifdef _WIN32 uint i; |