1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

merge of 5.1-main into 5.1-maria. MyISAM changes are propagated to Maria except

those of davi.arnaut@sun.com-20090219210935-9vilvcisyyieffxl (TODO).
This commit is contained in:
Guilhem Bichot
2009-04-01 11:34:52 +02:00
405 changed files with 26888 additions and 5452 deletions

View File

@ -754,6 +754,8 @@ mysql-test/linux_sys_vars.inc
mysql-test/load_sysvars.inc mysql-test/load_sysvars.inc
mysql-test/mtr mysql-test/mtr
mysql-test/mysql-test-run mysql-test/mysql-test-run
mysql-test/mysql-test-gcov.err
mysql-test/mysql-test-gcov.msg
mysql-test/mysql-test-run-shell mysql-test/mysql-test-run-shell
mysql-test/mysql-test-run.log mysql-test/mysql-test-run.log
mysql-test/mysql_test_run_new mysql-test/mysql_test_run_new

View File

@ -152,6 +152,12 @@ IF(MSVC)
STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS_INIT ${CMAKE_CXX_FLAGS_INIT}) STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS_INIT ${CMAKE_CXX_FLAGS_INIT})
STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS_DEBUG_INIT ${CMAKE_CXX_FLAGS_DEBUG_INIT}) STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS_DEBUG_INIT ${CMAKE_CXX_FLAGS_DEBUG_INIT})
# Mark 32 bit executables large address aware so they can
# use > 2GB address space
IF(CMAKE_SIZEOF_VOID_P MATCHES 4)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
ENDIF(CMAKE_SIZEOF_VOID_P MATCHES 4)
# Disable automatic manifest generation. # Disable automatic manifest generation.
STRING(REPLACE "/MANIFEST" "/MANIFEST:NO" CMAKE_EXE_LINKER_FLAGS STRING(REPLACE "/MANIFEST" "/MANIFEST:NO" CMAKE_EXE_LINKER_FLAGS
${CMAKE_EXE_LINKER_FLAGS}) ${CMAKE_EXE_LINKER_FLAGS})

View File

@ -250,7 +250,7 @@ static COMMANDS commands[] = {
{ "connect",'r', com_connect,1, { "connect",'r', com_connect,1,
"Reconnect to the server. Optional arguments are db and host." }, "Reconnect to the server. Optional arguments are db and host." },
{ "delimiter", 'd', com_delimiter, 1, { "delimiter", 'd', com_delimiter, 1,
"Set statement delimiter. NOTE: Takes the rest of the line as new delimiter." }, "Set statement delimiter." },
#ifdef USE_POPEN #ifdef USE_POPEN
{ "edit", 'e', com_edit, 0, "Edit command with $EDITOR."}, { "edit", 'e', com_edit, 0, "Edit command with $EDITOR."},
#endif #endif
@ -2252,8 +2252,22 @@ static bool add_line(String &buffer,char *line,char *in_string,
} }
if (out != line || !buffer.is_empty()) if (out != line || !buffer.is_empty())
{ {
*out++='\n';
uint length=(uint) (out-line); uint length=(uint) (out-line);
if (length < 9 ||
my_strnncoll (charset_info,
(uchar *)line, 9, (const uchar *) "delimiter", 9))
{
/*
Don't add a new line in case there's a DELIMITER command to be
added to the glob buffer (e.g. on processing a line like
"<command>;DELIMITER <non-eof>") : similar to how a new line is
not added in the case when the DELIMITER is the first command
entered with an empty glob buffer.
*/
*out++='\n';
length++;
}
if (buffer.length() + length >= buffer.alloced_length()) if (buffer.length() + length >= buffer.alloced_length())
buffer.realloc(buffer.length()+length+IO_SIZE); buffer.realloc(buffer.length()+length+IO_SIZE);
if ((!*ml_comment || preserve_comments) && buffer.append(line, length)) if ((!*ml_comment || preserve_comments) && buffer.append(line, length))
@ -2862,7 +2876,7 @@ com_charset(String *buffer __attribute__((unused)), char *line)
param= get_arg(buff, 0); param= get_arg(buff, 0);
if (!param || !*param) if (!param || !*param)
{ {
return put_info("Usage: \\C char_setname | charset charset_name", return put_info("Usage: \\C charset_name | charset charset_name",
INFO_ERROR, 0); INFO_ERROR, 0);
} }
new_cs= get_charset_by_csname(param, MY_CS_PRIMARY, MYF(MY_WME)); new_cs= get_charset_by_csname(param, MY_CS_PRIMARY, MYF(MY_WME));

View File

@ -1,4 +1,4 @@
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc. /* Copyright 2000-2008 MySQL AB, 2008, 2009 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -1475,7 +1475,8 @@ static int connect_to_db(char *host, char *user,char *passwd)
DB_error(&mysql_connection, "when trying to connect"); DB_error(&mysql_connection, "when trying to connect");
DBUG_RETURN(1); DBUG_RETURN(1);
} }
if (mysql_get_server_version(&mysql_connection) < 40100) if ((mysql_get_server_version(&mysql_connection) < 40100) ||
(opt_compatible_mode & 3))
{ {
/* Don't dump SET NAMES with a pre-4.1 server (bug#7997). */ /* Don't dump SET NAMES with a pre-4.1 server (bug#7997). */
opt_set_charset= 0; opt_set_charset= 0;
@ -2421,11 +2422,11 @@ static uint get_table_structure(char *table, char *db, char *table_type,
row= mysql_fetch_row(result); row= mysql_fetch_row(result);
fprintf(sql_file, fprintf(sql_file, (opt_compatible_mode & 3) ? "%s;\n" :
"SET @saved_cs_client = @@character_set_client;\n" "/*!40101 SET @saved_cs_client = @@character_set_client */;\n"
"SET character_set_client = utf8;\n" "/*!40101 SET character_set_client = utf8 */;\n"
"%s;\n" "%s;\n"
"SET character_set_client = @saved_cs_client;\n", "/*!40101 SET character_set_client = @saved_cs_client */;\n",
row[1]); row[1]);
check_io(sql_file); check_io(sql_file);

View File

@ -4652,6 +4652,10 @@ void safe_connect(MYSQL* mysql, const char *name, const char *host,
int failed_attempts= 0; int failed_attempts= 0;
DBUG_ENTER("safe_connect"); DBUG_ENTER("safe_connect");
verbose_msg("Connecting to server %s:%d (socket %s) as '%s'"
", connection '%s', attempt %d ...",
host, port, sock, user, name, failed_attempts);
while(!mysql_real_connect(mysql, host,user, pass, db, port, sock, while(!mysql_real_connect(mysql, host,user, pass, db, port, sock,
CLIENT_MULTI_STATEMENTS | CLIENT_REMEMBER_OPTIONS)) CLIENT_MULTI_STATEMENTS | CLIENT_REMEMBER_OPTIONS))
{ {
@ -4683,6 +4687,7 @@ void safe_connect(MYSQL* mysql, const char *name, const char *host,
} }
failed_attempts++; failed_attempts++;
} }
verbose_msg("... Connected.");
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
@ -7515,8 +7520,12 @@ int main(int argc, char **argv)
parse_args(argc, argv); parse_args(argc, argv);
log_file.open(opt_logdir, result_file_name, ".log"); log_file.open(opt_logdir, result_file_name, ".log");
verbose_msg("Logging to '%s'.", log_file.file_name());
if (opt_mark_progress) if (opt_mark_progress)
{
progress_file.open(opt_logdir, result_file_name, ".progress"); progress_file.open(opt_logdir, result_file_name, ".progress");
verbose_msg("Tracing progress in '%s'.", progress_file.file_name());
}
var_set_int("$PS_PROTOCOL", ps_protocol); var_set_int("$PS_PROTOCOL", ps_protocol);
var_set_int("$SP_PROTOCOL", sp_protocol); var_set_int("$SP_PROTOCOL", sp_protocol);
@ -7525,6 +7534,8 @@ int main(int argc, char **argv)
DBUG_PRINT("info",("result_file: '%s'", DBUG_PRINT("info",("result_file: '%s'",
result_file_name ? result_file_name : "")); result_file_name ? result_file_name : ""));
verbose_msg("Results saved in '%s'.",
result_file_name ? result_file_name : "");
if (mysql_server_init(embedded_server_arg_count, if (mysql_server_init(embedded_server_arg_count,
embedded_server_args, embedded_server_args,
(char**) embedded_server_groups)) (char**) embedded_server_groups))
@ -7595,6 +7606,7 @@ int main(int argc, char **argv)
open_file(opt_include); open_file(opt_include);
} }
verbose_msg("Start processing test commands from '%s' ...", cur_file->file_name);
while (!read_command(&command) && !abort_flag) while (!read_command(&command) && !abort_flag)
{ {
int current_line_inc = 1, processed = 0; int current_line_inc = 1, processed = 0;
@ -7912,6 +7924,7 @@ int main(int argc, char **argv)
log_file.close(); log_file.close();
start_lineno= 0; start_lineno= 0;
verbose_msg("... Done processing test commands.");
if (parsing_disabled) if (parsing_disabled)
die("Test ended with parsing disabled"); die("Test ended with parsing disabled");
@ -7962,6 +7975,7 @@ int main(int argc, char **argv)
if (!command_executed && result_file_name) if (!command_executed && result_file_name)
die("No queries executed but result file found!"); die("No queries executed but result file found!");
verbose_msg("Test has succeeded!");
timer_output(); timer_output();
/* Yes, if we got this far the test has suceeded! Sakila smiles */ /* Yes, if we got this far the test has suceeded! Sakila smiles */
cleanup_and_exit(0); cleanup_and_exit(0);

View File

@ -71,25 +71,22 @@ bool String::realloc(uint32 alloc_length)
char *new_ptr; char *new_ptr;
if (alloced) if (alloced)
{ {
if ((new_ptr= (char*) my_realloc(Ptr,len,MYF(MY_WME)))) if (!(new_ptr= (char*) my_realloc(Ptr,len,MYF(MY_WME))))
{
Ptr=new_ptr;
Alloced_length=len;
}
else
return TRUE; // Signal error return TRUE; // Signal error
} }
else if ((new_ptr= (char*) my_malloc(len,MYF(MY_WME)))) else if ((new_ptr= (char*) my_malloc(len,MYF(MY_WME))))
{ {
if (str_length > len - 1)
str_length= 0;
if (str_length) // Avoid bugs in memcpy on AIX if (str_length) // Avoid bugs in memcpy on AIX
memcpy(new_ptr,Ptr,str_length); memcpy(new_ptr,Ptr,str_length);
new_ptr[str_length]=0; new_ptr[str_length]=0;
Ptr=new_ptr;
Alloced_length=len;
alloced=1; alloced=1;
} }
else else
return TRUE; // Signal error return TRUE; // Signal error
Ptr= new_ptr;
Alloced_length= len;
} }
Ptr[alloc_length]=0; // This make other funcs shorter Ptr[alloc_length]=0; // This make other funcs shorter
return FALSE; return FALSE;
@ -125,7 +122,7 @@ 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, "%.14g",num));// Enough for a DATETIME uint32 len= my_sprintf(buff,(buff, "%.15g",num));// Enough for a DATETIME
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
@ -677,7 +674,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, "%.14g", d)); str_length+= my_sprintf(buff, (buff, "%.15g", d));
} }
void String::qs_append(double *d) void String::qs_append(double *d)

View File

@ -302,7 +302,9 @@ AC_DEFUN([MYSQL_CONFIGURE_PLUGINS],[
_MYSQL_CONFIGURE_PLUGINS(m4_bpatsubst(__mysql_plugin_list__, :, [,])) _MYSQL_CONFIGURE_PLUGINS(m4_bpatsubst(__mysql_plugin_list__, :, [,]))
_MYSQL_EMIT_PLUGIN_ACTIONS(m4_bpatsubst(__mysql_plugin_list__, :, [,])) _MYSQL_EMIT_PLUGIN_ACTIONS(m4_bpatsubst(__mysql_plugin_list__, :, [,]))
AC_SUBST([mysql_se_dirs]) AC_SUBST([mysql_se_dirs])
AC_SUBST([mysql_se_distdirs])
AC_SUBST([mysql_pg_dirs]) AC_SUBST([mysql_pg_dirs])
AC_SUBST([mysql_pg_distdirs])
AC_SUBST([mysql_se_unittest_dirs]) AC_SUBST([mysql_se_unittest_dirs])
AC_SUBST([mysql_pg_unittest_dirs]) AC_SUBST([mysql_pg_unittest_dirs])
AC_SUBST([condition_dependent_plugin_modules]) AC_SUBST([condition_dependent_plugin_modules])
@ -354,6 +356,24 @@ AC_DEFUN([__MYSQL_EMIT_CHECK_PLUGIN],[
fi fi
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
],[ ],[
# Plugin is not disabled, determine if it should be built,
# or only distributed
m4_ifdef([$6], [
if test ! -d "$srcdir/$6"; then
# Plugin directory was removed after autoconf was run; treat
# this as a disabled plugin
if test "X[$with_plugin_]$2" = Xyes; then
AC_MSG_RESULT([error])
AC_MSG_ERROR([disabled])
fi
# The result message will be printed below
[with_plugin_]$2=no
fi
])
m4_ifdef([$9],[ m4_ifdef([$9],[
if test "X[$with_plugin_]$2" = Xno; then if test "X[$with_plugin_]$2" = Xno; then
AC_MSG_RESULT([error]) AC_MSG_RESULT([error])
@ -372,6 +392,8 @@ AC_DEFUN([__MYSQL_EMIT_CHECK_PLUGIN],[
;; ;;
esac esac
]) ])
if test "X[$with_plugin_]$2" = Xno; then if test "X[$with_plugin_]$2" = Xno; then
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
else else
@ -448,28 +470,36 @@ dnl Although this is "pretty", it breaks libmysqld build
condition_dependent_plugin_includes="$condition_dependent_plugin_includes -I[\$(top_srcdir)]/$6/m4_bregexp($11, [^.+[/$]], [\&])" condition_dependent_plugin_includes="$condition_dependent_plugin_includes -I[\$(top_srcdir)]/$6/m4_bregexp($11, [^.+[/$]], [\&])"
]) ])
fi fi
fi
m4_ifdef([$6], [ m4_ifdef([$6], [
if test -n "$mysql_use_plugin_dir" ; then if test -d "$srcdir/$6"; then
mysql_plugin_dirs="$mysql_plugin_dirs $6" # Even if we don't build a plugin, we bundle its source into the dist
# file. So its Makefile (and Makefiles for any subdirs) must be
# generated for 'make dist' to work.
m4_syscmd(test -f "$6/configure") m4_syscmd(test -f "$6/configure")
ifelse(m4_sysval, 0, ifelse(m4_sysval, 0,
[AC_CONFIG_SUBDIRS($6)], [AC_CONFIG_SUBDIRS($6)],
[AC_CONFIG_FILES($6/Makefile)] [AC_CONFIG_FILES($6/Makefile)]
) )
ifelse(m4_substr($6, 0, 8), [storage/],
[ ifelse(
[mysql_se_dirs="$mysql_se_dirs ]m4_substr($6, 8)" m4_substr($6, 0, 8), [storage/], [
mysql_se_distdirs="$mysql_se_distdirs m4_substr($6, 8)"
if test -n "$mysql_use_plugin_dir" ; then
mysql_se_dirs="$mysql_se_dirs m4_substr($6, 8)"
mysql_se_unittest_dirs="$mysql_se_unittest_dirs ../$6" mysql_se_unittest_dirs="$mysql_se_unittest_dirs ../$6"
], fi],
m4_substr($6, 0, 7), [plugin/],
[ m4_substr($6, 0, 7), [plugin/], [
[mysql_pg_dirs="$mysql_pg_dirs ]m4_substr($6, 7)" mysql_pg_distdirs="$mysql_pg_distdirs m4_substr($6, 7)"
if test -n "$mysql_use_plugin_dir" ; then
mysql_pg_dirs="$mysql_pg_dirs m4_substr($6, 7)"
mysql_pg_unittest_dirs="$mysql_pg_unittest_dirs ../$6" mysql_pg_unittest_dirs="$mysql_pg_unittest_dirs ../$6"
], fi],
[AC_FATAL([don't know how to handle plugin dir ]$6)]) [AC_FATAL([don't know how to handle plugin dir ]$6)])
fi fi
]) ])
fi
]) ])
]) ])

View File

@ -815,7 +815,7 @@ AC_TYPE_SIZE_T
AC_HEADER_DIRENT AC_HEADER_DIRENT
AC_HEADER_STDC AC_HEADER_STDC
AC_HEADER_SYS_WAIT AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h float.h floatingpoint.h ieeefp.h limits.h \ AC_CHECK_HEADERS(fcntl.h fenv.h float.h floatingpoint.h ieeefp.h limits.h \
memory.h pwd.h select.h fnmatch.h \ memory.h pwd.h select.h fnmatch.h \
stdlib.h stddef.h sys/stat.h \ stdlib.h stddef.h sys/stat.h \
strings.h string.h synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h \ strings.h string.h synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h \
@ -838,19 +838,17 @@ AC_CHECK_LIB(nsl_r, gethostbyname_r, [],
AC_CHECK_LIB(nsl, gethostbyname_r)) AC_CHECK_LIB(nsl, gethostbyname_r))
AC_CHECK_FUNC(gethostbyname_r) AC_CHECK_FUNC(gethostbyname_r)
AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt)) AC_SEARCH_LIBS(setsockopt, socket)
AC_CHECK_FUNC(yp_get_default_domain, ,
AC_CHECK_LIB(nsl, yp_get_default_domain))
AC_CHECK_FUNC(p2open, , AC_CHECK_LIB(gen, p2open))
# This may get things to compile even if bind-8 is installed # This may get things to compile even if bind-8 is installed
AC_CHECK_FUNC(bind, , AC_CHECK_LIB(bind, bind)) AC_SEARCH_LIBS(bind, bind)
# Check if crypt() exists in libc or libcrypt, sets LIBS if needed # Check if crypt() exists in libc or libcrypt, sets LIBS if needed
AC_SEARCH_LIBS(crypt, crypt, AC_DEFINE(HAVE_CRYPT, 1, [crypt])) AC_SEARCH_LIBS(crypt, crypt, AC_DEFINE(HAVE_CRYPT, 1, [crypt]))
# See if we need a library for address lookup. # See if we need a library for address lookup.
AC_SEARCH_LIBS(inet_aton, [socket nsl resolv]) AC_SEARCH_LIBS(inet_aton, [socket nsl resolv])
# For the sched_yield() function on Solaris # For the sched_yield() function on Solaris
AC_CHECK_FUNC(sched_yield, , AC_CHECK_LIB(posix4, sched_yield)) AC_SEARCH_LIBS(sched_yield, posix4,
AC_DEFINE(HAVE_SCHED_YIELD, 1, [sched_yield]))
MYSQL_CHECK_ZLIB_WITH_COMPRESS MYSQL_CHECK_ZLIB_WITH_COMPRESS
@ -956,7 +954,7 @@ AC_MSG_RESULT([$USE_PSTACK])
# Check for gtty if termio.h doesn't exists # Check for gtty if termio.h doesn't exists
if test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no" if test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no"
then then
AC_CHECK_FUNC(gtty, , AC_CHECK_LIB(compat, gtty)) AC_SEARCH_LIBS(gtty, compat)
fi fi
# We make a special variable for non-threaded version of LIBS to avoid # We make a special variable for non-threaded version of LIBS to avoid
@ -2042,7 +2040,7 @@ AC_FUNC_VPRINTF
AC_CHECK_FUNCS(alarm bcmp bfill bmove bsearch bzero \ AC_CHECK_FUNCS(alarm bcmp bfill bmove bsearch bzero \
chsize cuserid fchmod fcntl \ chsize cuserid fchmod fcntl \
fconvert fdatasync 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 \
getpwuid getrlimit getrusage getwd index initgroups isnan \ getpwuid getrlimit getrusage getwd index initgroups isnan \
localtime_r gethrtime gmtime_r \ localtime_r gethrtime gmtime_r \

View File

@ -34,7 +34,6 @@ functions */
#include <sys/locking.h> #include <sys/locking.h>
#include <sys/stat.h> /* chmod() constants*/ #include <sys/stat.h> /* chmod() constants*/
#include <winsock2.h> #include <winsock2.h>
#include <math.h> /* Because of rint() */
#include <fcntl.h> #include <fcntl.h>
#include <io.h> #include <io.h>
#include <malloc.h> #include <malloc.h>
@ -233,13 +232,6 @@ typedef uint rf_SetTimer;
#define inline __inline #define inline __inline
#endif /* __cplusplus */ #endif /* __cplusplus */
inline double rint(double nr)
{
double f = floor(nr);
double c = ceil(nr);
return (((c-nr) >= (nr-f)) ? f :c);
}
#ifdef _WIN64 #ifdef _WIN64
#define ulonglong2double(A) ((double) (ulonglong) (A)) #define ulonglong2double(A) ((double) (ulonglong) (A))
#define my_off_t2double(A) ((double) (my_off_t) (A)) #define my_off_t2double(A) ((double) (my_off_t) (A))
@ -294,7 +286,6 @@ inline ulonglong double2ulonglong(double d)
#define HAVE_FLOAT_H #define HAVE_FLOAT_H
#define HAVE_LIMITS_H #define HAVE_LIMITS_H
#define HAVE_STDDEF_H #define HAVE_STDDEF_H
#define HAVE_RINT /* defined in this file */
#define NO_FCNTL_NONBLOCK /* No FCNTL */ #define NO_FCNTL_NONBLOCK /* No FCNTL */
#define HAVE_ALLOCA #define HAVE_ALLOCA
#define HAVE_STRPBRK #define HAVE_STRPBRK

View File

@ -72,7 +72,7 @@ extern void my_cleanup_options(const struct my_option *options);
extern void my_print_help(const struct my_option *options); extern void my_print_help(const struct my_option *options);
extern void my_print_variables(const struct my_option *options); extern void my_print_variables(const struct my_option *options);
extern void my_getopt_register_get_addr(uchar ** (*func_addr)(const char *, uint, extern void my_getopt_register_get_addr(uchar ** (*func_addr)(const char *, uint,
const struct my_option *)); const struct my_option *, int *));
ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp, ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp,
my_bool *fix); my_bool *fix);

View File

@ -430,6 +430,9 @@ C_MODE_END
#ifdef HAVE_FLOAT_H #ifdef HAVE_FLOAT_H
#include <float.h> #include <float.h>
#endif #endif
#ifdef HAVE_FENV_H
#include <fenv.h> /* For fesetround() */
#endif
#ifdef HAVE_SYS_TYPES_H #ifdef HAVE_SYS_TYPES_H
#include <sys/types.h> #include <sys/types.h>
@ -586,8 +589,39 @@ typedef unsigned short ushort;
#define set_bits(type, bit_count) (sizeof(type)*8 <= (bit_count) ? ~(type) 0 : ((((type) 1) << (bit_count)) - (type) 1)) #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])))
#ifndef HAVE_RINT #ifndef HAVE_RINT
#define rint(A) floor((A)+(((A) < 0)? -0.5 : 0.5)) /**
#endif All integers up to this number can be represented exactly as double precision
values (DBL_MANT_DIG == 53 for IEEE 754 hardware).
*/
#define MAX_EXACT_INTEGER ((1LL << DBL_MANT_DIG) - 1)
/**
rint(3) implementation for platforms that do not have it.
Always rounds to the nearest integer with ties being rounded to the nearest
even integer to mimic glibc's rint() behavior in the "round-to-nearest"
FPU mode. Hardware-specific optimizations are possible (frndint on x86).
Unlike this implementation, hardware will also honor the FPU rounding mode.
*/
static inline double rint(double x)
{
double f, i;
f = modf(x, &i);
/*
All doubles with absolute values > MAX_EXACT_INTEGER are even anyway,
no need to check it.
*/
if (x > 0.0)
i += (double) ((f > 0.5) || (f == 0.5 &&
i <= (double) MAX_EXACT_INTEGER &&
(longlong) i % 2));
else
i -= (double) ((f < -0.5) || (f == -0.5 &&
i >= (double) -MAX_EXACT_INTEGER &&
(longlong) i % 2));
return i;
}
#endif /* HAVE_RINT */
/* Define some general constants */ /* Define some general constants */
#ifndef TRUE #ifndef TRUE
@ -629,7 +663,6 @@ C_MODE_END
*/ */
#define _VARARGS(X) X #define _VARARGS(X) X
#define _STATIC_VARARGS(X) X #define _STATIC_VARARGS(X) X
#define _PC(X) X
/* The DBUG_ON flag always takes precedence over default DBUG_OFF */ /* The DBUG_ON flag always takes precedence over default DBUG_OFF */
#if defined(DBUG_ON) && defined(DBUG_OFF) #if defined(DBUG_ON) && defined(DBUG_OFF)

View File

