Commit 6892d965 authored by Joerg Bruehe's avatar Joerg Bruehe

Merge from main 5.1 to 5.1-build

parents c3b3d621 81e7bd86
#! /bin/sh
path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$pentium_cflags $debug_cflags $valgrind_flags"
extra_configs="$pentium_configs $debug_configs $max_no_ndb_configs"
. "$path/FINISH.sh"
if test -z "$just_print"
then
set +v +x
echo "\
******************************************************************************
Note that by default BUILD/compile-pentium-valgrind-max calls 'configure' with
--enable-assembler. When Valgrind detects an error involving an assembly
function (for example an uninitialized value used as an argument of an
assembly function), Valgrind will not print the stacktrace and 'valgrind
--gdb-attach=yes' will not work either. If you need a stacktrace in those
cases, you have to run BUILD/compile-pentium-valgrind-max with the
--disable-assembler argument.
******************************************************************************"
fi
...@@ -149,7 +149,7 @@ test-bt: ...@@ -149,7 +149,7 @@ test-bt:
echo "no program found for 'ndbcluster' tests - skipped testing" ; \ echo "no program found for 'ndbcluster' tests - skipped testing" ; \
fi fi
-cd mysql-test ; MTR_BUILD_THREAD=auto \ -cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --force --comment=funcs1+ps --ps-protocol --suite=funcs_1 @PERL@ ./mysql-test-run.pl --force --comment=funcs1+ps --ps-protocol --reorder --suite=funcs_1
-cd mysql-test ; MTR_BUILD_THREAD=auto \ -cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --force --comment=funcs2 --suite=funcs_2 @PERL@ ./mysql-test-run.pl --force --comment=funcs2 --suite=funcs_2
-cd mysql-test ; MTR_BUILD_THREAD=auto \ -cd mysql-test ; MTR_BUILD_THREAD=auto \
...@@ -190,7 +190,7 @@ test-force-full-pl: test-force-full ...@@ -190,7 +190,7 @@ test-force-full-pl: test-force-full
test-ext-funcs: test-ext-funcs:
cd mysql-test ; \ cd mysql-test ; \
@PERL@ ./mysql-test-run.pl --force --suite=funcs_1 ; \ @PERL@ ./mysql-test-run.pl --force --reorder --suite=funcs_1 ; \
@PERL@ ./mysql-test-run.pl --force --suite=funcs_2 @PERL@ ./mysql-test-run.pl --force --suite=funcs_2
test-ext-rpl: test-ext-rpl:
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake") INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
# We use the "mysqlclient_notls" library here just as safety, in case # We use the "mysqlclient_notls" library here just as safety, in case
# any of the clients here would go beond the client API and access the # any of the clients here would go beyond the client API and access the
# Thread Local Storage directly. # Thread Local Storage directly.
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX") SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
...@@ -32,9 +32,9 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ...@@ -32,9 +32,9 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
ADD_EXECUTABLE(mysql completion_hash.cc mysql.cc readline.cc sql_string.cc ../mysys/my_conio.c) ADD_EXECUTABLE(mysql completion_hash.cc mysql.cc readline.cc sql_string.cc ../mysys/my_conio.c)
TARGET_LINK_LIBRARIES(mysql mysqlclient_notls wsock32) TARGET_LINK_LIBRARIES(mysql mysqlclient_notls wsock32)
ADD_EXECUTABLE(mysqltest mysqltest.c ../mysys/my_getsystime.c ADD_EXECUTABLE(mysqltest mysqltest.c)
../mysys/my_copy.c ../mysys/my_mkdir.c) SET_SOURCE_FILES_PROPERTIES(mysqltest.c PROPERTIES COMPILE_FLAGS "-DTHREADS")
TARGET_LINK_LIBRARIES(mysqltest mysqlclient_notls regex wsock32) TARGET_LINK_LIBRARIES(mysqltest mysqlclient mysys regex wsock32 dbug)
ADD_EXECUTABLE(mysqlcheck mysqlcheck.c) ADD_EXECUTABLE(mysqlcheck mysqlcheck.c)
TARGET_LINK_LIBRARIES(mysqlcheck mysqlclient_notls wsock32) TARGET_LINK_LIBRARIES(mysqlcheck mysqlclient_notls wsock32)
......
...@@ -86,11 +86,13 @@ mysqlslap_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \ ...@@ -86,11 +86,13 @@ mysqlslap_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \
$(LIBMYSQLCLIENT_LA) \ $(LIBMYSQLCLIENT_LA) \
$(top_builddir)/mysys/libmysys.a $(top_builddir)/mysys/libmysys.a
mysqltest_SOURCES= mysqltest.c \ mysqltest_SOURCES= mysqltest.c
$(top_srcdir)/mysys/my_getsystime.c \ mysqltest_CFLAGS= -DTHREAD -UUNDEF_THREADS_HACK
$(top_srcdir)/mysys/my_copy.c \ mysqltest_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \
$(top_srcdir)/mysys/my_mkdir.c @CLIENT_EXTRA_LDFLAGS@ \
mysqltest_LDADD = $(top_builddir)/regex/libregex.a $(LDADD) $(LIBMYSQLCLIENT_LA) \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/regex/libregex.a
mysql_upgrade_SOURCES= mysql_upgrade.c \ mysql_upgrade_SOURCES= mysql_upgrade.c \
$(top_srcdir)/mysys/my_getpagesize.c $(top_srcdir)/mysys/my_getpagesize.c
......
...@@ -2145,7 +2145,14 @@ static bool add_line(String &buffer,char *line,char *in_string, ...@@ -2145,7 +2145,14 @@ static bool add_line(String &buffer,char *line,char *in_string,
} }
else if (!*ml_comment && (!*in_string && (inchar == '#' || else if (!*ml_comment && (!*in_string && (inchar == '#' ||
inchar == '-' && pos[1] == '-' && inchar == '-' && pos[1] == '-' &&
my_isspace(charset_info,pos[2])))) /*
The third byte is either whitespace or is the
end of the line -- which would occur only
because of the user sending newline -- which is
itself whitespace and should also match.
*/
(my_isspace(charset_info,pos[2]) ||
!pos[2]))))
{ {
// Flush previously accepted characters // Flush previously accepted characters
if (out != line) if (out != line)
......
...@@ -48,7 +48,15 @@ ...@@ -48,7 +48,15 @@
#ifdef __WIN__ #ifdef __WIN__
#include <direct.h> #include <direct.h>
#endif #endif
#include <signal.h>
#include <my_stacktrace.h>
#ifdef __WIN__
#include <crtdbg.h>
#define SIGNAL_FMT "exception 0x%x"
#else
#define SIGNAL_FMT "signal %d"
#endif
/* Use cygwin for --exec and --system before 5.0 */ /* Use cygwin for --exec and --system before 5.0 */
#if MYSQL_VERSION_ID < 50000 #if MYSQL_VERSION_ID < 50000
...@@ -214,6 +222,7 @@ struct st_connection ...@@ -214,6 +222,7 @@ struct st_connection
/* Used when creating views and sp, to avoid implicit commit */ /* Used when creating views and sp, to avoid implicit commit */
MYSQL* util_mysql; MYSQL* util_mysql;
char *name; char *name;
size_t name_len;
MYSQL_STMT* stmt; MYSQL_STMT* stmt;
#ifdef EMBEDDED_LIBRARY #ifdef EMBEDDED_LIBRARY
...@@ -4436,6 +4445,7 @@ void do_connect(struct st_command *command) ...@@ -4436,6 +4445,7 @@ void do_connect(struct st_command *command)
ds_connection_name.str)); ds_connection_name.str));
if (!(con_slot->name= my_strdup(ds_connection_name.str, MYF(MY_WME)))) if (!(con_slot->name= my_strdup(ds_connection_name.str, MYF(MY_WME))))
die("Out of memory"); die("Out of memory");
con_slot->name_len= strlen(con_slot->name);
cur_con= con_slot; cur_con= con_slot;
if (con_slot == next_con) if (con_slot == next_con)
...@@ -6838,6 +6848,104 @@ void mark_progress(struct st_command* command __attribute__((unused)), ...@@ -6838,6 +6848,104 @@ void mark_progress(struct st_command* command __attribute__((unused)),
} }
#ifdef HAVE_STACKTRACE
static void dump_backtrace(void)
{
struct st_connection *conn= cur_con;
my_safe_print_str("read_command_buf", read_command_buf,
sizeof(read_command_buf));
if (conn)
{
my_safe_print_str("conn->name", conn->name, conn->name_len);
#ifdef EMBEDDED_LIBRARY
my_safe_print_str("conn->cur_query", conn->cur_query, conn->cur_query_len);
#endif
}
fputs("Attempting backtrace...\n", stderr);
my_print_stacktrace(NULL, my_thread_stack_size);
}
#else
static void dump_backtrace(void)
{
fputs("Backtrace not available.\n", stderr);
}
#endif
static sig_handler signal_handler(int sig)
{
fprintf(stderr, "mysqltest got " SIGNAL_FMT "\n", sig);
dump_backtrace();
}
#ifdef __WIN__
LONG WINAPI exception_filter(EXCEPTION_POINTERS *exp)
{
__try
{
my_set_exception_pointers(exp);
signal_handler(exp->ExceptionRecord->ExceptionCode);
}
__except(EXCEPTION_EXECUTE_HANDLER)
{
fputs("Got exception in exception handler!\n", stderr);
}
return EXCEPTION_CONTINUE_SEARCH;
}
static void init_signal_handling(void)
{
UINT mode;
/* Set output destination of messages to the standard error stream. */
_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
_CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR);
_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE);
_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR);
_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE);
_CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);
/* Do not not display the a error message box. */
mode= SetErrorMode(0) | SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX;
SetErrorMode(mode);
SetUnhandledExceptionFilter(exception_filter);
}
#else /* __WIN__ */
static void init_signal_handling(void)
{
struct sigaction sa;
DBUG_ENTER("init_signal_handling");
#ifdef HAVE_STACKTRACE
my_init_stacktrace();
#endif
sa.sa_flags = SA_RESETHAND | SA_NODEFER;
sigemptyset(&sa.sa_mask);
sigprocmask(SIG_SETMASK, &sa.sa_mask, NULL);
sa.sa_handler= signal_handler;
sigaction(SIGSEGV, &sa, NULL);
sigaction(SIGABRT, &sa, NULL);
#ifdef SIGBUS
sigaction(SIGBUS, &sa, NULL);
#endif
sigaction(SIGILL, &sa, NULL);
sigaction(SIGFPE, &sa, NULL);
}
#endif /* !__WIN__ */
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
...@@ -6851,6 +6959,8 @@ int main(int argc, char **argv) ...@@ -6851,6 +6959,8 @@ int main(int argc, char **argv)
save_file[0]= 0; save_file[0]= 0;
TMPDIR[0]= 0; TMPDIR[0]= 0;
init_signal_handling();
/* Init expected errors */ /* Init expected errors */
memset(&saved_expected_errors, 0, sizeof(saved_expected_errors)); memset(&saved_expected_errors, 0, sizeof(saved_expected_errors));
......
...@@ -2341,10 +2341,31 @@ then ...@@ -2341,10 +2341,31 @@ then
fi fi
AC_MSG_RESULT("$netinet_inc") AC_MSG_RESULT("$netinet_inc")
AC_CACHE_CHECK([support for weak symbols], mysql_cv_weak_symbol,
[AC_TRY_LINK([],[
extern void __attribute__((weak)) foo(void);
], [mysql_cv_weak_symbol=yes], [mysql_cv_weak_symbol=no])])
if test "x$mysql_cv_weak_symbol" = xyes; then
AC_DEFINE(HAVE_WEAK_SYMBOL, 1,
[Define to 1 if compiler supports weak symbol attribute.])
fi
AC_CACHE_CHECK([whether __bss_start is defined], mysql_cv_bss_start,
[AC_TRY_LINK([],[
extern char *__bss_start;
return __bss_start ? 1 : 0;
], [mysql_cv_bss_start=yes], [mysql_cv_bss_start=no])])
if test "x$mysql_cv_bss_start" = xyes; then
AC_DEFINE(HAVE_BSS_START, 1,
[Define to 1 if compiler defines __bss_start.])
fi
AC_LANG_SAVE AC_LANG_SAVE
AC_LANG_CPLUSPLUS AC_LANG_CPLUSPLUS
AC_CHECK_HEADERS(cxxabi.h) AC_CHECK_HEADERS(cxxabi.h)
AC_CACHE_CHECK([checking for abi::__cxa_demangle], mysql_cv_cxa_demangle, AC_CACHE_CHECK([for abi::__cxa_demangle], mysql_cv_cxa_demangle,
[AC_TRY_LINK([#include <cxxabi.h>], [ [AC_TRY_LINK([#include <cxxabi.h>], [
char *foo= 0; int bar= 0; char *foo= 0; int bar= 0;
foo= abi::__cxa_demangle(foo, foo, 0, &bar); foo= abi::__cxa_demangle(foo, foo, 0, &bar);
......
...@@ -36,7 +36,7 @@ noinst_HEADERS = config-win.h config-netware.h my_bit.h \ ...@@ -36,7 +36,7 @@ noinst_HEADERS = config-win.h config-netware.h my_bit.h \
mysql_version.h.in my_handler.h my_time.h \ mysql_version.h.in my_handler.h my_time.h \
my_vle.h my_user.h my_atomic.h atomic/nolock.h \ my_vle.h my_user.h my_atomic.h atomic/nolock.h \
atomic/rwlock.h atomic/x86-gcc.h atomic/x86-msvc.h \ atomic/rwlock.h atomic/x86-gcc.h atomic/x86-msvc.h \
atomic/gcc_builtins.h my_libwrap.h atomic/gcc_builtins.h my_libwrap.h my_stacktrace.h
# Remove built files and the symlinked directories # Remove built files and the symlinked directories
CLEANFILES = $(BUILT_SOURCES) readline openssl CLEANFILES = $(BUILT_SOURCES) readline openssl
......
...@@ -13,57 +13,54 @@ ...@@ -13,57 +13,54 @@
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 */
#ifdef __cplusplus #ifndef _my_stacktrace_h_
extern "C" { #define _my_stacktrace_h_
#endif
#if HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS && HAVE_CXXABI_H && HAVE_ABI_CXA_DEMANGLE #include <my_global.h>
#define BACKTRACE_DEMANGLE 1
#endif
#if BACKTRACE_DEMANGLE #ifdef TARGET_OS_LINUX
char *my_demangle(const char *mangled_name, int *status); #if defined (__x86_64__) || defined (__i386__) || \
(defined(__alpha__) && defined(__GNUC__))
#define HAVE_STACKTRACE 1
#endif
#elif defined(__WIN__)
#define HAVE_STACKTRACE 1
#endif #endif
#ifdef TARGET_OS_LINUX #if HAVE_BACKTRACE && (HAVE_BACKTRACE_SYMBOLS || HAVE_BACKTRACE_SYMBOLS_FD)
#if defined(HAVE_STACKTRACE) || (defined (__x86_64__) || defined (__i386__) || (defined(__alpha__) && defined(__GNUC__)))
#undef HAVE_STACKTRACE #undef HAVE_STACKTRACE
#define HAVE_STACKTRACE #define HAVE_STACKTRACE 1
#endif
extern char* __bss_start;
extern char* heap_start;
#define init_stacktrace() do { \ #if !defined(__NETWARE__)
heap_start = (char*) &__bss_start; \ #define HAVE_WRITE_CORE
} while(0);
void check_thread_lib(void);
#endif /* defined (__i386__) || (defined(__alpha__) && defined(__GNUC__))) */
#elif defined (__WIN__)
#define HAVE_STACKTRACE
extern void set_exception_pointers(EXCEPTION_POINTERS *ep);
#define init_stacktrace() {}
#endif #endif
#ifdef HAVE_STACKTRACE #if HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS && \
void print_stacktrace(uchar* stack_bottom, ulong thread_stack); HAVE_CXXABI_H && HAVE_ABI_CXA_DEMANGLE && \
void safe_print_str(const char* name, const char* val, int max_len); HAVE_WEAK_SYMBOL
#else #define BACKTRACE_DEMANGLE 1
/* Define empty prototypes for functions that are not implemented */ #endif
#define init_stacktrace() {}
#define print_stacktrace(A,B) {}
#define safe_print_str(A,B,C) {}
#endif /* HAVE_STACKTRACE */
C_MODE_START
#if !defined(__NETWARE__) #if defined(HAVE_STACKTRACE) || defined(HAVE_BACKTRACE)
#define HAVE_WRITE_CORE void my_init_stacktrace();
void my_print_stacktrace(uchar* stack_bottom, ulong thread_stack);
void my_safe_print_str(const char* name, const char* val, int max_len);
void my_write_core(int sig);
#if BACKTRACE_DEMANGLE
char *my_demangle(const char *mangled_name, int *status);
#endif
#ifdef __WIN__
void my_set_exception_pointers(EXCEPTION_POINTERS *ep);
#endif
#endif #endif
#ifdef HAVE_WRITE_CORE #ifdef HAVE_WRITE_CORE
void write_core(int sig); void my_write_core(int sig);
#endif #endif
C_MODE_END
#ifdef __cplusplus #endif /* _my_stacktrace_h_ */
}
#endif
...@@ -185,8 +185,7 @@ SET(LIBMYSQLD_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc ...@@ -185,8 +185,7 @@ SET(LIBMYSQLD_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc
../sql/strfunc.cc ../sql/table.cc ../sql/thr_malloc.cc ../sql/strfunc.cc ../sql/table.cc ../sql/thr_malloc.cc
../sql/time.cc ../sql/tztime.cc ../sql/uniques.cc ../sql/unireg.cc ../sql/time.cc ../sql/tztime.cc ../sql/uniques.cc ../sql/unireg.cc
../sql/partition_info.cc ../sql/sql_connect.cc ../sql/partition_info.cc ../sql/sql_connect.cc
../sql/scheduler.cc ../sql/stacktrace.c ../sql/scheduler.cc ../sql/event_parse_data.cc
../sql/event_parse_data.cc
${GEN_SOURCES} ${GEN_SOURCES}
${LIB_SOURCES}) ${LIB_SOURCES})
......
...@@ -69,7 +69,7 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \ ...@@ -69,7 +69,7 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
sql_select.cc sql_do.cc sql_show.cc set_var.cc \ sql_select.cc sql_do.cc sql_show.cc set_var.cc \
sql_string.cc sql_table.cc sql_test.cc sql_udf.cc \ sql_string.cc sql_table.cc sql_test.cc sql_udf.cc \
sql_update.cc sql_yacc.cc table.cc thr_malloc.cc time.cc \ sql_update.cc sql_yacc.cc table.cc thr_malloc.cc time.cc \
unireg.cc uniques.cc stacktrace.c sql_union.cc hash_filo.cc \ unireg.cc uniques.cc sql_union.cc hash_filo.cc \
spatial.cc gstream.cc sql_help.cc tztime.cc sql_cursor.cc \ spatial.cc gstream.cc sql_help.cc tztime.cc sql_cursor.cc \
sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc sp_rcontext.cc \ sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc sp_rcontext.cc \
parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \ parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \
......
...@@ -79,6 +79,15 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command, ...@@ -79,6 +79,15 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
my_bool result= 1; my_bool result= 1;
THD *thd=(THD *) mysql->thd; THD *thd=(THD *) mysql->thd;
NET *net= &mysql->net; NET *net= &mysql->net;
my_bool stmt_skip= stmt ? stmt->state != MYSQL_STMT_INIT_DONE : FALSE;
if (!thd)
{
/* Do "reconnect" if possible */
if (mysql_reconnect(mysql) || stmt_skip)
return 1;
thd= (THD *) mysql->thd;
}
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) #if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
thd->profiling.start_new_query(); thd->profiling.start_new_query();
......
...@@ -265,6 +265,22 @@ eval SELECT "$last_error" AS Last_SQL_Error; ...@@ -265,6 +265,22 @@ eval SELECT "$last_error" AS Last_SQL_Error;
enable_query_log; enable_query_log;
query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2; query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
# BUG#37076: TIMESTAMP/DATETIME values are not replicated correctly
# between machines with mixed endiannes
# (regression test)
--echo **** Test for BUG#37076 ****
--echo **** On Master ****
connection master;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a TIMESTAMP, b DATETIME, c DATE);
INSERT INTO t1 VALUES(
'2005-11-14 01:01:01', '2005-11-14 01:01:02', '2005-11-14');
--echo **** On Slave ****
sync_slave_with_master slave;
SELECT * FROM t1;
# #
# cleanup # cleanup
# #
......
...@@ -1428,29 +1428,31 @@ DROP TABLE t1; ...@@ -1428,29 +1428,31 @@ DROP TABLE t1;
# Bug#21704: Renaming column does not update FK definition. # Bug#21704: Renaming column does not update FK definition.
# #
--disable_warnings #
DROP TABLE IF EXISTS t1; # --disable_warnings
DROP TABLE IF EXISTS t2; # DROP TABLE IF EXISTS t1;
--enable_warnings # DROP TABLE IF EXISTS t2;
# --enable_warnings
CREATE TABLE t1(id INT PRIMARY KEY) #
ENGINE=innodb; # CREATE TABLE t1(id INT PRIMARY KEY)
# ENGINE=innodb;
CREATE TABLE t2( #
t1_id INT PRIMARY KEY, # CREATE TABLE t2(
CONSTRAINT fk1 FOREIGN KEY (t1_id) REFERENCES t1(id)) # t1_id INT PRIMARY KEY,
ENGINE=innodb; # CONSTRAINT fk1 FOREIGN KEY (t1_id) REFERENCES t1(id))
# ENGINE=innodb;
--echo #
# --echo
--disable_result_log #
--error ER_ERROR_ON_RENAME # --disable_result_log
ALTER TABLE t1 CHANGE id id2 INT; # --error ER_ERROR_ON_RENAME
--enable_result_log # ALTER TABLE t1 CHANGE id id2 INT;
# --enable_result_log
--echo #
# --echo
DROP TABLE t2; #
DROP TABLE t1; # DROP TABLE t2;
# DROP TABLE t1;
#
--echo End of 5.1 tests --echo End of 5.1 tests
# include/wait_condition.inc
#
# SUMMARY
#
# Waits until the passed statement returns true, or the operation
# times out.
#
# USAGE
#
# let $wait_condition=
# SELECT c = 3 FROM t;
# --source include/wait_condition.inc
#
# OR
#
# let $wait_timeout= 60; # Override default 30 seconds with 60.
# let $wait_condition=
# SELECT c = 3 FROM t;
# --source include/wait_condition.inc
# --echo Executed the test condition $wait_condition_reps times
#
# EXAMPLE
# events_bugs.test, events_time_zone.test
#
--disable_query_log
let $wait_counter= 300;
if ($wait_timeout)
{
let $wait_counter= `SELECT $wait_timeout * 10`;
}
# Reset $wait_timeout so that its value won't be used on subsequent
# calls, and default will be used instead.
let $wait_timeout= 0;
# Keep track of how many times the wait condition is tested
# This is used by some tests (e.g., main.status)
let $wait_condition_reps= 0;
while ($wait_counter)
{
let $success= `$wait_condition`;
inc $wait_condition_reps;
if ($success)
{
let $wait_counter= 0;
}
if (!$success)
{
real_sleep 0.1;
dec $wait_counter;
}
}
if (!$success)
{
echo Timeout in wait_condition.inc for $wait_condition;
}
--enable_query_log
...@@ -112,6 +112,7 @@ our $glob_basedir; ...@@ -112,6 +112,7 @@ our $glob_basedir;
our $path_charsetsdir; our $path_charsetsdir;
our $path_client_bindir; our $path_client_bindir;
our $path_client_libdir;
our $path_share; our $path_share;
our $path_language; our $path_language;
our $path_timefile; our $path_timefile;
...@@ -657,6 +658,8 @@ sub command_line_setup () { ...@@ -657,6 +658,8 @@ sub command_line_setup () {
'vardir=s' => \$opt_vardir, 'vardir=s' => \$opt_vardir,
'benchdir=s' => \$glob_mysql_bench_dir, 'benchdir=s' => \$glob_mysql_bench_dir,
'mem' => \$opt_mem, 'mem' => \$opt_mem,
'client-bindir=s' => \$path_client_bindir,
'client-libdir=s' => \$path_client_libdir,
# Misc # Misc
'report-features' => \$opt_report_features, 'report-features' => \$opt_report_features,
...@@ -783,12 +786,20 @@ sub command_line_setup () { ...@@ -783,12 +786,20 @@ sub command_line_setup () {
# #
# Look for the client binaries directory # Look for the client binaries directory
$path_client_bindir= mtr_path_exists("$glob_basedir/client_release", if ($path_client_bindir)
"$glob_basedir/client_debug", {
vs_config_dirs('client', ''), # --client-bindir=path set on command line, check that the path exists
"$glob_basedir/client", $path_client_bindir= mtr_path_exists($path_client_bindir);
"$glob_basedir/bin"); }
else
{
$path_client_bindir= mtr_path_exists("$glob_basedir/client_release",
"$glob_basedir/client_debug",
vs_config_dirs('client', ''),
"$glob_basedir/client",
"$glob_basedir/bin");
}
# Look for language files and charsetsdir, use same share # Look for language files and charsetsdir, use same share
$path_share= mtr_path_exists("$glob_basedir/share/mysql", $path_share= mtr_path_exists("$glob_basedir/share/mysql",
"$glob_basedir/sql/share", "$glob_basedir/sql/share",
...@@ -1837,19 +1848,25 @@ sub environment_setup () { ...@@ -1837,19 +1848,25 @@ sub environment_setup () {
my @ld_library_paths; my @ld_library_paths;
# -------------------------------------------------------------------------- if ($path_client_libdir)
# Setup LD_LIBRARY_PATH so the libraries from this distro/clone
# are used in favor of the system installed ones
# --------------------------------------------------------------------------
if ( $source_dist )
{ {
push(@ld_library_paths, "$glob_basedir/libmysql/.libs/", # Use the --client-libdir passed on commandline
"$glob_basedir/libmysql_r/.libs/", push(@ld_library_paths, "$path_client_libdir");
"$glob_basedir/zlib.libs/");
} }
else else
{ {
push(@ld_library_paths, "$glob_basedir/lib"); # Setup LD_LIBRARY_PATH so the libraries from this distro/clone
# are used in favor of the system installed ones
if ( $source_dist )
{
push(@ld_library_paths, "$glob_basedir/libmysql/.libs/",
"$glob_basedir/libmysql_r/.libs/",
"$glob_basedir/zlib.libs/");
}
else
{
push(@ld_library_paths, "$glob_basedir/lib");
}
} }
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
...@@ -2091,6 +2108,9 @@ sub environment_setup () { ...@@ -2091,6 +2108,9 @@ sub environment_setup () {
{ {
$cmdline_mysqlbinlog .=" --character-sets-dir=$path_charsetsdir"; $cmdline_mysqlbinlog .=" --character-sets-dir=$path_charsetsdir";
} }
# Always use the given tmpdir for the LOAD files created
# by mysqlbinlog
$cmdline_mysqlbinlog .=" --local-load=$opt_tmpdir";
if ( $opt_debug ) if ( $opt_debug )
{ {
...@@ -5357,6 +5377,8 @@ Misc options ...@@ -5357,6 +5377,8 @@ Misc options
warnings | log-warnings Pass --log-warnings to mysqld warnings | log-warnings Pass --log-warnings to mysqld
sleep=SECONDS Passed to mysqltest, will be used as fixed sleep time sleep=SECONDS Passed to mysqltest, will be used as fixed sleep time
client-bindir=PATH Path to the directory where client binaries are located
client-libdir=PATH Path to the directory where client libraries are located
Deprecated options Deprecated options
with-openssl Deprecated option for ssl with-openssl Deprecated option for ssl
......
...@@ -1184,3 +1184,42 @@ check table t1; ...@@ -1184,3 +1184,42 @@ check table t1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t1 check status OK test.t1 check status OK
drop table t1; drop table t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (id int, c int) character set latin1;
INSERT INTO t1 VALUES (1,1);
ALTER TABLE t1 CHANGE c d int;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
ALTER TABLE t1 CHANGE d c int;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
ALTER TABLE t1 MODIFY c VARCHAR(10);
affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 0
ALTER TABLE t1 CHANGE c d varchar(10);
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
ALTER TABLE t1 CHANGE d c varchar(10);
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (id int, c int) character set utf8;
INSERT INTO t1 VALUES (1,1);
ALTER TABLE t1 CHANGE c d int;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
ALTER TABLE t1 CHANGE d c int;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
ALTER TABLE t1 MODIFY c VARCHAR(10);
affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 0
ALTER TABLE t1 CHANGE c d varchar(10);
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
ALTER TABLE t1 CHANGE d c varchar(10);
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
DROP TABLE t1;
End of 5.1 tests
...@@ -104,41 +104,99 @@ t1 CREATE TABLE `t1` ( ...@@ -104,41 +104,99 @@ t1 CREATE TABLE `t1` (
`length(uuid())` int(10) NOT NULL DEFAULT '0' `length(uuid())` int(10) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1; drop table t1;
create table t1 (a timestamp default '2005-05-05 01:01:01', #------------------------------------------------------------------------
b timestamp default '2005-05-05 01:01:01'); # Tests for Bug#6760 and Bug#12689
insert into t1 set a = now(); SET @row_count = 4;
select sleep(3); SET @sleep_time_per_result_row = 1;
sleep(3) SET @max_acceptable_delay = 2;
0 SET @@global.query_cache_size = 1024 * 64;
update t1 set b = now(); DROP TEMPORARY TABLE IF EXISTS t_history;
select timediff(b, a) >= '00:00:03' from t1; DROP TABLE IF EXISTS t1;
timediff(b, a) >= '00:00:03' CREATE TEMPORARY TABLE t_history (attempt SMALLINT,
1 start_ts DATETIME, end_ts DATETIME,
drop table t1; start_cached INTEGER, end_cached INTEGER);
set global query_cache_size=1355776; CREATE TABLE t1 (f1 BIGINT);
create table t1 (a int); INSERT INTO t1 VALUES (1);
insert into t1 values (1),(1),(1); INSERT INTO t1 VALUES (1);
create table t2 (a datetime default null, b datetime default null); INSERT INTO t1 VALUES (1);
insert into t2 set a = now(); INSERT INTO t1 VALUES (1);
select a from t1 where sleep(1); INSERT INTO t_history
a SET attempt = 4 - 4 + 1, start_ts = NOW(),
update t2 set b = now() where b is null; start_cached = 0;
insert into t2 set a = now(); SELECT *, SLEEP(@sleep_time_per_result_row) FROM t1;
select a from t1 where sleep(a); f1 SLEEP(@sleep_time_per_result_row)
a 1 0
update t2 set b = now() where b is null; 1 0
insert into t2 set a = now(); 1 0
select a from t1 where sleep(1); 1 0
a UPDATE t_history SET end_ts = NOW()
update t2 set b = now() where b is null; WHERE attempt = 4 - 4 + 1;
select timediff(b, a) >= '00:00:03' from t2; UPDATE t_history SET end_cached = 0
timediff(b, a) >= '00:00:03' WHERE attempt = 4 - 4 + 1;
INSERT INTO t_history
SET attempt = 4 - 3 + 1, start_ts = NOW(),
start_cached = 0;
SELECT *, SLEEP(@sleep_time_per_result_row) FROM t1;
f1 SLEEP(@sleep_time_per_result_row)
1 0
1 0
1 0
1 0
UPDATE t_history SET end_ts = NOW()
WHERE attempt = 4 - 3 + 1;
UPDATE t_history SET end_cached = 0
WHERE attempt = 4 - 3 + 1;
INSERT INTO t_history
SET attempt = 4 - 2 + 1, start_ts = NOW(),
start_cached = 0;
SELECT *, SLEEP(@sleep_time_per_result_row) FROM t1;
f1 SLEEP(@sleep_time_per_result_row)
1 0
1 0
1 0
1 0
UPDATE t_history SET end_ts = NOW()
WHERE attempt = 4 - 2 + 1;
UPDATE t_history SET end_cached = 0
WHERE attempt = 4 - 2 + 1;
INSERT INTO t_history
SET attempt = 4 - 1 + 1, start_ts = NOW(),
start_cached = 0;
SELECT *, SLEEP(@sleep_time_per_result_row) FROM t1;
f1 SLEEP(@sleep_time_per_result_row)
1 0
1 0
1 0
1 0
UPDATE t_history SET end_ts = NOW()
WHERE attempt = 4 - 1 + 1;
UPDATE t_history SET end_cached = 0
WHERE attempt = 4 - 1 + 1;
# Test 1: Does the query with SLEEP need a reasonable time?
SELECT COUNT(*) >= 4 - 1 INTO @aux1 FROM t_history
WHERE TIMEDIFF(end_ts,start_ts) - @sleep_time_per_result_row * @row_count
BETWEEN 0 AND @max_acceptable_delay;
SELECT @aux1 AS "Expect 1";
Expect 1
1 1
# Test 2: Does the query with SLEEP need a reasonable time even in case
# of the non first execution?
SELECT COUNT(*) >= 4 - 1 - 1 INTO @aux2 FROM t_history
WHERE TIMEDIFF(end_ts,start_ts) - @sleep_time_per_result_row * @row_count
BETWEEN 0 AND @max_acceptable_delay
AND attempt > 1;
SELECT @aux2 AS "Expect 1";
Expect 1
1 1
# Test 3: The query with SLEEP must be not cached.
SELECT COUNT(*) = 4 INTO @aux3 FROM t_history
WHERE end_cached = start_cached;
SELECT @aux3 AS "Expect 1";
Expect 1
1 1
drop table t2; DROP TABLE t1;
drop table t1; DROP TEMPORARY TABLE t_history;
set global query_cache_size=default; SET @@global.query_cache_size = default;
create table t1 select INET_ATON('255.255.0.1') as `a`; create table t1 select INET_ATON('255.255.0.1') as `a`;
show create table t1; show create table t1;
Table Create Table Table Create Table
......
...@@ -3,11 +3,11 @@ create table t1 (c1 char(5) unique not null, c2 int, stamp timestamp) engine=inn ...@@ -3,11 +3,11 @@ create table t1 (c1 char(5) unique not null, c2 int, stamp timestamp) engine=inn
select * from t1; select * from t1;
c1 c2 stamp c1 c2 stamp
replace delayed into t1 (c1, c2) values ( "text1","11"); replace delayed into t1 (c1, c2) values ( "text1","11");
ERROR HY000: Table storage engine for 't1' doesn't have this option ERROR HY000: DELAYED option not supported for table 't1'
select * from t1; select * from t1;
c1 c2 stamp c1 c2 stamp
replace delayed into t1 (c1, c2) values ( "text1","12"); replace delayed into t1 (c1, c2) values ( "text1","12");
ERROR HY000: Table storage engine for 't1' doesn't have this option ERROR HY000: DELAYED option not supported for table 't1'
select * from t1; select * from t1;
c1 c2 stamp c1 c2 stamp
drop table t1; drop table t1;
...@@ -1640,19 +1640,6 @@ vid tid idx name type ...@@ -1640,19 +1640,6 @@ vid tid idx name type
3 1 2 c1 NULL 3 1 2 c1 NULL
3 1 1 pk NULL 3 1 1 pk NULL
DROP TABLE t1; DROP TABLE t1;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
CREATE TABLE t1(id INT PRIMARY KEY)
ENGINE=innodb;
CREATE TABLE t2(
t1_id INT PRIMARY KEY,
CONSTRAINT fk1 FOREIGN KEY (t1_id) REFERENCES t1(id))
ENGINE=innodb;
ALTER TABLE t1 CHANGE id id2 INT;
DROP TABLE t2;
DROP TABLE t1;
End of 5.1 tests End of 5.1 tests
drop table if exists t1, t2, t3; drop table if exists t1, t2, t3;
create table t1(a int); create table t1(a int);
......
drop table if exists t1; drop table if exists t1, t2;
CREATE TABLE t1 (
a INT NOT NULL,
b MEDIUMINT NOT NULL,
c INT NOT NULL,
KEY b (b)
) ENGINE=MyISAM
PARTITION BY LIST (a) (
PARTITION p0 VALUES IN (1)
);
INSERT INTO t1 VALUES (1,1,0), (1,1,1), (1,1,2), (1,1,53), (1,1,4), (1,1,5),
(1,1,6), (1,1,7), (1,1,8), (1,1,9), (1,1,10), (1,1,11), (1,1,12), (1,1,13),
(1,1,14), (1,1,15), (1,1,16), (1,1,67), (1,1,18), (1,1,19), (1,1,20), (1,1,21),
(1,1,22), (1,1,23), (1,1,24), (1,1,75), (1,1,26), (1,1,27), (1,1,128),
(1,1,79), (1,1,30), (1,1,31), (1,1,32), (1,1,33), (1,1,34), (1,1,85), (1,1,36),
(1,1,37), (1,1,38), (1,1,39), (1,1,40), (1,1,241), (1,1,42), (1,1,43),
(1,1,44), (1,1,45), (1,1,46), (1,1,147), (1,1,48), (1,1,49), (1,2,0), (1,2,1),
(1,2,2), (1,2,3), (1,2,4), (1,2,5), (1,2,6), (1,2,7), (1,2,8), (1,2,9),
(1,2,10), (1,2,11), (1,2,12), (1,2,13), (1,2,14), (1,2,15), (1,2,16), (1,2,17),
(1,2,18), (1,2,19), (1,2,20), (1,2,21), (1,2,22), (1,2,23), (1,2,24), (1,2,25),
(1,2,26), (1,2,27), (1,2,28), (1,2,29), (1,2,30), (1,2,31), (1,2,32), (1,2,33),
(1,2,34), (1,2,35), (1,2,36), (1,2,37), (1,2,38), (1,2,39), (1,2,40), (1,2,41),
(1,2,42), (1,2,43), (1,2,44), (1,2,45), (1,2,46), (1,2,47), (1,2,48), (1,2,49),
(1,6,0), (1,6,1), (1,6,2), (1,6,3), (1,6,4), (1,6,5), (1,6,6), (1,6,7),
(1,6,8), (1,6,9), (1,6,10), (1,6,11), (1,6,12), (1,6,13), (1,6,14), (1,6,15),
(1,6,16), (1,6,17), (1,6,18), (1,6,19), (1,6,20), (1,6,21), (1,6,22), (1,6,23),
(1,6,24), (1,6,25), (1,6,26), (1,6,27), (1,6,28), (1,6,29), (1,6,30), (1,6,31),
(1,6,32), (1,6,33), (1,6,34), (1,6,35), (1,6,36), (1,6,37), (1,6,38), (1,6,39),
(1,6,40), (1,6,41), (1,6,42), (1,6,43), (1,6,44), (1,6,45), (1,6,46), (1,6,47),
(1,6,48), (1,6,49), (1,7,0), (1,7,1), (1,7,2), (1,7,3), (1,7,4), (1,7,5),
(1,7,6), (1,7,7), (1,7,8), (1,7,9), (1,7,10), (1,7,11), (1,7,12), (1,7,13),
(1,7,14), (1,7,15), (1,7,16), (1,7,17), (1,7,18), (1,7,19), (1,7,20), (1,7,21),
(1,7,22), (1,7,23), (1,7,24), (1,7,25), (1,7,26), (1,7,27), (1,7,28), (1,7,29),
(1,7,30), (1,7,31), (1,7,32), (1,7,33), (1,7,34), (1,7,35), (1,7,38), (1,7,39),
(1,7,90), (1,7,41), (1,7,43), (1,7,48), (1,7,49), (1,9,0), (1,9,1), (1,9,2),
(1,9,3), (1,9,4), (1,9,5), (1,9,6), (1,9,7), (1,9,8), (1,9,9), (1,9,10),
(1,9,11), (1,9,12), (1,9,13), (1,9,14), (1,9,15), (1,9,16), (1,9,17), (1,9,18),
(1,9,19), (1,9,20), (1,9,21), (1,9,22), (1,9,23), (1,9,24), (1,9,25), (1,9,26),
(1,9,29), (1,9,32), (1,9,35), (1,9,38), (1,10,0), (1,10,1), (1,10,2), (1,10,3),
(1,10,4), (1,10,5), (1,10,6), (1,10,7), (1,10,8), (1,10,9), (1,10,10),
(1,10,11), (1,10,13), (1,10,14), (1,10,15), (1,10,16), (1,10,17), (1,10,18),
(1,10,22), (1,10,24), (1,10,25), (1,10,26), (1,10,28), (1,10,131), (1,10,33),
(1,10,84), (1,10,35), (1,10,40), (1,10,42), (1,10,49), (1,11,0), (1,11,1),
(1,11,2), (1,11,3), (1,11,4), (1,11,5), (1,11,6), (1,11,7), (1,11,8), (1,11,9),
(1,11,10), (1,11,11), (1,11,12), (1,11,13), (1,11,14), (1,11,15), (1,11,16),
(1,11,17), (1,11,18), (1,11,19), (1,11,20), (1,11,21), (1,11,22), (1,11,23),
(1,11,24), (1,11,25), (1,11,26), (1,11,27), (1,11,28), (1,11,30), (1,11,31),
(1,11,32), (1,11,33), (1,11,34), (1,11,35), (1,11,37), (1,11,39), (1,11,40),
(1,11,42), (1,11,44), (1,11,45), (1,11,47), (1,11,48), (1,14,104), (1,14,58),
(1,14,12), (1,14,13), (1,14,15), (1,14,16), (1,14,17), (1,14,34), (1,15,0),
(1,15,1), (1,15,2), (1,15,3), (1,15,4), (1,15,5), (1,15,7), (1,15,9),
(1,15,15), (1,15,27), (1,15,49), (1,16,0), (1,16,1), (1,16,3), (1,17,4),
(1,19,1);
SELECT COUNT(*) FROM t1 WHERE b NOT IN ( 1,2,6,7,9,10,11 );
COUNT(*)
24
SELECT SUM(c) FROM t1 WHERE b NOT IN ( 1,2,6,7,9,10,11 );
SUM(c)
400
ALTER TABLE t1 DROP INDEX b;
SELECT COUNT(*) FROM t1 WHERE b NOT IN ( 1,2,6,7,9,10,11 );
COUNT(*)
24
SELECT SUM(c) FROM t1 WHERE b NOT IN ( 1,2,6,7,9,10,11 );
SUM(c)
400
ALTER TABLE t1 ENGINE = Memory;
SELECT COUNT(*) FROM t1 WHERE b NOT IN ( 1,2,6,7,9,10,11 );
COUNT(*)
24
SELECT SUM(c) FROM t1 WHERE b NOT IN ( 1,2,6,7,9,10,11 );
SUM(c)
400
ALTER TABLE t1 ADD INDEX b USING HASH (b);
SELECT COUNT(*) FROM t1 WHERE b NOT IN ( 1,2,6,7,9,10,11 );
COUNT(*)
24
SELECT SUM(c) FROM t1 WHERE b NOT IN ( 1,2,6,7,9,10,11 );
SUM(c)
400
DROP TABLE t1;
CREATE TABLE `t1` (
`c1` int(11) DEFAULT NULL,
KEY `c1` (`c1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE `t2` (
`c1` int(11) DEFAULT NULL,
KEY `c1` (`c1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (c1) (PARTITION a VALUES LESS THAN (100) ENGINE = MyISAM, PARTITION b VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */;
INSERT INTO `t1` VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17),(18),(19),(20);
INSERT INTO `t2` VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17),(18),(19),(20);
EXPLAIN PARTITIONS SELECT c1 FROM t1 WHERE (c1 > 10 AND c1 < 13) OR (c1 > 17 AND c1 < 20);
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 NULL range c1 c1 5 NULL 4 Using where; Using index
FLUSH STATUS;
SELECT c1 FROM t1 WHERE (c1 > 10 AND c1 < 13) OR (c1 > 17 AND c1 < 20);
c1
11
12
18
19
SHOW STATUS LIKE 'Handler_read_%';
Variable_name Value
Handler_read_first 0
Handler_read_key 2
Handler_read_next 4
Handler_read_prev 0
Handler_read_rnd 0
Handler_read_rnd_next 0
EXPLAIN PARTITIONS SELECT c1 FROM t2 WHERE (c1 > 10 AND c1 < 13) OR (c1 > 17 AND c1 < 20);
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t2 a range c1 c1 5 NULL 4 Using where; Using index
FLUSH STATUS;
SELECT c1 FROM t2 WHERE (c1 > 10 AND c1 < 13) OR (c1 > 17 AND c1 < 20);
c1
11
12
18
19
SHOW STATUS LIKE 'Handler_read_%';
Variable_name Value
Handler_read_first 0
Handler_read_key 2
Handler_read_next 4
Handler_read_prev 0
Handler_read_rnd 0
Handler_read_rnd_next 0
DROP TABLE t1,t2;
CREATE TABLE `t1` (
`c1` int(11) DEFAULT NULL,
KEY `c1` (`c1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE `t2` (
`c1` int(11) DEFAULT NULL,
KEY `c1` (`c1`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (c1) (PARTITION a VALUES LESS THAN (100) ENGINE = MyISAM, PARTITION b VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */;
INSERT INTO `t1` VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17),(18),(19),(20);
INSERT INTO `t2` VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17),(18),(19),(20);
EXPLAIN PARTITIONS SELECT c1 FROM t1 WHERE (c1 > 2 AND c1 < 5);
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 NULL range c1 c1 5 NULL 2 Using where; Using index
FLUSH STATUS;
SELECT c1 FROM t1 WHERE (c1 > 2 AND c1 < 5);
c1
3
4
SHOW STATUS LIKE 'Handler_read_%';
Variable_name Value
Handler_read_first 0
Handler_read_key 1
Handler_read_next 2
Handler_read_prev 0
Handler_read_rnd 0
Handler_read_rnd_next 0
EXPLAIN PARTITIONS SELECT c1 FROM t2 WHERE (c1 > 2 AND c1 < 5);
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t2 a range c1 c1 5 NULL 2 Using where; Using index
FLUSH STATUS;
SELECT c1 FROM t2 WHERE (c1 > 2 AND c1 < 5);
c1
3
4
SHOW STATUS LIKE 'Handler_read_%';
Variable_name Value
Handler_read_first 0
Handler_read_key 1
Handler_read_next 2
Handler_read_prev 0
Handler_read_rnd 0
Handler_read_rnd_next 0
EXPLAIN PARTITIONS SELECT c1 FROM t1 WHERE (c1 > 12 AND c1 < 15);
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 NULL range c1 c1 5 NULL 2 Using where; Using index
FLUSH STATUS;
SELECT c1 FROM t1 WHERE (c1 > 12 AND c1 < 15);
c1
13
14
SHOW STATUS LIKE 'Handler_read_%';
Variable_name Value
Handler_read_first 0
Handler_read_key 1
Handler_read_next 2
Handler_read_prev 0
Handler_read_rnd 0
Handler_read_rnd_next 0
EXPLAIN PARTITIONS SELECT c1 FROM t2 WHERE (c1 > 12 AND c1 < 15);
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t2 a range c1 c1 5 NULL 2 Using where; Using index
FLUSH STATUS;
SELECT c1 FROM t2 WHERE (c1 > 12 AND c1 < 15);
c1
13
14
SHOW STATUS LIKE 'Handler_read_%';
Variable_name Value
Handler_read_first 0
Handler_read_key 1
Handler_read_next 2
Handler_read_prev 0
Handler_read_rnd 0
Handler_read_rnd_next 0
DROP TABLE t1,t2;
create table t1 (a int) partition by list ((a/3)*10 div 1) create table t1 (a int) partition by list ((a/3)*10 div 1)
(partition p0 values in (0), partition p1 values in (1)); (partition p0 values in (0), partition p1 values in (1));
ERROR HY000: This partition function is not allowed ERROR HY000: This partition function is not allowed
......
This diff is collapsed.
...@@ -163,13 +163,11 @@ Com_show_status 8 ...@@ -163,13 +163,11 @@ Com_show_status 8
rnd_diff tmp_table_diff rnd_diff tmp_table_diff
20 8 20 8
flush status; flush status;
show status like 'Com%function%'; show status like 'Com%function';
Variable_name Value Variable_name Value
Com_alter_function 0 Com_alter_function 0
Com_create_function 0 Com_create_function 0
Com_drop_function 0 Com_drop_function 0
Com_show_function_code 0
Com_show_function_status 0
create function f1 (x INTEGER) returns integer create function f1 (x INTEGER) returns integer
begin begin
declare ret integer; declare ret integer;
...@@ -177,10 +175,8 @@ set ret = x * 10; ...@@ -177,10 +175,8 @@ set ret = x * 10;
return ret; return ret;
end // end //
drop function f1; drop function f1;
show status like 'Com%function%'; show status like 'Com%function';
Variable_name Value Variable_name Value
Com_alter_function 0 Com_alter_function 0
Com_create_function 1 Com_create_function 1
Com_drop_function 1 Com_drop_function 1
Com_show_function_code 0
Com_show_function_status 0
...@@ -84,4 +84,3 @@ SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML, ...@@ -84,4 +84,3 @@ SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
FROM information_schema.columns FROM information_schema.columns
$my_where $my_where
ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION; ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION;
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
let $innodb_pattern = 'InnoDB free'; let $innodb_pattern = 'InnoDB free';
let $ndb_pattern = 'number_of_replicas'; let $ndb_pattern = 'number_of_replicas';
--vertical_results --vertical_results
# We do not unify the engine name here, because the rowformat is
# specific to the engine.
--replace_column 8 "#TBLR#" 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "#CRT#" 16 "#UT#" 17 "#CT#" 20 "#CO#" 21 "#TC#" --replace_column 8 "#TBLR#" 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "#CRT#" 16 "#UT#" 17 "#CT#" 20 "#CO#" 21 "#TC#"
eval eval
SELECT *, SELECT *,
...@@ -44,4 +46,3 @@ FROM information_schema.tables ...@@ -44,4 +46,3 @@ FROM information_schema.tables
$my_where $my_where
ORDER BY table_schema,table_name; ORDER BY table_schema,table_name;
--horizontal_results --horizontal_results
# Skip tests which suffer from
# Bug#28309 First insert violates unique constraint
# - was "memory" table empty?
# if the folowing conditions are fulfilled:
# - MySQL Version is 5.0 (Bug is fixed in 5.1 and up)
# - use of embedded server
# - run on a case insensitive filesystem
#
let $value= query_get_value(SHOW VARIABLES LIKE 'lower_case_file_system', Value, 1);
if (`SELECT '$value' = 'ON' AND VERSION() LIKE '5.0%embedded%'`)
{
skip # Test requires backport of fix for Bug#28309 First insert violates unique constraint - was "memory" table empty ?;
}
...@@ -7,7 +7,7 @@ create table tb1 ( ...@@ -7,7 +7,7 @@ create table tb1 (
f1 char(0), f1 char(0),
f2 char(0) binary, f2 char(0) binary,
f3 char(0) ascii, f3 char(0) ascii,
f4 tinytext unicode, f4 tinytext,
f5 text, f5 text,
f6 mediumtext, f6 mediumtext,
f7 longtext, f7 longtext,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment