Skip to content

Commit

Permalink
Merge of mysql-5.1-bugteam into mysql-trunk-merge.
Browse files Browse the repository at this point in the history
--BZR--
revision-id: [email protected]
property-branch-nick: mysql-trunk-merge
testament3-sha1: 50343a014c5cc623dd06320898633a67f7f08020
  • Loading branch information
Davi Arnaut authored and Davi Arnaut committed Jul 2, 2010
2 parents 0ab37eb + ace4992 commit 780d7cf
Show file tree
Hide file tree
Showing 61 changed files with 260 additions and 365 deletions.
Binary file modified .bzrfileids
Binary file not shown.
13 changes: 5 additions & 8 deletions BUILD/SETUP.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,22 +90,19 @@ SSL_LIBRARY=--with-ssl

if [ "x$warning_mode" != "xpedantic" ]; then
# Both C and C++ warnings
warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W"
warnings="$warnings -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare"
warnings="$warnings -Wwrite-strings -Wunused-function -Wunused-label -Wunused-value -Wunused-variable"
warnings="-Wall -Wextra -Wunused -Wwrite-strings"

# For more warnings, uncomment the following line
# warnings="$global_warnings -Wshadow"
# warnings="$warnings -Wshadow"

# C warnings
c_warnings="$warnings -Wunused-parameter"
c_warnings="$warnings"
# C++ warnings
cxx_warnings="$warnings"
cxx_warnings="$warnings -Wno-unused-parameter"
# cxx_warnings="$cxx_warnings -Woverloaded-virtual -Wsign-promo"
cxx_warnings="$cxx_warnings -Wreorder"
cxx_warnings="$cxx_warnings -Wctor-dtor-privacy -Wnon-virtual-dtor"
# Added unless --with-debug=full
debug_extra_cflags="-O0 -g3 -gdwarf-2" #1 -Wuninitialized"
debug_extra_cflags="-O0 -g3 -gdwarf-2"
else
warnings="-W -Wall -ansi -pedantic -Wno-long-long -Wno-unused -D_POSIX_SOURCE"
c_warnings="$warnings"
Expand Down
117 changes: 62 additions & 55 deletions BUILD/check-cpu
Original file line number Diff line number Diff line change
Expand Up @@ -187,69 +187,76 @@ check_cpu () {
cc=$CC
fi

if test "x$compiler" = "x" ; then
cc_ver=`$cc --version | sed 1q`
cc_verno=`echo $cc_ver | sed -e 's/^.*(GCC)//g; s/[^0-9. ]//g; s/^ *//g; s/ .*//g'`
if test "x$core2" = "xyes" ; then
cpu_arg="core2"
fi

if test "x$compiler" != "x" ; then
return 0
fi

# check if compiler is gcc and dump its version
cc_verno=`$cc -dumpversion 2>/dev/null`
if test "x$?" = "x0" ; then
set -- `echo $cc_verno | tr '.' ' '`
cc_ver="GCC"
cc_major=$1
cc_minor=$2
cc_patch=$3
cc_comp=`expr $cc_major '*' 100 '+' $cc_minor`

case "$cc_ver--$cc_verno" in
*GCC*)
# different gcc backends (and versions) have different CPU flags
case `gcc -dumpmachine` in
i?86-* | x86_64-*)
if test "$cc_comp" -lt 304 ; then
check_cpu_cflags="-mcpu=${cpu_arg}"
elif test "$cc_comp" -ge 402 ; then
check_cpu_cflags="-mtune=native"
else
check_cpu_cflags="-mtune=${cpu_arg}"
fi
;;
ppc-*)
check_cpu_cflags="-mcpu=${cpu_arg} -mtune=${cpu_arg}"
;;
*)
check_cpu_cflags=""
return
;;
esac
;;
2.95.*)
# GCC 2.95 doesn't expose its name in --version output
check_cpu_cflags="-m${cpu_arg}"
;;
*)
check_cpu_cflags=""
return
;;
esac
# now we check whether the compiler really understands the cpu type
touch __test.c

while [ "$cpu_arg" ] ; do
printf "testing $cpu_arg ... " >&2

# compile check
eval "$cc -c $check_cpu_cflags __test.c" 2>/dev/null
if test "x$?" = "x0" ; then
echo ok >&2
break;
fi
fi

echo failed >&2
case "$cc_ver--$cc_verno" in
*GCC*)
# different gcc backends (and versions) have different CPU flags
case `gcc -dumpmachine` in
i?86-* | x86_64-*)
if test "$cc_comp" -lt 304 ; then
check_cpu_cflags="-mcpu=${cpu_arg}"
elif test "$cc_comp" -ge 402 ; then
check_cpu_cflags="-mtune=native"
else
check_cpu_cflags="-mtune=${cpu_arg}"
fi
;;
ppc-*)
check_cpu_cflags="-mcpu=${cpu_arg} -mtune=${cpu_arg}"
;;
*)
check_cpu_cflags=""
return
;;
esac
;;
2.95.*)
# GCC 2.95 doesn't expose its name in --version output
check_cpu_cflags="-m${cpu_arg}"
;;
*)
check_cpu_cflags=""
return
;;
esac