@ -13,80 +13,42 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* See md5.c for explanation and copyright information. */
/* MD5.H - header file for MD5C.C /*
* $FreeBSD: src/contrib/cvs/lib/md5.h,v 1.2 1999/12/11 15:10:02 peter Exp $
*/ */
/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All /* Unlike previous versions of this code, uint32 need not be exactly
rights reserved. 32 bits, merely 32 bits or more. Choosing a data type which is 32
bits instead of 64 is not important; speed is considerably more
important. ANSI guarantees that "unsigned long" will be big enough,
and always using it seems to have few disadvantages. */
typedef uint32 cvs_uint32;
License to copy and use this software is granted provided that it
is identified as the "RSA Data Security, Inc. MD5 Message-Digest
Algorithm" in all material mentioning or referencing this software
or this function.
License is also granted to make and use derivative works provided
that such works are identified as "derived from the RSA Data
Security, Inc. MD5 Message-Digest Algorithm" in all material
mentioning or referencing the derived work.
RSA Data Security, Inc. makes no representations concerning either
the merchantability of this software or the suitability of this
software for any particular purpose. It is provided "as is"
without express or implied warranty of any kind.
These notices must be retained in any copies of any part of this
documentation and/or software.
*/
/* GLOBAL.H - RSAREF types and constants
*/
/* PROTOTYPES should be set to one if and only if the compiler supports
function argument prototyping.
The following makes PROTOTYPES default to 0 if it has not already
been defined with C compiler flags.
*/
/* egcs 1.1.2 under linux didn't defined it.... :( */
#ifndef PROTOTYPES
#define PROTOTYPES 1 /* Assume prototypes */
#endif
/* POINTER defines a generic pointer type */
typedef unsigned char *POINTER;
/* UINT2 defines a two byte word */
typedef uint16 UINT2; /* Fix for MySQL / Alpha */
/* UINT4 defines a four byte word */
typedef uint32 UINT4; /* Fix for MySQL / Alpha */
/* PROTO_LIST is defined depending on how PROTOTYPES is defined above.
If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
returns an empty list.
*/
#if PROTOTYPES
#define PROTO_LIST(list) list
#else
#define PROTO_LIST(list) ()
#endif
/* MD5 context. */
typedef struct { typedef struct {
UINT4 state[4]; /* state (ABCD) */ cvs_uint32 buf[4];
UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */ cvs_uint32 bits[2];
unsigned char buffer[64]; /* input buffer */ unsigned char in[64];
} my_MD5_CTX; } my_MD5Context;
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
void my_MD5Init PROTO_LIST ((my_MD5_CTX *)); void my_MD5Init (my_MD5Context *context);
void my_MD5Update PROTO_LIST void my_MD5Update (my_MD5Context *context,
((my_MD5_CTX *, unsigned char *, unsigned int)); unsigned char const *buf, unsigned len);
void my_MD5Final PROTO_LIST ((unsigned char [16], my_MD5_CTX *)); void my_MD5Final (unsigned char digest[16],
my_MD5Context *context);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#define MY_MD5_HASH(digest,buf,len) \
do { \
my_MD5Context ctx; \
my_MD5Init (&ctx); \
my_MD5Update (&ctx, buf, len); \
my_MD5Final (digest, &ctx); \
} while (0)

View File

@ -652,6 +652,7 @@ extern int nt_share_delete(const char *name,myf MyFlags);
extern void TERMINATE(FILE *file, uint flag); extern void TERMINATE(FILE *file, uint flag);
#endif #endif
extern void init_glob_errs(void); extern void init_glob_errs(void);
extern void wait_for_free_space(const char *filename, int errors);
extern FILE *my_fopen(const char *FileName,int Flags,myf MyFlags); extern FILE *my_fopen(const char *FileName,int Flags,myf MyFlags);
extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags); extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags);
extern int my_fclose(FILE *fd,myf MyFlags); extern int my_fclose(FILE *fd,myf MyFlags);

View File

@ -3833,13 +3833,13 @@ static void fetch_float_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
#undef NOT_FIXED_DEC #undef NOT_FIXED_DEC
{ {
/* /*
The 14 below is to ensure that the server and client has the same DBL_DIG below is to ensure that the server and client has the same
precisions. This will ensure that on the same machine you get the precisions. This will ensure that on the same machine you get the
same value as a string independent of the protocol you use. same value as a string independent of the protocol you use.
*/ */
sprintf(buff, "%-*.*g", (int) min(sizeof(buff)-1, sprintf(buff, "%-*.*g", (int) min(sizeof(buff)-1,
param->buffer_length), param->buffer_length),
min(14,width), value); min(DBL_DIG, width), value);
end= strcend(buff, ' '); end= strcend(buff, ' ');
*end= 0; *end= 0;
} }

View File

@ -43,6 +43,15 @@ extern char mysql_server_last_error[MYSQL_ERRMSG_SIZE];
static my_bool emb_read_query_result(MYSQL *mysql); static my_bool emb_read_query_result(MYSQL *mysql);
extern "C" void unireg_clear(int exit_code)
{
DBUG_ENTER("unireg_clear");
clean_up(!opt_help && (exit_code || !opt_bootstrap)); /* purecov: inspected */
my_end(opt_endinfo ? MY_CHECK_ERROR | MY_GIVE_INFO : 0);
DBUG_VOID_RETURN;
}
/* /*
Reads error information from the MYSQL_DATA and puts Reads error information from the MYSQL_DATA and puts
it into proper MYSQL members it into proper MYSQL members

View File

@ -479,6 +479,7 @@ handler t1 open;
--echo --> client 1 --echo --> client 1
connection default; connection default;
drop table t1; drop table t1;
disconnect con2;
# #
# Bug#30632 HANDLER read failure causes hang # Bug#30632 HANDLER read failure causes hang
@ -692,3 +693,30 @@ unlock tables;
drop table t1; drop table t1;
--error ER_UNKNOWN_TABLE --error ER_UNKNOWN_TABLE
handler t1 read a next; handler t1 read a next;
#
# Bug#41110: crash with handler command when used concurrently with alter table
# Bug#41112: crash in mysql_ha_close_table/get_lock_data with alter table
#
--disable_warnings
drop table if exists t1;
--enable_warnings
create table t1 (a int);
insert into t1 values (1);
handler t1 open;
connect(con1,localhost,root,,);
send alter table t1 engine=memory;
connection default;
let $wait_condition=
select count(*) = 1 from information_schema.processlist
where state = "rename result table" and info = "alter table t1 engine=memory";
--source include/wait_condition.inc
--error ER_ILLEGAL_HA
handler t1 read a next;
handler t1 close;
connection con1;
--reap
drop table t1;
disconnect con1;
connection default;

View File

@ -2,6 +2,13 @@
# By JBM 2006-02-16 So that the code is not repeated # # By JBM 2006-02-16 So that the code is not repeated #
# in test cases and can be reused. # # in test cases and can be reused. #
###################################################### ######################################################
# Bug#41307: Tests using include/ndb_backup.inc won't work on Windows due to
# 'grep' call
# This test is disabled on Windows via the next line until the above bug is
# resolved
--source include/not_windows.inc
--exec $NDB_MGM --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -e "start backup" >> $NDB_TOOLS_OUTPUT --exec $NDB_MGM --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -e "start backup" >> $NDB_TOOLS_OUTPUT
# there is no neat way to find the backupid, this is a hack to find it... # there is no neat way to find the backupid, this is a hack to find it...

View File

@ -69,9 +69,9 @@ let $_fake_relay_log_purge= `SELECT @@global.relay_log_purge`;
# Create relay log file. # Create relay log file.
copy_file $fake_relay_log $_fake_relay_log; copy_file $fake_relay_log $_fake_relay_log;
# Create relay log index. # Create relay log index.
--exec echo $_fake_relay_log > $_fake_relay_index --exec echo $_fake_filename-fake.000001 > $_fake_relay_index
# Setup replication from existing relay log. # Setup replication from existing relay log.
eval CHANGE MASTER TO MASTER_HOST='dummy.localdomain', RELAY_LOG_FILE='$_fake_relay_log', RELAY_LOG_POS=4; eval CHANGE MASTER TO MASTER_HOST='dummy.localdomain', RELAY_LOG_FILE='$_fake_filename-fake.000001', RELAY_LOG_POS=4;
--enable_query_log --enable_query_log

View File

@ -1,5 +1,5 @@
# #
# Run a query over and over until it suceeds ot timeout occurs # Run a query over and over until it succeeds ot timeout occurs
# #
@ -17,7 +17,7 @@ while ($mysql_errno)
if (!$counter) if (!$counter)
{ {
die("Waited too long for query to suceed"); --die "Waited too long for query to succeed";
} }
} }
enable_abort_on_error; enable_abort_on_error;

View File

@ -0,0 +1,78 @@
# include/wait_show_condition.inc
#
# SUMMARY
#
# Waits until the show statement ($show_statement) has at least within one of
# the rows of the result set for the field ($field) a value which fulfils
# a condition ($condition), or the operation times out.
#
#
# USAGE
#
# let $show_statement= SHOW PROCESSLIST;
# let $field= State;
# let $condition= = 'Updating';
# --source include/wait_show_condition.inc
#
# OR
#
# let $wait_timeout= 60; # Override default of 30 seconds with 60.
# let $show_statement= SHOW PROCESSLIST;
# let $field= State;
# let $condition= = 'Updating';
# --source include/wait_show_condition.inc
#
# Please do not use this use routine if you can replace the SHOW statement
# with a select. In such a case include/wait_condition.inc is recommended.
#
# Created: 2009-02-18 mleich
#
let $max_run_time= 30;
if ($wait_timeout)
{
let $max_run_time= $wait_timeout;
}
# Reset $wait_timeout so that its value won't be used on subsequent
# calls, and default will be used instead.
let $wait_timeout= 0;
# The smallest timespan till UNIX_TIMESTAMP() gets incremented is ~0 seconds.
# We add one second to avoid the case that somebody measures timespans on a
# real clock with fractions of seconds, detects that n seconds are sufficient,
# assigns n to this routine and suffers because he sometimes gets n - 1
# seconds in reality.
inc $max_run_time;
let $found= 0;
let $max_end_time= `SELECT UNIX_TIMESTAMP() + $max_run_time`;
while (`SELECT UNIX_TIMESTAMP() <= $max_end_time AND $found = 0`)
{
# Sleep a bit to avoid too heavy load.
real_sleep 0.2;
let $rowno= 1;
let $process_result= 1;
while (`SELECT $process_result = 1 AND $found = 0`)
{
let $field_value= query_get_value($show_statement, $field, $rowno);
if (`SELECT '$field_value' $condition`)
{
let $found= 1;
}
if (`SELECT '$field_value' = 'No such row'`)
{
# We are behind the last row of the result set.
let $process_result= 0;
}
inc $rowno;
}
}
if (!$found)
{
echo # Timeout in include/wait_show_condition.inc for $wait_condition;
echo # show_statement : $show_statement;
echo # field : $field;
echo # condition : $condition;
echo # max_run_time : $max_run_time;
}

View File

@ -2,11 +2,20 @@
# #
# SUMMARY # SUMMARY
# #
# Waits until the passed number ($count_sessions) of concurrent sessions was # Waits until the passed number ($count_sessions) of concurrent sessions or
# observed via # a smaller number was observed via
# SHOW STATUS LIKE 'Threads_connected' # SHOW STATUS LIKE 'Threads_connected'
# or the operation times out. # or the operation times out.
# Note: Starting with 5.1 we could also use # Note:
# 1. We wait for $current_sessions <= $count_sessions because in the use case
# with count_sessions.inc before and wait_until_count_sessions.inc after
# the core of the test it could happen that the disconnects of sessions
# belonging to the preceeding test are not finished.
# sessions at test begin($count_sessions) = m + n
# sessions of the previous test which will be soon disconnected = n (n >= 0)
# sessions at test end ($current sessions, assuming the test disconnects
# all additional sessions) = m
# 2. Starting with 5.1 we could also use
# SELECT COUNT(*) FROM information_schema.processlist # SELECT COUNT(*) FROM information_schema.processlist
# I stay with "SHOW STATUS LIKE 'Threads_connected'" because this # I stay with "SHOW STATUS LIKE 'Threads_connected'" because this
# runs in all versions 5.0+ # runs in all versions 5.0+
@ -19,7 +28,7 @@
# #
# OR typical example of a test which uses more than one session # OR typical example of a test which uses more than one session
# Such a test could harm successing tests if there is no server shutdown # Such a test could harm successing tests if there is no server shutdown
# and start between.cw # and start between.
# #
# If the testing box is slow than the disconnect of sessions belonging to # If the testing box is slow than the disconnect of sessions belonging to
# the current test might happen when the successing test gets executed. # the current test might happen when the successing test gets executed.
@ -79,10 +88,14 @@
# backup.test, grant3.test # backup.test, grant3.test
# #
# #
# Created: 2009-01-14 mleich # Created:
# 2009-01-14 mleich
# Modified:
# 2009-02-24 mleich Fix Bug#43114 wait_until_count_sessions too restrictive,
# random PB failures
# #
let $wait_counter= 50; let $wait_counter= 100;
if ($wait_timeout) if ($wait_timeout)
{ {
let $wait_counter= `SELECT $wait_timeout * 10`; let $wait_counter= `SELECT $wait_timeout * 10`;
@ -93,7 +106,7 @@ let $wait_timeout= 0;
while ($wait_counter) while ($wait_counter)
{ {
let $current_sessions= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1); let $current_sessions= query_get_value(SHOW STATUS LIKE 'Threads_connected', Value, 1);
let $success= `SELECT $current_sessions = $count_sessions`; let $success= `SELECT $current_sessions <= $count_sessions`;
if ($success) if ($success)
{ {
let $wait_counter= 0; let $wait_counter= 0;
@ -107,6 +120,7 @@ while ($wait_counter)
if (!$success) if (!$success)
{ {
--echo # Timeout in wait_until_count_sessions.inc --echo # Timeout in wait_until_count_sessions.inc
--echo # Number of sessions expected: $count_sessions found: $current_sessions --echo # Number of sessions expected: <= $count_sessions found: $current_sessions
SHOW PROCESSLIST;
} }

View File

@ -104,9 +104,136 @@ EOF
} }
# Check that Debugging tools for Windows are installed
sub cdb_check {
`cdb -? 2>&1`;
if ($? >> 8)
{
print "Cannot find cdb. Please Install Debugging tools for Windows\n";
print "from http://www.microsoft.com/whdc/devtools/debugging/";
if($ENV{'ProgramW6432'})
{
print "install64bit.mspx (native x64 version)\n";
}
else
{
print "installx86.mspx\n";
}
}
}
sub _cdb {
my ($core_name)= @_;
print "\nTrying 'cdb' to get a backtrace\n";
return unless -f $core_name;
# Try to set environment for debugging tools for Windows
if ($ENV{'PATH'} !~ /Debugging Tools/)
{
if ($ENV{'ProgramW6432'})
{
# On x64 computer
$ENV{'PATH'}.= ";".$ENV{'ProgramW6432'}."\\Debugging Tools For Windows (x64)";
}
else
{
# On x86 computer. Newest versions of Debugging tools are installed in the
# directory with (x86) suffix, older versions did not have this suffix.
$ENV{'PATH'}.= ";".$ENV{'ProgramFiles'}."\\Debugging Tools For Windows (x86)";
$ENV{'PATH'}.= ";".$ENV{'ProgramFiles'}."\\Debugging Tools For Windows";
}
}
# Read module list, find out the name of executable and
# build symbol path (required by cdb if executable was built on
# different machine)
my $tmp_name= $core_name.".cdb_lmv";
`cdb -z $core_name -c \"lmv;q\" > $tmp_name 2>&1`;
if ($? >> 8)
{
unlink($tmp_name);
# check if cdb is installed and complain if not
cdb_check();
return;
}
open(temp,"< $tmp_name");
my %dirhash=();
while(<temp>)
{
if($_ =~ /Image path\: (.*)/)
{
if (rindex($1,'\\') != -1)
{
my $dir= substr($1, 0, rindex($1,'\\'));
$dirhash{$dir}++;
}
}
}
close(temp);
unlink($tmp_name);
my $image_path= join(";", (keys %dirhash),".");
# For better callstacks, setup _NT_SYMBOL_PATH to include
# OS symbols. Note : Dowloading symbols for the first time
# can take some minutes
if (!$ENV{'_NT_SYMBOL_PATH'})
{
my $windir= $ENV{'windir'};
my $symbol_cache= substr($windir ,0, index($windir,'\\'))."\\cdb_symbols";
print "OS debug symbols will be downloaded and stored in $symbol_cache.\n";
print "You can control the location of symbol cache with _NT_SYMBOL_PATH\n";
print "environment variable. Please refer to Microsoft KB article\n";
print "http://support.microsoft.com/kb/311503 for details about _NT_SYMBOL_PATH\n";
print "-------------------------------------------------------------------------\n";
$ENV{'_NT_SYMBOL_PATH'}.=
"srv*".$symbol_cache."*http://msdl.microsoft.com/download/symbols";
}
my $symbol_path= $image_path.";".$ENV{'_NT_SYMBOL_PATH'};
# Run cdb. Use "analyze" extension to print crashing thread stacktrace
# and "uniqstack" to print other threads
my $cdb_cmd = "!sym prompts off; !analyze -v; .ecxr; !for_each_frame dv /t;!uniqstack -p;q";
my $cdb_output=
`cdb -z $core_name -i "$image_path" -y "$symbol_path" -t 0 -lines -c "$cdb_cmd" 2>&1`;
return if $? >> 8;
return unless $cdb_output;
# Remove comments (lines starting with *), stack pointer and frame
# pointer adresses and offsets to function to make output better readable
$cdb_output=~ s/^\*.*\n//gm;
$cdb_output=~ s/^([\:0-9a-fA-F\`]+ )+//gm;
$cdb_output=~ s/^ChildEBP RetAddr//gm;
$cdb_output=~ s/^Child\-SP RetAddr Call Site//gm;
$cdb_output=~ s/\+0x([0-9a-fA-F]+)//gm;
print <<EOF, $cdb_output, "\n";
Output from cdb follows. Faulting thread is printed twice,with and without function parameters
Search for STACK_TEXT to see the stack trace of
the faulting thread. Callstacks of other threads are printed after it.
EOF
return 1;
}
sub show { sub show {
my ($class, $core_name)= @_; my ($class, $core_name)= @_;
# On Windows, rely on cdb to be there...
if (IS_WINDOWS)
{
_cdb($core_name);
return;
}
# We try dbx first; gdb itself may coredump if run on a Sun Studio # We try dbx first; gdb itself may coredump if run on a Sun Studio
# compiled binary on Solaris. # compiled binary on Solaris.

View File

@ -77,14 +77,29 @@ static void message(const char* fmt, ...)
static void die(const char* fmt, ...) static void die(const char* fmt, ...)
{ {
DWORD last_err= GetLastError();
va_list args; va_list args;
fprintf(stderr, "%s: FATAL ERROR, ", safe_process_name); fprintf(stderr, "%s: FATAL ERROR, ", safe_process_name);
va_start(args, fmt); va_start(args, fmt);
vfprintf(stderr, fmt, args); vfprintf(stderr, fmt, args);
fprintf(stderr, "\n"); fprintf(stderr, "\n");
va_end(args); va_end(args);
if (int last_err= GetLastError()) if (last_err)
fprintf(stderr, "error: %d, %s\n", last_err, strerror(last_err)); {
char *message_text;
if (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER
|FORMAT_MESSAGE_IGNORE_INSERTS, NULL, last_err , 0, (LPSTR)&message_text,
0, NULL))
{
fprintf(stderr,"error: %d, %s\n",last_err, message_text);
LocalFree(message_text);
}
else
{
/* FormatMessage failed, print error code only */
fprintf(stderr,"error:%d\n", last_err);
}
}
fflush(stderr); fflush(stderr);
exit(1); exit(1);
} }

View File

