This commit is contained in:
Georgi Kodinov 2010-07-21 18:54:11 +03:00
commit 98357570b4
179 changed files with 2058 additions and 1733 deletions

View File

@ -90,22 +90,19 @@ SSL_LIBRARY=--with-ssl
if [ "x$warning_mode" != "xpedantic" ]; then if [ "x$warning_mode" != "xpedantic" ]; then
# Both C and C++ warnings # Both C and C++ warnings
warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W" warnings="-Wall -Wextra -Wunused -Wwrite-strings"
warnings="$warnings -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare"
warnings="$warnings -Wwrite-strings -Wunused-function -Wunused-label -Wunused-value -Wunused-variable"
# For more warnings, uncomment the following line # For more warnings, uncomment the following line
# warnings="$global_warnings -Wshadow" # warnings="$warnings -Wshadow"
# C warnings # C warnings
c_warnings="$warnings -Wunused-parameter" c_warnings="$warnings"
# C++ warnings # C++ warnings
cxx_warnings="$warnings" cxx_warnings="$warnings -Wno-unused-parameter"
# cxx_warnings="$cxx_warnings -Woverloaded-virtual -Wsign-promo" # cxx_warnings="$cxx_warnings -Woverloaded-virtual -Wsign-promo"
cxx_warnings="$cxx_warnings -Wreorder"
cxx_warnings="$cxx_warnings -Wctor-dtor-privacy -Wnon-virtual-dtor" cxx_warnings="$cxx_warnings -Wctor-dtor-privacy -Wnon-virtual-dtor"
# Added unless --with-debug=full # Added unless --with-debug=full
debug_extra_cflags="-O0 -g3 -gdwarf-2" #1 -Wuninitialized" debug_extra_cflags="-O0 -g3 -gdwarf-2"
else else
warnings="-W -Wall -ansi -pedantic -Wno-long-long -Wno-unused -D_POSIX_SOURCE" warnings="-W -Wall -ansi -pedantic -Wno-long-long -Wno-unused -D_POSIX_SOURCE"
c_warnings="$warnings" c_warnings="$warnings"

View File

@ -181,13 +181,16 @@ check_cpu () {
cc=$CC cc=$CC
fi fi
cc_ver=`$cc --version | sed 1q` # check if compiler is gcc and dump its version
cc_verno=`echo $cc_ver | sed -e 's/^.*(GCC)//g; s/[^0-9. ]//g; s/^ *//g; s/ .*//g'` cc_verno=`$cc -dumpversion 2>/dev/null`
if test "x$?" = "x0" ; then
set -- `echo $cc_verno | tr '.' ' '` set -- `echo $cc_verno | tr '.' ' '`
cc_ver="GCC"
cc_major=$1 cc_major=$1
cc_minor=$2 cc_minor=$2
cc_patch=$3 cc_patch=$3
cc_comp=`expr $cc_major '*' 100 '+' $cc_minor` cc_comp=`expr $cc_major '*' 100 '+' $cc_minor`
fi
case "$cc_ver--$cc_verno" in case "$cc_ver--$cc_verno" in
*GCC*) *GCC*)

View File

@ -314,7 +314,7 @@ abi_check_all: $(TEST_PREPROCESSOR_HEADER)
do_abi_check: do_abi_check:
set -ex; \ set -ex; \
for file in $(abi_headers); do \ for file in $(abi_headers); do \
@CC@ -E -nostdinc -dI \ @CC@ -E -nostdinc -dI -DMYSQL_ABI_CHECK \
-I$(top_srcdir)/include \ -I$(top_srcdir)/include \
-I$(top_srcdir)/include/mysql \ -I$(top_srcdir)/include/mysql \
-I$(top_srcdir)/sql \ -I$(top_srcdir)/sql \

View File

@ -93,7 +93,6 @@ extern "C" {
#endif #endif
#endif #endif
#undef bcmp // Fix problem with new readline
#if defined(__WIN__) #if defined(__WIN__)
#include <conio.h> #include <conio.h>
#elif !defined(__NETWARE__) #elif !defined(__NETWARE__)
@ -3640,7 +3639,7 @@ xmlencode_print(const char *src, uint length)
tee_fputs("NULL", PAGER); tee_fputs("NULL", PAGER);
else else
{ {
for (const char *p = src; length; *p++, length--) for (const char *p = src; length; p++, length--)
{ {
const char *t; const char *t;
if ((t = array_value(xmlmeta, *p))) if ((t = array_value(xmlmeta, *p)))
@ -4727,7 +4726,7 @@ static const char* construct_prompt()
struct tm *t = localtime(&lclock); struct tm *t = localtime(&lclock);
/* parse thru the settings for the prompt */ /* 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) if (*c != PROMPT_CHAR)
processed_prompt.append(*c); processed_prompt.append(*c);

View File

@ -595,7 +595,10 @@ static int upgrade_already_done(void)
my_fclose(in, MYF(0)); 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); sizeof(MYSQL_SERVER_VERSION)-1)==0);
} }

View File

@ -437,7 +437,7 @@ Exit_status Load_log_processor::process_first_event(const char *bname,
ptr= fname + target_dir_name_len; ptr= fname + target_dir_name_len;
memcpy(ptr,bname,blen); memcpy(ptr,bname,blen);
ptr+= 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) if ((file= create_unique_file(fname,ptr)) < 0)
{ {

View File

@ -703,8 +703,7 @@ static int handle_request_for_tables(char *tables, uint length)
if (opt_all_in_1) if (opt_all_in_1)
{ {
/* No backticks here as we added them before */ /* No backticks here as we added them before */
query_length= my_sprintf(query, query_length= sprintf(query, "%s TABLE %s %s", op, tables, options);
(query, "%s TABLE %s %s", op, tables, options));
} }
else else
{ {

View File

@ -669,8 +669,7 @@ list_fields(MYSQL *mysql,const char *db,const char *table,
char query[1024],*end; char query[1024],*end;
MYSQL_RES *result; MYSQL_RES *result;
MYSQL_ROW row; MYSQL_ROW row;
ulong rows; ulong UNINIT_VAR(rows);
LINT_INIT(rows);
if (mysql_select_db(mysql,db)) if (mysql_select_db(mysql,db))
{ {

View File

@ -5780,7 +5780,7 @@ int read_command(struct st_command** command_ptr)
(struct st_command*) my_malloc(sizeof(*command), (struct st_command*) my_malloc(sizeof(*command),
MYF(MY_WME|MY_ZEROFILL))) || MYF(MY_WME|MY_ZEROFILL))) ||
insert_dynamic(&q_lines, (uchar*) &command)) insert_dynamic(&q_lines, (uchar*) &command))
die(NullS); die("Out of memory");
command->type= Q_UNKNOWN; command->type= Q_UNKNOWN;
read_command_buf[0]= 0; read_command_buf[0]= 0;
@ -6260,7 +6260,7 @@ void init_win_path_patterns()
} }
if (insert_dynamic(&patterns, (uchar*) &p)) if (insert_dynamic(&patterns, (uchar*) &p))
die(NullS); die("Out of memory");
DBUG_PRINT("info", ("p: %s", p)); DBUG_PRINT("info", ("p: %s", p));
while (*p) while (*p)
@ -9331,8 +9331,7 @@ REPLACE *init_replace(char * *from, char * *to,uint count,
for (i=1 ; i <= found_sets ; i++) for (i=1 ; i <= found_sets ; i++)
{ {
pos=from[found_set[i-1].table_offset]; pos=from[found_set[i-1].table_offset];
rep_str[i].found= !bcmp((const uchar*) pos, rep_str[i].found= !memcmp(pos, "\\^", 3) ? 2 : 1;
(const uchar*) "\\^", 3) ? 2 : 1;
rep_str[i].replace_string=to_array[found_set[i-1].table_offset]; 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].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)+ rep_str[i].from_offset=found_set[i-1].found_offset-replace_len(pos)+
@ -9460,7 +9459,7 @@ void copy_bits(REP_SET *to,REP_SET *from)
int cmp_bits(REP_SET *set1,REP_SET *set2) int cmp_bits(REP_SET *set1,REP_SET *set2)
{ {
return bcmp((uchar*) set1->bits,(uchar*) set2->bits, return memcmp(set1->bits, set2->bits,
sizeof(uint) * set1->size_of_bits); sizeof(uint) * set1->size_of_bits);
} }
@ -9530,17 +9529,15 @@ int find_found(FOUND_SET *found_set,uint table_offset, int found_offset)
uint start_at_word(char * pos) uint start_at_word(char * pos)
{ {
return (((!bcmp((const uchar*) pos, (const uchar*) "\\b",2) && pos[2]) || return (((!memcmp(pos, "\\b",2) && pos[2]) ||
!bcmp((const uchar*) pos, (const uchar*) "\\^", 2)) ? 1 : 0); !memcmp(pos, "\\^", 2)) ? 1 : 0);
} }
uint end_of_word(char * pos) uint end_of_word(char * pos)
{ {
char * end=strend(pos); char * end=strend(pos);
return ((end > pos+2 && !bcmp((const uchar*) end-2, return ((end > pos+2 && !memcmp(end-2, "\\b", 2)) ||
(const uchar*) "\\b", 2)) || (end >= pos+2 && !memcmp(end-2, "\\$",2))) ? 1 : 0;
(end >= pos+2 && !bcmp((const uchar*) end-2,
(const uchar*) "\\$",2))) ? 1 : 0;
} }
/**************************************************************************** /****************************************************************************

View File

@ -122,7 +122,8 @@ bool String::set(double num,uint decimals, CHARSET_INFO *cs)
str_charset=cs; str_charset=cs;
if (decimals >= NOT_FIXED_DEC) 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); return copy(buff, len, &my_charset_latin1, cs, &dummy_errors);
} }
#ifdef HAVE_FCONVERT #ifdef HAVE_FCONVERT
@ -674,7 +675,7 @@ void String::qs_append(const char *str, uint32 len)
void String::qs_append(double d) void String::qs_append(double d)
{ {
char *buff = Ptr + str_length; 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) void String::qs_append(double *d)

View File

@ -31,7 +31,7 @@ noinst_HEADERS = readline.h chardefs.h keymaps.h \
EXTRA_DIST= emacs_keymap.c vi_keymap.c EXTRA_DIST= emacs_keymap.c vi_keymap.c
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
# Don't update the files from bitkeeper # Don't update the files from bitkeeper
%::SCCS/s.% %::SCCS/s.%

View File

@ -318,7 +318,9 @@ _rl_input_available ()
return (_kbhit ()); return (_kbhit ());
#endif #endif
#if !defined (HAVE_SELECT)
return 0; return 0;
#endif
} }
int int

View File

@ -0,0 +1,64 @@
#
# Control aspects of the development environment which are
# specific to MySQL maintainers and developers.
#
AC_DEFUN([MY_MAINTAINER_MODE], [
AC_MSG_CHECKING([whether to enable the maintainer-specific development environment])
AC_ARG_ENABLE([mysql-maintainer-mode],
[AS_HELP_STRING([--enable-mysql-maintainer-mode],
[Enable a MySQL maintainer-specific development environment])],
[USE_MYSQL_MAINTAINER_MODE=$enableval],
[USE_MYSQL_MAINTAINER_MODE=no])
AC_MSG_RESULT([$USE_MYSQL_MAINTAINER_MODE])
])
# Set warning options required under maintainer mode.
AC_DEFUN([MY_MAINTAINER_MODE_WARNINGS], [
# Setup GCC warning options.
AS_IF([test "$GCC" = "yes"], [
C_WARNINGS="-Wall -Wextra -Wunused -Wwrite-strings -Werror"
CXX_WARNINGS="${C_WARNINGS} -Wno-unused-parameter"
])
# Test whether the warning options work.
# Test C options
AS_IF([test -n "$C_WARNINGS"], [
save_CFLAGS="$CFLAGS"
AC_MSG_CHECKING([whether to use C warning options ${C_WARNINGS}])
AC_LANG_PUSH(C)
CFLAGS="$CFLAGS ${C_WARNINGS}"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [myac_c_warning_flags=yes],
[myac_c_warning_flags=no])
AC_LANG_POP()
AC_MSG_RESULT([$myac_c_warning_flags])
CFLAGS="$save_CFLAGS"
])
# Test C++ options
AS_IF([test -n "$CXX_WARNINGS"], [
save_CXXFLAGS="$CXXFLAGS"
AC_MSG_CHECKING([whether to use C++ warning options ${CXX_WARNINGS}])
AC_LANG_PUSH(C++)
CXXFLAGS="$CXXFLAGS ${CXX_WARNINGS}"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [myac_cxx_warning_flags=yes],
[myac_cxx_warning_flags=no])
AC_LANG_POP()
AC_MSG_RESULT([$myac_cxx_warning_flags])
CXXFLAGS="$save_CXXFLAGS"
])
# Set compile flag variables.
AS_IF([test "$myac_c_warning_flags" = "yes"], [
AM_CFLAGS="${AM_CFLAGS} ${C_WARNINGS}"
AC_SUBST([AM_CFLAGS])])
AS_IF([test "$myac_cxx_warning_flags" = "yes"], [
AM_CXXFLAGS="${AM_CXXFLAGS} ${CXX_WARNINGS}"
AC_SUBST([AM_CXXFLAGS])])
])
# Set compiler flags required under maintainer mode.
AC_DEFUN([MY_MAINTAINER_MODE_SETUP], [
AS_IF([test "$USE_MYSQL_MAINTAINER_MODE" = "yes"],
[MY_MAINTAINER_MODE_WARNINGS])
])

View File

@ -65,6 +65,7 @@ MYSQL_TCP_PORT_DEFAULT=3306
MYSQL_UNIX_ADDR_DEFAULT="/tmp/mysql.sock" MYSQL_UNIX_ADDR_DEFAULT="/tmp/mysql.sock"
dnl Include m4 dnl Include m4
sinclude(config/ac-macros/maintainer.m4)
sinclude(config/ac-macros/alloca.m4) sinclude(config/ac-macros/alloca.m4)
sinclude(config/ac-macros/check_cpu.m4) sinclude(config/ac-macros/check_cpu.m4)
sinclude(config/ac-macros/character_sets.m4) sinclude(config/ac-macros/character_sets.m4)
@ -102,6 +103,8 @@ AC_SUBST(SHARED_LIB_MAJOR_VERSION)
AC_SUBST(SHARED_LIB_VERSION) AC_SUBST(SHARED_LIB_VERSION)
AC_SUBST(AVAILABLE_LANGUAGES) AC_SUBST(AVAILABLE_LANGUAGES)
# Whether the maintainer mode should be enabled.
MY_MAINTAINER_MODE
# Canonicalize the configuration name. # Canonicalize the configuration name.
@ -275,40 +278,6 @@ AC_CHECK_PROGS(YACC, ['bison -y -p MYSQL'])
AC_CHECK_PROG(PDFMANUAL, pdftex, manual.pdf) AC_CHECK_PROG(PDFMANUAL, pdftex, manual.pdf)
AC_CHECK_PROG(DVIS, tex, manual.dvi) AC_CHECK_PROG(DVIS, tex, manual.dvi)
#check the return type of sprintf
AC_MSG_CHECKING("return type of sprintf")
AC_TRY_RUN([
int main()
{
char* s = "hello";
char buf[6];
if((int)sprintf(buf, s) == strlen(s))
return 0;
return -1;
}
],
[AC_DEFINE(SPRINTF_RETURNS_INT, [1], [POSIX sprintf])
AC_MSG_RESULT("int")],
[AC_TRY_RUN([
int main()
{
char* s = "hello";
char buf[6];
if((char*)sprintf(buf,s) == buf + strlen(s))
return 0;
return -1;
} ],
[AC_DEFINE(SPRINTF_RETURNS_PTR, [1], [Broken sprintf])
AC_MSG_RESULT("ptr")],
[AC_DEFINE(SPRINTF_RETURNS_GARBAGE, [1], [Broken sprintf])
AC_MSG_RESULT("garbage")]
)],
# Cross compile, assume POSIX
[AC_DEFINE(SPRINTF_RETURNS_INT, [1], [POSIX sprintf])
AC_MSG_RESULT("int (we assume)")]
)
AC_PATH_PROG(uname_prog, uname, no) AC_PATH_PROG(uname_prog, uname, no)
# We should go through this and put all the explictly system dependent # We should go through this and put all the explictly system dependent
@ -2102,7 +2071,7 @@ MYSQL_TYPE_QSORT
AC_FUNC_UTIME_NULL AC_FUNC_UTIME_NULL
AC_FUNC_VPRINTF AC_FUNC_VPRINTF
AC_CHECK_FUNCS(alarm bcmp bfill bmove bsearch bzero \ AC_CHECK_FUNCS(alarm bfill bmove bsearch bzero \
chsize cuserid fchmod fcntl \ chsize cuserid fchmod fcntl \
fconvert fdatasync fesetround finite fpresetsticky fpsetmask fsync ftruncate \ fconvert fdatasync fesetround finite fpresetsticky fpsetmask fsync ftruncate \
getcwd gethostbyaddr_r gethostbyname_r getpass getpassphrase getpwnam \ getcwd gethostbyaddr_r gethostbyname_r getpass getpassphrase getpwnam \
@ -2880,6 +2849,12 @@ do
done done
AC_SUBST(sql_union_dirs) AC_SUBST(sql_union_dirs)
#
# Setup maintainer mode options by the end to not disturb
# system and other checks.
#
MY_MAINTAINER_MODE_SETUP
# Some usefull subst # Some usefull subst
AC_SUBST(CC) AC_SUBST(CC)
AC_SUBST(GXX) AC_SUBST(GXX)

View File

@ -639,9 +639,9 @@ static struct message *find_message(struct errors *err, const char *lang,
static ha_checksum checksum_format_specifier(const char* msg) static ha_checksum checksum_format_specifier(const char* msg)
{ {
ha_checksum chksum= 0; ha_checksum chksum= 0;
const char* p= msg; const uchar* p= (const uchar*) msg;
const char* start= 0; const uchar* start= NULL;
int num_format_specifiers= 0; uint32 num_format_specifiers= 0;
while (*p) while (*p)
{ {
@ -831,7 +831,6 @@ static struct message *parse_message_string(struct message *new_message,
static struct errors *parse_error_string(char *str, int er_count) static struct errors *parse_error_string(char *str, int er_count)
{ {
struct errors *new_error; struct errors *new_error;
char *start;
DBUG_ENTER("parse_error_string"); DBUG_ENTER("parse_error_string");
DBUG_PRINT("enter", ("str: %s", str)); DBUG_PRINT("enter", ("str: %s", str));
@ -842,7 +841,6 @@ static struct errors *parse_error_string(char *str, int er_count)
DBUG_RETURN(0); /* OOM: Fatal error */ DBUG_RETURN(0); /* OOM: Fatal error */
/* getting the error name */ /* getting the error name */
start= str;
str= skip_delimiters(str); str= skip_delimiters(str);
if (!(new_error->er_name= get_word(&str))) if (!(new_error->er_name= get_word(&str)))

View File

@ -648,7 +648,7 @@ static REPLACE *init_replace(char * *from, char * *to,uint count,
for (i=1 ; i <= found_sets ; i++) for (i=1 ; i <= found_sets ; i++)
{ {
pos=from[found_set[i-1].table_offset]; 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].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].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)+ rep_str[i].from_offset=found_set[i-1].found_offset-replace_len(pos)+
@ -776,7 +776,7 @@ static void copy_bits(REP_SET *to,REP_SET *from)
static int cmp_bits(REP_SET *set1,REP_SET *set2) static int cmp_bits(REP_SET *set1,REP_SET *set2)
{ {
return bcmp((uchar*) set1->bits,(uchar*) set2->bits, return memcmp(set1->bits, set2->bits,
sizeof(uint) * set1->size_of_bits); sizeof(uint) * set1->size_of_bits);
} }
@ -849,14 +849,14 @@ static short find_found(FOUND_SET *found_set,uint table_offset,
static uint start_at_word(char * pos) 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) static uint end_of_word(char * pos)
{ {
char * end=strend(pos); char * end=strend(pos);
return ((end > pos+2 && !bcmp(end-2,"\\b",2)) || return ((end > pos+2 && !memcmp(end-2,"\\b",2)) ||
(end >= pos+2 && !bcmp(end-2,"\\$",2))) ? (end >= pos+2 && !memcmp(end-2,"\\$",2))) ?
1 : 0; 1 : 0;
} }

View File

@ -953,7 +953,8 @@ x509* PemToDer(FILE* file, CertType type, EncryptedInfo* info)
info->set = true; info->set = true;
} }
} }
fgets(line,sizeof(line), file); // get blank line // get blank line
if (fgets(line, sizeof(line), file))
begin = ftell(file); begin = ftell(file);
} }

