summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorStaale Smedseng <staale.smedseng@sun.com>2009-08-28 18:21:54 +0200
committerStaale Smedseng <staale.smedseng@sun.com>2009-08-28 18:21:54 +0200
commit5be4c3822691f8bca4c8444ccc77b4b01bc996c1 (patch)
treea1ec5dfbd668a88bc0b6c98db397a421d2b37f21 /client
parent169f7da04c4ffc43355d5a632a8013bc4caea39b (diff)
parent1ba25ae47caace207cda0be2b7994a1a845e6cce (diff)
downloadmariadb-git-5be4c3822691f8bca4c8444ccc77b4b01bc996c1.tar.gz
Merge from 5.0 for 43414
Diffstat (limited to 'client')
-rw-r--r--client/mysql.cc3
-rw-r--r--client/mysql_upgrade.c3
-rw-r--r--client/mysqladmin.cc6
-rw-r--r--client/mysqltest.cc15
4 files changed, 15 insertions, 12 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 1491ff1b059..bafd173343e 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -3819,7 +3819,8 @@ com_edit(String *buffer,char *line __attribute__((unused)))
!(editor = (char *)getenv("VISUAL")))
editor = "vi";
strxmov(buff,editor," ",filename,NullS);
- (void) system(buff);
+ if(system(buff) == -1)
+ goto err;
MY_STAT stat_arg;
if (!my_stat(filename,&stat_arg,MYF(MY_WME)))
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index 645fb037647..cfd7ed4ea56 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -552,6 +552,7 @@ static int upgrade_already_done(void)
FILE *in;
char upgrade_info_file[FN_REFLEN]= {0};
char buf[sizeof(MYSQL_SERVER_VERSION)+1];
+ char *res;
if (get_upgrade_info_file_name(upgrade_info_file))
return 0; /* Could not get filename => not sure */
@@ -564,7 +565,7 @@ static int upgrade_already_done(void)
will be detected by the strncmp
*/
bzero(buf, sizeof(buf));
- fgets(buf, sizeof(buf), in);
+ res= fgets(buf, sizeof(buf), in);
my_fclose(in, MYF(0));
diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc
index a4e7c5ad0c9..299be5a842f 100644
--- a/client/mysqladmin.cc
+++ b/client/mysqladmin.cc
@@ -1036,14 +1036,16 @@ static void usage(void)
static int drop_db(MYSQL *mysql, const char *db)
{
char name_buff[FN_REFLEN+20], buf[10];
+ char *input;
+
if (!option_force)
{
puts("Dropping the database is potentially a very bad thing to do.");
puts("Any data stored in the database will be destroyed.\n");
printf("Do you really want to drop the '%s' database [y/N] ",db);
fflush(stdout);
- VOID(fgets(buf,sizeof(buf)-1,stdin));
- if ((*buf != 'y') && (*buf != 'Y'))
+ input= fgets(buf, sizeof(buf)-1, stdin);
+ if (!input || ((*input != 'y') && (*input != 'Y')))
{
puts("\nOK, aborting database drop!");
return -1;
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 265d3b0a8e7..b9535ba6b05 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -431,10 +431,12 @@ DYNAMIC_STRING ds_res;
char builtin_echo[FN_REFLEN];
+static void cleanup_and_exit(int exit_code) __attribute__((noreturn));
+
void die(const char *fmt, ...)
- ATTRIBUTE_FORMAT(printf, 1, 2);
+ ATTRIBUTE_FORMAT(printf, 1, 2) __attribute__((noreturn));
void abort_not_supported_test(const char *fmt, ...)
- ATTRIBUTE_FORMAT(printf, 1, 2);
+ ATTRIBUTE_FORMAT(printf, 1, 2) __attribute__((noreturn));
void verbose_msg(const char *fmt, ...)
ATTRIBUTE_FORMAT(printf, 1, 2);
void log_msg(const char *fmt, ...)
@@ -3705,10 +3707,9 @@ void do_wait_for_slave_to_stop(struct st_command *c __attribute__((unused)))
MYSQL* mysql = &cur_con->mysql;
for (;;)
{
- MYSQL_RES *res;
+ MYSQL_RES *UNINIT_VAR(res);
MYSQL_ROW row;
int done;
- LINT_INIT(res);
if (mysql_query(mysql,"show status like 'Slave_running'") ||
!(res=mysql_store_result(mysql)))
@@ -5240,13 +5241,12 @@ my_bool end_of_query(int c)
int read_line(char *buf, int size)
{
- char c, last_quote;
+ char c, UNINIT_VAR(last_quote);
char *p= buf, *buf_end= buf + size - 1;
int skip_char= 0;
enum {R_NORMAL, R_Q, R_SLASH_IN_Q,
R_COMMENT, R_LINE_START} state= R_LINE_START;
DBUG_ENTER("read_line");
- LINT_INIT(last_quote);
start_lineno= cur_file->lineno;
DBUG_PRINT("info", ("Starting to read at lineno: %d", start_lineno));
@@ -6478,8 +6478,7 @@ void run_query_normal(struct st_connection *cn, struct st_command *command,
if (!disable_result_log)
{
- ulonglong affected_rows; /* Ok to be undef if 'disable_info' is set */
- LINT_INIT(affected_rows);
+ ulonglong UNINIT_VAR(affected_rows); /* Ok to be undef if 'disable_info' is set */
if (res)
{