@ -22,40 +22,46 @@ use strict;
sub gcov_prepare ($) { sub gcov_prepare ($) {
my ($dir)= @_; my ($dir)= @_;
print "Purging gcov information from '$dir'...\n";
`find $dir -name \*.gcov \ system("find $dir -name \*.gcov -o -name \*.da"
-or -name \*.da | xargs rm`; . " -o -name \*.gcda | grep -v 'README.gcov\$' | xargs rm");
} }
my @mysqld_src_dirs= #
( # Collect gcov statistics.
"strings", # Arguments:
"mysys", # $dir basedir, normally source directory
"include", # $gcov gcov utility program [path] name
"extra", # $gcov_msg message file name
"regex", # $gcov_err error file name
"isam", #
"merge",
"myisam",
"myisammrg",
"heap",
"sql",
);
sub gcov_collect ($$$) { sub gcov_collect ($$$) {
my ($dir, $gcov, $gcov_msg, $gcov_err)= @_; my ($dir, $gcov, $gcov_msg, $gcov_err)= @_;
# Get current directory to return to later.
my $start_dir= cwd(); my $start_dir= cwd();
print "Collecting source coverage info...\n"; print "Collecting source coverage info using '$gcov'...\n";
-f $gcov_msg and unlink($gcov_msg); -f "$start_dir/$gcov_msg" and unlink("$start_dir/$gcov_msg");
-f $gcov_err and unlink($gcov_err); -f "$start_dir/$gcov_err" and unlink("$start_dir/$gcov_err");
foreach my $d ( @mysqld_src_dirs )
{ my @dirs= `find "$dir" -type d -print | sort`;
chdir("$dir/$d"); #print "List of directories:\n@dirs\n";
foreach my $f ( (glob("*.h"), glob("*.cc"), glob("*.c")) )
{ foreach my $d ( @dirs ) {
`$gcov $f 2>>$gcov_err >>$gcov_msg`; my $dir_reported= 0;
chomp($d);
chdir($d) or next;
foreach my $f ( (glob("*.h"), glob("*.cc"), glob("*.c")) ) {
$f =~ /(.*)\.[ch]c?/;
-f "$1.gcno" or next;
if (!$dir_reported) {
print "Collecting in '$d'...\n";
$dir_reported= 1;
}
system("$gcov $f 2>>$start_dir/$gcov_err >>$start_dir/$gcov_msg");
} }
chdir($start_dir); chdir($start_dir);
} }

View File

@ -168,8 +168,9 @@ our $opt_force;
our $opt_mem= $ENV{'MTR_MEM'}; our $opt_mem= $ENV{'MTR_MEM'};
our $opt_gcov; our $opt_gcov;
our $opt_gcov_err; our $opt_gcov_exe= "gcov";
our $opt_gcov_msg; our $opt_gcov_err= "mysql-test-gcov.msg";
our $opt_gcov_msg= "mysql-test-gcov.err";
our $glob_debugger= 0; our $glob_debugger= 0;
our $opt_gdb; our $opt_gdb;
@ -413,7 +414,7 @@ sub main {
mtr_print_line(); mtr_print_line();
if ( $opt_gcov ) { if ( $opt_gcov ) {
gcov_collect($basedir, $opt_gcov, gcov_collect($basedir, $opt_gcov_exe,
$opt_gcov_msg, $opt_gcov_err); $opt_gcov_msg, $opt_gcov_err);
} }
@ -2977,9 +2978,6 @@ test case was executed:\n";
$result= 2; $result= 2;
} }
# Remove the .err file the check generated
unlink($err_file);
# Remove the .result file the check generated # Remove the .result file the check generated
unlink("$base_file.result"); unlink("$base_file.result");
@ -3600,6 +3598,7 @@ sub start_check_warnings ($$) {
mtr_add_arg($args, "--skip-safemalloc"); mtr_add_arg($args, "--skip-safemalloc");
mtr_add_arg($args, "--test-file=%s", "include/check-warnings.test"); mtr_add_arg($args, "--test-file=%s", "include/check-warnings.test");
mtr_add_arg($args, "--verbose");
if ( $opt_embedded_server ) if ( $opt_embedded_server )
{ {
@ -3689,10 +3688,9 @@ sub check_warnings ($) {
if ( $res == 62 ) { if ( $res == 62 ) {
# Test case was ok and called "skip" # Test case was ok and called "skip"
;
}
# Remove the .err file the check generated # Remove the .err file the check generated
unlink($err_file); unlink($err_file);
}
if ( keys(%started) == 0){ if ( keys(%started) == 0){
# All checks completed # All checks completed
@ -3714,8 +3712,6 @@ sub check_warnings ($) {
$result= 2; $result= 2;
} }
# Remove the .err file the check generated
unlink($err_file);
} }
elsif ( $proc eq $timeout_proc ) { elsif ( $proc eq $timeout_proc ) {
$tinfo->{comment}.= "Timeout $timeout_proc for ". $tinfo->{comment}.= "Timeout $timeout_proc for ".
@ -4616,6 +4612,7 @@ sub start_check_testcase ($$$) {
mtr_add_arg($args, "--result-file=%s", "$opt_vardir/tmp/$name.result"); mtr_add_arg($args, "--result-file=%s", "$opt_vardir/tmp/$name.result");
mtr_add_arg($args, "--test-file=%s", "include/check-testcase.test"); mtr_add_arg($args, "--test-file=%s", "include/check-testcase.test");
mtr_add_arg($args, "--verbose");
if ( $mode eq "before" ) if ( $mode eq "before" )
{ {
@ -4792,7 +4789,6 @@ sub start_mysqltest ($) {
debugger_arguments(\$args, \$exe, "client"); debugger_arguments(\$args, \$exe, "client");
} }
my $proc= My::SafeProcess->new my $proc= My::SafeProcess->new
( (
name => "mysqltest", name => "mysqltest",
@ -5189,6 +5185,8 @@ Misc options
sleep=SECONDS Passed to mysqltest, will be used as fixed sleep time sleep=SECONDS Passed to mysqltest, will be used as fixed sleep time
debug-sync-timeout=NUM Set default timeout for WAIT_FOR debug sync debug-sync-timeout=NUM Set default timeout for WAIT_FOR debug sync
actions. Disable facility with NUM=0. actions. Disable facility with NUM=0.
gcov Collect coverage information after the test.
The result is a gcov file per source and header file.
HERE HERE
exit(1); exit(1);

View File

@ -292,7 +292,7 @@ Note 1003 select astext(startpoint(`test`.`gis_line`.`g`)) AS `AsText(StartPoint
SELECT fid, AsText(Centroid(g)) FROM gis_polygon ORDER by fid; SELECT fid, AsText(Centroid(g)) FROM gis_polygon ORDER by fid;
fid AsText(Centroid(g)) fid AsText(Centroid(g))
108 POINT(15 15) 108 POINT(15 15)
109 POINT(25.416666666667 25.416666666667) 109 POINT(25.4166666666667 25.4166666666667)
110 POINT(20 10) 110 POINT(20 10)
SELECT fid, Area(g) FROM gis_polygon ORDER by fid; SELECT fid, Area(g) FROM gis_polygon ORDER by fid;
fid Area(g) fid Area(g)
@ -326,8 +326,8 @@ fid IsClosed(g)
116 0 116 0
SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid; SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid;
fid AsText(Centroid(g)) fid AsText(Centroid(g))
117 POINT(55.588527753042 17.426536064114) 117 POINT(55.5885277530424 17.426536064114)
118 POINT(55.588527753042 17.426536064114) 118 POINT(55.5885277530424 17.426536064114)
119 POINT(2 2) 119 POINT(2 2)
SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid; SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid;
fid Area(g) fid Area(g)

View File

@ -4,23 +4,23 @@ create table t4(n int);
backup table t4 to '../../bogus'; backup table t4 to '../../bogus';
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t4 backup error Failed copying .frm file (errno: X) test.t4 backup error Failed copying .frm file (errno: X)
test.t4 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead test.t4 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
test.t4 backup Error Can't create/write to file 'MYSQLTEST_VARDIR/bogus/t4.frm' (Errcode: X) test.t4 backup Error Can't create/write to file 'MYSQLTEST_VARDIR/bogus/t4.frm' (Errcode: X)
test.t4 backup status Operation failed test.t4 backup status Operation failed
backup table t4 to '../../tmp'; backup table t4 to '../../tmp';
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t4 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead test.t4 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
test.t4 backup status OK test.t4 backup status OK
backup table t4 to '../../tmp'; backup table t4 to '../../tmp';
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t4 backup error Failed copying .frm file (errno: X) test.t4 backup error Failed copying .frm file (errno: X)
test.t4 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead test.t4 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
test.t4 backup Error Can't create/write to file 'MYSQLTEST_VARDIR/tmp/t4.frm' (Errcode: X) test.t4 backup Error Can't create/write to file 'MYSQLTEST_VARDIR/tmp/t4.frm' (Errcode: X)
test.t4 backup status Operation failed test.t4 backup status Operation failed
drop table t4; drop table t4;
restore table t4 from '../../tmp'; restore table t4 from '../../tmp';
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t4 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead test.t4 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
test.t4 restore status OK test.t4 restore status OK
select count(*) from t4; select count(*) from t4;
count(*) count(*)
@ -29,18 +29,18 @@ create table t1(n int);
insert into t1 values (23),(45),(67); insert into t1 values (23),(45),(67);
backup table t1 to '../../tmp'; backup table t1 to '../../tmp';
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead test.t1 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
test.t1 backup status OK test.t1 backup status OK
drop table t1; drop table t1;
restore table t1 from '../../bogus'; restore table t1 from '../../bogus';
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
t1 restore error Failed copying .frm file t1 restore error Failed copying .frm file
Warnings: Warnings:
Warning 1287 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead Warning 1287 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
Error 29 File 'MYSQLTEST_VARDIR/bogus/t1.frm' not found (Errcode: X) Error 29 File 'MYSQLTEST_VARDIR/bogus/t1.frm' not found (Errcode: X)
restore table t1 from '../../tmp'; restore table t1 from '../../tmp';
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead test.t1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
test.t1 restore status OK test.t1 restore status OK
select n from t1; select n from t1;
n n
@ -53,13 +53,13 @@ insert into t2 values (123),(145),(167);
insert into t3 values (223),(245),(267); insert into t3 values (223),(245),(267);
backup table t2,t3 to '../../tmp'; backup table t2,t3 to '../../tmp';
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t2 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead test.t2 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
test.t2 backup status OK test.t2 backup status OK
test.t3 backup status OK test.t3 backup status OK
drop table t1,t2,t3; drop table t1,t2,t3;
restore table t1,t2,t3 from '../../tmp'; restore table t1,t2,t3 from '../../tmp';
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead test.t1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
test.t1 restore status OK test.t1 restore status OK
test.t2 restore status OK test.t2 restore status OK
test.t3 restore status OK test.t3 restore status OK
@ -81,14 +81,14 @@ k
drop table t1,t2,t3,t4; drop table t1,t2,t3,t4;
restore table t1 from '../../tmp'; restore table t1 from '../../tmp';
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead test.t1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
test.t1 restore status OK test.t1 restore status OK
rename table t1 to t5; rename table t1 to t5;
lock tables t5 write; lock tables t5 write;
backup table t5 to '../../tmp'; backup table t5 to '../../tmp';
unlock tables; unlock tables;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t5 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead test.t5 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
test.t5 backup status OK test.t5 backup status OK
drop table t5; drop table t5;
DROP TABLE IF EXISTS `t+1`; DROP TABLE IF EXISTS `t+1`;
@ -96,12 +96,12 @@ CREATE TABLE `t+1` (c1 INT);
INSERT INTO `t+1` VALUES (1), (2), (3); INSERT INTO `t+1` VALUES (1), (2), (3);
BACKUP TABLE `t+1` TO '../../tmp'; BACKUP TABLE `t+1` TO '../../tmp';
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t+1 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead test.t+1 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
test.t+1 backup status OK test.t+1 backup status OK
DROP TABLE `t+1`; DROP TABLE `t+1`;
RESTORE TABLE `t+1` FROM '../../tmp'; RESTORE TABLE `t+1` FROM '../../tmp';
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t+1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead test.t+1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
test.t+1 restore status OK test.t+1 restore status OK
SELECT * FROM `t+1`; SELECT * FROM `t+1`;
c1 c1

View File

@ -1,15 +1,23 @@
drop table if exists t1; DROP TABLE IF EXISTS t1;
create table t1 (a int) engine=innodb; # Establish connection con1 (user=root)
start transaction with consistent snapshot; # Establish connection con2 (user=root)
insert into t1 values(1); # Switch to connection con1
select * from t1; CREATE TABLE t1 (a INT) ENGINE=innodb;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
# Switch to connection con2
INSERT INTO t1 VALUES(1);
# Switch to connection con1
SELECT * FROM t1;
a a
commit; COMMIT;
delete from t1; DELETE FROM t1;
start transaction; START TRANSACTION;
insert into t1 values(1); # Switch to connection con2
select * from t1; INSERT INTO t1 VALUES(1);
# Switch to connection con1
SELECT * FROM t1;
a a
1 1
commit; COMMIT;
drop table t1; # Switch to connection default + close connections con1 and con2
DROP TABLE t1;

View File

@ -1729,18 +1729,18 @@ DELETE FROM mysqltest2.log|
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER SET cp866 */; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER SET cp866 */;
USE `mysqltest1`; USE `mysqltest1`;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `log` ( CREATE TABLE `log` (
`msg` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL `msg` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t1` ( CREATE TABLE `t1` (
`c` int(11) DEFAULT NULL `c` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
INSERT INTO `t1` VALUES (1),(0),(1); INSERT INTO `t1` VALUES (1),(0),(1);
ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
/*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_client = @@character_set_client */ ;
@ -1808,18 +1808,18 @@ ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER SET cp866 */; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER SET cp866 */;
USE `mysqltest2`; USE `mysqltest2`;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `log` ( CREATE TABLE `log` (
`msg` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL `msg` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t1` ( CREATE TABLE `t1` (
`c` int(11) DEFAULT NULL `c` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
INSERT INTO `t1` VALUES (1),(0),(1); INSERT INTO `t1` VALUES (1),(0),(1);
ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
/*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_client = @@character_set_client */ ;

View File

@ -1729,18 +1729,18 @@ DELETE FROM mysqltest2.log|
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER SET cp866 */; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest1` /*!40100 DEFAULT CHARACTER SET cp866 */;
USE `mysqltest1`; USE `mysqltest1`;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `log` ( CREATE TABLE `log` (
`msg` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL `msg` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t1` ( CREATE TABLE `t1` (
`c` int(11) DEFAULT NULL `c` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
INSERT INTO `t1` VALUES (1),(0),(1); INSERT INTO `t1` VALUES (1),(0),(1);
ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
/*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_client = @@character_set_client */ ;
@ -1808,18 +1808,18 @@ ALTER DATABASE mysqltest1 CHARACTER SET cp866 COLLATE cp866_general_ci ;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER SET cp866 */; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqltest2` /*!40100 DEFAULT CHARACTER SET cp866 */;
USE `mysqltest2`; USE `mysqltest2`;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `log` ( CREATE TABLE `log` (
`msg` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL `msg` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t1` ( CREATE TABLE `t1` (
`c` int(11) DEFAULT NULL `c` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
INSERT INTO `t1` VALUES (1),(0),(1); INSERT INTO `t1` VALUES (1),(0),(1);
ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ; ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
/*!50003 SET @saved_cs_client = @@character_set_client */ ; /*!50003 SET @saved_cs_client = @@character_set_client */ ;

View File

@ -1,9 +1,9 @@
drop table if exists t1; DROP TABLE IF EXISTS t1;
create table t1 (n int); CREATE TABLE t1 (n INT);
insert into t1 values (1),(2),(3); INSERT INTO t1 VALUES (1),(2),(3);
select * from t1; SELECT * FROM t1;
n n
1 1
2 2
3 3
drop table t1; DROP TABLE t1;

View File

@ -736,6 +736,17 @@ select replace(@full_mode, 'ALLOW_INVALID_DATES', 'INVALID_DATES') into @full_mo
select name from mysql.event where name = 'p' and sql_mode = @full_mode; select name from mysql.event where name = 'p' and sql_mode = @full_mode;
name name
drop event e1; drop event e1;
SET @old_server_id = @@GLOBAL.server_id;
SET GLOBAL server_id = (1 << 32) - 1;
SELECT @@GLOBAL.server_id;
@@GLOBAL.server_id
4294967295
CREATE EVENT ev1 ON SCHEDULE EVERY 1 DAY DO SELECT 1;
SELECT event_name, originator FROM INFORMATION_SCHEMA.EVENTS;
event_name originator
ev1 4294967295
DROP EVENT ev1;
SET GLOBAL server_id = @old_server_id;
DROP DATABASE events_test; DROP DATABASE events_test;
SET GLOBAL event_scheduler= 'ON'; SET GLOBAL event_scheduler= 'ON';
SET @@global.concurrent_insert= @concurrent_insert; SET @@global.concurrent_insert= @concurrent_insert;

View File

@ -155,6 +155,10 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings: Warnings:
Note 1003 select 1 AS `1` from (select count(distinct `test`.`t1`.`a`) AS `COUNT(DISTINCT t1.a)` from `test`.`t1` join `test`.`t2` group by `test`.`t1`.`a`) `s1` Note 1003 select 1 AS `1` from (select count(distinct `test`.`t1`.`a`) AS `COUNT(DISTINCT t1.a)` from `test`.`t1` join `test`.`t2` group by `test`.`t1`.`a`) `s1`
DROP TABLE t1,t2; DROP TABLE t1,t2;
CREATE TABLE t1 (a INT PRIMARY KEY);
EXPLAIN EXTENDED SELECT COUNT(a) FROM t1 USE KEY(a);
ERROR 42000: Key 'a' doesn't exist in table 't1'
DROP TABLE t1;
# #
# Bug#37870: Usage of uninitialized value caused failed assertion. # Bug#37870: Usage of uninitialized value caused failed assertion.
# #
@ -182,3 +186,4 @@ dt
2001-01-01 01:01:01 2001-01-01 01:01:01
2001-01-01 01:01:01 2001-01-01 01:01:01
drop tables t1, t2; drop tables t1, t2;
End of 5.1 tests.

View File

@ -1,39 +1,57 @@
drop table if exists t1; # Establish connection con1 (user=root)
create table t1 (a int) engine=innodb; # Establish connection con2 (user=root)
begin; # Establish connection con3 (user=root)
insert into t1 values(1); # Switch to connection con1
flush tables with read lock; DROP TABLE IF EXISTS t1;
select * from t1; CREATE TABLE t1 (a INT) ENGINE=innodb;
BEGIN;
INSERT INTO t1 VALUES(1);
# Switch to connection con2
FLUSH TABLES WITH READ LOCK;
SELECT * FROM t1;
a a
commit; # Switch to connection con1
select * from t1; COMMIT;
# Switch to connection con2
SELECT * FROM t1;
a a
unlock tables; UNLOCK TABLES;
begin; # Switch to connection con1
select * from t1 for update; # Switch to connection con1
BEGIN;
SELECT * FROM t1 FOR UPDATE;
a a
1 1
begin; # Switch to connection con2
select * from t1 for update; BEGIN;
flush tables with read lock; SELECT * FROM t1 FOR UPDATE;
commit; # Switch to connection con3
FLUSH TABLES WITH READ LOCK;
# Switch to connection con1
COMMIT;
# Switch to connection con2
a a
1 1
unlock tables; # Switch to connection con3
commit; UNLOCK TABLES;
begin; # Switch to connection con2
insert into t1 values(10); COMMIT;
flush tables with read lock; # Switch to connection con1
commit; BEGIN;
unlock tables; INSERT INTO t1 VALUES(10);
flush tables with read lock; FLUSH TABLES WITH READ LOCK;
unlock tables; COMMIT;
begin; UNLOCK TABLES;
select * from t1; # Switch to connection con2
FLUSH TABLES WITH READ LOCK;
UNLOCK TABLES;
BEGIN;
SELECT * FROM t1;
a a
1 1
10 10
show create database test; SHOW CREATE DATABASE test;
Database Create Database Database Create Database
test CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET latin1 */ test CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET latin1 */
drop table t1; DROP TABLE t1;
# Switch to connection default and close connections con1, con2, con3

View File

@ -1,15 +1,23 @@
create table t1 (a int) engine=innodb; # Establish connection con1 (user=root)
reset master; # Establish connection con2 (user=root)
set autocommit=0; # Switch to connection con1
insert t1 values (1); CREATE TABLE t1 (a INT) ENGINE=innodb;
flush tables with read lock; RESET MASTER;
show master status; SET AUTOCOMMIT=0;
INSERT t1 VALUES (1);
# Switch to connection con2
FLUSH TABLES WITH READ LOCK;
SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 106 master-bin.000001 106
commit; # Switch to connection con1
show master status; COMMIT;
# Switch to connection con2
SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 106 master-bin.000001 106
unlock tables; UNLOCK TABLES;
drop table t1; # Switch to connection con1
set autocommit=1; DROP TABLE t1;
SET AUTOCOMMIT=1;
# Switch to connection default and close connections con1 and con2

View File

@ -1,12 +1,12 @@
set @old_concurrent_insert= @@global.concurrent_insert; SET @old_concurrent_insert= @@global.concurrent_insert;
set @@global.concurrent_insert= 0; SET @@global.concurrent_insert= 0;
drop table if exists t1; DROP TABLE IF EXISTS t1;
create table t1 (kill_id int); CREATE TABLE t1 (kill_id INT);
insert into t1 values(connection_id()); INSERT INTO t1 VALUES(connection_id());
flush tables with read lock; FLUSH TABLES WITH READ LOCK;
select ((@id := kill_id) - kill_id) from t1; SELECT ((@id := kill_id) - kill_id) FROM t1;
((@id := kill_id) - kill_id) ((@id := kill_id) - kill_id)
0 0
kill connection @id; KILL CONNECTION @id;
drop table t1; DROP TABLE t1;
set @@global.concurrent_insert= @old_concurrent_insert; SET @@global.concurrent_insert= @old_concurrent_insert;

View File

@ -539,3 +539,7 @@ SELECT MATCH(a) AGAINST('aaa1* aaa14 aaa15 aaa16' IN BOOLEAN MODE) FROM t1;
MATCH(a) AGAINST('aaa1* aaa14 aaa15 aaa16' IN BOOLEAN MODE) MATCH(a) AGAINST('aaa1* aaa14 aaa15 aaa16' IN BOOLEAN MODE)
2 2
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1(a TEXT);
SELECT GROUP_CONCAT(a) AS st FROM t1 HAVING MATCH(st) AGAINST('test' IN BOOLEAN MODE);
ERROR HY000: Incorrect arguments to AGAINST
DROP TABLE t1;

View File

@ -61,7 +61,7 @@ grp sum
NULL NULL NULL NULL
1 7 1 7
2 20.25 2 20.25
3 45.483163247594 3 45.4831632475944
create table t2 (grp int, a bigint unsigned, c char(10)); create table t2 (grp int, a bigint unsigned, c char(10));
insert into t2 select grp,max(a)+max(grp),max(c) from t1 group by grp; insert into t2 select grp,max(a)+max(grp),max(c) from t1 group by grp;
replace into t2 select grp, a, c from t1 limit 2,1; replace into t2 select grp, a, c from t1 limit 2,1;
@ -1186,7 +1186,7 @@ std(s1/s2)
0.21325764 0.21325764
select std(o1/o2) from bug22555; select std(o1/o2) from bug22555;
std(o1/o2) std(o1/o2)
0.21325763586649 0.213257635866493
select std(e1/e2) from bug22555; select std(e1/e2) from bug22555;
std(e1/e2) std(e1/e2)
0.21325764 0.21325764
@ -1212,7 +1212,7 @@ round(std(s1/s2), 17)
0.21325763586649341 0.21325763586649341
select std(o1/o2) from bug22555; select std(o1/o2) from bug22555;
std(o1/o2) std(o1/o2)
0.21325763586649 0.213257635866493
select round(std(e1/e2), 17) from bug22555; select round(std(e1/e2), 17) from bug22555;
round(std(e1/e2), 17) round(std(e1/e2), 17)
0.21325763586649341 0.21325763586649341
@ -1237,7 +1237,7 @@ round(std(s1/s2), 17)
0.21325763586649341 0.21325763586649341
select std(o1/o2) from bug22555; select std(o1/o2) from bug22555;
std(o1/o2) std(o1/o2)
0.21325763586649 0.213257635866493
select round(std(e1/e2), 17) from bug22555; select round(std(e1/e2), 17) from bug22555;
round(std(e1/e2), 17) round(std(e1/e2), 17)
0.21325763586649341 0.21325763586649341

View File

@ -60,7 +60,7 @@ Warnings:
Note 1003 select ln(exp(10)) AS `ln(exp(10))`,exp((ln(sqrt(10)) * 2)) AS `exp(ln(sqrt(10))*2)`,ln(-(1)) AS `ln(-1)`,ln(0) AS `ln(0)`,ln(NULL) AS `ln(NULL)` Note 1003 select ln(exp(10)) AS `ln(exp(10))`,exp((ln(sqrt(10)) * 2)) AS `exp(ln(sqrt(10))*2)`,ln(-(1)) AS `ln(-1)`,ln(0) AS `ln(0)`,ln(NULL) AS `ln(NULL)`
select log2(8),log2(15),log2(-2),log2(0),log2(NULL); select log2(8),log2(15),log2(-2),log2(0),log2(NULL);
log2(8) log2(15) log2(-2) log2(0) log2(NULL) log2(8) log2(15) log2(-2) log2(0) log2(NULL)
3 3.9068905956085 NULL NULL NULL 3 3.90689059560852 NULL NULL NULL
explain extended select log2(8),log2(15),log2(-2),log2(0),log2(NULL); explain extended select log2(8),log2(15),log2(-2),log2(0),log2(NULL);
id select_type table type possible_keys key key_len ref rows filtered Extra id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
@ -68,7 +68,7 @@ Warnings:
Note 1003 select log2(8) AS `log2(8)`,log2(15) AS `log2(15)`,log2(-(2)) AS `log2(-2)`,log2(0) AS `log2(0)`,log2(NULL) AS `log2(NULL)` Note 1003 select log2(8) AS `log2(8)`,log2(15) AS `log2(15)`,log2(-(2)) AS `log2(-2)`,log2(0) AS `log2(0)`,log2(NULL) AS `log2(NULL)`
select log10(100),log10(18),log10(-4),log10(0),log10(NULL); select log10(100),log10(18),log10(-4),log10(0),log10(NULL);
log10(100) log10(18) log10(-4) log10(0) log10(NULL) log10(100) log10(18) log10(-4) log10(0) log10(NULL)
2 1.2552725051033 NULL NULL NULL 2 1.25527250510331 NULL NULL NULL
explain extended select log10(100),log10(18),log10(-4),log10(0),log10(NULL); explain extended select log10(100),log10(18),log10(-4),log10(0),log10(NULL);
id select_type table type possible_keys key key_len ref rows filtered Extra id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
@ -85,7 +85,7 @@ Note 1003 select pow(10,log10(10)) AS `pow(10,log10(10))`,pow(2,4) AS `power(2,4
set @@rand_seed1=10000000,@@rand_seed2=1000000; set @@rand_seed1=10000000,@@rand_seed2=1000000;
select rand(999999),rand(); select rand(999999),rand();
rand(999999) rand() rand(999999) rand()
0.014231365187309 0.028870999839968 0.0142313651873091 0.028870999839968
explain extended select rand(999999),rand(); explain extended select rand(999999),rand();
id select_type table type possible_keys key key_len ref rows filtered Extra id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
@ -101,7 +101,7 @@ Warnings:
Note 1003 select pi() AS `pi()`,format(sin((pi() / 2)),6) AS `format(sin(pi()/2),6)`,format(cos((pi() / 2)),6) AS `format(cos(pi()/2),6)`,format(abs(tan(pi())),6) AS `format(abs(tan(pi())),6)`,format((1 / tan(1)),6) AS `format(cot(1),6)`,format(asin(1),6) AS `format(asin(1),6)`,format(acos(0),6) AS `format(acos(0),6)`,format(atan(1),6) AS `format(atan(1),6)` Note 1003 select pi() AS `pi()`,format(sin((pi() / 2)),6) AS `format(sin(pi()/2),6)`,format(cos((pi() / 2)),6) AS `format(cos(pi()/2),6)`,format(abs(tan(pi())),6) AS `format(abs(tan(pi())),6)`,format((1 / tan(1)),6) AS `format(cot(1),6)`,format(asin(1),6) AS `format(asin(1),6)`,format(acos(0),6) AS `format(acos(0),6)`,format(atan(1),6) AS `format(atan(1),6)`
select degrees(pi()),radians(360); select degrees(pi()),radians(360);
degrees(pi()) radians(360) degrees(pi()) radians(360)
180 6.2831853071796 180 6.28318530717959
select format(atan(-2, 2), 6); select format(atan(-2, 2), 6);
format(atan(-2, 2), 6) format(atan(-2, 2), 6)
-0.785398 -0.785398
@ -368,7 +368,7 @@ mod(5, cast(-2 as unsigned)) mod(5, 18446744073709551614) mod(5, -2)
5 5 1 5 5 1
select pow(cast(-2 as unsigned), 5), pow(18446744073709551614, 5), pow(-2, 5); select pow(cast(-2 as unsigned), 5), pow(18446744073709551614, 5), pow(-2, 5);
pow(cast(-2 as unsigned), 5) pow(18446744073709551614, 5) pow(-2, 5) pow(cast(-2 as unsigned), 5) pow(18446744073709551614, 5) pow(-2, 5)
2.1359870359209e+96 2.1359870359209e+96 -32 2.13598703592091e+96 2.13598703592091e+96 -32
CREATE TABLE t1 (a timestamp, b varchar(20), c bit(1)); CREATE TABLE t1 (a timestamp, b varchar(20), c bit(1));
INSERT INTO t1 VALUES('1998-09-23', 'str1', 1), ('2003-03-25', 'str2', 0); INSERT INTO t1 VALUES('1998-09-23', 'str1', 1), ('2003-03-25', 'str2', 0);
SELECT a DIV 900 y FROM t1 GROUP BY y; SELECT a DIV 900 y FROM t1 GROUP BY y;
@ -407,6 +407,36 @@ SELECT a DIV 2 FROM t1 UNION SELECT a DIV 2 FROM t1;
a DIV 2 a DIV 2
0 0
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (a DOUBLE);
INSERT INTO t1 VALUES (-1.1), (1.1),
(-1.5), (1.5),
(-1.9), (1.9),
(-2.1), (2.1),
(-2.5), (2.5),
(-2.9), (2.9),
# Check numbers with absolute values > 2^53 - 1
# (see comments for MAX_EXACT_INTEGER)
(-1e16 - 0.5), (1e16 + 0.5),
(-1e16 - 1.5), (1e16 + 1.5);
SELECT a, ROUND(a) FROM t1;
a ROUND(a)
-1.1 -1
1.1 1
-1.5 -2
1.5 2
-1.9 -2
1.9 2
-2.1 -2
2.1 2
-2.5 -2
2.5 2
-2.9 -3
2.9 3
-1e+16 -10000000000000000
1e+16 10000000000000000
-1e+16 -10000000000000002
1e+16 10000000000000002
DROP TABLE t1;
End of 5.0 tests End of 5.0 tests
SELECT 1e308 + 1e308; SELECT 1e308 + 1e308;
1e308 + 1e308 1e308 + 1e308

View File

@ -1351,10 +1351,10 @@ cast(rtrim(ltrim(' 20.06 ')) as decimal(19,2))
20.06 20.06
select conv("18383815659218730760",10,10) + 0; select conv("18383815659218730760",10,10) + 0;
conv("18383815659218730760",10,10) + 0 conv("18383815659218730760",10,10) + 0
1.8383815659219e+19 1.83838156592187e+19
select "18383815659218730760" + 0; select "18383815659218730760" + 0;
"18383815659218730760" + 0 "18383815659218730760" + 0
1.8383815659219e+19 1.83838156592187e+19
CREATE TABLE t1 (code varchar(10)); CREATE TABLE t1 (code varchar(10));
INSERT INTO t1 VALUES ('a12'), ('A12'), ('a13'); INSERT INTO t1 VALUES ('a12'), ('A12'), ('a13');
SELECT ASCII(code), code FROM t1 WHERE code='A12'; SELECT ASCII(code), code FROM t1 WHERE code='A12';
@ -2519,4 +2519,10 @@ def format(a, 2) 253 49 4 Y 0 31 8
format(a, 2) format(a, 2)
1.33 1.33
drop table t1; drop table t1;
CREATE TABLE t1 (c DATE, aa VARCHAR(30));
INSERT INTO t1 VALUES ('2008-12-31','aaaaaa');
SELECT DATE_FORMAT(c, GET_FORMAT(DATE, 'eur')) h, CONCAT(UPPER(aa),', ', aa) i FROM t1;
h i
31.12.2008 AAAAAA, aaaaaa
DROP TABLE t1;
End of 5.0 tests End of 5.0 tests

View File

@ -284,7 +284,7 @@ Note 1003 select astext(startpoint(`test`.`gis_line`.`g`)) AS `AsText(StartPoint
SELECT fid, AsText(Centroid(g)) FROM gis_polygon; SELECT fid, AsText(Centroid(g)) FROM gis_polygon;
fid AsText(Centroid(g)) fid AsText(Centroid(g))
108 POINT(15 15) 108 POINT(15 15)
109 POINT(25.416666666667 25.416666666667) 109 POINT(25.4166666666667 25.4166666666667)
110 POINT(20 10) 110 POINT(20 10)
SELECT fid, Area(g) FROM gis_polygon; SELECT fid, Area(g) FROM gis_polygon;
fid Area(g) fid Area(g)
@ -318,8 +318,8 @@ fid IsClosed(g)
116 0 116 0
SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon; SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon;
fid AsText(Centroid(g)) fid AsText(Centroid(g))
117 POINT(55.588527753042 17.426536064114) 117 POINT(55.5885277530424 17.426536064114)
118 POINT(55.588527753042 17.426536064114) 118 POINT(55.5885277530424 17.426536064114)
119 POINT(2 2) 119 POINT(2 2)
SELECT fid, Area(g) FROM gis_multi_polygon; SELECT fid, Area(g) FROM gis_multi_polygon;
fid Area(g) fid Area(g)
@ -651,11 +651,11 @@ insert into t1 values ('85984',GeomFromText('MULTIPOLYGON(((-115.006363
select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from
t1 where object_id=85998; t1 where object_id=85998;
object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo)) object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo))
85998 MULTIPOLYGON 0 POINT(115.31877315203 -36.237472821022) 85998 MULTIPOLYGON 0 POINT(115.318773152032 -36.2374728210215)
select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from
t1 where object_id=85984; t1 where object_id=85984;
object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo)) object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo))
85984 MULTIPOLYGON 0 POINT(-114.87787186923 36.33101763469) 85984 MULTIPOLYGON 0 POINT(-114.877871869233 36.3310176346905)
drop table t1; drop table t1;
create table t1 (fl geometry not null); create table t1 (fl geometry not null);
insert into t1 values (1); insert into t1 values (1);

View File

@ -264,7 +264,7 @@ drop user mysqltest_1@localhost;
SET NAMES koi8r; SET NAMES koi8r;
CREATE DATABASE <20><>; CREATE DATABASE <20><>;
USE <20><>; USE <20><>;
CREATE TABLE <20><><EFBFBD> (<28><><EFBFBD> int); CREATE TABLE <20><><EFBFBD> (<28><><EFBFBD> INT);
GRANT SELECT ON <20><>.* TO <20><><EFBFBD><EFBFBD>@localhost; GRANT SELECT ON <20><>.* TO <20><><EFBFBD><EFBFBD>@localhost;
SHOW GRANTS FOR <20><><EFBFBD><EFBFBD>@localhost; SHOW GRANTS FOR <20><><EFBFBD><EFBFBD>@localhost;
Grants for <20><><EFBFBD><EFBFBD>@localhost Grants for <20><><EFBFBD><EFBFBD>@localhost
@ -459,7 +459,7 @@ Privilege Context Comment
Alter Tables To alter the table Alter Tables To alter the table
Alter routine Functions,Procedures To alter or drop stored functions/procedures Alter routine Functions,Procedures To alter or drop stored functions/procedures
Create Databases,Tables,Indexes To create new databases and tables Create Databases,Tables,Indexes To create new databases and tables
Create routine Functions,Procedures To use CREATE FUNCTION/PROCEDURE Create routine Databases To use CREATE FUNCTION/PROCEDURE
Create temporary tables Databases To use CREATE TEMPORARY TABLE Create temporary tables Databases To use CREATE TEMPORARY TABLE
Create view Tables To create new views Create view Tables To create new views
Create user Server Admin To create new users Create user Server Admin To create new users
@ -884,11 +884,11 @@ flush privileges;
drop table t2; drop table t2;
drop table t1; drop table t1;
CREATE DATABASE mysqltest3; CREATE DATABASE mysqltest3;
use mysqltest3; USE mysqltest3;
CREATE TABLE t_nn (c1 INT); CREATE TABLE t_nn (c1 INT);
CREATE VIEW v_nn AS SELECT * FROM t_nn; CREATE VIEW v_nn AS SELECT * FROM t_nn;
CREATE DATABASE mysqltest2; CREATE DATABASE mysqltest2;
use mysqltest2; USE mysqltest2;
CREATE TABLE t_nn (c1 INT); CREATE TABLE t_nn (c1 INT);
CREATE VIEW v_nn AS SELECT * FROM t_nn; CREATE VIEW v_nn AS SELECT * FROM t_nn;
CREATE VIEW v_yn AS SELECT * FROM t_nn; CREATE VIEW v_yn AS SELECT * FROM t_nn;
@ -958,7 +958,7 @@ DROP TABLE mysqltest3.t_nn;
DROP DATABASE mysqltest3; DROP DATABASE mysqltest3;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'mysqltest_1'@'localhost'; REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'mysqltest_1'@'localhost';
DROP USER 'mysqltest_1'@'localhost'; DROP USER 'mysqltest_1'@'localhost';
use test; USE test;
create user mysqltest1_thisisreallytoolong; create user mysqltest1_thisisreallytoolong;
ERROR HY000: String 'mysqltest1_thisisreallytoolong' is too long for user name (should be no longer than 16) ERROR HY000: String 'mysqltest1_thisisreallytoolong' is too long for user name (should be no longer than 16)
CREATE DATABASE mysqltest1; CREATE DATABASE mysqltest1;
@ -1196,16 +1196,16 @@ DROP DATABASE mysqltest1;
DROP DATABASE mysqltest2; DROP DATABASE mysqltest2;
DROP USER mysqltest_1@localhost; DROP USER mysqltest_1@localhost;
DROP USER mysqltest_2@localhost; DROP USER mysqltest_2@localhost;
use test; USE test;
CREATE TABLE t1 (f1 int, f2 int); CREATE TABLE t1 (f1 int, f2 int);
INSERT INTO t1 VALUES(1,1), (2,2); INSERT INTO t1 VALUES(1,1), (2,2);
CREATE DATABASE db27878; CREATE DATABASE db27878;
GRANT UPDATE(f1) ON t1 TO 'mysqltest_1'@'localhost'; GRANT UPDATE(f1) ON t1 TO 'mysqltest_1'@'localhost';
GRANT SELECT ON `test`.* TO 'mysqltest_1'@'localhost'; GRANT SELECT ON `test`.* TO 'mysqltest_1'@'localhost';
GRANT ALL ON db27878.* TO 'mysqltest_1'@'localhost'; GRANT ALL ON db27878.* TO 'mysqltest_1'@'localhost';
use db27878; USE db27878;
CREATE SQL SECURITY INVOKER VIEW db27878.v1 AS SELECT * FROM test.t1; CREATE SQL SECURITY INVOKER VIEW db27878.v1 AS SELECT * FROM test.t1;
use db27878; USE db27878;
UPDATE v1 SET f2 = 4; UPDATE v1 SET f2 = 4;
ERROR HY000: View 'db27878.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them ERROR HY000: View 'db27878.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
SELECT * FROM test.t1; SELECT * FROM test.t1;
@ -1217,7 +1217,7 @@ REVOKE SELECT ON `test`.* FROM 'mysqltest_1'@'localhost';
REVOKE ALL ON db27878.* FROM 'mysqltest_1'@'localhost'; REVOKE ALL ON db27878.* FROM 'mysqltest_1'@'localhost';
DROP USER mysqltest_1@localhost; DROP USER mysqltest_1@localhost;
DROP DATABASE db27878; DROP DATABASE db27878;
use test; USE test;
DROP TABLE t1; DROP TABLE t1;
# #
# Bug#33275 Server crash when creating temporary table mysql.user # Bug#33275 Server crash when creating temporary table mysql.user
@ -1355,6 +1355,6 @@ Warnings:
Warning 1403 There is no such grant defined for user 'userbug33464' on host 'localhost' on routine 'fn2' Warning 1403 There is no such grant defined for user 'userbug33464' on host 'localhost' on routine 'fn2'
DROP PROCEDURE sp3; DROP PROCEDURE sp3;
DROP USER 'userbug33464'@'localhost'; DROP USER 'userbug33464'@'localhost';
use test; USE test;
DROP DATABASE dbbug33464; DROP DATABASE dbbug33464;
SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators; SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;

View File

@ -1691,3 +1691,15 @@ FROM t1;
ERROR 21000: Subquery returns more than 1 row ERROR 21000: Subquery returns more than 1 row
DROP TABLE t1; DROP TABLE t1;
SET @@sql_mode = @old_sql_mode; SET @@sql_mode = @old_sql_mode;
SET @old_sql_mode = @@sql_mode;
SET @@sql_mode='ONLY_FULL_GROUP_BY';
CREATE TABLE t1(i INT);
INSERT INTO t1 VALUES (1), (10);
SELECT COUNT(i) FROM t1;
COUNT(i)
2
SELECT COUNT(i) FROM t1 WHERE i > 1;
COUNT(i)
1
DROP TABLE t1;
SET @@sql_mode = @old_sql_mode;

View File

@ -2448,3 +2448,18 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings: Warnings:
Note 1003 select sql_buffer_result `test`.`t1`.`a` AS `a`,(max(`test`.`t1`.`b`) + 1) AS `max(b)+1` from `test`.`t1` where (`test`.`t1`.`a` = 0) group by `test`.`t1`.`a` Note 1003 select sql_buffer_result `test`.`t1`.`a` AS `a`,(max(`test`.`t1`.`b`) + 1) AS `max(b)+1` from `test`.`t1` where (`test`.`t1`.`a` = 0) group by `test`.`t1`.`a`
drop table t1; drop table t1;
CREATE TABLE t1 (a int, b int, c int, d int,
KEY foo (c,d,a,b), KEY bar (c,a,b,d));
INSERT INTO t1 VALUES (1, 1, 1, 1), (1, 1, 1, 2), (1, 1, 1, 3), (1, 1, 1, 4);
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT a,b,c+1,d FROM t1;
EXPLAIN SELECT DISTINCT c FROM t1 WHERE d=4;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range NULL foo 10 NULL 9 Using where; Using index for group-by
SELECT DISTINCT c FROM t1 WHERE d=4;
c
1
2
DROP TABLE t1;
End of 5.0 tests

View File

@ -730,3 +730,12 @@ unlock tables;
drop table t1; drop table t1;
handler t1 read a next; handler t1 read a next;
ERROR 42S02: Unknown table 't1' in HANDLER ERROR 42S02: Unknown table 't1' in HANDLER
drop table if exists t1;
create table t1 (a int);
insert into t1 values (1);
handler t1 open;
alter table t1 engine=memory;
handler t1 read a next;
ERROR HY000: Table storage engine for 't1' doesn't have this option
handler t1 close;
drop table t1;

View File

@ -728,3 +728,12 @@ unlock tables;
drop table t1; drop table t1;
handler t1 read a next; handler t1 read a next;
ERROR 42S02: Unknown table 't1' in HANDLER ERROR 42S02: Unknown table 't1' in HANDLER
drop table if exists t1;
create table t1 (a int);
insert into t1 values (1);
handler t1 open;
alter table t1 engine=memory;
handler t1 read a next;
ERROR HY000: Table storage engine for 't1' doesn't have this option
handler t1 close;
drop table t1;

View File

@ -1634,7 +1634,7 @@ show events where Db= 'information_schema';
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
use test; use test;
# #
# Bug#34166: Server crash in SHOW OPEN TABLES and prelocking # Bug#34166 Server crash in SHOW OPEN TABLES and prelocking
# #
drop table if exists t1; drop table if exists t1;
drop function if exists f1; drop function if exists f1;

View File

@ -200,7 +200,7 @@ Field Type Null Key Default Extra
f1 char(4) YES NULL f1 char(4) YES NULL
show create view v2; show create view v2;
View Create View character_set_client collation_connection View Create View character_set_client collation_connection
v2 CREATE ALGORITHM=UNDEFINED DEFINER=`testdb_2`@`localhost` SQL SECURITY DEFINER VIEW `test`.`v2` AS select `v1`.`f1` AS `f1` from `testdb_1`.`v1` latin1 latin1_swedish_ci v2 CREATE ALGORITHM=UNDEFINED DEFINER=`testdb_2`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `v1`.`f1` AS `f1` from `testdb_1`.`v1` latin1 latin1_swedish_ci
show create view testdb_1.v1; show create view testdb_1.v1;
ERROR 42000: SHOW VIEW command denied to user 'testdb_2'@'localhost' for table 'v1' ERROR 42000: SHOW VIEW command denied to user 'testdb_2'@'localhost' for table 'v1'
select table_name from information_schema.columns a select table_name from information_schema.columns a

View File

@ -579,3 +579,291 @@ c1
18446744073709551610 18446744073709551610
18446744073709551615 18446744073709551615
DROP TABLE t1; DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
SET @@INSERT_ID=1;
SHOW VARIABLES LIKE "%auto_inc%";
Variable_name Value
auto_increment_increment 1
auto_increment_offset 1
CREATE TABLE t1 (c1 DOUBLE NOT NULL AUTO_INCREMENT, c2 INT, PRIMARY KEY (c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES(NULL, 1);
INSERT INTO t1 VALUES(NULL, 2);
SELECT * FROM t1;
c1 c2
1 1
2 2
ALTER TABLE t1 CHANGE c1 c1 SERIAL;
SELECT * FROM t1;
c1 c2
1 1
2 2
INSERT INTO t1 VALUES(NULL, 3);
INSERT INTO t1 VALUES(NULL, 4);
SELECT * FROM t1;
c1 c2
1 1
2 2
3 3
4 4
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 FLOAT NOT NULL AUTO_INCREMENT, c2 INT, PRIMARY KEY (c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES(NULL, 1);
INSERT INTO t1 VALUES(NULL, 2);
SELECT * FROM t1;
c1 c2
1 1
2 2
ALTER TABLE t1 CHANGE c1 c1 SERIAL;
SELECT * FROM t1;
c1 c2
1 1
2 2
INSERT INTO t1 VALUES(NULL, 3);
INSERT INTO t1 VALUES(NULL, 4);
SELECT * FROM t1;
c1 c2
1 1
2 2
3 3
4 4
DROP TABLE t1;
SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=5;
DROP TABLE IF EXISTS t1;
Warnings:
Note 1051 Unknown table 't1'
DROP TABLE IF EXISTS t2;
Warnings:
Note 1051 Unknown table 't2'
CREATE TABLE t1 (
a INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
b INT(10) UNSIGNED NOT NULL,
c ENUM('FALSE','TRUE') DEFAULT NULL,
PRIMARY KEY (a)) ENGINE = InnoDB;
CREATE TABLE t2 (
m INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
n INT(10) UNSIGNED NOT NULL,
o enum('FALSE','TRUE') DEFAULT NULL,
PRIMARY KEY (m)) ENGINE = InnoDB;
INSERT INTO t2 (n,o) VALUES
(1 , 'true'), (1 , 'false'), (2 , 'true'), (2 , 'false'), (3 , 'true'),
(3 , 'false'), (4 , 'true'), (4 , 'false'), (5 , 'true'), (5 , 'false');
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`m` int(11) unsigned NOT NULL AUTO_INCREMENT,
`n` int(10) unsigned NOT NULL,
`o` enum('FALSE','TRUE') DEFAULT NULL,
PRIMARY KEY (`m`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1
INSERT INTO t1 (b,c) SELECT n,o FROM t2 ;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) unsigned NOT NULL AUTO_INCREMENT,
`b` int(10) unsigned NOT NULL,
`c` enum('FALSE','TRUE') DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1
INSERT INTO t1 (b,c) SELECT n,o FROM t2 ;
SELECT * FROM t1;
a b c
1 1 TRUE
2 1 FALSE
3 2 TRUE
4 2 FALSE
5 3 TRUE
6 3 FALSE
7 4 TRUE
8 4 FALSE
9 5 TRUE
10 5 FALSE
13 1 TRUE
14 1 FALSE
15 2 TRUE
16 2 FALSE
17 3 TRUE
18 3 FALSE
19 4 TRUE
20 4 FALSE
21 5 TRUE
22 5 FALSE
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) unsigned NOT NULL AUTO_INCREMENT,
`b` int(10) unsigned NOT NULL,
`c` enum('FALSE','TRUE') DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=latin1
INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false';
SELECT * FROM t1;
a b c
1 1 TRUE
2 1 FALSE
3 2 TRUE
4 2 FALSE
5 3 TRUE
6 3 FALSE
7 4 TRUE
8 4 FALSE
9 5 TRUE
10 5 FALSE
13 1 TRUE
14 1 FALSE
15 2 TRUE
16 2 FALSE
17 3 TRUE
18 3 FALSE
19 4 TRUE
20 4 FALSE
21 5 TRUE
22 5 FALSE
23 1 FALSE
24 2 FALSE
25 3 FALSE
26 4 FALSE
27 5 FALSE
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) unsigned NOT NULL AUTO_INCREMENT,
`b` int(10) unsigned NOT NULL,
`c` enum('FALSE','TRUE') DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=latin1
INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false';
SELECT * FROM t1;
a b c
1 1 TRUE
2 1 FALSE
3 2 TRUE
4 2 FALSE
5 3 TRUE
6 3 FALSE
7 4 TRUE
8 4 FALSE
9 5 TRUE
10 5 FALSE
13 1 TRUE
14 1 FALSE
15 2 TRUE
16 2 FALSE
17 3 TRUE
18 3 FALSE
19 4 TRUE
20 4 FALSE
21 5 TRUE
22 5 FALSE
23 1 FALSE
24 2 FALSE
25 3 FALSE
26 4 FALSE
27 5 FALSE
30 1 FALSE
31 2 FALSE
32 3 FALSE
33 4 FALSE
34 5 FALSE
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) unsigned NOT NULL AUTO_INCREMENT,
`b` int(10) unsigned NOT NULL,
`c` enum('FALSE','TRUE') DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=latin1
INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false';
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) unsigned NOT NULL AUTO_INCREMENT,
`b` int(10) unsigned NOT NULL,
`c` enum('FALSE','TRUE') DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=latin1
INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false';
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) unsigned NOT NULL AUTO_INCREMENT,
`b` int(10) unsigned NOT NULL,
`c` enum('FALSE','TRUE') DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=latin1
INSERT INTO t1 (b,c) SELECT n,o FROM t2 WHERE o = 'false';
SELECT * FROM t1;
a b c
1 1 TRUE
2 1 FALSE
3 2 TRUE
4 2 FALSE
5 3 TRUE
6 3 FALSE
7 4 TRUE
8 4 FALSE
9 5 TRUE
10 5 FALSE
13 1 TRUE
14 1 FALSE
15 2 TRUE
16 2 FALSE
17 3 TRUE
18 3 FALSE
19 4 TRUE
20 4 FALSE
21 5 TRUE
22 5 FALSE
23 1 FALSE
24 2 FALSE
25 3 FALSE
26 4 FALSE
27 5 FALSE
30 1 FALSE
31 2 FALSE
32 3 FALSE
33 4 FALSE
34 5 FALSE
37 1 FALSE
38 2 FALSE
39 3 FALSE
40 4 FALSE
41 5 FALSE
44 1 FALSE
45 2 FALSE
46 3 FALSE
47 4 FALSE
48 5 FALSE
51 1 FALSE
52 2 FALSE
53 3 FALSE
54 4 FALSE
55 5 FALSE
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) unsigned NOT NULL AUTO_INCREMENT,
`b` int(10) unsigned NOT NULL,
`c` enum('FALSE','TRUE') DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB AUTO_INCREMENT=58 DEFAULT CHARSET=latin1
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE IF EXISTS t1;
Warnings:
Note 1051 Unknown table 't1'
DROP TABLE IF EXISTS t2;
Warnings:
Note 1051 Unknown table 't2'
CREATE TABLE t1(
c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT
PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL);
CREATE TABLE t2(
c1 TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT
PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t2 SELECT c1 FROM t1;
Got one of the listed errors
INSERT INTO t2 SELECT NULL FROM t1;
Got one of the listed errors
DROP TABLE t1;
DROP TABLE t2;

View File

@ -0,0 +1,17 @@
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b INT) ENGINE = InnoDB;
INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
COMMIT;
SET AUTOCOMMIT = 0;
CREATE TEMPORARY TABLE t1_tmp ( b INT );
INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 3;
INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 2;
SET AUTOCOMMIT = 0;
CREATE TEMPORARY TABLE t2_tmp ( a int, new_a int );
INSERT INTO t2_tmp VALUES (1,51),(2,52),(3,53);
UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 1;
UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 2;
INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
Reap the server message for connection user2 UPDATE t1 ...
UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 3;
DROP TABLE t1;

View File

@ -292,7 +292,7 @@ Note 1003 select astext(startpoint(`test`.`gis_line`.`g`)) AS `AsText(StartPoint
SELECT fid, AsText(Centroid(g)) FROM gis_polygon ORDER by fid; SELECT fid, AsText(Centroid(g)) FROM gis_polygon ORDER by fid;
fid AsText(Centroid(g)) fid AsText(Centroid(g))
108 POINT(15 15) 108 POINT(15 15)
109 POINT(25.416666666667 25.416666666667) 109 POINT(25.4166666666667 25.4166666666667)
110 POINT(20 10) 110 POINT(20 10)
SELECT fid, Area(g) FROM gis_polygon ORDER by fid; SELECT fid, Area(g) FROM gis_polygon ORDER by fid;
fid Area(g) fid Area(g)
@ -326,8 +326,8 @@ fid IsClosed(g)
116 0 116 0
SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid; SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid;
fid AsText(Centroid(g)) fid AsText(Centroid(g))
117 POINT(55.588527753042 17.426536064114) 117 POINT(55.5885277530424 17.426536064114)
118 POINT(55.588527753042 17.426536064114) 118 POINT(55.5885277530424 17.426536064114)
119 POINT(2 2) 119 POINT(2 2)
SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid; SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid;
fid Area(g) fid Area(g)

View File

@ -166,4 +166,31 @@ ERROR HY000: View's SELECT refers to a temporary table 't2'
Cleanup. Cleanup.
drop table t2, t3; drop table t2, t3;
#
# Bug#39843 DELETE requires write access to table in subquery in where clause
#
DROP TABLE IF EXISTS t1,t2;
CREATE TABLE t1 (
table1_rowid SMALLINT NOT NULL
);
CREATE TABLE t2 (
table2_rowid SMALLINT NOT NULL
);
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
LOCK TABLES t1 WRITE, t2 READ;
# Sub-select should not try to aquire a write lock.
DELETE FROM t1
WHERE EXISTS
(
SELECT 'x'
FROM t2
WHERE t1.table1_rowid = t2.table2_rowid
) ;
# While implementing the patch we didn't break old behavior;
# The following sub-select should still requires a write lock:
SELECT * FROM t1 WHERE 1 IN (SELECT * FROM t2 FOR UPDATE);
ERROR HY000: Table 't2' was locked with a READ lock and can't be updated
UNLOCK TABLES;
DROP TABLE t1,t2;
End of 5.1 tests. End of 5.1 tests.

View File

@ -51,10 +51,10 @@ Field Type Null Key Default Extra
a int(11) YES NULL a int(11) YES NULL
unlock tables; unlock tables;
drop table t1; drop table t1;
use mysql; USE mysql;
LOCK TABLES columns_priv WRITE, db WRITE, host WRITE, user WRITE; LOCK TABLES columns_priv WRITE, db WRITE, host WRITE, user WRITE;
FLUSH TABLES; FLUSH TABLES;
use mysql; USE mysql;
SELECT user.Select_priv FROM user, db WHERE user.user = db.user LIMIT 1; SELECT user.Select_priv FROM user, db WHERE user.user = db.user LIMIT 1;
OPTIMIZE TABLES columns_priv, db, host, user; OPTIMIZE TABLES columns_priv, db, host, user;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
@ -65,7 +65,7 @@ mysql.user optimize status OK
UNLOCK TABLES; UNLOCK TABLES;
Select_priv Select_priv
N N
use test; USE test;
use test; use test;
CREATE TABLE t1 (c1 int); CREATE TABLE t1 (c1 int);
LOCK TABLE t1 WRITE; LOCK TABLE t1 WRITE;
@ -133,8 +133,8 @@ DROP TABLE t1;
End of 5.0 tests End of 5.0 tests
create table t1 (i int); create table t1 (i int);
lock table t1 read; lock table t1 read;
update t1 set i= 10;; update t1 set i= 10;
select * from t1;; select * from t1;
kill query ID; kill query ID;
i i
ERROR 70100: Query execution was interrupted ERROR 70100: Query execution was interrupted

View File

@ -56,7 +56,7 @@ general_log CREATE TABLE `general_log` (
`event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`user_host` mediumtext NOT NULL, `user_host` mediumtext NOT NULL,
`thread_id` int(11) NOT NULL, `thread_id` int(11) NOT NULL,
`server_id` int(11) NOT NULL, `server_id` int(10) unsigned NOT NULL,
`command_type` varchar(64) NOT NULL, `command_type` varchar(64) NOT NULL,
`argument` mediumtext NOT NULL `argument` mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log' ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log'
@ -65,7 +65,7 @@ Field Type Null Key Default Extra
event_time timestamp NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP event_time timestamp NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP
user_host mediumtext NO NULL user_host mediumtext NO NULL
thread_id int(11) NO NULL thread_id int(11) NO NULL
server_id int(11) NO NULL server_id int(10) unsigned NO NULL
command_type varchar(64) NO NULL command_type varchar(64) NO NULL
argument mediumtext NO NULL argument mediumtext NO NULL
show create table mysql.slow_log; show create table mysql.slow_log;
@ -80,7 +80,7 @@ slow_log CREATE TABLE `slow_log` (
`db` varchar(512) NOT NULL, `db` varchar(512) NOT NULL,
`last_insert_id` int(11) NOT NULL, `last_insert_id` int(11) NOT NULL,
`insert_id` int(11) NOT NULL, `insert_id` int(11) NOT NULL,
`server_id` int(11) NOT NULL, `server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL `sql_text` mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log' ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'
show fields from mysql.slow_log; show fields from mysql.slow_log;
@ -94,7 +94,7 @@ rows_examined int(11) NO NULL
db varchar(512) NO NULL db varchar(512) NO NULL
last_insert_id int(11) NO NULL last_insert_id int(11) NO NULL
insert_id int(11) NO NULL insert_id int(11) NO NULL
server_id int(11) NO NULL server_id int(10) unsigned NO NULL
sql_text mediumtext NO NULL sql_text mediumtext NO NULL
flush logs; flush logs;
flush tables; flush tables;
@ -167,7 +167,7 @@ general_log CREATE TABLE `general_log` (
`event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`user_host` mediumtext NOT NULL, `user_host` mediumtext NOT NULL,
`thread_id` int(11) NOT NULL, `thread_id` int(11) NOT NULL,
`server_id` int(11) NOT NULL, `server_id` int(10) unsigned NOT NULL,
`command_type` varchar(64) NOT NULL, `command_type` varchar(64) NOT NULL,
`argument` mediumtext NOT NULL `argument` mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log' ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log'
@ -183,7 +183,7 @@ slow_log CREATE TABLE `slow_log` (
`db` varchar(512) NOT NULL, `db` varchar(512) NOT NULL,
`last_insert_id` int(11) NOT NULL, `last_insert_id` int(11) NOT NULL,
`insert_id` int(11) NOT NULL, `insert_id` int(11) NOT NULL,
`server_id` int(11) NOT NULL, `server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL `sql_text` mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log' ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'
alter table mysql.general_log engine=myisam; alter table mysql.general_log engine=myisam;
@ -194,7 +194,7 @@ general_log CREATE TABLE `general_log` (
`event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`user_host` mediumtext NOT NULL, `user_host` mediumtext NOT NULL,
`thread_id` int(11) NOT NULL, `thread_id` int(11) NOT NULL,
`server_id` int(11) NOT NULL, `server_id` int(10) unsigned NOT NULL,
`command_type` varchar(64) NOT NULL, `command_type` varchar(64) NOT NULL,
`argument` mediumtext NOT NULL `argument` mediumtext NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='General log' ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='General log'
@ -210,7 +210,7 @@ slow_log CREATE TABLE `slow_log` (
`db` varchar(512) NOT NULL, `db` varchar(512) NOT NULL,
`last_insert_id` int(11) NOT NULL, `last_insert_id` int(11) NOT NULL,
`insert_id` int(11) NOT NULL, `insert_id` int(11) NOT NULL,
`server_id` int(11) NOT NULL, `server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL `sql_text` mediumtext NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Slow log' ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Slow log'
set global general_log='ON'; set global general_log='ON';
@ -268,7 +268,7 @@ CREATE TABLE `general_log` (
ON UPDATE CURRENT_TIMESTAMP, ON UPDATE CURRENT_TIMESTAMP,
`user_host` mediumtext NOT NULL, `user_host` mediumtext NOT NULL,
`thread_id` int(11) NOT NULL, `thread_id` int(11) NOT NULL,
`server_id` int(11) NOT NULL, `server_id` int(10) unsigned NOT NULL,
`command_type` varchar(64) NOT NULL, `command_type` varchar(64) NOT NULL,
`argument` mediumtext NOT NULL `argument` mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log'; ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log';
@ -283,7 +283,7 @@ ON UPDATE CURRENT_TIMESTAMP,
`db` varchar(512) NOT NULL, `db` varchar(512) NOT NULL,
`last_insert_id` int(11) NOT NULL, `last_insert_id` int(11) NOT NULL,
`insert_id` int(11) NOT NULL, `insert_id` int(11) NOT NULL,
`server_id` int(11) NOT NULL, `server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL `sql_text` mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'; ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log';
set global general_log='ON'; set global general_log='ON';

View File

@ -1,11 +1,11 @@
call mtr.add_suppression("Cannot find or open table test/BUG29839 from"); call mtr.add_suppression("Cannot find or open table test/BUG29839 from .*");
DROP TABLE IF EXISTS t1,T1; DROP TABLE IF EXISTS t1,T1;
CREATE TABLE t1 (a int); CREATE TABLE t1 (a INT);
SELECT * from T1; SELECT * FROM T1;
a a
drop table t1; FLUSH TABLES;
flush tables; DROP TABLE t1;
CREATE TABLE bug29839 (a int) ENGINE=INNODB; CREATE TABLE bug29839 (a INT) ENGINE=INNODB;
SELECT * from BUG29839; SELECT * FROM BUG29839;
ERROR 42S02: Table 'test.BUG29839' doesn't exist ERROR 42S02: Table 'test.BUG29839' doesn't exist
drop table bug29839; DROP TABLE bug29839;

View File

@ -0,0 +1,9 @@
set names utf8;
create table `Ö` (id int);
show tables from test like 'Ö';
Tables_in_test (Ö)
ö
show tables from test like 'ö';
Tables_in_test (ö)
ö
drop table `Ö`;

View File

@ -2027,7 +2027,6 @@ TABLE_SCHEMA = 'test' and TABLE_NAME='tm1';
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
NULL test tm1 BASE TABLE NULL NULL NULL # # # # # # # # # # NULL # # Unable to open underlying table which is differently defined or of non-MyISAM ty NULL test tm1 BASE TABLE NULL NULL NULL # # # # # # # # # # NULL # # Unable to open underlying table which is differently defined or of non-MyISAM ty
DROP TABLE tm1; DROP TABLE tm1;
End of 5.1 tests
CREATE TABLE t1(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2)) ENGINE=MYISAM; CREATE TABLE t1(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2)) ENGINE=MYISAM;
CREATE TABLE t2(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2)) ENGINE=MYISAM; CREATE TABLE t2(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2)) ENGINE=MYISAM;
CREATE TABLE t3(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2)) ENGINE=MYISAM; CREATE TABLE t3(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2)) ENGINE=MYISAM;
@ -2043,4 +2042,79 @@ EXPLAIN SELECT COUNT(*) FROM t4;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
DROP TABLE t1, t2, t3, t4; DROP TABLE t1, t2, t3, t4;
CREATE TABLE t1(a INT, KEY(a));
INSERT INTO t1 VALUES(0),(1),(2),(3),(4);
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
CREATE TABLE m1(a INT, KEY(a)) ENGINE=MERGE UNION=(t1);
SELECT CARDINALITY FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_SCHEMA='test' AND TABLE_NAME='m1';
CARDINALITY
5
SELECT CARDINALITY FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_SCHEMA='test' AND TABLE_NAME='m1';
CARDINALITY
5
SELECT CARDINALITY FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_SCHEMA='test' AND TABLE_NAME='m1';
CARDINALITY
5
SELECT CARDINALITY FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_SCHEMA='test' AND TABLE_NAME='m1';
CARDINALITY
5
DROP TABLE t1, m1;
#
# Bug #40675 MySQL 5.1 crash with index merge algorithm and Merge tables
#
# create MYISAM table t1 and insert values into it
CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES(1);
# create MYISAM table t2 and insert values into it
CREATE TABLE t2(a INT, b INT, dummy CHAR(16) DEFAULT '', KEY(a), KEY(b));
INSERT INTO t2(a,b) VALUES
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(1,2);
# Create the merge table t3
CREATE TABLE t3(a INT, b INT, dummy CHAR(16) DEFAULT '', KEY(a), KEY(b))
ENGINE=MERGE UNION=(t2) INSERT_METHOD=FIRST;
# Lock tables t1 and t3 for write
LOCK TABLES t1 WRITE, t3 WRITE;
# Insert values into the merge table t3
INSERT INTO t3(a,b) VALUES(1,2);
# select from the join of t2 and t3 (The merge table)
SELECT t3.a FROM t1,t3 WHERE t3.b=2 AND t3.a=1;
a
1
1
# Unlock the tables
UNLOCK TABLES;
# drop the created tables
DROP TABLE t1, t2, t3;
# insert duplicate value in child table while merge table doesn't have key
create table t1 (
col1 int(10),
primary key (col1)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE m1 (
col1 int(10) NOT NULL
) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(t1);
insert into m1 (col1) values (1);
insert into m1 (col1) values (1);
ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
drop table m1, t1;
End of 5.1 tests End of 5.1 tests

View File

@ -188,6 +188,10 @@ delimiter
2 2
@z:='1' @z=database() @z:='1' @z=database()
1 NULL 1 NULL
1
1
1
1
End of 5.0 tests End of 5.0 tests
WARNING: --server-arg option not supported in this configuration. WARNING: --server-arg option not supported in this configuration.
Warning (Code 1286): Unknown table engine 'nonexistent' Warning (Code 1286): Unknown table engine 'nonexistent'

View File

@ -391,22 +391,28 @@ DELIMITER ;
ROLLBACK /* added by mysqlbinlog */; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
CREATE TABLE t1 (c1 CHAR(10)); CREATE TABLE t1 (c1 CHAR(10));
flush logs; FLUSH LOGS;
INSERT INTO t1 VALUES ('0123456789'); INSERT INTO t1 VALUES ('0123456789');
flush logs; FLUSH LOGS;
DROP TABLE t1; DROP TABLE t1;
# Query thread_id=REMOVED exec_time=REMOVED error_code=REMOVED We expect this value to be 1
flush logs; The bug being tested was that 'Query' lines were not preceded by '#'
create table t1(a int); If the line is in the table, it had to have been preceded by a '#'
insert into t1 values(connection_id());
flush logs; SELECT COUNT(*) AS `BUG#28293_expect_1` FROM patch WHERE a LIKE '%Query%';
drop table t1; BUG#28293_expect_1
1 1
drop table t1; DROP TABLE patch;
FLUSH LOGS;
CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES(connection_id());
FLUSH LOGS;
DROP TABLE t1;
1
DROP TABLE t1;
shell> mysqlbinlog std_data/corrupt-relay-bin.000624 > var/tmp/bug31793.sql shell> mysqlbinlog std_data/corrupt-relay-bin.000624 > var/tmp/bug31793.sql
End of 5.0 tests FLUSH LOGS;
flush logs; Bug#31611 Security risk with BINLOG statement
BUG#31611: Security risk with BINLOG statement
SET BINLOG_FORMAT=ROW; SET BINLOG_FORMAT=ROW;
CREATE DATABASE mysqltest1; CREATE DATABASE mysqltest1;
CREATE USER untrusted@localhost; CREATE USER untrusted@localhost;
@ -429,7 +435,7 @@ a b
1 root@localhost 1 root@localhost
DROP DATABASE mysqltest1; DROP DATABASE mysqltest1;
DROP USER untrusted@localhost; DROP USER untrusted@localhost;
BUG#32580: mysqlbinlog cannot read binlog event with user variables Bug#32580 mysqlbinlog cannot read binlog event with user variables
USE test; USE test;
SET BINLOG_FORMAT = STATEMENT; SET BINLOG_FORMAT = STATEMENT;
FLUSH LOGS; FLUSH LOGS;
@ -454,4 +460,15 @@ an_int 1000
a_decimal 907.79 a_decimal 907.79
a_string Just a test a_string Just a test
DROP TABLE t1; DROP TABLE t1;
SET @@global.server_id= 4294967295;
RESET MASTER;
FLUSH LOGS;
SELECT
(@a:=LOAD_FILE("MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug37313.binlog"))
IS NOT NULL;
(@a:=LOAD_FILE("MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug37313.binlog"))
IS NOT NULL
1
*** Unsigned server_id 4294967295 is found: 1 ***
SET @@global.server_id= 1;
End of 5.1 tests End of 5.1 tests

View File

@ -149,7 +149,7 @@ SET NAMES DEFAULT;
mysqlcheck --default-character-set="latin1" --databases test mysqlcheck --default-character-set="latin1" --databases test
test.? test.?
Error : Table doesn't exist Error : Table doesn't exist
error : Corrupt status : Operation failed
mysqlcheck --default-character-set="utf8" --databases test mysqlcheck --default-character-set="utf8" --databases test
test.я OK test.я OK
SET NAMES utf8; SET NAMES utf8;

View File

@ -93,73 +93,73 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
USE `test`; USE `test`;
DROP TABLE IF EXISTS `t1`; DROP TABLE IF EXISTS `t1`;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t1` ( CREATE TABLE `t1` (
`id` int(8) DEFAULT NULL, `id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL `name` varchar(32) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1; ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */; /*!40000 ALTER TABLE `t1` DISABLE KEYS */;
INSERT DELAYED IGNORE INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); INSERT DELAYED IGNORE INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t1` ENABLE KEYS */; /*!40000 ALTER TABLE `t1` ENABLE KEYS */;
DROP TABLE IF EXISTS `t2`; DROP TABLE IF EXISTS `t2`;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t2` ( CREATE TABLE `t2` (
`id` int(8) DEFAULT NULL, `id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL `name` varchar(32) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1; ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t2` DISABLE KEYS */; /*!40000 ALTER TABLE `t2` DISABLE KEYS */;
INSERT DELAYED IGNORE INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); INSERT DELAYED IGNORE INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t2` ENABLE KEYS */; /*!40000 ALTER TABLE `t2` ENABLE KEYS */;
DROP TABLE IF EXISTS `t3`; DROP TABLE IF EXISTS `t3`;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t3` ( CREATE TABLE `t3` (
`id` int(8) DEFAULT NULL, `id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL `name` varchar(32) DEFAULT NULL
) ENGINE=MEMORY DEFAULT CHARSET=latin1; ) ENGINE=MEMORY DEFAULT CHARSET=latin1;
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t3` DISABLE KEYS */; /*!40000 ALTER TABLE `t3` DISABLE KEYS */;
INSERT DELAYED IGNORE INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); INSERT DELAYED IGNORE INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t3` ENABLE KEYS */; /*!40000 ALTER TABLE `t3` ENABLE KEYS */;
DROP TABLE IF EXISTS `t4`; DROP TABLE IF EXISTS `t4`;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t4` ( CREATE TABLE `t4` (
`id` int(8) DEFAULT NULL, `id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL `name` varchar(32) DEFAULT NULL
) ENGINE=MEMORY DEFAULT CHARSET=latin1; ) ENGINE=MEMORY DEFAULT CHARSET=latin1;
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t4` DISABLE KEYS */; /*!40000 ALTER TABLE `t4` DISABLE KEYS */;
INSERT DELAYED IGNORE INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); INSERT DELAYED IGNORE INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t4` ENABLE KEYS */; /*!40000 ALTER TABLE `t4` ENABLE KEYS */;
DROP TABLE IF EXISTS `t5`; DROP TABLE IF EXISTS `t5`;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t5` ( CREATE TABLE `t5` (
`id` int(8) DEFAULT NULL, `id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL `name` varchar(32) DEFAULT NULL
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1; ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1;
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t5` DISABLE KEYS */; /*!40000 ALTER TABLE `t5` DISABLE KEYS */;
INSERT DELAYED IGNORE INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); INSERT DELAYED IGNORE INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t5` ENABLE KEYS */; /*!40000 ALTER TABLE `t5` ENABLE KEYS */;
DROP TABLE IF EXISTS `t6`; DROP TABLE IF EXISTS `t6`;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t6` ( CREATE TABLE `t6` (
`id` int(8) DEFAULT NULL, `id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL `name` varchar(32) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1; ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t6` DISABLE KEYS */; /*!40000 ALTER TABLE `t6` DISABLE KEYS */;
INSERT IGNORE INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); INSERT IGNORE INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
@ -190,73 +190,73 @@ CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET l
USE `test`; USE `test`;
DROP TABLE IF EXISTS `t1`; DROP TABLE IF EXISTS `t1`;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t1` ( CREATE TABLE `t1` (
`id` int(8) DEFAULT NULL, `id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL `name` varchar(32) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1; ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */; /*!40000 ALTER TABLE `t1` DISABLE KEYS */;
INSERT DELAYED INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); INSERT DELAYED INTO `t1` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t1` ENABLE KEYS */; /*!40000 ALTER TABLE `t1` ENABLE KEYS */;
DROP TABLE IF EXISTS `t2`; DROP TABLE IF EXISTS `t2`;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t2` ( CREATE TABLE `t2` (
`id` int(8) DEFAULT NULL, `id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL `name` varchar(32) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1; ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t2` DISABLE KEYS */; /*!40000 ALTER TABLE `t2` DISABLE KEYS */;
INSERT DELAYED INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); INSERT DELAYED INTO `t2` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t2` ENABLE KEYS */; /*!40000 ALTER TABLE `t2` ENABLE KEYS */;
DROP TABLE IF EXISTS `t3`; DROP TABLE IF EXISTS `t3`;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t3` ( CREATE TABLE `t3` (
`id` int(8) DEFAULT NULL, `id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL `name` varchar(32) DEFAULT NULL
) ENGINE=MEMORY DEFAULT CHARSET=latin1; ) ENGINE=MEMORY DEFAULT CHARSET=latin1;
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t3` DISABLE KEYS */; /*!40000 ALTER TABLE `t3` DISABLE KEYS */;
INSERT DELAYED INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); INSERT DELAYED INTO `t3` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t3` ENABLE KEYS */; /*!40000 ALTER TABLE `t3` ENABLE KEYS */;
DROP TABLE IF EXISTS `t4`; DROP TABLE IF EXISTS `t4`;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t4` ( CREATE TABLE `t4` (
`id` int(8) DEFAULT NULL, `id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL `name` varchar(32) DEFAULT NULL
) ENGINE=MEMORY DEFAULT CHARSET=latin1; ) ENGINE=MEMORY DEFAULT CHARSET=latin1;
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t4` DISABLE KEYS */; /*!40000 ALTER TABLE `t4` DISABLE KEYS */;
INSERT DELAYED INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); INSERT DELAYED INTO `t4` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t4` ENABLE KEYS */; /*!40000 ALTER TABLE `t4` ENABLE KEYS */;
DROP TABLE IF EXISTS `t5`; DROP TABLE IF EXISTS `t5`;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t5` ( CREATE TABLE `t5` (
`id` int(8) DEFAULT NULL, `id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL `name` varchar(32) DEFAULT NULL
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1; ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1;
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t5` DISABLE KEYS */; /*!40000 ALTER TABLE `t5` DISABLE KEYS */;
INSERT DELAYED INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); INSERT DELAYED INTO `t5` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');
/*!40000 ALTER TABLE `t5` ENABLE KEYS */; /*!40000 ALTER TABLE `t5` ENABLE KEYS */;
DROP TABLE IF EXISTS `t6`; DROP TABLE IF EXISTS `t6`;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t6` ( CREATE TABLE `t6` (
`id` int(8) DEFAULT NULL, `id` int(8) DEFAULT NULL,
`name` varchar(32) DEFAULT NULL `name` varchar(32) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1; ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
/*!40000 ALTER TABLE `t6` DISABLE KEYS */; /*!40000 ALTER TABLE `t6` DISABLE KEYS */;
INSERT INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value'); INSERT INTO `t6` VALUES (1,'first value'),(2,'first value'),(3,'first value'),(4,'first value'),(5,'first value');

File diff suppressed because it is too large Load Diff

View File

@ -215,7 +215,6 @@ source database
"MySQL: The world's most popular ;open source database" "MySQL: The world's most popular ;open source database"
echo message echo message echo message echo message
mysqltest: At line 1: command "false" failed
mysqltest: At line 1: Missing argument in exec mysqltest: At line 1: Missing argument in exec
MySQL MySQL
"MySQL" "MySQL"
@ -383,7 +382,6 @@ mysqltest: At line 1: The argument to dec must be a variable (start with $)
mysqltest: At line 1: End of line junk detected: "1000" mysqltest: At line 1: End of line junk detected: "1000"
mysqltest: At line 1: Missing arguments to system, nothing to do! mysqltest: At line 1: Missing arguments to system, nothing to do!
mysqltest: At line 1: Missing arguments to system, nothing to do! mysqltest: At line 1: Missing arguments to system, nothing to do!
mysqltest: At line 1: system command 'false' failed
system command 'NonExistsinfComamdn 2> /dev/null' failed system command 'NonExistsinfComamdn 2> /dev/null' failed
test test
test2 test2
@ -745,10 +743,12 @@ select 1;
-- a comment for the server; -- a comment for the server;
mysqltest: At line 1: Found line beginning with -- that didn't contain a valid mysqltest command, check your syntax or use # if you intended to write a comment mysqltest: At line 1: Found line beginning with -- that didn't contain a valid mysqltest command, check your syntax or use # if you intended to write a comment
con1 con1
con2
default default
con1 con1
default con2
con1
con1 con1
con2
con2
-closed_connection- -closed_connection-
End of tests End of tests

View File

@ -98,12 +98,12 @@ INSERT INTO t1 VALUES (1), (2);
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`; DROP TABLE IF EXISTS `t1`;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t1` ( CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
); );
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
LOCK TABLES `t1` WRITE; LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */; /*!40000 ALTER TABLE `t1` DISABLE KEYS */;
@ -132,12 +132,12 @@ UNLOCK TABLES;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`; DROP TABLE IF EXISTS `t1`;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t1` ( CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
); );
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
LOCK TABLES `t1` WRITE; LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */; /*!40000 ALTER TABLE `t1` DISABLE KEYS */;
@ -166,12 +166,12 @@ UNLOCK TABLES;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`; DROP TABLE IF EXISTS `t1`;
SET @saved_cs_client = @@character_set_client; /*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t1` ( CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
); );
SET character_set_client = @saved_cs_client; /*!40101 SET character_set_client = @saved_cs_client */;
LOCK TABLES `t1` WRITE; LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */; /*!40000 ALTER TABLE `t1` DISABLE KEYS */;

View File

@ -1,3 +1,5 @@
set @max_allowed_packet=@@global.max_allowed_packet;
set @net_buffer_length=@@global.net_buffer_length;
set global max_allowed_packet=100; set global max_allowed_packet=100;
Warnings: Warnings:
Warning 1292 Truncated incorrect max_allowed_packet value: '100' Warning 1292 Truncated incorrect max_allowed_packet value: '100'
@ -23,3 +25,5 @@ len
select length(repeat('a',2000)); select length(repeat('a',2000));
length(repeat('a',2000)) length(repeat('a',2000))
2000 2000
set global max_allowed_packet=@max_allowed_packet;
set global net_buffer_length=@net_buffer_length;

View File

@ -522,7 +522,7 @@ select conv(255 AS p1, 10 AS p2, 16 AS p3);
ERROR 42000: Incorrect parameters in the call to native function 'conv' ERROR 42000: Incorrect parameters in the call to native function 'conv'
select atan(10); select atan(10);
atan(10) atan(10)
1.4711276743037 1.47112767430373
select atan(10 AS p1); select atan(10 AS p1);
ERROR 42000: Incorrect parameters in the call to native function 'atan' ERROR 42000: Incorrect parameters in the call to native function 'atan'
select atan(10 p1); select atan(10 p1);
@ -533,7 +533,7 @@ select atan(10 "p1");
ERROR 42000: Incorrect parameters in the call to native function 'atan' ERROR 42000: Incorrect parameters in the call to native function 'atan'
select atan(10, 20); select atan(10, 20);
atan(10, 20) atan(10, 20)
0.46364760900081 0.463647609000806
select atan(10 AS p1, 20); select atan(10 AS p1, 20);
ERROR 42000: Incorrect parameters in the call to native function 'atan' ERROR 42000: Incorrect parameters in the call to native function 'atan'
select atan(10 p1, 20); select atan(10 p1, 20);

View File

@ -1,5 +1,9 @@
SET @old_general_log= @@global.general_log; SET @old_general_log= @@global.general_log;
drop table if exists t1, t2; drop table if exists t1, t2;
CREATE TABLE t1 (a INT, FOREIGN KEY (a) REFERENCES t0 (a))
ENGINE=MyISAM
PARTITION BY HASH (a);
ERROR HY000: Foreign key clause is not yet supported in conjunction with partitioning
CREATE TABLE t1 ( CREATE TABLE t1 (
pk INT NOT NULL AUTO_INCREMENT, pk INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY (pk) PRIMARY KEY (pk)

View File

@ -1,4 +1,13 @@
drop table if exists t1; drop table if exists t1;
CREATE TABLE t1 (a INTEGER NOT NULL, PRIMARY KEY (a));
INSERT INTO t1 VALUES (1),(1);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
DROP TABLE t1;
CREATE TABLE t1 (a INTEGER NOT NULL, PRIMARY KEY (a))
PARTITION BY KEY (a) PARTITIONS 2;
INSERT INTO t1 VALUES (1),(1);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
DROP TABLE t1;
CREATE TABLE t1 (a INT) CREATE TABLE t1 (a INT)
PARTITION BY HASH (a) PARTITION BY HASH (a)
( PARTITION p0 ENGINE=MyISAM, ( PARTITION p0 ENGINE=MyISAM,

View File

@ -25,13 +25,13 @@ ALTER TABLE t1 DROP PARTITION x10, x1, x2, x3;
ERROR HY000: Error in list of partitions to DROP ERROR HY000: Error in list of partitions to DROP
ALTER TABLE t1 REORGANIZE PARTITION x0,x1,x2,x3,x4,x5,x6,x7,x8,x9,x10 INTO ALTER TABLE t1 REORGANIZE PARTITION x0,x1,x2,x3,x4,x5,x6,x7,x8,x9,x10 INTO
(PARTITION x11 VALUES LESS THAN (22)); (PARTITION x11 VALUES LESS THAN (22));
ERROR HY000: More partitions to reorganise than there are partitions ERROR HY000: More partitions to reorganize than there are partitions
ALTER TABLE t1 REORGANIZE PARTITION x0,x1,x2 INTO ALTER TABLE t1 REORGANIZE PARTITION x0,x1,x2 INTO
(PARTITION x3 VALUES LESS THAN (6)); (PARTITION x3 VALUES LESS THAN (6));
ERROR HY000: Duplicate partition name x3 ERROR HY000: Duplicate partition name x3
ALTER TABLE t1 REORGANIZE PARTITION x0, x2 INTO ALTER TABLE t1 REORGANIZE PARTITION x0, x2 INTO
(PARTITION x11 VALUES LESS THAN (2)); (PARTITION x11 VALUES LESS THAN (2));
ERROR HY000: When reorganising a set of partitions they must be in consecutive order ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
ALTER TABLE t1 REORGANIZE PARTITION x0, x1, x1 INTO ALTER TABLE t1 REORGANIZE PARTITION x0, x1, x1 INTO
(PARTITION x11 VALUES LESS THAN (4)); (PARTITION x11 VALUES LESS THAN (4));
ERROR HY000: Error in list of partitions to REORGANIZE ERROR HY000: Error in list of partitions to REORGANIZE

View File

@ -144,7 +144,7 @@ Key_reads 0
load index into cache t3, t2 key (primary,b) ; load index into cache t3, t2 key (primary,b) ;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t3 preload_keys Error Table 'test.t3' doesn't exist test.t3 preload_keys Error Table 'test.t3' doesn't exist
test.t3 preload_keys error Corrupt test.t3 preload_keys status Operation failed
test.t2 preload_keys status OK test.t2 preload_keys status OK
show status like "key_read%"; show status like "key_read%";
Variable_name Value Variable_name Value
@ -159,7 +159,7 @@ Key_reads 0
load index into cache t3 key (b), t2 key (c) ; load index into cache t3 key (b), t2 key (c) ;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t3 preload_keys Error Table 'test.t3' doesn't exist test.t3 preload_keys Error Table 'test.t3' doesn't exist
test.t3 preload_keys error Corrupt test.t3 preload_keys status Operation failed
test.t2 preload_keys Error Key 'c' doesn't exist in table 't2' test.t2 preload_keys Error Key 'c' doesn't exist in table 't2'
test.t2 preload_keys status Operation failed test.t2 preload_keys status Operation failed
show status like "key_read%"; show status like "key_read%";

View File

@ -235,7 +235,7 @@ execute stmt1;
prepare stmt1 from "insert into t1 select i from t1"; prepare stmt1 from "insert into t1 select i from t1";
execute stmt1; execute stmt1;
execute stmt1; execute stmt1;
prepare stmt1 from "select * from t1 into outfile 'f1.txt'"; prepare stmt1 from "select * from t1 into outfile '<MYSQLTEST_VARDIR>/tmp/f1.txt'";
execute stmt1; execute stmt1;
deallocate prepare stmt1; deallocate prepare stmt1;
drop table t1; drop table t1;
@ -803,6 +803,8 @@ select @@max_prepared_stmt_count;
@@max_prepared_stmt_count @@max_prepared_stmt_count
16382 16382
set global max_prepared_stmt_count=-1; set global max_prepared_stmt_count=-1;
Warnings:
Warning 1292 Truncated incorrect max_prepared_stmt_count value: '-1'
select @@max_prepared_stmt_count; select @@max_prepared_stmt_count;
@@max_prepared_stmt_count @@max_prepared_stmt_count
0 0
@ -1394,13 +1396,13 @@ execute stmt;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 repair status OK test.t1 repair status OK
test.t4 repair Error Table 'test.t4' doesn't exist test.t4 repair Error Table 'test.t4' doesn't exist
test.t4 repair error Corrupt test.t4 repair status Operation failed
test.t3 repair status OK test.t3 repair status OK
execute stmt; execute stmt;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 repair status OK test.t1 repair status OK
test.t4 repair Error Table 'test.t4' doesn't exist test.t4 repair Error Table 'test.t4' doesn't exist
test.t4 repair error Corrupt test.t4 repair status Operation failed
test.t3 repair status OK test.t3 repair status OK
prepare stmt from "optimize table t1, t3, t4"; prepare stmt from "optimize table t1, t3, t4";
execute stmt; execute stmt;
@ -1408,23 +1410,23 @@ Table Op Msg_type Msg_text
test.t1 optimize status OK test.t1 optimize status OK
test.t3 optimize status OK test.t3 optimize status OK
test.t4 optimize Error Table 'test.t4' doesn't exist test.t4 optimize Error Table 'test.t4' doesn't exist
test.t4 optimize error Corrupt test.t4 optimize status Operation failed
execute stmt; execute stmt;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 optimize status Table is already up to date test.t1 optimize status Table is already up to date
test.t3 optimize status Table is already up to date test.t3 optimize status Table is already up to date
test.t4 optimize Error Table 'test.t4' doesn't exist test.t4 optimize Error Table 'test.t4' doesn't exist
test.t4 optimize error Corrupt test.t4 optimize status Operation failed
prepare stmt from "analyze table t4, t1"; prepare stmt from "analyze table t4, t1";
execute stmt; execute stmt;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t4 analyze Error Table 'test.t4' doesn't exist test.t4 analyze Error Table 'test.t4' doesn't exist
test.t4 analyze error Corrupt test.t4 analyze status Operation failed
test.t1 analyze status Table is already up to date test.t1 analyze status Table is already up to date
execute stmt; execute stmt;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t4 analyze Error Table 'test.t4' doesn't exist test.t4 analyze Error Table 'test.t4' doesn't exist
test.t4 analyze error Corrupt test.t4 analyze status Operation failed
test.t1 analyze status Table is already up to date test.t1 analyze status Table is already up to date
deallocate prepare stmt; deallocate prepare stmt;
drop table t1, t2, t3; drop table t1, t2, t3;

View File

@ -22,3 +22,52 @@ Qcache_queries_in_cache 0
set global query_cache_size= 0; set global query_cache_size= 0;
use test; use test;
drop table t1; drop table t1;
SET @old_concurrent_insert= @@GLOBAL.concurrent_insert;
SET @old_query_cache_size= @@GLOBAL.query_cache_size;
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (a INT);
INSERT INTO t1 VALUES (1),(2),(3);
SET GLOBAL concurrent_insert= 1;
SET GLOBAL query_cache_size= 1024*512;
SET GLOBAL query_cache_type= ON;
# Switch to connection con1
SET SESSION debug='+d,wait_after_query_cache_invalidate';
# Send concurrent insert, will wait in the query cache table invalidate
INSERT INTO t1 VALUES (4);
# Switch to connection default
# Wait for concurrent insert to reach the debug point
# Switch to connection con2
# Send SELECT that shouldn't be cached
SELECT * FROM t1;
a
1
2
3
# Switch to connection default
# Notify the concurrent insert to proceed
SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE STATE = 'wait_after_query_cache_invalidate' INTO @thread_id;
KILL QUERY @thread_id;
# Switch to connection con1
# Gather insert result
SHOW STATUS LIKE "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
# Test that it's cacheable
SELECT * FROM t1;
a
1
2
3
4
SHOW STATUS LIKE "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
# Disconnect
# Restore defaults
RESET QUERY CACHE;
DROP TABLE t1,t2;
SET GLOBAL concurrent_insert= DEFAULT;
SET GLOBAL query_cache_size= DEFAULT;
SET GLOBAL query_cache_type= DEFAULT;

View File

@ -375,6 +375,7 @@ id
show status like 'Qcache_queries_in_cache'; show status like 'Qcache_queries_in_cache';
Variable_name Value Variable_name Value
Qcache_queries_in_cache 1 Qcache_queries_in_cache 1
USE test;
DROP DATABASE bug30269; DROP DATABASE bug30269;
DROP USER 'bug30269'@'localhost'; DROP USER 'bug30269'@'localhost';
set GLOBAL query_cache_type=default; set GLOBAL query_cache_type=default;

View File

@ -1,12 +1,18 @@
set @start_read_only= @@global.read_only;
DROP TABLE IF EXISTS t1,t2,t3; DROP TABLE IF EXISTS t1,t2,t3;
grant CREATE, SELECT, DROP on *.* to test@localhost; grant CREATE, SELECT, DROP on *.* to test@localhost;
connect (con1,localhost,test,,test);
connection default;
set global read_only=0; set global read_only=0;
connection con1;
create table t1 (a int); create table t1 (a int);
insert into t1 values(1); insert into t1 values(1);
create table t2 select * from t1; create table t2 select * from t1;
connection default;
set global read_only=1; set global read_only=1;
create table t3 (a int); create table t3 (a int);
drop table t3; drop table t3;
connection con1;
select @@global.read_only; select @@global.read_only;
@@global.read_only @@global.read_only
1 1
@ -39,13 +45,18 @@ delete t1 from t1,t3 where t1.a=t3.a;
drop table t1; drop table t1;
insert into t1 values(1); insert into t1 values(1);
ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
connection default;
set global read_only=0; set global read_only=0;
lock table t1 write; lock table t1 write;
connection con1;
lock table t2 write; lock table t2 write;
connection default;
set global read_only=1; set global read_only=1;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
unlock tables ; unlock tables ;
send set global read_only=1;
set global read_only=1; set global read_only=1;
connection con1;
select @@global.read_only; select @@global.read_only;
@@global.read_only @@global.read_only
0 0
@ -53,13 +64,20 @@ unlock tables ;
select @@global.read_only; select @@global.read_only;
@@global.read_only @@global.read_only
1 1
connection default;
reap;
connection default;
set global read_only=0; set global read_only=0;
lock table t1 read; lock table t1 read;
connection con1;
lock table t2 read; lock table t2 read;
connection default;
set global read_only=1; set global read_only=1;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
unlock tables ; unlock tables ;
send set global read_only=1;
set global read_only=1; set global read_only=1;
connection con1;
select @@global.read_only; select @@global.read_only;
@@global.read_only @@global.read_only
0 0
@ -67,24 +85,35 @@ unlock tables ;
select @@global.read_only; select @@global.read_only;
@@global.read_only @@global.read_only
1 1
connection default;
reap;
connection default;
set global read_only=0; set global read_only=0;
BEGIN; BEGIN;
connection con1;
BEGIN; BEGIN;
connection default;
set global read_only=1; set global read_only=1;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
ROLLBACK; ROLLBACK;
set global read_only=1; set global read_only=1;
connection con1;
select @@global.read_only; select @@global.read_only;
@@global.read_only @@global.read_only
1 1
ROLLBACK; ROLLBACK;
connection default;
set global read_only=0; set global read_only=0;
flush tables with read lock; flush tables with read lock;
set global read_only=1; set global read_only=1;
unlock tables; unlock tables;
connect (root2,localhost,root,,test);
connection default;
set global read_only=0; set global read_only=0;
flush tables with read lock; flush tables with read lock;
connection root2;
set global read_only=1; set global read_only=1;
connection default;
select @@global.read_only; select @@global.read_only;
@@global.read_only @@global.read_only
1 1
@ -94,6 +123,7 @@ ERROR 42S02: Unknown table 'ttt'
drop temporary table if exists ttt; drop temporary table if exists ttt;
Warnings: Warnings:
Note 1051 Unknown table 'ttt' Note 1051 Unknown table 'ttt'
connection default;
set global read_only=0; set global read_only=0;
drop table t1,t2; drop table t1,t2;
drop user test@localhost; drop user test@localhost;
@ -112,16 +142,20 @@ grant all on mysqltest_db2.* to `mysqltest_u1`@`%`;
create database mysqltest_db1; create database mysqltest_db1;
grant all on mysqltest_db1.* to `mysqltest_u1`@`%`; grant all on mysqltest_db1.* to `mysqltest_u1`@`%`;
flush privileges; flush privileges;
connect (con_bug27440,127.0.0.1,mysqltest_u1,,test,MASTER_MYPORT,);
connection con_bug27440;
create database mysqltest_db2; create database mysqltest_db2;
ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
show databases like '%mysqltest_db2%'; show databases like '%mysqltest_db2%';
Database (%mysqltest_db2%) Database (%mysqltest_db2%)
drop database mysqltest_db1; drop database mysqltest_db1;
ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement
disconnect con_bug27440;
connection default;
delete from mysql.user where User like 'mysqltest_%'; delete from mysql.user where User like 'mysqltest_%';
delete from mysql.db where User like 'mysqltest_%'; delete from mysql.db where User like 'mysqltest_%';
delete from mysql.tables_priv where User like 'mysqltest_%'; delete from mysql.tables_priv where User like 'mysqltest_%';
delete from mysql.columns_priv where User like 'mysqltest_%'; delete from mysql.columns_priv where User like 'mysqltest_%';
flush privileges; flush privileges;
drop database mysqltest_db1; drop database mysqltest_db1;
set global read_only=0; set global read_only= @start_read_only;

View File

@ -27,7 +27,7 @@ drop table t1;
repair table t1 use_frm; repair table t1 use_frm;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 repair Error Table 'test.t1' doesn't exist test.t1 repair Error Table 'test.t1' doesn't exist
test.t1 repair error Corrupt test.t1 repair status Operation failed
create table t1 engine=myisam SELECT 1,"table 1"; create table t1 engine=myisam SELECT 1,"table 1";
flush tables; flush tables;
repair table t1; repair table t1;

View File

@ -443,3 +443,17 @@ SELECT ROW(a, 1) IN (SELECT SUM(b), 3) FROM t1 GROUP BY a;
ROW(a, 1) IN (SELECT SUM(b), 3) ROW(a, 1) IN (SELECT SUM(b), 3)
0 0
DROP TABLE t1; DROP TABLE t1;
create table t1 (a varchar(200),
b int unsigned not null primary key auto_increment)
default character set 'utf8';
create table t2 (c varchar(200),
d int unsigned not null primary key auto_increment)
default character set 'latin1';
insert into t1 (a) values('abc');
insert into t2 (c) values('abc');
select * from t1,t2 where (a,b) = (c,d);
a b c d
abc 1 abc 1
select host,user from mysql.user where (host,user) = ('localhost','test');
host user
drop table t1,t2;

View File

@ -2784,26 +2784,26 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
select max(key1) from t1 where key1 <= 0.6158; select max(key1) from t1 where key1 <= 0.6158;
max(key1) max(key1)
0.61580002307892 0.615800023078918
select max(key2) from t2 where key2 <= 1.6158; select max(key2) from t2 where key2 <= 1.6158;
max(key2) max(key2)
1.6158000230789 1.61580002307892
select min(key1) from t1 where key1 >= 0.3762; select min(key1) from t1 where key1 >= 0.3762;
min(key1) min(key1)
0.37619999051094 0.376199990510941
select min(key2) from t2 where key2 >= 1.3762; select min(key2) from t2 where key2 >= 1.3762;
min(key2) min(key2)
1.3761999607086 1.37619996070862
select max(key1), min(key2) from t1, t2 select max(key1), min(key2) from t1, t2
where key1 <= 0.6158 and key2 >= 1.3762; where key1 <= 0.6158 and key2 >= 1.3762;
max(key1) min(key2) max(key1) min(key2)
0.61580002307892 1.3761999607086 0.615800023078918 1.37619996070862
select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5; select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5;
max(key1) max(key1)
0.61580002307892 0.615800023078918
select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5; select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
min(key1) min(key1)
0.37619999051094 0.376199990510941
DROP TABLE t1,t2; DROP TABLE t1,t2;
CREATE TABLE t1 (i BIGINT UNSIGNED NOT NULL); CREATE TABLE t1 (i BIGINT UNSIGNED NOT NULL);
INSERT INTO t1 VALUES (10); INSERT INTO t1 VALUES (10);

View File

@ -664,7 +664,7 @@ show create table t1;
ERROR HY000: Incorrect information in file: './test/t1.frm' ERROR HY000: Incorrect information in file: './test/t1.frm'
drop table if exists t1; drop table if exists t1;
# Bug#12183: SHOW OPEN TABLES behavior doesn't match grammar. # Bug#12183 SHOW OPEN TABLES behavior doesn't match grammar.
DROP DATABASE IF EXISTS mysqltest1; DROP DATABASE IF EXISTS mysqltest1;
CREATE DATABASE mysqltest1; CREATE DATABASE mysqltest1;
@ -1198,7 +1198,7 @@ CREATE DATABASE mysqltest1;
use mysqltest1; use mysqltest1;
CREATE TABLE t1(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1 INT); CREATE TABLE t1(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>1 INT);
---> Dumping mysqltest1 to show_check.mysqltest1.sql ---> Dumping mysqltest1 to outfile1
DROP DATABASE mysqltest1; DROP DATABASE mysqltest1;
@ -1295,7 +1295,7 @@ drop database mysqltest;
show full plugin; show full plugin;
show warnings; show warnings;
Level Code Message Level Code Message
Warning 1287 The syntax 'SHOW PLUGIN' is deprecated and will be removed in MySQL 5.2. Please use 'SHOW PLUGINS' instead Warning 1287 The syntax 'SHOW PLUGIN' is deprecated and will be removed in MySQL 6.0. Please use 'SHOW PLUGINS' instead
show plugin; show plugin;
show plugins; show plugins;
create database `mysqlttest\1`; create database `mysqlttest\1`;

View File

@ -5,10 +5,7 @@ GRANT USAGE ON *.* TO 'mysqltest_1'@'127.0.0.1/255.255.255.255'
GRANT ALL PRIVILEGES ON `test`.* TO 'mysqltest_1'@'127.0.0.1/255.255.255.255' GRANT ALL PRIVILEGES ON `test`.* TO 'mysqltest_1'@'127.0.0.1/255.255.255.255'
REVOKE ALL ON test.* FROM mysqltest_1@'127.0.0.1/255.255.255.255'; REVOKE ALL ON test.* FROM mysqltest_1@'127.0.0.1/255.255.255.255';
DROP USER mysqltest_1@'127.0.0.1/255.255.255.255'; DROP USER mysqltest_1@'127.0.0.1/255.255.255.255';
select user(); SELECT USER();
user() USER()
# #
show processlist; SHOW PROCESSLIST;
Id User Host db Command Time State Info
<id> root <host> test <command> <time> <state> <info>
<id> root <host> test <command> <time> <state> <info>

View File

@ -1643,7 +1643,7 @@ create table t1 (a int) type=MyISAM;
drop table t1; drop table t1;
end| end|
Warnings: Warnings:
Warning 1287 The syntax 'TYPE=storage_engine' is deprecated and will be removed in MySQL 5.2. Please use 'ENGINE=storage_engine' instead Warning 1287 The syntax 'TYPE=storage_engine' is deprecated and will be removed in MySQL 6.0. Please use 'ENGINE=storage_engine' instead
call p1(); call p1();
call p1(); call p1();
drop procedure p1; drop procedure p1;

View File

@ -342,12 +342,12 @@ GRANT SUPER ON *.* TO mysqltest_2@localhost;
GRANT ALL PRIVILEGES ON mysqltest.* TO mysqltest_2@localhost; GRANT ALL PRIVILEGES ON mysqltest.* TO mysqltest_2@localhost;
---> connection: mysqltest_2_con ---> connection: mysqltest_2_con
use mysqltest; USE mysqltest;
CREATE PROCEDURE wl2897_p1() SELECT 1; CREATE PROCEDURE wl2897_p1() SELECT 1;
CREATE FUNCTION wl2897_f1() RETURNS INT RETURN 1; CREATE FUNCTION wl2897_f1() RETURNS INT RETURN 1;
---> connection: mysqltest_1_con ---> connection: mysqltest_1_con
use mysqltest; USE mysqltest;
CREATE DEFINER=root@localhost PROCEDURE wl2897_p2() SELECT 2; CREATE DEFINER=root@localhost PROCEDURE wl2897_p2() SELECT 2;
ERROR 42000: Access denied; you need the SUPER privilege for this operation ERROR 42000: Access denied; you need the SUPER privilege for this operation
CREATE DEFINER=root@localhost FUNCTION wl2897_f2() RETURNS INT RETURN 2; CREATE DEFINER=root@localhost FUNCTION wl2897_f2() RETURNS INT RETURN 2;
@ -363,7 +363,7 @@ Warnings:
Note 1449 The user specified as a definer ('a @ b @ c'@'localhost') does not exist Note 1449 The user specified as a definer ('a @ b @ c'@'localhost') does not exist
---> connection: con1root ---> connection: con1root
use mysqltest; USE mysqltest;
SHOW CREATE PROCEDURE wl2897_p1; SHOW CREATE PROCEDURE wl2897_p1;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
wl2897_p1 CREATE DEFINER=`mysqltest_2`@`localhost` PROCEDURE `wl2897_p1`() wl2897_p1 CREATE DEFINER=`mysqltest_2`@`localhost` PROCEDURE `wl2897_p1`()
@ -393,7 +393,7 @@ CREATE USER mysqltest_2@localhost;
GRANT ALL PRIVILEGES ON mysqltest.* TO mysqltest_2@localhost; GRANT ALL PRIVILEGES ON mysqltest.* TO mysqltest_2@localhost;
---> connection: mysqltest_1_con ---> connection: mysqltest_1_con
use mysqltest; USE mysqltest;
CREATE PROCEDURE bug13198_p1() CREATE PROCEDURE bug13198_p1()
SELECT 1; SELECT 1;
CREATE FUNCTION bug13198_f1() RETURNS INT CREATE FUNCTION bug13198_f1() RETURNS INT
@ -406,7 +406,7 @@ bug13198_f1()
1 1
---> connection: mysqltest_2_con ---> connection: mysqltest_2_con
use mysqltest; USE mysqltest;
CALL bug13198_p1(); CALL bug13198_p1();
1 1
1 1
@ -418,7 +418,7 @@ bug13198_f1()
DROP USER mysqltest_1@localhost; DROP USER mysqltest_1@localhost;
---> connection: mysqltest_2_con ---> connection: mysqltest_2_con
use mysqltest; USE mysqltest;
CALL bug13198_p1(); CALL bug13198_p1();
ERROR HY000: The user specified as a definer ('mysqltest_1'@'localhost') does not exist ERROR HY000: The user specified as a definer ('mysqltest_1'@'localhost') does not exist
SELECT bug13198_f1(); SELECT bug13198_f1();
@ -435,7 +435,7 @@ Host User Password
localhost user19857 *82DC221D557298F6CE9961037DB1C90604792F5C localhost user19857 *82DC221D557298F6CE9961037DB1C90604792F5C
---> connection: mysqltest_2_con ---> connection: mysqltest_2_con
use test; USE test;
CREATE PROCEDURE sp19857() DETERMINISTIC CREATE PROCEDURE sp19857() DETERMINISTIC
BEGIN BEGIN
DECLARE a INT; DECLARE a INT;

View File

@ -581,7 +581,7 @@ return 2.7182818284590452354|
set @e = e()| set @e = e()|
select e(), @e| select e(), @e|
e() @e e() @e
2.718281828459 2.718281828459 2.71828182845905 2.71828182845905
drop function if exists inc| drop function if exists inc|
create function inc(i int) returns int create function inc(i int) returns int
return i+1| return i+1|
@ -618,7 +618,7 @@ create function fun(d double, i int, u int unsigned) returns double
return mul(inc(i), fac(u)) / e()| return mul(inc(i), fac(u)) / e()|
select fun(2.3, 3, 5)| select fun(2.3, 3, 5)|
fun(2.3, 3, 5) fun(2.3, 3, 5)
176.58213176229 176.582131762292
insert into t2 values (append("xxx", "yyy"), mul(4,3), e())| insert into t2 values (append("xxx", "yyy"), mul(4,3), e())|
insert into t2 values (append("a", "b"), mul(2,mul(3,4)), fun(1.7, 4, 6))| insert into t2 values (append("a", "b"), mul(2,mul(3,4)), fun(1.7, 4, 6))|
select * from t2 where s = append("a", "b")| select * from t2 where s = append("a", "b")|
@ -4350,10 +4350,10 @@ call bug13012()|
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 repair status OK test.t1 repair status OK
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead test.t1 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
test.t1 backup status OK test.t1 backup status OK
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead test.t1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
test.t1 restore status OK test.t1 restore status OK
drop procedure bug13012| drop procedure bug13012|
create view v1 as select * from t1| create view v1 as select * from t1|
@ -6018,9 +6018,9 @@ CREATE TABLE t3 (f1 INT, f2 FLOAT)|
INSERT INTO t3 VALUES (1, 3.4), (1, 2), (1, 0.9), (2, 8), (2, 7)| INSERT INTO t3 VALUES (1, 3.4), (1, 2), (1, 0.9), (2, 8), (2, 7)|
SELECT SUM(f2), bug25373(f1) FROM t3 GROUP BY bug25373(f1) WITH ROLLUP| SELECT SUM(f2), bug25373(f1) FROM t3 GROUP BY bug25373(f1) WITH ROLLUP|
SUM(f2) bug25373(f1) SUM(f2) bug25373(f1)
6.3000000715256 1 6.30000007152557 1
15 2 15 2
21.300000071526 NULL 21.3000000715256 NULL
DROP FUNCTION bug25373| DROP FUNCTION bug25373|
DROP TABLE t3| DROP TABLE t3|
DROP DATABASE IF EXISTS mysqltest1| DROP DATABASE IF EXISTS mysqltest1|

View File

@ -535,7 +535,7 @@ use db_bug7787|
CREATE PROCEDURE p1() CREATE PROCEDURE p1()
SHOW INNODB STATUS; | SHOW INNODB STATUS; |
Warnings: Warnings:
Warning 1287 The syntax 'SHOW INNODB STATUS' is deprecated and will be removed in MySQL 5.2. Please use 'SHOW ENGINE INNODB STATUS' instead Warning 1287 The syntax 'SHOW INNODB STATUS' is deprecated and will be removed in MySQL 6.0. Please use 'SHOW ENGINE INNODB STATUS' instead
GRANT EXECUTE ON PROCEDURE p1 TO user_bug7787@localhost| GRANT EXECUTE ON PROCEDURE p1 TO user_bug7787@localhost|
DROP DATABASE db_bug7787| DROP DATABASE db_bug7787|
drop user user_bug7787@localhost| drop user user_bug7787@localhost|

View File

@ -1305,7 +1305,7 @@ set @@sql_mode='traditional';
create table t1 (i int) create table t1 (i int)
comment '123456789*123456789*123456789*123456789*123456789* comment '123456789*123456789*123456789*123456789*123456789*
123456789*123456789*123456789*123456789*123456789*'; 123456789*123456789*123456789*123456789*123456789*';
ERROR HY000: Too long comment for table 't1' ERROR HY000: Comment for table 't1' is too long (max = 60)
create table t1 ( create table t1 (
i int comment i int comment
'123456789*123456789*123456789*123456789* '123456789*123456789*123456789*123456789*
@ -1315,7 +1315,7 @@ i int comment
123456789*123456789*123456789*123456789* 123456789*123456789*123456789*123456789*
123456789*123456789*123456789*123456789* 123456789*123456789*123456789*123456789*
123456789*123456789*123456789*123456789*'); 123456789*123456789*123456789*123456789*');
ERROR HY000: Too long comment for field 'i' ERROR HY000: Comment for field 'i' is too long (max = 255)
set @@sql_mode= @org_mode; set @@sql_mode= @org_mode;
create table t1 create table t1
(i int comment (i int comment
@ -1327,7 +1327,7 @@ create table t1
123456789*123456789*123456789*123456789* 123456789*123456789*123456789*123456789*
123456789*123456789*123456789*123456789*'); 123456789*123456789*123456789*123456789*');
Warnings: Warnings:
Warning 1105 Unknown error Warning 1629 Comment for field 'i' is too long (max = 255)
select column_name, column_comment from information_schema.columns where select column_name, column_comment from information_schema.columns where
table_schema = 'test' and table_name = 't1'; table_schema = 'test' and table_name = 't1';
column_name column_comment column_name column_comment

View File

@ -4362,7 +4362,7 @@ Warnings:
Note 1003 select 1 AS `1` from `test`.`t1` where <in_optimizer>(1,<exists>(select 1 AS `1` from `test`.`t1` where (`test`.`t1`.`a` > 3) group by `test`.`t1`.`a` having (<cache>(1) = <ref_null_helper>(1)))) Note 1003 select 1 AS `1` from `test`.`t1` where <in_optimizer>(1,<exists>(select 1 AS `1` from `test`.`t1` where (`test`.`t1`.`a` > 3) group by `test`.`t1`.`a` having (<cache>(1) = <ref_null_helper>(1))))
DROP TABLE t1; DROP TABLE t1;
End of 5.0 tests. End of 5.0 tests.
CREATE TABLE t1 (a int, b int); CREATE TABLE t1 (a INT, b INT);
INSERT INTO t1 VALUES (2,22),(1,11),(2,22); INSERT INTO t1 VALUES (2,22),(1,11),(2,22);
SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 0 GROUP BY a; SELECT a FROM t1 WHERE (SELECT COUNT(b) FROM DUAL) > 0 GROUP BY a;
a a
@ -4385,22 +4385,22 @@ WHERE (SELECT COUNT(t0.b) FROM t1 t WHERE t.b>20) GROUP BY a;
ERROR HY000: Invalid use of group function ERROR HY000: Invalid use of group function
SET @@sql_mode=default; SET @@sql_mode=default;
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (s1 char(1)); CREATE TABLE t1 (s1 CHAR(1));
INSERT INTO t1 VALUES ('a'); INSERT INTO t1 VALUES ('a');
SELECT * FROM t1 WHERE _utf8'a' = ANY (SELECT s1 FROM t1); SELECT * FROM t1 WHERE _utf8'a' = ANY (SELECT s1 FROM t1);
s1 s1
a a
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1(c int, KEY(c)); CREATE TABLE t1(c INT, KEY(c));
CREATE TABLE t2(a int, b int); CREATE TABLE t2(a INT, b INT);
INSERT INTO t2 VALUES (1, 10), (2, NULL); INSERT INTO t2 VALUES (1, 10), (2, NULL);
INSERT INTO t1 VALUES (1), (3); INSERT INTO t1 VALUES (1), (3);
SELECT * FROM t2 WHERE b NOT IN (SELECT max(t.c) FROM t1, t1 t WHERE t.c>10); SELECT * FROM t2 WHERE b NOT IN (SELECT max(t.c) FROM t1, t1 t WHERE t.c>10);
a b a b
DROP TABLE t1,t2; DROP TABLE t1,t2;
CREATE TABLE t1(pk int PRIMARY KEY, a int, INDEX idx(a)); CREATE TABLE t1(pk INT PRIMARY KEY, a INT, INDEX idx(a));
INSERT INTO t1 VALUES (1, 10), (3, 30), (2, 20); INSERT INTO t1 VALUES (1, 10), (3, 30), (2, 20);
CREATE TABLE t2(pk int PRIMARY KEY, a int, b int, INDEX idxa(a)); CREATE TABLE t2(pk INT PRIMARY KEY, a INT, b INT, INDEX idxa(a));
INSERT INTO t2 VALUES (2, 20, 700), (1, 10, 200), (4, 10, 100); INSERT INTO t2 VALUES (2, 20, 700), (1, 10, 200), (4, 10, 100);
SELECT * FROM t1 SELECT * FROM t1
WHERE EXISTS (SELECT DISTINCT a FROM t2 WHERE t1.a < t2.a ORDER BY b); WHERE EXISTS (SELECT DISTINCT a FROM t2 WHERE t1.a < t2.a ORDER BY b);
@ -4409,13 +4409,13 @@ pk a
3 30 3 30
2 20 2 20
DROP TABLE t1,t2; DROP TABLE t1,t2;
CREATE TABLE t1 (a int, b int, PRIMARY KEY (a), KEY b (b)); CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a), KEY b (b));
INSERT INTO t1 VALUES (1,NULL), (9,NULL); INSERT INTO t1 VALUES (1,NULL), (9,NULL);
CREATE TABLE t2 ( CREATE TABLE t2 (
a int, a INT,
b int, b INT,
c int, c INT,
d int, d INT,
PRIMARY KEY (a), PRIMARY KEY (a),
UNIQUE KEY b (b,c,d), UNIQUE KEY b (b,c,d),
KEY b_2 (b), KEY b_2 (b),
@ -4429,9 +4429,9 @@ INSERT INTO t2 VALUES
(46, 1, 2 ,10000), (46, 1, 2 ,10000),
(556,1, 32 ,10000); (556,1, 32 ,10000);
CREATE TABLE t3 ( CREATE TABLE t3 (
a int, a INT,
b int, b INT,
c int, c INT,
PRIMARY KEY (a), PRIMARY KEY (a),
UNIQUE KEY b (b,c), UNIQUE KEY b (b,c),
KEY c (c), KEY c (c),
@ -4476,7 +4476,7 @@ DELETE FROM v3;
DROP VIEW v1,v2,v3; DROP VIEW v1,v2,v3;
DROP TABLE t1,t2; DROP TABLE t1,t2;
# #
# BUG#37822: Correlated subquery with IN and IS UNKNOWN provides wrong result # Bug#37822 Correlated subquery with IN and IS UNKNOWN provides wrong result
# #
create table t1(id integer primary key, g integer, v integer, s char(1)); create table t1(id integer primary key, g integer, v integer, s char(1));
create table t2(id integer primary key, g integer, v integer, s char(1)); create table t2(id integer primary key, g integer, v integer, s char(1));

View File

@ -1,6 +1,6 @@
drop table if exists t1,t2; DROP TABLE IF EXISTS t1,t2;
CREATE TABLE t1 (x1 int); CREATE TABLE t1 (x1 INT);
ALTER TABLE t1 CHANGE x1 x2 int; ALTER TABLE t1 CHANGE x1 x2 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
@ -8,7 +8,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL `xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x2 x1 int; ALTER TABLE t1 CHANGE x2 x1 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
@ -16,7 +16,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL `xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x1 x2 int; ALTER TABLE t1 CHANGE x1 x2 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
@ -24,7 +24,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL `xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x2 x1 int; ALTER TABLE t1 CHANGE x2 x1 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
@ -32,7 +32,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL `xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x1 x2 int; ALTER TABLE t1 CHANGE x1 x2 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
@ -40,7 +40,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL `xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x2 x1 int; ALTER TABLE t1 CHANGE x2 x1 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
@ -48,7 +48,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL `xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x1 x2 int; ALTER TABLE t1 CHANGE x1 x2 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
@ -56,7 +56,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL `xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x2 x1 int; ALTER TABLE t1 CHANGE x2 x1 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
@ -64,7 +64,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL `xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x1 x2 int; ALTER TABLE t1 CHANGE x1 x2 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
@ -72,7 +72,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL `xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x2 x1 int; ALTER TABLE t1 CHANGE x2 x1 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
@ -80,7 +80,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL `xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x1 x2 int; ALTER TABLE t1 CHANGE x1 x2 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
@ -88,7 +88,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL `xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x2 x1 int; ALTER TABLE t1 CHANGE x2 x1 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
@ -96,7 +96,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL `xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x1 x2 int; ALTER TABLE t1 CHANGE x1 x2 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
@ -104,7 +104,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL `xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x2 x1 int; ALTER TABLE t1 CHANGE x2 x1 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
@ -112,7 +112,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL `xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x1 x2 int; ALTER TABLE t1 CHANGE x1 x2 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
@ -120,7 +120,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL `xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x2 x1 int; ALTER TABLE t1 CHANGE x2 x1 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
@ -128,7 +128,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL `xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x1 x2 int; ALTER TABLE t1 CHANGE x1 x2 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
@ -136,7 +136,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL `xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x2 x1 int; ALTER TABLE t1 CHANGE x2 x1 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
@ -144,7 +144,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL `xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x1 x2 int; ALTER TABLE t1 CHANGE x1 x2 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table
@ -152,7 +152,7 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL `xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2; DROP TABLE t2;
ALTER TABLE t1 CHANGE x2 x1 int; ALTER TABLE t1 CHANGE x2 x1 INT;
CREATE TABLE t2 LIKE t1; CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2; SHOW CREATE TABLE t2;
Table Create Table Table Create Table

View File

@ -227,7 +227,7 @@ event CREATE TABLE `event` (
`on_completion` enum('DROP','PRESERVE') NOT NULL DEFAULT 'DROP', `on_completion` enum('DROP','PRESERVE') NOT NULL DEFAULT 'DROP',
`sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '', `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '',
`comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', `comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
`originator` int(10) NOT NULL, `originator` int(10) unsigned NOT NULL,
`time_zone` char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', `time_zone` char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM',
`character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
@ -241,7 +241,7 @@ general_log CREATE TABLE `general_log` (
`event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`user_host` mediumtext NOT NULL, `user_host` mediumtext NOT NULL,
`thread_id` int(11) NOT NULL, `thread_id` int(11) NOT NULL,
`server_id` int(11) NOT NULL, `server_id` int(10) unsigned NOT NULL,
`command_type` varchar(64) NOT NULL, `command_type` varchar(64) NOT NULL,
`argument` mediumtext NOT NULL `argument` mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log' ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log'
@ -257,7 +257,7 @@ slow_log CREATE TABLE `slow_log` (
`db` varchar(512) NOT NULL, `db` varchar(512) NOT NULL,
`last_insert_id` int(11) NOT NULL, `last_insert_id` int(11) NOT NULL,
`insert_id` int(11) NOT NULL, `insert_id` int(11) NOT NULL,
`server_id` int(11) NOT NULL, `server_id` int(10) unsigned NOT NULL,
`sql_text` mediumtext NOT NULL `sql_text` mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log' ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'
show tables; show tables;

View File

@ -12,9 +12,7 @@ GRANT CREATE, TRIGGER ON mysqltest_db1.* TO mysqltest_dfn@localhost;
---> connection: wl2818_definer_con ---> connection: wl2818_definer_con
CREATE TABLE t1(num_value INT); CREATE TABLE t1(num_value INT);
CREATE TABLE t2(user_str TEXT); CREATE TABLE t2(user_str TEXT);
CREATE TRIGGER wl2818_trg1 BEFORE INSERT ON t1 CREATE TRIGGER wl2818_trg1 BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES(CURRENT_USER());
FOR EACH ROW
INSERT INTO t2 VALUES(CURRENT_USER());
---> patching t1.TRG... ---> patching t1.TRG...

View File

@ -891,11 +891,11 @@ CREATE TABLE b15776 (a year(-2));
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-2))' at line 1 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-2))' at line 1
CREATE TABLE b15776 (a timestamp(4294967294)); CREATE TABLE b15776 (a timestamp(4294967294));
Warnings: Warnings:
Warning 1287 The syntax 'TIMESTAMP(4294967294)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead Warning 1287 The syntax 'TIMESTAMP(4294967294)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
DROP TABLE b15776; DROP TABLE b15776;
CREATE TABLE b15776 (a timestamp(4294967295)); CREATE TABLE b15776 (a timestamp(4294967295));
Warnings: Warnings:
Warning 1287 The syntax 'TIMESTAMP(4294967295)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead Warning 1287 The syntax 'TIMESTAMP(4294967295)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
DROP TABLE b15776; DROP TABLE b15776;
CREATE TABLE b15776 (a timestamp(4294967296)); CREATE TABLE b15776 (a timestamp(4294967296));
ERROR 42000: Display width out of range for column 'a' (max = 4294967295) ERROR 42000: Display width out of range for column 'a' (max = 4294967295)

View File

@ -619,3 +619,22 @@ ERROR 42000: Invalid default value for 'da'
create table t1 (t time default '916:00:00 a'); create table t1 (t time default '916:00:00 a');
ERROR 42000: Invalid default value for 't' ERROR 42000: Invalid default value for 't'
set @@sql_mode= @org_mode; set @@sql_mode= @org_mode;
SELECT CAST(CAST('2006-08-10 10:11:12.0123450' AS DATETIME) AS DECIMAL(30,7));
CAST(CAST('2006-08-10 10:11:12.0123450' AS DATETIME) AS DECIMAL(30,7))
20060810101112.0123450
Warnings:
Warning 1292 Truncated incorrect datetime value: '2006-08-10 10:11:12.0123450'
SELECT CAST(CAST('00000002006-000008-0000010 000010:0000011:00000012.0123450' AS DATETIME) AS DECIMAL(30,7));
CAST(CAST('00000002006-000008-0000010 000010:0000011:00000012.0123450' AS DATETIME) AS DECIMAL(30,7))
20060810101112.0123450
Warnings:
Warning 1292 Truncated incorrect datetime value: '00000002006-000008-0000010 000010:0000011:00000012.0123450'
SELECT CAST(CAST('00000002006-000008-0000010 000010:0000011:00000012.012345' AS DATETIME) AS DECIMAL(30,7));
CAST(CAST('00000002006-000008-0000010 000010:0000011:00000012.012345' AS DATETIME) AS DECIMAL(30,7))
20060810101112.0123450
SELECT CAST(CAST('2008-07-29T10:42:51.1234567' AS DateTime) AS DECIMAL(30,7));
CAST(CAST('2008-07-29T10:42:51.1234567' AS DateTime) AS DECIMAL(30,7))
20080729104251.1234560
Warnings:
Warning 1292 Truncated incorrect datetime value: '2008-07-29T10:42:51.1234567'
End of 5.1 tests

View File

@ -385,12 +385,12 @@ Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 2 Warning 1264 Out of range value for column 'f1' at row 2
select f1 + 0e0 from t1; select f1 + 0e0 from t1;
f1 + 0e0 f1 + 0e0
1.0000000150475e+29 1.00000001504747e+29
-1.0000000150475e+29 -1.00000001504747e+29
1.0000000150475e+30 1.00000001504747e+30
-1.0000000150475e+30 -1.00000001504747e+30
1.0000000150475e+30 1.00000001504747e+30
-1.0000000150475e+30 -1.00000001504747e+30
drop table t1; drop table t1;
create table t1(d double, u bigint unsigned); create table t1(d double, u bigint unsigned);
insert into t1(d) values (9.22337203685479e18), insert into t1(d) values (9.22337203685479e18),
@ -401,4 +401,10 @@ u
9223372036854790144 9223372036854790144
18400000000000000000 18400000000000000000
drop table t1; drop table t1;
CREATE TABLE t1 (f1 DOUBLE);
INSERT INTO t1 VALUES(-1.79769313486231e+308);
SELECT f1 FROM t1;
f1
-1.79769313486231e+308
DROP TABLE t1;
End of 5.0 tests End of 5.0 tests

View File

@ -101,13 +101,13 @@ create table t1 (t2 timestamp(2), t4 timestamp(4), t6 timestamp(6),
t8 timestamp(8), t10 timestamp(10), t12 timestamp(12), t8 timestamp(8), t10 timestamp(10), t12 timestamp(12),
t14 timestamp(14)); t14 timestamp(14));
Warnings: Warnings:
Warning 1287 The syntax 'TIMESTAMP(2)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead Warning 1287 The syntax 'TIMESTAMP(2)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
Warning 1287 The syntax 'TIMESTAMP(4)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead Warning 1287 The syntax 'TIMESTAMP(4)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
Warning 1287 The syntax 'TIMESTAMP(6)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead Warning 1287 The syntax 'TIMESTAMP(6)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
Warning 1287 The syntax 'TIMESTAMP(8)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead Warning 1287 The syntax 'TIMESTAMP(8)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
Warning 1287 The syntax 'TIMESTAMP(10)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead Warning 1287 The syntax 'TIMESTAMP(10)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
Warning 1287 The syntax 'TIMESTAMP(12)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead Warning 1287 The syntax 'TIMESTAMP(12)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
Warning 1287 The syntax 'TIMESTAMP(14)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead Warning 1287 The syntax 'TIMESTAMP(14)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
insert t1 values (0,0,0,0,0,0,0), insert t1 values (0,0,0,0,0,0,0),
("1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59", ("1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59",
"1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59",

View File

@ -299,59 +299,107 @@ set @@rand_seed1=10000000,@@rand_seed2=1000000;
select ROUND(RAND(),5); select ROUND(RAND(),5);
ROUND(RAND(),5) ROUND(RAND(),5)
0.02887 0.02887
show variables like '%alloc%';
==+ Testing %alloc% system variables +==
==+ NOTE: These values *must* be a multiple of 1024 +==
==+ Other values will be rounded down to nearest multiple +==
==+ Show initial values +==
SHOW VARIABLES WHERE variable_name IN ('range_alloc_block_size',
'query_alloc_block_size', 'query_prealloc_size',
'transaction_alloc_block_size', 'transaction_prealloc_size');
Variable_name Value Variable_name Value
query_alloc_block_size 8192 query_alloc_block_size 8192
query_prealloc_size 8192 query_prealloc_size 8192
range_alloc_block_size 4096 range_alloc_block_size 4096
transaction_alloc_block_size 8192 transaction_alloc_block_size 8192
transaction_prealloc_size 4096 transaction_prealloc_size 4096
select * from information_schema.session_variables where variable_name like '%alloc%' order by 1; ==+ information_schema data +==
SELECT * FROM information_schema.session_variables
WHERE variable_name IN ('range_alloc_block_size',
'query_alloc_block_size', 'query_prealloc_size',
'transaction_alloc_block_size', 'transaction_prealloc_size') ORDER BY 1;
VARIABLE_NAME VARIABLE_VALUE VARIABLE_NAME VARIABLE_VALUE
QUERY_ALLOC_BLOCK_SIZE 8192 QUERY_ALLOC_BLOCK_SIZE 8192
QUERY_PREALLOC_SIZE 8192 QUERY_PREALLOC_SIZE 8192
RANGE_ALLOC_BLOCK_SIZE 4096 RANGE_ALLOC_BLOCK_SIZE 4096
TRANSACTION_ALLOC_BLOCK_SIZE 8192 TRANSACTION_ALLOC_BLOCK_SIZE 8192
TRANSACTION_PREALLOC_SIZE 4096 TRANSACTION_PREALLOC_SIZE 4096
set @@range_alloc_block_size=1024*16; Testing values that are multiples of 1024
set @@range_alloc_block_size=1024*15+1024;
set @@query_alloc_block_size=1024*15+1024*2;
set @@query_prealloc_size=1024*18-1024;
set @@transaction_alloc_block_size=1024*21-1024*1;
set @@transaction_prealloc_size=1024*21-2048;
==+ Check manipulated values ==+
select @@query_alloc_block_size;
@@query_alloc_block_size
17408
SHOW VARIABLES WHERE variable_name IN ('range_alloc_block_size',
'query_alloc_block_size', 'query_prealloc_size',
'transaction_alloc_block_size', 'transaction_prealloc_size');
Variable_name Value
query_alloc_block_size 17408
query_prealloc_size 17408
range_alloc_block_size 16384
transaction_alloc_block_size 20480
transaction_prealloc_size 19456
==+ information_schema data +==
SELECT * FROM information_schema.session_variables
WHERE variable_name IN ('range_alloc_block_size',
'query_alloc_block_size', 'query_prealloc_size',
'transaction_alloc_block_size', 'transaction_prealloc_size') ORDER BY 1;
VARIABLE_NAME VARIABLE_VALUE
QUERY_ALLOC_BLOCK_SIZE 17408
QUERY_PREALLOC_SIZE 17408
RANGE_ALLOC_BLOCK_SIZE 16384
TRANSACTION_ALLOC_BLOCK_SIZE 20480
TRANSACTION_PREALLOC_SIZE 19456
==+ Manipulate variable values +==
Testing values that are not 1024 multiples
set @@range_alloc_block_size=1024*16+1023;
set @@query_alloc_block_size=1024*17+2; set @@query_alloc_block_size=1024*17+2;
set @@query_prealloc_size=1024*18; set @@query_prealloc_size=1024*18-1023;
set @@transaction_alloc_block_size=1024*20-1; set @@transaction_alloc_block_size=1024*20-1;
set @@transaction_prealloc_size=1024*21-1; set @@transaction_prealloc_size=1024*21-1;
select @@query_alloc_block_size; select @@query_alloc_block_size;
@@query_alloc_block_size @@query_alloc_block_size
17408 17408
show variables like '%alloc%'; ==+ Check manipulated values ==+
SHOW VARIABLES WHERE variable_name IN ('range_alloc_block_size',
'query_alloc_block_size', 'query_prealloc_size',
'transaction_alloc_block_size', 'transaction_prealloc_size');
Variable_name Value Variable_name Value
query_alloc_block_size 17408 query_alloc_block_size 17408
query_prealloc_size 18432 query_prealloc_size 17408
range_alloc_block_size 16384 range_alloc_block_size 16384
transaction_alloc_block_size 19456 transaction_alloc_block_size 19456
transaction_prealloc_size 20480 transaction_prealloc_size 20480
select * from information_schema.session_variables where variable_name like '%alloc%' order by 1; ==+ information_schema data +==
SELECT * FROM information_schema.session_variables
WHERE variable_name IN ('range_alloc_block_size',
'query_alloc_block_size', 'query_prealloc_size',
'transaction_alloc_block_size', 'transaction_prealloc_size') ORDER BY 1;
VARIABLE_NAME VARIABLE_VALUE VARIABLE_NAME VARIABLE_VALUE
QUERY_ALLOC_BLOCK_SIZE 17408 QUERY_ALLOC_BLOCK_SIZE 17408
QUERY_PREALLOC_SIZE 18432 QUERY_PREALLOC_SIZE 17408
RANGE_ALLOC_BLOCK_SIZE 16384 RANGE_ALLOC_BLOCK_SIZE 16384
TRANSACTION_ALLOC_BLOCK_SIZE 19456 TRANSACTION_ALLOC_BLOCK_SIZE 19456
TRANSACTION_PREALLOC_SIZE 20480 TRANSACTION_PREALLOC_SIZE 20480
==+ Set values back to the default values +==
set @@range_alloc_block_size=default; set @@range_alloc_block_size=default;
set @@query_alloc_block_size=default, @@query_prealloc_size=default; set @@query_alloc_block_size=default, @@query_prealloc_size=default;
set transaction_alloc_block_size=default, @@transaction_prealloc_size=default; set transaction_alloc_block_size=default, @@transaction_prealloc_size=default;
show variables like '%alloc%'; ==+ Check the values now that they are reset +==
SHOW VARIABLES WHERE variable_name IN ('range_alloc_block_size',
'query_alloc_block_size', 'query_prealloc_size',
'transaction_alloc_block_size', 'transaction_prealloc_size');
Variable_name Value Variable_name Value
query_alloc_block_size 8192 query_alloc_block_size 8192
query_prealloc_size 8192 query_prealloc_size 8192
range_alloc_block_size 4096 range_alloc_block_size 4096
transaction_alloc_block_size 8192 transaction_alloc_block_size 8192
transaction_prealloc_size 4096 transaction_prealloc_size 4096
select * from information_schema.session_variables where variable_name like '%alloc%' order by 1;
VARIABLE_NAME VARIABLE_VALUE
QUERY_ALLOC_BLOCK_SIZE 8192
QUERY_PREALLOC_SIZE 8192
RANGE_ALLOC_BLOCK_SIZE 4096
TRANSACTION_ALLOC_BLOCK_SIZE 8192
TRANSACTION_PREALLOC_SIZE 4096
SELECT @@version LIKE 'non-existent'; SELECT @@version LIKE 'non-existent';
@@version LIKE 'non-existent' @@version LIKE 'non-existent'
0 0
@ -705,7 +753,7 @@ VARIABLE_NAME VARIABLE_VALUE
MYISAM_DATA_POINTER_SIZE 7 MYISAM_DATA_POINTER_SIZE 7
SET GLOBAL table_open_cache=-1; SET GLOBAL table_open_cache=-1;
Warnings: Warnings:
Warning 1292 Truncated incorrect table_open_cache value: '0' Warning 1292 Truncated incorrect table_open_cache value: '-1'
SHOW VARIABLES LIKE 'table_open_cache'; SHOW VARIABLES LIKE 'table_open_cache';
Variable_name Value Variable_name Value
table_open_cache 1 table_open_cache 1
@ -1341,3 +1389,75 @@ SET @@session.thread_stack= 7;
ERROR HY000: Variable 'thread_stack' is a read only variable ERROR HY000: Variable 'thread_stack' is a read only variable
SET @@global.thread_stack= 7; SET @@global.thread_stack= 7;
ERROR HY000: Variable 'thread_stack' is a read only variable ERROR HY000: Variable 'thread_stack' is a read only variable
SELECT @@global.expire_logs_days INTO @old_eld;
SET GLOBAL expire_logs_days = -1;
Warnings:
Warning 1292 Truncated incorrect expire_logs_days value: '-1'
needs to've been adjusted (0)
SELECT @@global.expire_logs_days;
@@global.expire_logs_days
0
SET GLOBAL expire_logs_days = 11;
SET @old_mode=@@sql_mode;
SET SESSION sql_mode = 'TRADITIONAL';
SET GLOBAL expire_logs_days = 100;
ERROR 42000: Variable 'expire_logs_days' can't be set to the value of '100'
needs to be unchanged (11)
SELECT @@global.expire_logs_days;
@@global.expire_logs_days
11
SET SESSION sql_mode = @old_mode;
SET GLOBAL expire_logs_days = 100;
Warnings:
Warning 1292 Truncated incorrect expire_logs_days value: '100'
needs to've been adjusted (99)
SELECT @@global.expire_logs_days;
@@global.expire_logs_days
99
SET GLOBAL expire_logs_days = 11;
SET GLOBAL expire_logs_days = 99;
needs to pass with no warnings (99)
SELECT @@global.expire_logs_days;
@@global.expire_logs_days
99
SET GLOBAL expire_logs_days = @old_eld;
SET GLOBAL auto_increment_offset=-1;
Warnings:
Warning 1292 Truncated incorrect auto_increment_offset value: '-1'
SET GLOBAL auto_increment_offset=0;
Warnings:
Warning 1292 Truncated incorrect auto_increment_offset value: '0'
select @@storage_engine;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def @@storage_engine 253 6 6 N 1 31 8
@@storage_engine
MyISAM
SET @old_server_id = @@GLOBAL.server_id;
SET GLOBAL server_id = (1 << 32) - 1;
SELECT @@GLOBAL.server_id;
@@GLOBAL.server_id
4294967295
SET GLOBAL server_id = (1 << 32);
Warnings:
Warning 1292 Truncated incorrect server_id value: '4294967296'
SELECT @@GLOBAL.server_id;
@@GLOBAL.server_id
4294967295
SET GLOBAL server_id = (1 << 60);
Warnings:
Warning 1292 Truncated incorrect server_id value: '1152921504606846976'
SELECT @@GLOBAL.server_id;
@@GLOBAL.server_id
4294967295
SET GLOBAL server_id = 0;
SELECT @@GLOBAL.server_id;
@@GLOBAL.server_id
0
SET GLOBAL server_id = -1;
Warnings:
Warning 1292 Truncated incorrect server_id value: '-1'
SELECT @@GLOBAL.server_id;
@@GLOBAL.server_id
0
SET GLOBAL server_id = @old_server_id;
End of 5.1 tests

View File

@ -3598,7 +3598,7 @@ DROP VIEW v2;
DROP VIEW v3; DROP VIEW v3;
DROP TABLE t1; DROP TABLE t1;
# #
# Bug#29477: Not all fields of the target table were checked to have # Bug#29477 Not all fields of the target table were checked to have
# a default value when inserting into a view. # a default value when inserting into a view.
# #
create table t1(f1 int, f2 int not null); create table t1(f1 int, f2 int not null);
@ -3638,7 +3638,7 @@ MAX(a) COUNT(DISTINCT a)
DROP VIEW v1; DROP VIEW v1;
DROP TABLE t1; DROP TABLE t1;
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# -- Bug#34337: Server crash when Altering a view using a table name. # -- Bug#34337 Server crash when Altering a view using a table name.
# ----------------------------------------------------------------- # -----------------------------------------------------------------
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
@ -3655,7 +3655,7 @@ DROP TABLE t1;
# -- End of test case for Bug#34337. # -- End of test case for Bug#34337.
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# -- Bug#35193: VIEW query is rewritten without "FROM DUAL", # -- Bug#35193 VIEW query is rewritten without "FROM DUAL",
# -- causing syntax error # -- causing syntax error
# ----------------------------------------------------------------- # -----------------------------------------------------------------
@ -3723,7 +3723,7 @@ DROP DATABASE `d-1`;
USE test; USE test;
# #
# Bug#26676: VIEW using old table schema in a session. # Bug#26676 VIEW using old table schema in a session.
# #
DROP VIEW IF EXISTS v1; DROP VIEW IF EXISTS v1;
@ -3765,7 +3765,7 @@ DROP TABLE t1;
# End of test case for Bug#26676. # End of test case for Bug#26676.
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# -- Bug#32538: View definition picks up character set, but not collation # -- Bug#32538 View definition picks up character set, but not collation
# ----------------------------------------------------------------- # -----------------------------------------------------------------
DROP VIEW IF EXISTS v1; DROP VIEW IF EXISTS v1;

View File

@ -28,7 +28,7 @@ create view v2 as select * from mysqltest.t2;
ERROR 42000: ANY command denied to user 'mysqltest_1'@'localhost' for table 't2' ERROR 42000: ANY command denied to user 'mysqltest_1'@'localhost' for table 't2'
show create view v1; show create view v1;
View Create View character_set_client collation_connection View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_1`@`localhost` SQL SECURITY DEFINER VIEW `test`.`v1` AS select `mysqltest`.`t1`.`a` AS `a`,`mysqltest`.`t1`.`b` AS `b` from `mysqltest`.`t1` latin1 latin1_swedish_ci v1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_1`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `mysqltest`.`t1`.`a` AS `a`,`mysqltest`.`t1`.`b` AS `b` from `mysqltest`.`t1` latin1 latin1_swedish_ci
grant create view,drop,select on test.* to mysqltest_1@localhost; grant create view,drop,select on test.* to mysqltest_1@localhost;
use test; use test;
alter view v1 as select * from mysqltest.t1; alter view v1 as select * from mysqltest.t1;
@ -309,7 +309,7 @@ grant create view,select on test.* to mysqltest_1@localhost;
create view v1 as select * from mysqltest.t1; create view v1 as select * from mysqltest.t1;
show create view v1; show create view v1;
View Create View character_set_client collation_connection View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_1`@`localhost` SQL SECURITY DEFINER VIEW `test`.`v1` AS select `mysqltest`.`t1`.`a` AS `a`,`mysqltest`.`t1`.`b` AS `b` from `mysqltest`.`t1` latin1 latin1_swedish_ci v1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_1`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `mysqltest`.`t1`.`a` AS `a`,`mysqltest`.`t1`.`b` AS `b` from `mysqltest`.`t1` latin1 latin1_swedish_ci
revoke select on mysqltest.t1 from mysqltest_1@localhost; revoke select on mysqltest.t1 from mysqltest_1@localhost;
select * from v1; select * from v1;
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 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
@ -790,7 +790,7 @@ v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
DROP USER u26813@localhost; DROP USER u26813@localhost;
DROP DATABASE db26813; DROP DATABASE db26813;
# #
# Bug#29908: A user can gain additional access through the ALTER VIEW. # Bug#29908 A user can gain additional access through the ALTER VIEW.
# #
CREATE DATABASE mysqltest_29908; CREATE DATABASE mysqltest_29908;
USE mysqltest_29908; USE mysqltest_29908;
@ -921,6 +921,32 @@ c4
DROP DATABASE mysqltest1; DROP DATABASE mysqltest1;
DROP DATABASE mysqltest2; DROP DATABASE mysqltest2;
DROP USER mysqltest_u1@localhost; DROP USER mysqltest_u1@localhost;
CREATE DATABASE db1;
USE db1;
CREATE TABLE t1(f1 INT, f2 INT);
CREATE VIEW v1 AS SELECT f1, f2 FROM t1;
GRANT SELECT (f1) ON t1 TO foo;
GRANT SELECT (f1) ON v1 TO foo;
USE db1;
SELECT f1 FROM t1;
f1
SELECT f2 FROM t1;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for column 'f2' in table 't1'
SELECT * FROM t1;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 't1'
SELECT f1 FROM v1;
f1
SELECT f2 FROM v1;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for column 'f2' in table 'v1'
SELECT * FROM v1;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'v1'
USE test;
REVOKE SELECT (f1) ON db1.t1 FROM foo;
REVOKE SELECT (f1) ON db1.v1 FROM foo;
DROP USER foo;
DROP VIEW db1.v1;
DROP TABLE db1.t1;
DROP DATABASE db1;
End of 5.0 tests. End of 5.0 tests.
DROP VIEW IF EXISTS v1; DROP VIEW IF EXISTS v1;
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
@ -956,6 +982,27 @@ Warnings:
Warning 1356 View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them Warning 1356 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 VIEW v1;
DROP TABLE t1; DROP TABLE t1;
CREATE USER mysqluser1@localhost;
CREATE DATABASE mysqltest1;
USE mysqltest1;
CREATE TABLE t1 ( a INT );
CREATE TABLE t2 ( b INT );
INSERT INTO t1 VALUES (1), (2);
INSERT INTO t2 VALUES (1), (2);
GRANT CREATE VIEW ON mysqltest1.* TO mysqluser1@localhost;
GRANT SELECT ON t1 TO mysqluser1@localhost;
GRANT INSERT ON t2 TO mysqluser1@localhost;
This would lead to failed assertion.
CREATE VIEW v1 AS SELECT a, b FROM t1, t2;
SELECT * FROM v1;
ERROR 42000: SELECT command denied to user 'mysqluser1'@'localhost' for table 'v1'
SELECT b FROM v1;
ERROR 42000: SELECT command denied to user 'mysqluser1'@'localhost' for table 'v1'
DROP TABLE t1, t2;
DROP VIEW v1;
DROP DATABASE mysqltest1;
DROP USER mysqluser1@localhost;
USE test;
End of 5.1 tests. End of 5.1 tests.
CREATE USER mysqluser1@localhost; CREATE USER mysqluser1@localhost;
CREATE DATABASE mysqltest1; CREATE DATABASE mysqltest1;
@ -996,3 +1043,4 @@ DROP VIEW v1, v2;
DROP DATABASE mysqltest1; DROP DATABASE mysqltest1;
DROP VIEW test.v3; DROP VIEW test.v3;
DROP USER mysqluser1@localhost; DROP USER mysqluser1@localhost;
USE test;

View File

@ -168,7 +168,7 @@ max_error_count 10
drop table t1; drop table t1;
set table_type=MYISAM; set table_type=MYISAM;
Warnings: Warnings:
Warning 1287 The syntax '@@table_type' is deprecated and will be removed in MySQL 5.2. Please use '@@storage_engine' instead Warning 1287 The syntax '@@table_type' is deprecated and will be removed in MySQL 6.0. Please use '@@storage_engine' instead
create table t1 (a int); create table t1 (a int);
insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
update t1 set a='abc'; update t1 set a='abc';

View File

@ -19,6 +19,24 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used 2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
DROP TABLE t1; DROP TABLE t1;
CREATE DATABASE `TESTDB`;
USE `TESTDB`;
CREATE FUNCTION test_fn() RETURNS INTEGER
BEGIN
DECLARE rId bigint;
RETURN rId;
END
//
CREATE FUNCTION test_fn2() RETURNS INTEGER
BEGIN
DECLARE rId bigint;
RETURN rId;
END
//
DROP FUNCTION `TESTDB`.`test_fn`;
DROP FUNCTION `testdb`.`test_fn2`;
USE test;
DROP DATABASE `TESTDB`;
End of 5.0 tests. End of 5.0 tests.
drop procedure if exists proc_1; drop procedure if exists proc_1;
create procedure proc_1() install plugin my_plug soname '\\root\\some_plugin.dll'; create procedure proc_1() install plugin my_plug soname '\\root\\some_plugin.dll';

View File

@ -0,0 +1,46 @@
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;
SET @old_sql_mode= @@global.sql_mode;
SET @old_binlog_format=@@session.binlog_format;
SET SESSION sql_mode=8;
Initialization
RESET MASTER;
CREATE TABLE t1 (id INT);
CREATE PROCEDURE testProc() SELECT * FROM t1;
CREATE VIEW testView as SELECT * from t1;
CREATE FUNCTION testFunc()
RETURNS INT
BEGIN
return 1;
END;|
CREATE TRIGGER testTrig BEFORE INSERT ON t1
FOR EACH ROW BEGIN
UPDATE t1 SET id = id +1;
END;|
CREATE EVENT testEvent ON SCHEDULE
EVERY 1 DAY
DO
BEGIN
UPDATE t1 SET id = id +1;
END;|
Chceck Result
select
(@a:=load_file("MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug39526.binlog"))
is not null;
(@a:=load_file("MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug39526.binlog"))
is not null
1
*** String sql_mode=0 is found: 0 ***
Clean Up
DROP PROCEDURE testProc;
DROP FUNCTION testFunc;
DROP TRIGGER testTrig;
DROP EVENT testEvent;
DROP VIEW testView;
DROP TABLE t1;
SET @@global.sql_mode= @old_sql_mode;
SET @@session.binlog_format=@old_binlog_format;

View File

@ -227,3 +227,86 @@ UPDATE t1 SET b = '%s%s%s%s%s%s%s%s%s%s%s%s%s%s' WHERE a = 'a' LIMIT 1;
Warnings: Warnings:
Warning 1592 Statement is not safe to log in statement format. Warning 1592 Statement is not safe to log in statement format.
DROP TABLE t1; DROP TABLE t1;
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1(i INT PRIMARY KEY);
CREATE TABLE t2(i INT PRIMARY KEY);
CREATE TABLE t3(i INT, ch CHAR(50));
"Should issue message Statement is not safe to log in statement format."
INSERT INTO t1 SELECT * FROM t2 LIMIT 1;
Warnings:
Warning 1592 Statement is not safe to log in statement format.
CREATE FUNCTION func6()
RETURNS INT
BEGIN
INSERT INTO t1 VALUES (10);
INSERT INTO t1 VALUES (11);
INSERT INTO t1 VALUES (12);
RETURN 0;
END|
"Should issue message Statement is not safe to log in statement format only once"
INSERT INTO t3 VALUES(func6(), UUID());
Warnings:
Warning 1592 Statement is not safe to log in statement format.
"Check whether SET @@SQL_LOG_BIN = 0/1 doesn't work in substatements"
CREATE FUNCTION fun_check_log_bin() RETURNS INT
BEGIN
SET @@SQL_LOG_BIN = 0;
INSERT INTO t1 VALUES(@@global.sync_binlog);
RETURN 100;
END|
"One unsafe warning should be issued in the following statement"
SELECT fun_check_log_bin();
fun_check_log_bin()
100
Warnings:
Warning 1592 Statement is not safe to log in statement format.
"SQL_LOG_BIN should be ON still"
SHOW VARIABLES LIKE "SQL_LOG_BIN";
Variable_name Value
sql_log_bin ON
set @save_log_bin = @@SESSION.SQL_LOG_BIN;
set @@SESSION.SQL_LOG_BIN = 0;
"Should NOT have any warning message issued in the following statements"
INSERT INTO t1 SELECT * FROM t2 LIMIT 1;
DROP TABLE t1,t2;
"Should NOT have any warning message issued in the following func7() and trig"
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (a CHAR(40));
CREATE TABLE trigger_table (a CHAR(7));
CREATE FUNCTION func7()
RETURNS INT
BEGIN
INSERT INTO t1 VALUES (@@global.sync_binlog);
INSERT INTO t1 VALUES (@@session.insert_id);
INSERT INTO t2 SELECT UUID();
INSERT INTO t2 VALUES (@@session.sql_mode);
INSERT INTO t2 VALUES (@@global.init_slave);
RETURN 0;
END|
SHOW VARIABLES LIKE "SQL_LOG_BIN";
Variable_name Value
sql_log_bin OFF
SELECT func7();
func7()
0
---- Insert from trigger ----
CREATE TRIGGER trig
BEFORE INSERT ON trigger_table
FOR EACH ROW
BEGIN
INSERT INTO t1 VALUES (@@global.sync_binlog);
INSERT INTO t1 VALUES (@@session.insert_id);
INSERT INTO t1 VALUES (@@global.auto_increment_increment);
INSERT INTO t2 SELECT UUID();
INSERT INTO t2 VALUES (@@session.sql_mode);
INSERT INTO t2 VALUES (@@global.init_slave);
INSERT INTO t2 VALUES (@@hostname);
END|
INSERT INTO trigger_table VALUES ('bye.');
DROP FUNCTION fun_check_log_bin;
DROP FUNCTION func6;
DROP FUNCTION func7;
DROP TRIGGER trig;
DROP TABLE t1, t2, t3, trigger_table;
set @@SESSION.SQL_LOG_BIN = @save_log_bin;
"End of tests"

View File

@ -0,0 +1,76 @@
# ==== Purpose ====
#
# Test that sql_mode can correct restore before generating the binlog event
# when creating CREATEable objects.
#
# ==== Method ====
#
# Scan binlog file to check if the sql_mode is still set to 0 before generating binlog event
#
-- source include/master-slave.inc
-- source include/have_log_bin.inc
# BUG#39526 sql_mode not retained in binary log for CREATE PROCEDURE
SET @old_sql_mode= @@global.sql_mode;
SET @old_binlog_format=@@session.binlog_format;
let $MYSQLD_DATADIR= `select @@datadir`;
SET SESSION sql_mode=8;
--echo Initialization
RESET MASTER;
CREATE TABLE t1 (id INT);
CREATE PROCEDURE testProc() SELECT * FROM t1;
CREATE VIEW testView as SELECT * from t1;
DELIMITER |;
CREATE FUNCTION testFunc()
RETURNS INT
BEGIN
return 1;
END;|
DELIMITER ;|
DELIMITER |;
CREATE TRIGGER testTrig BEFORE INSERT ON t1
FOR EACH ROW BEGIN
UPDATE t1 SET id = id +1;
END;|
DELIMITER ;|
DELIMITER |;
CREATE EVENT testEvent ON SCHEDULE
EVERY 1 DAY
DO
BEGIN
UPDATE t1 SET id = id +1;
END;|
DELIMITER ;|
--echo Chceck Result
let $MYSQLD_DATADIR= `select @@datadir`;
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug39526.binlog
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
eval select
(@a:=load_file("$MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug39526.binlog"))
is not null;
let $s_mode_unsigned= `select @a like "%@@session.sql_mode=0%" /* must return 0 */`;
echo *** String sql_mode=0 is found: $s_mode_unsigned ***;
--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_bug39526.binlog
--echo Clean Up
DROP PROCEDURE testProc;
DROP FUNCTION testFunc;
DROP TRIGGER testTrig;
DROP EVENT testEvent;
DROP VIEW testView;
DROP TABLE t1;
SET @@global.sql_mode= @old_sql_mode;
SET @@session.binlog_format=@old_binlog_format;

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