View File

@ -884,21 +884,19 @@ void Alert::Process(input_buffer& input, SSL& ssl)
else else
hmac(ssl, verify, data, aSz, alert, true); hmac(ssl, verify, data, aSz, alert, true);
// read mac and fill // read mac and skip fill
int digestSz = ssl.getCrypto().get_digest().get_digestSize(); int digestSz = ssl.getCrypto().get_digest().get_digestSize();
opaque mac[SHA_LEN]; opaque mac[SHA_LEN];
input.read(mac, digestSz); input.read(mac, digestSz);
if (ssl.getSecurity().get_parms().cipher_type_ == block) { if (ssl.getSecurity().get_parms().cipher_type_ == block) {
int ivExtra = 0; int ivExtra = 0;
opaque fill;
if (ssl.isTLSv1_1()) if (ssl.isTLSv1_1())
ivExtra = ssl.getCrypto().get_cipher().get_blockSize(); ivExtra = ssl.getCrypto().get_cipher().get_blockSize();
int padSz = ssl.getSecurity().get_parms().encrypt_size_ - ivExtra - int padSz = ssl.getSecurity().get_parms().encrypt_size_ - ivExtra -
aSz - digestSz; aSz - digestSz;
for (int i = 0; i < padSz; i++) input.set_current(input.get_current() + padSz);
fill = input[AUTO];
} }
// verify // verify
@ -981,17 +979,17 @@ output_buffer& operator<<(output_buffer& output, const Data& data)
void Data::Process(input_buffer& input, SSL& ssl) void Data::Process(input_buffer& input, SSL& ssl)
{ {
int msgSz = ssl.getSecurity().get_parms().encrypt_size_; int msgSz = ssl.getSecurity().get_parms().encrypt_size_;
int pad = 0, padByte = 0; int pad = 0, padSz = 0;
int ivExtra = 0; int ivExtra = 0;
if (ssl.getSecurity().get_parms().cipher_type_ == block) { if (ssl.getSecurity().get_parms().cipher_type_ == block) {
if (ssl.isTLSv1_1()) // IV if (ssl.isTLSv1_1()) // IV
ivExtra = ssl.getCrypto().get_cipher().get_blockSize(); ivExtra = ssl.getCrypto().get_cipher().get_blockSize();
pad = *(input.get_buffer() + input.get_current() + msgSz -ivExtra - 1); pad = *(input.get_buffer() + input.get_current() + msgSz -ivExtra - 1);
padByte = 1; padSz = 1;
} }
int digestSz = ssl.getCrypto().get_digest().get_digestSize(); int digestSz = ssl.getCrypto().get_digest().get_digestSize();
int dataSz = msgSz - ivExtra - digestSz - pad - padByte; int dataSz = msgSz - ivExtra - digestSz - pad - padSz;
opaque verify[SHA_LEN]; opaque verify[SHA_LEN];
const byte* rawData = input.get_buffer() + input.get_current(); const byte* rawData = input.get_buffer() + input.get_current();
@ -1020,14 +1018,10 @@ void Data::Process(input_buffer& input, SSL& ssl)
hmac(ssl, verify, rawData, dataSz, application_data, true); hmac(ssl, verify, rawData, dataSz, application_data, true);
} }
// read mac and fill // read mac and skip fill
opaque mac[SHA_LEN]; opaque mac[SHA_LEN];
opaque fill;
input.read(mac, digestSz); input.read(mac, digestSz);
for (int i = 0; i < pad; i++) input.set_current(input.get_current() + pad + padSz);
fill = input[AUTO];
if (padByte)
fill = input[AUTO];
// verify // verify
if (dataSz) { if (dataSz) {
@ -2073,11 +2067,9 @@ void Finished::Process(input_buffer& input, SSL& ssl)
if (ssl.isTLSv1_1()) if (ssl.isTLSv1_1())
ivExtra = ssl.getCrypto().get_cipher().get_blockSize(); ivExtra = ssl.getCrypto().get_cipher().get_blockSize();
opaque fill;
int padSz = ssl.getSecurity().get_parms().encrypt_size_ - ivExtra - int padSz = ssl.getSecurity().get_parms().encrypt_size_ - ivExtra -
HANDSHAKE_HEADER - finishedSz - digestSz; HANDSHAKE_HEADER - finishedSz - digestSz;
for (int i = 0; i < padSz; i++) input.set_current(input.get_current() + padSz);
fill = input[AUTO];
// verify mac // verify mac
if (memcmp(mac, verifyMAC, digestSz)) { if (memcmp(mac, verifyMAC, digestSz)) {

View File

@ -51,7 +51,7 @@ public:
enum { BLOCK_SIZE = BLOWFISH_BLOCK_SIZE, ROUNDS = 16 }; enum { BLOCK_SIZE = BLOWFISH_BLOCK_SIZE, ROUNDS = 16 };
Blowfish(CipherDir DIR, Mode MODE) 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 #ifdef DO_BLOWFISH_ASM
void Process(byte*, const byte*, word32); void Process(byte*, const byte*, word32);
@ -62,8 +62,8 @@ private:
static const word32 p_init_[ROUNDS + 2]; static const word32 p_init_[ROUNDS + 2];
static const word32 s_init_[4 * 256]; static const word32 s_init_[4 * 256];
word32 pbox_[ROUNDS + 2]; word32 pbox_[ROUNDS + 2 + 4 * 256];
word32 sbox_[4 * 256]; word32* sbox_;
void crypt_block(const word32 in[2], word32 out[2]) const; void crypt_block(const word32 in[2], word32 out[2]) const;
void AsmProcess(const byte* in, byte* out) const; void AsmProcess(const byte* in, byte* out) const;

View File

@ -35,10 +35,7 @@
// Handler for pure virtual functions // Handler for pure virtual functions
namespace __Crun { namespace __Crun {
static void pure_error(void) void pure_error(void);
{
assert("Pure virtual method called." == "Aborted");
}
} // namespace __Crun } // namespace __Crun
#endif // __sun #endif // __sun
@ -54,16 +51,7 @@ extern "C" {
#else #else
#include "kernelc.hpp" #include "kernelc.hpp"
#endif #endif
int __cxa_pure_virtual () __attribute__ ((weak));
/* 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;
}
} // extern "C" } // extern "C"
#endif // __GNUC__ > 2 #endif // __GNUC__ > 2

View File

@ -51,7 +51,7 @@ void AES::Process(byte* out, const byte* in, word32 sz)
out += BLOCK_SIZE; out += BLOCK_SIZE;
in += BLOCK_SIZE; in += BLOCK_SIZE;
} }
else if (mode_ == CBC) else if (mode_ == CBC) {
if (dir_ == ENCRYPTION) if (dir_ == ENCRYPTION)
while (blocks--) { while (blocks--) {
r_[0] ^= *(word32*)in; r_[0] ^= *(word32*)in;
@ -79,6 +79,7 @@ void AES::Process(byte* out, const byte* in, word32 sz)
in += BLOCK_SIZE; in += BLOCK_SIZE;
} }
} }
}
#endif // DO_AES_ASM #endif // DO_AES_ASM

View File

@ -186,10 +186,10 @@ Integer AbstractGroup::CascadeScalarMultiply(const Element &x,
struct WindowSlider struct WindowSlider
{ {
WindowSlider(const Integer &exp, bool fastNegate, WindowSlider(const Integer &expIn, bool fastNegateIn,
unsigned int windowSizeIn=0) unsigned int windowSizeIn=0)
: exp(exp), windowModulus(Integer::One()), windowSize(windowSizeIn), : exp(expIn), windowModulus(Integer::One()), windowSize(windowSizeIn),
windowBegin(0), fastNegate(fastNegate), firstTime(true), windowBegin(0), fastNegate(fastNegateIn), firstTime(true),
finished(false) finished(false)
{ {
if (windowSize == 0) if (windowSize == 0)

View File

@ -53,7 +53,7 @@ void Blowfish::Process(byte* out, const byte* in, word32 sz)
out += BLOCK_SIZE; out += BLOCK_SIZE;
in += BLOCK_SIZE; in += BLOCK_SIZE;
} }
else if (mode_ == CBC) else if (mode_ == CBC) {
if (dir_ == ENCRYPTION) if (dir_ == ENCRYPTION)
while (blocks--) { while (blocks--) {
r_[0] ^= *(word32*)in; r_[0] ^= *(word32*)in;
@ -79,6 +79,7 @@ void Blowfish::Process(byte* out, const byte* in, word32 sz)
in += BLOCK_SIZE; in += BLOCK_SIZE;
} }
} }
}
#endif // DO_BLOWFISH_ASM #endif // DO_BLOWFISH_ASM

View File

@ -283,12 +283,7 @@ DWord() {}
word GetHighHalfAsBorrow() const {return 0-halfs_.high;} word GetHighHalfAsBorrow() const {return 0-halfs_.high;}
private: private:
union struct dword_struct
{
#ifdef TAOCRYPT_NATIVE_DWORD_AVAILABLE
dword whole_;
#endif
struct
{ {
#ifdef LITTLE_ENDIAN_ORDER #ifdef LITTLE_ENDIAN_ORDER
word low; word low;
@ -297,7 +292,14 @@ private:
word high; word high;
word low; word low;
#endif #endif
} halfs_; };
union
{
#ifdef TAOCRYPT_NATIVE_DWORD_AVAILABLE
dword whole_;
#endif
struct dword_struct halfs_;
}; };
}; };
@ -1214,20 +1216,24 @@ public:
#define AS1(x) #x ";" #define AS1(x) #x ";"
#define AS2(x, y) #x ", " #y ";" #define AS2(x, y) #x ", " #y ";"
#define AddPrologue \ #define AddPrologue \
word res; \
__asm__ __volatile__ \ __asm__ __volatile__ \
( \ ( \
"push %%ebx;" /* save this manually, in case of -fPIC */ \ "push %%ebx;" /* save this manually, in case of -fPIC */ \
"mov %2, %%ebx;" \ "mov %3, %%ebx;" \
".intel_syntax noprefix;" \ ".intel_syntax noprefix;" \
"push ebp;" "push ebp;"
#define AddEpilogue \ #define AddEpilogue \
"pop ebp;" \ "pop ebp;" \
".att_syntax prefix;" \ ".att_syntax prefix;" \
"pop %%ebx;" \ "pop %%ebx;" \
: \ "mov %%eax, %0;" \
: "=g" (res) \
: "c" (C), "d" (A), "m" (B), "S" (N) \ : "c" (C), "d" (A), "m" (B), "S" (N) \
: "%edi", "memory", "cc" \ : "%edi", "memory", "cc" \
); ); \
return res;
#define MulPrologue \ #define MulPrologue \
__asm__ __volatile__ \ __asm__ __volatile__ \
( \ ( \

View File

@ -84,12 +84,23 @@ namespace STL = STL_NAMESPACE;
} }
#if defined(__ICC) || defined(__INTEL_COMPILER) #ifdef __sun
// Handler for pure virtual functions
namespace __Crun {
void pure_error() {
assert(!"Aborted: pure virtual method called.");
}
}
#endif
#if defined(__ICC) || defined(__INTEL_COMPILER) || (__GNUC__ > 2)
extern "C" { extern "C" {
int __cxa_pure_virtual() { int __cxa_pure_virtual() {
assert("Pure virtual method called." == "Aborted"); assert(!"Aborted: pure virtual method called.");
return 0; return 0;
} }
@ -166,14 +177,6 @@ word Crop(word value, unsigned int size)
#ifdef TAOCRYPT_X86ASM_AVAILABLE #ifdef TAOCRYPT_X86ASM_AVAILABLE
#ifndef _MSC_VER
static jmp_buf s_env;
static void SigIllHandler(int)
{
longjmp(s_env, 1);
}
#endif
bool HaveCpuId() bool HaveCpuId()
{ {

View File

@ -54,7 +54,7 @@ void Twofish::Process(byte* out, const byte* in, word32 sz)
out += BLOCK_SIZE; out += BLOCK_SIZE;
in += BLOCK_SIZE; in += BLOCK_SIZE;
} }
else if (mode_ == CBC) else if (mode_ == CBC) {
if (dir_ == ENCRYPTION) if (dir_ == ENCRYPTION)
while (blocks--) { while (blocks--) {
r_[0] ^= *(word32*)in; r_[0] ^= *(word32*)in;
@ -83,6 +83,7 @@ void Twofish::Process(byte* out, const byte* in, word32 sz)
in += BLOCK_SIZE; in += BLOCK_SIZE;
} }
} }
}
#endif // DO_TWOFISH_ASM #endif // DO_TWOFISH_ASM

View File

@ -160,6 +160,11 @@ inline void err_sys(const char* msg)
} }
extern "C" {
static int PasswordCallBack(char*, int, int, void*);
}
static int PasswordCallBack(char* passwd, int sz, int rw, void* userdata) static int PasswordCallBack(char* passwd, int sz, int rw, void* userdata)
{ {
strncpy(passwd, "12345678", sz); strncpy(passwd, "12345678", sz);

View File

@ -36,10 +36,8 @@ noinst_HEADERS = config-win.h config-netware.h my_bit.h \
my_nosys.h my_alarm.h queues.h rijndael.h sha1.h \ my_nosys.h my_alarm.h queues.h rijndael.h sha1.h \
my_aes.h my_tree.h my_trie.h hash.h thr_alarm.h \ my_aes.h my_tree.h my_trie.h hash.h thr_alarm.h \
thr_lock.h t_ctype.h violite.h my_md5.h base64.h \ thr_lock.h t_ctype.h violite.h my_md5.h base64.h \
my_handler.h my_time.h \ my_handler.h my_time.h my_vle.h my_user.h \
my_vle.h my_user.h my_atomic.h atomic/nolock.h \ my_libwrap.h my_stacktrace.h my_compiler.h
atomic/rwlock.h atomic/x86-gcc.h atomic/x86-msvc.h \
atomic/gcc_builtins.h my_libwrap.h my_stacktrace.h
EXTRA_DIST = mysql.h.pp mysql/plugin.h.pp EXTRA_DIST = mysql.h.pp mysql/plugin.h.pp

View File

@ -1,33 +0,0 @@
/* Copyright (C) 2008 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#define make_atomic_add_body(S) \
v= __sync_fetch_and_add(a, v);
#define make_atomic_swap_body(S) \
v= __sync_lock_test_and_set(a, v);
#define make_atomic_cas_body(S) \
int ## S sav; \
sav= __sync_val_compare_and_swap(a, *cmp, set); \
if (!(ret= (sav == *cmp))) *cmp= sav;
#ifdef MY_ATOMIC_MODE_DUMMY
#define make_atomic_load_body(S) ret= *a
#define make_atomic_store_body(S) *a= v
#else
#define make_atomic_load_body(S) \
ret= __sync_fetch_and_or(a, 0);
#define make_atomic_store_body(S) \
(void) __sync_lock_test_and_set(a, v);
#endif

View File

@ -1,44 +0,0 @@
/* Copyright (C) 2006 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#if defined(__i386__) || defined(_M_IX86) || defined(HAVE_GCC_ATOMIC_BUILTINS)
#ifdef MY_ATOMIC_MODE_DUMMY
# define LOCK ""
#else
# define LOCK "lock"
#endif
#ifdef HAVE_GCC_ATOMIC_BUILTINS
#include "gcc_builtins.h"
#elif __GNUC__
#include "x86-gcc.h"
#elif defined(_MSC_VER)
#include "x86-msvc.h"
#endif
#endif
#ifdef make_atomic_cas_body
typedef struct { } my_atomic_rwlock_t;
#define my_atomic_rwlock_destroy(name)
#define my_atomic_rwlock_init(name)
#define my_atomic_rwlock_rdlock(name)
#define my_atomic_rwlock_wrlock(name)
#define my_atomic_rwlock_rdunlock(name)
#define my_atomic_rwlock_wrunlock(name)
#endif

View File

@ -1,48 +0,0 @@
/* Copyright (C) 2006 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
typedef struct {pthread_rwlock_t rw;} my_atomic_rwlock_t;
#ifdef MY_ATOMIC_MODE_DUMMY
/*
the following can never be enabled by ./configure, one need to put #define in
a source to trigger the following warning. The resulting code will be broken,
it only makes sense to do it to see now test_atomic detects broken
implementations (another way is to run a UP build on an SMP box).
*/
#warning MY_ATOMIC_MODE_DUMMY and MY_ATOMIC_MODE_RWLOCKS are incompatible
#define my_atomic_rwlock_destroy(name)
#define my_atomic_rwlock_init(name)
#define my_atomic_rwlock_rdlock(name)
#define my_atomic_rwlock_wrlock(name)
#define my_atomic_rwlock_rdunlock(name)
#define my_atomic_rwlock_wrunlock(name)
#define MY_ATOMIC_MODE "dummy (non-atomic)"
#else
#define my_atomic_rwlock_destroy(name) pthread_rwlock_destroy(& (name)->rw)
#define my_atomic_rwlock_init(name) pthread_rwlock_init(& (name)->rw, 0)
#define my_atomic_rwlock_rdlock(name) pthread_rwlock_rdlock(& (name)->rw)
#define my_atomic_rwlock_wrlock(name) pthread_rwlock_wrlock(& (name)->rw)
#define my_atomic_rwlock_rdunlock(name) pthread_rwlock_unlock(& (name)->rw)
#define my_atomic_rwlock_wrunlock(name) pthread_rwlock_unlock(& (name)->rw)
#define MY_ATOMIC_MODE "rwlocks"
#endif
#define make_atomic_add_body(S) int ## S sav; sav= *a; *a+= v; v=sav;
#define make_atomic_swap_body(S) int ## S sav; sav= *a; *a= v; v=sav;
#define make_atomic_cas_body(S) if ((ret= (*a == *cmp))) *a= set; else *cmp=*a;
#define make_atomic_load_body(S) ret= *a;
#define make_atomic_store_body(S) *a= v;

View File

@ -1,58 +0,0 @@
/* Copyright (C) 2006 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/*
XXX 64-bit atomic operations can be implemented using
cmpxchg8b, if necessary. Though I've heard that not all 64-bit
architectures support double-word (128-bit) cas.
*/
#ifdef MY_ATOMIC_NO_XADD
#define MY_ATOMIC_MODE "gcc-x86" LOCK "-no-xadd"
#else
#define MY_ATOMIC_MODE "gcc-x86" LOCK
#endif
/* fix -ansi errors while maintaining readability */
#ifndef asm
#define asm __asm__
#endif
#ifndef MY_ATOMIC_NO_XADD
#define make_atomic_add_body(S) \
asm volatile (LOCK "; xadd %0, %1;" : "+r" (v) , "+m" (*a))
#endif
#define make_atomic_swap_body(S) \
asm volatile ("; xchg %0, %1;" : "+r" (v) , "+m" (*a))
#define make_atomic_cas_body(S) \
asm volatile (LOCK "; cmpxchg %3, %0; setz %2;" \
: "+m" (*a), "+a" (*cmp), "=q" (ret): "r" (set))
#ifdef MY_ATOMIC_MODE_DUMMY
#define make_atomic_load_body(S) ret=*a
#define make_atomic_store_body(S) *a=v
#else
/*
Actually 32-bit reads/writes are always atomic on x86
But we add LOCK here anyway to force memory barriers
*/
#define make_atomic_load_body(S) \
ret=0; \
asm volatile (LOCK "; cmpxchg %2, %0" \
: "+m" (*a), "+a" (ret): "r" (ret))
#define make_atomic_store_body(S) \
asm volatile ("; xchg %0, %1;" : "+m" (*a) : "r" (v))
#endif

View File

@ -1,96 +0,0 @@
/* Copyright (C) 2006 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/*
XXX 64-bit atomic operations can be implemented using
cmpxchg8b, if necessary
*/
// Would it be better to use intrinsics ?
// (InterlockedCompareExchange, InterlockedCompareExchange16
// InterlockedExchangeAdd, InterlockedExchange)
#ifndef _atomic_h_cleanup_
#define _atomic_h_cleanup_ "atomic/x86-msvc.h"
#define MY_ATOMIC_MODE "msvc-x86" LOCK
#define make_atomic_add_body(S) \
_asm { \
_asm mov reg_ ## S, v \
_asm LOCK xadd *a, reg_ ## S \
_asm movzx v, reg_ ## S \
}
#define make_atomic_cas_body(S) \
_asm { \
_asm mov areg_ ## S, *cmp \
_asm mov reg2_ ## S, set \
_asm LOCK cmpxchg *a, reg2_ ## S \
_asm mov *cmp, areg_ ## S \
_asm setz al \
_asm movzx ret, al \
}
#define make_atomic_swap_body(S) \
_asm { \
_asm mov reg_ ## S, v \
_asm xchg *a, reg_ ## S \
_asm mov v, reg_ ## S \
}
#ifdef MY_ATOMIC_MODE_DUMMY
#define make_atomic_load_body(S) ret=*a
#define make_atomic_store_body(S) *a=v
#else
/*
Actually 32-bit reads/writes are always atomic on x86
But we add LOCK here anyway to force memory barriers
*/
#define make_atomic_load_body(S) \
_asm { \
_asm mov areg_ ## S, 0 \
_asm mov reg2_ ## S, areg_ ## S \
_asm LOCK cmpxchg *a, reg2_ ## S \
_asm mov ret, areg_ ## S \
}
#define make_atomic_store_body(S) \
_asm { \
_asm mov reg_ ## S, v \
_asm xchg *a, reg_ ## S \
}
#endif
#define reg_8 al
#define reg_16 ax
#define reg_32 eax
#define areg_8 al
#define areg_16 ax
#define areg_32 eax
#define reg2_8 bl
#define reg2_16 bx
#define reg2_32 ebx
#else /* cleanup */
#undef reg_8
#undef reg_16
#undef reg_32
#undef areg_8
#undef areg_16
#undef areg_32
#undef reg2_8
#undef reg2_16
#undef reg2_32
#endif

View File

@ -33,10 +33,6 @@
/* need by my_vsnprintf */ /* need by my_vsnprintf */
#include <stdarg.h> #include <stdarg.h>
#ifdef _AIX
#undef HAVE_BCMP
#endif
/* This is needed for the definitions of bzero... on solaris */ /* This is needed for the definitions of bzero... on solaris */
#if defined(HAVE_STRINGS_H) #if defined(HAVE_STRINGS_H)
#include <strings.h> #include <strings.h>
@ -60,14 +56,10 @@
/* Unixware 7 */ /* Unixware 7 */
#if !defined(HAVE_BFILL) #if !defined(HAVE_BFILL)
# define bfill(A,B,C) memset((A),(C),(B)) # define bfill(A,B,C) memset((A),(C),(B))
# define bmove_align(A,B,C) memcpy((A),(B),(C))
#endif #endif
#if !defined(HAVE_BCMP) #if !defined(bzero) && !defined(HAVE_BZERO)
# define bcopy(s, d, n) memcpy((d), (s), (n))
# define bcmp(A,B,C) memcmp((A),(B),(C))
# define bzero(A,B) memset((A),0,(B)) # define bzero(A,B) memset((A),0,(B))
# define bmove_align(A,B,C) memcpy((A),(B),(C))
#endif #endif
#if defined(__cplusplus) #if defined(__cplusplus)
@ -116,19 +108,6 @@ extern const double log_10[309];
extern void bfill(uchar *dst,size_t len,pchar fill); extern void bfill(uchar *dst,size_t len,pchar fill);
#endif #endif
#if !defined(bzero) && !defined(HAVE_BZERO)
extern void bzero(uchar * dst,size_t len);
#endif
#if !defined(bcmp) && !defined(HAVE_BCMP)
extern size_t bcmp(const uchar *s1,const uchar *s2,size_t len);
#endif
#ifdef HAVE_purify
extern size_t my_bcmp(const uchar *s1,const uchar *s2,size_t len);
#undef bcmp
#define bcmp(A,B,C) my_bcmp((A),(B),(C))
#endif /* HAVE_purify */
#ifndef bmove512 #ifndef bmove512
extern void bmove512(uchar *dst,const uchar *src,size_t len); extern void bmove512(uchar *dst,const uchar *src,size_t len);
#endif #endif

View File

@ -1,142 +0,0 @@
/* Copyright (C) 2006 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#ifndef my_atomic_rwlock_init
#define intptr void *
#ifndef MY_ATOMIC_MODE_RWLOCKS
#include "atomic/nolock.h"
#endif
#ifndef make_atomic_cas_body
#include "atomic/rwlock.h"
#endif
#ifndef make_atomic_add_body
#define make_atomic_add_body(S) \
int ## S tmp=*a; \
while (!my_atomic_cas ## S(a, &tmp, tmp+v)); \
v=tmp;
#endif
#ifdef HAVE_INLINE
#define make_atomic_add(S) \
STATIC_INLINE int ## S my_atomic_add ## S( \
int ## S volatile *a, int ## S v) \
{ \
make_atomic_add_body(S); \
return v; \
}
#define make_atomic_swap(S) \
STATIC_INLINE int ## S my_atomic_swap ## S( \
int ## S volatile *a, int ## S v) \
{ \
make_atomic_swap_body(S); \
return v; \
}
#define make_atomic_cas(S) \
STATIC_INLINE int my_atomic_cas ## S(int ## S volatile *a, \
int ## S *cmp, int ## S set) \
{ \
int8 ret; \
make_atomic_cas_body(S); \
return ret; \
}
#define make_atomic_load(S) \
STATIC_INLINE int ## S my_atomic_load ## S(int ## S volatile *a) \
{ \
int ## S ret; \
make_atomic_load_body(S); \
return ret; \
}
#define make_atomic_store(S) \
STATIC_INLINE void my_atomic_store ## S( \
int ## S volatile *a, int ## S v) \
{ \
make_atomic_store_body(S); \
}
#else /* no inline functions */
#define make_atomic_add(S) \
extern int ## S my_atomic_add ## S(int ## S volatile *a, int ## S v);
#define make_atomic_swap(S) \
extern int ## S my_atomic_swap ## S(int ## S volatile *a, int ## S v);
#define make_atomic_cas(S) \
extern int my_atomic_cas ## S(int ## S volatile *a, int ## S *cmp, int ## S set);
#define make_atomic_load(S) \
extern int ## S my_atomic_load ## S(int ## S volatile *a);
#define make_atomic_store(S) \
extern void my_atomic_store ## S(int ## S volatile *a, int ## S v);
#endif
make_atomic_cas( 8)
make_atomic_cas(16)
make_atomic_cas(32)
make_atomic_cas(ptr)
make_atomic_add( 8)
make_atomic_add(16)
make_atomic_add(32)
make_atomic_load( 8)
make_atomic_load(16)
make_atomic_load(32)
make_atomic_load(ptr)
make_atomic_store( 8)
make_atomic_store(16)
make_atomic_store(32)
make_atomic_store(ptr)
make_atomic_swap( 8)
make_atomic_swap(16)
make_atomic_swap(32)
make_atomic_swap(ptr)
#undef make_atomic_add
#undef make_atomic_cas
#undef make_atomic_load
#undef make_atomic_store
#undef make_atomic_swap
#undef make_atomic_add_body
#undef make_atomic_cas_body
#undef make_atomic_load_body
#undef make_atomic_store_body
#undef make_atomic_swap_body
#undef intptr
#ifdef _atomic_h_cleanup_
#include _atomic_h_cleanup_
#undef _atomic_h_cleanup_
#endif
#define MY_ATOMIC_OK 0
#define MY_ATOMIC_NOT_1CPU 1
extern int my_atomic_initialize();
#endif

View File

@ -159,22 +159,6 @@ static inline my_bool bitmap_cmp(const MY_BITMAP *map1, const MY_BITMAP *map2)
#define bitmap_set_all(MAP) \ #define bitmap_set_all(MAP) \
(memset((MAP)->bitmap, 0xFF, 4*no_words_in_map((MAP)))) (memset((MAP)->bitmap, 0xFF, 4*no_words_in_map((MAP))))
/**
check, set and clear a bit of interest of an integer.
If the bit is out of range @retval -1. Otherwise
bit_is_set @return 0 or 1 reflecting the bit is set or not;
bit_do_set @return 1 (bit is set 1)
bit_do_clear @return 0 (bit is cleared to 0)
*/
#define bit_is_set(I,B) (sizeof(I) * CHAR_BIT > (B) ? \
(((I) & (ULL(1) << (B))) == 0 ? 0 : 1) : -1)
#define bit_do_set(I,B) (sizeof(I) * CHAR_BIT > (B) ? \
((I) |= (ULL(1) << (B)), 1) : -1)
#define bit_do_clear(I,B) (sizeof(I) * CHAR_BIT > (B) ? \
((I) &= ~(ULL(1) << (B)), 0) : -1)
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

129
include/my_compiler.h Normal file
View File

@ -0,0 +1,129 @@
#ifndef MY_COMPILER_INCLUDED
#define MY_COMPILER_INCLUDED
/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/**
Header for compiler-dependent features.
Intended to contain a set of reusable wrappers for preprocessor
macros, attributes, pragmas, and any other features that are
specific to a target compiler.
*/
#include <my_global.h> /* stddef.h offsetof */
/**
Compiler-dependent internal convenience macros.
*/
/* GNU C/C++ */
#if defined __GNUC__
/* Any after 2.95... */
# define MY_ALIGN_EXT
/* Microsoft Visual C++ */
#elif defined _MSC_VER
# define MY_ALIGNOF(type) __alignof(type)
# define MY_ALIGNED(n) __declspec(align(n))
/* Oracle Solaris Studio */
#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
# if __SUNPRO_C >= 0x590
# define MY_ALIGN_EXT
# endif
/* IBM XL C/C++ */
#elif defined __xlC__
# if __xlC__ >= 0x0600
# define MY_ALIGN_EXT
# endif
/* HP aCC */
#elif defined(__HP_aCC) || defined(__HP_cc)
# if (__HP_aCC >= 60000) || (__HP_cc >= 60000)
# define MY_ALIGN_EXT
# endif
#endif
#ifdef MY_ALIGN_EXT
/** Specifies the minimum alignment of a type. */
# define MY_ALIGNOF(type) __alignof__(type)
/** Determine the alignment requirement of a type. */
# define MY_ALIGNED(n) __attribute__((__aligned__((n))))
#endif
/**
Generic compiler-dependent features.
*/
#ifndef MY_ALIGNOF
# ifdef __cplusplus
template<typename type> struct my_alignof_helper { char m1; type m2; };
/* Invalid for non-POD types, but most compilers give the right answer. */
# define MY_ALIGNOF(type) offsetof(my_alignof_helper<type>, m2)
# else
# define MY_ALIGNOF(type) offsetof(struct { char m1; type m2; }, m2)
# endif
#endif
/**
C++ Type Traits
*/
#ifdef __cplusplus
/**
Opaque storage with a particular alignment.
*/
# if defined(MY_ALIGNED)
/* Partial specialization used due to MSVC++. */
template<size_t alignment> struct my_alignment_imp;
template<> struct MY_ALIGNED(1) my_alignment_imp<1> {};
template<> struct MY_ALIGNED(2) my_alignment_imp<2> {};
template<> struct MY_ALIGNED(4) my_alignment_imp<4> {};
template<> struct MY_ALIGNED(8) my_alignment_imp<8> {};
template<> struct MY_ALIGNED(16) my_alignment_imp<16> {};
/* ... expand as necessary. */
# else
template<size_t alignment>
struct my_alignment_imp { double m1; };
# endif
/**
A POD type with a given size and alignment.
@remark If the compiler does not support a alignment attribute
(MY_ALIGN macro), the default alignment of a double is
used instead.
@tparam size The minimum size.
@tparam alignment The desired alignment: 1, 2, 4, 8 or 16.
*/
template <size_t size, size_t alignment>
struct my_aligned_storage
{
union
{
char data[size];
my_alignment_imp<alignment> align;
};
};
#endif /* __cplusplus */
#include <my_attribute.h>
#endif /* MY_COMPILER_INCLUDED */

View File

@ -556,8 +556,15 @@ int __void__;
#endif #endif
#endif /* DONT_DEFINE_VOID */ #endif /* DONT_DEFINE_VOID */
#if defined(_lint) || defined(FORCE_INIT_OF_VARS) /*
#define LINT_INIT(var) var=0 /* No uninitialize-warning */ Deprecated workaround for false-positive uninitialized variables
warnings. Those should be silenced using tool-specific heuristics.
Enabled by default for g++ due to the bug referenced below.
*/
#if defined(_lint) || defined(FORCE_INIT_OF_VARS) || \
(defined(__GNUC__) && defined(__cplusplus))
#define LINT_INIT(var) var= 0
#else #else
#define LINT_INIT(var) #define LINT_INIT(var)
#endif #endif
@ -568,10 +575,11 @@ int __void__;
The _cplusplus is a temporary workaround for C++ code pending a fix The _cplusplus is a temporary workaround for C++ code pending a fix
for a g++ bug (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34772). for a g++ bug (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34772).
*/ */
#if defined(_lint) || defined(FORCE_INIT_OF_VARS) || defined(__cplusplus) || \ #if defined(_lint) || defined(FORCE_INIT_OF_VARS) || \
!defined(__GNUC__) defined(__cplusplus) || !defined(__GNUC__)
#define UNINIT_VAR(x) x= 0 #define UNINIT_VAR(x) x= 0
#else #else
/* GCC specific self-initialization which inhibits the warning. */
#define UNINIT_VAR(x) x= x #define UNINIT_VAR(x) x= x
#endif #endif
@ -595,7 +603,6 @@ typedef unsigned short ushort;
#define set_if_bigger(a,b) do { if ((a) < (b)) (a)=(b); } while(0) #define set_if_bigger(a,b) do { if ((a) < (b)) (a)=(b); } while(0)
#define set_if_smaller(a,b) do { if ((a) > (b)) (a)=(b); } while(0) #define set_if_smaller(a,b) do { if ((a) > (b)) (a)=(b); } while(0)
#define test_all_bits(a,b) (((a) & (b)) == (b)) #define test_all_bits(a,b) (((a) & (b)) == (b))
#define set_bits(type, bit_count) (sizeof(type)*8 <= (bit_count) ? ~(type) 0 : ((((type) 1) << (bit_count)) - (type) 1))
#define array_elements(A) ((uint) (sizeof(A)/sizeof(A[0]))) #define array_elements(A) ((uint) (sizeof(A)/sizeof(A[0])))
/* Define some general constants */ /* Define some general constants */
@ -616,7 +623,7 @@ typedef unsigned short ushort;
#define my_const_cast(A) (A) #define my_const_cast(A) (A)
#endif #endif
#include <my_attribute.h> #include <my_compiler.h>
/* /*
Wen using the embedded library, users might run into link problems, Wen using the embedded library, users might run into link problems,
@ -934,9 +941,6 @@ typedef long long my_ptrdiff_t;
#define ADD_TO_PTR(ptr,size,type) (type) ((uchar*) (ptr)+size) #define ADD_TO_PTR(ptr,size,type) (type) ((uchar*) (ptr)+size)
#define PTR_BYTE_DIFF(A,B) (my_ptrdiff_t) ((uchar*) (A) - (uchar*) (B)) #define PTR_BYTE_DIFF(A,B) (my_ptrdiff_t) ((uchar*) (A) - (uchar*) (B))
#define MY_DIV_UP(A, B) (((A) + (B) - 1) / (B))
#define MY_ALIGNED_BYTE_ARRAY(N, S, T) T N[MY_DIV_UP(S, sizeof(T))]
/* /*
Custom version of standard offsetof() macro which can be used to get Custom version of standard offsetof() macro which can be used to get
offsets of members in class for non-POD types (according to the current offsets of members in class for non-POD types (according to the current
@ -1460,17 +1464,6 @@ do { doubleget_union _tmp; \
#endif /* WORDS_BIGENDIAN */ #endif /* WORDS_BIGENDIAN */
/* sprintf does not always return the number of bytes :- */
#ifdef SPRINTF_RETURNS_INT
#define my_sprintf(buff,args) sprintf args
#else
#ifdef SPRINTF_RETURNS_PTR
#define my_sprintf(buff,args) ((int)(sprintf args - buff))
#else
#define my_sprintf(buff,args) ((ulong) sprintf args, (ulong) strlen(buff))
#endif
#endif
#ifndef THREAD #ifndef THREAD
#define thread_safe_increment(V,L) (V)++ #define thread_safe_increment(V,L) (V)++
#define thread_safe_decrement(V,L) (V)-- #define thread_safe_decrement(V,L) (V)--

View File

@ -269,13 +269,14 @@ int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */
we want to make sure that no such flags are set. we want to make sure that no such flags are set.
*/ */
#if defined(HAVE_SIGACTION) && !defined(my_sigset) #if defined(HAVE_SIGACTION) && !defined(my_sigset)
#define my_sigset(A,B) do { struct sigaction l_s; sigset_t l_set; int l_rc; \ #define my_sigset(A,B) do { struct sigaction l_s; sigset_t l_set; \
IF_DBUG(int l_rc); \
DBUG_ASSERT((A) != 0); \ DBUG_ASSERT((A) != 0); \
sigemptyset(&l_set); \ sigemptyset(&l_set); \
l_s.sa_handler = (B); \ l_s.sa_handler = (B); \
l_s.sa_mask = l_set; \ l_s.sa_mask = l_set; \
l_s.sa_flags = 0; \ l_s.sa_flags = 0; \
l_rc= sigaction((A), &l_s, (struct sigaction *) NULL);\ IF_DBUG(l_rc=) sigaction((A), &l_s, NULL); \
DBUG_ASSERT(l_rc == 0); \ DBUG_ASSERT(l_rc == 0); \
} while (0) } while (0)
#elif defined(HAVE_SIGSET) && !defined(my_sigset) #elif defined(HAVE_SIGSET) && !defined(my_sigset)
@ -715,7 +716,7 @@ extern uint thd_lib_detected;
The implementation is guaranteed to be thread safe, on all platforms. The implementation is guaranteed to be thread safe, on all platforms.
Note that the calling code should *not* assume the counter is protected Note that the calling code should *not* assume the counter is protected
by the mutex given, as the implementation of these helpers may change by the mutex given, as the implementation of these helpers may change
to use my_atomic operations instead. to use atomic operations instead.
*/ */
/* /*

View File

@ -44,7 +44,9 @@ extern "C" {
#endif #endif
#ifndef _global_h /* If not standard header */ #ifndef _global_h /* If not standard header */
#ifndef MYSQL_ABI_CHECK
#include <sys/types.h> #include <sys/types.h>
#endif
#ifdef __LCC__ #ifdef __LCC__
#include <winsock2.h> /* For windows */ #include <winsock2.h> /* For windows */
#endif #endif

