summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorBjorn Munch <bjorn.munch@oracle.com>2010-09-29 12:56:10 +0200
committerBjorn Munch <bjorn.munch@oracle.com>2010-09-29 12:56:10 +0200
commitdae793978a4e445dfc9779bd8ed46ae9d34e1e26 (patch)
tree455f2c5a7579641baacc1f25f0d7454c9c5d954b /client
parent9605bc63fc7fe2d2b188d992ae43d9e97360c782 (diff)
parent69c280506808e434e20669d838724d43b675540c (diff)
downloadmariadb-git-dae793978a4e445dfc9779bd8ed46ae9d34e1e26.tar.gz
merge from 5.1
Diffstat (limited to 'client')
-rw-r--r--client/mysql.cc5
-rw-r--r--client/mysql_upgrade.c5
-rw-r--r--client/mysqlbinlog.cc2
-rw-r--r--client/mysqlcheck.c3
-rw-r--r--client/mysqlshow.c3
-rw-r--r--client/mysqltest.cc21
-rw-r--r--client/sql_string.cc5
7 files changed, 21 insertions, 23 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 14a6ceed51d..5b90f318629 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -93,7 +93,6 @@ extern "C" {
#endif
#endif
-#undef bcmp // Fix problem with new readline
#if defined(__WIN__)
#include <conio.h>
#elif !defined(__NETWARE__)
@@ -3640,7 +3639,7 @@ xmlencode_print(const char *src, uint length)
tee_fputs("NULL", PAGER);
else
{
- for (const char *p = src; length; *p++, length--)
+ for (const char *p = src; length; p++, length--)
{
const char *t;
if ((t = array_value(xmlmeta, *p)))
@@ -4727,7 +4726,7 @@ static const char* construct_prompt()
struct tm *t = localtime(&lclock);
/* parse thru the settings for the prompt */
- for (char *c = current_prompt; *c ; *c++)
+ for (char *c = current_prompt; *c ; c++)
{
if (*c != PROMPT_CHAR)
processed_prompt.append(*c);
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c
index 0b8b43775ed..3122cc25731 100644
--- a/client/mysql_upgrade.c
+++ b/client/mysql_upgrade.c
@@ -595,7 +595,10 @@ static int upgrade_already_done(void)
my_fclose(in, MYF(0));
- return (strncmp(buf, MYSQL_SERVER_VERSION,
+ if (!res)
+ return 0; /* Could not read from file => not sure */
+
+ return (strncmp(res, MYSQL_SERVER_VERSION,
sizeof(MYSQL_SERVER_VERSION)-1)==0);
}
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index 30bdb58153f..dec3f142798 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -437,7 +437,7 @@ Exit_status Load_log_processor::process_first_event(const char *bname,
ptr= fname + target_dir_name_len;
memcpy(ptr,bname,blen);
ptr+= blen;
- ptr+= my_sprintf(ptr, (ptr, "-%x", file_id));
+ ptr+= sprintf(ptr, "-%x", file_id);
if ((file= create_unique_file(fname,ptr)) < 0)
{
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c
index 4183ab1dd5e..78c4b79085e 100644
--- a/client/mysqlcheck.c
+++ b/client/mysqlcheck.c
@@ -703,8 +703,7 @@ static int handle_request_for_tables(char *tables, uint length)
if (opt_all_in_1)
{
/* No backticks here as we added them before */
- query_length= my_sprintf(query,
- (query, "%s TABLE %s %s", op, tables, options));
+ query_length= sprintf(query, "%s TABLE %s %s", op, tables, options);
}
else
{
diff --git a/client/mysqlshow.c b/client/mysqlshow.c
index 2f5582cb668..8c64d61ded2 100644
--- a/client/mysqlshow.c
+++ b/client/mysqlshow.c
@@ -669,8 +669,7 @@ list_fields(MYSQL *mysql,const char *db,const char *table,
char query[1024],*end;
MYSQL_RES *result;
MYSQL_ROW row;
- ulong rows;
- LINT_INIT(rows);
+ ulong UNINIT_VAR(rows);
if (mysql_select_db(mysql,db))
{
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 742ddda6add..89ba739a9ef 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -5904,7 +5904,7 @@ int read_command(struct st_command** command_ptr)
(struct st_command*) my_malloc(sizeof(*command),
MYF(MY_WME|MY_ZEROFILL))) ||
insert_dynamic(&q_lines, (uchar*) &command))
- die(NullS);
+ die("Out of memory");
command->type= Q_UNKNOWN;
read_command_buf[0]= 0;
@@ -6392,7 +6392,7 @@ void init_win_path_patterns()
}
if (insert_dynamic(&patterns, (uchar*) &p))
- die(NullS);
+ die("Out of memory");
DBUG_PRINT("info", ("p: %s", p));
while (*p)
@@ -9460,8 +9460,7 @@ REPLACE *init_replace(char * *from, char * *to,uint count,
for (i=1 ; i <= found_sets ; i++)
{
pos=from[found_set[i-1].table_offset];
- rep_str[i].found= !bcmp((const uchar*) pos,
- (const uchar*) "\\^", 3) ? 2 : 1;
+ rep_str[i].found= !memcmp(pos, "\\^", 3) ? 2 : 1;
rep_str[i].replace_string=to_array[found_set[i-1].table_offset];
rep_str[i].to_offset=found_set[i-1].found_offset-start_at_word(pos);
rep_str[i].from_offset=found_set[i-1].found_offset-replace_len(pos)+
@@ -9589,8 +9588,8 @@ void copy_bits(REP_SET *to,REP_SET *from)
int cmp_bits(REP_SET *set1,REP_SET *set2)
{
- return bcmp((uchar*) set1->bits,(uchar*) set2->bits,
- sizeof(uint) * set1->size_of_bits);
+ return memcmp(set1->bits, set2->bits,
+ sizeof(uint) * set1->size_of_bits);
}
@@ -9659,17 +9658,15 @@ int find_found(FOUND_SET *found_set,uint table_offset, int found_offset)
uint start_at_word(char * pos)
{
- return (((!bcmp((const uchar*) pos, (const uchar*) "\\b",2) && pos[2]) ||
- !bcmp((const uchar*) pos, (const uchar*) "\\^", 2)) ? 1 : 0);
+ return (((!memcmp(pos, "\\b",2) && pos[2]) ||
+ !memcmp(pos, "\\^", 2)) ? 1 : 0);
}
uint end_of_word(char * pos)
{
char * end=strend(pos);
- return ((end > pos+2 && !bcmp((const uchar*) end-2,
- (const uchar*) "\\b", 2)) ||
- (end >= pos+2 && !bcmp((const uchar*) end-2,
- (const uchar*) "\\$",2))) ? 1 : 0;
+ return ((end > pos+2 && !memcmp(end-2, "\\b", 2)) ||
+ (end >= pos+2 && !memcmp(end-2, "\\$",2))) ? 1 : 0;
}
/****************************************************************************
diff --git a/client/sql_string.cc b/client/sql_string.cc
index dc6147b563f..50fb4a5b777 100644
--- a/client/sql_string.cc
+++ b/client/sql_string.cc
@@ -122,7 +122,8 @@ bool String::set(double num,uint decimals, CHARSET_INFO *cs)
str_charset=cs;
if (decimals >= NOT_FIXED_DEC)
{
- uint32 len= my_sprintf(buff,(buff, "%.15g",num));// Enough for a DATETIME
+ // Enough for a DATETIME
+ uint32 len= sprintf(buff, "%.15g", num);
return copy(buff, len, &my_charset_latin1, cs, &dummy_errors);
}
#ifdef HAVE_FCONVERT
@@ -674,7 +675,7 @@ void String::qs_append(const char *str, uint32 len)
void String::qs_append(double d)
{
char *buff = Ptr + str_length;
- str_length+= my_sprintf(buff, (buff, "%.15g", d));
+ str_length+= sprintf(buff, buff, "%.15g", d);
}
void String::qs_append(double *d)