Commit d98a77b4 authored by Andrei Elkin's avatar Andrei Elkin

merging 5.1 -> 5.1 rpl. 3 of 4 conflicts are resolved similarly to 6.0->6.0-rpl merging.

mysql_upgrade results changed due to the error messesge of mysqlcheck has changed.
parents bea8fad5 68b944a2
...@@ -80,7 +80,7 @@ path=`dirname $0` ...@@ -80,7 +80,7 @@ path=`dirname $0`
. "$path/check-cpu" . "$path/check-cpu"
export AM_MAKEFLAGS export AM_MAKEFLAGS
AM_MAKEFLAGS="-j 4" AM_MAKEFLAGS="-j 6"
# SSL library to use.--with-ssl will select our bundled yaSSL # SSL library to use.--with-ssl will select our bundled yaSSL
# implementation of SSL. To use openSSl you will nee too point out # implementation of SSL. To use openSSl you will nee too point out
...@@ -105,7 +105,7 @@ if [ "x$warning_mode" != "xpedantic" ]; then ...@@ -105,7 +105,7 @@ if [ "x$warning_mode" != "xpedantic" ]; then
cxx_warnings="$cxx_warnings -Wreorder" cxx_warnings="$cxx_warnings -Wreorder"
cxx_warnings="$cxx_warnings -Wctor-dtor-privacy -Wnon-virtual-dtor" cxx_warnings="$cxx_warnings -Wctor-dtor-privacy -Wnon-virtual-dtor"
# Added unless --with-debug=full # Added unless --with-debug=full
debug_extra_cflags="-O1 -Wuninitialized" debug_extra_cflags="-O0 -g3 -gdwarf-2" #1 -Wuninitialized"
else else
warnings="-W -Wall -ansi -pedantic -Wno-long-long -Wno-unused -D_POSIX_SOURCE" warnings="-W -Wall -ansi -pedantic -Wno-long-long -Wno-unused -D_POSIX_SOURCE"
c_warnings="$warnings" c_warnings="$warnings"
......
...@@ -13,34 +13,51 @@ path=`dirname $0` ...@@ -13,34 +13,51 @@ path=`dirname $0`
# Default to gcc for CC and CXX # Default to gcc for CC and CXX
if test -z "$CXX" ; then if test -z "$CXX" ; then
export CXX=gcc CXX=gcc
# Set some required compile options # Set some required compile options
if test -z "$CXXFLAGS" ; then if test -z "$CXXFLAGS" ; then
export CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti" CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti"
fi fi
fi fi
if test -z "$CC" ; then if test -z "$CC" ; then
export CC=gcc CC=gcc
fi fi
# Use ccache, if available # Use ccache, if available
if ccache -V > /dev/null 2>&1 if ccache -V > /dev/null 2>&1
then then
if ! (echo "$CC" | grep "ccache" > /dev/null) if echo "$CC" | grep "ccache" > /dev/null
then then
export CC="ccache $CC" :
else
CC="ccache $CC"
fi fi
if ! (echo "$CXX" | grep "ccache" > /dev/null) if echo "$CXX" | grep "ccache" > /dev/null
then then
export CXX="ccache $CXX" :
else
CXX="ccache $CXX"
fi fi
fi fi
if test -z "$MAKE"
then
if gmake -v > /dev/null 2>&1
then
MAKE="gmake"
else
MAKE="make"
fi
fi
export CC CXX MAKE
# Make sure to enable all features that affect "make dist" # Make sure to enable all features that affect "make dist"
# Remember that configure restricts the man pages to the configured features ! # Remember that configure restricts the man pages to the configured features !
./configure \ ./configure \
--with-embedded-server \ --with-embedded-server \
--with-ndbcluster --with-ndbcluster
make $MAKE
...@@ -10,7 +10,7 @@ AC_CANONICAL_SYSTEM ...@@ -10,7 +10,7 @@ AC_CANONICAL_SYSTEM
# #
# When changing major version number please also check switch statement # When changing major version number please also check switch statement
# in mysqlbinlog::check_master_version(). # in mysqlbinlog::check_master_version().
AM_INIT_AUTOMAKE(mysql, 5.1.30) AM_INIT_AUTOMAKE(mysql, 5.1.31)
AM_CONFIG_HEADER([include/config.h:config.h.in]) AM_CONFIG_HEADER([include/config.h:config.h.in])
PROTOCOL_VERSION=10 PROTOCOL_VERSION=10
...@@ -405,12 +405,15 @@ dnl Find paths to some shell programs ...@@ -405,12 +405,15 @@ dnl Find paths to some shell programs
AC_PATH_PROG(LN, ln, ln) AC_PATH_PROG(LN, ln, ln)
# This must be able to take a -f flag like normal unix ln. # This must be able to take a -f flag like normal unix ln.
AC_PATH_PROG(LN_CP_F, ln, ln) AC_PATH_PROG(LN_CP_F, ln, ln)
if ! ( expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null ); then case $SYSTEM_TYPE in
# If ln -f does not exists use -s (AFS systems) *netware*) ;;
if test -n "$LN_CP_F"; then *)
LN_CP_F="$LN_CP_F -s" # If ln -f does not exists use -s (AFS systems)
fi if test -n "$LN_CP_F"; then
fi LN_CP_F="$LN_CP_F -s"
fi
;;
esac
AC_PATH_PROG(MV, mv, mv) AC_PATH_PROG(MV, mv, mv)
AC_PATH_PROG(RM, rm, rm) AC_PATH_PROG(RM, rm, rm)
...@@ -1642,14 +1645,16 @@ else ...@@ -1642,14 +1645,16 @@ else
OPTIMIZE_CXXFLAGS="-O" OPTIMIZE_CXXFLAGS="-O"
fi fi
if expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null; then case $SYSTEM_TYPE in
DEBUG_CFLAGS="-g -DDEBUG -sym internal,codeview4" *netware*)
DEBUG_CXXFLAGS="-g -DDEBUG -sym internal,codeview4" DEBUG_CFLAGS="-g -DDEBUG -sym internal,codeview4"
DEBUG_OPTIMIZE_CC="-DDEBUG" DEBUG_CXXFLAGS="-g -DDEBUG -sym internal,codeview4"
DEBUG_OPTIMIZE_CXX="-DDEBUG" DEBUG_OPTIMIZE_CC="-DDEBUG"
OPTIMIZE_CFLAGS="-O3 -DNDEBUG" DEBUG_OPTIMIZE_CXX="-DDEBUG"
OPTIMIZE_CXXFLAGS="-O3 -DNDEBUG" OPTIMIZE_CFLAGS="-O3 -DNDEBUG"
fi OPTIMIZE_CXXFLAGS="-O3 -DNDEBUG"
;;
esac
# If the user specified CFLAGS, we won't add any optimizations # If the user specified CFLAGS, we won't add any optimizations
if test -n "$SAVE_CFLAGS" if test -n "$SAVE_CFLAGS"
...@@ -1915,15 +1920,18 @@ MYSQL_TZNAME ...@@ -1915,15 +1920,18 @@ MYSQL_TZNAME
# Do the c++ compiler have a bool type # Do the c++ compiler have a bool type
MYSQL_CXX_BOOL MYSQL_CXX_BOOL
# Check some common bugs with gcc 2.8.# on sparc # Check some common bugs with gcc 2.8.# on sparc
if ! ( expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null ); then case $SYSTEM_TYPE in
MYSQL_CHECK_LONGLONG_TO_FLOAT *netware*) ;;
if test "$ac_cv_conv_longlong_to_float" != "yes" *)
then MYSQL_CHECK_LONGLONG_TO_FLOAT
AC_MSG_ERROR([Your compiler cannot convert a longlong value to a float! if test "$ac_cv_conv_longlong_to_float" != "yes"
If you are using gcc 2.8.# you should upgrade to egcs 1.0.3 or newer and try then
again]) AC_MSG_ERROR([Your compiler cannot convert a longlong value to a float!
fi If you are using gcc 2.8.# you should upgrade to egcs 1.0.3 or newer and try
fi again])
fi
;;
esac
AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>]) AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
AC_CHECK_TYPES([size_t], [], [], [#include <stdio.h>]) AC_CHECK_TYPES([size_t], [], [], [#include <stdio.h>])
AC_CHECK_TYPES([u_int32_t]) AC_CHECK_TYPES([u_int32_t])
...@@ -2040,7 +2048,7 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bsearch bzero \ ...@@ -2040,7 +2048,7 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bsearch bzero \
mkstemp mlockall perror poll pread pthread_attr_create mmap mmap64 getpagesize \ mkstemp mlockall perror poll pread pthread_attr_create mmap mmap64 getpagesize \
pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \ pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \
pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \ pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \
pthread_key_delete pthread_rwlock_rdlock pthread_setprio \ pthread_key_delete pthread_rwlock_rdlock pthread_setprio pthread_setschedprio \
pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \ pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \
realpath rename rint rwlock_init setupterm \ realpath rename rint rwlock_init setupterm \
shmget shmat shmdt shmctl sigaction sigemptyset sigaddset \ shmget shmat shmdt shmctl sigaction sigemptyset sigaddset \
...@@ -2549,11 +2557,12 @@ readline_h_ln_cmd="" ...@@ -2549,11 +2557,12 @@ readline_h_ln_cmd=""
readline_link="" readline_link=""
want_to_use_readline="no" want_to_use_readline="no"
if expr "$SYSTEM_TYPE" : ".*netware.*" > /dev/null case $SYSTEM_TYPE in
then *netware*)
# For NetWare, do not need readline # For NetWare, do not need readline
echo "Skipping readline" echo "Skipping readline"
else ;;
*)
if [test "$with_libedit" = "yes"] || [test "$with_libedit" = "undefined"] && [test "$with_readline" = "undefined"] if [test "$with_libedit" = "yes"] || [test "$with_libedit" = "undefined"] && [test "$with_readline" = "undefined"]
then then
readline_topdir="cmd-line-utils" readline_topdir="cmd-line-utils"
...@@ -2606,7 +2615,8 @@ else ...@@ -2606,7 +2615,8 @@ else
be built with libreadline. Please use --with-libedit to use be built with libreadline. Please use --with-libedit to use
the bundled version of libedit instead.]) the bundled version of libedit instead.])
fi fi
fi ;;
esac
AC_SUBST(readline_dir) AC_SUBST(readline_dir)
AC_SUBST(readline_topdir) AC_SUBST(readline_topdir)
......
...@@ -15,8 +15,9 @@ ...@@ -15,8 +15,9 @@
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, # Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA # MA 02111-1307, USA
BUILT_SOURCES = $(HEADERS_GEN) link_sources BUILT_SOURCES = $(HEADERS_GEN_MAKE) link_sources
HEADERS_GEN = mysql_version.h my_config.h HEADERS_GEN_CONFIGURE = mysql_version.h
HEADERS_GEN_MAKE = my_config.h
HEADERS_ABI = mysql.h mysql_com.h mysql_time.h \ HEADERS_ABI = mysql.h mysql_com.h mysql_time.h \
my_list.h my_alloc.h typelib.h mysql/plugin.h my_list.h my_alloc.h typelib.h mysql/plugin.h
pkginclude_HEADERS = $(HEADERS_ABI) my_dbug.h m_string.h my_sys.h \ pkginclude_HEADERS = $(HEADERS_ABI) my_dbug.h m_string.h my_sys.h \
...@@ -25,7 +26,9 @@ pkginclude_HEADERS = $(HEADERS_ABI) my_dbug.h m_string.h my_sys.h \ ...@@ -25,7 +26,9 @@ pkginclude_HEADERS = $(HEADERS_ABI) my_dbug.h m_string.h my_sys.h \
decimal.h errmsg.h my_global.h my_net.h \ decimal.h errmsg.h my_global.h my_net.h \
my_getopt.h sslopt-longopts.h my_dir.h \ my_getopt.h sslopt-longopts.h my_dir.h \
sslopt-vars.h sslopt-case.h sql_common.h keycache.h \ sslopt-vars.h sslopt-case.h sql_common.h keycache.h \
m_ctype.h my_attribute.h $(HEADERS_GEN) m_ctype.h my_attribute.h $(HEADERS_GEN_CONFIGURE) \
$(HEADERS_GEN_MAKE)
noinst_HEADERS = config-win.h config-netware.h my_bit.h \ noinst_HEADERS = config-win.h config-netware.h my_bit.h \
heap.h my_bitmap.h my_uctype.h \ heap.h my_bitmap.h my_uctype.h \
myisam.h myisampack.h myisammrg.h ft_global.h\ myisam.h myisampack.h myisammrg.h ft_global.h\
...@@ -33,7 +36,7 @@ noinst_HEADERS = config-win.h config-netware.h my_bit.h \ ...@@ -33,7 +36,7 @@ noinst_HEADERS = config-win.h config-netware.h my_bit.h \
my_nosys.h my_alarm.h queues.h rijndael.h sha1.h \ my_nosys.h my_alarm.h queues.h rijndael.h sha1.h \
my_aes.h my_tree.h my_trie.h hash.h thr_alarm.h \ my_aes.h my_tree.h my_trie.h hash.h thr_alarm.h \
thr_lock.h t_ctype.h violite.h my_md5.h base64.h \ thr_lock.h t_ctype.h violite.h my_md5.h base64.h \
mysql_version.h.in my_handler.h my_time.h \ 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 my_stacktrace.h atomic/gcc_builtins.h my_libwrap.h my_stacktrace.h
...@@ -45,7 +48,7 @@ CLEANFILES = $(BUILT_SOURCES) readline openssl ...@@ -45,7 +48,7 @@ CLEANFILES = $(BUILT_SOURCES) readline openssl
# Some include files that may be moved and patched by configure # Some include files that may be moved and patched by configure
DISTCLEANFILES = sched.h $(CLEANFILES) DISTCLEANFILES = sched.h $(CLEANFILES) $(HEADERS_GEN_CONFIGURE)
link_sources: link_sources:
-$(RM) -f readline openssl -$(RM) -f readline openssl
......
...@@ -279,6 +279,8 @@ int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */ ...@@ -279,6 +279,8 @@ int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */
#define my_pthread_setprio(A,B) pthread_setprio_np((A),(B)) #define my_pthread_setprio(A,B) pthread_setprio_np((A),(B))
#elif defined(HAVE_PTHREAD_SETPRIO) #elif defined(HAVE_PTHREAD_SETPRIO)
#define my_pthread_setprio(A,B) pthread_setprio((A),(B)) #define my_pthread_setprio(A,B) pthread_setprio((A),(B))
#elif defined(HAVE_PTHREAD_SETSCHEDPRIO)
#define my_pthread_setprio(A,B) pthread_setschedprio((A),(B))
#else #else
extern void my_pthread_setprio(pthread_t thread_id,int prior); extern void my_pthread_setprio(pthread_t thread_id,int prior);
#endif #endif
...@@ -519,6 +521,7 @@ typedef struct st_my_pthread_fastmutex_t ...@@ -519,6 +521,7 @@ typedef struct st_my_pthread_fastmutex_t
{ {
pthread_mutex_t mutex; pthread_mutex_t mutex;
uint spins; uint spins;
uint rng_state;
} my_pthread_fastmutex_t; } my_pthread_fastmutex_t;
void fastmutex_global_init(void); void fastmutex_global_init(void);
......
...@@ -442,8 +442,6 @@ SELECT f1(); ...@@ -442,8 +442,6 @@ SELECT f1();
INSERT INTO t1 VALUES (NULL, f2()), (NULL, LAST_INSERT_ID()), INSERT INTO t1 VALUES (NULL, f2()), (NULL, LAST_INSERT_ID()),
(NULL, LAST_INSERT_ID()), (NULL, f2()), (NULL, f2()); (NULL, LAST_INSERT_ID()), (NULL, f2()), (NULL, f2());
INSERT INTO t1 VALUES (NULL, f2()); INSERT INTO t1 VALUES (NULL, f2());
INSERT INTO t1 VALUES (NULL, LAST_INSERT_ID()), (NULL, LAST_INSERT_ID(5)),
(NULL, @@LAST_INSERT_ID);
# Test replication of substitution "IS NULL" -> "= LAST_INSERT_ID". # Test replication of substitution "IS NULL" -> "= LAST_INSERT_ID".
INSERT INTO t1 VALUES (NULL, 0), (NULL, LAST_INSERT_ID()); INSERT INTO t1 VALUES (NULL, 0), (NULL, LAST_INSERT_ID());
UPDATE t1 SET j= -1 WHERE i IS NULL; UPDATE t1 SET j= -1 WHERE i IS NULL;
......
...@@ -471,3 +471,184 @@ source include/diff_tables.inc; ...@@ -471,3 +471,184 @@ source include/diff_tables.inc;
connection master; connection master;
drop table t1; drop table t1;
sync_slave_with_master; sync_slave_with_master;
#
# Bug #38230 Differences between master and slave after
# UPDATE or DELETE with LIMIT with pk
#
# the regression test verifies consistency via selecting
--disable_abort_on_error
--connection master
--disable_warnings
DROP TABLE IF EXISTS t1, t2;
--enable_warnings
eval CREATE TABLE t1 (
`pk` int(11) NOT NULL AUTO_INCREMENT,
`int_nokey` int(11) NOT NULL,
`int_key` int(11) NOT NULL,
`date_key` date NOT NULL,
`date_nokey` date NOT NULL,
`time_key` time NOT NULL,
`time_nokey` time NOT NULL,
`datetime_key` datetime NOT NULL,
`datetime_nokey` datetime NOT NULL,
`varchar_key` varchar(1) NOT NULL,
`varchar_nokey` varchar(1) NOT NULL,
PRIMARY KEY (`pk`),
KEY `int_key` (`int_key`),
KEY `date_key` (`date_key`),
KEY `time_key` (`time_key`),
KEY `datetime_key` (`datetime_key`),
KEY `varchar_key` (`varchar_key`)
) ENGINE=$type;
INSERT INTO t1 VALUES (1,8,5,'0000-00-00','0000-00-00','10:37:38','10:37:38','0000-00-00 00:00:00','0000-00-00 00:00:00','p','p'),(2,0,9,'0000-00-00','0000-00-00','00:00:00','00:00:00','2007-10-14 00:00:00','2007-10-14 00:00:00','d','d');
eval CREATE TABLE t2 (
`pk` int(11) NOT NULL AUTO_INCREMENT,
`int_nokey` int(11) NOT NULL,
`int_key` int(11) NOT NULL,
`date_key` date NOT NULL,
`date_nokey` date NOT NULL,
`time_key` time NOT NULL,
`time_nokey` time NOT NULL,
`datetime_key` datetime NOT NULL,
`datetime_nokey` datetime NOT NULL,
`varchar_key` varchar(1) NOT NULL,
`varchar_nokey` varchar(1) NOT NULL,
PRIMARY KEY (`pk`),
KEY `int_key` (`int_key`),
KEY `date_key` (`date_key`),
KEY `time_key` (`time_key`),
KEY `datetime_key` (`datetime_key`),
KEY `varchar_key` (`varchar_key`)
) ENGINE=$type;
INSERT INTO t2 VALUES (1,1,6,'2005-12-23','2005-12-23','02:24:28','02:24:28','0000-00-00 00:00:00','0000-00-00 00:00:00','g','g'),(2,0,3,'2009-09-14','2009-09-14','00:00:00','00:00:00','2000-01-30 16:39:40','2000-01-30 16:39:40','q','q'),(3,0,3,'0000-00-00','0000-00-00','00:00:00','00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','c','c'),(4,1,6,'2007-03-29','2007-03-29','15:49:00','15:49:00','0000-00-00 00:00:00','0000-00-00 00:00:00','m','m'),(5,4,0,'2002-12-04','2002-12-04','00:00:00','00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','o','o'),(6,9,0,'2005-01-28','2005-01-28','00:00:00','00:00:00','2001-05-18 00:00:00','2001-05-18 00:00:00','w','w'),(7,6,0,'0000-00-00','0000-00-00','06:57:25','06:57:25','0000-00-00 00:00:00','0000-00-00 00:00:00','m','m'),(8,0,0,'0000-00-00','0000-00-00','00:00:00','00:00:00','0000-00-00 00:00:00','0000-00-00 00:00:00','z','z'),(9,4,6,'2006-08-15','2006-08-15','00:00:00','00:00:00','2002-04-12 14:44:25','2002-04-12 14:44:25','j','j'),(10,0,5,'2006-12-20','2006-12-20','10:13:53','10:13:53','2008-07-22 00:00:00','2008-07-22 00:00:00','y','y'),(11,9,7,'0000-00-00','0000-00-00','00:00:00','00:00:00','2004-07-05 00:00:00','2004-07-05 00:00:00','{','{'),(12,4,3,'2007-01-26','2007-01-26','23:00:51','23:00:51','2001-05-16 00:00:00','2001-05-16 00:00:00','f','f'),(13,7,0,'2004-03-27','2004-03-27','00:00:00','00:00:00','2005-01-24 03:30:37','2005-01-24 03:30:37','',''),(14,6,0,'2006-07-26','2006-07-26','18:43:57','18:43:57','0000-00-00 00:00:00','0000-00-00 00:00:00','{','{'),(15,0,6,'2000-01-14','2000-01-14','00:00:00','00:00:00','2000-09-21 00:00:00','2000-09-21 00:00:00','o','o'),(16,9,8,'0000-00-00','0000-00-00','21:15:08','21:15:08','0000-00-00 00:00:00','0000-00-00 00:00:00','a','a'),(17,2,0,'2004-10-27','2004-10-27','00:00:00','00:00:00','2004-03-24 22:13:43','2004-03-24 22:13:43','',''),(18,7,4,'0000-00-00','0000-00-00','08:38:27','08:38:27','2002-03-18 19:51:44','2002-03-18 19:51:44','t','t'),(19,5,3,'2008-03-07','2008-03-07','03:29:07','03:29:07','2007-12-01 18:44:44','2007-12-01 18:44:44','t','t'),(20,0,0,'2002-04-09','2002-04-09','16:06:03','16:06:03','2009-04-22 00:00:00','2009-04-22 00:00:00','n','n');
DELETE FROM t2 WHERE `int_key` < 3 LIMIT 1;
UPDATE t1 SET `int_key` = 3 ORDER BY `pk` LIMIT 4;
DELETE FROM t2 WHERE `int_key` < 3 LIMIT 1;
DELETE FROM t2 WHERE `pk` < 6 LIMIT 1;
UPDATE t1 SET `int_key` = 6 ORDER BY `pk` LIMIT 3;
DELETE FROM t2 WHERE `pk` < 6 LIMIT 1;
UPDATE t1 SET `pk` = 6 ORDER BY `int_key` LIMIT 6;
DELETE FROM t2 WHERE `pk` < 7 LIMIT 1;
UPDATE t1 SET `int_key` = 4 ORDER BY `pk` LIMIT 6;
--sync_slave_with_master
--echo *** results: t2 must be consistent ****
let $diff_table_1=master:test.t2;
let $diff_table_2=master:test.t2;
source include/diff_tables.inc;
--connection master
DROP TABLE t1, t2;
--enable_abort_on_error
--echo EOF OF TESTS
#
# BUG#40004: Replication failure with no PK + no indexes
#
# The test cases are taken from the bug report. It is difficult to
# produce a test case that generates a HA_ERR_RECORD_DELETED, so we go
# with the test cases we have.
connection master;
eval CREATE TABLE t1 (a int) ENGINE=$type;
INSERT IGNORE INTO t1 VALUES (NULL);
INSERT INTO t1 ( a ) VALUES ( 0 );
INSERT INTO t1 ( a ) VALUES ( 9 );
INSERT INTO t1 ( a ) VALUES ( 2 );
INSERT INTO t1 ( a ) VALUES ( 9 );
INSERT INTO t1 ( a ) VALUES ( 5 );
UPDATE t1 SET a = 5 WHERE a = 9;
DELETE FROM t1 WHERE a < 6;
UPDATE t1 SET a = 9 WHERE a < 3;
INSERT INTO t1 ( a ) VALUES ( 3 );
UPDATE t1 SET a = 0 WHERE a < 4;
UPDATE t1 SET a = 8 WHERE a < 5;
sync_slave_with_master;
let $diff_table_1=master:test.t1;
let $diff_table_2=slave:test.t1;
source include/diff_tables.inc;
connection master;
drop table t1;
sync_slave_with_master;
#
# Bug #39752: Replication failure on RBR + MyISAM + no PK
#
# The test cases are taken from the bug report. It is difficult to
# produce a test case that generates a HA_ERR_RECORD_DELETED, so we go
# with the test cases we have.
connection master;
--disable_warnings
eval CREATE TABLE t1 (a bit) ENGINE=$type;
INSERT IGNORE INTO t1 VALUES (NULL);
INSERT INTO t1 ( a ) VALUES ( 0 );
UPDATE t1 SET a = 0 WHERE a = 1 LIMIT 3;
INSERT INTO t1 ( a ) VALUES ( 5 );
DELETE FROM t1 WHERE a < 2 LIMIT 4;
DELETE FROM t1 WHERE a < 9 LIMIT 4;
INSERT INTO t1 ( a ) VALUES ( 9 );
UPDATE t1 SET a = 8 WHERE a = 0 LIMIT 6;
INSERT INTO t1 ( a ) VALUES ( 8 );
UPDATE t1 SET a = 0 WHERE a < 6 LIMIT 0;
INSERT INTO t1 ( a ) VALUES ( 4 );
INSERT INTO t1 ( a ) VALUES ( 3 );
UPDATE t1 SET a = 0 WHERE a = 7 LIMIT 6;
DELETE FROM t1 WHERE a = 4 LIMIT 7;
UPDATE t1 SET a = 9 WHERE a < 2 LIMIT 9;
UPDATE t1 SET a = 0 WHERE a < 9 LIMIT 2;
DELETE FROM t1 WHERE a < 0 LIMIT 5;
INSERT INTO t1 ( a ) VALUES ( 5 );
UPDATE t1 SET a = 4 WHERE a < 6 LIMIT 4;
INSERT INTO t1 ( a ) VALUES ( 5 );
UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 8;
DELETE FROM t1 WHERE a < 8 LIMIT 8;
INSERT INTO t1 ( a ) VALUES ( 6 );
DELETE FROM t1 WHERE a < 6 LIMIT 7;
UPDATE t1 SET a = 7 WHERE a = 3 LIMIT 7;
UPDATE t1 SET a = 8 WHERE a = 0 LIMIT 6;
INSERT INTO t1 ( a ) VALUES ( 7 );
DELETE FROM t1 WHERE a < 9 LIMIT 4;
INSERT INTO t1 ( a ) VALUES ( 7 );
INSERT INTO t1 ( a ) VALUES ( 6 );
UPDATE t1 SET a = 8 WHERE a = 3 LIMIT 4;
DELETE FROM t1 WHERE a = 2 LIMIT 9;
DELETE FROM t1 WHERE a = 1 LIMIT 4;
UPDATE t1 SET a = 4 WHERE a = 2 LIMIT 7;
INSERT INTO t1 ( a ) VALUES ( 0 );
DELETE FROM t1 WHERE a < 3 LIMIT 0;
UPDATE t1 SET a = 8 WHERE a = 5 LIMIT 2;
INSERT INTO t1 ( a ) VALUES ( 1 );
UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 3;
--enable_warnings
sync_slave_with_master;
let $diff_table_1=master:test.t1;
let $diff_table_2=slave:test.t1;
source include/diff_tables.inc;
connection master;
drop table t1;
sync_slave_with_master;
# 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
...@@ -1222,4 +1222,34 @@ ALTER TABLE t1 CHANGE d c varchar(10); ...@@ -1222,4 +1222,34 @@ ALTER TABLE t1 CHANGE d c varchar(10);
affected rows: 0 affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0 info: Records: 0 Duplicates: 0 Warnings: 0
DROP TABLE t1; DROP TABLE t1;
create table t1(f1 int not null, f2 int not null, key (f1), key (f2));
select index_length into @unpaked_keys_size from
information_schema.tables where table_name='t1';
alter table t1 pack_keys=1;
select index_length into @paked_keys_size from
information_schema.tables where table_name='t1';
select (@unpaked_keys_size > @paked_keys_size);
(@unpaked_keys_size > @paked_keys_size)
1
select max_data_length into @orig_max_data_length from
information_schema.tables where table_name='t1';
alter table t1 max_rows=100;
select max_data_length into @changed_max_data_length from
information_schema.tables where table_name='t1';
select (@orig_max_data_length > @changed_max_data_length);
(@orig_max_data_length > @changed_max_data_length)
1
drop table t1;
CREATE TABLE t1(a INT AUTO_INCREMENT PRIMARY KEY,
b ENUM('a', 'b', 'c') NOT NULL);
INSERT INTO t1 (b) VALUES ('a'), ('c'), ('b'), ('b'), ('a');
ALTER TABLE t1 MODIFY b ENUM('a', 'z', 'b', 'c') NOT NULL;
SELECT * FROM t1;
a b
1 a
2 c
3 b
4 b
5 a
DROP TABLE t1;
End of 5.1 tests End of 5.1 tests
SELECT @@GLOBAL.binlog_format;
@@GLOBAL.binlog_format
STATEMENT
'#---------------------BS_STVARS_002_01----------------------#' '#---------------------BS_STVARS_002_01----------------------#'
SET @start_value= @@global.binlog_format; SET @start_value= @@global.binlog_format;
SELECT COUNT(@@GLOBAL.binlog_format); SELECT COUNT(@@GLOBAL.binlog_format);
......
...@@ -59,7 +59,8 @@ begin ...@@ -59,7 +59,8 @@ begin
select get_lock('test_bug16407', 60); select get_lock('test_bug16407', 60);
end| end|
"Now if everything is fine the event has compiled and is locked" "Now if everything is fine the event has compiled and is locked"
select /*1*/ user, host, db, info from information_schema.processlist where command!='Daemon' and (info is null or info not like '%processlist%') order by info; select /*1*/ user, host, db, info from information_schema.processlist
where info = 'select get_lock(\'test_bug16407\', 60)';
user host db info user host db info
root localhost events_test select get_lock('test_bug16407', 60) root localhost events_test select get_lock('test_bug16407', 60)
select release_lock('test_bug16407'); select release_lock('test_bug16407');
...@@ -114,18 +115,18 @@ event_schema event_name sql_mode ...@@ -114,18 +115,18 @@ event_schema event_name sql_mode
events_test ee_16407_2 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER events_test ee_16407_2 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
events_test ee_16407_3 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER events_test ee_16407_3 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
events_test ee_16407_4 events_test ee_16407_4
select /*2*/ user, host, db, info from information_schema.processlist where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%') order by info; select /*2*/ user, host, db, info from information_schema.processlist
where info = 'select get_lock(\'ee_16407_2\', 60)';
user host db info user host db info
event_scheduler localhost NULL NULL
root localhost events_test select get_lock('ee_16407_2', 60) root localhost events_test select get_lock('ee_16407_2', 60)
root localhost events_test select get_lock('ee_16407_2', 60) root localhost events_test select get_lock('ee_16407_2', 60)
root localhost events_test select get_lock('ee_16407_2', 60) root localhost events_test select get_lock('ee_16407_2', 60)
select release_lock('ee_16407_2'); select release_lock('ee_16407_2');
release_lock('ee_16407_2') release_lock('ee_16407_2')
1 1
select /*3*/ user, host, db, info from information_schema.processlist where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%') order by info; select /*3*/ user, host, db, info from information_schema.processlist
where info = 'select get_lock(\'ee_16407_2\', 60)';
user host db info user host db info
event_scheduler localhost NULL NULL
set global event_scheduler= off; set global event_scheduler= off;
select * from events_smode_test order by ev_name, a; select * from events_smode_test order by ev_name, a;
ev_name a ev_name a
...@@ -164,7 +165,9 @@ select release_lock('ee_16407_5'); ...@@ -164,7 +165,9 @@ select release_lock('ee_16407_5');
call events_test.ee_16407_6_pendant(); call events_test.ee_16407_6_pendant();
end| end|
"Should have 2 locked processes" "Should have 2 locked processes"
select /*4*/ user, host, db, info from information_schema.processlist where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%') order by info; select /*4*/ user, host, db, info from information_schema.processlist
where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%')
order by info;
user host db info user host db info
event_scheduler localhost NULL NULL event_scheduler localhost NULL NULL
root localhost events_test select get_lock('ee_16407_5', 60) root localhost events_test select get_lock('ee_16407_5', 60)
...@@ -173,7 +176,9 @@ select release_lock('ee_16407_5'); ...@@ -173,7 +176,9 @@ select release_lock('ee_16407_5');
release_lock('ee_16407_5') release_lock('ee_16407_5')
1 1
"Should have 0 processes locked" "Should have 0 processes locked"
select /*5*/ user, host, db, info from information_schema.processlist where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%') order by info; select /*5*/ user, host, db, info from information_schema.processlist
where (command!='Daemon' || user='event_scheduler') and (info is null or info not like '%processlist%')
order by info;
user host db info user host db info
event_scheduler localhost NULL NULL event_scheduler localhost NULL NULL
select * from events_smode_test order by ev_name, a; select * from events_smode_test order by ev_name, a;
...@@ -566,10 +571,9 @@ SHOW GRANTS FOR CURRENT_USER; ...@@ -566,10 +571,9 @@ SHOW GRANTS FOR CURRENT_USER;
Grants for root@localhost Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
SET GLOBAL event_scheduler = ON; SET GLOBAL event_scheduler = ON;
CREATE TABLE event_log (id int KEY AUTO_INCREMENT, CREATE TABLE events_test.event_log
ev_nm char(40), ev_cnt int, (id int KEY AUTO_INCREMENT, ev_nm char(40), ev_cnt int, ev_tm timestamp)
ev_tm timestamp) ENGINE=MyISAM; ENGINE=MyISAM;
SET @ev_base_date = 20281224180000;
SET autocommit=0; SET autocommit=0;
CREATE USER evtest1@localhost; CREATE USER evtest1@localhost;
SET PASSWORD FOR evtest1@localhost = password('ev1'); SET PASSWORD FOR evtest1@localhost = password('ev1');
...@@ -582,41 +586,40 @@ GRANT USAGE ON *.* TO 'evtest1'@'localhost' IDENTIFIED BY PASSWORD '*3170F3644E3 ...@@ -582,41 +586,40 @@ GRANT USAGE ON *.* TO 'evtest1'@'localhost' IDENTIFIED BY PASSWORD '*3170F3644E3
GRANT SELECT, INSERT ON `test`.* TO 'evtest1'@'localhost' GRANT SELECT, INSERT ON `test`.* TO 'evtest1'@'localhost'
GRANT SELECT, INSERT, CREATE, EVENT ON `events_test`.* TO 'evtest1'@'localhost' GRANT SELECT, INSERT, CREATE, EVENT ON `events_test`.* TO 'evtest1'@'localhost'
connection e1; connection e1;
USE events_test;
CREATE EVENT ev_sched_1823 ON SCHEDULE EVERY 2 SECOND CREATE EVENT ev_sched_1823 ON SCHEDULE EVERY 2 SECOND
DO BEGIN DO BEGIN
SET AUTOCOMMIT = 0; SET AUTOCOMMIT = 0;
SET @evname = 'ev_sched_1823'; SET @evname = 'ev_sched_1823';
SET @cnt = 0; SET @cnt = 0;
SELECT COUNT(*) INTO @cnt FROM test.event_log WHERE ev_nm = @evname; SELECT COUNT(*) INTO @cnt FROM events_test.event_log WHERE ev_nm = @evname;
IF @cnt < 6 THEN IF @cnt < 6 THEN
INSERT INTO test.event_log VALUES (NULL,@evname,@cnt+1,current_timestamp()); INSERT INTO events_test.event_log VALUES (NULL,@evname,@cnt+1,current_timestamp());
COMMIT; COMMIT;
END IF; END IF;
SELECT COUNT(*) INTO @cnt FROM test.event_log WHERE ev_nm = @evname; SELECT COUNT(*) INTO @cnt FROM events_test.event_log WHERE ev_nm = @evname;
IF @cnt < 6 THEN IF @cnt < 6 THEN
INSERT INTO test.event_log VALUES (NULL,@evname,@cnt+1,current_timestamp()); INSERT INTO events_test.event_log VALUES (NULL,@evname,@cnt+1,current_timestamp());
ROLLBACK; ROLLBACK;
END IF; END IF;
END;| END;|
Sleep till the first INSERT into events_test.event_log occured
SELECT COUNT(*) > 0 AS "Expect 1" FROM events_test.event_log;
Expect 1
1
connection default; connection default;
DROP EVENT ev_sched_1823;
DROP USER evtest1@localhost; DROP USER evtest1@localhost;
USE test; Sleep 4 seconds
===================================================================================== SELECT COUNT(*) INTO @row_cnt FROM events_test.event_log;
select id,ev_nm,ev_cnt from event_log order by id; Sleep 4 seconds
id ev_nm ev_cnt SELECT COUNT(*) > @row_cnt AS "Expect 0" FROM events_test.event_log;
1 ev_sched_1823 1 Expect 0
2 ev_sched_1823 2 0
3 ev_sched_1823 3 DROP EVENT events_test.ev_sched_1823;
4 ev_sched_1823 4 DROP TABLE events_test.event_log;
5 ev_sched_1823 5
6 ev_sched_1823 6
DROP TABLE event_log;
SET GLOBAL event_scheduler = OFF; SET GLOBAL event_scheduler = OFF;
SET GLOBAL event_scheduler= ON; SET GLOBAL event_scheduler= ON;
CREATE EVENT bug28641 ON SCHEDULE AT '2038.01.18 03:00:00' CREATE EVENT bug28641 ON SCHEDULE AT '2038.01.18 03:00:00'
DO BEGIN DO BEGIN
SELECT 1; SELECT 1;
END;| END;|
SET GLOBAL event_scheduler= OFF; SET GLOBAL event_scheduler= OFF;
......
...@@ -107,3 +107,78 @@ X X X X X X X X X ...@@ -107,3 +107,78 @@ X X X X X X X X X
X X X X X X X X X Range checked for each record (index map: 0xFFFFFFFFFF) X X X X X X X X X Range checked for each record (index map: 0xFFFFFFFFFF)
DROP TABLE t2; DROP TABLE t2;
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1(a INT);
CREATE TABLE t2(a INT);
INSERT INTO t1 VALUES (1),(2);
INSERT INTO t2 VALUES (1),(2);
EXPLAIN EXTENDED SELECT 1
FROM (SELECT COUNT(DISTINCT t1.a) FROM t1,t2 GROUP BY t1.a) AS s1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 100.00
2 DERIVED t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort
2 DERIVED t2 ALL NULL NULL NULL NULL 2 100.00 Using join buffer
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`
EXPLAIN EXTENDED SELECT 1
FROM (SELECT COUNT(DISTINCT t1.a) FROM t1,t2 GROUP BY t1.a) AS s1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 100.00
2 DERIVED t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort
2 DERIVED t2 ALL NULL NULL NULL NULL 2 100.00 Using join buffer
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`
prepare s1 from
'EXPLAIN EXTENDED SELECT 1
FROM (SELECT COUNT(DISTINCT t1.a) FROM t1,t2 GROUP BY t1.a) AS s1';
execute s1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 100.00
2 DERIVED t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort
2 DERIVED t2 ALL NULL NULL NULL NULL 2 100.00 Using join buffer
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`
prepare s1 from
'EXPLAIN EXTENDED SELECT 1
FROM (SELECT COUNT(DISTINCT t1.a) FROM t1,t2 GROUP BY t1.a) AS s1';
execute s1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 100.00
2 DERIVED t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort
2 DERIVED t2 ALL NULL NULL NULL NULL 2 100.00 Using join buffer
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`
execute s1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 100.00
2 DERIVED t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort
2 DERIVED t2 ALL NULL NULL NULL NULL 2 100.00 Using join buffer
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`
DROP TABLE t1,t2;
#
# Bug#37870: Usage of uninitialized value caused failed assertion.
#
create table t1 (dt datetime not null, t time not null);
create table t2 (dt datetime not null);
insert into t1 values ('2001-01-01 1:1:1', '1:1:1'),
('2001-01-01 1:1:1', '1:1:1');
insert into t2 values ('2001-01-01 1:1:1'), ('2001-01-01 1:1:1');
flush tables;
EXPLAIN SELECT OUTR.dt FROM t1 AS OUTR WHERE OUTR.dt IN (SELECT INNR.dt FROM t2 AS INNR WHERE OUTR.dt IS NULL );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY OUTR ALL NULL NULL NULL NULL 2 Using where
2 DEPENDENT SUBQUERY INNR ALL NULL NULL NULL NULL 2 Using where
flush tables;
SELECT OUTR.dt FROM t1 AS OUTR WHERE OUTR.dt IN (SELECT INNR.dt FROM t2 AS INNR WHERE OUTR.dt IS NULL );
dt
flush tables;
EXPLAIN SELECT OUTR.dt FROM t1 AS OUTR WHERE OUTR.dt IN ( SELECT INNR.dt FROM t2 AS INNR WHERE OUTR.t < '2005-11-13 7:41:31' );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY OUTR ALL NULL NULL NULL NULL 2 Using where
2 DEPENDENT SUBQUERY INNR ALL NULL NULL NULL NULL 2 Using where
flush tables;
SELECT OUTR.dt FROM t1 AS OUTR WHERE OUTR.dt IN ( SELECT INNR.dt FROM t2 AS INNR WHERE OUTR.t < '2005-11-13 7:41:31' );
dt
2001-01-01 01:01:01
2001-01-01 01:01:01
drop tables t1, t2;
...@@ -1274,6 +1274,36 @@ tt ...@@ -1274,6 +1274,36 @@ tt
41 41
SET sql_mode=@save_sql_mode; SET sql_mode=@save_sql_mode;
DROP TABLE t1, t2; DROP TABLE t1, t2;
#
# BUG#38072: Wrong result: HAVING not observed in a query with aggregate
#
CREATE TABLE t1 (
pk int(11) NOT NULL AUTO_INCREMENT,
int_nokey int(11) NOT NULL,
int_key int(11) NOT NULL,
varchar_key varchar(1) NOT NULL,
varchar_nokey varchar(1) NOT NULL,
PRIMARY KEY (pk),
KEY int_key (int_key),
KEY varchar_key (varchar_key)
);
INSERT INTO t1 VALUES
(1,5,5, 'h','h'),
(2,1,1, '{','{'),
(3,1,1, 'z','z'),
(4,8,8, 'x','x'),
(5,7,7, 'o','o'),
(6,3,3, 'p','p'),
(7,9,9, 'c','c'),
(8,0,0, 'k','k'),
(9,6,6, 't','t'),
(10,0,0,'c','c');
explain SELECT COUNT(varchar_key) AS X FROM t1 WHERE pk = 8 having 'foo'='bar';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible HAVING
SELECT COUNT(varchar_key) AS X FROM t1 WHERE pk = 8 having 'foo'='bar';
X
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,
PRIMARY KEY (a), PRIMARY KEY (a),
......
...@@ -766,7 +766,6 @@ table_schema table_name column_name ...@@ -766,7 +766,6 @@ table_schema table_name column_name
information_schema COLUMNS COLUMN_DEFAULT information_schema COLUMNS COLUMN_DEFAULT
information_schema COLUMNS COLUMN_TYPE information_schema COLUMNS COLUMN_TYPE
information_schema EVENTS EVENT_DEFINITION information_schema EVENTS EVENT_DEFINITION
information_schema EVENTS SQL_MODE
information_schema PARTITIONS PARTITION_EXPRESSION information_schema PARTITIONS PARTITION_EXPRESSION
information_schema PARTITIONS SUBPARTITION_EXPRESSION information_schema PARTITIONS SUBPARTITION_EXPRESSION
information_schema PARTITIONS PARTITION_DESCRIPTION information_schema PARTITIONS PARTITION_DESCRIPTION
...@@ -776,8 +775,6 @@ information_schema ROUTINES ROUTINE_DEFINITION ...@@ -776,8 +775,6 @@ information_schema ROUTINES ROUTINE_DEFINITION
information_schema ROUTINES SQL_MODE information_schema ROUTINES SQL_MODE
information_schema TRIGGERS ACTION_CONDITION information_schema TRIGGERS ACTION_CONDITION
information_schema TRIGGERS ACTION_STATEMENT information_schema TRIGGERS ACTION_STATEMENT
information_schema TRIGGERS SQL_MODE
information_schema TRIGGERS DEFINER
information_schema VIEWS VIEW_DEFINITION information_schema VIEWS VIEW_DEFINITION
select table_name, column_name, data_type from information_schema.columns select table_name, column_name, data_type from information_schema.columns
where data_type = 'datetime'; where data_type = 'datetime';
...@@ -1654,4 +1651,13 @@ drop table t1; ...@@ -1654,4 +1651,13 @@ drop table t1;
drop function f1; drop function f1;
select * from information_schema.tables where 1=sleep(100000); select * from information_schema.tables where 1=sleep(100000);
select * from information_schema.columns where 1=sleep(100000); select * from information_schema.columns where 1=sleep(100000);
explain select count(*) from information_schema.tables;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tables ALL NULL NULL NULL NULL NULL Skip_open_table; Scanned all databases
explain select count(*) from information_schema.columns;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE columns ALL NULL NULL NULL NULL NULL Open_frm_only; Scanned all databases
explain select count(*) from information_schema.views;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE views ALL NULL NULL NULL NULL NULL Open_frm_only; Scanned all databases
End of 5.1 tests. End of 5.1 tests.
...@@ -119,7 +119,10 @@ SHOW CREATE TABLE t1; ...@@ -119,7 +119,10 @@ SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) SUBPARTITION BY LINEAR HASH (a) (PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM) */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (a)
SUBPARTITION BY LINEAR HASH (a)
(PARTITION p0 VALUES LESS THAN (10) ENGINE = MyISAM) */
select SUBPARTITION_METHOD FROM information_schema.partitions WHERE select SUBPARTITION_METHOD FROM information_schema.partitions WHERE
table_schema="test" AND table_name="t1"; table_schema="test" AND table_name="t1";
SUBPARTITION_METHOD SUBPARTITION_METHOD
...@@ -134,7 +137,9 @@ SHOW CREATE TABLE t1; ...@@ -134,7 +137,9 @@ SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION p0 VALUES IN (10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53) ENGINE = MyISAM) */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53) ENGINE = MyISAM) */
SELECT PARTITION_DESCRIPTION FROM information_schema.partitions WHERE SELECT PARTITION_DESCRIPTION FROM information_schema.partitions WHERE
table_schema = "test" AND table_name = "t1"; table_schema = "test" AND table_name = "t1";
PARTITION_DESCRIPTION PARTITION_DESCRIPTION
......
'#---------------------BS_STVARS_025_01----------------------#' '#---------------------BS_STVARS_025_01----------------------#'
SELECT COUNT(@@GLOBAL.innodb_data_home_dir); SELECT COUNT(@@GLOBAL.innodb_data_home_dir);
COUNT(@@GLOBAL.innodb_data_home_dir) COUNT(@@GLOBAL.innodb_data_home_dir)
0 1
1 Expected 1 Expected
'#---------------------BS_STVARS_025_02----------------------#' '#---------------------BS_STVARS_025_02----------------------#'
SET @@GLOBAL.innodb_data_home_dir=1; SET @@GLOBAL.innodb_data_home_dir=1;
...@@ -9,7 +9,7 @@ ERROR HY000: Variable 'innodb_data_home_dir' is a read only variable ...@@ -9,7 +9,7 @@ ERROR HY000: Variable 'innodb_data_home_dir' is a read only variable
Expected error 'Read only variable' Expected error 'Read only variable'
SELECT COUNT(@@GLOBAL.innodb_data_home_dir); SELECT COUNT(@@GLOBAL.innodb_data_home_dir);
COUNT(@@GLOBAL.innodb_data_home_dir) COUNT(@@GLOBAL.innodb_data_home_dir)
0 1
1 Expected 1 Expected
'#---------------------BS_STVARS_025_03----------------------#' '#---------------------BS_STVARS_025_03----------------------#'
SELECT @@GLOBAL.innodb_data_home_dir = VARIABLE_VALUE SELECT @@GLOBAL.innodb_data_home_dir = VARIABLE_VALUE
...@@ -20,7 +20,7 @@ NULL ...@@ -20,7 +20,7 @@ NULL
1 Expected 1 Expected
SELECT COUNT(@@GLOBAL.innodb_data_home_dir); SELECT COUNT(@@GLOBAL.innodb_data_home_dir);
COUNT(@@GLOBAL.innodb_data_home_dir) COUNT(@@GLOBAL.innodb_data_home_dir)
0 1
1 Expected 1 Expected
SELECT COUNT(VARIABLE_VALUE) SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
...@@ -36,7 +36,7 @@ NULL ...@@ -36,7 +36,7 @@ NULL
'#---------------------BS_STVARS_025_05----------------------#' '#---------------------BS_STVARS_025_05----------------------#'
SELECT COUNT(@@innodb_data_home_dir); SELECT COUNT(@@innodb_data_home_dir);
COUNT(@@innodb_data_home_dir) COUNT(@@innodb_data_home_dir)
0 1
1 Expected 1 Expected
SELECT COUNT(@@local.innodb_data_home_dir); SELECT COUNT(@@local.innodb_data_home_dir);
ERROR HY000: Variable 'innodb_data_home_dir' is a GLOBAL variable ERROR HY000: Variable 'innodb_data_home_dir' is a GLOBAL variable
...@@ -46,7 +46,7 @@ ERROR HY000: Variable 'innodb_data_home_dir' is a GLOBAL variable ...@@ -46,7 +46,7 @@ ERROR HY000: Variable 'innodb_data_home_dir' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable' Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.innodb_data_home_dir); SELECT COUNT(@@GLOBAL.innodb_data_home_dir);
COUNT(@@GLOBAL.innodb_data_home_dir) COUNT(@@GLOBAL.innodb_data_home_dir)
0 1
1 Expected 1 Expected
SELECT innodb_data_home_dir = @@SESSION.innodb_data_home_dir; SELECT innodb_data_home_dir = @@SESSION.innodb_data_home_dir;
ERROR 42S22: Unknown column 'innodb_data_home_dir' in 'field list' ERROR 42S22: Unknown column 'innodb_data_home_dir' in 'field list'
......
'#---------------------BS_STVARS_029_01----------------------#' '#---------------------BS_STVARS_029_01----------------------#'
SELECT COUNT(@@GLOBAL.innodb_flush_method); SELECT COUNT(@@GLOBAL.innodb_flush_method);
COUNT(@@GLOBAL.innodb_flush_method) COUNT(@@GLOBAL.innodb_flush_method)
0 1
1 Expected 1 Expected
'#---------------------BS_STVARS_029_02----------------------#' '#---------------------BS_STVARS_029_02----------------------#'
SET @@GLOBAL.innodb_flush_method=1; SET @@GLOBAL.innodb_flush_method=1;
...@@ -9,7 +9,7 @@ ERROR HY000: Variable 'innodb_flush_method' is a read only variable ...@@ -9,7 +9,7 @@ ERROR HY000: Variable 'innodb_flush_method' is a read only variable
Expected error 'Read only variable' Expected error 'Read only variable'
SELECT COUNT(@@GLOBAL.innodb_flush_method); SELECT COUNT(@@GLOBAL.innodb_flush_method);
COUNT(@@GLOBAL.innodb_flush_method) COUNT(@@GLOBAL.innodb_flush_method)
0 1
1 Expected 1 Expected
'#---------------------BS_STVARS_029_03----------------------#' '#---------------------BS_STVARS_029_03----------------------#'
SELECT @@GLOBAL.innodb_flush_method = VARIABLE_VALUE SELECT @@GLOBAL.innodb_flush_method = VARIABLE_VALUE
...@@ -20,7 +20,7 @@ NULL ...@@ -20,7 +20,7 @@ NULL
1 Expected 1 Expected
SELECT COUNT(@@GLOBAL.innodb_flush_method); SELECT COUNT(@@GLOBAL.innodb_flush_method);
COUNT(@@GLOBAL.innodb_flush_method) COUNT(@@GLOBAL.innodb_flush_method)
0 1
1 Expected 1 Expected
SELECT COUNT(VARIABLE_VALUE) SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
...@@ -36,7 +36,7 @@ NULL ...@@ -36,7 +36,7 @@ NULL
'#---------------------BS_STVARS_029_05----------------------#' '#---------------------BS_STVARS_029_05----------------------#'
SELECT COUNT(@@innodb_flush_method); SELECT COUNT(@@innodb_flush_method);
COUNT(@@innodb_flush_method) COUNT(@@innodb_flush_method)
0 1
1 Expected 1 Expected
SELECT COUNT(@@local.innodb_flush_method); SELECT COUNT(@@local.innodb_flush_method);
ERROR HY000: Variable 'innodb_flush_method' is a GLOBAL variable ERROR HY000: Variable 'innodb_flush_method' is a GLOBAL variable
...@@ -46,7 +46,7 @@ ERROR HY000: Variable 'innodb_flush_method' is a GLOBAL variable ...@@ -46,7 +46,7 @@ ERROR HY000: Variable 'innodb_flush_method' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable' Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.innodb_flush_method); SELECT COUNT(@@GLOBAL.innodb_flush_method);
COUNT(@@GLOBAL.innodb_flush_method) COUNT(@@GLOBAL.innodb_flush_method)
0 1
1 Expected 1 Expected
SELECT innodb_flush_method = @@SESSION.innodb_flush_method; SELECT innodb_flush_method = @@SESSION.innodb_flush_method;
ERROR 42S22: Unknown column 'innodb_flush_method' in 'field list' ERROR 42S22: Unknown column 'innodb_flush_method' in 'field list'
......
...@@ -1668,3 +1668,12 @@ explain select a from t2 where a=b; ...@@ -1668,3 +1668,12 @@ explain select a from t2 where a=b;
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 t2 index NULL a 10 NULL # Using where; Using index 1 SIMPLE t2 index NULL a 10 NULL # Using where; Using index
drop table t1, t2; drop table t1, t2;
SET SESSION BINLOG_FORMAT=STATEMENT;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
select @@session.sql_log_bin, @@session.binlog_format, @@session.tx_isolation;
@@session.sql_log_bin 1
@@session.binlog_format STATEMENT
@@session.tx_isolation READ-COMMITTED
CREATE TABLE t1 ( a INT ) ENGINE=InnoDB;
INSERT INTO t1 VALUES(1);
DROP TABLE t1;
...@@ -111,3 +111,6 @@ set @a=-14632475938453979136; ...@@ -111,3 +111,6 @@ set @a=-14632475938453979136;
execute s using @a, @a; execute s using @a, @a;
ERROR HY000: Incorrect arguments to EXECUTE ERROR HY000: Incorrect arguments to EXECUTE
End of 5.0 tests End of 5.0 tests
select 1 as a limit 4294967296,10;
a
End of 5.1 tests
This diff is collapsed.
...@@ -830,7 +830,7 @@ ERROR HY000: Unable to open underlying table which is differently defined or of ...@@ -830,7 +830,7 @@ ERROR HY000: Unable to open underlying table which is differently defined or of
DROP TABLE t1, t2; DROP TABLE t1, t2;
CREATE TABLE t2(a INT) ENGINE=MERGE UNION=(t3); CREATE TABLE t2(a INT) ENGINE=MERGE UNION=(t3);
SELECT * FROM t2; SELECT * FROM t2;
ERROR 42S02: Table 'test.t3' doesn't exist ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
DROP TABLE t2; DROP TABLE t2;
CREATE TABLE t1(a INT, b TEXT); CREATE TABLE t1(a INT, b TEXT);
CREATE TABLE tm1(a TEXT, b INT) ENGINE=MERGE UNION=(t1); CREATE TABLE tm1(a TEXT, b INT) ENGINE=MERGE UNION=(t1);
...@@ -895,17 +895,19 @@ drop table t2; ...@@ -895,17 +895,19 @@ drop table t2;
drop table t1; drop table t1;
CREATE TABLE tm1(a INT) ENGINE=MERGE UNION=(t1, t2); CREATE TABLE tm1(a INT) ENGINE=MERGE UNION=(t1, t2);
SELECT * FROM tm1; SELECT * FROM tm1;
ERROR 42S02: Table 'test.t1' doesn't exist ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
CHECK TABLE tm1; CHECK TABLE tm1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.tm1 check Error Table 'test.t1' doesn't exist test.tm1 check Error Table 'test.t1' doesn't exist
test.tm1 check Error Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
test.tm1 check error Corrupt test.tm1 check error Corrupt
CREATE TABLE t1(a INT); CREATE TABLE t1(a INT);
SELECT * FROM tm1; SELECT * FROM tm1;
ERROR 42S02: Table 'test.t2' doesn't exist ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
CHECK TABLE tm1; CHECK TABLE tm1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.tm1 check Error Table 'test.t2' doesn't exist test.tm1 check Error Table 'test.t2' doesn't exist
test.tm1 check Error Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
test.tm1 check error Corrupt test.tm1 check error Corrupt
CREATE TABLE t2(a BLOB); CREATE TABLE t2(a BLOB);
SELECT * FROM tm1; SELECT * FROM tm1;
...@@ -1199,7 +1201,7 @@ c1 ...@@ -1199,7 +1201,7 @@ c1
3 3
RENAME TABLE t2 TO t5; RENAME TABLE t2 TO t5;
SELECT * FROM t3 ORDER BY c1; SELECT * FROM t3 ORDER BY c1;
ERROR 42S02: Table 'test.t2' doesn't exist ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
RENAME TABLE t5 TO t2; RENAME TABLE t5 TO t2;
SELECT * FROM t3 ORDER BY c1; SELECT * FROM t3 ORDER BY c1;
c1 c1
...@@ -1233,7 +1235,7 @@ UNLOCK TABLES; ...@@ -1233,7 +1235,7 @@ UNLOCK TABLES;
# 4. Alter table rename. # 4. Alter table rename.
ALTER TABLE t2 RENAME TO t5; ALTER TABLE t2 RENAME TO t5;
SELECT * FROM t3 ORDER BY c1; SELECT * FROM t3 ORDER BY c1;
ERROR 42S02: Table 'test.t2' doesn't exist ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
ALTER TABLE t5 RENAME TO t2; ALTER TABLE t5 RENAME TO t2;
SELECT * FROM t3 ORDER BY c1; SELECT * FROM t3 ORDER BY c1;
c1 c1
...@@ -1317,7 +1319,7 @@ LOCK TABLES t1 WRITE, t2 WRITE; ...@@ -1317,7 +1319,7 @@ LOCK TABLES t1 WRITE, t2 WRITE;
INSERT INTO t1 VALUES (1); INSERT INTO t1 VALUES (1);
DROP TABLE t1; DROP TABLE t1;
SELECT * FROM t2; SELECT * FROM t2;
ERROR 42S02: Table 'test.t1' doesn't exist ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
SELECT * FROM t1; SELECT * FROM t1;
ERROR 42S02: Table 'test.t1' doesn't exist ERROR 42S02: Table 'test.t1' doesn't exist
UNLOCK TABLES; UNLOCK TABLES;
...@@ -2006,6 +2008,13 @@ test.t1 optimize status OK ...@@ -2006,6 +2008,13 @@ test.t1 optimize status OK
FLUSH TABLES m1, t1; FLUSH TABLES m1, t1;
UNLOCK TABLES; UNLOCK TABLES;
DROP TABLE t1, m1; DROP TABLE t1, m1;
CREATE TABLE tm1 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1) INSERT_METHOD=FIRST;
SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE
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
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;
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;
......
...@@ -181,4 +181,21 @@ c1 c2 ...@@ -181,4 +181,21 @@ c1 c2
3 3 3 3
DROP VIEW v1,v2; DROP VIEW v1,v2;
DROP TABLE t1,t2; DROP TABLE t1,t2;
CREATE TABLE t1 (i INT, d DATE);
INSERT INTO t1 VALUES (1, '2008-01-01'), (2, '2008-01-02'), (3, '2008-01-03');
SELECT COALESCE(d, d), IFNULL(d, d), IF(i, d, d),
CASE i WHEN i THEN d ELSE d END, GREATEST(d, d), LEAST(d, d)
FROM t1 ORDER BY RAND();
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
2008-01-01 2008-01-01 2008-01-01 2008-01-01 2008-01-01 2008-01-01
2008-01-02 2008-01-02 2008-01-02 2008-01-02 2008-01-02 2008-01-02
2008-01-03 2008-01-03 2008-01-03 2008-01-03 2008-01-03 2008-01-03
COALESCE(d, d) IFNULL(d, d) IF(i, d, d) CASE i WHEN i THEN d ELSE d END GREATEST(d, d) LEAST(d, d)
def CASE i WHEN i THEN d ELSE d END CASE i WHEN i THEN d ELSE d END 10 10 10 Y 128 0 63
def COALESCE(d, d) COALESCE(d, d) 10 10 10 Y 128 0 63
def GREATEST(d, d) GREATEST(d, d) 10 10 10 Y 128 0 63
def IF(i, d, d) IF(i, d, d) 10 10 10 Y 128 0 63
def IFNULL(d, d) IFNULL(d, d) 10 10 10 Y 128 0 63
def LEAST(d, d) LEAST(d, d) 10 10 10 Y 128 0 63
DROP TABLE t1;
End of 5.0 tests End of 5.0 tests
...@@ -97,7 +97,7 @@ mysql.time_zone_transition_type OK ...@@ -97,7 +97,7 @@ mysql.time_zone_transition_type OK
mysql.user OK mysql.user OK
DROP USER mysqltest1@'%'; DROP USER mysqltest1@'%';
Run mysql_upgrade with a non existing server socket Run mysql_upgrade with a non existing server socket
mysqlcheck: Got error: 2003: Can't connect to MySQL server on 'not_existing_host' (errno) when trying to connect mysqlcheck: Got error: 2005: Unknown MySQL server host 'not_existing_host' (errno) when trying to connect
FATAL ERROR: Upgrade failed FATAL ERROR: Upgrade failed
set GLOBAL sql_mode='STRICT_ALL_TABLES,ANSI_QUOTES,NO_ZERO_DATE'; set GLOBAL sql_mode='STRICT_ALL_TABLES,ANSI_QUOTES,NO_ZERO_DATE';
mtr.global_suppressions OK mtr.global_suppressions OK
......
...@@ -1428,6 +1428,22 @@ set session max_sort_length= 2180; ...@@ -1428,6 +1428,22 @@ set session max_sort_length= 2180;
select * from t1 order by b; select * from t1 order by b;
ERROR HY001: Out of sort memory; increase server sort buffer size ERROR HY001: Out of sort memory; increase server sort buffer size
drop table t1; drop table t1;
#
# Bug #39844: Query Crash Mysql Server 5.0.67
#
CREATE TABLE t1 (a INT PRIMARY KEY);
CREATE TABLE t2 (a INT PRIMARY KEY, b INT);
CREATE TABLE t3 (c INT);
INSERT INTO t1 (a) VALUES (1), (2);
INSERT INTO t2 (a,b) VALUES (1,2), (2,3);
INSERT INTO t3 (c) VALUES (1), (2);
SELECT
(SELECT t1.a FROM t1, t2 WHERE t1.a = t2.b AND t2.a = t3.c ORDER BY t1.a)
FROM t3;
(SELECT t1.a FROM t1, t2 WHERE t1.a = t2.b AND t2.a = t3.c ORDER BY t1.a)
2
NULL
DROP TABLE t1, t2, t3;
CREATE TABLE t2 (a varchar(32), b int(11), c float, d double, CREATE TABLE t2 (a varchar(32), b int(11), c float, d double,
UNIQUE KEY a (a,b,c), KEY b (b), KEY c (c)); UNIQUE KEY a (a,b,c), KEY b (b), KEY c (c));
CREATE TABLE t1 (a varchar(32), b char(3), UNIQUE KEY a (a,b), KEY b (b)); CREATE TABLE t1 (a varchar(32), b char(3), UNIQUE KEY a (a,b), KEY b (b));
......
This diff is collapsed.
...@@ -60,7 +60,8 @@ show create table t1; ...@@ -60,7 +60,8 @@ show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) */ ) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (a) */
drop table t1; drop table t1;
CREATE TABLE t1(id MEDIUMINT NOT NULL AUTO_INCREMENT, CREATE TABLE t1(id MEDIUMINT NOT NULL AUTO_INCREMENT,
f1 VARCHAR(25), f1 VARCHAR(25),
...@@ -84,7 +85,21 @@ t1 CREATE TABLE `t1` ( ...@@ -84,7 +85,21 @@ t1 CREATE TABLE `t1` (
`id` mediumint(9) NOT NULL AUTO_INCREMENT, `id` mediumint(9) NOT NULL AUTO_INCREMENT,
`f1` varchar(25) DEFAULT NULL, `f1` varchar(25) DEFAULT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=ARCHIVE AUTO_INCREMENT=101 DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (id) SUBPARTITION BY HASH (id) SUBPARTITIONS 2 (PARTITION pa1 VALUES LESS THAN (10) ENGINE = ARCHIVE, PARTITION pa2 VALUES LESS THAN (20) ENGINE = ARCHIVE, PARTITION pa3 VALUES LESS THAN (30) ENGINE = ARCHIVE, PARTITION pa4 VALUES LESS THAN (40) ENGINE = ARCHIVE, PARTITION pa5 VALUES LESS THAN (50) ENGINE = ARCHIVE, PARTITION pa6 VALUES LESS THAN (60) ENGINE = ARCHIVE, PARTITION pa7 VALUES LESS THAN (70) ENGINE = ARCHIVE, PARTITION pa8 VALUES LESS THAN (80) ENGINE = ARCHIVE, PARTITION pa9 VALUES LESS THAN (90) ENGINE = ARCHIVE, PARTITION pa10 VALUES LESS THAN (100) ENGINE = ARCHIVE, PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) */ ) ENGINE=ARCHIVE AUTO_INCREMENT=101 DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (id)
SUBPARTITION BY HASH (id)
SUBPARTITIONS 2
(PARTITION pa1 VALUES LESS THAN (10) ENGINE = ARCHIVE,
PARTITION pa2 VALUES LESS THAN (20) ENGINE = ARCHIVE,
PARTITION pa3 VALUES LESS THAN (30) ENGINE = ARCHIVE,
PARTITION pa4 VALUES LESS THAN (40) ENGINE = ARCHIVE,
PARTITION pa5 VALUES LESS THAN (50) ENGINE = ARCHIVE,
PARTITION pa6 VALUES LESS THAN (60) ENGINE = ARCHIVE,
PARTITION pa7 VALUES LESS THAN (70) ENGINE = ARCHIVE,
PARTITION pa8 VALUES LESS THAN (80) ENGINE = ARCHIVE,
PARTITION pa9 VALUES LESS THAN (90) ENGINE = ARCHIVE,
PARTITION pa10 VALUES LESS THAN (100) ENGINE = ARCHIVE,
PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = ARCHIVE) */
select count(*) from t1; select count(*) from t1;
count(*) count(*)
100 100
......
...@@ -326,7 +326,11 @@ Table Create Table ...@@ -326,7 +326,11 @@ Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` bit(27) NOT NULL DEFAULT '\0\0\0\0', `a` bit(27) NOT NULL DEFAULT '\0\0\0\0',
PRIMARY KEY (`a`) PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (a) (PARTITION p0 ENGINE = MyISAM, PARTITION p1 ENGINE = MyISAM, PARTITION p2 ENGINE = MyISAM) */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (a)
(PARTITION p0 ENGINE = MyISAM,
PARTITION p1 ENGINE = MyISAM,
PARTITION p2 ENGINE = MyISAM) */
insert into t1 values (1),(4),(7),(10),(13),(16),(19),(22),(25),(28),(31),(34); insert into t1 values (1),(4),(7),(10),(13),(16),(19),(22),(25),(28),(31),(34);
select hex(a) from t1 where a = 7; select hex(a) from t1 where a = 7;
hex(a) hex(a)
......
# Bug#37721, test of ORDER BY on PK and WHERE on INDEX
CREATE TABLE t1 (
a INT,
b INT,
PRIMARY KEY (a),
INDEX (b))
ENGINE InnoDB
PARTITION BY HASH(a)
PARTITIONS 3;
INSERT INTO t1 VALUES (0,0),(4,0),(2,0);
SELECT a FROM t1 WHERE b = 0 ORDER BY a ASC;
a
0
2
4
SELECT a FROM t1 WHERE b = 0 ORDER BY a DESC;
a
4
2
0
ALTER TABLE t1 DROP INDEX b;
SELECT a FROM t1 WHERE b = 0 ORDER BY a ASC;
a
0
2
4
SELECT a FROM t1 WHERE b = 0 ORDER BY a DESC;
a
4
2
0
DROP TABLE t1;
CREATE TABLE t1 (
a VARCHAR(600),
b VARCHAR(600),
PRIMARY KEY (a),
INDEX (b))
ENGINE InnoDB
PARTITION BY KEY(a)
PARTITIONS 3;
INSERT INTO t1 VALUES (concat(repeat('MySQL',100),'1'),repeat('0',257));
INSERT INTO t1 VALUES (concat(repeat('MySQL',100),'3'),repeat('0',257));
INSERT INTO t1 VALUES (concat(repeat('MySQL',100),'2'),repeat('0',257));
SELECT right(a,1) FROM t1 WHERE b = repeat('0',257) ORDER BY a ASC;
right(a,1)
1
2
3
SELECT right(a,1) FROM t1 WHERE b = repeat('0',257) ORDER BY a DESC;
right(a,1)
3
2
1
ALTER TABLE t1 DROP INDEX b;
SELECT right(a,1) FROM t1 WHERE b = repeat('0',257) ORDER BY a ASC;
right(a,1)
1
2
3
SELECT right(a,1) FROM t1 WHERE b = repeat('0',257) ORDER BY a DESC;
right(a,1)
3
2
1
DROP TABLE t1;
# Bug#32948 # Bug#32948
CREATE TABLE t1 (c1 INT, PRIMARY KEY (c1)) ENGINE=INNODB; CREATE TABLE t1 (c1 INT, PRIMARY KEY (c1)) ENGINE=INNODB;
CREATE TABLE t2 (c1 INT, PRIMARY KEY (c1), CREATE TABLE t2 (c1 INT, PRIMARY KEY (c1),
...@@ -72,7 +137,8 @@ show create table t1; ...@@ -72,7 +137,8 @@ show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a) */
drop table t1; drop table t1;
create table t1 (a int) create table t1 (a int)
engine = innodb engine = innodb
...@@ -84,7 +150,9 @@ show create table t1; ...@@ -84,7 +150,9 @@ show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) (PARTITION p0 VALUES IN (0) ENGINE = InnoDB) */ ) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0) ENGINE = InnoDB) */
drop table t1; drop table t1;
create table t1 create table t1
( (
...@@ -160,5 +228,9 @@ Table Create Table ...@@ -160,5 +228,9 @@ Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`int_column` int(11) DEFAULT NULL, `int_column` int(11) DEFAULT NULL,
`char_column` char(5) DEFAULT NULL `char_column` char(5) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (int_column) SUBPARTITION BY KEY (char_column) SUBPARTITIONS 2 (PARTITION p1 VALUES LESS THAN (5) ENGINE = MyISAM) */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (int_column)
SUBPARTITION BY KEY (char_column)
SUBPARTITIONS 2
(PARTITION p1 VALUES LESS THAN (5) ENGINE = MyISAM) */
drop table t1; drop table t1;
# connection default
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
CREATE TABLE t1
(
id SMALLINT NOT NULL,
PRIMARY KEY (id)
) ENGINE=innodb
PARTITION BY RANGE (id)
(
PARTITION p1 VALUES LESS THAN (2),
PARTITION p2 VALUES LESS THAN (4),
PARTITION p3 VALUES LESS THAN (10)
);
INSERT INTO t1 VALUES (1),(2),(3);
# Test READ COMMITTED -> REPEATABLE READ
FLUSH TABLES;
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
BEGIN;
SELECT * FROM t1;
id
1
2
3
#connection con1
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
BEGIN;
INSERT INTO t1 VALUES(7);
COMMIT;
# connection default
COMMIT;
FLUSH TABLES;
# Test REPEATABLE READ -> READ COMMITTED
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
BEGIN;
SELECT * FROM t1;
id
1
2
3
7
# connection con1
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
BEGIN;
INSERT INTO t1 VALUES(9);
ERROR HY000: Binary logging not possible. Message: Transaction level 'READ-COMMITTED' in InnoDB is not safe for binlog mode 'STATEMENT'
COMMIT;
COMMIT;
DROP TABLE t1;
...@@ -16,14 +16,18 @@ Table Create Table ...@@ -16,14 +16,18 @@ Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL, `f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL `f_varchar` varchar(30) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) PARTITIONS 2 */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (YEAR(f_date))
PARTITIONS 2 */
ALTER TABLE t1 COALESCE PARTITION 1; ALTER TABLE t1 COALESCE PARTITION 1;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL, `f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL `f_varchar` varchar(30) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (YEAR(f_date)) PARTITIONS 1 */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (YEAR(f_date))
PARTITIONS 1 */
drop table t1; drop table t1;
create table t1 (a int) create table t1 (a int)
partition by list (a) partition by list (a)
...@@ -36,3 +40,42 @@ alter table t1 REORGANIZE partition p1 INTO ...@@ -36,3 +40,42 @@ alter table t1 REORGANIZE partition p1 INTO
(partition p11 values in (1,2), (partition p11 values in (1,2),
partition p12 values in (3,4)); partition p12 values in (3,4));
drop table t1; drop table t1;
CREATE TABLE t1 (a INT)
/*!50100 PARTITION BY HASH (a)
/* Test
of multi-line
comment */
PARTITIONS 5 */;
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 '*/' at line 6
CREATE TABLE t1 (a INT)
/*!50100 PARTITION BY HASH (a)
-- with a single line comment embedded
PARTITIONS 5 */;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (a)
PARTITIONS 5 */
DROP TABLE t1;
CREATE TABLE t1 (a INT)
/*!50100 PARTITION BY HASH (a)
PARTITIONS 5 */;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (a)
PARTITIONS 5 */
DROP TABLE t1;
CREATE TABLE t1 (a INT) /*!50100 PARTITION BY HASH (a) PARTITIONS 5 */;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH (a)
PARTITIONS 5 */
DROP TABLE t1;
...@@ -84,6 +84,14 @@ ALTER TABLE t1 DROP PARTITION x1; ...@@ -84,6 +84,14 @@ ALTER TABLE t1 DROP PARTITION x1;
ERROR HY000: Partition management on a not partitioned table is not possible ERROR HY000: Partition management on a not partitioned table is not possible
ALTER TABLE t1 COALESCE PARTITION 1; ALTER TABLE t1 COALESCE PARTITION 1;
ERROR HY000: Partition management on a not partitioned table is not possible ERROR HY000: Partition management on a not partitioned table is not possible
ALTER TABLE t1 ANALYZE PARTITION p1;
ERROR HY000: Partition management on a not partitioned table is not possible
ALTER TABLE t1 CHECK PARTITION p1;
ERROR HY000: Partition management on a not partitioned table is not possible
ALTER TABLE t1 OPTIMIZE PARTITION p1;
ERROR HY000: Partition management on a not partitioned table is not possible
ALTER TABLE t1 REPAIR PARTITION p1;
ERROR HY000: Partition management on a not partitioned table is not possible
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (a int) CREATE TABLE t1 (a int)
PARTITION BY KEY (a) PARTITION BY KEY (a)
...@@ -136,7 +144,9 @@ SHOW CREATE TABLE t1; ...@@ -136,7 +144,9 @@ SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 2 */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
PARTITIONS 2 */
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (a INT) PARTITION BY HASH(a); CREATE TABLE t1 (a INT) PARTITION BY HASH(a);
ALTER TABLE t1 ADD PARTITION PARTITIONS 4; ALTER TABLE t1 ADD PARTITION PARTITIONS 4;
......
...@@ -24,13 +24,15 @@ data directory='/not/existing' ...@@ -24,13 +24,15 @@ data directory='/not/existing'
index directory='/not/existing' index directory='/not/existing'
); );
Warnings: Warnings:
Warning 0 DATA DIRECTORY option ignored Warning 1618 <DATA DIRECTORY> option ignored
Warning 0 INDEX DIRECTORY option ignored Warning 1618 <INDEX DIRECTORY> option ignored
show create table t2; show create table t2;
Table Create Table Table Create Table
t2 CREATE TABLE `t2` ( t2 CREATE TABLE `t2` (
`i` int(11) DEFAULT NULL `i` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (i) (PARTITION p01 VALUES LESS THAN (1000) ENGINE = MyISAM) */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (i)
(PARTITION p01 VALUES LESS THAN (1000) ENGINE = MyISAM) */
DROP TABLE t1, t2; DROP TABLE t1, t2;
set @@sql_mode=@org_mode; set @@sql_mode=@org_mode;
CREATE TABLE t1(a INT) CREATE TABLE t1(a INT)
......
...@@ -8,7 +8,9 @@ show create table t1; ...@@ -8,7 +8,9 @@ show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
drop table t1; drop table t1;
create table t1 (a integer) create table t1 (a integer)
partition by range (a) partition by range (a)
...@@ -137,7 +139,11 @@ t1 CREATE TABLE `t1` ( ...@@ -137,7 +139,11 @@ t1 CREATE TABLE `t1` (
`b` int(11) NOT NULL, `b` int(11) NOT NULL,
`c` int(11) NOT NULL, `c` int(11) NOT NULL,
PRIMARY KEY (`a`,`b`) PRIMARY KEY (`a`,`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION x1 VALUES LESS THAN (5) TABLESPACE = ts1 ENGINE = MyISAM, PARTITION x2 VALUES LESS THAN (10) TABLESPACE = ts2 ENGINE = MyISAM, PARTITION x3 VALUES LESS THAN MAXVALUE TABLESPACE = ts3 ENGINE = MyISAM) */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (a)
(PARTITION x1 VALUES LESS THAN (5) TABLESPACE = ts1 ENGINE = MyISAM,
PARTITION x2 VALUES LESS THAN (10) TABLESPACE = ts2 ENGINE = MyISAM,
PARTITION x3 VALUES LESS THAN MAXVALUE TABLESPACE = ts3 ENGINE = MyISAM) */
ALTER TABLE t1 ALTER TABLE t1
partition by range (a) partition by range (a)
partitions 3 partitions 3
...@@ -157,7 +163,11 @@ t1 CREATE TABLE `t1` ( ...@@ -157,7 +163,11 @@ t1 CREATE TABLE `t1` (
`b` int(11) NOT NULL, `b` int(11) NOT NULL,
`c` int(11) NOT NULL, `c` int(11) NOT NULL,
PRIMARY KEY (`a`,`b`) PRIMARY KEY (`a`,`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION x1 VALUES LESS THAN (5) TABLESPACE = ts1 ENGINE = MyISAM, PARTITION x2 VALUES LESS THAN (10) TABLESPACE = ts2 ENGINE = MyISAM, PARTITION x3 VALUES LESS THAN MAXVALUE TABLESPACE = ts3 ENGINE = MyISAM) */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (a)
(PARTITION x1 VALUES LESS THAN (5) TABLESPACE = ts1 ENGINE = MyISAM,
PARTITION x2 VALUES LESS THAN (10) TABLESPACE = ts2 ENGINE = MyISAM,
PARTITION x3 VALUES LESS THAN MAXVALUE TABLESPACE = ts3 ENGINE = MyISAM) */
drop table if exists t1; drop table if exists t1;
CREATE TABLE t1 ( CREATE TABLE t1 (
a int not null, a int not null,
...@@ -254,7 +264,15 @@ t1 CREATE TABLE `t1` ( ...@@ -254,7 +264,15 @@ t1 CREATE TABLE `t1` (
`b` int(11) NOT NULL, `b` int(11) NOT NULL,
`c` int(11) NOT NULL, `c` int(11) NOT NULL,
PRIMARY KEY (`a`,`b`) PRIMARY KEY (`a`,`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) SUBPARTITION BY HASH (a+b) (PARTITION x1 VALUES LESS THAN (1) (SUBPARTITION x11 ENGINE = MyISAM, SUBPARTITION x12 ENGINE = MyISAM), PARTITION x2 VALUES LESS THAN (5) (SUBPARTITION x21 ENGINE = MyISAM, SUBPARTITION x22 ENGINE = MyISAM)) */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (a)
SUBPARTITION BY HASH (a+b)
(PARTITION x1 VALUES LESS THAN (1)
(SUBPARTITION x11 ENGINE = MyISAM,
SUBPARTITION x12 ENGINE = MyISAM),
PARTITION x2 VALUES LESS THAN (5)
(SUBPARTITION x21 ENGINE = MyISAM,
SUBPARTITION x22 ENGINE = MyISAM)) */
ALTER TABLE t1 ADD COLUMN d int; ALTER TABLE t1 ADD COLUMN d int;
show create table t1; show create table t1;
Table Create Table Table Create Table
...@@ -264,7 +282,15 @@ t1 CREATE TABLE `t1` ( ...@@ -264,7 +282,15 @@ t1 CREATE TABLE `t1` (
`c` int(11) NOT NULL, `c` int(11) NOT NULL,
`d` int(11) DEFAULT NULL, `d` int(11) DEFAULT NULL,
PRIMARY KEY (`a`,`b`) PRIMARY KEY (`a`,`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) SUBPARTITION BY HASH (a+b) (PARTITION x1 VALUES LESS THAN (1) (SUBPARTITION x11 ENGINE = MyISAM, SUBPARTITION x12 ENGINE = MyISAM), PARTITION x2 VALUES LESS THAN (5) (SUBPARTITION x21 ENGINE = MyISAM, SUBPARTITION x22 ENGINE = MyISAM)) */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (a)
SUBPARTITION BY HASH (a+b)
(PARTITION x1 VALUES LESS THAN (1)
(SUBPARTITION x11 ENGINE = MyISAM,
SUBPARTITION x12 ENGINE = MyISAM),
PARTITION x2 VALUES LESS THAN (5)
(SUBPARTITION x21 ENGINE = MyISAM,
SUBPARTITION x22 ENGINE = MyISAM)) */
drop table t1; drop table t1;
CREATE TABLE t1 ( CREATE TABLE t1 (
a int not null, a int not null,
...@@ -487,7 +513,10 @@ show create table t1; ...@@ -487,7 +513,10 @@ show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` bigint(20) unsigned DEFAULT NULL `a` bigint(20) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (0) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (10) ENGINE = MyISAM) */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (0) ENGINE = MyISAM,
PARTITION p1 VALUES LESS THAN (10) ENGINE = MyISAM) */
drop table t1; drop table t1;
create table t1 (a bigint unsigned) create table t1 (a bigint unsigned)
partition by range (a) partition by range (a)
...@@ -497,7 +526,10 @@ show create table t1; ...@@ -497,7 +526,10 @@ show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` bigint(20) unsigned DEFAULT NULL `a` bigint(20) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) (PARTITION p0 VALUES LESS THAN (2) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN (10) ENGINE = MyISAM) */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (2) ENGINE = MyISAM,
PARTITION p1 VALUES LESS THAN (10) ENGINE = MyISAM) */
insert into t1 values (0xFFFFFFFFFFFFFFFF); insert into t1 values (0xFFFFFFFFFFFFFFFF);
ERROR HY000: Table has no partition for value 18446744073709551615 ERROR HY000: Table has no partition for value 18446744073709551615
drop table t1; drop table t1;
......
...@@ -101,13 +101,15 @@ data directory='/not/existing' ...@@ -101,13 +101,15 @@ data directory='/not/existing'
index directory='/not/existing' index directory='/not/existing'
); );
Warnings: Warnings:
Warning 0 DATA DIRECTORY option ignored Warning 1618 <DATA DIRECTORY> option ignored
Warning 0 INDEX DIRECTORY option ignored Warning 1618 <INDEX DIRECTORY> option ignored
show create table t2; show create table t2;
Table Create Table Table Create Table
t2 CREATE TABLE `t2` ( t2 CREATE TABLE `t2` (
`i` int(11) DEFAULT NULL `i` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (i) (PARTITION p01 VALUES LESS THAN (1000) ENGINE = MyISAM) */ ) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (i)
(PARTITION p01 VALUES LESS THAN (1000) ENGINE = MyISAM) */
DROP TABLE t1, t2; DROP TABLE t1, t2;
set @@sql_mode=@org_mode; set @@sql_mode=@org_mode;
create table t1 (a int) create table t1 (a int)
......
...@@ -15,16 +15,16 @@ DATA DIRECTORY = 'E:/mysqltest/p2Data' ...@@ -15,16 +15,16 @@ DATA DIRECTORY = 'E:/mysqltest/p2Data'
INDEX DIRECTORY = 'F:/mysqltest/p2Index' INDEX DIRECTORY = 'F:/mysqltest/p2Index'
); );
Warnings: Warnings:
Warning 0 DATA DIRECTORY option ignored Warning 1618 <DATA DIRECTORY> option ignored
Warning 0 INDEX DIRECTORY option ignored Warning 1618 <INDEX DIRECTORY> option ignored
Warning 0 DATA DIRECTORY option ignored Warning 1618 <DATA DIRECTORY> option ignored
Warning 0 INDEX DIRECTORY option ignored Warning 1618 <INDEX DIRECTORY> option ignored
INSERT INTO t1 VALUES (NULL, "first", 1); INSERT INTO t1 VALUES (NULL, "first", 1);
INSERT INTO t1 VALUES (NULL, "second", 2); INSERT INTO t1 VALUES (NULL, "second", 2);
INSERT INTO t1 VALUES (NULL, "third", 3); INSERT INTO t1 VALUES (NULL, "third", 3);
ALTER TABLE t1 ADD PARTITION (PARTITION p3 DATA DIRECTORY = 'G:/mysqltest/p3Data' INDEX DIRECTORY = 'H:/mysqltest/p3Index'); ALTER TABLE t1 ADD PARTITION (PARTITION p3 DATA DIRECTORY = 'G:/mysqltest/p3Data' INDEX DIRECTORY = 'H:/mysqltest/p3Index');
Warnings: Warnings:
Warning 0 DATA DIRECTORY option ignored Warning 1618 <DATA DIRECTORY> option ignored
Warning 0 INDEX DIRECTORY option ignored Warning 1618 <INDEX DIRECTORY> option ignored
INSERT INTO t1 VALUES (NULL, "last", 4); INSERT INTO t1 VALUES (NULL, "last", 4);
DROP TABLE t1; DROP TABLE t1;
...@@ -162,4 +162,32 @@ a b ...@@ -162,4 +162,32 @@ a b
12 NULL 12 NULL
drop table t1; drop table t1;
drop table t2; drop table t2;
CREATE TABLE t1 (a INT);
PREPARE stmt FROM 'select 1 from `t1` where `a` = any (select (@@tmpdir))';
EXECUTE stmt;
1
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
CREATE TABLE t2 (a INT PRIMARY KEY);
INSERT INTO t2 VALUES (400000), (400001);
SET @@sort_buffer_size=400000;
CREATE FUNCTION p1(i INT) RETURNS INT
BEGIN
SET @@sort_buffer_size= i;
RETURN i + 1;
END|
SELECT * FROM t2 WHERE a = @@sort_buffer_size AND p1(@@sort_buffer_size + 1) > a - 1;
a
400000
DROP TABLE t2;
DROP FUNCTION p1;
SELECT CONCAT(@@sort_buffer_size);
CONCAT(@@sort_buffer_size)
400001
SELECT LEFT("12345", @@ft_boolean_syntax);
LEFT("12345", @@ft_boolean_syntax)
Warnings:
Warning 1292 Truncated incorrect INTEGER value: '+ -><()~*:""&|'
SET @@sort_buffer_size=DEFAULT;
End of 5.0 tests. End of 5.0 tests.
...@@ -1002,8 +1002,8 @@ def TRIGGERS EVENT_OBJECT_TABLE Table 253 192 2 N 1 0 33 ...@@ -1002,8 +1002,8 @@ def TRIGGERS EVENT_OBJECT_TABLE Table 253 192 2 N 1 0 33
def TRIGGERS ACTION_STATEMENT Statement 252 589815 10 N 17 0 33 def TRIGGERS ACTION_STATEMENT Statement 252 589815 10 N 17 0 33
def TRIGGERS ACTION_TIMING Timing 253 18 6 N 1 0 33 def TRIGGERS ACTION_TIMING Timing 253 18 6 N 1 0 33
def TRIGGERS CREATED Created 12 19 0 Y 128 0 63 def TRIGGERS CREATED Created 12 19 0 Y 128 0 63
def TRIGGERS SQL_MODE sql_mode 252 589815 0 N 17 0 33 def TRIGGERS SQL_MODE sql_mode 253 24576 0 N 1 0 33
def TRIGGERS DEFINER Definer 252 589815 14 N 17 0 33 def TRIGGERS DEFINER Definer 253 231 14 N 1 0 33
def TRIGGERS CHARACTER_SET_CLIENT character_set_client 253 96 6 N 1 0 33 def TRIGGERS CHARACTER_SET_CLIENT character_set_client 253 96 6 N 1 0 33
def TRIGGERS COLLATION_CONNECTION collation_connection 253 96 6 N 1 0 33 def TRIGGERS COLLATION_CONNECTION collation_connection 253 96 6 N 1 0 33
def TRIGGERS DATABASE_COLLATION Database Collation 253 96 17 N 1 0 33 def TRIGGERS DATABASE_COLLATION Database Collation 253 96 17 N 1 0 33
...@@ -1046,8 +1046,8 @@ def TRIGGERS ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_OLD_TABLE 253 192 0 Y ...@@ -1046,8 +1046,8 @@ def TRIGGERS ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_OLD_TABLE 253 192 0 Y
def TRIGGERS ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_NEW_TABLE 253 192 0 Y 0 0 33 def TRIGGERS ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_NEW_TABLE 253 192 0 Y 0 0 33
def TRIGGERS ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_OLD_ROW 253 9 3 N 1 0 33 def TRIGGERS ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_OLD_ROW 253 9 3 N 1 0 33
def TRIGGERS ACTION_REFERENCE_NEW_ROW ACTION_REFERENCE_NEW_ROW 253 9 3 N 1 0 33 def TRIGGERS ACTION_REFERENCE_NEW_ROW ACTION_REFERENCE_NEW_ROW 253 9 3 N 1 0 33
def TRIGGERS SQL_MODE SQL_MODE 252 589815 0 N 17 0 33 def TRIGGERS SQL_MODE SQL_MODE 253 24576 0 N 1 0 33
def TRIGGERS DEFINER DEFINER 252 589815 14 N 17 0 33 def TRIGGERS DEFINER DEFINER 253 231 14 N 1 0 33
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW SQL_MODE DEFINER TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW SQL_MODE DEFINER
NULL test t1_bi INSERT NULL test t1 NULL SET @a = 1 ROW BEFORE NULL NULL OLD NEW root@localhost NULL test t1_bi INSERT NULL test t1 NULL SET @a = 1 ROW BEFORE NULL NULL OLD NEW root@localhost
---------------------------------------------------------------- ----------------------------------------------------------------
......
...@@ -6820,6 +6820,24 @@ ttt ...@@ -6820,6 +6820,24 @@ ttt
2 2
drop function func30787; drop function func30787;
drop table t1; drop table t1;
CREATE TABLE t1 (id INT);
INSERT INTO t1 VALUES (1),(2),(3),(4);
CREATE PROCEDURE test_sp()
SELECT t1.* FROM t1 RIGHT JOIN t1 t2 ON t1.id=t2.id;
CALL test_sp();
id
1
2
3
4
CALL test_sp();
id
1
2
3
4
DROP PROCEDURE test_sp;
DROP TABLE t1;
create table t1(c1 INT); create table t1(c1 INT);
create function f1(p1 int) returns varchar(32) create function f1(p1 int) returns varchar(32)
return 'aaa'; return 'aaa';
...@@ -6846,6 +6864,19 @@ select substr(`str`, `pos`+ 1 ) into `str`; ...@@ -6846,6 +6864,19 @@ select substr(`str`, `pos`+ 1 ) into `str`;
end $ end $
call `p2`('s s s s s s'); call `p2`('s s s s s s');
drop procedure `p2`; drop procedure `p2`;
drop table if exists t1;
drop procedure if exists p1;
create procedure p1() begin select * from t1; end$
call p1$
ERROR 42S02: Table 'test.t1' doesn't exist
create table t1 (a integer)$
call p1$
a
alter table t1 add b integer;
call p1$
a
drop table t1;
drop procedure p1;
# ------------------------------------------------------------------ # ------------------------------------------------------------------
# -- End of 5.0 tests # -- End of 5.0 tests
# ------------------------------------------------------------------ # ------------------------------------------------------------------
......
'#---------------------BS_STVARS_046_01----------------------#' '#---------------------BS_STVARS_046_01----------------------#'
SELECT COUNT(@@GLOBAL.ssl_capath); SELECT COUNT(@@GLOBAL.ssl_capath);
COUNT(@@GLOBAL.ssl_capath) COUNT(@@GLOBAL.ssl_capath)
0 1
1 Expected 1 Expected
'#---------------------BS_STVARS_046_02----------------------#' '#---------------------BS_STVARS_046_02----------------------#'
SET @@GLOBAL.ssl_capath=1; SET @@GLOBAL.ssl_capath=1;
...@@ -9,7 +9,7 @@ ERROR HY000: Variable 'ssl_capath' is a read only variable ...@@ -9,7 +9,7 @@ ERROR HY000: Variable 'ssl_capath' is a read only variable
Expected error 'Read only variable' Expected error 'Read only variable'
SELECT COUNT(@@GLOBAL.ssl_capath); SELECT COUNT(@@GLOBAL.ssl_capath);
COUNT(@@GLOBAL.ssl_capath) COUNT(@@GLOBAL.ssl_capath)
0 1
1 Expected 1 Expected
'#---------------------BS_STVARS_046_03----------------------#' '#---------------------BS_STVARS_046_03----------------------#'
SELECT @@GLOBAL.ssl_capath = VARIABLE_VALUE SELECT @@GLOBAL.ssl_capath = VARIABLE_VALUE
...@@ -20,7 +20,7 @@ NULL ...@@ -20,7 +20,7 @@ NULL
1 Expected 1 Expected
SELECT COUNT(@@GLOBAL.ssl_capath); SELECT COUNT(@@GLOBAL.ssl_capath);
COUNT(@@GLOBAL.ssl_capath) COUNT(@@GLOBAL.ssl_capath)
0 1
1 Expected 1 Expected
SELECT COUNT(VARIABLE_VALUE) SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
...@@ -36,7 +36,7 @@ NULL ...@@ -36,7 +36,7 @@ NULL
'#---------------------BS_STVARS_046_05----------------------#' '#---------------------BS_STVARS_046_05----------------------#'
SELECT COUNT(@@ssl_capath); SELECT COUNT(@@ssl_capath);
COUNT(@@ssl_capath) COUNT(@@ssl_capath)
0 1
1 Expected 1 Expected
SELECT COUNT(@@local.ssl_capath); SELECT COUNT(@@local.ssl_capath);
ERROR HY000: Variable 'ssl_capath' is a GLOBAL variable ERROR HY000: Variable 'ssl_capath' is a GLOBAL variable
...@@ -46,7 +46,7 @@ ERROR HY000: Variable 'ssl_capath' is a GLOBAL variable ...@@ -46,7 +46,7 @@ ERROR HY000: Variable 'ssl_capath' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable' Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.ssl_capath); SELECT COUNT(@@GLOBAL.ssl_capath);
COUNT(@@GLOBAL.ssl_capath) COUNT(@@GLOBAL.ssl_capath)
0 1
1 Expected 1 Expected
SELECT ssl_capath = @@SESSION.ssl_capath; SELECT ssl_capath = @@SESSION.ssl_capath;
ERROR 42S22: Unknown column 'ssl_capath' in 'field list' ERROR 42S22: Unknown column 'ssl_capath' in 'field list'
......
'#---------------------BS_STVARS_048_01----------------------#' '#---------------------BS_STVARS_048_01----------------------#'
SELECT COUNT(@@GLOBAL.ssl_cipher); SELECT COUNT(@@GLOBAL.ssl_cipher);
COUNT(@@GLOBAL.ssl_cipher) COUNT(@@GLOBAL.ssl_cipher)
0 1
1 Expected 1 Expected
'#---------------------BS_STVARS_048_02----------------------#' '#---------------------BS_STVARS_048_02----------------------#'
SET @@GLOBAL.ssl_cipher=1; SET @@GLOBAL.ssl_cipher=1;
...@@ -9,7 +9,7 @@ ERROR HY000: Variable 'ssl_cipher' is a read only variable ...@@ -9,7 +9,7 @@ ERROR HY000: Variable 'ssl_cipher' is a read only variable
Expected error 'Read only variable' Expected error 'Read only variable'
SELECT COUNT(@@GLOBAL.ssl_cipher); SELECT COUNT(@@GLOBAL.ssl_cipher);
COUNT(@@GLOBAL.ssl_cipher) COUNT(@@GLOBAL.ssl_cipher)
0 1
1 Expected 1 Expected
'#---------------------BS_STVARS_048_03----------------------#' '#---------------------BS_STVARS_048_03----------------------#'
SELECT @@GLOBAL.ssl_cipher = VARIABLE_VALUE SELECT @@GLOBAL.ssl_cipher = VARIABLE_VALUE
...@@ -20,7 +20,7 @@ NULL ...@@ -20,7 +20,7 @@ NULL
1 Expected 1 Expected
SELECT COUNT(@@GLOBAL.ssl_cipher); SELECT COUNT(@@GLOBAL.ssl_cipher);
COUNT(@@GLOBAL.ssl_cipher) COUNT(@@GLOBAL.ssl_cipher)
0 1
1 Expected 1 Expected
SELECT COUNT(VARIABLE_VALUE) SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
...@@ -36,7 +36,7 @@ NULL ...@@ -36,7 +36,7 @@ NULL
'#---------------------BS_STVARS_048_05----------------------#' '#---------------------BS_STVARS_048_05----------------------#'
SELECT COUNT(@@ssl_cipher); SELECT COUNT(@@ssl_cipher);
COUNT(@@ssl_cipher) COUNT(@@ssl_cipher)
0 1
1 Expected 1 Expected
SELECT COUNT(@@local.ssl_cipher); SELECT COUNT(@@local.ssl_cipher);
ERROR HY000: Variable 'ssl_cipher' is a GLOBAL variable ERROR HY000: Variable 'ssl_cipher' is a GLOBAL variable
...@@ -46,7 +46,7 @@ ERROR HY000: Variable 'ssl_cipher' is a GLOBAL variable ...@@ -46,7 +46,7 @@ ERROR HY000: Variable 'ssl_cipher' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable' Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.ssl_cipher); SELECT COUNT(@@GLOBAL.ssl_cipher);
COUNT(@@GLOBAL.ssl_cipher) COUNT(@@GLOBAL.ssl_cipher)
0 1
1 Expected 1 Expected
SELECT ssl_cipher = @@SESSION.ssl_cipher; SELECT ssl_cipher = @@SESSION.ssl_cipher;
ERROR 42S22: Unknown column 'ssl_cipher' in 'field list' ERROR 42S22: Unknown column 'ssl_cipher' in 'field list'
......
...@@ -779,6 +779,22 @@ SELECT 1 FROM t1 WHERE t1.a NOT IN (SELECT 1 FROM t1, t2 WHERE 0); ...@@ -779,6 +779,22 @@ SELECT 1 FROM t1 WHERE t1.a NOT IN (SELECT 1 FROM t1, t2 WHERE 0);
1 1
1 1
DROP TABLE t1, t2; DROP TABLE t1, t2;
CREATE TABLE t1 (
pk INT PRIMARY KEY,
int_key INT,
varchar_key VARCHAR(5) UNIQUE,
varchar_nokey VARCHAR(5)
);
INSERT INTO t1 VALUES (9, 7,NULL,NULL), (10,8,'p' ,'p');
SELECT varchar_nokey
FROM t1
WHERE NULL NOT IN (
SELECT INNR.pk FROM t1 AS INNR2
LEFT JOIN t1 AS INNR ON ( INNR2.int_key = INNR.int_key )
WHERE INNR.varchar_key > 'n{'
);
varchar_nokey
DROP TABLE t1;
End of 5.0 tests End of 5.0 tests
create table t0 (a int); create table t0 (a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
......
...@@ -79,7 +79,7 @@ drop database mysqltest; ...@@ -79,7 +79,7 @@ drop database mysqltest;
create table t1 (a int not null) engine=myisam; create table t1 (a int not null) engine=myisam;
alter table t1 data directory="MYSQLTEST_VARDIR/tmp"; alter table t1 data directory="MYSQLTEST_VARDIR/tmp";
Warnings: Warnings:
Warning 0 DATA DIRECTORY option ignored Warning 1618 <DATA DIRECTORY> option ignored
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
...@@ -88,7 +88,7 @@ t1 CREATE TABLE `t1` ( ...@@ -88,7 +88,7 @@ t1 CREATE TABLE `t1` (
alter table t1 add b int; alter table t1 add b int;
alter table t1 data directory="MYSQLTEST_VARDIR/log"; alter table t1 data directory="MYSQLTEST_VARDIR/log";
Warnings: Warnings:
Warning 0 DATA DIRECTORY option ignored Warning 1618 <DATA DIRECTORY> option ignored
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
...@@ -97,7 +97,7 @@ t1 CREATE TABLE `t1` ( ...@@ -97,7 +97,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
alter table t1 index directory="MYSQLTEST_VARDIR/log"; alter table t1 index directory="MYSQLTEST_VARDIR/log";
Warnings: Warnings:
Warning 0 INDEX DIRECTORY option ignored Warning 1618 <INDEX DIRECTORY> option ignored
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
...@@ -164,8 +164,8 @@ ERROR HY000: Can't create/write to file 'TEST_DIR/master-data_var/t1.MYI' (Errco ...@@ -164,8 +164,8 @@ ERROR HY000: Can't create/write to file 'TEST_DIR/master-data_var/t1.MYI' (Errco
SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE='NO_DIR_IN_CREATE'; SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE='NO_DIR_IN_CREATE';
CREATE TABLE t1(a INT) DATA DIRECTORY='MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY='MYSQLTEST_VARDIR/tmp'; CREATE TABLE t1(a INT) DATA DIRECTORY='MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY='MYSQLTEST_VARDIR/tmp';
Warnings: Warnings:
Warning 0 DATA DIRECTORY option ignored Warning 1618 <DATA DIRECTORY> option ignored
Warning 0 INDEX DIRECTORY option ignored Warning 1618 <INDEX DIRECTORY> option ignored
DROP TABLE t1; DROP TABLE t1;
SET @@SQL_MODE=@OLD_SQL_MODE; SET @@SQL_MODE=@OLD_SQL_MODE;
End of 5.1 tests End of 5.1 tests
...@@ -2,67 +2,31 @@ SET @global_thread_cache_size = @@GLOBAL.thread_cache_size; ...@@ -2,67 +2,31 @@ SET @global_thread_cache_size = @@GLOBAL.thread_cache_size;
FLUSH STATUS; FLUSH STATUS;
'# Test1#' '# Test1#'
SET @@GLOBAL.thread_cache_size=3; SET @@GLOBAL.thread_cache_size=3;
Saving threads cached, threads created values
SHOW STATUS LIKE 'Threads_cached'; SHOW STATUS LIKE 'Threads_cached';
Variable_name Value Variable_name Value
Threads_cached 0 Threads_cached 0
0 Expected 0 Expected
'#Old value for thread_cache'#
** Connecting conn1 using username 'root' ** ** Connecting conn1 using username 'root' **
** Connecting conn2 using username 'root' ** ** Connecting conn2 using username 'root' **
** Connecting conn3 using username 'root' ** ** Connecting conn3 using username 'root' **
** Connecting conn4 using username 'root' ** ** Connecting conn4 using username 'root' **
Saving threads cached, threads created values ** Connection default **
Threads Created Difference
4
4 Expected
SHOW STATUS LIKE 'Threads_cached'; SHOW STATUS LIKE 'Threads_cached';
Variable_name Value Variable_name Value
Threads_cached 0 Threads_cached 0
0 Expected 0 Expected
** Connection default **
** Disconnecting conn1,conn2,conn3,conn4 ** ** Disconnecting conn1,conn2,conn3,conn4 **
'#new values for thread cache after disconnecting'#
Saving threads cached, threads created values
Threads Created Difference
0
0 Expected
SHOW STATUS LIKE 'Threads_cached'; SHOW STATUS LIKE 'Threads_cached';
Variable_name Value Variable_name Value
Threads_cached 3 Threads_cached 3
3 Expected 3 Expected
SET @@GLOBAL.thread_cache_size=1; SET @@GLOBAL.thread_cache_size= 1;
Saving threads cached, threads created values
Threads Created Difference
0
0 Expected
SHOW STATUS LIKE 'Threads_cached';
Variable_name Value
Threads_cached 3
1 Expected
Bug: The number of threads cached should have decreased with cache size decrease.
** Connecting conn1 using username 'root' ** ** Connecting conn1 using username 'root' **
** Connecting conn2 using username 'root' ** ** Connecting conn2 using username 'root' **
Saving threads cached, threads created values connection default;
Threads Created Difference
0
1 Expected
Bug: The number of threads created should have increased because the cache should have 1 thread only
SHOW STATUS LIKE 'Threads_cached';
Variable_name Value
Threads_cached 1
0 Expected
Bug: The number of threads created should have decreased because atleast 1 new connection came in
** Connection default **
** Disconnecting conn1,conn2 ** ** Disconnecting conn1,conn2 **
'#new status values for thread cache'#
Saving threads cached, threads created values
Threads Created Difference
0
0 Expected
SHOW STATUS LIKE 'Threads_cached'; SHOW STATUS LIKE 'Threads_cached';
Variable_name Value Variable_name Value
Threads_cached 1 Threads_cached 1
1 Expected 1 Expected
Saving threads cached, threads created values
SET @@GLOBAL.thread_cache_size = @global_thread_cache_size; SET @@GLOBAL.thread_cache_size = @global_thread_cache_size;
...@@ -158,7 +158,7 @@ explain extended select @@IDENTITY,last_insert_id(), @@identity; ...@@ -158,7 +158,7 @@ explain extended select @@IDENTITY,last_insert_id(), @@identity;
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
Warnings: Warnings:
Note 1003 select 345 AS `@@IDENTITY`,last_insert_id() AS `last_insert_id()`,345 AS `@@identity` Note 1003 select @@IDENTITY AS `@@IDENTITY`,last_insert_id() AS `last_insert_id()`,@@identity AS `@@identity`
set big_tables=OFF, big_tables=ON, big_tables=0, big_tables=1, big_tables="OFF", big_tables="ON"; set big_tables=OFF, big_tables=ON, big_tables=0, big_tables=1, big_tables="OFF", big_tables="ON";
set global concurrent_insert=2; set global concurrent_insert=2;
show variables like 'concurrent_insert'; show variables like 'concurrent_insert';
......
...@@ -3672,6 +3672,8 @@ DROP VIEW v1; ...@@ -3672,6 +3672,8 @@ DROP VIEW v1;
# -- End of test case for Bug#35193. # -- End of test case for Bug#35193.
CREATE VIEW v1 AS SELECT 1;
DROP VIEW v1;
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# -- End of 5.0 tests. # -- End of 5.0 tests.
# ----------------------------------------------------------------- # -----------------------------------------------------------------
......
...@@ -9,8 +9,8 @@ drop table nu; ...@@ -9,8 +9,8 @@ drop table nu;
drop table if exists t1; drop table if exists t1;
CREATE TABLE t1 ( `ID` int(6) ) data directory 'c:/tmp/' index directory 'c:/tmp/' engine=MyISAM; CREATE TABLE t1 ( `ID` int(6) ) data directory 'c:/tmp/' index directory 'c:/tmp/' engine=MyISAM;
Warnings: Warnings:
Warning 0 DATA DIRECTORY option ignored Warning 1618 <DATA DIRECTORY> option ignored
Warning 0 INDEX DIRECTORY option ignored Warning 1618 <INDEX DIRECTORY> option ignored
drop table t1; drop table t1;
CREATE TABLE t1 (a int, b int); CREATE TABLE t1 (a int, b int);
INSERT INTO t1 VALUES (1,1); INSERT INTO t1 VALUES (1,1);
...@@ -18,6 +18,7 @@ EXPLAIN SELECT * FROM t1 WHERE b = (SELECT max(2)); ...@@ -18,6 +18,7 @@ EXPLAIN SELECT * FROM t1 WHERE b = (SELECT max(2));
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 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;
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';
......
...@@ -55,3 +55,23 @@ select * from t1; ...@@ -55,3 +55,23 @@ select * from t1;
a a
20 20
drop table t1; drop table t1;
drop table if exists t1;
create table t1(a int, b int, c varchar(20), primary key(a)) engine = innodb;
insert into t1 values(1, 1, 'a');
insert into t1 values(2, 2, 'b');
xa start 'a','b';
update t1 set c = 'aa' where a = 1;
xa start 'a','c';
update t1 set c = 'bb' where a = 2;
update t1 set c = 'bb' where a = 2;
update t1 set c = 'aa' where a = 1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
select count(*) from t1;
count(*)
2
xa end 'a','c';
ERROR XA102: XA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detected
xa rollback 'a','c';
xa start 'a','c';
drop table t1;
End of 5.0 tests
...@@ -67,7 +67,7 @@ NULL information_schema EVENTS LAST_ALTERED 18 0000-00-00 00:00:00 NO datetime N ...@@ -67,7 +67,7 @@ NULL information_schema EVENTS LAST_ALTERED 18 0000-00-00 00:00:00 NO datetime N
NULL information_schema EVENTS LAST_EXECUTED 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select NULL information_schema EVENTS LAST_EXECUTED 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema EVENTS ON_COMPLETION 16 NO varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12) select NULL information_schema EVENTS ON_COMPLETION 16 NO varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12) select
NULL information_schema EVENTS ORIGINATOR 21 0 NO bigint NULL NULL 19 0 NULL NULL bigint(10) select NULL information_schema EVENTS ORIGINATOR 21 0 NO bigint NULL NULL 19 0 NULL NULL bigint(10) select
NULL information_schema EVENTS SQL_MODE 12 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select NULL information_schema EVENTS SQL_MODE 12 NO varchar 8192 24576 NULL NULL utf8 utf8_general_ci varchar(8192) select
NULL information_schema EVENTS STARTS 13 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select NULL information_schema EVENTS STARTS 13 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema EVENTS STATUS 15 NO varchar 18 54 NULL NULL utf8 utf8_general_ci varchar(18) select NULL information_schema EVENTS STATUS 15 NO varchar 18 54 NULL NULL utf8 utf8_general_ci varchar(18) select
NULL information_schema EVENTS TIME_ZONE 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema EVENTS TIME_ZONE 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
...@@ -277,12 +277,12 @@ NULL information_schema TRIGGERS CHARACTER_SET_CLIENT 20 NO varchar 32 96 NULL ...@@ -277,12 +277,12 @@ NULL information_schema TRIGGERS CHARACTER_SET_CLIENT 20 NO varchar 32 96 NULL
NULL information_schema TRIGGERS COLLATION_CONNECTION 21 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select NULL information_schema TRIGGERS COLLATION_CONNECTION 21 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime select
NULL information_schema TRIGGERS DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select NULL information_schema TRIGGERS DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32) select
NULL information_schema TRIGGERS DEFINER 19 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select NULL information_schema TRIGGERS DEFINER 19 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77) select
NULL information_schema TRIGGERS EVENT_MANIPULATION 4 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6) select NULL information_schema TRIGGERS EVENT_MANIPULATION 4 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6) select
NULL information_schema TRIGGERS EVENT_OBJECT_CATALOG 5 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select NULL information_schema TRIGGERS EVENT_OBJECT_CATALOG 5 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
NULL information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema TRIGGERS EVENT_OBJECT_TABLE 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema TRIGGERS EVENT_OBJECT_TABLE 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema TRIGGERS SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select NULL information_schema TRIGGERS SQL_MODE 18 NO varchar 8192 24576 NULL NULL utf8 utf8_general_ci varchar(8192) select
NULL information_schema TRIGGERS TRIGGER_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select NULL information_schema TRIGGERS TRIGGER_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
NULL information_schema TRIGGERS TRIGGER_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema TRIGGERS TRIGGER_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema TRIGGERS TRIGGER_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select NULL information_schema TRIGGERS TRIGGER_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
...@@ -412,7 +412,7 @@ NULL information_schema COLUMNS NUMERIC_SCALE bigint NULL NULL NULL NULL bigint( ...@@ -412,7 +412,7 @@ NULL information_schema COLUMNS NUMERIC_SCALE bigint NULL NULL NULL NULL bigint(
NULL information_schema EVENTS EXECUTE_AT datetime NULL NULL NULL NULL datetime NULL information_schema EVENTS EXECUTE_AT datetime NULL NULL NULL NULL datetime
3.0000 information_schema EVENTS INTERVAL_VALUE varchar 256 768 utf8 utf8_general_ci varchar(256) 3.0000 information_schema EVENTS INTERVAL_VALUE varchar 256 768 utf8 utf8_general_ci varchar(256)
3.0000 information_schema EVENTS INTERVAL_FIELD varchar 18 54 utf8 utf8_general_ci varchar(18) 3.0000 information_schema EVENTS INTERVAL_FIELD varchar 18 54 utf8 utf8_general_ci varchar(18)
1.0000 information_schema EVENTS SQL_MODE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext 3.0000 information_schema EVENTS SQL_MODE varchar 8192 24576 utf8 utf8_general_ci varchar(8192)
NULL information_schema EVENTS STARTS datetime NULL NULL NULL NULL datetime NULL information_schema EVENTS STARTS datetime NULL NULL NULL NULL datetime
NULL information_schema EVENTS ENDS datetime NULL NULL NULL NULL datetime NULL information_schema EVENTS ENDS datetime NULL NULL NULL NULL datetime
3.0000 information_schema EVENTS STATUS varchar 18 54 utf8 utf8_general_ci varchar(18) 3.0000 information_schema EVENTS STATUS varchar 18 54 utf8 utf8_general_ci varchar(18)
...@@ -635,8 +635,8 @@ NULL information_schema TRIGGERS ACTION_ORDER bigint NULL NULL NULL NULL bigint( ...@@ -635,8 +635,8 @@ NULL information_schema TRIGGERS ACTION_ORDER bigint NULL NULL NULL NULL bigint(
3.0000 information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW varchar 3 9 utf8 utf8_general_ci varchar(3) 3.0000 information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW varchar 3 9 utf8 utf8_general_ci varchar(3)
3.0000 information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW varchar 3 9 utf8 utf8_general_ci varchar(3) 3.0000 information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW varchar 3 9 utf8 utf8_general_ci varchar(3)
NULL information_schema TRIGGERS CREATED datetime NULL NULL NULL NULL datetime NULL information_schema TRIGGERS CREATED datetime NULL NULL NULL NULL datetime
1.0000 information_schema TRIGGERS SQL_MODE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext 3.0000 information_schema TRIGGERS SQL_MODE varchar 8192 24576 utf8 utf8_general_ci varchar(8192)
1.0000 information_schema TRIGGERS DEFINER longtext 4294967295 4294967295 utf8 utf8_general_ci longtext 3.0000 information_schema TRIGGERS DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77)
3.0000 information_schema TRIGGERS CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32) 3.0000 information_schema TRIGGERS CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema TRIGGERS COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32) 3.0000 information_schema TRIGGERS COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32)
3.0000 information_schema TRIGGERS DATABASE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32) 3.0000 information_schema TRIGGERS DATABASE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32)
......
...@@ -39,7 +39,7 @@ EVENT_TYPE varchar(9) NO ...@@ -39,7 +39,7 @@ EVENT_TYPE varchar(9) NO
EXECUTE_AT datetime YES NULL EXECUTE_AT datetime YES NULL
INTERVAL_VALUE varchar(256) YES NULL INTERVAL_VALUE varchar(256) YES NULL
INTERVAL_FIELD varchar(18) YES NULL INTERVAL_FIELD varchar(18) YES NULL
SQL_MODE longtext NO NULL SQL_MODE varchar(8192) NO
STARTS datetime YES NULL STARTS datetime YES NULL
ENDS datetime YES NULL ENDS datetime YES NULL
STATUS varchar(18) NO STATUS varchar(18) NO
...@@ -66,7 +66,7 @@ EVENTS CREATE TEMPORARY TABLE `EVENTS` ( ...@@ -66,7 +66,7 @@ EVENTS CREATE TEMPORARY TABLE `EVENTS` (
`EXECUTE_AT` datetime DEFAULT NULL, `EXECUTE_AT` datetime DEFAULT NULL,
`INTERVAL_VALUE` varchar(256) DEFAULT NULL, `INTERVAL_VALUE` varchar(256) DEFAULT NULL,
`INTERVAL_FIELD` varchar(18) DEFAULT NULL, `INTERVAL_FIELD` varchar(18) DEFAULT NULL,
`SQL_MODE` longtext NOT NULL, `SQL_MODE` varchar(8192) NOT NULL DEFAULT '',
`STARTS` datetime DEFAULT NULL, `STARTS` datetime DEFAULT NULL,
`ENDS` datetime DEFAULT NULL, `ENDS` datetime DEFAULT NULL,
`STATUS` varchar(18) NOT NULL DEFAULT '', `STATUS` varchar(18) NOT NULL DEFAULT '',
...@@ -93,7 +93,7 @@ EVENT_TYPE varchar(9) NO ...@@ -93,7 +93,7 @@ EVENT_TYPE varchar(9) NO
EXECUTE_AT datetime YES NULL EXECUTE_AT datetime YES NULL
INTERVAL_VALUE varchar(256) YES NULL INTERVAL_VALUE varchar(256) YES NULL
INTERVAL_FIELD varchar(18) YES NULL INTERVAL_FIELD varchar(18) YES NULL
SQL_MODE longtext NO NULL SQL_MODE varchar(8192) NO
STARTS datetime YES NULL STARTS datetime YES NULL
ENDS datetime YES NULL ENDS datetime YES NULL
STATUS varchar(18) NO STATUS varchar(18) NO
......
...@@ -45,8 +45,8 @@ ACTION_REFERENCE_NEW_TABLE varchar(64) YES NULL ...@@ -45,8 +45,8 @@ ACTION_REFERENCE_NEW_TABLE varchar(64) YES NULL
ACTION_REFERENCE_OLD_ROW varchar(3) NO ACTION_REFERENCE_OLD_ROW varchar(3) NO
ACTION_REFERENCE_NEW_ROW varchar(3) NO ACTION_REFERENCE_NEW_ROW varchar(3) NO
CREATED datetime YES NULL CREATED datetime YES NULL
SQL_MODE longtext NO NULL SQL_MODE varchar(8192) NO
DEFINER longtext NO NULL DEFINER varchar(77) NO
CHARACTER_SET_CLIENT varchar(32) NO CHARACTER_SET_CLIENT varchar(32) NO
COLLATION_CONNECTION varchar(32) NO COLLATION_CONNECTION varchar(32) NO
DATABASE_COLLATION varchar(32) NO DATABASE_COLLATION varchar(32) NO
...@@ -70,8 +70,8 @@ TRIGGERS CREATE TEMPORARY TABLE `TRIGGERS` ( ...@@ -70,8 +70,8 @@ TRIGGERS CREATE TEMPORARY TABLE `TRIGGERS` (
`ACTION_REFERENCE_OLD_ROW` varchar(3) NOT NULL DEFAULT '', `ACTION_REFERENCE_OLD_ROW` varchar(3) NOT NULL DEFAULT '',
`ACTION_REFERENCE_NEW_ROW` varchar(3) NOT NULL DEFAULT '', `ACTION_REFERENCE_NEW_ROW` varchar(3) NOT NULL DEFAULT '',
`CREATED` datetime DEFAULT NULL, `CREATED` datetime DEFAULT NULL,
`SQL_MODE` longtext NOT NULL, `SQL_MODE` varchar(8192) NOT NULL DEFAULT '',
`DEFINER` longtext NOT NULL, `DEFINER` varchar(77) NOT NULL DEFAULT '',
`CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '', `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '',
`COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '', `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '',
`DATABASE_COLLATION` varchar(32) NOT NULL DEFAULT '' `DATABASE_COLLATION` varchar(32) NOT NULL DEFAULT ''
...@@ -95,8 +95,8 @@ ACTION_REFERENCE_NEW_TABLE varchar(64) YES NULL ...@@ -95,8 +95,8 @@ ACTION_REFERENCE_NEW_TABLE varchar(64) YES NULL
ACTION_REFERENCE_OLD_ROW varchar(3) NO ACTION_REFERENCE_OLD_ROW varchar(3) NO
ACTION_REFERENCE_NEW_ROW varchar(3) NO ACTION_REFERENCE_NEW_ROW varchar(3) NO
CREATED datetime YES NULL CREATED datetime YES NULL
SQL_MODE longtext NO NULL SQL_MODE varchar(8192) NO
DEFINER longtext NO NULL DEFINER varchar(77) NO
CHARACTER_SET_CLIENT varchar(32) NO CHARACTER_SET_CLIENT varchar(32) NO
COLLATION_CONNECTION varchar(32) NO COLLATION_CONNECTION varchar(32) NO
DATABASE_COLLATION varchar(32) NO DATABASE_COLLATION varchar(32) NO
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#### suite/funcs_1/t/ndb_triggers.test
# ndb tables should be used
#
# 1. Check if ndb is available
--source include/have_ndb.inc
# 2. Set $engine_type
let $engine_type= ndb;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/ndb_tb3.inc
--source suite/funcs_1/triggers/triggers_0102.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/ndb_triggers.test
# NDB tables should be used
#
# 1. Check if NDB is available
--source include/have_ndb.inc
# 2. Set $engine_type
let $engine_type= ndb;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/ndb_tb3.inc
--source suite/funcs_1/triggers/triggers_03.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/ndb_triggers.test
# ndb tables should be used
#
# 1. Check if ndb is available
--source include/have_ndb.inc
# 2. Set $engine_type
let $engine_type= ndb;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/ndb_tb3.inc
--source suite/funcs_1/triggers/triggers_0407.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/ndb_triggers.test
# ndb tables should be used
#
# 1. Check if ndb is available
--source include/have_ndb.inc
# 2. Set $engine_type
let $engine_type= ndb;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/ndb_tb3.inc
--source suite/funcs_1/triggers/triggers_08.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/ndb_triggers.test
# ndb tables should be used
#
# 1. Check if ndb is available
--source include/have_ndb.inc
# 2. Set $engine_type
let $engine_type= ndb;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/ndb_tb3.inc
--source suite/funcs_1/triggers/triggers_09.inc
DROP TABLE test.tb3;
#### suite/funcs_1/t/ndb_triggers.test
# ndb tables should be used
#
# 1. Check if ndb is available
--source include/have_ndb.inc
# 2. Set $engine_type
let $engine_type= ndb;
# Create some objects needed in many testcases
USE test;
--source suite/funcs_1/include/ndb_tb3.inc
--source suite/funcs_1/triggers/triggers_1011ext.inc
DROP TABLE test.tb3;
...@@ -97,7 +97,8 @@ t1 CREATE TABLE `t1` ( ...@@ -97,7 +97,8 @@ t1 CREATE TABLE `t1` (
`c` int(11) NOT NULL DEFAULT '0', `c` int(11) NOT NULL DEFAULT '0',
`d` int(11) DEFAULT NULL, `d` int(11) DEFAULT NULL,
PRIMARY KEY (`a`,`b`,`c`) USING HASH PRIMARY KEY (`a`,`b`,`c`) USING HASH
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (b) */ ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (b) */
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (a int not null primary key) CREATE TABLE t1 (a int not null primary key)
PARTITION BY KEY(a) PARTITION BY KEY(a)
...@@ -122,19 +123,28 @@ show create table t1; ...@@ -122,19 +123,28 @@ show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
(PARTITION p0 ENGINE = ndbcluster,
PARTITION p1 ENGINE = ndbcluster) */
alter table t1 engine=heap; alter table t1 engine=heap;
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = MEMORY, PARTITION p1 ENGINE = MEMORY) */ ) ENGINE=MEMORY DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
(PARTITION p0 ENGINE = MEMORY,
PARTITION p1 ENGINE = MEMORY) */
alter table t1 engine=ndb; alter table t1 engine=ndb;
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
(PARTITION p0 ENGINE = ndbcluster,
PARTITION p1 ENGINE = ndbcluster) */
alter table t1 engine=heap remove partitioning; alter table t1 engine=heap remove partitioning;
show create table t1; show create table t1;
Table Create Table Table Create Table
...@@ -148,7 +158,10 @@ show create table t1; ...@@ -148,7 +158,10 @@ show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
(PARTITION p0 ENGINE = ndbcluster,
PARTITION p1 ENGINE = ndbcluster) */
alter table t1 alter table t1
partition by key (a) partition by key (a)
(partition p0 engine=ndb, partition p1 engine=ndb); (partition p0 engine=ndb, partition p1 engine=ndb);
...@@ -156,7 +169,10 @@ show create table t1; ...@@ -156,7 +169,10 @@ show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
(PARTITION p0 ENGINE = ndbcluster,
PARTITION p1 ENGINE = ndbcluster) */
alter table t1 remove partitioning; alter table t1 remove partitioning;
show create table t1; show create table t1;
Table Create Table Table Create Table
...@@ -174,7 +190,10 @@ show create table t1; ...@@ -174,7 +190,10 @@ show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) DEFAULT NULL
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */ ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY (a)
(PARTITION p0 ENGINE = ndbcluster,
PARTITION p1 ENGINE = ndbcluster) */
drop table t1; drop table t1;
CREATE TABLE t1 ( CREATE TABLE t1 (
c1 MEDIUMINT NOT NULL AUTO_INCREMENT, c1 MEDIUMINT NOT NULL AUTO_INCREMENT,
......
...@@ -123,7 +123,11 @@ t1 CREATE TABLE `t1` ( ...@@ -123,7 +123,11 @@ t1 CREATE TABLE `t1` (
`c` int(11) NOT NULL, `c` int(11) NOT NULL,
PRIMARY KEY (`b`), PRIMARY KEY (`b`),
UNIQUE KEY `a` (`a`) UNIQUE KEY `a` (`a`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (b) (PARTITION x1 VALUES LESS THAN (5) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (10) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (20) ENGINE = ndbcluster) */ ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (b)
(PARTITION x1 VALUES LESS THAN (5) ENGINE = ndbcluster,
PARTITION x2 VALUES LESS THAN (10) ENGINE = ndbcluster,
PARTITION x3 VALUES LESS THAN (20) ENGINE = ndbcluster) */
drop table t1; drop table t1;
CREATE TABLE t1 CREATE TABLE t1
(id MEDIUMINT NOT NULL, (id MEDIUMINT NOT NULL,
......
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