View File

@ -1,4 +1,3 @@
#include <sys/types.h>
typedef char my_bool; typedef char my_bool;
typedef int my_socket; typedef int my_socket;
#include "mysql_version.h" #include "mysql_version.h"

View File

@ -62,7 +62,9 @@ extern const char * NEAR globerrs[]; /* my_error_messages is here */
#define EE_UNKNOWN_COLLATION 28 #define EE_UNKNOWN_COLLATION 28
#define EE_FILENOTFOUND 29 #define EE_FILENOTFOUND 29
#define EE_FILE_NOT_CLOSED 30 #define EE_FILE_NOT_CLOSED 30
#define EE_ERROR_LAST 30 /* Copy last error nr */ #define EE_CHANGE_OWNERSHIP 31
#define EE_CHANGE_PERMISSIONS 32
#define EE_ERROR_LAST 32 /* Copy last error nr */
/* Add error numbers before EE_ERROR_LAST and change it accordingly. */ /* Add error numbers before EE_ERROR_LAST and change it accordingly. */
/* exit codes for all MySQL programs */ /* exit codes for all MySQL programs */

View File

@ -38,7 +38,7 @@ mystringsobjects = strmov.lo strxmov.lo strxnmov.lo strnmov.lo \
strmake.lo strend.lo strtod.lo \ strmake.lo strend.lo strtod.lo \
strnlen.lo strfill.lo is_prefix.lo \ strnlen.lo strfill.lo is_prefix.lo \
int2str.lo str2int.lo strinstr.lo strcont.lo \ int2str.lo str2int.lo strinstr.lo strcont.lo \
strcend.lo bcmp.lo ctype-latin1.lo \ strcend.lo ctype-latin1.lo \
bchange.lo bmove.lo bmove_upp.lo longlong2str.lo \ bchange.lo bmove.lo bmove_upp.lo longlong2str.lo \
strtoull.lo strtoll.lo llstr.lo my_vsnprintf.lo \ strtoull.lo strtoll.lo llstr.lo my_vsnprintf.lo \
ctype.lo ctype-simple.lo ctype-bin.lo ctype-mb.lo \ ctype.lo ctype-simple.lo ctype-bin.lo ctype-mb.lo \

