summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2010-08-27 17:12:44 +0300
committerMichael Widenius <monty@askmonty.org>2010-08-27 17:12:44 +0300
commitad6d95d3cb420557cfc7efa658181a8d20b4c154 (patch)
tree984bb45ca187a6cc38c7132a9600d91515df564e /client
parent9bc9855c16f815e71223398ef17cd6052becc44e (diff)
parent7909541953de43c7b7d16513c8d612cfe405af67 (diff)
downloadmariadb-git-ad6d95d3cb420557cfc7efa658181a8d20b4c154.tar.gz
Merge with MySQL 5.1.50
- Changed to still use bcmp() in certain cases becasue - Faster for short unaligneed strings than memcmp() - Bettern when using valgrind - Changed to use my_sprintf() instead of sprintf() to get higher portability for old systems - Changed code to use MariaDB version of select->skip_record() - Removed -%::SCCS/s.% from Makefile.am:s to remove automake warnings
Diffstat (limited to 'client')
-rw-r--r--client/Makefile.am3
-rw-r--r--client/mysql.cc4
-rw-r--r--client/mysqlshow.c3
-rw-r--r--client/mysqltest.cc21
4 files changed, 12 insertions, 19 deletions
diff --git a/client/Makefile.am b/client/Makefile.am
index ccd0d8aada0..ad32117ac35 100644
--- a/client/Makefile.am
+++ b/client/Makefile.am
@@ -122,6 +122,3 @@ link_sources:
rm -f $(srcdir)/my_user.c; \
@LN_CP_F@ $(top_srcdir)/sql-common/my_user.c my_user.c;
echo timestamp > link_sources;
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff --git a/client/mysql.cc b/client/mysql.cc
index feb2a19e4f2..f9da1a8737b 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -3655,7 +3655,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)))
@@ -4767,7 +4767,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/mysqlshow.c b/client/mysqlshow.c
index 2c9a59a2d54..698516e0794 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 5e8499f739a..055d8da5097 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -5825,7 +5825,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;
@@ -6322,7 +6322,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)
@@ -9402,8 +9402,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)+
@@ -9531,8 +9530,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);
}
@@ -9601,17 +9600,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;
}
/****************************************************************************