# now we check whether the compiler really understands the cpu type
touch __test.c

while [ "$cpu_arg" ] ; do
printf "testing $cpu_arg ... " >&2

# compile check
eval "$cc -c $check_cpu_cflags __test.c" 2>/dev/null
if test "x$?" = "x0" ; then
echo ok >&2
break;
done
rm __test.*
fi
if test "x$core2" = "xyes" ; then
cpu_arg="core2"
fi
fi

echo failed >&2
check_cpu_cflags=""
break;
done
rm __test.*
return 0
}

check_cpu
1 change: 0 additions & 1 deletion client/mysql.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ extern "C" {
#endif
#endif

#undef bcmp // Fix problem with new readline
#if defined(__WIN__)
#include <conio.h>
#elif !defined(__NETWARE__)
Expand Down
21 changes: 9 additions & 12 deletions client/mysqltest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5827,7 +5827,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;
Expand Down Expand Up @@ -6326,7 +6326,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)
Expand Down Expand Up @@ -9421,8 +9421,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)+
Expand Down Expand Up @@ -9550,8 +9549,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);
}


Expand Down Expand Up @@ -9620,17 +9619,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;
}

/****************************************************************************
Expand Down
1 change: 0 additions & 1 deletion cmake/os/WindowsCache.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ SET(HAVE_ASM_MSR_H CACHE INTERNAL "")
SET(HAVE_BACKTRACE CACHE INTERNAL "")
SET(HAVE_BACKTRACE_SYMBOLS CACHE INTERNAL "")
SET(HAVE_BACKTRACE_SYMBOLS_FD CACHE INTERNAL "")
SET(HAVE_BCMP CACHE INTERNAL "")
SET(HAVE_BFILL CACHE INTERNAL "")
SET(HAVE_BMOVE CACHE INTERNAL "")
SET(HAVE_BSD_SIGNALS CACHE INTERNAL "")
Expand Down
2 changes: 1 addition & 1 deletion cmd-line-utils/readline/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ noinst_HEADERS = readline.h chardefs.h keymaps.h \

EXTRA_DIST= emacs_keymap.c vi_keymap.c CMakeLists.txt

DEFS = -DMYSQL_CLIENT_NO_THREADS -DHAVE_CONFIG_H -DNO_KILL_INTR
DEFS = -DMYSQL_CLIENT_NO_THREADS -DHAVE_CONFIG_H -DNO_KILL_INTR -D_GNU_SOURCE=1
1 change: 0 additions & 1 deletion config.h.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@
#cmakedefine HAVE_AIOWAIT 1
#cmakedefine HAVE_ALARM 1
#cmakedefine HAVE_ALLOCA 1
#cmakedefine HAVE_BCMP 1
#cmakedefine HAVE_BFILL 1
#cmakedefine HAVE_BMOVE 1
#cmakedefine HAVE_BZERO 1
Expand Down
1 change: 0 additions & 1 deletion configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ CHECK_FUNCTION_EXISTS (backtrace HAVE_BACKTRACE)
CHECK_FUNCTION_EXISTS (backtrace_symbols HAVE_BACKTRACE_SYMBOLS)
CHECK_FUNCTION_EXISTS (backtrace_symbols_fd HAVE_BACKTRACE_SYMBOLS_FD)
CHECK_FUNCTION_EXISTS (printstack HAVE_PRINTSTACK)
CHECK_FUNCTION_EXISTS (bcmp HAVE_BCMP)
CHECK_FUNCTION_EXISTS (bfill HAVE_BFILL)
CHECK_FUNCTION_EXISTS (bmove HAVE_BMOVE)
CHECK_FUNCTION_EXISTS (bsearch HAVE_BSEARCH)
Expand Down
2 changes: 1 addition & 1 deletion configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -2342,7 +2342,7 @@ MYSQL_TYPE_QSORT
AC_FUNC_UTIME_NULL
AC_FUNC_VPRINTF

AC_CHECK_FUNCS(alarm bcmp bfill bmove bsearch bzero \
AC_CHECK_FUNCS(alarm bfill bmove bsearch bzero \
chsize cuserid fchmod fcntl \
fdatasync fesetround finite fpresetsticky fpsetmask fsync ftruncate \
getcwd gethostbyaddr_r gethostbyname_r getpass getpassphrase getpwnam \
Expand Down
6 changes: 3 additions & 3 deletions extra/comp_err.c
Original file line number Diff line number Diff line change
Expand Up @@ -665,9 +665,9 @@ static struct message *find_message(struct errors *err, const char *lang,
static ha_checksum checksum_format_specifier(const char* msg)
{
ha_checksum chksum= 0;
const char* p= msg;
const char* start= 0;
int num_format_specifiers= 0;
const uchar* p= (const uchar*) msg;
const uchar* start= NULL;
uint32 num_format_specifiers= 0;
while (*p)
{

Expand Down
12 changes: 6 additions & 6 deletions extra/replace.c
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ static 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= (my_bool) (!bcmp(pos,"\\^",3) ? 2 : 1);
rep_str[i].found= (my_bool) (!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)+
Expand Down Expand Up @@ -776,8 +776,8 @@ static void copy_bits(REP_SET *to,REP_SET *from)

static 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);
}


Expand Down Expand Up @@ -849,14 +849,14 @@ static short find_found(FOUND_SET *found_set,uint table_offset,

static uint start_at_word(char * pos)
{
return (((!bcmp(pos,"\\b",2) && pos[2]) || !bcmp(pos,"\\^",2)) ? 1 : 0);
return (((!memcmp(pos,"\\b",2) && pos[2]) || !memcmp(pos,"\\^",2)) ? 1 : 0);
}

static uint end_of_word(char * pos)
{
char * end=strend(pos);
return ((end > pos+2 && !bcmp(end-2,"\\b",2)) ||
(end >= pos+2 && !bcmp(end-2,"\\$",2))) ?
return ((end > pos+2 && !memcmp(end-2,"\\b",2)) ||
(end >= pos+2 && !memcmp(end-2,"\\$",2))) ?
1 : 0;
}

Expand Down
5 changes: 3 additions & 2 deletions extra/yassl/src/crypto_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -953,8 +953,9 @@ x509* PemToDer(FILE* file, CertType type, EncryptedInfo* info)
info->set = true;
}
}
fgets(line,sizeof(line), file); // get blank line
begin = ftell(file);
// get blank line
if (fgets(line, sizeof(line), file))
begin = ftell(file);
}

}
Expand Down
6 changes: 3 additions & 3 deletions extra/yassl/taocrypt/include/blowfish.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Blowfish : public Mode_BASE {
enum { BLOCK_SIZE = BLOWFISH_BLOCK_SIZE, ROUNDS = 16 };

Blowfish(CipherDir DIR, Mode MODE)
: Mode_BASE(BLOCK_SIZE, DIR, MODE) {}
: Mode_BASE(BLOCK_SIZE, DIR, MODE), sbox_(pbox_ + ROUNDS + 2) {}

#ifdef DO_BLOWFISH_ASM
void Process(byte*, const byte*, word32);
Expand All @@ -62,8 +62,8 @@ class Blowfish : public Mode_BASE {
static const word32 p_init_[ROUNDS + 2];
static const word32 s_init_[4 * 256];

word32 pbox_[ROUNDS + 2];
word32 sbox_[4 * 256];
word32 pbox_[ROUNDS + 2 + 4 * 256];
word32* sbox_;

void crypt_block(const word32 in[2], word32 out[2]) const;
void AsmProcess(const byte* in, byte* out) const;
Expand Down
16 changes: 2 additions & 14 deletions extra/yassl/taocrypt/include/runtime.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@

// Handler for pure virtual functions
namespace __Crun {
static void pure_error(void)
{
assert("Pure virtual method called." == "Aborted");
}
void pure_error(void);
} // namespace __Crun

#endif // __sun
Expand All @@ -54,16 +51,7 @@ extern "C" {
#else
#include "kernelc.hpp"
#endif

/* Disallow inline __cxa_pure_virtual() */
static int __cxa_pure_virtual() __attribute__((noinline, used));
static int __cxa_pure_virtual()
{
// oops, pure virtual called!
assert(!"Pure virtual method called. Aborted");
return 0;
}

int __cxa_pure_virtual () __attribute__ ((weak));
} // extern "C"

#endif // __GNUC__ > 2
Expand Down
3 changes: 2 additions & 1 deletion extra/yassl/taocrypt/src/aes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void AES::Process(byte* out, const byte* in, word32 sz)
out += BLOCK_SIZE;
in += BLOCK_SIZE;
}
else if (mode_ == CBC)
else if (mode_ == CBC) {
if (dir_ == ENCRYPTION)
while (blocks--) {
r_[0] ^= *(word32*)in;
Expand All @@ -78,6 +78,7 @@ void AES::Process(byte* out, const byte* in, word32 sz)
out += BLOCK_SIZE;
in += BLOCK_SIZE;
}
}
}

#endif // DO_AES_ASM
Expand Down
Loading

0 comments on commit 780d7cf

Please sign in to comment.