View File

@ -4421,11 +4421,11 @@ static my_bool setup_one_fetch_function(MYSQL_BIND *param, MYSQL_FIELD *field)
case MYSQL_TYPE_TIME: case MYSQL_TYPE_TIME:
field->max_length= 15; /* 19:23:48.123456 */ field->max_length= 15; /* 19:23:48.123456 */
param->skip_result= skip_result_with_length; param->skip_result= skip_result_with_length;
break;
case MYSQL_TYPE_DATE: case MYSQL_TYPE_DATE:
field->max_length= 10; /* 2003-11-11 */ field->max_length= 10; /* 2003-11-11 */
param->skip_result= skip_result_with_length; param->skip_result= skip_result_with_length;
break; break;
break;
case MYSQL_TYPE_DATETIME: case MYSQL_TYPE_DATETIME:
case MYSQL_TYPE_TIMESTAMP: case MYSQL_TYPE_TIMESTAMP:
param->skip_result= skip_result_with_length; param->skip_result= skip_result_with_length;

View File

@ -42,7 +42,8 @@ LDADD = @CLIENT_EXTRA_LDFLAGS@ ../libmysqld.a @LIBDL@ $(CXXLDFLAGS) \
mysqltest_embedded_LINK = $(CXXLINK) mysqltest_embedded_LINK = $(CXXLINK)
nodist_mysqltest_embedded_SOURCES = mysqltest.cc nodist_mysqltest_embedded_SOURCES = mysqltest.cc
mysqltest_embedded_LDADD = $(LDADD) $(top_builddir)/regex/libregex.a mysqltest_embedded_LDADD = $(LDADD) $(top_builddir)/regex/libregex.a \
@MYSQLD_EXTRA_LDFLAGS@
nodist_mysql_SOURCES = mysql.cc readline.cc completion_hash.cc \ nodist_mysql_SOURCES = mysql.cc readline.cc completion_hash.cc \
my_readline.h sql_string.h completion_hash.h my_readline.h sql_string.h completion_hash.h

View File

@ -725,9 +725,9 @@ call p_verify_status_increment(4, 4, 4, 4);
alter table t3 add column (b int); alter table t3 add column (b int);
call p_verify_status_increment(2, 0, 2, 0); call p_verify_status_increment(2, 0, 2, 0);
alter table t3 rename t4; alter table t3 rename t4;
call p_verify_status_increment(2, 2, 2, 2); call p_verify_status_increment(1, 0, 1, 0);
rename table t4 to t3; rename table t4 to t3;
call p_verify_status_increment(2, 2, 2, 2); call p_verify_status_increment(1, 0, 1, 0);
truncate table t3; truncate table t3;
call p_verify_status_increment(4, 4, 4, 4); call p_verify_status_increment(4, 4, 4, 4);
create view v1 as select * from t2; create view v1 as select * from t2;

View File

@ -64,17 +64,13 @@ let $_diff_table=$diff_table_2;
let $_diff_i=2; let $_diff_i=2;
while ($_diff_i) { while ($_diff_i) {
# Parse out any leading "master:" or "slave:" from the table # Parse out any leading "master:" or "slave:" from the table specification
# specification and connect the appropriate server. # and connect the appropriate server.
let $_diff_conn_master=`SELECT SUBSTR('$_diff_table', 1, 7) = 'master:'`; let $_pos= `SELECT LOCATE(':', '$_diff_table')`;
if ($_diff_conn_master) { let $_diff_conn=`SELECT SUBSTR('$_diff_table', 1, $_pos-1)`;
let $_diff_table=`SELECT SUBSTR('$_diff_table', 8)`; if (`SELECT 'XX$_diff_conn' <> 'XX'`) {
connection master; let $_diff_table=`SELECT SUBSTR('$_diff_table', $_pos+1)`;
} connection $_diff_conn;
let $_diff_conn_slave=`SELECT SUBSTR('$_diff_table', 1, 6) = 'slave:'`;
if ($_diff_conn_slave) {
let $_diff_table=`SELECT SUBSTR('$_diff_table', 7)`;
connection slave;
} }
# Sanity-check the input. # Sanity-check the input.

View File

@ -0,0 +1,35 @@
# #############################################################################
# Check whether the given table is consistent between different master and
# slaves
#
# Usage:
# --let $diff_table= test.t1
# --let $diff_server_list= master, slave, slave2
# --source include/rpl_diff_tables.inc
# #############################################################################
if (`SELECT "XX$diff_table" = "XX"`)
{
--die diff_table is null.
}
--let $_servers= master, slave
if (`SELECT "XX$diff_server_list" <> "XX"`)
{
--let $_servers= $diff_server_list
}
--let $_master= `SELECT SUBSTRING_INDEX('$_servers', ',', 1)`
--let $_servers= `SELECT LTRIM(SUBSTRING('$_servers', LENGTH('$_master') + 2))`
connection $_master;
while (`SELECT "XX$_servers" <> "XX"`)
{
--let $_slave= `SELECT SUBSTRING_INDEX('$_servers', ',', 1)`
--let $_servers= `SELECT LTRIM(SUBSTRING('$_servers', LENGTH('$_slave') + 2))`
--sync_slave_with_master $_slave
--let $diff_table_1= $_master:$diff_table
--let $diff_table_2= $_slave:$diff_table
--source include/diff_tables.inc
connection $_slave;
}

View File

@ -159,7 +159,7 @@ int main(int argc, char* const argv[] )
signal(SIGCHLD, handle_signal); signal(SIGCHLD, handle_signal);
signal(SIGABRT, handle_abort); signal(SIGABRT, handle_abort);
sprintf(safe_process_name, "safe_process[%d]", own_pid); sprintf(safe_process_name, "safe_process[%ld]", (long) own_pid);
message("Started"); message("Started");

View File

@ -841,11 +841,11 @@ call p_verify_status_increment(2, 0, 2, 0);
SUCCESS SUCCESS
alter table t3 rename t4; alter table t3 rename t4;
call p_verify_status_increment(2, 2, 2, 2); call p_verify_status_increment(1, 0, 1, 0);
SUCCESS SUCCESS
rename table t4 to t3; rename table t4 to t3;
call p_verify_status_increment(2, 2, 2, 2); call p_verify_status_increment(1, 0, 1, 0);
SUCCESS SUCCESS
truncate table t3; truncate table t3;

View File

@ -530,3 +530,19 @@ MAX(t2.f2)
NULL NULL
DROP TABLE t1,t2; DROP TABLE t1,t2;
End of 5.0 tests End of 5.0 tests
#
# Bug#54416 MAX from JOIN with HAVING returning NULL with 5.1 and Empty set
#
CREATE TABLE t1 (f1 INT(11), f2 VARCHAR(1), PRIMARY KEY (f1));
INSERT INTO t1 VALUES (1,'f');
CREATE TABLE t2 (f1 INT(11), f2 VARCHAR(1));
INSERT INTO t2 VALUES (2,'m');
INSERT INTO t2 VALUES (3,'m');
INSERT INTO t2 VALUES (11,NULL);
INSERT INTO t2 VALUES (12,'k');
SELECT MAX(t1.f1) field1
FROM t1 JOIN t2 ON t2.f2 LIKE 'x'
HAVING field1 < 7;
field1
DROP TABLE t1,t2;
End of 5.1 tests

View File

@ -1757,4 +1757,21 @@ WHERE INFORMATION_SCHEMA.COLUMNS.TABLE_NAME = 'variables';
COLUMN_DEFAULT TABLE_NAME COLUMN_DEFAULT TABLE_NAME
NULL variables NULL variables
DROP TABLE variables; DROP TABLE variables;
#
# Bug #53814: NUMERIC_PRECISION for unsigned bigint field is 19,
# should be 20
#
CREATE TABLE ubig (a BIGINT, b BIGINT UNSIGNED);
SELECT TABLE_NAME, COLUMN_NAME, NUMERIC_PRECISION
FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='ubig';
TABLE_NAME COLUMN_NAME NUMERIC_PRECISION
ubig a 19
ubig b 20
INSERT INTO ubig VALUES (0xFFFFFFFFFFFFFFFF,0xFFFFFFFFFFFFFFFF);
Warnings:
Warning 1264 Out of range value for column 'a' at row 1
SELECT length(CAST(b AS CHAR)) FROM ubig;
length(CAST(b AS CHAR))
20
DROP TABLE ubig;
End of 5.1 tests. End of 5.1 tests.

View File

@ -503,4 +503,33 @@ DROP TABLE t1;
CREATE TABLE t1 (id INT NOT NULL); CREATE TABLE t1 (id INT NOT NULL);
LOAD DATA LOCAL INFILE 'tb.txt' INTO TABLE t1; LOAD DATA LOCAL INFILE 'tb.txt' INTO TABLE t1;
DROP TABLE t1; DROP TABLE t1;
#
# Bug #51876 : crash/memory underrun when loading data with ucs2
# and reverse() function
#
# Problem # 1 (original report): wrong parsing of ucs2 data
SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp.txt';
CREATE TABLE t1(a INT);
LOAD DATA INFILE 'tmpp.txt' INTO TABLE t1 CHARACTER SET ucs2
(@b) SET a=REVERSE(@b);
Warnings:
Warning 1366 Incorrect integer value: '00' for column 'a' at row 1
Warning 1366 Incorrect integer value: '10' for column 'a' at row 2
# should return 2 zeroes (as the value is truncated)
SELECT * FROM t1;
a
0
0
DROP TABLE t1;
# Problem # 2 : if you write and read ucs2 data to a file they're lost
SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp2.txt' CHARACTER SET ucs2;
CREATE TABLE t1(a INT);
LOAD DATA INFILE 'tmpp2.txt' INTO TABLE t1 CHARACTER SET ucs2
(@b) SET a=REVERSE(@b);
# should return 0 and 1 (10 reversed)
SELECT * FROM t1;
a
0
1
DROP TABLE t1;
End of 5.1 tests End of 5.1 tests

View File

@ -56,6 +56,7 @@ CREATE DATABASE `TEST_$1`;
SHOW DATABASES LIKE "TEST%"; SHOW DATABASES LIKE "TEST%";
Database (TEST%) Database (TEST%)
TEST_$1 TEST_$1
test
DROP DATABASE `test_$1`; DROP DATABASE `test_$1`;
CREATE TABLE T1 (a int) engine=innodb; CREATE TABLE T1 (a int) engine=innodb;
INSERT INTO T1 VALUES (1); INSERT INTO T1 VALUES (1);
@ -171,6 +172,6 @@ create table myUC (i int);
select TABLE_SCHEMA,TABLE_NAME FROM information_schema.TABLES select TABLE_SCHEMA,TABLE_NAME FROM information_schema.TABLES
where TABLE_SCHEMA ='mysqltest_LC2'; where TABLE_SCHEMA ='mysqltest_LC2';
TABLE_SCHEMA TABLE_NAME TABLE_SCHEMA TABLE_NAME
mysqltest_LC2 myUC mysqltest_lc2 myUC
use test; use test;
drop database mysqltest_LC2; drop database mysqltest_LC2;

View File

@ -148,3 +148,20 @@ a
DROP VIEW v1; DROP VIEW v1;
DROP TABLE t1; DROP TABLE t1;
End of 5.0 tests. End of 5.0 tests.
#
# Bug #53095: SELECT column_name FROM INFORMATION_SCHEMA.STATISTICS
# returns nothing
#
CREATE TABLE `ttt` (
`f1` char(3) NOT NULL,
PRIMARY KEY (`f1`)
) ENGINE=myisam DEFAULT CHARSET=latin1;
SELECT count(COLUMN_NAME) FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME =
'TTT';
count(COLUMN_NAME)
1
SELECT count(*) FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME = 'TTT';
count(*)
1
DROP TABLE `ttt`;
End of 5.0 tests.

View File

@ -169,3 +169,45 @@ DROP PROCEDURE testproc;
WARNING: NULL values of the 'character_set_client' column ('mysql.proc' table) have been updated with a default value (latin1). Please verify if necessary. WARNING: NULL values of the 'character_set_client' column ('mysql.proc' table) have been updated with a default value (latin1). Please verify if necessary.
WARNING: NULL values of the 'collation_connection' column ('mysql.proc' table) have been updated with a default value (latin1_swedish_ci). Please verify if necessary. WARNING: NULL values of the 'collation_connection' column ('mysql.proc' table) have been updated with a default value (latin1_swedish_ci). Please verify if necessary.
WARNING: NULL values of the 'db_collation' column ('mysql.proc' table) have been updated with default values. Please verify if necessary. WARNING: NULL values of the 'db_collation' column ('mysql.proc' table) have been updated with default values. Please verify if necessary.
#
# Bug #53613: mysql_upgrade incorrectly revokes
# TRIGGER privilege on given table
#
GRANT USAGE ON *.* TO 'user3'@'%';
GRANT ALL PRIVILEGES ON `roelt`.`test2` TO 'user3'@'%';
Run mysql_upgrade with all privileges on a user
mtr.global_suppressions OK
mtr.test_suppressions OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
mysql.general_log
Error : You can't use locks with log tables.
status : OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.servers OK
mysql.slow_log
Error : You can't use locks with log tables.
status : OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
SHOW GRANTS FOR 'user3'@'%';
Grants for user3@%
GRANT USAGE ON *.* TO 'user3'@'%'
GRANT ALL PRIVILEGES ON `roelt`.`test2` TO 'user3'@'%'
DROP USER 'user3'@'%';
End of 5.1 tests

View File

@ -527,3 +527,17 @@ ERROR HY000: You are using safe update mode and you tried to update a table with
SET SESSION sql_safe_updates = DEFAULT; SET SESSION sql_safe_updates = DEFAULT;
DROP TABLE t1; DROP TABLE t1;
DROP VIEW v1; DROP VIEW v1;
#
# Bug#54734 assert in Diagnostics_area::set_ok_status
#
DROP TABLE IF EXISTS t1, not_exists;
DROP FUNCTION IF EXISTS f1;
DROP VIEW IF EXISTS v1;
CREATE TABLE t1 (PRIMARY KEY(pk)) AS SELECT 1 AS pk;
CREATE FUNCTION f1() RETURNS INTEGER RETURN (SELECT 1 FROM not_exists);
CREATE VIEW v1 AS SELECT pk FROM t1 WHERE f1() = 13;
UPDATE v1 SET pk = 7 WHERE pk > 0;
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
DROP VIEW v1;
DROP FUNCTION f1;
DROP TABLE t1;

View File

@ -328,7 +328,7 @@ ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_
SELECT table_schema,table_name FROM information_schema.tables SELECT table_schema,table_name FROM information_schema.tables
WHERE table_schema = 'information_schema' AND table_name = 'tables'; WHERE table_schema = 'information_schema' AND table_name = 'tables';
table_schema table_name table_schema table_name
information_schema tables information_schema TABLES
SELECT * FROM information_schema.table_privileges SELECT * FROM information_schema.table_privileges
WHERE table_schema = 'information_schema'; WHERE table_schema = 'information_schema';
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE

View File

@ -450,9 +450,9 @@ NULL test tb1 f27 27 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned zero
NULL test tb1 f28 28 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references NULL test tb1 f28 28 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references
NULL test tb1 f29 29 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) select,insert,update,references NULL test tb1 f29 29 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) select,insert,update,references
NULL test tb1 f3 3 NULL YES char 0 0 NULL NULL latin1 latin1_swedish_ci char(0) select,insert,update,references NULL test tb1 f3 3 NULL YES char 0 0 NULL NULL latin1 latin1_swedish_ci char(0) select,insert,update,references
NULL test tb1 f30 30 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned select,insert,update,references NULL test tb1 f30 30 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned select,insert,update,references
NULL test tb1 f31 31 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references NULL test tb1 f31 31 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
NULL test tb1 f32 32 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references NULL test tb1 f32 32 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
NULL test tb1 f33 33 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references NULL test tb1 f33 33 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
NULL test tb1 f34 34 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references NULL test tb1 f34 34 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
NULL test tb1 f35 35 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NULL test tb1 f35 35 NULL YES decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
@ -565,9 +565,9 @@ NULL test tb3 f143 26 99999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned s
NULL test tb3 f144 27 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references NULL test tb3 f144 27 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references
NULL test tb3 f145 28 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references NULL test tb3 f145 28 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references
NULL test tb3 f146 29 999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) select,insert,update,references NULL test tb3 f146 29 999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) select,insert,update,references
NULL test tb3 f147 30 999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned select,insert,update,references NULL test tb3 f147 30 999999 NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned select,insert,update,references
NULL test tb3 f148 31 00000000000000999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references NULL test tb3 f148 31 00000000000000999999 NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
NULL test tb3 f149 32 00000000000000999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references NULL test tb3 f149 32 00000000000000999999 NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
NULL test tb3 f150 33 1000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references NULL test tb3 f150 33 1000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
NULL test tb3 f151 34 999 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references NULL test tb3 f151 34 999 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
NULL test tb3 f152 35 0000001000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NULL test tb3 f152 35 0000001000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references

View File

@ -15,8 +15,8 @@ NULL information_schema COLLATIONS IS_DEFAULT 4 NO varchar 3 9 NULL NULL utf8 u
NULL information_schema COLLATIONS SORTLEN 6 0 NO bigint NULL NULL 19 0 NULL NULL bigint(3) select NULL information_schema COLLATIONS SORTLEN 6 0 NO bigint NULL NULL 19 0 NULL NULL bigint(3) select
NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME 2 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME 2 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME 1 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME 1 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema COLUMNS CHARACTER_MAXIMUM_LENGTH 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema COLUMNS CHARACTER_MAXIMUM_LENGTH 9 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
NULL information_schema COLUMNS CHARACTER_OCTET_LENGTH 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema COLUMNS CHARACTER_OCTET_LENGTH 10 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
NULL information_schema COLUMNS CHARACTER_SET_NAME 13 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select NULL information_schema COLUMNS CHARACTER_SET_NAME 13 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select NULL information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema COLUMNS COLUMN_COMMENT 19 NO varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) select NULL information_schema COLUMNS COLUMN_COMMENT 19 NO varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) select
@ -27,9 +27,9 @@ NULL information_schema COLUMNS COLUMN_TYPE 15 NULL NO longtext 4294967295 42949
NULL information_schema COLUMNS DATA_TYPE 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema COLUMNS DATA_TYPE 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema COLUMNS EXTRA 17 NO varchar 27 81 NULL NULL utf8 utf8_general_ci varchar(27) select NULL information_schema COLUMNS EXTRA 17 NO varchar 27 81 NULL NULL utf8 utf8_general_ci varchar(27) select
NULL information_schema COLUMNS IS_NULLABLE 7 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select NULL information_schema COLUMNS IS_NULLABLE 7 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3) select
NULL information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
NULL information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
NULL information_schema COLUMNS ORDINAL_POSITION 5 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema COLUMNS ORDINAL_POSITION 5 0 NO bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
NULL information_schema COLUMNS PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select NULL information_schema COLUMNS PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
NULL information_schema COLUMNS TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select NULL information_schema COLUMNS TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
NULL information_schema COLUMNS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema COLUMNS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@ -71,14 +71,14 @@ NULL information_schema EVENTS SQL_MODE 12 NO varchar 8192 24576 NULL NULL utf8
NULL information_schema EVENTS STARTS 13 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select NULL information_schema EVENTS STARTS 13 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema EVENTS STATUS 15 NO varchar 18 54 NULL NULL utf8 utf8_general_ci varchar(18) select NULL information_schema EVENTS STATUS 15 NO varchar 18 54 NULL NULL utf8 utf8_general_ci varchar(18) select
NULL information_schema EVENTS TIME_ZONE 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema EVENTS TIME_ZONE 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema FILES AUTOEXTEND_SIZE 19 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema FILES AUTOEXTEND_SIZE 19 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
NULL information_schema FILES AVG_ROW_LENGTH 28 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema FILES AVG_ROW_LENGTH 28 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
NULL information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
NULL information_schema FILES CHECK_TIME 35 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select NULL information_schema FILES CHECK_TIME 35 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema FILES CREATE_TIME 33 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select NULL information_schema FILES CREATE_TIME 33 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema FILES CREATION_TIME 20 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select NULL information_schema FILES CREATION_TIME 20 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema FILES DATA_FREE 32 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema FILES DATA_FREE 32 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
NULL information_schema FILES DATA_LENGTH 29 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema FILES DATA_LENGTH 29 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
NULL information_schema FILES DELETED_ROWS 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) select NULL information_schema FILES DELETED_ROWS 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) select
NULL information_schema FILES ENGINE 10 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema FILES ENGINE 10 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema FILES EXTENT_SIZE 16 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) select NULL information_schema FILES EXTENT_SIZE 16 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4) select
@ -88,27 +88,27 @@ NULL information_schema FILES FILE_NAME 2 NULL YES varchar 64 192 NULL NULL utf8
NULL information_schema FILES FILE_TYPE 3 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select NULL information_schema FILES FILE_TYPE 3 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
NULL information_schema FILES FREE_EXTENTS 14 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) select NULL information_schema FILES FREE_EXTENTS 14 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) select
NULL information_schema FILES FULLTEXT_KEYS 11 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema FILES FULLTEXT_KEYS 11 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema FILES INDEX_LENGTH 31 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema FILES INDEX_LENGTH 31 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
NULL information_schema FILES INITIAL_SIZE 17 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema FILES INITIAL_SIZE 17 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
NULL information_schema FILES LAST_ACCESS_TIME 22 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select NULL information_schema FILES LAST_ACCESS_TIME 22 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema FILES LAST_UPDATE_TIME 21 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select NULL information_schema FILES LAST_UPDATE_TIME 21 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema FILES LOGFILE_GROUP_NAME 8 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema FILES LOGFILE_GROUP_NAME 8 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema FILES LOGFILE_GROUP_NUMBER 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) select NULL information_schema FILES LOGFILE_GROUP_NUMBER 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) select
NULL information_schema FILES MAXIMUM_SIZE 18 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema FILES MAXIMUM_SIZE 18 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
NULL information_schema FILES MAX_DATA_LENGTH 30 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema FILES MAX_DATA_LENGTH 30 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
NULL information_schema FILES RECOVER_TIME 23 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) select NULL information_schema FILES RECOVER_TIME 23 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) select
NULL information_schema FILES ROW_FORMAT 26 NULL YES varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10) select NULL information_schema FILES ROW_FORMAT 26 NULL YES varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10) select
NULL information_schema FILES STATUS 37 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select NULL information_schema FILES STATUS 37 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
NULL information_schema FILES TABLESPACE_NAME 4 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema FILES TABLESPACE_NAME 4 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema FILES TABLE_CATALOG 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema FILES TABLE_CATALOG 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema FILES TABLE_NAME 7 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema FILES TABLE_NAME 7 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema FILES TABLE_ROWS 27 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema FILES TABLE_ROWS 27 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
NULL information_schema FILES TABLE_SCHEMA 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema FILES TABLE_SCHEMA 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema FILES TOTAL_EXTENTS 15 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) select NULL information_schema FILES TOTAL_EXTENTS 15 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) select
NULL information_schema FILES TRANSACTION_COUNTER 24 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) select NULL information_schema FILES TRANSACTION_COUNTER 24 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) select
NULL information_schema FILES UPDATE_COUNT 13 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) select NULL information_schema FILES UPDATE_COUNT 13 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4) select
NULL information_schema FILES UPDATE_TIME 34 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select NULL information_schema FILES UPDATE_TIME 34 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema FILES VERSION 25 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema FILES VERSION 25 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
NULL information_schema GLOBAL_STATUS VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema GLOBAL_STATUS VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024) select NULL information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL utf8 utf8_general_ci varchar(1024) select
NULL information_schema GLOBAL_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema GLOBAL_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@ -125,29 +125,29 @@ NULL information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_SCHEMA 10 NULL YES var
NULL information_schema KEY_COLUMN_USAGE TABLE_CATALOG 4 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select NULL information_schema KEY_COLUMN_USAGE TABLE_CATALOG 4 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
NULL information_schema KEY_COLUMN_USAGE TABLE_NAME 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema KEY_COLUMN_USAGE TABLE_NAME 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema KEY_COLUMN_USAGE TABLE_SCHEMA 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema KEY_COLUMN_USAGE TABLE_SCHEMA 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema PARTITIONS AVG_ROW_LENGTH 14 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema PARTITIONS AVG_ROW_LENGTH 14 0 NO bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
NULL information_schema PARTITIONS CHECKSUM 22 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema PARTITIONS CHECKSUM 22 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
NULL information_schema PARTITIONS CHECK_TIME 21 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select NULL information_schema PARTITIONS CHECK_TIME 21 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema PARTITIONS CREATE_TIME 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select NULL information_schema PARTITIONS CREATE_TIME 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema PARTITIONS DATA_FREE 18 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema PARTITIONS DATA_FREE 18 0 NO bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
NULL information_schema PARTITIONS DATA_LENGTH 15 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema PARTITIONS DATA_LENGTH 15 0 NO bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
NULL information_schema PARTITIONS INDEX_LENGTH 17 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema PARTITIONS INDEX_LENGTH 17 0 NO bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
NULL information_schema PARTITIONS MAX_DATA_LENGTH 16 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema PARTITIONS MAX_DATA_LENGTH 16 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
NULL information_schema PARTITIONS NODEGROUP 24 NO varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12) select NULL information_schema PARTITIONS NODEGROUP 24 NO varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12) select
NULL information_schema PARTITIONS PARTITION_COMMENT 23 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select NULL information_schema PARTITIONS PARTITION_COMMENT 23 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
NULL information_schema PARTITIONS PARTITION_DESCRIPTION 12 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select NULL information_schema PARTITIONS PARTITION_DESCRIPTION 12 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema PARTITIONS PARTITION_EXPRESSION 10 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select NULL information_schema PARTITIONS PARTITION_EXPRESSION 10 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema PARTITIONS PARTITION_METHOD 8 NULL YES varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12) select NULL information_schema PARTITIONS PARTITION_METHOD 8 NULL YES varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12) select
NULL information_schema PARTITIONS PARTITION_NAME 4 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema PARTITIONS PARTITION_NAME 4 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema PARTITIONS PARTITION_ORDINAL_POSITION 6 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema PARTITIONS PARTITION_ORDINAL_POSITION 6 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
NULL information_schema PARTITIONS SUBPARTITION_EXPRESSION 11 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select NULL information_schema PARTITIONS SUBPARTITION_EXPRESSION 11 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema PARTITIONS SUBPARTITION_METHOD 9 NULL YES varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12) select NULL information_schema PARTITIONS SUBPARTITION_METHOD 9 NULL YES varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12) select
NULL information_schema PARTITIONS SUBPARTITION_NAME 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema PARTITIONS SUBPARTITION_NAME 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema PARTITIONS SUBPARTITION_ORDINAL_POSITION 7 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema PARTITIONS SUBPARTITION_ORDINAL_POSITION 7 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
NULL information_schema PARTITIONS TABLESPACE_NAME 25 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema PARTITIONS TABLESPACE_NAME 25 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema PARTITIONS TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select NULL information_schema PARTITIONS TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
NULL information_schema PARTITIONS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema PARTITIONS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema PARTITIONS TABLE_ROWS 13 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema PARTITIONS TABLE_ROWS 13 0 NO bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
NULL information_schema PARTITIONS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema PARTITIONS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema PARTITIONS UPDATE_TIME 20 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select NULL information_schema PARTITIONS UPDATE_TIME 20 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema PLUGINS PLUGIN_AUTHOR 8 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema PLUGINS PLUGIN_AUTHOR 8 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
@ -231,27 +231,27 @@ NULL information_schema STATISTICS SUB_PART 11 NULL YES bigint NULL NULL 19 0 NU
NULL information_schema STATISTICS TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select NULL information_schema STATISTICS TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
NULL information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema TABLES AUTO_INCREMENT 14 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema TABLES AUTO_INCREMENT 14 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
NULL information_schema TABLES AVG_ROW_LENGTH 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema TABLES AVG_ROW_LENGTH 9 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
NULL information_schema TABLES CHECKSUM 19 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema TABLES CHECKSUM 19 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
NULL information_schema TABLES CHECK_TIME 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select NULL information_schema TABLES CHECK_TIME 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema TABLES CREATE_OPTIONS 20 NULL YES varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) select NULL information_schema TABLES CREATE_OPTIONS 20 NULL YES varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255) select
NULL information_schema TABLES CREATE_TIME 15 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select NULL information_schema TABLES CREATE_TIME 15 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema TABLES DATA_FREE 13 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema TABLES DATA_FREE 13 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
NULL information_schema TABLES DATA_LENGTH 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema TABLES DATA_LENGTH 10 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
NULL information_schema TABLES ENGINE 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema TABLES ENGINE 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema TABLES INDEX_LENGTH 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema TABLES INDEX_LENGTH 12 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
NULL information_schema TABLES MAX_DATA_LENGTH 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema TABLES MAX_DATA_LENGTH 11 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
NULL information_schema TABLES ROW_FORMAT 7 NULL YES varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10) select NULL information_schema TABLES ROW_FORMAT 7 NULL YES varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10) select
NULL information_schema TABLES TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select NULL information_schema TABLES TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
NULL information_schema TABLES TABLE_COLLATION 18 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select NULL information_schema TABLES TABLE_COLLATION 18 NULL YES varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema TABLES TABLE_COMMENT 21 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select NULL information_schema TABLES TABLE_COMMENT 21 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
NULL information_schema TABLES TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema TABLES TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema TABLES TABLE_ROWS 8 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema TABLES TABLE_ROWS 8 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
NULL information_schema TABLES TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema TABLES TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema TABLES TABLE_TYPE 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema TABLES TABLE_TYPE 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema TABLES UPDATE_TIME 16 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select NULL information_schema TABLES UPDATE_TIME 16 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema TABLES VERSION 6 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema TABLES VERSION 6 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(21) unsigned select
NULL information_schema TABLE_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select NULL information_schema TABLE_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
NULL information_schema TABLE_CONSTRAINTS CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema TABLE_CONSTRAINTS CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema TABLE_CONSTRAINTS CONSTRAINT_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema TABLE_CONSTRAINTS CONSTRAINT_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select

View File

@ -437,9 +437,9 @@ NULL test tb1 f27 19 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned zero
NULL test tb1 f28 20 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references NULL test tb1 f28 20 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references
NULL test tb1 f29 21 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) select,insert,update,references NULL test tb1 f29 21 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) select,insert,update,references
NULL test tb1 f3 3 NULL YES char 1 1 NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references NULL test tb1 f3 3 NULL YES char 1 1 NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references
NULL test tb1 f30 22 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned select,insert,update,references NULL test tb1 f30 22 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned select,insert,update,references
NULL test tb1 f31 23 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references NULL test tb1 f31 23 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
NULL test tb1 f32 24 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references NULL test tb1 f32 24 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
NULL test tb1 f33 25 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references NULL test tb1 f33 25 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
NULL test tb1 f34 26 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references NULL test tb1 f34 26 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
NULL test tb1 f35 27 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NULL test tb1 f35 27 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
@ -540,9 +540,9 @@ NULL test tb3 f143 20 99999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned s
NULL test tb3 f144 21 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references NULL test tb3 f144 21 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references
NULL test tb3 f145 22 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references NULL test tb3 f145 22 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references
NULL test tb3 f146 23 999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) select,insert,update,references NULL test tb3 f146 23 999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) select,insert,update,references
NULL test tb3 f147 24 999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned select,insert,update,references NULL test tb3 f147 24 999999 NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned select,insert,update,references
NULL test tb3 f148 25 00000000000000999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references NULL test tb3 f148 25 00000000000000999999 NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
NULL test tb3 f149 26 00000000000000999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references NULL test tb3 f149 26 00000000000000999999 NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
NULL test tb3 f150 27 1000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references NULL test tb3 f150 27 1000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
NULL test tb3 f151 28 999 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references NULL test tb3 f151 28 999 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
NULL test tb3 f152 29 0000001000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NULL test tb3 f152 29 0000001000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references

View File

@ -479,9 +479,9 @@ NULL test tb1 f27 27 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned zero
NULL test tb1 f28 28 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references NULL test tb1 f28 28 NULL YES int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references
NULL test tb1 f29 29 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) select,insert,update,references NULL test tb1 f29 29 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) select,insert,update,references
NULL test tb1 f3 3 NULL YES char 1 1 NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references NULL test tb1 f3 3 NULL YES char 1 1 NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references
NULL test tb1 f30 30 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned select,insert,update,references NULL test tb1 f30 30 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned select,insert,update,references
NULL test tb1 f31 31 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references NULL test tb1 f31 31 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
NULL test tb1 f32 32 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references NULL test tb1 f32 32 NULL YES bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
NULL test tb1 f33 33 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references NULL test tb1 f33 33 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
NULL test tb1 f34 34 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references NULL test tb1 f34 34 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
NULL test tb1 f35 35 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NULL test tb1 f35 35 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
@ -602,9 +602,9 @@ NULL test tb3 f143 26 99999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned s
NULL test tb3 f144 27 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references NULL test tb3 f144 27 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references
NULL test tb3 f145 28 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references NULL test tb3 f145 28 0000099999 NO int NULL NULL 10 0 NULL NULL int(10) unsigned zerofill select,insert,update,references
NULL test tb3 f146 29 999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) select,insert,update,references NULL test tb3 f146 29 999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) select,insert,update,references
NULL test tb3 f147 30 999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned select,insert,update,references NULL test tb3 f147 30 999999 NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned select,insert,update,references
NULL test tb3 f148 31 00000000000000999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references NULL test tb3 f148 31 00000000000000999999 NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
NULL test tb3 f149 32 00000000000000999999 NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references NULL test tb3 f149 32 00000000000000999999 NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned zerofill select,insert,update,references
NULL test tb3 f150 33 1000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references NULL test tb3 f150 33 1000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
NULL test tb3 f151 34 999 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references NULL test tb3 f151 34 999 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
NULL test tb3 f152 35 0000001000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NULL test tb3 f152 35 0000001000 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references

View File

@ -97,13 +97,13 @@ NULL mysql host Select_priv 3 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum(
NULL mysql host Show_view_priv 16 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NULL mysql host Show_view_priv 16 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
NULL mysql host Trigger_priv 20 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NULL mysql host Trigger_priv 20 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
NULL mysql host Update_priv 5 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references NULL mysql host Update_priv 5 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
NULL mysql ndb_binlog_index deletes 6 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned select,insert,update,references NULL mysql ndb_binlog_index deletes 6 NULL NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned select,insert,update,references
NULL mysql ndb_binlog_index epoch 3 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned PRI select,insert,update,references NULL mysql ndb_binlog_index epoch 3 NULL NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned PRI select,insert,update,references
NULL mysql ndb_binlog_index File 2 NULL NO varchar 255 255 NULL NULL latin1 latin1_swedish_ci varchar(255) select,insert,update,references NULL mysql ndb_binlog_index File 2 NULL NO varchar 255 255 NULL NULL latin1 latin1_swedish_ci varchar(255) select,insert,update,references
NULL mysql ndb_binlog_index inserts 4 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned select,insert,update,references NULL mysql ndb_binlog_index inserts 4 NULL NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned select,insert,update,references
NULL mysql ndb_binlog_index Position 1 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned select,insert,update,references NULL mysql ndb_binlog_index Position 1 NULL NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned select,insert,update,references
NULL mysql ndb_binlog_index schemaops 7 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned select,insert,update,references NULL mysql ndb_binlog_index schemaops 7 NULL NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned select,insert,update,references
NULL mysql ndb_binlog_index updates 5 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned select,insert,update,references NULL mysql ndb_binlog_index updates 5 NULL NO bigint NULL NULL 20 0 NULL NULL bigint(20) unsigned select,insert,update,references
NULL mysql plugin dl 2 NO char 128 384 NULL NULL utf8 utf8_bin char(128) select,insert,update,references NULL mysql plugin dl 2 NO char 128 384 NULL NULL utf8 utf8_bin char(128) select,insert,update,references
NULL mysql plugin name 1 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references NULL mysql plugin name 1 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
NULL mysql proc body 11 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL longblob select,insert,update,references NULL mysql proc body 11 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL longblob select,insert,update,references

View File

@ -0,0 +1,9 @@
#
# Bug#54453: Failing assertion: trx->active_trans when renaming a table with active trx
#
DROP TABLE IF EXISTS bug54453;
CREATE TABLE bug54453(a INT) ENGINE=InnoDB;
ALTER TABLE bug54453 RENAME TO bug54453_2;
SELECT * FROM bug54453_2;
a
DROP TABLE bug54453_2;

View File

@ -0,0 +1,15 @@
--source include/have_innodb_plugin.inc
--source include/have_log_bin.inc
--echo #
--echo # Bug#54453: Failing assertion: trx->active_trans when renaming a table with active trx
--echo #
--disable_warnings
DROP TABLE IF EXISTS bug54453;
--enable_warnings
CREATE TABLE bug54453(a INT) ENGINE=InnoDB;
ALTER TABLE bug54453 RENAME TO bug54453_2;
SELECT * FROM bug54453_2;
DROP TABLE bug54453_2;

View File

@ -0,0 +1,205 @@
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
# On slave2
# Connect slave2 to slave
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=SLAVE_MYPORT;,
MASTER_LOG_FILE='slave-bin.000001', MASTER_USER='root';
START SLAVE;
# [On master]
DROP VIEW IF EXISTS v_user;
DROP VIEW IF EXISTS v_tables_priv;
DROP VIEW IF EXISTS v_procs_priv;
DROP PROCEDURE IF EXISTS p1;
DROP PROCEDURE IF EXISTS my_grant;
DROP PROCEDURE IF EXISTS my_revoke;
DROP FUNCTION IF EXISTS my_user;
DROP EVENT IF EXISTS e1;
CREATE TABLE t1(c1 char(100));
CREATE VIEW test.v_user AS SELECT * FROM mysql.user WHERE User LIKE 'bug48321%';
CREATE VIEW test.v_tables_priv AS SELECT * FROM mysql.tables_priv WHERE User LIKE 'bug48321%';
CREATE VIEW test.v_procs_priv AS SELECT * FROM mysql.procs_priv WHERE User LIKE 'bug48321%';
CREATE VIEW test.v_event AS SELECT definer FROM mysql.event WHERE name = 'e1';
CREATE PROCEDURE p1() SELECT 1;
# bug48321_1-01234 has the max length(16) of user.
GRANT ALL PRIVILEGES ON *.* TO 'bug48321_1-01234'@'localhost' WITH GRANT OPTION;
# Make sure the max lengths of user and host
# the user name is too lengh
GRANT CREATE USER ON *.* TO '01234567890123456'@'fakehost';
ERROR HY000: String '01234567890123456' is too long for user name (should be no longer than 16)
# the host name is too lengh
GRANT CREATE USER ON *.* TO 'fakename'@'0123456789012345678901234567890123456789012345678901234567890';
ERROR HY000: String '0123456789012345678901234567890123456789012345678901234567890' is too long for host name (should be no longer than 60)
# User 'bug48321_1-01234' connects to master by conn1
# [On conn1]
# Verify 'REVOKE ALL' statement
REVOKE ALL PRIVILEGES, GRANT OPTION FROM CURRENT_USER();
Comparing tables master:test.v_user and slave:test.v_user
Comparing tables master:test.v_user and slave2:test.v_user
# Verify 'GRANT ... ON TABLE ...' statement
GRANT CREATE, INSERT, SELECT ON TABLE test.t1 TO CURRENT_USER();
Comparing tables master:test.v_tables_priv and slave:test.v_tables_priv
Comparing tables master:test.v_tables_priv and slave2:test.v_tables_priv
# Verify 'GRANT ... ON PROCEDURE...' statement
GRANT ALTER ROUTINE, EXECUTE ON PROCEDURE p1 TO CURRENT_USER();
Comparing tables master:test.v_procs_priv and slave:test.v_procs_priv
Comparing tables master:test.v_procs_priv and slave2:test.v_procs_priv
# Verify 'GRANT ... ON *.* ...' statement
GRANT ALL PRIVILEGES ON *.* TO CURRENT_USER() WITH GRANT OPTION;
Comparing tables master:test.v_procs_priv and slave:test.v_procs_priv
Comparing tables master:test.v_procs_priv and slave2:test.v_procs_priv
# Verify 'REVOKE ... ON TABLE ...' statement
REVOKE CREATE, INSERT, SELECT ON TABLE t1 FROM CURRENT_USER();
Comparing tables master:test.v_tables_priv and slave:test.v_tables_priv
Comparing tables master:test.v_tables_priv and slave2:test.v_tables_priv
# Verify 'REVOKE ... ON PROCEDURE...' statement
REVOKE ALTER ROUTINE, EXECUTE ON PROCEDURE p1 FROM CURRENT_USER();
Comparing tables master:test.v_procs_priv and slave:test.v_procs_priv
Comparing tables master:test.v_procs_priv and slave2:test.v_procs_priv
# Verify 'REVOKE ... ON *.* ...' statement
REVOKE ALL PRIVILEGES ON *.* FROM CURRENT_USER();
Comparing tables master:test.v_user and slave:test.v_user
Comparing tables master:test.v_user and slave2:test.v_user
# Verify 'GRANT ...' statement in the procedure
CREATE PROCEDURE my_grant()
GRANT CREATE, INSERT, SELECT ON TABLE test.t1 TO CURRENT_USER();
call my_grant;
Comparing tables master:test.v_tables_priv and slave:test.v_tables_priv
Comparing tables master:test.v_tables_priv and slave2:test.v_tables_priv
# Verify 'REVOKE ... ON TABLE ...' statement in the procedure
CREATE PROCEDURE my_revoke()
REVOKE CREATE, INSERT, SELECT ON TABLE t1 FROM CURRENT_USER();
call my_revoke;
Comparing tables master:test.v_tables_priv and slave:test.v_tables_priv
Comparing tables master:test.v_tables_priv and slave2:test.v_tables_priv
# Verify 'RENAME USER ...' statement
RENAME USER CURRENT_USER TO 'bug48321_2'@'localhost';
Comparing tables master:test.v_user and slave:test.v_user
Comparing tables master:test.v_user and slave2:test.v_user
# Verify 'DROP USER ...' statement
GRANT CREATE USER ON *.* TO 'bug48321_2'@'localhost';
DROP USER CURRENT_USER();
Comparing tables master:test.v_user and slave:test.v_user
Comparing tables master:test.v_user and slave2:test.v_user
# Verify 'ALTER EVENT...' statement
CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT * FROM t1;
# Explicitly assign CURRENT_USER() to definer
ALTER DEFINER=CURRENT_USER() EVENT e1 ENABLE;
Comparing tables master:test.v_event and slave:test.v_event
Comparing tables master:test.v_event and slave2:test.v_event
# Session user will be set as definer, if the statement does not assign
# a definer
ALTER EVENT e1 ENABLE;
Comparing tables master:test.v_event and slave:test.v_event
Comparing tables master:test.v_event and slave2:test.v_event
# Verify that this patch does not affect the calling of CURRENT_USER()
# in the other statements
# [On master]
INSERT INTO t1 VALUES(CURRENT_USER()), ('1234');
Warnings:
Note 1592 Statement may not be safe to log in statement format.
SELECT * FROM t1;
c1
root@localhost
1234
# [On slave]
SELECT * FROM t1;
c1
@
1234
# [On slave2]
SELECT * FROM t1;
c1
@
1234
# [On master]
UPDATE t1 SET c1=CURRENT_USER() WHERE c1='1234';
Warnings:
Note 1592 Statement may not be safe to log in statement format.
SELECT * FROM t1;
c1
root@localhost
root@localhost
# [On slave]
SELECT * FROM t1;
c1
@
@
# [On slave2]
SELECT * FROM t1;
c1
@
@
# [On master]
DELETE FROM t1 WHERE c1=CURRENT_USER();
Warnings:
Note 1592 Statement may not be safe to log in statement format.
SELECT * FROM t1;
c1
# [On slave]
SELECT * FROM t1;
c1
# [On slave2]
SELECT * FROM t1;
c1
# [On master]
CREATE TABLE t2(c1 char(100));
CREATE FUNCTION my_user() RETURNS VARCHAR(64)
SQL SECURITY INVOKER
BEGIN
INSERT INTO t2 VALUES(CURRENT_USER());
RETURN CURRENT_USER();
END |
INSERT INTO t1 VALUES(my_user());
Warnings:
Note 1592 Statement may not be safe to log in statement format.
Note 1592 Statement may not be safe to log in statement format.
SELECT * FROM t1;
c1
root@localhost
SELECT * FROM t2;
c1
root@localhost
# [On slave]
SELECT * FROM t1;
c1
@
SELECT * FROM t2;
c1
@
# [On slave2]
SELECT * FROM t1;
c1
@
SELECT * FROM t2;
c1
@
# END
DROP TABLE t1, t2;
DROP VIEW v_user, v_tables_priv, v_procs_priv, v_event;
DROP PROCEDURE p1;
DROP PROCEDURE my_grant;
DROP PROCEDURE my_revoke;
DROP FUNCTION my_user;
DROP EVENT e1;

View File

@ -750,7 +750,7 @@ test_rpl e2 root@localhost SYSTEM RECURRING NULL 1 # # NULL ENABLED 1 latin1 lat
USE test_rpl; USE test_rpl;
SHOW EVENTS; SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
test_rpl e2 @ SYSTEM RECURRING NULL 1 # # NULL SLAVESIDE_DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci test_rpl e2 root@localhost SYSTEM RECURRING NULL 1 # # NULL SLAVESIDE_DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
==========MASTER========== ==========MASTER==========
SELECT COUNT(*) FROM t1; SELECT COUNT(*) FROM t1;
COUNT(*) COUNT(*)

View File

@ -0,0 +1,9 @@
!include ../my.cnf
[mysqld.3]
server-id=3
log-bin=slave-bin
[ENV]
SLAVE_MYPORT1= @mysqld.3.port
SLAVE_MYSOCK1= @mysqld.3.socket

View File

@ -0,0 +1,238 @@
##############################################################################
# BUG#48321 CURRENT_USER() incorrectly replicated for DROP/RENAME USER,
# REVOKE, GRANT, ALTER EVENT
#
# Calling CURRENT_USER() results into inconsistency between slave and master,
# as the slave SQL thread has different user with common users.
#
# After the patch for bug#48321, session's user will be written into query log
# event if CURRENT_USER() is called in 'DROP/RENAME USER', 'REVOKE', 'GRANT',
# 'ALTER EVENT'.
#
##############################################################################
source include/master-slave.inc;
source include/have_binlog_format_statement.inc;
--echo
--echo # On slave2
connect (slave2,127.0.0.1,root,,test,$SLAVE_MYPORT1,);
connection slave2;
--echo # Connect slave2 to slave
--replace_result $SLAVE_MYPORT SLAVE_MYPORT;
eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$SLAVE_MYPORT,
MASTER_LOG_FILE='slave-bin.000001', MASTER_USER='root';
START SLAVE;
source include/wait_for_slave_to_start.inc;
--echo
--echo # [On master]
connection master;
--disable_warnings
DROP VIEW IF EXISTS v_user;
DROP VIEW IF EXISTS v_tables_priv;
DROP VIEW IF EXISTS v_procs_priv;
DROP PROCEDURE IF EXISTS p1;
DROP PROCEDURE IF EXISTS my_grant;
DROP PROCEDURE IF EXISTS my_revoke;
DROP FUNCTION IF EXISTS my_user;
DROP EVENT IF EXISTS e1;
--enable_warnings
CREATE TABLE t1(c1 char(100));
CREATE VIEW test.v_user AS SELECT * FROM mysql.user WHERE User LIKE 'bug48321%';
CREATE VIEW test.v_tables_priv AS SELECT * FROM mysql.tables_priv WHERE User LIKE 'bug48321%';
CREATE VIEW test.v_procs_priv AS SELECT * FROM mysql.procs_priv WHERE User LIKE 'bug48321%';
CREATE VIEW test.v_event AS SELECT definer FROM mysql.event WHERE name = 'e1';
CREATE PROCEDURE p1() SELECT 1;
--echo # bug48321_1-01234 has the max length(16) of user.
GRANT ALL PRIVILEGES ON *.* TO 'bug48321_1-01234'@'localhost' WITH GRANT OPTION;
--echo
--echo # Make sure the max lengths of user and host
--echo # the user name is too lengh
--error 1470
GRANT CREATE USER ON *.* TO '01234567890123456'@'fakehost';
--echo # the host name is too lengh
--error 1470
GRANT CREATE USER ON *.* TO 'fakename'@'0123456789012345678901234567890123456789012345678901234567890';
--echo
--echo # User 'bug48321_1-01234' connects to master by conn1
connect (conn1, 127.0.0.1, 'bug48321_1-01234'@'localhost',,);
connection conn1;
--echo # [On conn1]
--echo # Verify 'REVOKE ALL' statement
REVOKE ALL PRIVILEGES, GRANT OPTION FROM CURRENT_USER();
let $diff_table= test.v_user;
let $diff_server_list= master, slave, slave2;
source include/rpl_diff_tables.inc;
--echo
--echo # Verify 'GRANT ... ON TABLE ...' statement
connection conn1;
GRANT CREATE, INSERT, SELECT ON TABLE test.t1 TO CURRENT_USER();
let $diff_table= test.v_tables_priv;
source include/rpl_diff_tables.inc;
--echo
--echo # Verify 'GRANT ... ON PROCEDURE...' statement
connection conn1;
GRANT ALTER ROUTINE, EXECUTE ON PROCEDURE p1 TO CURRENT_USER();
let $diff_table= test.v_procs_priv;
source include/rpl_diff_tables.inc;
--echo
--echo # Verify 'GRANT ... ON *.* ...' statement
connection conn1;
GRANT ALL PRIVILEGES ON *.* TO CURRENT_USER() WITH GRANT OPTION;
source include/rpl_diff_tables.inc;
--echo
--echo # Verify 'REVOKE ... ON TABLE ...' statement
connection conn1;
REVOKE CREATE, INSERT, SELECT ON TABLE t1 FROM CURRENT_USER();
let $diff_table= test.v_tables_priv;
source include/rpl_diff_tables.inc;
--echo
--echo # Verify 'REVOKE ... ON PROCEDURE...' statement
connection conn1;
REVOKE ALTER ROUTINE, EXECUTE ON PROCEDURE p1 FROM CURRENT_USER();
let $diff_table= test.v_procs_priv;
source include/rpl_diff_tables.inc;
--echo
--echo # Verify 'REVOKE ... ON *.* ...' statement
connection conn1;
REVOKE ALL PRIVILEGES ON *.* FROM CURRENT_USER();
let $diff_table= test.v_user;
source include/rpl_diff_tables.inc;
--echo
--echo # Verify 'GRANT ...' statement in the procedure
connection conn1;
CREATE PROCEDURE my_grant()
GRANT CREATE, INSERT, SELECT ON TABLE test.t1 TO CURRENT_USER();
call my_grant;
let $diff_table= test.v_tables_priv;
source include/rpl_diff_tables.inc;
--echo
--echo # Verify 'REVOKE ... ON TABLE ...' statement in the procedure
connection conn1;
CREATE PROCEDURE my_revoke()
REVOKE CREATE, INSERT, SELECT ON TABLE t1 FROM CURRENT_USER();
call my_revoke;
let $diff_table= test.v_tables_priv;
source include/rpl_diff_tables.inc;
--echo
--echo # Verify 'RENAME USER ...' statement
connection conn1;
RENAME USER CURRENT_USER TO 'bug48321_2'@'localhost';
let $diff_table= test.v_user;
source include/rpl_diff_tables.inc;
disconnect conn1;
--echo
--echo # Verify 'DROP USER ...' statement
connection master;
GRANT CREATE USER ON *.* TO 'bug48321_2'@'localhost';
connect (conn1, 127.0.0.1, 'bug48321_2'@'localhost',,);
connection conn1;
DROP USER CURRENT_USER();
source include/rpl_diff_tables.inc;
--echo
--echo # Verify 'ALTER EVENT...' statement
connection master;
CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT * FROM t1;
--echo # Explicitly assign CURRENT_USER() to definer
ALTER DEFINER=CURRENT_USER() EVENT e1 ENABLE;
let $diff_table= test.v_event;
source include/rpl_diff_tables.inc;
connection master;
--echo
--echo # Session user will be set as definer, if the statement does not assign
--echo # a definer
ALTER EVENT e1 ENABLE;
sync_slave_with_master;
source include/rpl_diff_tables.inc;
--echo
--echo # Verify that this patch does not affect the calling of CURRENT_USER()
--echo # in the other statements
connection master;
--echo # [On master]
INSERT INTO t1 VALUES(CURRENT_USER()), ('1234');
SELECT * FROM t1;
sync_slave_with_master;
--echo # [On slave]
SELECT * FROM t1;
--echo # [On slave2]
sync_slave_with_master slave2;
SELECT * FROM t1;
connection master;
--echo # [On master]
UPDATE t1 SET c1=CURRENT_USER() WHERE c1='1234';
SELECT * FROM t1;
sync_slave_with_master;
--echo # [On slave]
SELECT * FROM t1;
sync_slave_with_master slave2;
--echo # [On slave2]
SELECT * FROM t1;
connection master;
--echo # [On master]
DELETE FROM t1 WHERE c1=CURRENT_USER();
SELECT * FROM t1;
sync_slave_with_master;
--echo # [On slave]
SELECT * FROM t1;
sync_slave_with_master slave2;
--echo # [On slave2]
SELECT * FROM t1;
connection master;
--echo # [On master]
CREATE TABLE t2(c1 char(100));
DELIMITER |;
CREATE FUNCTION my_user() RETURNS VARCHAR(64)
SQL SECURITY INVOKER
BEGIN
INSERT INTO t2 VALUES(CURRENT_USER());
RETURN CURRENT_USER();
END |
DELIMITER ;|
INSERT INTO t1 VALUES(my_user());
SELECT * FROM t1;
SELECT * FROM t2;
sync_slave_with_master;
--echo # [On slave]
SELECT * FROM t1;
SELECT * FROM t2;
sync_slave_with_master slave2;
--echo # [On slave2]
SELECT * FROM t1;
SELECT * FROM t2;
--echo
--echo # END
connection master;
DROP TABLE t1, t2;
DROP VIEW v_user, v_tables_priv, v_procs_priv, v_event;
DROP PROCEDURE p1;
DROP PROCEDURE my_grant;
DROP PROCEDURE my_revoke;
DROP FUNCTION my_user;
DROP EVENT e1;
sync_slave_with_master;
sync_slave_with_master slave2;
source include/master-slave-end.inc;

View File

@ -544,3 +544,24 @@ ORDER BY t1.f2;
DROP TABLE t1,t2; DROP TABLE t1,t2;
--echo End of 5.0 tests --echo End of 5.0 tests
--echo #
--echo # Bug#54416 MAX from JOIN with HAVING returning NULL with 5.1 and Empty set
--echo #
CREATE TABLE t1 (f1 INT(11), f2 VARCHAR(1), PRIMARY KEY (f1));
INSERT INTO t1 VALUES (1,'f');
CREATE TABLE t2 (f1 INT(11), f2 VARCHAR(1));
INSERT INTO t2 VALUES (2,'m');
INSERT INTO t2 VALUES (3,'m');
INSERT INTO t2 VALUES (11,NULL);
INSERT INTO t2 VALUES (12,'k');
SELECT MAX(t1.f1) field1
FROM t1 JOIN t2 ON t2.f2 LIKE 'x'
HAVING field1 < 7;
DROP TABLE t1,t2;
--echo End of 5.1 tests

View File

@ -1455,6 +1455,22 @@ FROM INFORMATION_SCHEMA.COLUMNS
WHERE INFORMATION_SCHEMA.COLUMNS.TABLE_NAME = 'variables'; WHERE INFORMATION_SCHEMA.COLUMNS.TABLE_NAME = 'variables';
DROP TABLE variables; DROP TABLE variables;
--echo #
--echo # Bug #53814: NUMERIC_PRECISION for unsigned bigint field is 19,
--echo # should be 20
--echo #
CREATE TABLE ubig (a BIGINT, b BIGINT UNSIGNED);
SELECT TABLE_NAME, COLUMN_NAME, NUMERIC_PRECISION
FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='ubig';
INSERT INTO ubig VALUES (0xFFFFFFFFFFFFFFFF,0xFFFFFFFFFFFFFFFF);
SELECT length(CAST(b AS CHAR)) FROM ubig;
DROP TABLE ubig;
--echo End of 5.1 tests. --echo End of 5.1 tests.
# Wait till all disconnects are completed # Wait till all disconnects are completed

View File

@ -580,4 +580,36 @@ DROP TABLE t1;
connection default; connection default;
disconnect con1; disconnect con1;
--echo #
--echo # Bug #51876 : crash/memory underrun when loading data with ucs2
--echo # and reverse() function
--echo #
--echo # Problem # 1 (original report): wrong parsing of ucs2 data
SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp.txt';
CREATE TABLE t1(a INT);
LOAD DATA INFILE 'tmpp.txt' INTO TABLE t1 CHARACTER SET ucs2
(@b) SET a=REVERSE(@b);
--echo # should return 2 zeroes (as the value is truncated)
SELECT * FROM t1;
DROP TABLE t1;
let $MYSQLD_DATADIR= `select @@datadir`;
remove_file $MYSQLD_DATADIR/test/tmpp.txt;
--echo # Problem # 2 : if you write and read ucs2 data to a file they're lost
SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp2.txt' CHARACTER SET ucs2;
CREATE TABLE t1(a INT);
LOAD DATA INFILE 'tmpp2.txt' INTO TABLE t1 CHARACTER SET ucs2
(@b) SET a=REVERSE(@b);
--echo # should return 0 and 1 (10 reversed)
SELECT * FROM t1;
DROP TABLE t1;
let $MYSQLD_DATADIR= `select @@datadir`;
remove_file $MYSQLD_DATADIR/test/tmpp2.txt;
--echo End of 5.1 tests --echo End of 5.1 tests

View File

@ -160,4 +160,26 @@ SELECT * FROM v1;
DROP VIEW v1; DROP VIEW v1;
DROP TABLE t1; DROP TABLE t1;
--echo End of 5.0 tests. --echo End of 5.0 tests.
--echo #
--echo # Bug #53095: SELECT column_name FROM INFORMATION_SCHEMA.STATISTICS
--echo # returns nothing
--echo #
CREATE TABLE `ttt` (
`f1` char(3) NOT NULL,
PRIMARY KEY (`f1`)
) ENGINE=myisam DEFAULT CHARSET=latin1;
SELECT count(COLUMN_NAME) FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME =
'TTT';
SELECT count(*) FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME = 'TTT';
DROP TABLE `ttt`;
--echo End of 5.0 tests.

View File

@ -108,3 +108,19 @@ CALL testproc();
DROP PROCEDURE testproc; DROP PROCEDURE testproc;
--cat_file $MYSQLTEST_VARDIR/tmp/41569.txt --cat_file $MYSQLTEST_VARDIR/tmp/41569.txt
--remove_file $MYSQLTEST_VARDIR/tmp/41569.txt --remove_file $MYSQLTEST_VARDIR/tmp/41569.txt
--echo #
--echo # Bug #53613: mysql_upgrade incorrectly revokes
--echo # TRIGGER privilege on given table
--echo #
GRANT USAGE ON *.* TO 'user3'@'%';
GRANT ALL PRIVILEGES ON `roelt`.`test2` TO 'user3'@'%';
--echo Run mysql_upgrade with all privileges on a user
--exec $MYSQL_UPGRADE --skip-verbose --force 2>&1
SHOW GRANTS FOR 'user3'@'%';
DROP USER 'user3'@'%';
--echo End of 5.1 tests

View File

@ -483,3 +483,23 @@ UPDATE IGNORE v1 SET a = 1;
SET SESSION sql_safe_updates = DEFAULT; SET SESSION sql_safe_updates = DEFAULT;
DROP TABLE t1; DROP TABLE t1;
DROP VIEW v1; DROP VIEW v1;
--echo #
--echo # Bug#54734 assert in Diagnostics_area::set_ok_status
--echo #
--disable_warnings
DROP TABLE IF EXISTS t1, not_exists;
DROP FUNCTION IF EXISTS f1;
DROP VIEW IF EXISTS v1;
--enable_warnings
CREATE TABLE t1 (PRIMARY KEY(pk)) AS SELECT 1 AS pk;
CREATE FUNCTION f1() RETURNS INTEGER RETURN (SELECT 1 FROM not_exists);
CREATE VIEW v1 AS SELECT pk FROM t1 WHERE f1() = 13;
--error ER_VIEW_INVALID
UPDATE v1 SET pk = 7 WHERE pk > 0;
DROP VIEW v1;
DROP FUNCTION f1;
DROP TABLE t1;

View File

@ -30,8 +30,7 @@ libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c my_mmap.c \
mf_tempdir.c my_lock.c mf_brkhant.c my_alarm.c \ mf_tempdir.c my_lock.c mf_brkhant.c my_alarm.c \
my_malloc.c my_realloc.c my_once.c mulalloc.c \ my_malloc.c my_realloc.c my_once.c mulalloc.c \
my_alloc.c safemalloc.c my_new.cc \ my_alloc.c safemalloc.c my_new.cc \
my_vle.c my_atomic.c \ my_vle.c my_fopen.c my_fstream.c my_getsystime.c \
my_fopen.c my_fstream.c my_getsystime.c \
my_error.c errors.c my_div.c my_messnc.c \ my_error.c errors.c my_div.c my_messnc.c \
mf_format.c mf_same.c mf_dirname.c mf_fn_ext.c \ mf_format.c mf_same.c mf_dirname.c mf_fn_ext.c \
my_symlink.c my_symlink2.c \ my_symlink.c my_symlink2.c \

View File

@ -49,7 +49,9 @@ const char * NEAR globerrs[GLOBERRS]=
"Can't sync file '%s' to disk (Errcode: %d)", "Can't sync file '%s' to disk (Errcode: %d)",
"Collation '%s' is not a compiled collation and is not specified in the '%s' file", "Collation '%s' is not a compiled collation and is not specified in the '%s' file",
"File '%s' not found (Errcode: %d)", "File '%s' not found (Errcode: %d)",
"File '%s' (fileno: %d) was not closed" "File '%s' (fileno: %d) was not closed",
"Can't change ownership of the file '%s' (Errcode: %d)",
"Can't change permissions of the file '%s' (Errcode: %d)",
}; };
void init_glob_errs(void) void init_glob_errs(void)
@ -90,6 +92,8 @@ void init_glob_errs()
EE(EE_UNKNOWN_COLLATION)= "Collation '%s' is not a compiled collation and is not specified in the %s file"; EE(EE_UNKNOWN_COLLATION)= "Collation '%s' is not a compiled collation and is not specified in the %s file";
EE(EE_FILENOTFOUND) = "File '%s' not found (Errcode: %d)"; EE(EE_FILENOTFOUND) = "File '%s' not found (Errcode: %d)";
EE(EE_FILE_NOT_CLOSED) = "File '%s' (fileno: %d) was not closed"; EE(EE_FILE_NOT_CLOSED) = "File '%s' (fileno: %d) was not closed";
EE(EE_CHANGE_OWNERSHIP) = "Can't change ownership of the file '%s' (Errcode: %d)";
EE(EE_CHANGE_PERMISSIONS) = "Can't change permissions of the file '%s' (Errcode: %d)";
} }
#endif #endif

View File

@ -1701,16 +1701,19 @@ int my_block_write(register IO_CACHE *info, const uchar *Buffer, size_t Count,
#endif #endif
int my_b_flush_io_cache(IO_CACHE *info, int need_append_buffer_lock) int my_b_flush_io_cache(IO_CACHE *info,
int need_append_buffer_lock __attribute__((unused)))
{ {
size_t length; size_t length;
my_bool append_cache;
my_off_t pos_in_file; my_off_t pos_in_file;
my_bool append_cache= (info->type == SEQ_READ_APPEND);
DBUG_ENTER("my_b_flush_io_cache"); DBUG_ENTER("my_b_flush_io_cache");
DBUG_PRINT("enter", ("cache: 0x%lx", (long) info)); DBUG_PRINT("enter", ("cache: 0x%lx", (long) info));
if (!(append_cache = (info->type == SEQ_READ_APPEND))) #ifdef THREAD
if (!append_cache)
need_append_buffer_lock= 0; need_append_buffer_lock= 0;
#endif
if (info->type == WRITE_CACHE || append_cache) if (info->type == WRITE_CACHE || append_cache)
{ {

View File

@ -42,7 +42,7 @@ char * my_load_path(char * to, const char *path,
if (is_cur) if (is_cur)
is_cur=2; /* Remove current dir */ is_cur=2; /* Remove current dir */
if (! my_getwd(buff,(uint) (FN_REFLEN-strlen(path)+is_cur),MYF(0))) if (! my_getwd(buff,(uint) (FN_REFLEN-strlen(path)+is_cur),MYF(0)))
VOID(strncat(buff, path+is_cur, FN_REFLEN)); VOID(strncat(buff, path+is_cur, FN_REFLEN-1));
else else
VOID(strnmov(buff, path, FN_REFLEN)); /* Return org file name */ VOID(strnmov(buff, path, FN_REFLEN)); /* Return org file name */
} }

View File

@ -52,7 +52,7 @@ void pack_dirname(char * to, const char *from)
buff_length= strlen(buff); buff_length= strlen(buff);
d_length= (size_t) (start-to); d_length= (size_t) (start-to);
if ((start == to || if ((start == to ||
(buff_length == d_length && !bcmp(buff,start,d_length))) && (buff_length == d_length && !memcmp(buff,start,d_length))) &&
*start != FN_LIBCHAR && *start) *start != FN_LIBCHAR && *start)
{ /* Put current dir before */ { /* Put current dir before */
bchange((uchar*) to, d_length, (uchar*) buff, buff_length, strlen(to)+1); bchange((uchar*) to, d_length, (uchar*) buff, buff_length, strlen(to)+1);
@ -70,7 +70,7 @@ void pack_dirname(char * to, const char *from)
} }
if (length > 1 && length < d_length) if (length > 1 && length < d_length)
{ /* test if /xx/yy -> ~/yy */ { /* test if /xx/yy -> ~/yy */
if (bcmp(to,home_dir,length) == 0 && to[length] == FN_LIBCHAR) if (memcmp(to,home_dir,length) == 0 && to[length] == FN_LIBCHAR)
{ {
to[0]=FN_HOMELIB; /* Filename begins with ~ */ to[0]=FN_HOMELIB; /* Filename begins with ~ */
(void) strmov_overlapp(to+1,to+length); (void) strmov_overlapp(to+1,to+length);
@ -80,7 +80,7 @@ void pack_dirname(char * to, const char *from)
{ /* Test if cwd is ~/... */ { /* Test if cwd is ~/... */
if (length > 1 && length < buff_length) if (length > 1 && length < buff_length)
{ {
if (bcmp(buff,home_dir,length) == 0 && buff[length] == FN_LIBCHAR) if (memcmp(buff,home_dir,length) == 0 && buff[length] == FN_LIBCHAR)
{ {
buff[0]=FN_HOMELIB; buff[0]=FN_HOMELIB;
(void) strmov_overlapp(buff+1,buff+length); (void) strmov_overlapp(buff+1,buff+length);
@ -166,7 +166,7 @@ size_t cleanup_dirname(register char *to, const char *from)
*pos = FN_LIBCHAR; *pos = FN_LIBCHAR;
if (*pos == FN_LIBCHAR) if (*pos == FN_LIBCHAR)
{ {
if ((size_t) (pos-start) > length && bcmp(pos-length,parent,length) == 0) if ((size_t) (pos-start) > length && memcmp(pos-length,parent,length) == 0)
{ /* If .../../; skip prev */ { /* If .../../; skip prev */
pos-=length; pos-=length;
if (pos != start) if (pos != start)
@ -197,7 +197,7 @@ size_t cleanup_dirname(register char *to, const char *from)
end_parentdir=pos; end_parentdir=pos;
while (pos >= start && *pos != FN_LIBCHAR) /* remove prev dir */ while (pos >= start && *pos != FN_LIBCHAR) /* remove prev dir */
pos--; pos--;
if (pos[1] == FN_HOMELIB || bcmp(pos,parent,length) == 0) if (pos[1] == FN_HOMELIB || memcmp(pos,parent,length) == 0)
{ /* Don't remove ~user/ */ { /* Don't remove ~user/ */
pos=strmov(end_parentdir+1,parent); pos=strmov(end_parentdir+1,parent);
*pos=FN_LIBCHAR; *pos=FN_LIBCHAR;
@ -206,7 +206,7 @@ size_t cleanup_dirname(register char *to, const char *from)
} }
} }
else if ((size_t) (pos-start) == length-1 && else if ((size_t) (pos-start) == length-1 &&
!bcmp(start,parent+1,length-1)) !memcmp(start,parent+1,length-1))
start=pos; /* Starts with "../" */ start=pos; /* Starts with "../" */
else if (pos-start > 0 && pos[-1] == FN_LIBCHAR) else if (pos-start > 0 && pos[-1] == FN_LIBCHAR)
{ {

View File

@ -1,45 +0,0 @@
/* Copyright (C) 2006 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <my_global.h>
#include <my_pthread.h>
#ifndef HAVE_INLINE
/* the following will cause all inline functions to be instantiated */
#define HAVE_INLINE
#undef STATIC_INLINE
#define STATIC_INLINE extern
#endif
#include <my_atomic.h>
/*
checks that the current build of atomic ops
can run on this machine
RETURN
ATOMIC_xxx values, see my_atomic.h
*/
int my_atomic_initialize()
{
compile_time_assert(sizeof(intptr) == sizeof(void *));
/* currently the only thing worth checking is SMP/UP issue */
#ifdef MY_ATOMIC_MODE_DUMMY
return my_getncpus() == 1 ? MY_ATOMIC_OK : MY_ATOMIC_NOT_1CPU;
#else
return MY_ATOMIC_OK;
#endif
}

View File

@ -508,10 +508,8 @@ uint bitmap_get_first_set(const MY_BITMAP *map)
if (*byte_ptr & (1 << k)) if (*byte_ptr & (1 << k))
return (i*32) + (j*8) + k; return (i*32) + (j*8) + k;
} }
DBUG_ASSERT(0);
} }
} }
DBUG_ASSERT(0);
} }
} }
return MY_BIT_NONE; return MY_BIT_NONE;
@ -542,10 +540,8 @@ uint bitmap_get_first(const MY_BITMAP *map)
if (!(*byte_ptr & (1 << k))) if (!(*byte_ptr & (1 << k)))
return (i*32) + (j*8) + k; return (i*32) + (j*8) + k;
} }
DBUG_ASSERT(0);
} }
} }
DBUG_ASSERT(0);
} }
} }
return MY_BIT_NONE; return MY_BIT_NONE;

View File

@ -16,6 +16,7 @@
#include "mysys_priv.h" #include "mysys_priv.h"
#include <my_dir.h> /* for stat */ #include <my_dir.h> /* for stat */
#include <m_string.h> #include <m_string.h>
#include "mysys_err.h"
#if defined(HAVE_UTIME_H) #if defined(HAVE_UTIME_H)
#include <utime.h> #include <utime.h>
#elif defined(HAVE_SYS_UTIME_H) #elif defined(HAVE_SYS_UTIME_H)
@ -56,7 +57,6 @@ int my_copy(const char *from, const char *to, myf MyFlags)
File from_file,to_file; File from_file,to_file;
uchar buff[IO_SIZE]; uchar buff[IO_SIZE];
MY_STAT stat_buff,new_stat_buff; MY_STAT stat_buff,new_stat_buff;
int res;
DBUG_ENTER("my_copy"); DBUG_ENTER("my_copy");
DBUG_PRINT("my",("from %s to %s MyFlags %d", from, to, MyFlags)); DBUG_PRINT("my",("from %s to %s MyFlags %d", from, to, MyFlags));
@ -102,9 +102,23 @@ int my_copy(const char *from, const char *to, myf MyFlags)
if (MyFlags & MY_HOLD_ORIGINAL_MODES && !new_file_stat) if (MyFlags & MY_HOLD_ORIGINAL_MODES && !new_file_stat)
DBUG_RETURN(0); /* File copyed but not stat */ DBUG_RETURN(0); /* File copyed but not stat */
res= chmod(to, stat_buff.st_mode & 07777); /* Copy modes */ /* Copy modes */
if (chmod(to, stat_buff.st_mode & 07777))
{
my_errno= errno;
if (MyFlags & (MY_FAE+MY_WME))
my_error(EE_CHANGE_PERMISSIONS, MYF(ME_BELL+ME_WAITTANG), from, errno);
goto err;
}
#if !defined(__WIN__) && !defined(__NETWARE__) #if !defined(__WIN__) && !defined(__NETWARE__)
res= chown(to, stat_buff.st_uid,stat_buff.st_gid); /* Copy ownership */ /* Copy ownership */
if (chown(to, stat_buff.st_uid,stat_buff.st_gid))
{
my_errno= errno;
if (MyFlags & (MY_FAE+MY_WME))
my_error(EE_CHANGE_OWNERSHIP, MYF(ME_BELL+ME_WAITTANG), from, errno);
goto err;
}
#endif #endif
#if !defined(VMS) && !defined(__ZTC__) #if !defined(VMS) && !defined(__ZTC__)
if (MyFlags & MY_COPYTIME) if (MyFlags & MY_COPYTIME)

View File

@ -47,7 +47,7 @@ my_bool my_gethwaddr(uchar *to)
uchar *buf, *next, *end, *addr; uchar *buf, *next, *end, *addr;
struct if_msghdr *ifm; struct if_msghdr *ifm;
struct sockaddr_dl *sdl; struct sockaddr_dl *sdl;
int i, res=1, mib[6]={CTL_NET, AF_ROUTE, 0, AF_LINK, NET_RT_IFLIST, 0}; int res=1, mib[6]={CTL_NET, AF_ROUTE, 0, AF_LINK, NET_RT_IFLIST, 0};
if (sysctl(mib, 6, NULL, &len, NULL, 0) == -1) if (sysctl(mib, 6, NULL, &len, NULL, 0) == -1)
goto err; goto err;

View File

@ -30,7 +30,7 @@ my_error_reporter my_getopt_error_reporter= &default_reporter;
static int findopt(char *optpat, uint length, static int findopt(char *optpat, uint length,
const struct my_option **opt_res, const struct my_option **opt_res,
char **ffname); const char **ffname);
my_bool getopt_compare_strings(const char *s, my_bool getopt_compare_strings(const char *s,
const char *t, const char *t,
uint length); uint length);
@ -115,8 +115,8 @@ int handle_options(int *argc, char ***argv,
uint opt_found, argvpos= 0, length; uint opt_found, argvpos= 0, length;
my_bool end_of_options= 0, must_be_var, set_maximum_value, my_bool end_of_options= 0, must_be_var, set_maximum_value,
option_is_loose; option_is_loose;
char **pos, **pos_end, *optend, *UNINIT_VAR(prev_found), char **pos, **pos_end, *optend, *opt_str, key_name[FN_REFLEN];
*opt_str, key_name[FN_REFLEN]; const char *UNINIT_VAR(prev_found);
const struct my_option *optp; const struct my_option *optp;
void *value; void *value;
int error, i; int error, i;
@ -225,7 +225,6 @@ int handle_options(int *argc, char ***argv,
Find first the right option. Return error in case of an ambiguous, Find first the right option. Return error in case of an ambiguous,
or unknown option or unknown option
*/ */
LINT_INIT(prev_found);
optp= longopts; optp= longopts;
if (!(opt_found= findopt(opt_str, length, &optp, &prev_found))) if (!(opt_found= findopt(opt_str, length, &optp, &prev_found)))
{ {
@ -709,10 +708,10 @@ static int setval(const struct my_option *opts, void *value, char *argument,
static int findopt(char *optpat, uint length, static int findopt(char *optpat, uint length,
const struct my_option **opt_res, const struct my_option **opt_res,
char **ffname) const char **ffname)
{ {
uint count; uint count;
struct my_option *opt= (struct my_option *) *opt_res; const struct my_option *opt= *opt_res;
for (count= 0; opt->name; opt++) for (count= 0; opt->name; opt++)
{ {
@ -723,8 +722,9 @@ static int findopt(char *optpat, uint length,
return 1; return 1;
if (!count) if (!count)
{ {
/* We only need to know one prev */
count= 1; count= 1;
*ffname= (char *) opt->name; /* We only need to know one prev */ *ffname= opt->name;
} }
else if (strcmp(*ffname, opt->name)) else if (strcmp(*ffname, opt->name))
{ {

View File

@ -269,7 +269,6 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag); return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
a+=a_length; a+=a_length;
b+=b_length; b+=b_length;
break;
} }
break; break;
case HA_KEYTYPE_INT8: case HA_KEYTYPE_INT8:

View File

@ -76,11 +76,8 @@ end:
int my_copystat(const char *from, const char *to, int MyFlags) int my_copystat(const char *from, const char *to, int MyFlags)
{ {
struct stat statbuf; struct stat statbuf;
#if !defined(__WIN__) && !defined(__NETWARE__)
int res;
#endif
if (stat((char*) from, &statbuf)) if (stat(from, &statbuf))
{ {
my_errno=errno; my_errno=errno;
if (MyFlags & (MY_FAE+MY_WME)) if (MyFlags & (MY_FAE+MY_WME))
@ -89,7 +86,15 @@ int my_copystat(const char *from, const char *to, int MyFlags)
} }
if ((statbuf.st_mode & S_IFMT) != S_IFREG) if ((statbuf.st_mode & S_IFMT) != S_IFREG)
return 1; return 1;
VOID(chmod(to, statbuf.st_mode & 07777)); /* Copy modes */
/* Copy modes */
if (chmod(to, statbuf.st_mode & 07777))
{
my_errno= errno;
if (MyFlags & (MY_FAE+MY_WME))
my_error(EE_CHANGE_PERMISSIONS, MYF(ME_BELL+ME_WAITTANG), from, errno);
return -1;
}
#if !defined(__WIN__) && !defined(__NETWARE__) #if !defined(__WIN__) && !defined(__NETWARE__)
if (statbuf.st_nlink > 1 && MyFlags & MY_LINK_WARNING) if (statbuf.st_nlink > 1 && MyFlags & MY_LINK_WARNING)
@ -97,7 +102,14 @@ int my_copystat(const char *from, const char *to, int MyFlags)
if (MyFlags & MY_LINK_WARNING) if (MyFlags & MY_LINK_WARNING)
my_error(EE_LINK_WARNING,MYF(ME_BELL+ME_WAITTANG),from,statbuf.st_nlink); my_error(EE_LINK_WARNING,MYF(ME_BELL+ME_WAITTANG),from,statbuf.st_nlink);
} }
res= chown(to, statbuf.st_uid, statbuf.st_gid); /* Copy ownership */ /* Copy ownership */
if (chown(to, statbuf.st_uid, statbuf.st_gid))
{
my_errno= errno;
if (MyFlags & (MY_FAE+MY_WME))
my_error(EE_CHANGE_OWNERSHIP, MYF(ME_BELL+ME_WAITTANG), from, errno);
return -1;
}
#endif /* !__WIN__ && !__NETWARE__ */ #endif /* !__WIN__ && !__NETWARE__ */
#ifndef VMS #ifndef VMS

View File

@ -163,7 +163,7 @@ void *_mymalloc(size_t size, const char *filename, uint lineno, myf MyFlags)
my_message(EE_OUTOFMEMORY, buff, MYF(ME_BELL+ME_WAITTANG+ME_NOREFRESH)); my_message(EE_OUTOFMEMORY, buff, MYF(ME_BELL+ME_WAITTANG+ME_NOREFRESH));
} }
DBUG_PRINT("error",("Out of memory, in use: %ld at line %d, '%s'", DBUG_PRINT("error",("Out of memory, in use: %ld at line %d, '%s'",
sf_malloc_max_memory,lineno, filename)); (ulong) sf_malloc_max_memory, lineno, filename));
DBUG_EXECUTE_IF("simulate_out_of_memory", DBUG_EXECUTE_IF("simulate_out_of_memory",
DBUG_SET("-d,simulate_out_of_memory");); DBUG_SET("-d,simulate_out_of_memory"););
if (MyFlags & MY_FAE) if (MyFlags & MY_FAE)

View File

@ -125,8 +125,7 @@ static int check_lock(struct st_lock_list *list, const char* lock_type,
{ {
THR_LOCK_DATA *data,**prev; THR_LOCK_DATA *data,**prev;
uint count=0; uint count=0;
THR_LOCK_OWNER *first_owner; THR_LOCK_OWNER *UNINIT_VAR(first_owner);
LINT_INIT(first_owner);
prev= &list->data; prev= &list->data;
if (list->data) if (list->data)

View File

@ -27,14 +27,14 @@ INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \
EXTRA_LTLIBRARIES = libdaemon_example.la EXTRA_LTLIBRARIES = libdaemon_example.la
pkgplugin_LTLIBRARIES = @plugin_daemon_example_shared_target@ pkgplugin_LTLIBRARIES = @plugin_daemon_example_shared_target@
libdaemon_example_la_LDFLAGS = -module -rpath $(pkgplugindir) libdaemon_example_la_LDFLAGS = -module -rpath $(pkgplugindir)
libdaemon_example_la_CXXFLAGS= $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN libdaemon_example_la_CXXFLAGS= $(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN
libdaemon_example_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN libdaemon_example_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN
libdaemon_example_la_SOURCES = daemon_example.cc libdaemon_example_la_SOURCES = daemon_example.cc
EXTRA_LIBRARIES = libdaemon_example.a EXTRA_LIBRARIES = libdaemon_example.a
noinst_LIBRARIES = @plugin_daemon_example_static_target@ noinst_LIBRARIES = @plugin_daemon_example_static_target@
libdaemon_example_a_CXXFLAGS = $(AM_CFLAGS) libdaemon_example_a_CXXFLAGS = $(AM_CXXFLAGS)
libdaemon_example_a_CFLAGS = $(AM_CFLAGS) libdaemon_example_a_CFLAGS = $(AM_CFLAGS)
libdaemon_example_a_SOURCES= daemon_example.cc libdaemon_example_a_SOURCES= daemon_example.cc

View File

@ -256,7 +256,6 @@ sopno stopst;
register char *ssp; /* start of string matched by subsubRE */ register char *ssp; /* start of string matched by subsubRE */
register char *sep; /* end of string matched by subsubRE */ register char *sep; /* end of string matched by subsubRE */
register char *oldssp; /* previous ssp */ register char *oldssp; /* previous ssp */
register char *dp; /* used in debug mode to check asserts */
AT("diss", start, stop, startst, stopst); AT("diss", start, stop, startst, stopst);
sp = start; sp = start;
@ -314,10 +313,8 @@ sopno stopst;
ssub = ss + 1; ssub = ss + 1;
esub = es - 1; esub = es - 1;
/* did innards match? */ /* did innards match? */
if (slow(charset, m, sp, rest, ssub, esub) != NULL) { if (slow(charset, m, sp, rest, ssub, esub) != NULL)
dp = dissect(charset, m, sp, rest, ssub, esub); sp = dissect(charset, m, sp, rest, ssub, esub);
assert(dp == rest);
} else /* no */
assert(sp == rest); assert(sp == rest);
sp = rest; sp = rest;
break; break;
@ -353,8 +350,8 @@ sopno stopst;
} }
assert(sep == rest); /* must exhaust substring */ assert(sep == rest); /* must exhaust substring */
assert(slow(charset, m, ssp, sep, ssub, esub) == rest); assert(slow(charset, m, ssp, sep, ssub, esub) == rest);
dp = dissect(charset, m, ssp, sep, ssub, esub); sp = dissect(charset, m, ssp, sep, ssub, esub);
assert(dp == sep); assert(sp == sep);
sp = rest; sp = rest;
break; break;
case OCH_: case OCH_:
@ -388,8 +385,8 @@ sopno stopst;
else else
assert(OP(m->g->strip[esub]) == O_CH); assert(OP(m->g->strip[esub]) == O_CH);
} }
dp = dissect(charset, m, sp, rest, ssub, esub); sp = dissect(charset, m, sp, rest, ssub, esub);
assert(dp == rest); assert(sp == rest);
sp = rest; sp = rest;
break; break;
case O_PLUS: case O_PLUS:

View File

@ -690,7 +690,6 @@ register cset *cs;
case '-': case '-':
SETERROR(REG_ERANGE); SETERROR(REG_ERANGE);
return; /* NOTE RETURN */ return; /* NOTE RETURN */
break;
default: default:
c = '\0'; c = '\0';
break; break;
@ -1564,13 +1563,13 @@ struct parse *p;
register struct re_guts *g; register struct re_guts *g;
{ {
register sop *scan; register sop *scan;
sop *start; sop *UNINIT_VAR(start);
register sop *newstart; register sop *UNINIT_VAR(newstart);
register sopno newlen; register sopno newlen;
register sop s; register sop s;
register char *cp; register char *cp;
register sopno i; register sopno i;
LINT_INIT(start); LINT_INIT(newstart);
/* avoid making error situations worse */ /* avoid making error situations worse */
if (p->error != 0) if (p->error != 0)
return; return;

View File

@ -208,7 +208,7 @@ sub remove_anonymous_users {
} }
sub remove_remote_root { sub remove_remote_root {
if (do_query("DELETE FROM mysql.user WHERE User='root' AND Host!='localhost';")) { if (do_query("DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');")) {
print " ... Success!\n"; print " ... Success!\n";
} else { } else {
print " ... Failed!\n"; print " ... Failed!\n";

View File

@ -17,6 +17,7 @@
config=".my.cnf.$$" config=".my.cnf.$$"
command=".mysql.$$" command=".mysql.$$"
mysql_client=""
trap "interrupt" 2 trap "interrupt" 2
@ -37,10 +38,26 @@ prepare() {
chmod 600 $config $command chmod 600 $config $command
} }
find_mysql_client()
{
for n in ./bin/mysql mysql
do
$n --no-defaults --help > /dev/null 2>&1
status=$?
if test $status -eq 0
then
mysql_client=$n
return
fi
done
echo "Can't find a 'mysql' client in PATH or ./bin"
exit 1
}
do_query() { do_query() {
echo "$1" >$command echo "$1" >$command
#sed 's,^,> ,' < $command # Debugging #sed 's,^,> ,' < $command # Debugging
mysql --defaults-file=$config <$command $mysql_client --defaults-file=$config <$command
return $? return $?
} }
@ -147,7 +164,7 @@ remove_anonymous_users() {
} }
remove_remote_root() { remove_remote_root() {
do_query "DELETE FROM mysql.user WHERE User='root' AND Host!='localhost';" do_query "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');"
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
echo " ... Success!" echo " ... Success!"
else else
@ -204,6 +221,7 @@ cleanup() {
# The actual script starts here # The actual script starts here
prepare prepare
find_mysql_client
set_echo_compat set_echo_compat
echo echo

View File

@ -58,7 +58,7 @@ ALTER TABLE tables_priv
COLLATE utf8_general_ci DEFAULT '' NOT NULL, COLLATE utf8_general_ci DEFAULT '' NOT NULL,
MODIFY Table_priv set('Select','Insert','Update','Delete','Create', MODIFY Table_priv set('Select','Insert','Update','Delete','Create',
'Drop','Grant','References','Index','Alter', 'Drop','Grant','References','Index','Alter',
'Create View','Show view') 'Create View','Show view','Trigger')
COLLATE utf8_general_ci DEFAULT '' NOT NULL, COLLATE utf8_general_ci DEFAULT '' NOT NULL,
COMMENT='Table privileges'; COMMENT='Table privileges';
@ -584,8 +584,6 @@ ALTER TABLE host MODIFY Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAU
ALTER TABLE db ADD Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; ALTER TABLE db ADD Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL;
ALTER TABLE db MODIFY Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; ALTER TABLE db MODIFY Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL;
ALTER TABLE tables_priv MODIFY Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') COLLATE utf8_general_ci DEFAULT '' NOT NULL;
UPDATE user SET Trigger_priv=Super_priv WHERE @hadTriggerPriv = 0; UPDATE user SET Trigger_priv=Super_priv WHERE @hadTriggerPriv = 0;
# Activate the new, possible modified privilege tables # Activate the new, possible modified privilege tables

View File

@ -303,7 +303,6 @@ bool Instance_options::fill_log_options()
enum { MAX_LOG_OPTION_LENGTH= 256 }; enum { MAX_LOG_OPTION_LENGTH= 256 };
char datadir[MAX_LOG_OPTION_LENGTH]; char datadir[MAX_LOG_OPTION_LENGTH];
char hostname[MAX_LOG_OPTION_LENGTH]; char hostname[MAX_LOG_OPTION_LENGTH];
uint hostname_length;
struct log_files_st struct log_files_st
{ {
const char *name; const char *name;
@ -335,8 +334,6 @@ bool Instance_options::fill_log_options()
strmov(hostname, "mysql"); strmov(hostname, "mysql");
hostname[MAX_LOG_OPTION_LENGTH - 1]= 0; /* Safety */ hostname[MAX_LOG_OPTION_LENGTH - 1]= 0; /* Safety */
hostname_length= strlen(hostname);
for (log_files= logs_st; log_files->name; log_files++) for (log_files= logs_st; log_files->name; log_files++)
{ {

View File

@ -1024,30 +1024,21 @@ void set_zero_time(MYSQL_TIME *tm, enum enum_mysql_timestamp_type time_type)
int my_time_to_str(const MYSQL_TIME *l_time, char *to) int my_time_to_str(const MYSQL_TIME *l_time, char *to)
{ {
uint extra_hours= 0; uint extra_hours= 0;
return my_sprintf(to, (to, "%s%02u:%02u:%02u", return sprintf(to, "%s%02u:%02u:%02u", (l_time->neg ? "-" : ""),
(l_time->neg ? "-" : ""), extra_hours+ l_time->hour, l_time->minute, l_time->second);
extra_hours+ l_time->hour,
l_time->minute,
l_time->second));
} }
int my_date_to_str(const MYSQL_TIME *l_time, char *to) int my_date_to_str(const MYSQL_TIME *l_time, char *to)
{ {
return my_sprintf(to, (to, "%04u-%02u-%02u", return sprintf(to, "%04u-%02u-%02u",
l_time->year, l_time->year, l_time->month, l_time->day);
l_time->month,
l_time->day));
} }
int my_datetime_to_str(const MYSQL_TIME *l_time, char *to) int my_datetime_to_str(const MYSQL_TIME *l_time, char *to)
{ {
return my_sprintf(to, (to, "%04u-%02u-%02u %02u:%02u:%02u", return sprintf(to, "%04u-%02u-%02u %02u:%02u:%02u",
l_time->year, l_time->year, l_time->month, l_time->day,
l_time->month, l_time->hour, l_time->minute, l_time->second);
l_time->day,
l_time->hour,
l_time->minute,
l_time->second));
} }

View File

@ -2277,7 +2277,7 @@ int Field_decimal::store(double nr)
snprintf(buff,sizeof(buff)-1, "%.*f",(int) dec,nr); snprintf(buff,sizeof(buff)-1, "%.*f",(int) dec,nr);
length= strlen(buff); length= strlen(buff);
#else #else
length= my_sprintf(buff,(buff,"%.*f",dec,nr)); length= sprintf(buff, "%.*f", dec, nr);
#endif #endif
if (length > field_length) if (length > field_length)
@ -4259,7 +4259,7 @@ String *Field_float::val_str(String *val_buffer,
snprintf(to,to_length-1,"%.*f",dec,nr); snprintf(to,to_length-1,"%.*f",dec,nr);
to=strend(to); to=strend(to);
#else #else
to+= my_sprintf(to,(to,"%.*f",dec,nr)); to+= sprintf(to, "%.*f", dec, nr);
#endif #endif
#endif #endif
} }
@ -4617,7 +4617,7 @@ String *Field_double::val_str(String *val_buffer,
snprintf(to,to_length-1,"%.*f",dec,nr); snprintf(to,to_length-1,"%.*f",dec,nr);
to=strend(to); to=strend(to);
#else #else
to+= my_sprintf(to,(to,"%.*f",dec,nr)); to+= sprintf(to, "%.*f", dec, nr);
#endif #endif
#endif #endif
} }
@ -5541,7 +5541,6 @@ int Field_date::store(const char *from, uint len,CHARSET_INFO *cs)
int Field_date::store(double nr) int Field_date::store(double nr)
{ {
longlong tmp; longlong tmp;
int error= 0;
if (nr >= 19000000000000.0 && nr <= 99991231235959.0) if (nr >= 19000000000000.0 && nr <= 99991231235959.0)
nr=floor(nr/1000000.0); // Timestamp to date nr=floor(nr/1000000.0); // Timestamp to date
if (nr < 0.0 || nr > 99991231.0) if (nr < 0.0 || nr > 99991231.0)
@ -5550,7 +5549,6 @@ int Field_date::store(double nr)
set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN, set_datetime_warning(MYSQL_ERROR::WARN_LEVEL_WARN,
ER_WARN_DATA_OUT_OF_RANGE, ER_WARN_DATA_OUT_OF_RANGE,
nr, MYSQL_TIMESTAMP_DATE); nr, MYSQL_TIMESTAMP_DATE);
error= 1;
} }
else else
tmp= (longlong) rint(nr); tmp= (longlong) rint(nr);
@ -6461,7 +6459,7 @@ int Field_str::store(double nr)
/* Limit precision to DBL_DIG to avoid garbage past significant digits */ /* Limit precision to DBL_DIG to avoid garbage past significant digits */
set_if_smaller(digits, DBL_DIG); set_if_smaller(digits, DBL_DIG);
length= (uint) my_sprintf(buff, (buff, "%-.*g", digits, nr)); length= (uint) sprintf(buff, "%-.*g", digits, nr);
#ifdef __WIN__ #ifdef __WIN__
/* /*
@ -8691,7 +8689,13 @@ int Field_set::store(longlong nr, bool unsigned_val)
{ {
ASSERT_COLUMN_MARKED_FOR_WRITE; ASSERT_COLUMN_MARKED_FOR_WRITE;
int error= 0; int error= 0;
ulonglong max_nr= set_bits(ulonglong, typelib->count); ulonglong max_nr;
if (sizeof(ulonglong)*8 <= typelib->count)
max_nr= ULONGLONG_MAX;
else
max_nr= (ULL(1) << typelib->count) - 1;
if ((ulonglong) nr > max_nr) if ((ulonglong) nr > max_nr)
{ {
nr&= max_nr; nr&= max_nr;
@ -10413,7 +10417,7 @@ Field::set_datetime_warning(MYSQL_ERROR::enum_warning_level level, uint code,
{ {
/* DBL_DIG is enough to print '-[digits].E+###' */ /* DBL_DIG is enough to print '-[digits].E+###' */
char str_nr[DBL_DIG + 8]; char str_nr[DBL_DIG + 8];
uint str_len= my_sprintf(str_nr, (str_nr, "%g", nr)); uint str_len= sprintf(str_nr, "%g", nr);
make_truncated_value_warning(thd, level, str_nr, str_len, ts_type, make_truncated_value_warning(thd, level, str_nr, str_len, ts_type,
field_name); field_name);
} }

View File

@ -514,6 +514,7 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
volatile THD::killed_state *killed= &thd->killed; volatile THD::killed_state *killed= &thd->killed;
handler *file; handler *file;
MY_BITMAP *save_read_set, *save_write_set; MY_BITMAP *save_read_set, *save_write_set;
bool skip_record;
DBUG_ENTER("find_all_keys"); DBUG_ENTER("find_all_keys");
DBUG_PRINT("info",("using: %s", DBUG_PRINT("info",("using: %s",
(select ? select->quick ? "ranges" : "where": (select ? select->quick ? "ranges" : "where":
@ -606,7 +607,8 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
} }
if (error == 0) if (error == 0)
param->examined_rows++; param->examined_rows++;
if (error == 0 && (!select || select->skip_record() == 0)) if (!error && (!select ||
(!select->skip_record(thd, &skip_record) && !skip_record)))
{ {
if (idx == param->keys) if (idx == param->keys)
{ {

View File

@ -4219,6 +4219,58 @@ int ha_partition::index_read_last_map(uchar *buf, const uchar *key,
} }
/*
Optimization of the default implementation to take advantage of dynamic
partition pruning.
*/
int ha_partition::index_read_idx_map(uchar *buf, uint index,
const uchar *key,
key_part_map keypart_map,
enum ha_rkey_function find_flag)
{
int error= HA_ERR_KEY_NOT_FOUND;
DBUG_ENTER("ha_partition::index_read_idx_map");
if (find_flag == HA_READ_KEY_EXACT)
{
uint part;
m_start_key.key= key;
m_start_key.keypart_map= keypart_map;
m_start_key.flag= find_flag;
m_start_key.length= calculate_key_len(table, index, m_start_key.key,
m_start_key.keypart_map);
get_partition_set(table, buf, index, &m_start_key, &m_part_spec);
/* How can it be more than one partition with the current use? */
DBUG_ASSERT(m_part_spec.start_part == m_part_spec.end_part);
for (part= m_part_spec.start_part; part <= m_part_spec.end_part; part++)
{
if (bitmap_is_set(&(m_part_info->used_partitions), part))
{
error= m_file[part]->index_read_idx_map(buf, index, key,
keypart_map, find_flag);
if (error != HA_ERR_KEY_NOT_FOUND &&
error != HA_ERR_END_OF_FILE)
break;
}
}
}
else
{
/*
If not only used with READ_EXACT, we should investigate if possible
to optimize for other find_flag's as well.
*/
DBUG_ASSERT(0);
/* fall back on the default implementation */
error= handler::index_read_idx_map(buf, index, key, keypart_map, find_flag);
}
DBUG_RETURN(error);
}
/* /*
Read next record in a forward index scan Read next record in a forward index scan

Some files were not shown because too many files have changed in this diff Show More