mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 05:22:25 +01:00
Merge bk-internal.mysql.com:/dev/shm/knielsen/mysql-5.1-ndb-bj
into bk-internal.mysql.com:/dev/shm/knielsen/mysql-5.1-new-ndb
This commit is contained in:
commit
a96d7250e8
546 changed files with 29522 additions and 20294 deletions
1126
.bzrignore
1126
.bzrignore
File diff suppressed because it is too large
Load diff
|
@ -51,7 +51,7 @@ parse_options()
|
|||
|
||||
########################################################################
|
||||
|
||||
if ! test -f sql/mysqld.cc
|
||||
if test ! -f sql/mysqld.cc
|
||||
then
|
||||
echo "You must run this script from the MySQL top-level directory"
|
||||
exit 1
|
||||
|
@ -185,12 +185,6 @@ fi
|
|||
# (returns 0 if finds lines)
|
||||
if ccache -V > /dev/null 2>&1
|
||||
then
|
||||
if ! (echo "$CC" | grep "ccache" > /dev/null)
|
||||
then
|
||||
CC="ccache $CC"
|
||||
fi
|
||||
if ! (echo "$CXX" | grep "ccache" > /dev/null)
|
||||
then
|
||||
CXX="ccache $CXX"
|
||||
fi
|
||||
echo "$CC" | grep "ccache" > /dev/null || CC="ccache $CC"
|
||||
echo "$CXX" | grep "ccache" > /dev/null || CXX="ccache $CXX"
|
||||
fi
|
||||
|
|
|
@ -11,11 +11,6 @@ if [ -f /usr/bin/glibtoolize ]
|
|||
LIBTOOLIZE=libtoolize
|
||||
fi
|
||||
|
||||
(cd storage/bdb/dist && sh s_all)
|
||||
(cd storage/innobase && aclocal && autoheader && \
|
||||
$LIBTOOLIZE --automake --force --copy && \
|
||||
automake --force --add-missing --copy && autoconf)
|
||||
|
||||
aclocal || die "Can't execute aclocal"
|
||||
autoheader || die "Can't execute autoheader"
|
||||
# --force means overwrite ltmain.sh script if it already exists
|
||||
|
|
379
BUILD/check-cpu
379
BUILD/check-cpu
|
@ -3,209 +3,216 @@
|
|||
# Check cpu of current machine and find the
|
||||
# best compiler optimization flags for gcc
|
||||
#
|
||||
#
|
||||
|
||||
if test -r /proc/cpuinfo ; then
|
||||
# on Linux (and others?) we can get detailed CPU information out of /proc
|
||||
cpuinfo="cat /proc/cpuinfo"
|
||||
check_cpu () {
|
||||
if test -r /proc/cpuinfo ; then
|
||||
# on Linux (and others?) we can get detailed CPU information out of /proc
|
||||
cpuinfo="cat /proc/cpuinfo"
|
||||
|
||||
# detect CPU family
|
||||
cpu_family=`$cpuinfo | grep 'family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1`
|
||||
if test -z "$cpu_family" ; then
|
||||
cpu_family=`$cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1`
|
||||
# detect CPU family
|
||||
cpu_family=`$cpuinfo | grep 'family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1`
|
||||
if test -z "$cpu_family" ; then
|
||||
cpu_family=`$cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1`
|
||||
fi
|
||||
|
||||
# detect CPU vendor and model
|
||||
cpu_vendor=`$cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1`
|
||||
model_name=`$cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -1`
|
||||
if test -z "$model_name" ; then
|
||||
model_name=`$cpuinfo | grep 'cpu model' | cut -d ':' -f 2 | head -1`
|
||||
fi
|
||||
|
||||
# fallback: get CPU model from uname output
|
||||
if test -z "$model_name" ; then
|
||||
model_name=`uname -m`
|
||||
fi
|
||||
|
||||
# parse CPU flags
|
||||
for flag in `$cpuinfo | grep '^flags' | sed -e 's/^flags.*: //'`; do
|
||||
eval cpu_flag_$flag=yes
|
||||
done
|
||||
else
|
||||
# Fallback when there is no /proc/cpuinfo
|
||||
case "`uname -s`" in
|
||||
FreeBSD|OpenBSD)
|
||||
cpu_family=`uname -m`;
|
||||
model_name=`sysctl -n hw.model`
|
||||
;;
|
||||
Darwin)
|
||||
cpu_family=`uname -p`
|
||||
model_name=`machine`
|
||||
;;
|
||||
*)
|
||||
cpu_family=`uname -m`;
|
||||
model_name=`uname -p`;
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# detect CPU vendor and model
|
||||
cpu_vendor=`$cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1`
|
||||
model_name=`$cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -1`
|
||||
if test -z "$model_name" ; then
|
||||
model_name=`$cpuinfo | grep 'cpu model' | cut -d ':' -f 2 | head -1`
|
||||
fi
|
||||
|
||||
# fallback: get CPU model from uname output
|
||||
if test -z "$model_name" ; then
|
||||
model_name=`uname -m`
|
||||
fi
|
||||
|
||||
# parse CPU flags
|
||||
for flag in `$cpuinfo | grep '^flags' | sed -e 's/^flags.*: //'`; do
|
||||
eval cpu_flag_$flag=yes
|
||||
done
|
||||
else
|
||||
# Fallback when there is no /proc/cpuinfo
|
||||
case "`uname -s`" in
|
||||
FreeBSD|OpenBSD)
|
||||
cpu_family=`uname -m`;
|
||||
model_name=`sysctl -n hw.model`
|
||||
# detect CPU shortname as used by gcc options
|
||||
# this list is not complete, feel free to add further entries
|
||||
cpu_arg=""
|
||||
case "$cpu_family--$model_name" in
|
||||
# DEC Alpha
|
||||
Alpha*EV6*)
|
||||
cpu_arg="ev6";
|
||||
;;
|
||||
Darwin)
|
||||
cpu_family=`uname -p`
|
||||
model_name=`machine`
|
||||
|
||||
# Intel ia32
|
||||
*X[eE][oO][nN]*)
|
||||
# a Xeon is just another pentium4 ...
|
||||
# ... unless it has the "lm" (long-mode) flag set,
|
||||
# in that case it's a Xeon with EM64T support
|
||||
if [ -z "$cpu_flag_lm" ]; then
|
||||
cpu_arg="pentium4";
|
||||
else
|
||||
cpu_arg="nocona";
|
||||
fi
|
||||
;;
|
||||
*Pentium*4*Mobile*)
|
||||
cpu_arg="pentium4m";
|
||||
;;
|
||||
*Pentium*4*)
|
||||
cpu_arg="pentium4";
|
||||
;;
|
||||
*Pentium*III*Mobile*)
|
||||
cpu_arg="pentium3m";
|
||||
;;
|
||||
*Pentium*III*)
|
||||
cpu_arg="pentium3";
|
||||
;;
|
||||
*Pentium*M*pro*)
|
||||
cpu_arg="pentium-m";
|
||||
;;
|
||||
*Athlon*64*)
|
||||
cpu_arg="athlon64";
|
||||
;;
|
||||
*Athlon*)
|
||||
cpu_arg="athlon";
|
||||
;;
|
||||
*Opteron*)
|
||||
cpu_arg="opteron";
|
||||
;;
|
||||
# MacOSX / Intel
|
||||
*i386*i486*)
|
||||
cpu_arg="pentium-m";
|
||||
;;
|
||||
|
||||
# Intel ia64
|
||||
*Itanium*)
|
||||
# Don't need to set any flags for itanium(at the moment)
|
||||
cpu_arg="";
|
||||
;;
|
||||
|
||||
#
|
||||
*ppc*)
|
||||
cpu_arg='powerpc'
|
||||
;;
|
||||
|
||||
*powerpc*)
|
||||
cpu_arg='powerpc'
|
||||
;;
|
||||
|
||||
# unknown
|
||||
*)
|
||||
cpu_family=`uname -m`;
|
||||
model_name=`uname -p`;
|
||||
cpu_arg="";
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# detect CPU shortname as used by gcc options
|
||||
# this list is not complete, feel free to add further entries
|
||||
cpu_arg=""
|
||||
case "$cpu_family--$model_name" in
|
||||
# DEC Alpha
|
||||
Alpha*EV6*)
|
||||
cpu_arg="ev6";
|
||||
;;
|
||||
|
||||
# Intel ia32
|
||||
*X[eE][oO][nN]*)
|
||||
# a Xeon is just another pentium4 ...
|
||||
# ... unless it has the "lm" (long-mode) flag set,
|
||||
# in that case it's a Xeon with EM64T support
|
||||
if [ -z "$cpu_flag_lm" ]; then
|
||||
cpu_arg="pentium4";
|
||||
else
|
||||
cpu_arg="nocona";
|
||||
fi
|
||||
;;
|
||||
*Pentium*4*Mobile*)
|
||||
cpu_arg="pentium4m";
|
||||
;;
|
||||
*Pentium*4*)
|
||||
cpu_arg="pentium4";
|
||||
;;
|
||||
*Pentium*III*Mobile*)
|
||||
cpu_arg="pentium3m";
|
||||
;;
|
||||
*Pentium*III*)
|
||||
cpu_arg="pentium3";
|
||||
;;
|
||||
*Pentium*M*pro*)
|
||||
cpu_arg="pentium-m";
|
||||
;;
|
||||
*Athlon*64*)
|
||||
cpu_arg="athlon64";
|
||||
;;
|
||||
*Athlon*)
|
||||
cpu_arg="athlon";
|
||||
;;
|
||||
*Opteron*)
|
||||
cpu_arg="opteron";
|
||||
;;
|
||||
|
||||
# Intel ia64
|
||||
*Itanium*)
|
||||
# Don't need to set any flags for itanium(at the moment)
|
||||
cpu_arg="";
|
||||
;;
|
||||
|
||||
#
|
||||
*ppc*)
|
||||
cpu_arg='powerpc'
|
||||
;;
|
||||
|
||||
*powerpc*)
|
||||
cpu_arg='powerpc'
|
||||
;;
|
||||
|
||||
# unknown
|
||||
*)
|
||||
cpu_arg="";
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
if test -z "$cpu_arg"; then
|
||||
echo "BUILD/check-cpu: Oops, could not find out what kind of cpu this machine is using."
|
||||
check_cpu_cflags=""
|
||||
return
|
||||
fi
|
||||
|
||||
# different compiler versions have different option names
|
||||
# for CPU specific command line options
|
||||
if test -z "$CC" ; then
|
||||
cc="gcc";
|
||||
else
|
||||
cc=$CC
|
||||
fi
|
||||
|
||||
cc_ver=`$cc --version | sed 1q`
|
||||
cc_verno=`echo $cc_ver | sed -e 's/[^0-9. ]//g; s/^ *//g; s/ .*//g'`
|
||||
|
||||
case "$cc_ver--$cc_verno" in
|
||||
*GCC*)
|
||||
# different gcc backends (and versions) have different CPU flags
|
||||
case `gcc -dumpmachine` in
|
||||
i?86-*)
|
||||
case "$cc_verno" in
|
||||
3.4*|3.5*|4.*)
|
||||
check_cpu_args='-mtune=$cpu_arg -march=$cpu_arg'
|
||||
;;
|
||||
*)
|
||||
check_cpu_args='-mcpu=$cpu_arg -march=$cpu_arg'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
ppc-*)
|
||||
check_cpu_args='-mcpu=$cpu_arg -mtune=$cpu_arg'
|
||||
;;
|
||||
x86_64-*)
|
||||
check_cpu_args='-mtune=$cpu_arg'
|
||||
;;
|
||||
*)
|
||||
check_cpu_cflags=""
|
||||
return
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
2.95.*)
|
||||
# GCC 2.95 doesn't expose its name in --version output
|
||||
check_cpu_args='-m$cpu_arg'
|
||||
;;
|
||||
*)
|
||||
if test -z "$cpu_arg"; then
|
||||
echo "BUILD/check-cpu: Oops, could not find out what kind of cpu this machine is using." >&2
|
||||
check_cpu_cflags=""
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
# now we check whether the compiler really understands the cpu type
|
||||
touch __test.c
|
||||
|
||||
while [ "$cpu_arg" ] ; do
|
||||
echo -n testing $cpu_arg "... "
|
||||
|
||||
# compile check
|
||||
check_cpu_cflags=`eval echo $check_cpu_args`
|
||||
if $cc -c $check_cpu_cflags __test.c 2>/dev/null; then
|
||||
echo ok
|
||||
break;
|
||||
fi
|
||||
|
||||
echo failed
|
||||
check_cpu_cflags=""
|
||||
# different compiler versions have different option names
|
||||
# for CPU specific command line options
|
||||
if test -z "$CC" ; then
|
||||
cc="gcc";
|
||||
else
|
||||
cc=$CC
|
||||
fi
|
||||
|
||||
# if compile failed: check whether it supports a predecessor of this CPU
|
||||
# this list is not complete, feel free to add further entries
|
||||
case "$cpu_arg" in
|
||||
# Intel ia32
|
||||
nocona) cpu_arg=pentium4 ;;
|
||||
prescott) cpu_arg=pentium4 ;;
|
||||
pentium4m) cpu_arg=pentium4 ;;
|
||||
pentium4) cpu_arg=pentium3 ;;
|
||||
pentium3m) cpu_arg=pentium3 ;;
|
||||
pentium3) cpu_arg=pentium2 ;;
|
||||
pentium2) cpu_arg=pentiumpro ;;
|
||||
pentiumpro) cpu_arg=pentium ;;
|
||||
pentium) cpu_arg=i486 ;;
|
||||
i486) cpu_arg=i386 ;;
|
||||
cc_ver=`$cc --version | sed 1q`
|
||||
cc_verno=`echo $cc_ver | sed -e 's/^.*gcc/gcc/g; s/[^0-9. ]//g; s/^ *//g; s/ .*//g'`
|
||||
|
||||
# power / powerPC
|
||||
7450) cpu_arg=7400 ;;
|
||||
|
||||
*) cpu_arg="" ;;
|
||||
case "$cc_ver--$cc_verno" in
|
||||
*GCC*)
|
||||
# different gcc backends (and versions) have different CPU flags
|
||||
case `gcc -dumpmachine` in
|
||||
i?86-*)
|
||||
case "$cc_verno" in
|
||||
3.4*|3.5*|4.*)
|
||||
check_cpu_args='-mtune=$cpu_arg -march=$cpu_arg'
|
||||
;;
|
||||
*)
|
||||
check_cpu_args='-mcpu=$cpu_arg -march=$cpu_arg'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
ppc-*)
|
||||
check_cpu_args='-mcpu=$cpu_arg -mtune=$cpu_arg'
|
||||
;;
|
||||
x86_64-*)
|
||||
check_cpu_args='-mtune=$cpu_arg'
|
||||
;;
|
||||
*)
|
||||
check_cpu_cflags=""
|
||||
return
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
2.95.*)
|
||||
# GCC 2.95 doesn't expose its name in --version output
|
||||
check_cpu_args='-m$cpu_arg'
|
||||
;;
|
||||
*)
|
||||
check_cpu_cflags=""
|
||||
return
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
rm __test.*
|
||||
# now we check whether the compiler really understands the cpu type
|
||||
touch __test.c
|
||||
|
||||
while [ "$cpu_arg" ] ; do
|
||||
# FIXME: echo -n isn't portable - see contortions autoconf goes through
|
||||
echo -n testing $cpu_arg "... " >&2
|
||||
|
||||
# compile check
|
||||
check_cpu_cflags=`eval echo $check_cpu_args`
|
||||
if $cc -c $check_cpu_cflags __test.c 2>/dev/null; then
|
||||
echo ok >&2
|
||||
break;
|
||||
fi
|
||||
|
||||
echo failed >&2
|
||||
check_cpu_cflags=""
|
||||
|
||||
# if compile failed: check whether it supports a predecessor of this CPU
|
||||
# this list is not complete, feel free to add further entries
|
||||
case "$cpu_arg" in
|
||||
# Intel ia32
|
||||
nocona) cpu_arg=pentium4 ;;
|
||||
prescott) cpu_arg=pentium4 ;;
|
||||
pentium4m) cpu_arg=pentium4 ;;
|
||||
pentium4) cpu_arg=pentium3 ;;
|
||||
pentium3m) cpu_arg=pentium3 ;;
|
||||
pentium3) cpu_arg=pentium2 ;;
|
||||
pentium2) cpu_arg=pentiumpro ;;
|
||||
pentiumpro) cpu_arg=pentium ;;
|
||||
pentium) cpu_arg=i486 ;;
|
||||
i486) cpu_arg=i386 ;;
|
||||
|
||||
# power / powerPC
|
||||
7450) cpu_arg=7400 ;;
|
||||
|
||||
*) cpu_arg="" ;;
|
||||
esac
|
||||
done
|
||||
|
||||
rm __test.*
|
||||
}
|
||||
|
||||
check_cpu
|
||||
|
|
|
@ -1 +1,4 @@
|
|||
44d03f27qNdqJmARzBoP3Is_cN5e0w
|
||||
44ec850ac2k4y2Omgr92GiWPBAVKGQ
|
||||
44edb86b1iE5knJ97MbliK_3lCiAXA
|
||||
44f33f3aj5KW5qweQeekY1LU0E9ZCg
|
||||
|
|
|
@ -6,6 +6,13 @@ COMMITS=commits@lists.mysql.com
|
|||
DOCS=docs-commit@mysql.com
|
||||
LIMIT=10000
|
||||
VERSION="5.1"
|
||||
BKROOT=`bk root`
|
||||
|
||||
if [ -x /usr/sbin/sendmail ]; then
|
||||
SENDMAIL=/usr/sbin/sendmail
|
||||
else
|
||||
SENDMAIL=sendmail
|
||||
fi
|
||||
|
||||
if [ "$REAL_EMAIL" = "" ]
|
||||
then
|
||||
|
@ -14,12 +21,6 @@ else
|
|||
FROM=$REAL_EMAIL
|
||||
fi
|
||||
|
||||
if [ -x /usr/sbin/sendmail ]; then
|
||||
SENDMAIL=/usr/sbin/sendmail
|
||||
else
|
||||
SENDMAIL=sendmail
|
||||
fi
|
||||
|
||||
BK_STATUS=$BK_STATUS$BK_COMMIT
|
||||
|
||||
if [ "$BK_STATUS" = OK ]
|
||||
|
@ -64,7 +65,9 @@ $BH
|
|||
EOF
|
||||
bk changes -v -r+
|
||||
bk cset -r+ -d
|
||||
) | $SENDMAIL -t
|
||||
) > $BKROOT/BitKeeper/tmp/dev_public.txt
|
||||
|
||||
$SENDMAIL -t < $BKROOT/BitKeeper/tmp/dev_public.txt
|
||||
|
||||
#++
|
||||
# commits@ mail
|
||||
|
@ -88,7 +91,9 @@ see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
|
|||
EOF
|
||||
bk changes -v -r+
|
||||
bk cset -r+ -d
|
||||
) | head -n $LIMIT | $SENDMAIL -t
|
||||
) | bk sed -e ${LIMIT}q > $BKROOT/BitKeeper/tmp/commits.txt
|
||||
|
||||
$SENDMAIL -t < $BKROOT/BitKeeper/tmp/commits.txt
|
||||
|
||||
#++
|
||||
# docs-commit@ mail
|
||||
|
@ -108,7 +113,8 @@ Subject: bk commit - $VERSION tree (Manual) ($CHANGESET)$BS
|
|||
EOF
|
||||
bk changes -v -r+
|
||||
bk cset -r+ -d
|
||||
) | $SENDMAIL -t
|
||||
) > $BKROOT/BitKeeper/tmp/docs.txt
|
||||
$SENDMAIL -t < $BKROOT/BitKeeper/tmp/docs.txt
|
||||
fi
|
||||
|
||||
else
|
||||
|
|
|
@ -136,6 +136,9 @@ ENDIF(WITH_CSV_STORAGE_ENGINE)
|
|||
IF(WITH_EXAMPLE_STORAGE_ENGINE)
|
||||
ADD_SUBDIRECTORY(storage/example)
|
||||
ENDIF(WITH_EXAMPLE_STORAGE_ENGINE)
|
||||
IF(WITH_FEDERATED_STORAGE_ENGINE)
|
||||
ADD_SUBDIRECTORY(storage/federated)
|
||||
ENDIF(WITH_FEDERATED_STORAGE_ENGINE)
|
||||
IF(WITH_INNOBASE_STORAGE_ENGINE)
|
||||
ADD_SUBDIRECTORY(storage/innobase)
|
||||
ENDIF(WITH_INNOBASE_STORAGE_ENGINE)
|
||||
|
|
44
bdb/CMakeLists.txt
Executable file
44
bdb/CMakeLists.txt
Executable file
|
@ -0,0 +1,44 @@
|
|||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
|
||||
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
|
||||
|
||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/bdb/build_win32
|
||||
${CMAKE_SOURCE_DIR}/bdb/dbinc
|
||||
${CMAKE_SOURCE_DIR}/bdb)
|
||||
|
||||
# BDB needs a number of source files that are auto-generated by the unix
|
||||
# configure. So to build BDB, it is necessary to copy these over to the Windows
|
||||
# bitkeeper tree, or to use a source .tar.gz package which already has these
|
||||
# files.
|
||||
ADD_LIBRARY(bdb btree/bt_compare.c btree/bt_conv.c btree/bt_curadj.c btree/bt_cursor.c
|
||||
btree/bt_delete.c btree/bt_method.c btree/bt_open.c btree/bt_put.c btree/bt_rec.c
|
||||
btree/bt_reclaim.c btree/bt_recno.c btree/bt_rsearch.c btree/bt_search.c
|
||||
btree/bt_split.c btree/bt_stat.c btree/bt_upgrade.c btree/bt_verify.c btree/btree_auto.c
|
||||
db/crdel_auto.c db/crdel_rec.c db/db.c db/db_am.c db/db_auto.c common/db_byteorder.c
|
||||
db/db_cam.c db/db_conv.c db/db_dispatch.c db/db_dup.c common/db_err.c common/db_getlong.c
|
||||
common/db_idspace.c db/db_iface.c db/db_join.c common/db_log2.c db/db_meta.c
|
||||
db/db_method.c db/db_open.c db/db_overflow.c db/db_pr.c db/db_rec.c db/db_reclaim.c
|
||||
db/db_remove.c db/db_rename.c db/db_ret.c env/db_salloc.c env/db_shash.c db/db_truncate.c
|
||||
db/db_upg.c db/db_upg_opd.c db/db_vrfy.c db/db_vrfyutil.c dbm/dbm.c dbreg/dbreg.c
|
||||
dbreg/dbreg_auto.c dbreg/dbreg_rec.c dbreg/dbreg_util.c env/env_file.c env/env_method.c
|
||||
env/env_open.c env/env_recover.c env/env_region.c fileops/fileops_auto.c fileops/fop_basic.c
|
||||
fileops/fop_rec.c fileops/fop_util.c hash/hash.c hash/hash_auto.c hash/hash_conv.c
|
||||
hash/hash_dup.c hash/hash_func.c hash/hash_meta.c hash/hash_method.c hash/hash_open.c
|
||||
hash/hash_page.c hash/hash_rec.c hash/hash_reclaim.c hash/hash_stat.c hash/hash_upgrade.c
|
||||
hash/hash_verify.c hmac/hmac.c hsearch/hsearch.c lock/lock.c lock/lock_deadlock.c
|
||||
lock/lock_method.c lock/lock_region.c lock/lock_stat.c lock/lock_util.c log/log.c
|
||||
log/log_archive.c log/log_compare.c log/log_get.c log/log_method.c log/log_put.c
|
||||
mp/mp_alloc.c mp/mp_bh.c mp/mp_fget.c mp/mp_fopen.c mp/mp_fput.c
|
||||
mp/mp_fset.c mp/mp_method.c mp/mp_region.c mp/mp_register.c mp/mp_stat.c mp/mp_sync.c
|
||||
mp/mp_trickle.c mutex/mut_tas.c mutex/mut_win32.c mutex/mutex.c os_win32/os_abs.c
|
||||
os/os_alloc.c os_win32/os_clock.c os_win32/os_config.c os_win32/os_dir.c os_win32/os_errno.c
|
||||
os_win32/os_fid.c os_win32/os_fsync.c os_win32/os_handle.c os/os_id.c os_win32/os_map.c
|
||||
os/os_method.c os/os_oflags.c os_win32/os_open.c os/os_region.c os_win32/os_rename.c
|
||||
os/os_root.c os/os_rpath.c os_win32/os_rw.c os_win32/os_seek.c os_win32/os_sleep.c
|
||||
os_win32/os_spin.c os_win32/os_stat.c os/os_tmpdir.c os_win32/os_type.c os/os_unlink.c
|
||||
qam/qam.c qam/qam_auto.c qam/qam_conv.c qam/qam_files.c qam/qam_method.c qam/qam_open.c
|
||||
qam/qam_rec.c qam/qam_stat.c qam/qam_upgrade.c qam/qam_verify.c rep/rep_method.c
|
||||
rep/rep_record.c rep/rep_region.c rep/rep_util.c hmac/sha1.c
|
||||
clib/strcasecmp.c txn/txn.c txn/txn_auto.c txn/txn_method.c txn/txn_rec.c
|
||||
txn/txn_recover.c txn/txn_region.c txn/txn_stat.c txn/txn_util.c common/util_log.c
|
||||
common/util_sig.c xa/xa.c xa/xa_db.c xa/xa_map.c)
|
||||
|
|
@ -338,7 +338,7 @@ static void end_timer(ulong start_time,char *buff);
|
|||
static void mysql_end_timer(ulong start_time,char *buff);
|
||||
static void nice_time(double sec,char *buff,bool part_second);
|
||||
static sig_handler mysql_end(int sig);
|
||||
static sig_handler mysql_sigint(int sig);
|
||||
static sig_handler handle_sigint(int sig);
|
||||
|
||||
int main(int argc,char *argv[])
|
||||
{
|
||||
|
@ -420,8 +420,7 @@ int main(int argc,char *argv[])
|
|||
if (opt_sigint_ignore)
|
||||
signal(SIGINT, SIG_IGN);
|
||||
else
|
||||
signal(SIGINT, mysql_sigint); // Catch SIGINT to clean up
|
||||
|
||||
signal(SIGINT, handle_sigint); // Catch SIGINT to clean up
|
||||
signal(SIGQUIT, mysql_end); // Catch SIGQUIT to clean up
|
||||
|
||||
/*
|
||||
|
@ -489,28 +488,6 @@ int main(int argc,char *argv[])
|
|||
#endif
|
||||
}
|
||||
|
||||
sig_handler mysql_sigint(int sig)
|
||||
{
|
||||
char kill_buffer[40];
|
||||
MYSQL *kill_mysql= NULL;
|
||||
|
||||
signal(SIGINT, mysql_sigint);
|
||||
|
||||
/* terminate if no query being executed, or we already tried interrupting */
|
||||
if (!executing_query || interrupted_query++)
|
||||
mysql_end(sig);
|
||||
|
||||
kill_mysql= mysql_init(kill_mysql);
|
||||
if (!mysql_real_connect(kill_mysql,current_host, current_user, opt_password,
|
||||
"", opt_mysql_port, opt_mysql_unix_port,0))
|
||||
mysql_end(sig);
|
||||
/* kill_buffer is always big enough because max length of %lu is 15 */
|
||||
sprintf(kill_buffer, "KILL /*!50000 QUERY */ %lu", mysql_thread_id(&mysql));
|
||||
mysql_real_query(kill_mysql, kill_buffer, strlen(kill_buffer));
|
||||
mysql_close(kill_mysql);
|
||||
tee_fprintf(stdout, "Query aborted by Ctrl+C\n");
|
||||
}
|
||||
|
||||
sig_handler mysql_end(int sig)
|
||||
{
|
||||
mysql_close(&mysql);
|
||||
|
@ -1058,8 +1035,6 @@ static int read_and_execute(bool interactive)
|
|||
if (opt_outfile && glob_buffer.is_empty())
|
||||
fflush(OUTFILE);
|
||||
|
||||
interrupted_query= 0;
|
||||
|
||||
#if defined( __WIN__) || defined(__NETWARE__)
|
||||
tee_fputs(prompt, stdout);
|
||||
#if defined(__NETWARE__)
|
||||
|
@ -1982,6 +1957,9 @@ com_charset(String *buffer __attribute__((unused)), char *line)
|
|||
if (new_cs)
|
||||
{
|
||||
charset_info= new_cs;
|
||||
mysql_set_character_set(&mysql, charset_info->csname);
|
||||
default_charset= (char *)charset_info->csname;
|
||||
default_charset_used= 1;
|
||||
put_info("Charset changed", INFO_INFO);
|
||||
}
|
||||
else put_info("Charset is not found", INFO_INFO);
|
||||
|
@ -2041,9 +2019,7 @@ com_go(String *buffer,char *line __attribute__((unused)))
|
|||
}
|
||||
|
||||
timer=start_timer();
|
||||
|
||||
executing_query= 1;
|
||||
|
||||
error= mysql_real_query_for_lazy(buffer->ptr(),buffer->length());
|
||||
|
||||
#ifdef HAVE_READLINE
|
||||
|
@ -2059,7 +2035,6 @@ com_go(String *buffer,char *line __attribute__((unused)))
|
|||
{
|
||||
executing_query= 0;
|
||||
buffer->length(0); // Remove query on error
|
||||
executing_query= 0;
|
||||
return error;
|
||||
}
|
||||
error=0;
|
||||
|
@ -2143,9 +2118,6 @@ com_go(String *buffer,char *line __attribute__((unused)))
|
|||
fflush(stdout);
|
||||
mysql_free_result(result);
|
||||
} while (!(err= mysql_next_result(&mysql)));
|
||||
|
||||
executing_query= 0;
|
||||
|
||||
if (err >= 1)
|
||||
error= put_error(&mysql);
|
||||
|
||||
|
@ -2329,10 +2301,8 @@ print_table_data(MYSQL_RES *result)
|
|||
MYSQL_ROW cur;
|
||||
MYSQL_FIELD *field;
|
||||
bool *num_flag;
|
||||
bool *not_null_flag;
|
||||
|
||||
num_flag=(bool*) my_alloca(sizeof(bool)*mysql_num_fields(result));
|
||||
not_null_flag=(bool*) my_alloca(sizeof(bool)*mysql_num_fields(result));
|
||||
if (info_flag)
|
||||
{
|
||||
print_field_types(result);
|
||||
|
@ -2362,11 +2332,15 @@ print_table_data(MYSQL_RES *result)
|
|||
(void) tee_fputs("|", PAGER);
|
||||
for (uint off=0; (field = mysql_fetch_field(result)) ; off++)
|
||||
{
|
||||
tee_fprintf(PAGER, " %-*s |",(int) min(field->max_length,
|
||||
uint name_length= (uint) strlen(field->name);
|
||||
uint numcells= charset_info->cset->numcells(charset_info,
|
||||
field->name,
|
||||
field->name + name_length);
|
||||
uint display_length= field->max_length + name_length - numcells;
|
||||
tee_fprintf(PAGER, " %-*s |",(int) min(display_length,
|
||||
MAX_COLUMN_LENGTH),
|
||||
field->name);
|
||||
field->name);
|
||||
num_flag[off]= IS_NUM(field->type);
|
||||
not_null_flag[off]= IS_NOT_NULL(field->flags);
|
||||
}
|
||||
(void) tee_fputs("\n", PAGER);
|
||||
tee_puts((char*) separator.ptr(), PAGER);
|
||||
|
@ -2384,11 +2358,10 @@ print_table_data(MYSQL_RES *result)
|
|||
const char *buffer;
|
||||
uint data_length;
|
||||
uint field_max_length;
|
||||
bool right_justified;
|
||||
uint visible_length;
|
||||
uint extra_padding;
|
||||
|
||||
if (! not_null_flag[off] && (cur[off] == NULL))
|
||||
if (cur[off] == NULL)
|
||||
{
|
||||
buffer= "NULL";
|
||||
data_length= 4;
|
||||
|
@ -2428,7 +2401,6 @@ print_table_data(MYSQL_RES *result)
|
|||
}
|
||||
tee_puts((char*) separator.ptr(), PAGER);
|
||||
my_afree((gptr) num_flag);
|
||||
my_afree((gptr) not_null_flag);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -157,17 +157,29 @@ static int create_defaults_file(const char *path, const char *our_defaults_path)
|
|||
File our_defaults_file, defaults_file;
|
||||
char buffer[512];
|
||||
char *buffer_end;
|
||||
int failed_to_open_count= 0;
|
||||
int error;
|
||||
|
||||
/* check if the defaults file is needed at all */
|
||||
if (!opt_password)
|
||||
return 0;
|
||||
|
||||
defaults_file= my_open(path, O_BINARY | O_CREAT | O_WRONLY,
|
||||
retry_open:
|
||||
defaults_file= my_open(path, O_BINARY | O_CREAT | O_WRONLY | O_EXCL,
|
||||
MYF(MY_FAE | MY_WME));
|
||||
|
||||
if (defaults_file < 0)
|
||||
return 1;
|
||||
{
|
||||
if (failed_to_open_count == 0)
|
||||
{
|
||||
remove(path);
|
||||
failed_to_open_count+= 1;
|
||||
goto retry_open;
|
||||
}
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
upgrade_defaults_created= 1;
|
||||
if (our_defaults_path)
|
||||
{
|
||||
|
@ -188,7 +200,7 @@ static int create_defaults_file(const char *path, const char *our_defaults_path)
|
|||
}
|
||||
buffer_end= strnmov(buffer, "\n[client]", sizeof(buffer));
|
||||
if (opt_password)
|
||||
buffer_end= strxnmov(buffer, sizeof(buffer),
|
||||
buffer_end= strxnmov(buffer_end, sizeof(buffer),
|
||||
"\npassword=", opt_password, NullS);
|
||||
error= my_write(defaults_file, buffer, (int) (buffer_end - buffer),
|
||||
MYF(MY_WME | MY_FNABP));
|
||||
|
|
|
@ -86,7 +86,7 @@ static char *alloc_query_str(ulong size);
|
|||
static char *field_escape(char *to,const char *from,uint length);
|
||||
static my_bool verbose= 0, opt_no_create_info= 0, opt_no_data= 0,
|
||||
quick= 1, extended_insert= 1,
|
||||
lock_tables=1,ignore_errors=0,flush_logs=0,
|
||||
lock_tables=1,ignore_errors=0,flush_logs=0,flush_privileges=0,
|
||||
opt_drop=1,opt_keywords=0,opt_lock=1,opt_compress=0,
|
||||
opt_delayed=0,create_options=1,opt_quoted=0,opt_databases=0,
|
||||
opt_alldbs=0,opt_create_db=0,opt_lock_all_tables=0,
|
||||
|
@ -266,6 +266,12 @@ static struct my_option my_long_options[] =
|
|||
"--lock-all-tables or --master-data with --flush-logs",
|
||||
(gptr*) &flush_logs, (gptr*) &flush_logs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
0, 0},
|
||||
{"flush-privileges", OPT_ESC, "Emit a FLUSH PRIVILEGES statement "
|
||||
"after dumping the mysql database. This option should be used any "
|
||||
"time the dump contains the mysql database and any other database "
|
||||
"that depends on the data in the mysql database for proper restore. ",
|
||||
(gptr*) &flush_privileges, (gptr*) &flush_privileges, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
|
||||
0, 0},
|
||||
{"force", 'f', "Continue even if we get an sql-error.",
|
||||
(gptr*) &ignore_errors, (gptr*) &ignore_errors, 0, GET_BOOL, NO_ARG,
|
||||
0, 0, 0, 0, 0, 0},
|
||||
|
@ -430,7 +436,9 @@ static void print_value(FILE *file, MYSQL_RES *result, MYSQL_ROW row,
|
|||
int string_value);
|
||||
static int dump_selected_tables(char *db, char **table_names, int tables);
|
||||
static int dump_all_tables_in_db(char *db);
|
||||
static int init_dumping(char *);
|
||||
static int init_dumping_views(char *);
|
||||
static int init_dumping_tables(char *);
|
||||
static int init_dumping(char *, int init_func(char*));
|
||||
static int dump_databases(char **);
|
||||
static int dump_all_databases();
|
||||
static char *quote_name(const char *name, char *buff, my_bool force);
|
||||
|
@ -861,8 +869,9 @@ static int get_options(int *argc, char ***argv)
|
|||
static void DB_error(MYSQL *mysql, const char *when)
|
||||
{
|
||||
DBUG_ENTER("DB_error");
|
||||
my_printf_error(0,"Got error: %d: %s %s", MYF(0),
|
||||
mysql_errno(mysql), mysql_error(mysql), when);
|
||||
fprintf(stderr, "%s: Got error: %d: %s %s\n", my_progname,
|
||||
mysql_errno(mysql), mysql_error(mysql), when);
|
||||
fflush(stderr);
|
||||
safe_exit(EX_MYSQLERR);
|
||||
DBUG_VOID_RETURN;
|
||||
} /* DB_error */
|
||||
|
@ -890,8 +899,9 @@ static int mysql_query_with_error_report(MYSQL *mysql_con, MYSQL_RES **res,
|
|||
if (mysql_query(mysql_con, query) ||
|
||||
(res && !((*res)= mysql_store_result(mysql_con))))
|
||||
{
|
||||
my_printf_error(0, "Couldn't execute '%s': %s (%d)", MYF(0),
|
||||
query, mysql_error(mysql_con), mysql_errno(mysql_con));
|
||||
fprintf(stderr, "%s: Couldn't execute '%s': %s (%d)\n",
|
||||
my_progname, query,
|
||||
mysql_error(mysql_con), mysql_errno(mysql_con));
|
||||
safe_exit(EX_MYSQLERR);
|
||||
return 1;
|
||||
}
|
||||
|
@ -2378,7 +2388,10 @@ static void dump_table(char *table, char *db)
|
|||
check_io(md_result_file);
|
||||
}
|
||||
if (mysql_query_with_error_report(mysql, 0, query))
|
||||
{
|
||||
DB_error(mysql, "when retrieving data from server");
|
||||
goto err;
|
||||
}
|
||||
if (quick)
|
||||
res=mysql_use_result(mysql);
|
||||
else
|
||||
|
@ -2737,6 +2750,12 @@ static int dump_all_tablespaces()
|
|||
MYSQL_RES *tableres;
|
||||
char buf[FN_REFLEN];
|
||||
int first;
|
||||
/*
|
||||
The following are used for parsing the EXTRA field
|
||||
*/
|
||||
char extra_format[]= "UNDO_BUFFER_SIZE=";
|
||||
char *ubs;
|
||||
char *endsemi;
|
||||
|
||||
if (mysql_query_with_error_report(mysql, &tableres,
|
||||
"SELECT DISTINCT"
|
||||
|
@ -2744,9 +2763,11 @@ static int dump_all_tablespaces()
|
|||
" FILE_NAME,"
|
||||
" TOTAL_EXTENTS,"
|
||||
" INITIAL_SIZE,"
|
||||
" ENGINE"
|
||||
" ENGINE,"
|
||||
" EXTRA"
|
||||
" FROM INFORMATION_SCHEMA.FILES"
|
||||
" WHERE FILE_TYPE = \"UNDO LOG\""
|
||||
" AND FILE_NAME IS NOT NULL"
|
||||
" ORDER BY LOGFILE_GROUP_NAME"))
|
||||
return 1;
|
||||
|
||||
|
@ -2775,9 +2796,16 @@ static int dump_all_tablespaces()
|
|||
row[1]);
|
||||
if (first)
|
||||
{
|
||||
ubs= strstr(row[5],extra_format);
|
||||
if(!ubs)
|
||||
break;
|
||||
ubs+= strlen(extra_format);
|
||||
endsemi= strstr(ubs,";");
|
||||
if(endsemi)
|
||||
endsemi[0]= '\0';
|
||||
fprintf(md_result_file,
|
||||
" UNDO_BUFFER_SIZE %s\n",
|
||||
row[2]);
|
||||
ubs);
|
||||
}
|
||||
fprintf(md_result_file,
|
||||
" INITIAL_SIZE %s\n"
|
||||
|
@ -2905,7 +2933,76 @@ static int dump_databases(char **db_names)
|
|||
} /* dump_databases */
|
||||
|
||||
|
||||
static int init_dumping(char *database)
|
||||
/*
|
||||
View Specific database initalization.
|
||||
|
||||
SYNOPSIS
|
||||
init_dumping_views
|
||||
qdatabase quoted name of the database
|
||||
|
||||
RETURN VALUES
|
||||
0 Success.
|
||||
1 Failure.
|
||||
*/
|
||||
int init_dumping_views(char *qdatabase)
|
||||
{
|
||||
return 0;
|
||||
} /* init_dumping_views */
|
||||
|
||||
|
||||
/*
|
||||
Table Specific database initalization.
|
||||
|
||||
SYNOPSIS
|
||||
init_dumping_tables
|
||||
qdatabase quoted name of the database
|
||||
|
||||
RETURN VALUES
|
||||
0 Success.
|
||||
1 Failure.
|
||||
*/
|
||||
int init_dumping_tables(char *qdatabase)
|
||||
{
|
||||
if (!opt_create_db)
|
||||
{
|
||||
char qbuf[256];
|
||||
MYSQL_ROW row;
|
||||
MYSQL_RES *dbinfo;
|
||||
|
||||
my_snprintf(qbuf, sizeof(qbuf),
|
||||
"SHOW CREATE DATABASE IF NOT EXISTS %s",
|
||||
qdatabase);
|
||||
|
||||
if (mysql_query(mysql, qbuf) || !(dbinfo = mysql_store_result(mysql)))
|
||||
{
|
||||
/* Old server version, dump generic CREATE DATABASE */
|
||||
if (opt_drop_database)
|
||||
fprintf(md_result_file,
|
||||
"\n/*!40000 DROP DATABASE IF EXISTS %s;*/\n",
|
||||
qdatabase);
|
||||
fprintf(md_result_file,
|
||||
"\nCREATE DATABASE /*!32312 IF NOT EXISTS*/ %s;\n",
|
||||
qdatabase);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (opt_drop_database)
|
||||
fprintf(md_result_file,
|
||||
"\n/*!40000 DROP DATABASE IF EXISTS %s*/;\n",
|
||||
qdatabase);
|
||||
row = mysql_fetch_row(dbinfo);
|
||||
if (row[1])
|
||||
{
|
||||
fprintf(md_result_file,"\n%s;\n",row[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
} /* init_dumping_tables */
|
||||
|
||||
|
||||
static int init_dumping(char *database, int init_func(char*))
|
||||
{
|
||||
if (mysql_get_server_version(mysql) >= 50003 &&
|
||||
!my_strcasecmp(&my_charset_latin1, database, "information_schema"))
|
||||
|
@ -2930,40 +3027,10 @@ static int init_dumping(char *database)
|
|||
fprintf(md_result_file,"\n--\n-- Current Database: %s\n--\n", qdatabase);
|
||||
check_io(md_result_file);
|
||||
}
|
||||
if (!opt_create_db)
|
||||
{
|
||||
char qbuf[256];
|
||||
MYSQL_ROW row;
|
||||
MYSQL_RES *dbinfo;
|
||||
|
||||
my_snprintf(qbuf, sizeof(qbuf),
|
||||
"SHOW CREATE DATABASE IF NOT EXISTS %s",
|
||||
qdatabase);
|
||||
/* Call the view or table specific function */
|
||||
init_func(qdatabase);
|
||||
|
||||
if (mysql_query(mysql, qbuf) || !(dbinfo = mysql_store_result(mysql)))
|
||||
{
|
||||
/* Old server version, dump generic CREATE DATABASE */
|
||||
if (opt_drop_database)
|
||||
fprintf(md_result_file,
|
||||
"\n/*!40000 DROP DATABASE IF EXISTS %s;*/\n",
|
||||
qdatabase);
|
||||
fprintf(md_result_file,
|
||||
"\nCREATE DATABASE /*!32312 IF NOT EXISTS*/ %s;\n",
|
||||
qdatabase);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (opt_drop_database)
|
||||
fprintf(md_result_file,
|
||||
"\n/*!40000 DROP DATABASE IF EXISTS %s*/;\n",
|
||||
qdatabase);
|
||||
row = mysql_fetch_row(dbinfo);
|
||||
if (row[1])
|
||||
{
|
||||
fprintf(md_result_file,"\n%s;\n",row[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
fprintf(md_result_file,"\nUSE %s;\n", qdatabase);
|
||||
check_io(md_result_file);
|
||||
}
|
||||
|
@ -2991,13 +3058,14 @@ static int dump_all_tables_in_db(char *database)
|
|||
|
||||
char hash_key[2*NAME_LEN+2]; /* "db.tablename" */
|
||||
char *afterdot;
|
||||
int using_mysql_db= my_strcasecmp(&my_charset_latin1, database, "mysql");
|
||||
|
||||
afterdot= strmov(hash_key, database);
|
||||
*afterdot++= '.';
|
||||
|
||||
if (!strcmp(database, NDB_REP_DB)) /* Skip cluster internal database */
|
||||
return 0;
|
||||
if (init_dumping(database))
|
||||
if (init_dumping(database, init_dumping_tables))
|
||||
return 1;
|
||||
if (opt_xml)
|
||||
print_xml_tag1(md_result_file, "", "database name=", database, "\n");
|
||||
|
@ -3053,6 +3121,11 @@ static int dump_all_tables_in_db(char *database)
|
|||
}
|
||||
if (lock_tables)
|
||||
VOID(mysql_query_with_error_report(mysql, 0, "UNLOCK TABLES"));
|
||||
if (flush_privileges && using_mysql_db == 0)
|
||||
{
|
||||
fprintf(md_result_file,"\n--\n-- Flush Grant Tables \n--\n");
|
||||
fprintf(md_result_file,"\n/*! FLUSH PRIVILEGES */;\n");
|
||||
}
|
||||
return 0;
|
||||
} /* dump_all_tables_in_db */
|
||||
|
||||
|
@ -3075,23 +3148,8 @@ static my_bool dump_all_views_in_db(char *database)
|
|||
uint numrows;
|
||||
char table_buff[NAME_LEN*2+3];
|
||||
|
||||
if (mysql_select_db(mysql, database))
|
||||
{
|
||||
DB_error(mysql, "when selecting the database");
|
||||
if (init_dumping(database, init_dumping_views))
|
||||
return 1;
|
||||
}
|
||||
if (opt_databases || opt_alldbs)
|
||||
{
|
||||
char quoted_database_buf[NAME_LEN*2+3];
|
||||
char *qdatabase= quote_name(database,quoted_database_buf,opt_quoted);
|
||||
if (opt_comments)
|
||||
{
|
||||
fprintf(md_result_file,"\n--\n-- Current Database: %s\n--\n", qdatabase);
|
||||
check_io(md_result_file);
|
||||
}
|
||||
fprintf(md_result_file,"\nUSE %s;\n", qdatabase);
|
||||
check_io(md_result_file);
|
||||
}
|
||||
if (opt_xml)
|
||||
print_xml_tag1(md_result_file, "", "database name=", database, "\n");
|
||||
if (lock_tables)
|
||||
|
@ -3186,7 +3244,7 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
|
|||
char **dump_tables, **pos, **end;
|
||||
DBUG_ENTER("dump_selected_tables");
|
||||
|
||||
if (init_dumping(db))
|
||||
if (init_dumping(db, init_dumping_tables))
|
||||
DBUG_RETURN(1);
|
||||
|
||||
init_alloc_root(&root, 8192, 0);
|
||||
|
|
|
@ -155,6 +155,7 @@ static my_bool ps_protocol= 0, ps_protocol_enabled= 0;
|
|||
static my_bool sp_protocol= 0, sp_protocol_enabled= 0;
|
||||
static my_bool view_protocol= 0, view_protocol_enabled= 0;
|
||||
static my_bool cursor_protocol= 0, cursor_protocol_enabled= 0;
|
||||
static my_bool opt_valgrind_test= 0;
|
||||
static int parsing_disabled= 0;
|
||||
|
||||
static char **default_argv;
|
||||
|
@ -1624,16 +1625,25 @@ int do_save_master_pos()
|
|||
|
||||
if (have_ndbcluster)
|
||||
{
|
||||
ulonglong epoch=0, tmp_epoch= 0;
|
||||
ulonglong start_epoch= 0, applied_epoch= 0,
|
||||
latest_epoch=0, latest_trans_epoch=0,
|
||||
latest_handled_binlog_epoch= 0, latest_received_binlog_epoch= 0,
|
||||
latest_applied_binlog_epoch= 0;
|
||||
int count= 0;
|
||||
int do_continue= 1;
|
||||
while (do_continue)
|
||||
{
|
||||
const char binlog[]= "binlog";
|
||||
const char latest_trans_epoch[]=
|
||||
const char latest_epoch_str[]=
|
||||
"latest_epoch=";
|
||||
const char latest_trans_epoch_str[]=
|
||||
"latest_trans_epoch=";
|
||||
const char latest_handled_binlog_epoch[]=
|
||||
const char latest_received_binlog_epoch_str[]=
|
||||
"latest_received_binlog_epoch";
|
||||
const char latest_handled_binlog_epoch_str[]=
|
||||
"latest_handled_binlog_epoch=";
|
||||
const char latest_applied_binlog_epoch_str[]=
|
||||
"latest_applied_binlog_epoch=";
|
||||
if (count)
|
||||
sleep(1);
|
||||
if (mysql_query(mysql, query= "show engine ndb status"))
|
||||
|
@ -1647,45 +1657,87 @@ int do_save_master_pos()
|
|||
if (strcmp(row[1], binlog) == 0)
|
||||
{
|
||||
const char *status= row[2];
|
||||
/* latest_trans_epoch */
|
||||
if (count == 0)
|
||||
|
||||
/* latest_epoch */
|
||||
while (*status && strncmp(status, latest_epoch_str,
|
||||
sizeof(latest_epoch_str)-1))
|
||||
status++;
|
||||
if (*status)
|
||||
{
|
||||
while (*status && strncmp(status, latest_trans_epoch,
|
||||
sizeof(latest_trans_epoch)-1))
|
||||
status++;
|
||||
if (*status)
|
||||
{
|
||||
status+= sizeof(latest_trans_epoch)-1;
|
||||
epoch= strtoull(status, (char**) 0, 10);
|
||||
}
|
||||
else
|
||||
die("line %u: result does not contain '%s' in '%s'",
|
||||
start_lineno, latest_trans_epoch, query);
|
||||
}
|
||||
/* latest_applied_binlog_epoch */
|
||||
while (*status && strncmp(status, latest_handled_binlog_epoch,
|
||||
sizeof(latest_handled_binlog_epoch)-1))
|
||||
status++;
|
||||
if (*status)
|
||||
{
|
||||
status+= sizeof(latest_handled_binlog_epoch)-1;
|
||||
tmp_epoch= strtoull(status, (char**) 0, 10);
|
||||
}
|
||||
else
|
||||
die("line %u: result does not contain '%s' in '%s'",
|
||||
start_lineno, latest_handled_binlog_epoch, query);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!row)
|
||||
die("line %u: result does not contain '%s' in '%s'",
|
||||
start_lineno, binlog, query);
|
||||
count++;
|
||||
if (tmp_epoch >= epoch)
|
||||
status+= sizeof(latest_epoch_str)-1;
|
||||
latest_epoch= strtoull(status, (char**) 0, 10);
|
||||
}
|
||||
else
|
||||
die("line %u: result does not contain '%s' in '%s'",
|
||||
start_lineno, latest_epoch_str, query);
|
||||
/* latest_trans_epoch */
|
||||
while (*status && strncmp(status, latest_trans_epoch_str,
|
||||
sizeof(latest_trans_epoch_str)-1))
|
||||
status++;
|
||||
if (*status)
|
||||
{
|
||||
status+= sizeof(latest_trans_epoch_str)-1;
|
||||
latest_trans_epoch= strtoull(status, (char**) 0, 10);
|
||||
}
|
||||
else
|
||||
die("line %u: result does not contain '%s' in '%s'",
|
||||
start_lineno, latest_trans_epoch_str, query);
|
||||
/* latest_received_binlog_epoch */
|
||||
while (*status &&
|
||||
strncmp(status, latest_received_binlog_epoch_str,
|
||||
sizeof(latest_received_binlog_epoch_str)-1))
|
||||
status++;
|
||||
if (*status)
|
||||
{
|
||||
status+= sizeof(latest_received_binlog_epoch_str)-1;
|
||||
latest_received_binlog_epoch= strtoull(status, (char**) 0, 10);
|
||||
}
|
||||
else
|
||||
die("line %u: result does not contain '%s' in '%s'",
|
||||
start_lineno, latest_received_binlog_epoch_str, query);
|
||||
/* latest_handled_binlog */
|
||||
while (*status &&
|
||||
strncmp(status, latest_handled_binlog_epoch_str,
|
||||
sizeof(latest_handled_binlog_epoch_str)-1))
|
||||
status++;
|
||||
if (*status)
|
||||
{
|
||||
status+= sizeof(latest_handled_binlog_epoch_str)-1;
|
||||
latest_handled_binlog_epoch= strtoull(status, (char**) 0, 10);
|
||||
}
|
||||
else
|
||||
die("line %u: result does not contain '%s' in '%s'",
|
||||
start_lineno, latest_handled_binlog_epoch_str, query);
|
||||
/* latest_applied_binlog_epoch */
|
||||
while (*status &&
|
||||
strncmp(status, latest_applied_binlog_epoch_str,
|
||||
sizeof(latest_applied_binlog_epoch_str)-1))
|
||||
status++;
|
||||
if (*status)
|
||||
{
|
||||
status+= sizeof(latest_applied_binlog_epoch_str)-1;
|
||||
latest_applied_binlog_epoch= strtoull(status, (char**) 0, 10);
|
||||
}
|
||||
else
|
||||
die("line %u: result does not contain '%s' in '%s'",
|
||||
start_lineno, latest_applied_binlog_epoch_str, query);
|
||||
if (count == 0)
|
||||
start_epoch= latest_trans_epoch;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!row)
|
||||
die("line %u: result does not contain '%s' in '%s'",
|
||||
start_lineno, binlog, query);
|
||||
if (latest_applied_binlog_epoch > applied_epoch)
|
||||
count= 0;
|
||||
applied_epoch= latest_applied_binlog_epoch;
|
||||
count++;
|
||||
if (latest_handled_binlog_epoch >= start_epoch)
|
||||
do_continue= 0;
|
||||
else if (count > 30)
|
||||
{
|
||||
break;
|
||||
{
|
||||
break;
|
||||
}
|
||||
mysql_free_result(res);
|
||||
}
|
||||
|
@ -3286,6 +3338,8 @@ static struct my_option my_long_options[] =
|
|||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"user", 'u', "User for login.", (gptr*) &user, (gptr*) &user, 0, GET_STR,
|
||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"valgrind", 'N', "Define VALGRIND_TEST to 1.", (gptr*) &opt_valgrind_test,
|
||||
(gptr*) &opt_valgrind_test, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"verbose", 'v', "Write more.", (gptr*) &verbose, (gptr*) &verbose, 0,
|
||||
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"version", 'V', "Output version information and exit.",
|
||||
|
@ -5060,6 +5114,9 @@ static void init_var_hash(MYSQL *mysql)
|
|||
die("Variable hash initialization failed");
|
||||
my_hash_insert(&var_hash, (byte*) var_init(0,"BIG_TEST", 0,
|
||||
(opt_big_test) ? "1" : "0", 0));
|
||||
my_hash_insert(&var_hash, (byte*) var_init(0,"VALGRIND_TEST", 0,
|
||||
(opt_valgrind_test) ? "1" : "0",
|
||||
0));
|
||||
v= var_init(0,"MAX_TABLES", 0, (sizeof(ulong) == 4) ? "31" : "62",0);
|
||||
my_hash_insert(&var_hash, (byte*) v);
|
||||
v= var_init(0,"SERVER_VERSION", 0, mysql_get_server_info(mysql), 0);
|
||||
|
|
50
configure.in
50
configure.in
|
@ -2140,65 +2140,15 @@ MYSQL_CHECK_SSL
|
|||
# Has to be done late, as the plugin may need to check for existence of
|
||||
# functions tested above
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
MYSQL_STORAGE_ENGINE(blackhole,,[Blackhole Storage Engine],
|
||||
[Basic Write-only Read-never tables], [max,max-no-ndb])
|
||||
MYSQL_PLUGIN_DIRECTORY(blackhole, [storage/blackhole])
|
||||
MYSQL_PLUGIN_STATIC(blackhole, [libblackhole.a])
|
||||
MYSQL_PLUGIN_DYNAMIC(blackhole, [ha_blackhole.la])
|
||||
|
||||
MYSQL_STORAGE_ENGINE(csv,, [CSV Storage Engine],
|
||||
[Stores tables in text CSV format])
|
||||
MYSQL_PLUGIN_DIRECTORY(csv, [storage/csv])
|
||||
MYSQL_PLUGIN_STATIC(csv, [libcsv.a])
|
||||
MYSQL_PLUGIN_MANDATORY(csv) dnl Used for logging
|
||||
|
||||
MYSQL_STORAGE_ENGINE(federated,,[Federated Storage Engine],
|
||||
[Connects to tables on remote MySQL servers], [max,max-no-ndb])
|
||||
|
||||
MYSQL_PLUGIN(ftexample, [Simple Parser],
|
||||
[Simple full-text parser plugin])
|
||||
MYSQL_PLUGIN_DIRECTORY(ftexample, [plugin/fulltext])
|
||||
MYSQL_PLUGIN_DYNAMIC(ftexample, [mypluglib.la])
|
||||
|
||||
MYSQL_STORAGE_ENGINE(heap,no, [Memory Storage Engine],
|
||||
[Volatile memory based tables])
|
||||
MYSQL_PLUGIN_DIRECTORY(heap, [storage/heap])
|
||||
MYSQL_PLUGIN_STATIC(heap, [libheap.a])
|
||||
MYSQL_PLUGIN_MANDATORY(heap) dnl Memory tables
|
||||
|
||||
MYSQL_STORAGE_ENGINE(innobase, innodb, [InnoDB Storage Engine],
|
||||
[Transactional Tables using InnoDB], [max,max-no-ndb])
|
||||
MYSQL_PLUGIN_DIRECTORY(innobase, [storage/innobase])
|
||||
MYSQL_PLUGIN_STATIC(innobase, [libinnobase.a])
|
||||
MYSQL_PLUGIN_ACTIONS(innobase, [
|
||||
AC_CHECK_LIB(rt, aio_read, [innodb_system_libs="-lrt"])
|
||||
AC_SUBST(innodb_system_libs)
|
||||
])
|
||||
|
||||
MYSQL_STORAGE_ENGINE(myisam,no, [MyISAM Storage Engine],
|
||||
[Traditional non-transactional MySQL tables])
|
||||
MYSQL_PLUGIN_DIRECTORY(myisam, [storage/myisam])
|
||||
MYSQL_PLUGIN_STATIC(myisam, [libmyisam.a])
|
||||
MYSQL_PLUGIN_MANDATORY(myisam) dnl Default
|
||||
|
||||
MYSQL_STORAGE_ENGINE(myisammrg,no,[MyISAM MERGE Engine],
|
||||
[Merge multiple MySQL tables into one])
|
||||
MYSQL_PLUGIN_DIRECTORY(myisammrg,[storage/myisammrg])
|
||||
MYSQL_PLUGIN_STATIC(myisammrg, [libmyisammrg.a])
|
||||
MYSQL_PLUGIN_MANDATORY(myisammrg)
|
||||
|
||||
MYSQL_STORAGE_ENGINE(ndbcluster, ndbcluster, [Cluster Storage Engine],
|
||||
[High Availability Clustered tables], [max])
|
||||
MYSQL_PLUGIN_DIRECTORY(ndbcluster,[storage/ndb])
|
||||
MYSQL_PLUGIN_STATIC(ndbcluster, [[\$(ndbcluster_libs) \$(ndbcluster_system_libs) \$(NDB_SCI_LIBS)]])
|
||||
MYSQL_PLUGIN_ACTIONS(ndbcluster,[MYSQL_SETUP_NDBCLUSTER])
|
||||
|
||||
MYSQL_STORAGE_ENGINE(partition, partition, [Partition Support],
|
||||
[MySQL Partitioning Support], [max,max-no-ndb])
|
||||
|
||||
dnl -- ndbcluster requires partition to be enabled
|
||||
MYSQL_PLUGIN_DEPENDS(ndbcluster, [partition])
|
||||
|
||||
MYSQL_CONFIGURE_PLUGINS([none])
|
||||
|
||||
|
|
|
@ -22,7 +22,8 @@ noinst_HEADERS = dbug_long.h
|
|||
libdbug_a_SOURCES = dbug.c sanity.c
|
||||
EXTRA_DIST = CMakeLists.txt example1.c example2.c example3.c \
|
||||
user.r monty.doc dbug_add_tags.pl \
|
||||
my_main.c main.c factorial.c dbug_analyze.c
|
||||
my_main.c main.c factorial.c dbug_analyze.c \
|
||||
CMakeLists.txt
|
||||
NROFF_INC = example1.r example2.r example3.r main.r \
|
||||
factorial.r output1.r output2.r output3.r \
|
||||
output4.r output5.r
|
||||
|
|
14
dbug/dbug.c
14
dbug/dbug.c
|
@ -71,19 +71,18 @@
|
|||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <my_global.h>
|
||||
|
||||
/* This file won't compile unless DBUG_OFF is undefined locally */
|
||||
#ifdef DBUG_OFF
|
||||
#undef DBUG_OFF
|
||||
#endif
|
||||
|
||||
#include <m_string.h>
|
||||
#include <errno.h>
|
||||
#if defined(MSDOS) || defined(__WIN__)
|
||||
#include <process.h>
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef DBUG_OFF
|
||||
|
||||
|
||||
/*
|
||||
* Manifest constants which may be "tuned" if desired.
|
||||
*/
|
||||
|
@ -316,6 +315,7 @@ static unsigned long Clock(void);
|
|||
#define ChangeOwner(cs,name)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
** Macros to allow dbugging with threads
|
||||
*/
|
||||
|
@ -2354,3 +2354,5 @@ va_list ap;
|
|||
}
|
||||
|
||||
#endif /* NO_VARARGS */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -30,7 +30,7 @@ sub generate_prefix($$)
|
|||
next;
|
||||
}
|
||||
|
||||
if ( /^\s*[a-zA-Z0-9*_ ]+\s+([_a-zA-Z0-9]+)\s*\(/ )
|
||||
if ( /^\s*[a-zA-Z0-9*_ ]+\s+\*?([_a-zA-Z0-9]+)\s*\(/ )
|
||||
{
|
||||
print OUT "#define $1 ya$1\n";
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#define Copyright yaCopyright
|
||||
#define yaSSL_CleanUp yayaSSL_CleanUp
|
||||
#define BN_bin2bn yaBN_bin2bn
|
||||
#define DH_new yaDH_new
|
||||
#define DH_free yaDH_free
|
||||
#define RSA_free yaRSA_free
|
||||
|
@ -92,6 +93,12 @@
|
|||
#define SSL_want_read yaSSL_want_read
|
||||
#define SSL_want_write yaSSL_want_write
|
||||
#define SSL_pending yaSSL_pending
|
||||
#define SSLv3_method yaSSLv3_method
|
||||
#define SSLv3_server_method yaSSLv3_server_method
|
||||
#define SSLv3_client_method yaSSLv3_client_method
|
||||
#define TLSv1_server_method yaTLSv1_server_method
|
||||
#define TLSv1_client_method yaTLSv1_client_method
|
||||
#define SSLv23_server_method yaSSLv23_server_method
|
||||
#define SSL_CTX_use_certificate_file yaSSL_CTX_use_certificate_file
|
||||
#define SSL_CTX_use_PrivateKey_file yaSSL_CTX_use_PrivateKey_file
|
||||
#define SSL_CTX_set_cipher_list yaSSL_CTX_set_cipher_list
|
||||
|
@ -115,11 +122,13 @@
|
|||
#define RAND_write_file yaRAND_write_file
|
||||
#define RAND_load_file yaRAND_load_file
|
||||
#define RAND_status yaRAND_status
|
||||
#define RAND_bytes yaRAND_bytes
|
||||
#define DES_set_key yaDES_set_key
|
||||
#define DES_set_odd_parity yaDES_set_odd_parity
|
||||
#define DES_ecb_encrypt yaDES_ecb_encrypt
|
||||
#define SSL_CTX_set_default_passwd_cb_userdata yaSSL_CTX_set_default_passwd_cb_userdata
|
||||
#define SSL_SESSION_free yaSSL_SESSION_free
|
||||
#define SSL_peek yaSSL_peek
|
||||
#define SSL_get_certificate yaSSL_get_certificate
|
||||
#define SSL_get_privatekey yaSSL_get_privatekey
|
||||
#define X509_get_pubkey yaX509_get_pubkey
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include "runtime.hpp"
|
||||
#include "misc.hpp"
|
||||
|
||||
|
||||
#if !defined(YASSL_MYSQL_COMPATIBLE)
|
||||
extern "C" {
|
||||
|
||||
// for libcurl configure test, these are the signatures they use
|
||||
|
@ -37,6 +37,7 @@ extern "C" {
|
|||
char CRYPTO_lock() { return 0;}
|
||||
char CRYPTO_add_lock() { return 0;}
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#ifdef YASSL_PURE_C
|
||||
|
||||
|
|
8
heap/CMakeLists.txt
Executable file
8
heap/CMakeLists.txt
Executable file
|
@ -0,0 +1,8 @@
|
|||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
|
||||
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
|
||||
|
||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
|
||||
ADD_LIBRARY(heap _check.c _rectest.c hp_block.c hp_clear.c hp_close.c hp_create.c
|
||||
hp_delete.c hp_extra.c hp_hash.c hp_info.c hp_open.c hp_panic.c
|
||||
hp_rename.c hp_rfirst.c hp_rkey.c hp_rlast.c hp_rnext.c hp_rprev.c
|
||||
hp_rrnd.c hp_rsame.c hp_scan.c hp_static.c hp_update.c hp_write.c)
|
|
@ -15,7 +15,7 @@
|
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/* Error messages for MySQL clients */
|
||||
/* (Error messages for the daemon are in share/language/errmsg.sys) */
|
||||
/* (Error messages for the daemon are in sql/share/errmsg.txt) */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -165,7 +165,6 @@ struct st_mysql_options {
|
|||
char *ssl_ca; /* PEM CA file */
|
||||
char *ssl_capath; /* PEM directory of CA-s? */
|
||||
char *ssl_cipher; /* cipher to use */
|
||||
my_bool ssl_verify_server_cert; /* if to verify server cert */
|
||||
char *shared_memory_base_name;
|
||||
unsigned long max_allowed_packet;
|
||||
my_bool use_ssl; /* if to use SSL or not */
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
Plugin API. Common for all plugin types.
|
||||
*/
|
||||
|
||||
#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0001
|
||||
#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0002
|
||||
|
||||
/*
|
||||
The allowable types of plugins
|
||||
|
@ -31,10 +31,6 @@
|
|||
#define MYSQL_FTPARSER_PLUGIN 2 /* Full-text parser plugin */
|
||||
#define MYSQL_MAX_PLUGIN_TYPE_NUM 3 /* The number of plugin types */
|
||||
|
||||
#if !defined(__attribute__) && (defined(__cplusplus) || !defined(__GNUC__) || __GNUC__ == 2 && __GNUC_MINOR__ < 8)
|
||||
#define __attribute__(A)
|
||||
#endif
|
||||
|
||||
/*
|
||||
Macros for beginning and ending plugin declarations. Between
|
||||
mysql_declare_plugin and mysql_declare_plugin_end there should
|
||||
|
@ -60,7 +56,7 @@ __MYSQL_DECLARE_PLUGIN(NAME, \
|
|||
builtin_ ## NAME ## _sizeof_struct_st_plugin, \
|
||||
builtin_ ## NAME ## _plugin)
|
||||
|
||||
#define mysql_declare_plugin_end ,{0,0,0,0,0,0,0,0,0}}
|
||||
#define mysql_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0,0}}
|
||||
|
||||
/*
|
||||
declarations for SHOW STATUS support in plugins
|
||||
|
@ -96,6 +92,8 @@ struct st_mysql_plugin
|
|||
int (*deinit)(void); /* the function to invoke when plugin is unloaded */
|
||||
unsigned int version; /* plugin version (for SHOW PLUGINS) */
|
||||
struct st_mysql_show_var *status_vars;
|
||||
void * __reserved1; /* placeholder for system variables */
|
||||
void * __reserved2; /* placeholder for config options */
|
||||
};
|
||||
|
||||
/*************************************************************************
|
||||
|
|
|
@ -26,6 +26,9 @@
|
|||
#define USERNAME_LENGTH 16
|
||||
#define SERVER_VERSION_LENGTH 60
|
||||
#define SQLSTATE_LENGTH 5
|
||||
#define SYSTEM_CHARSET_MBMAXLEN 3
|
||||
#define NAME_BYTE_LEN NAME_LEN*SYSTEM_CHARSET_MBMAXLEN
|
||||
#define USERNAME_BYTE_LENGTH USERNAME_LENGTH*SYSTEM_CHARSET_MBMAXLEN
|
||||
|
||||
/*
|
||||
USER_HOST_BUFF_SIZE -- length of string buffer, that is enough to contain
|
||||
|
@ -33,7 +36,7 @@
|
|||
MySQL standard format:
|
||||
user_name_part@host_name_part\0
|
||||
*/
|
||||
#define USER_HOST_BUFF_SIZE HOSTNAME_LENGTH + USERNAME_LENGTH + 2
|
||||
#define USER_HOST_BUFF_SIZE HOSTNAME_LENGTH + USERNAME_BYTE_LENGTH + 2
|
||||
|
||||
#define LOCAL_HOST "localhost"
|
||||
#define LOCAL_HOST_NAMEDPIPE "."
|
||||
|
@ -138,8 +141,10 @@ enum enum_server_command
|
|||
#define CLIENT_TRANSACTIONS 8192 /* Client knows about transactions */
|
||||
#define CLIENT_RESERVED 16384 /* Old flag for 4.1 protocol */
|
||||
#define CLIENT_SECURE_CONNECTION 32768 /* New 4.1 authentication */
|
||||
#define CLIENT_MULTI_STATEMENTS 65536 /* Enable/disable multi-stmt support */
|
||||
#define CLIENT_MULTI_RESULTS 131072 /* Enable/disable multi-results */
|
||||
#define CLIENT_MULTI_STATEMENTS (((ulong) 1) << 16) /* Enable/disable multi-stmt support */
|
||||
#define CLIENT_MULTI_RESULTS (((ulong) 1) << 17) /* Enable/disable multi-results */
|
||||
|
||||
#define CLIENT_SSL_VERIFY_SERVER_CERT (((ulong) 1) << 30)
|
||||
#define CLIENT_REMEMBER_OPTIONS (((ulong) 1) << 31)
|
||||
|
||||
#define SERVER_STATUS_IN_TRANS 1 /* Transaction has started */
|
||||
|
@ -213,7 +218,13 @@ typedef struct st_net {
|
|||
char last_error[MYSQL_ERRMSG_SIZE], sqlstate[SQLSTATE_LENGTH+1];
|
||||
unsigned int last_errno;
|
||||
unsigned char error;
|
||||
|
||||
/*
|
||||
'query_cache_query' should be accessed only via query cache
|
||||
functions and methods to maintain proper locking.
|
||||
*/
|
||||
gptr query_cache_query;
|
||||
|
||||
my_bool report_error; /* We should report error (we have unreported error) */
|
||||
my_bool return_errno;
|
||||
} NET;
|
||||
|
|
35
innobase/CMakeLists.txt
Executable file
35
innobase/CMakeLists.txt
Executable file
|
@ -0,0 +1,35 @@
|
|||
#SET(CMAKE_CXX_FLAGS_DEBUG "-DSAFEMALLOC -DSAFE_MUTEX")
|
||||
#SET(CMAKE_C_FLAGS_DEBUG "-DSAFEMALLOC -DSAFE_MUTEX")
|
||||
ADD_DEFINITIONS(-DMYSQL_SERVER -D_WIN32 -DWIN32 -D_LIB)
|
||||
|
||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include include)
|
||||
ADD_LIBRARY(innobase btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c
|
||||
buf/buf0buf.c buf/buf0flu.c buf/buf0lru.c buf/buf0rea.c
|
||||
data/data0data.c data/data0type.c
|
||||
dict/dict0boot.c dict/dict0crea.c dict/dict0dict.c dict/dict0load.c dict/dict0mem.c
|
||||
dyn/dyn0dyn.c
|
||||
eval/eval0eval.c eval/eval0proc.c
|
||||
fil/fil0fil.c
|
||||
fsp/fsp0fsp.c
|
||||
fut/fut0fut.c fut/fut0lst.c
|
||||
ha/ha0ha.c ha/hash0hash.c
|
||||
ibuf/ibuf0ibuf.c
|
||||
pars/lexyy.c pars/pars0grm.c pars/pars0opt.c pars/pars0pars.c pars/pars0sym.c
|
||||
lock/lock0lock.c
|
||||
log/log0log.c log/log0recv.c
|
||||
mach/mach0data.c
|
||||
mem/mem0mem.c mem/mem0pool.c
|
||||
mtr/mtr0log.c mtr/mtr0mtr.c
|
||||
os/os0file.c os/os0proc.c os/os0sync.c os/os0thread.c
|
||||
page/page0cur.c page/page0page.c
|
||||
que/que0que.c
|
||||
read/read0read.c
|
||||
rem/rem0cmp.c rem/rem0rec.c
|
||||
row/row0ins.c row/row0mysql.c row/row0purge.c row/row0row.c row/row0sel.c row/row0uins.c
|
||||
row/row0umod.c row/row0undo.c row/row0upd.c row/row0vers.c
|
||||
srv/srv0que.c srv/srv0srv.c srv/srv0start.c
|
||||
sync/sync0arr.c sync/sync0rw.c sync/sync0sync.c
|
||||
thr/thr0loc.c
|
||||
trx/trx0purge.c trx/trx0rec.c trx/trx0roll.c trx/trx0rseg.c trx/trx0sys.c trx/trx0trx.c trx/trx0undo.c
|
||||
usr/usr0sess.c
|
||||
ut/ut0byte.c ut/ut0dbg.c ut/ut0mem.c ut/ut0rnd.c ut/ut0ut.c )
|
|
@ -11,7 +11,7 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
|
|||
${CMAKE_SOURCE_DIR}/sql
|
||||
${CMAKE_SOURCE_DIR}/strings)
|
||||
|
||||
ADD_LIBRARY(libmysql MODULE dll.c libmysql.def
|
||||
ADD_LIBRARY(libmysql SHARED dll.c libmysql.def
|
||||
../mysys/array.c ../strings/bchange.c ../strings/bmove.c
|
||||
../strings/bmove_upp.c ../mysys/charset-def.c ../mysys/charset.c
|
||||
../sql-common/client.c ../strings/ctype-big5.c ../strings/ctype-bin.c
|
||||
|
|
|
@ -1,103 +1,54 @@
|
|||
/*C4*/
|
||||
|
||||
/****************************************************************/
|
||||
|
||||
/* Author: Jethro Wright, III TS : 3/ 4/1998 9:15 */
|
||||
|
||||
/* Date: 02/18/1998 */
|
||||
|
||||
/* mytest.c : do some testing of the libmySQL.DLL.... */
|
||||
|
||||
/* */
|
||||
|
||||
/* History: */
|
||||
|
||||
/* 02/18/1998 jw3 also sprach zarathustra.... */
|
||||
|
||||
/****************************************************************/
|
||||
|
||||
|
||||
/*C4*/
|
||||
/****************************************************************/
|
||||
/* Author: Jethro Wright, III TS : 3/ 4/1998 9:15 */
|
||||
/* Date: 02/18/1998 */
|
||||
/* mytest.c : do some testing of the libmySQL.DLL.... */
|
||||
/* */
|
||||
/* History: */
|
||||
/* 02/18/1998 jw3 also sprach zarathustra.... */
|
||||
/****************************************************************/
|
||||
|
||||
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <windows.h>
|
||||
#include <mysql.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#define DEFALT_SQL_STMT "SELECT * FROM db"
|
||||
#ifndef offsetof
|
||||
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
|
||||
#endif
|
||||
|
||||
|
||||
#include <mysql.h>
|
||||
|
||||
/********************************************************
|
||||
**
|
||||
** main :-
|
||||
**
|
||||
********************************************************/
|
||||
|
||||
int
|
||||
main( int argc, char * argv[] )
|
||||
{
|
||||
|
||||
#define DEFALT_SQL_STMT "SELECT * FROM db"
|
||||
|
||||
#ifndef offsetof
|
||||
|
||||
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/********************************************************
|
||||
|
||||
**
|
||||
|
||||
** main :-
|
||||
|
||||
**
|
||||
|
||||
********************************************************/
|
||||
|
||||
|
||||
|
||||
int
|
||||
|
||||
main( int argc, char * argv[] )
|
||||
|
||||
{
|
||||
|
||||
|
||||
|
||||
char szSQL[ 200 ], aszFlds[ 25 ][ 25 ], szDB[ 50 ] ;
|
||||
|
||||
char szSQL[ 200 ], aszFlds[ 25 ][ 25 ], szDB[ 50 ] ;
|
||||
const char *pszT;
|
||||
int i, j, k, l, x ;
|
||||
|
||||
MYSQL * myData ;
|
||||
|
||||
MYSQL_RES * res ;
|
||||
|
||||
MYSQL_FIELD * fd ;
|
||||
|
||||
MYSQL_ROW row ;
|
||||
|
||||
|
||||
|
||||
//....just curious....
|
||||
int i, j, k, l, x ;
|
||||
MYSQL * myData ;
|
||||
MYSQL_RES * res ;
|
||||
MYSQL_FIELD * fd ;
|
||||
MYSQL_ROW row ;
|
||||
|
||||
//....just curious....
|
||||
printf( "sizeof( MYSQL ) == %d\n", (int) sizeof( MYSQL ) ) ;
|
||||
if ( argc == 2 )
|
||||
|
||||
{
|
||||
|
||||
strcpy( szDB, argv[ 1 ] ) ;
|
||||
|
||||
strcpy( szSQL, DEFALT_SQL_STMT ) ;
|
||||
|
||||
if (!strcmp(szDB,"--debug"))
|
||||
|
||||
{
|
||||
|
||||
strcpy( szDB, "mysql" ) ;
|
||||
|
||||
printf("Some mysql struct information (size and offset):\n");
|
||||
|
||||
if ( argc == 2 )
|
||||
{
|
||||
strcpy( szDB, argv[ 1 ] ) ;
|
||||
strcpy( szSQL, DEFALT_SQL_STMT ) ;
|
||||
if (!strcmp(szDB,"--debug"))
|
||||
{
|
||||
strcpy( szDB, "mysql" ) ;
|
||||
printf("Some mysql struct information (size and offset):\n");
|
||||
printf("net:\t%3d %3d\n",(int) sizeof(myData->net),
|
||||
(int) offsetof(MYSQL,net));
|
||||
printf("host:\t%3d %3d\n",(int) sizeof(myData->host),
|
||||
|
@ -123,200 +74,102 @@ main( int argc, char * argv[] )
|
|||
(int) offsetof(MYSQL,free_me));
|
||||
printf("options:\t%3d %3d\n",(int) sizeof(myData->options),
|
||||
(int) offsetof(MYSQL,options));
|
||||
puts("");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else if ( argc > 2 ) {
|
||||
|
||||
strcpy( szDB, argv[ 1 ] ) ;
|
||||
|
||||
strcpy( szSQL, argv[ 2 ] ) ;
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
strcpy( szDB, "mysql" ) ;
|
||||
|
||||
strcpy( szSQL, DEFALT_SQL_STMT ) ;
|
||||
|
||||
}
|
||||
|
||||
//....
|
||||
|
||||
|
||||
|
||||
if ( (myData = mysql_init((MYSQL*) 0)) &&
|
||||
|
||||
mysql_real_connect( myData, NULL, NULL, NULL, NULL, MYSQL_PORT,
|
||||
|
||||
NULL, 0 ) )
|
||||
|
||||
{
|
||||
|
||||
puts("");
|
||||
}
|
||||
}
|
||||
else if ( argc > 2 ) {
|
||||
strcpy( szDB, argv[ 1 ] ) ;
|
||||
strcpy( szSQL, argv[ 2 ] ) ;
|
||||
}
|
||||
else {
|
||||
strcpy( szDB, "mysql" ) ;
|
||||
strcpy( szSQL, DEFALT_SQL_STMT ) ;
|
||||
}
|
||||
//....
|
||||
|
||||
if ( (myData = mysql_init((MYSQL*) 0)) &&
|
||||
mysql_real_connect( myData, NULL, NULL, NULL, NULL, MYSQL_PORT,
|
||||
NULL, 0 ) )
|
||||
{
|
||||
myData->reconnect= 1;
|
||||
if ( mysql_select_db( myData, szDB ) < 0 ) {
|
||||
|
||||
printf( "Can't select the %s database !\n", szDB ) ;
|
||||
|
||||
mysql_close( myData ) ;
|
||||
|
||||
return 2 ;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
printf( "Can't connect to the mysql server on port %d !\n",
|
||||
|
||||
MYSQL_PORT ) ;
|
||||
|
||||
mysql_close( myData ) ;
|
||||
|
||||
return 1 ;
|
||||
|
||||
}
|
||||
|
||||
//....
|
||||
|
||||
if ( ! mysql_query( myData, szSQL ) ) {
|
||||
|
||||
res = mysql_store_result( myData ) ;
|
||||
|
||||
i = (int) mysql_num_rows( res ) ; l = 1 ;
|
||||
|
||||
printf( "Query: %s\nNumber of records found: %ld\n", szSQL, i ) ;
|
||||
|
||||
//....we can get the field-specific characteristics here....
|
||||
|
||||
for ( x = 0 ; fd = mysql_fetch_field( res ) ; x++ )
|
||||
|
||||
strcpy( aszFlds[ x ], fd->name ) ;
|
||||
|
||||
//....
|
||||
|
||||
while ( row = mysql_fetch_row( res ) ) {
|
||||
|
||||
j = mysql_num_fields( res ) ;
|
||||
|
||||
printf( "Record #%ld:-\n", l++ ) ;
|
||||
|
||||
for ( k = 0 ; k < j ; k++ )
|
||||
|
||||
printf( " Fld #%d (%s): %s\n", k + 1, aszFlds[ k ],
|
||||
|
||||
(((row[k]==NULL)||(!strlen(row[k])))?"NULL":row[k])) ;
|
||||
|
||||
puts( "==============================\n" ) ;
|
||||
|
||||
}
|
||||
|
||||
mysql_free_result( res ) ;
|
||||
|
||||
}
|
||||
|
||||
else printf( "Couldn't execute %s on the server !\n", szSQL ) ;
|
||||
|
||||
//....
|
||||
|
||||
puts( "==== Diagnostic info ====" ) ;
|
||||
|
||||
pszT = mysql_get_client_info() ;
|
||||
|
||||
printf( "Client info: %s\n", pszT ) ;
|
||||
|
||||
//....
|
||||
|
||||
pszT = mysql_get_host_info( myData ) ;
|
||||
|
||||
printf( "Host info: %s\n", pszT ) ;
|
||||
|
||||
//....
|
||||
|
||||
pszT = mysql_get_server_info( myData ) ;
|
||||
|
||||
printf( "Server info: %s\n", pszT ) ;
|
||||
|
||||
//....
|
||||
|
||||
res = mysql_list_processes( myData ) ; l = 1 ;
|
||||
|
||||
if (res)
|
||||
|
||||
{
|
||||
|
||||
for ( x = 0 ; fd = mysql_fetch_field( res ) ; x++ )
|
||||
|
||||
strcpy( aszFlds[ x ], fd->name ) ;
|
||||
|
||||
while ( row = mysql_fetch_row( res ) ) {
|
||||
|
||||
j = mysql_num_fields( res ) ;
|
||||
|
||||
printf( "Process #%ld:-\n", l++ ) ;
|
||||
|
||||
for ( k = 0 ; k < j ; k++ )
|
||||
|
||||
printf( " Fld #%d (%s): %s\n", k + 1, aszFlds[ k ],
|
||||
|
||||
(((row[k]==NULL)||(!strlen(row[k])))?"NULL":row[k])) ;
|
||||
|
||||
puts( "==============================\n" ) ;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
{
|
||||
|
||||
printf("Got error %s when retreiving processlist\n",mysql_error(myData));
|
||||
|
||||
}
|
||||
|
||||
//....
|
||||
|
||||
res = mysql_list_tables( myData, "%" ) ; l = 1 ;
|
||||
|
||||
for ( x = 0 ; fd = mysql_fetch_field( res ) ; x++ )
|
||||
|
||||
strcpy( aszFlds[ x ], fd->name ) ;
|
||||
|
||||
while ( row = mysql_fetch_row( res ) ) {
|
||||
|
||||
j = mysql_num_fields( res ) ;
|
||||
|
||||
printf( "Table #%ld:-\n", l++ ) ;
|
||||
|
||||
for ( k = 0 ; k < j ; k++ )
|
||||
|
||||
printf( " Fld #%d (%s): %s\n", k + 1, aszFlds[ k ],
|
||||
|
||||
(((row[k]==NULL)||(!strlen(row[k])))?"NULL":row[k])) ;
|
||||
|
||||
puts( "==============================\n" ) ;
|
||||
|
||||
}
|
||||
|
||||
//....
|
||||
|
||||
pszT = mysql_stat( myData ) ;
|
||||
|
||||
puts( pszT ) ;
|
||||
|
||||
//....
|
||||
|
||||
mysql_close( myData ) ;
|
||||
|
||||
return 0 ;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
if ( mysql_select_db( myData, szDB ) < 0 ) {
|
||||
printf( "Can't select the %s database !\n", szDB ) ;
|
||||
mysql_close( myData ) ;
|
||||
return 2 ;
|
||||
}
|
||||
}
|
||||
else {
|
||||
printf( "Can't connect to the mysql server on port %d !\n",
|
||||
MYSQL_PORT ) ;
|
||||
mysql_close( myData ) ;
|
||||
return 1 ;
|
||||
}
|
||||
//....
|
||||
if ( ! mysql_query( myData, szSQL ) ) {
|
||||
res = mysql_store_result( myData ) ;
|
||||
i = (int) mysql_num_rows( res ) ; l = 1 ;
|
||||
printf( "Query: %s\nNumber of records found: %ld\n", szSQL, i ) ;
|
||||
//....we can get the field-specific characteristics here....
|
||||
for ( x = 0 ; fd = mysql_fetch_field( res ) ; x++ )
|
||||
strcpy( aszFlds[ x ], fd->name ) ;
|
||||
//....
|
||||
while ( row = mysql_fetch_row( res ) ) {
|
||||
j = mysql_num_fields( res ) ;
|
||||
printf( "Record #%ld:-\n", l++ ) ;
|
||||
for ( k = 0 ; k < j ; k++ )
|
||||
printf( " Fld #%d (%s): %s\n", k + 1, aszFlds[ k ],
|
||||
(((row[k]==NULL)||(!strlen(row[k])))?"NULL":row[k])) ;
|
||||
puts( "==============================\n" ) ;
|
||||
}
|
||||
mysql_free_result( res ) ;
|
||||
}
|
||||
else printf( "Couldn't execute %s on the server !\n", szSQL ) ;
|
||||
//....
|
||||
puts( "==== Diagnostic info ====" ) ;
|
||||
pszT = mysql_get_client_info() ;
|
||||
printf( "Client info: %s\n", pszT ) ;
|
||||
//....
|
||||
pszT = mysql_get_host_info( myData ) ;
|
||||
printf( "Host info: %s\n", pszT ) ;
|
||||
//....
|
||||
pszT = mysql_get_server_info( myData ) ;
|
||||
printf( "Server info: %s\n", pszT ) ;
|
||||
//....
|
||||
res = mysql_list_processes( myData ) ; l = 1 ;
|
||||
if (res)
|
||||
{
|
||||
for ( x = 0 ; fd = mysql_fetch_field( res ) ; x++ )
|
||||
strcpy( aszFlds[ x ], fd->name ) ;
|
||||
while ( row = mysql_fetch_row( res ) ) {
|
||||
j = mysql_num_fields( res ) ;
|
||||
printf( "Process #%ld:-\n", l++ ) ;
|
||||
for ( k = 0 ; k < j ; k++ )
|
||||
printf( " Fld #%d (%s): %s\n", k + 1, aszFlds[ k ],
|
||||
(((row[k]==NULL)||(!strlen(row[k])))?"NULL":row[k])) ;
|
||||
puts( "==============================\n" ) ;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Got error %s when retreiving processlist\n",mysql_error(myData));
|
||||
}
|
||||
//....
|
||||
res = mysql_list_tables( myData, "%" ) ; l = 1 ;
|
||||
for ( x = 0 ; fd = mysql_fetch_field( res ) ; x++ )
|
||||
strcpy( aszFlds[ x ], fd->name ) ;
|
||||
while ( row = mysql_fetch_row( res ) ) {
|
||||
j = mysql_num_fields( res ) ;
|
||||
printf( "Table #%ld:-\n", l++ ) ;
|
||||
for ( k = 0 ; k < j ; k++ )
|
||||
printf( " Fld #%d (%s): %s\n", k + 1, aszFlds[ k ],
|
||||
(((row[k]==NULL)||(!strlen(row[k])))?"NULL":row[k])) ;
|
||||
puts( "==============================\n" ) ;
|
||||
}
|
||||
//....
|
||||
pszT = mysql_stat( myData ) ;
|
||||
puts( pszT ) ;
|
||||
//....
|
||||
mysql_close( myData ) ;
|
||||
return 0 ;
|
||||
|
||||
}
|
||||
|
|
|
@ -30,8 +30,7 @@ ADD_LIBRARY(mysqldemb emb_qcache.cc libmysqld.c lib_sql.cc
|
|||
../sql-common/pack.c ../sql/derror.cc ../sql/event_scheduler.cc
|
||||
../sql/event_timed.cc ../sql/events.cc ../sql/discover.cc
|
||||
../sql/field_conv.cc ../sql/field.cc ../sql/filesort.cc
|
||||
../sql/gstream.cc ../sql/ha_heap.cc ../sql/ha_myisam.cc
|
||||
../sql/ha_myisammrg.cc ${mysql_se_ha_src}
|
||||
../sql/gstream.cc ${mysql_se_ha_src}
|
||||
../sql/handler.cc ../sql/hash_filo.cc
|
||||
../sql/hostname.cc ../sql/init.cc ../sql/item_buff.cc
|
||||
../sql/item_cmpfunc.cc ../sql/item.cc ../sql/item_create.cc
|
||||
|
@ -80,6 +79,9 @@ ENDIF(WITH_ARCHIVE_STORAGE_ENGINE)
|
|||
IF(WITH_EXAMPLE_STORAGE_ENGINE)
|
||||
ADD_DEPENDENCIES(mysqlserver example)
|
||||
ENDIF(WITH_EXAMPLE_STORAGE_ENGINE)
|
||||
IF(WITH_FEDERATED_STORAGE_ENGINE)
|
||||
ADD_DEPENDENCIES(mysqlserver federated)
|
||||
ENDIF(WITH_FEDERATED_STORAGE_ENGINE)
|
||||
IF(WITH_INNOBASE_STORAGE_ENGINE)
|
||||
ADD_DEPENDENCIES(mysqlserver innobase)
|
||||
ENDIF(WITH_INNOBASE_STORAGE_ENGINE)
|
||||
|
|
|
@ -44,8 +44,7 @@ libmysqlsources = errmsg.c get_password.c libmysql.c client.c pack.c \
|
|||
noinst_HEADERS = embedded_priv.h emb_qcache.h
|
||||
|
||||
sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
|
||||
ha_heap.cc ha_myisam.cc ha_myisammrg.cc \
|
||||
ha_innodb.cc ha_federated.cc ha_ndbcluster.cc \
|
||||
ha_ndbcluster.cc \
|
||||
ha_ndbcluster_binlog.cc ha_partition.cc \
|
||||
handler.cc sql_handler.cc \
|
||||
hostname.cc init.cc password.c \
|
||||
|
@ -68,7 +67,8 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
|
|||
spatial.cc gstream.cc sql_help.cc tztime.cc sql_cursor.cc \
|
||||
sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc sp_rcontext.cc \
|
||||
parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \
|
||||
event_scheduler.cc events.cc event_timed.cc \
|
||||
event_scheduler.cc events.cc event_data_objects.cc \
|
||||
event_queue.cc event_db_repository.cc \
|
||||
rpl_filter.cc sql_partition.cc sql_builtin.cc sql_plugin.cc \
|
||||
sql_tablespace.cc \
|
||||
rpl_injector.cc my_user.c partition_info.cc
|
||||
|
|
|
@ -164,3 +164,4 @@ EXPORTS
|
|||
my_charset_bin
|
||||
my_charset_same
|
||||
modify_defaults_file
|
||||
mysql_set_server_option
|
||||
|
|
26
myisam/CMakeLists.txt
Executable file
26
myisam/CMakeLists.txt
Executable file
|
@ -0,0 +1,26 @@
|
|||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
|
||||
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
|
||||
|
||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
|
||||
ADD_LIBRARY(myisam ft_boolean_search.c ft_nlq_search.c ft_parser.c ft_static.c ft_stem.c
|
||||
ft_stopwords.c ft_update.c mi_cache.c mi_changed.c mi_check.c
|
||||
mi_checksum.c mi_close.c mi_create.c mi_dbug.c mi_delete.c
|
||||
mi_delete_all.c mi_delete_table.c mi_dynrec.c mi_extra.c mi_info.c
|
||||
mi_key.c mi_keycache.c mi_locking.c mi_log.c mi_open.c
|
||||
mi_packrec.c mi_page.c mi_panic.c mi_preload.c mi_range.c mi_rename.c
|
||||
mi_rfirst.c mi_rlast.c mi_rnext.c mi_rnext_same.c mi_rprev.c mi_rrnd.c
|
||||
mi_rsame.c mi_rsamepos.c mi_scan.c mi_search.c mi_static.c mi_statrec.c
|
||||
mi_unique.c mi_update.c mi_write.c rt_index.c rt_key.c rt_mbr.c
|
||||
rt_split.c sort.c sp_key.c ft_eval.h myisamdef.h rt_index.h mi_rkey.c)
|
||||
|
||||
ADD_EXECUTABLE(myisam_ftdump myisam_ftdump.c)
|
||||
TARGET_LINK_LIBRARIES(myisam_ftdump myisam mysys dbug strings zlib wsock32)
|
||||
|
||||
ADD_EXECUTABLE(myisamchk myisamchk.c)
|
||||
TARGET_LINK_LIBRARIES(myisamchk myisam mysys dbug strings zlib wsock32)
|
||||
|
||||
ADD_EXECUTABLE(myisamlog myisamlog.c)
|
||||
TARGET_LINK_LIBRARIES(myisamlog myisam mysys dbug strings zlib wsock32)
|
||||
|
||||
ADD_EXECUTABLE(myisampack myisampack.c)
|
||||
TARGET_LINK_LIBRARIES(myisampack myisam mysys dbug strings zlib wsock32)
|
9
myisammrg/CMakeLists.txt
Executable file
9
myisammrg/CMakeLists.txt
Executable file
|
@ -0,0 +1,9 @@
|
|||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
|
||||
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
|
||||
|
||||
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
|
||||
ADD_LIBRARY(myisammrg myrg_close.c myrg_create.c myrg_delete.c myrg_extra.c myrg_info.c
|
||||
myrg_locking.c myrg_open.c myrg_panic.c myrg_queue.c myrg_range.c
|
||||
myrg_rfirst.c myrg_rkey.c myrg_rlast.c myrg_rnext.c myrg_rnext_same.c
|
||||
myrg_rprev.c myrg_rrnd.c myrg_rsame.c myrg_static.c myrg_update.c
|
||||
myrg_write.c)
|
|
@ -24,7 +24,7 @@ benchdir_root= $(prefix)
|
|||
testdir = $(benchdir_root)/mysql-test
|
||||
EXTRA_SCRIPTS = mysql-test-run.sh install_test_db.sh valgrind.supp $(PRESCRIPTS)
|
||||
EXTRA_DIST = $(EXTRA_SCRIPTS)
|
||||
GENSCRIPTS = mysql-test-run install_test_db
|
||||
GENSCRIPTS = mysql-test-run install_test_db mtr
|
||||
PRESCRIPTS = mysql-test-run.pl
|
||||
test_SCRIPTS = $(GENSCRIPTS) $(PRESCRIPTS)
|
||||
test_DATA = std_data/client-key.pem std_data/client-cert.pem \
|
||||
|
@ -113,6 +113,10 @@ install-data-local:
|
|||
uninstall-local:
|
||||
@RM@ -f -r $(DESTDIR)$(testdir)
|
||||
|
||||
# mtr - a shortcut for executing mysql-test-run.pl
|
||||
mtr:
|
||||
$(RM) -f mtr
|
||||
$(LN_S) mysql-test-run.pl mtr
|
||||
|
||||
SUFFIXES = .sh
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ INSERT INTO t2 VALUES (NULL, 0), (NULL,1);
|
|||
SELECT * FROM t1 ORDER BY a;
|
||||
SELECT * FROM t2 ORDER BY a;
|
||||
|
||||
UPDATE t2, (SELECT a FROM t1) AS t SET t2.b = t.a+5 ;
|
||||
UPDATE t2, (SELECT a FROM t1 ORDER BY a) AS t SET t2.b = t.a+5 ;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
SELECT * FROM t2 ORDER BY a;
|
||||
|
||||
|
|
4
mysql-test/include/have_ndbapi_examples.inc
Normal file
4
mysql-test/include/have_ndbapi_examples.inc
Normal file
|
@ -0,0 +1,4 @@
|
|||
--require r/have_ndbapi_examples.require
|
||||
disable_query_log;
|
||||
eval select LENGTH("$MY_NDB_EXAMPLES_BINARY") > 0 as "have_ndb_example";
|
||||
enable_query_log;
|
|
@ -2,10 +2,6 @@
|
|||
# that ensure that starting conditions (environment) for the IM-test are as
|
||||
# expected.
|
||||
|
||||
# Wait for mysqld1 (guarded instance) to start.
|
||||
|
||||
--exec $MYSQL_TEST_DIR/t/wait_for_process.sh $IM_MYSQLD1_PATH_PID 30 started
|
||||
|
||||
# Check the running instances.
|
||||
|
||||
--connect (mysql1_con,localhost,root,,mysql,$IM_MYSQLD1_PORT,$IM_MYSQLD1_SOCK)
|
||||
|
@ -14,6 +10,8 @@
|
|||
|
||||
SHOW VARIABLES LIKE 'server_id';
|
||||
|
||||
--source include/not_windows.inc
|
||||
|
||||
--connection default
|
||||
|
||||
# Let IM detect that mysqld1 is online. This delay should be longer than
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
--connect (dflt_server_con,localhost,root,,mysql,$IM_MYSQLD1_PORT,$IM_MYSQLD1_SOCK)
|
||||
--connection dflt_server_con
|
||||
|
||||
--source include/not_windows.inc
|
||||
|
||||
# check that CSV engine was compiled in, as IM the test suite uses
|
||||
# logs tables-specific option and the option is not present if CSV
|
||||
# (and => the log tables) are not in.
|
||||
# NOTE: In future we should remove this check and make the test suite
|
||||
# to pass correct opyions to IM depending on the CSV presence
|
||||
--source include/have_csv.inc
|
||||
|
||||
--connection default
|
||||
--disconnect dflt_server_con
|
23
mysql-test/include/loaddata_autocom.inc
Normal file
23
mysql-test/include/loaddata_autocom.inc
Normal file
|
@ -0,0 +1,23 @@
|
|||
# Test if the engine does autocommit in LOAD DATA INFILE, or not
|
||||
# (NDB wants to do, others don't).
|
||||
|
||||
eval SET SESSION STORAGE_ENGINE = $engine_type;
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
# NDB does not support the create option 'Binlog of table with BLOB attribute and no PK'
|
||||
# So use a dummy PK here.
|
||||
create table t1 (id int unsigned not null auto_increment primary key, a text, b text);
|
||||
start transaction;
|
||||
load data infile '../std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''' (a, b);
|
||||
commit;
|
||||
select count(*) from t1;
|
||||
truncate table t1;
|
||||
start transaction;
|
||||
load data infile '../std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''' (a, b);
|
||||
rollback;
|
||||
select count(*) from t1;
|
||||
|
||||
drop table t1;
|
4
mysql-test/include/not_valgrind.inc
Normal file
4
mysql-test/include/not_valgrind.inc
Normal file
|
@ -0,0 +1,4 @@
|
|||
--require r/not_valgrind.require
|
||||
--disable_query_log
|
||||
eval select $VALGRIND_TEST as using_valgrind;
|
||||
--enable_query_log
|
|
@ -102,7 +102,7 @@ sub collect_test_cases ($) {
|
|||
|
||||
if ( $mysqld_test_exists and $im_test_exists )
|
||||
{
|
||||
mtr_error("Ambiguos test case name ($tname)");
|
||||
mtr_error("Ambiguous test case name ($tname)");
|
||||
}
|
||||
elsif ( ! $mysqld_test_exists and ! $im_test_exists )
|
||||
{
|
||||
|
@ -157,34 +157,38 @@ sub collect_test_cases ($) {
|
|||
|
||||
if ( $::opt_reorder )
|
||||
{
|
||||
@$cases = sort {
|
||||
if ( ! $a->{'master_restart'} and ! $b->{'master_restart'} )
|
||||
{
|
||||
return $a->{'name'} cmp $b->{'name'};
|
||||
}
|
||||
|
||||
if ( $a->{'master_restart'} and $b->{'master_restart'} )
|
||||
{
|
||||
my $cmp= mtr_cmp_opts($a->{'master_opt'}, $b->{'master_opt'});
|
||||
if ( $cmp == 0 )
|
||||
{
|
||||
return $a->{'name'} cmp $b->{'name'};
|
||||
}
|
||||
else
|
||||
{
|
||||
return $cmp;
|
||||
}
|
||||
}
|
||||
my %sort_criteria;
|
||||
my $tinfo;
|
||||
|
||||
if ( $a->{'master_restart'} )
|
||||
{
|
||||
return 1; # Is greater
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1; # Is less
|
||||
}
|
||||
} @$cases;
|
||||
# Make a mapping of test name to a string that represents how that test
|
||||
# should be sorted among the other tests. Put the most important criterion
|
||||
# first, then a sub-criterion, then sub-sub-criterion, et c.
|
||||
foreach $tinfo (@$cases)
|
||||
{
|
||||
my @this_criteria = ();
|
||||
|
||||
# Append the criteria for sorting, in order of importance.
|
||||
push(@this_criteria, join("!", sort @{$tinfo->{'master_opt'}}) . "~"); # Ending with "~" makes empty sort later than filled
|
||||
push(@this_criteria, "ndb=" . ($tinfo->{'ndb_test'} ? "1" : "0"));
|
||||
push(@this_criteria, "restart=" . ($tinfo->{'master_restart'} ? "1" : "0"));
|
||||
push(@this_criteria, "big_test=" . ($tinfo->{'big_test'} ? "1" : "0"));
|
||||
push(@this_criteria, join("|", sort keys %{$tinfo})); # Group similar things together. The values may differ substantially. FIXME?
|
||||
push(@this_criteria, $tinfo->{'name'}); # Finally, order by the name
|
||||
|
||||
$sort_criteria{$tinfo->{"name"}} = join(" ", @this_criteria);
|
||||
}
|
||||
|
||||
@$cases = sort { $sort_criteria{$a->{"name"}} cmp $sort_criteria{$b->{"name"}}; } @$cases;
|
||||
|
||||
### For debugging the sort-order
|
||||
# foreach $tinfo (@$cases)
|
||||
# {
|
||||
# print $sort_criteria{$tinfo->{"name"}};
|
||||
# print " -> \t";
|
||||
# print $tinfo->{"name"};
|
||||
# print "\n";
|
||||
# }
|
||||
}
|
||||
|
||||
return $cases;
|
||||
|
@ -469,14 +473,6 @@ sub collect_one_test_case($$$$$$$) {
|
|||
{
|
||||
mtr_options_from_test_file($tinfo,"$testdir/${tname}.test");
|
||||
|
||||
if ( ! $tinfo->{'innodb_test'} )
|
||||
{
|
||||
# mtr_verbose("Adding '--skip-innodb' to $tinfo->{'name'}");
|
||||
# FIXME activate the --skip-innodb only when running with
|
||||
# selected test cases
|
||||
# push(@{$tinfo->{'master_opt'}}, "--skip-innodb");
|
||||
}
|
||||
|
||||
if ( $tinfo->{'big_test'} and ! $::opt_big_test )
|
||||
{
|
||||
$tinfo->{'skip'}= 1;
|
||||
|
|
|
@ -20,13 +20,39 @@ sub mtr_lastlinefromfile($);
|
|||
##############################################################################
|
||||
|
||||
sub mtr_get_pid_from_file ($) {
|
||||
my $file= shift;
|
||||
my $pid_file_path= shift;
|
||||
my $TOTAL_ATTEMPTS= 30;
|
||||
my $timeout= 1;
|
||||
|
||||
open(FILE,"<",$file) or mtr_error("can't open file \"$file\": $!");
|
||||
my $pid= <FILE>;
|
||||
chomp($pid);
|
||||
close FILE;
|
||||
return $pid;
|
||||
# We should read from the file until we get correct pid. As it is
|
||||
# stated in BUG#21884, pid file can be empty at some moment. So, we should
|
||||
# read it until we get valid data.
|
||||
|
||||
for (my $cur_attempt= 1; $cur_attempt <= $TOTAL_ATTEMPTS; ++$cur_attempt)
|
||||
{
|
||||
mtr_debug("Reading pid file '$pid_file_path' " .
|
||||
"($cur_attempt of $TOTAL_ATTEMPTS)...");
|
||||
|
||||
open(FILE, '<', $pid_file_path)
|
||||
or mtr_error("can't open file \"$pid_file_path\": $!");
|
||||
|
||||
my $pid= <FILE>;
|
||||
|
||||
chomp($pid) if defined $pid;
|
||||
|
||||
close FILE;
|
||||
|
||||
return $pid if defined $pid && $pid ne '';
|
||||
|
||||
mtr_debug("Pid file '$pid_file_path' is empty. " .
|
||||
"Sleeping $timeout second(s)...");
|
||||
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
mtr_error("Pid file '$pid_file_path' is corrupted. " .
|
||||
"Can not retrieve PID in " .
|
||||
($timeout * $TOTAL_ATTEMPTS) . " seconds.");
|
||||
}
|
||||
|
||||
sub mtr_get_opts_from_file ($) {
|
||||
|
|
|
@ -139,6 +139,8 @@ sub mtr_copy_dir($$) {
|
|||
my $from_dir= shift;
|
||||
my $to_dir= shift;
|
||||
|
||||
# mtr_verbose("Copying from $from_dir to $to_dir");
|
||||
|
||||
mkpath("$to_dir");
|
||||
opendir(DIR, "$from_dir")
|
||||
or mtr_error("Can't find $from_dir$!");
|
||||
|
|
|
@ -25,7 +25,28 @@ sub sleep_until_file_created ($$$);
|
|||
sub mtr_kill_processes ($);
|
||||
sub mtr_ping_with_timeout($);
|
||||
sub mtr_ping_port ($);
|
||||
sub mtr_kill_process ($$$);
|
||||
|
||||
# Private IM-related operations.
|
||||
|
||||
sub mtr_im_kill_process ($$$);
|
||||
sub mtr_im_load_pids ($);
|
||||
sub mtr_im_terminate ($);
|
||||
sub mtr_im_check_alive ($);
|
||||
sub mtr_im_check_main_alive ($);
|
||||
sub mtr_im_check_angel_alive ($);
|
||||
sub mtr_im_check_mysqlds_alive ($);
|
||||
sub mtr_im_check_mysqld_alive ($$);
|
||||
sub mtr_im_cleanup ($);
|
||||
sub mtr_im_rm_file ($);
|
||||
sub mtr_im_errlog ($);
|
||||
sub mtr_im_kill ($);
|
||||
sub mtr_im_wait_for_connection ($$$);
|
||||
sub mtr_im_wait_for_mysqld($$$);
|
||||
|
||||
# Public IM-related operations.
|
||||
|
||||
sub mtr_im_start ($$);
|
||||
sub mtr_im_stop ($$);
|
||||
|
||||
# static in C
|
||||
sub spawn_impl ($$$$$$$$);
|
||||
|
@ -94,6 +115,8 @@ sub spawn_impl ($$$$$$$$) {
|
|||
my $pid_file= shift; # FIXME
|
||||
my $spawn_opts= shift;
|
||||
|
||||
mtr_error("Can't spawn with empty \"path\"") unless defined $path;
|
||||
|
||||
if ( $::opt_script_debug )
|
||||
{
|
||||
print STDERR "\n";
|
||||
|
@ -335,16 +358,27 @@ sub mtr_process_exit_status {
|
|||
# kill IM manager first, else it will restart the servers
|
||||
sub mtr_kill_leftovers () {
|
||||
|
||||
mtr_debug("mtr_kill_leftovers(): started.");
|
||||
|
||||
mtr_im_stop($::instance_manager, 'mtr_kill_leftovers');
|
||||
|
||||
# Start shutdown of masters and slaves. Don't touch IM-managed mysqld
|
||||
# instances -- they should be stopped by mtr_im_stop().
|
||||
|
||||
mtr_debug("Shutting down mysqld-instances...");
|
||||
|
||||
my @kill_pids;
|
||||
my %admin_pids;
|
||||
my $pid;
|
||||
|
||||
#Start shutdown of instance_managers, masters and slaves
|
||||
foreach my $srv ($::instance_manager,
|
||||
@{$::instance_manager->{'instances'}},
|
||||
@{$::master},@{$::slave})
|
||||
foreach my $srv (@{$::master}, @{$::slave})
|
||||
{
|
||||
$pid= mtr_mysqladmin_start($srv, "shutdown", 70);
|
||||
mtr_debug(" - mysqld " .
|
||||
"(pid: $srv->{pid}; " .
|
||||
"pid file: '$srv->{path_pid}'; " .
|
||||
"socket: '$srv->{path_sock}'; ".
|
||||
"port: $srv->{port})");
|
||||
|
||||
my $pid= mtr_mysqladmin_start($srv, "shutdown", 70);
|
||||
|
||||
# Save the pid of the mysqladmin process
|
||||
$admin_pids{$pid}= 1;
|
||||
|
@ -358,10 +392,17 @@ sub mtr_kill_leftovers () {
|
|||
$srv->{'pid'}= 0; # Assume we are done with it
|
||||
}
|
||||
|
||||
# Start shutdown of clusters
|
||||
# Start shutdown of clusters.
|
||||
|
||||
mtr_debug("Shutting down cluster...");
|
||||
|
||||
foreach my $cluster (@{$::clusters})
|
||||
{
|
||||
$pid= mtr_ndbmgm_start($cluster, "shutdown");
|
||||
mtr_debug(" - cluster " .
|
||||
"(pid: $cluster->{pid}; " .
|
||||
"pid file: '$cluster->{path_pid})");
|
||||
|
||||
my $pid= mtr_ndbmgm_start($cluster, "shutdown");
|
||||
|
||||
# Save the pid of the ndb_mgm process
|
||||
$admin_pids{$pid}= 1;
|
||||
|
@ -376,13 +417,16 @@ sub mtr_kill_leftovers () {
|
|||
|
||||
foreach my $ndbd (@{$cluster->{'ndbds'}})
|
||||
{
|
||||
mtr_debug(" - ndbd " .
|
||||
"(pid: $ndbd->{pid}; " .
|
||||
"pid file: '$ndbd->{path_pid})");
|
||||
|
||||
push(@kill_pids,{
|
||||
pid => $ndbd->{'pid'},
|
||||
pidfile => $ndbd->{'path_pid'},
|
||||
});
|
||||
$ndbd->{'pid'}= 0; # Assume we are done with it
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
# Wait for all the admin processes to complete
|
||||
|
@ -411,6 +455,8 @@ sub mtr_kill_leftovers () {
|
|||
# FIXME $path_run_dir or something
|
||||
my $rundir= "$::opt_vardir/run";
|
||||
|
||||
mtr_debug("Processing PID files in directory '$rundir'...");
|
||||
|
||||
if ( -d $rundir )
|
||||
{
|
||||
opendir(RUNDIR, $rundir)
|
||||
|
@ -424,8 +470,12 @@ sub mtr_kill_leftovers () {
|
|||
|
||||
if ( -f $pidfile )
|
||||
{
|
||||
mtr_debug("Processing PID file: '$pidfile'...");
|
||||
|
||||
my $pid= mtr_get_pid_from_file($pidfile);
|
||||
|
||||
mtr_debug("Got pid: $pid from file '$pidfile'");
|
||||
|
||||
# Race, could have been removed between I tested with -f
|
||||
# and the unlink() below, so I better check again with -f
|
||||
|
||||
|
@ -436,14 +486,24 @@ sub mtr_kill_leftovers () {
|
|||
|
||||
if ( $::glob_cygwin_perl or kill(0, $pid) )
|
||||
{
|
||||
mtr_debug("There is process with pid $pid -- scheduling for kill.");
|
||||
push(@pids, $pid); # We know (cygwin guess) it exists
|
||||
}
|
||||
else
|
||||
{
|
||||
mtr_debug("There is no process with pid $pid -- skipping.");
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir(RUNDIR);
|
||||
|
||||
if ( @pids )
|
||||
{
|
||||
mtr_debug("Killing the following processes with PID files: " .
|
||||
join(' ', @pids) . "...");
|
||||
|
||||
start_reap_all();
|
||||
|
||||
if ( $::glob_cygwin_perl )
|
||||
{
|
||||
# We have no (easy) way of knowing the Cygwin controlling
|
||||
|
@ -457,6 +517,7 @@ sub mtr_kill_leftovers () {
|
|||
my $retries= 10; # 10 seconds
|
||||
do
|
||||
{
|
||||
mtr_debug("Sending SIGKILL to pids: " . join(' ', @pids));
|
||||
kill(9, @pids);
|
||||
mtr_report("Sleep 1 second waiting for processes to die");
|
||||
sleep(1) # Wait one second
|
||||
|
@ -467,12 +528,20 @@ sub mtr_kill_leftovers () {
|
|||
mtr_warning("can't kill process(es) " . join(" ", @pids));
|
||||
}
|
||||
}
|
||||
|
||||
stop_reap_all();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mtr_debug("Directory for PID files ($rundir) does not exist.");
|
||||
}
|
||||
|
||||
# We may have failed everything, but we now check again if we have
|
||||
# the listen ports free to use, and if they are free, just go for it.
|
||||
|
||||
mtr_debug("Checking known mysqld servers...");
|
||||
|
||||
foreach my $srv ( @kill_pids )
|
||||
{
|
||||
if ( defined $srv->{'port'} and mtr_ping_port($srv->{'port'}) )
|
||||
|
@ -480,6 +549,8 @@ sub mtr_kill_leftovers () {
|
|||
mtr_warning("can't kill old process holding port $srv->{'port'}");
|
||||
}
|
||||
}
|
||||
|
||||
mtr_debug("mtr_kill_leftovers(): finished.");
|
||||
}
|
||||
|
||||
|
||||
|
@ -633,7 +704,7 @@ sub mtr_check_stop_servers ($) {
|
|||
}
|
||||
else
|
||||
{
|
||||
mtr_verbose("All ports where free, continuing");
|
||||
mtr_verbose("All ports were free, continuing");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -736,6 +807,9 @@ sub mtr_ping_with_timeout($) {
|
|||
my $res= 1; # If we just fall through, we are done
|
||||
# in the sense that the servers don't
|
||||
# listen to their ports any longer
|
||||
|
||||
mtr_debug("Waiting for mysqld servers to stop...");
|
||||
|
||||
TIME:
|
||||
while ( $timeout-- )
|
||||
{
|
||||
|
@ -763,7 +837,14 @@ sub mtr_ping_with_timeout($) {
|
|||
last; # If we got here, we are done
|
||||
}
|
||||
|
||||
$timeout or mtr_report("At least one server is still listening to its port");
|
||||
if ($res)
|
||||
{
|
||||
mtr_debug("mtr_ping_with_timeout(): All mysqld instances are down.");
|
||||
}
|
||||
else
|
||||
{
|
||||
mtr_report("mtr_ping_with_timeout(): At least one server is alive.");
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
@ -896,6 +977,7 @@ sub check_expected_crash_and_restart($)
|
|||
|
||||
sub mtr_record_dead_children () {
|
||||
|
||||
my $process_died= 0;
|
||||
my $ret_pid;
|
||||
|
||||
# Wait without blockinng to see if any processes had died
|
||||
|
@ -904,7 +986,9 @@ sub mtr_record_dead_children () {
|
|||
{
|
||||
mtr_warning("mtr_record_dead_children: $ret_pid");
|
||||
mark_process_dead($ret_pid);
|
||||
$process_died= 1;
|
||||
}
|
||||
return $process_died;
|
||||
}
|
||||
|
||||
sub start_reap_all {
|
||||
|
@ -946,6 +1030,9 @@ sub mtr_ping_port ($) {
|
|||
{
|
||||
mtr_error("can't create socket: $!");
|
||||
}
|
||||
|
||||
mtr_debug("Pinging server (port: $port)...");
|
||||
|
||||
if ( connect(SOCK, $paddr) )
|
||||
{
|
||||
close(SOCK); # FIXME check error?
|
||||
|
@ -1016,34 +1103,12 @@ sub mtr_kill_processes ($) {
|
|||
{
|
||||
foreach my $sig (15, 9)
|
||||
{
|
||||
last if mtr_kill_process($pid, $sig, 10);
|
||||
last if mtr_im_kill_process([ $pid ], $sig, 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sub mtr_kill_process ($$$) {
|
||||
my $pid= shift;
|
||||
my $signal= shift;
|
||||
my $timeout= shift; # Seconds to wait for process
|
||||
my $max_loop= $timeout*10; # Sleeping 0.1 between each kill attempt
|
||||
|
||||
for (my $cur_attempt= 1; $cur_attempt <= $max_loop; ++$cur_attempt)
|
||||
{
|
||||
mtr_debug("Sending $signal to $pid...");
|
||||
|
||||
kill($signal, $pid);
|
||||
|
||||
last unless kill (0, $pid) and $max_loop--;
|
||||
|
||||
mtr_verbose("Sleep 0.1 second waiting for processes $pid to die");
|
||||
|
||||
select(undef, undef, undef, 0.1);
|
||||
}
|
||||
|
||||
return $max_loop;
|
||||
}
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# When we exit, we kill off all children
|
||||
|
@ -1073,4 +1138,679 @@ sub mtr_exit ($) {
|
|||
exit($code);
|
||||
}
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Instance Manager management routines.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
sub mtr_im_kill_process ($$$) {
|
||||
my $pid_lst= shift;
|
||||
my $signal= shift;
|
||||
my $timeout= shift;
|
||||
my $total_attempts= $timeout * 10;
|
||||
|
||||
my %pids;
|
||||
|
||||
foreach my $pid (@{$pid_lst})
|
||||
{
|
||||
$pids{$pid}= 1;
|
||||
}
|
||||
|
||||
for (my $cur_attempt= 1; $cur_attempt <= $total_attempts; ++$cur_attempt)
|
||||
{
|
||||
foreach my $pid (keys %pids)
|
||||
{
|
||||
mtr_debug("Sending $signal to $pid...");
|
||||
|
||||
kill($signal, $pid);
|
||||
|
||||
unless (kill (0, $pid))
|
||||
{
|
||||
mtr_debug("Process $pid died.");
|
||||
delete $pids{$pid};
|
||||
}
|
||||
}
|
||||
|
||||
return if scalar keys %pids == 0;
|
||||
|
||||
mtr_debug("Sleeping 100ms waiting for processes to die...");
|
||||
|
||||
select(undef, undef, undef, 0.1);
|
||||
}
|
||||
|
||||
mtr_debug("Process(es) " .
|
||||
join(' ', keys %pids) .
|
||||
" is still alive after $total_attempts " .
|
||||
"of sending signal $signal.");
|
||||
}
|
||||
|
||||
###########################################################################
|
||||
|
||||
sub mtr_im_load_pids($) {
|
||||
my $instance_manager= shift;
|
||||
|
||||
mtr_debug("Loading PID files...");
|
||||
|
||||
# Obtain mysqld-process pids.
|
||||
|
||||
my $instances = $instance_manager->{'instances'};
|
||||
|
||||
for (my $idx= 0; $idx < 2; ++$idx)
|
||||
{
|
||||
mtr_debug("IM-guarded mysqld[$idx] PID file: '" .
|
||||
$instances->[$idx]->{'path_pid'} . "'.");
|
||||
|
||||
my $mysqld_pid;
|
||||
|
||||
if (-r $instances->[$idx]->{'path_pid'})
|
||||
{
|
||||
$mysqld_pid= mtr_get_pid_from_file($instances->[$idx]->{'path_pid'});
|
||||
mtr_debug("IM-guarded mysqld[$idx] PID: $mysqld_pid.");
|
||||
}
|
||||
else
|
||||
{
|
||||
$mysqld_pid= undef;
|
||||
mtr_debug("IM-guarded mysqld[$idx]: no PID file.");
|
||||
}
|
||||
|
||||
$instances->[$idx]->{'pid'}= $mysqld_pid;
|
||||
}
|
||||
|
||||
# Re-read Instance Manager PIDs from the file, since during tests Instance
|
||||
# Manager could have been restarted, so its PIDs could have been changed.
|
||||
|
||||
# - IM-main
|
||||
|
||||
mtr_debug("IM-main PID file: '$instance_manager->{path_pid}'.");
|
||||
|
||||
if (-f $instance_manager->{'path_pid'})
|
||||
{
|
||||
$instance_manager->{'pid'} =
|
||||
mtr_get_pid_from_file($instance_manager->{'path_pid'});
|
||||
|
||||
mtr_debug("IM-main PID: $instance_manager->{pid}.");
|
||||
}
|
||||
else
|
||||
{
|
||||
mtr_debug("IM-main: no PID file.");
|
||||
$instance_manager->{'pid'}= undef;
|
||||
}
|
||||
|
||||
# - IM-angel
|
||||
|
||||
mtr_debug("IM-angel PID file: '$instance_manager->{path_angel_pid}'.");
|
||||
|
||||
if (-f $instance_manager->{'path_angel_pid'})
|
||||
{
|
||||
$instance_manager->{'angel_pid'} =
|
||||
mtr_get_pid_from_file($instance_manager->{'path_angel_pid'});
|
||||
|
||||
mtr_debug("IM-angel PID: $instance_manager->{'angel_pid'}.");
|
||||
}
|
||||
else
|
||||
{
|
||||
mtr_debug("IM-angel: no PID file.");
|
||||
$instance_manager->{'angel_pid'} = undef;
|
||||
}
|
||||
}
|
||||
|
||||
###########################################################################
|
||||
|
||||
sub mtr_im_terminate($) {
|
||||
my $instance_manager= shift;
|
||||
|
||||
# Load pids from pid-files. We should do it first of all, because IM deletes
|
||||
# them on shutdown.
|
||||
|
||||
mtr_im_load_pids($instance_manager);
|
||||
|
||||
mtr_debug("Shutting Instance Manager down...");
|
||||
|
||||
# Ignoring SIGCHLD so that all children could rest in peace.
|
||||
|
||||
start_reap_all();
|
||||
|
||||
# Send SIGTERM to IM-main.
|
||||
|
||||
if (defined $instance_manager->{'pid'})
|
||||
{
|
||||
mtr_debug("IM-main pid: $instance_manager->{pid}.");
|
||||
mtr_debug("Stopping IM-main...");
|
||||
|
||||
mtr_im_kill_process([ $instance_manager->{'pid'} ], 'TERM', 10);
|
||||
}
|
||||
else
|
||||
{
|
||||
mtr_debug("IM-main pid: n/a.");
|
||||
}
|
||||
|
||||
# If IM-angel was alive, wait for it to die.
|
||||
|
||||
if (defined $instance_manager->{'angel_pid'})
|
||||
{
|
||||
mtr_debug("IM-angel pid: $instance_manager->{'angel_pid'}.");
|
||||
mtr_debug("Waiting for IM-angel to die...");
|
||||
|
||||
my $total_attempts= 10;
|
||||
|
||||
for (my $cur_attempt=1; $cur_attempt <= $total_attempts; ++$cur_attempt)
|
||||
{
|
||||
unless (kill (0, $instance_manager->{'angel_pid'}))
|
||||
{
|
||||
mtr_debug("IM-angel died.");
|
||||
last;
|
||||
}
|
||||
|
||||
sleep(1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mtr_debug("IM-angel pid: n/a.");
|
||||
}
|
||||
|
||||
stop_reap_all();
|
||||
|
||||
# Re-load PIDs.
|
||||
|
||||
mtr_im_load_pids($instance_manager);
|
||||
}
|
||||
|
||||
###########################################################################
|
||||
|
||||
sub mtr_im_check_alive($) {
|
||||
my $instance_manager= shift;
|
||||
|
||||
mtr_debug("Checking whether IM-components are alive...");
|
||||
|
||||
return 1 if mtr_im_check_main_alive($instance_manager);
|
||||
|
||||
return 1 if mtr_im_check_angel_alive($instance_manager);
|
||||
|
||||
return 1 if mtr_im_check_mysqlds_alive($instance_manager);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
###########################################################################
|
||||
|
||||
sub mtr_im_check_main_alive($) {
|
||||
my $instance_manager= shift;
|
||||
|
||||
# Check that the process, that we know to be IM's, is dead.
|
||||
|
||||
if (defined $instance_manager->{'pid'})
|
||||
{
|
||||
if (kill (0, $instance_manager->{'pid'}))
|
||||
{
|
||||
mtr_debug("IM-main (PID: $instance_manager->{pid}) is alive.");
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
mtr_debug("IM-main (PID: $instance_manager->{pid}) is dead.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mtr_debug("No PID file for IM-main.");
|
||||
}
|
||||
|
||||
# Check that IM does not accept client connections.
|
||||
|
||||
if (mtr_ping_port($instance_manager->{'port'}))
|
||||
{
|
||||
mtr_debug("IM-main (port: $instance_manager->{port}) " .
|
||||
"is accepting connections.");
|
||||
|
||||
mtr_im_errlog("IM-main is accepting connections on port " .
|
||||
"$instance_manager->{port}, but there is no " .
|
||||
"process information.");
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
mtr_debug("IM-main (port: $instance_manager->{port}) " .
|
||||
"does not accept connections.");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
###########################################################################
|
||||
|
||||
sub mtr_im_check_angel_alive($) {
|
||||
my $instance_manager= shift;
|
||||
|
||||
# Check that the process, that we know to be the Angel, is dead.
|
||||
|
||||
if (defined $instance_manager->{'angel_pid'})
|
||||
{
|
||||
if (kill (0, $instance_manager->{'angel_pid'}))
|
||||
{
|
||||
mtr_debug("IM-angel (PID: $instance_manager->{angel_pid}) is alive.");
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
mtr_debug("IM-angel (PID: $instance_manager->{angel_pid}) is dead.");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mtr_debug("No PID file for IM-angel.");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
###########################################################################
|
||||
|
||||
sub mtr_im_check_mysqlds_alive($) {
|
||||
my $instance_manager= shift;
|
||||
|
||||
mtr_debug("Checking for IM-guarded mysqld instances...");
|
||||
|
||||
my $instances = $instance_manager->{'instances'};
|
||||
|
||||
for (my $idx= 0; $idx < 2; ++$idx)
|
||||
{
|
||||
mtr_debug("Checking mysqld[$idx]...");
|
||||
|
||||
return 1
|
||||
if mtr_im_check_mysqld_alive($instance_manager, $instances->[$idx]);
|
||||
}
|
||||
}
|
||||
|
||||
###########################################################################
|
||||
|
||||
sub mtr_im_check_mysqld_alive($$) {
|
||||
my $instance_manager= shift;
|
||||
my $mysqld_instance= shift;
|
||||
|
||||
# Check that the process is dead.
|
||||
|
||||
if (defined $instance_manager->{'pid'})
|
||||
{
|
||||
if (kill (0, $instance_manager->{'pid'}))
|
||||
{
|
||||
mtr_debug("Mysqld instance (PID: $mysqld_instance->{pid}) is alive.");
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
mtr_debug("Mysqld instance (PID: $mysqld_instance->{pid}) is dead.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mtr_debug("No PID file for mysqld instance.");
|
||||
}
|
||||
|
||||
# Check that mysqld does not accept client connections.
|
||||
|
||||
if (mtr_ping_port($mysqld_instance->{'port'}))
|
||||
{
|
||||
mtr_debug("Mysqld instance (port: $mysqld_instance->{port}) " .
|
||||
"is accepting connections.");
|
||||
|
||||
mtr_im_errlog("Mysqld is accepting connections on port " .
|
||||
"$mysqld_instance->{port}, but there is no " .
|
||||
"process information.");
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
mtr_debug("Mysqld instance (port: $mysqld_instance->{port}) " .
|
||||
"does not accept connections.");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
###########################################################################
|
||||
|
||||
sub mtr_im_cleanup($) {
|
||||
my $instance_manager= shift;
|
||||
|
||||
mtr_im_rm_file($instance_manager->{'path_pid'});
|
||||
mtr_im_rm_file($instance_manager->{'path_sock'});
|
||||
|
||||
mtr_im_rm_file($instance_manager->{'path_angel_pid'});
|
||||
|
||||
for (my $idx= 0; $idx < 2; ++$idx)
|
||||
{
|
||||
mtr_im_rm_file($instance_manager->{'instances'}->[$idx]->{'path_pid'});
|
||||
mtr_im_rm_file($instance_manager->{'instances'}->[$idx]->{'path_sock'});
|
||||
}
|
||||
}
|
||||
|
||||
###########################################################################
|
||||
|
||||
sub mtr_im_rm_file($)
|
||||
{
|
||||
my $file_path= shift;
|
||||
|
||||
if (-f $file_path)
|
||||
{
|
||||
mtr_debug("Removing '$file_path'...");
|
||||
|
||||
mtr_warning("Can not remove '$file_path'.")
|
||||
unless unlink($file_path);
|
||||
}
|
||||
else
|
||||
{
|
||||
mtr_debug("File '$file_path' does not exist already.");
|
||||
}
|
||||
}
|
||||
|
||||
###########################################################################
|
||||
|
||||
sub mtr_im_errlog($) {
|
||||
my $msg= shift;
|
||||
|
||||
# Complain in error log so that a warning will be shown.
|
||||
#
|
||||
# TODO: unless BUG#20761 is fixed, we will print the warning to stdout, so
|
||||
# that it can be seen on console and does not produce pushbuild error.
|
||||
|
||||
# my $errlog= "$opt_vardir/log/mysql-test-run.pl.err";
|
||||
#
|
||||
# open (ERRLOG, ">>$errlog") ||
|
||||
# mtr_error("Can not open error log ($errlog)");
|
||||
#
|
||||
# my $ts= localtime();
|
||||
# print ERRLOG
|
||||
# "Warning: [$ts] $msg\n";
|
||||
#
|
||||
# close ERRLOG;
|
||||
|
||||
my $ts= localtime();
|
||||
print "Warning: [$ts] $msg\n";
|
||||
}
|
||||
|
||||
###########################################################################
|
||||
|
||||
sub mtr_im_kill($) {
|
||||
my $instance_manager= shift;
|
||||
|
||||
# Re-load PIDs. That can be useful because some processes could have been
|
||||
# restarted.
|
||||
|
||||
mtr_im_load_pids($instance_manager);
|
||||
|
||||
# Ignoring SIGCHLD so that all children could rest in peace.
|
||||
|
||||
start_reap_all();
|
||||
|
||||
# Kill IM-angel first of all.
|
||||
|
||||
if (defined $instance_manager->{'angel_pid'})
|
||||
{
|
||||
mtr_debug("Killing IM-angel (PID: $instance_manager->{angel_pid})...");
|
||||
mtr_im_kill_process([ $instance_manager->{'angel_pid'} ], 'KILL', 10);
|
||||
}
|
||||
else
|
||||
{
|
||||
mtr_debug("IM-angel is dead.");
|
||||
}
|
||||
|
||||
# Re-load PIDs again.
|
||||
|
||||
mtr_im_load_pids($instance_manager);
|
||||
|
||||
# Kill IM-main.
|
||||
|
||||
if (defined $instance_manager->{'pid'})
|
||||
{
|
||||
mtr_debug("Killing IM-main (PID: $instance_manager->pid})...");
|
||||
mtr_im_kill_process([ $instance_manager->{'pid'} ], 'KILL', 10);
|
||||
}
|
||||
else
|
||||
{
|
||||
mtr_debug("IM-main is dead.");
|
||||
}
|
||||
|
||||
# Re-load PIDs again.
|
||||
|
||||
mtr_im_load_pids($instance_manager);
|
||||
|
||||
# Kill guarded mysqld instances.
|
||||
|
||||
my @mysqld_pids;
|
||||
|
||||
mtr_debug("Collecting PIDs of mysqld instances to kill...");
|
||||
|
||||
for (my $idx= 0; $idx < 2; ++$idx)
|
||||
{
|
||||
my $pid= $instance_manager->{'instances'}->[$idx]->{'pid'};
|
||||
|
||||
next unless defined $pid;
|
||||
|
||||
mtr_debug(" - IM-guarded mysqld[$idx] PID: $pid.");
|
||||
|
||||
push (@mysqld_pids, $pid);
|
||||
}
|
||||
|
||||
if (scalar @mysqld_pids > 0)
|
||||
{
|
||||
mtr_debug("Killing IM-guarded mysqld instances...");
|
||||
mtr_im_kill_process(\@mysqld_pids, 'KILL', 10);
|
||||
}
|
||||
|
||||
# That's all.
|
||||
|
||||
stop_reap_all();
|
||||
}
|
||||
|
||||
##############################################################################
|
||||
|
||||
sub mtr_im_wait_for_connection($$$) {
|
||||
my $instance_manager= shift;
|
||||
my $total_attempts= shift;
|
||||
my $connect_timeout= shift;
|
||||
|
||||
mtr_debug("Waiting for IM on port $instance_manager->{port} " .
|
||||
"to start accepting connections...");
|
||||
|
||||
for (my $cur_attempt= 1; $cur_attempt <= $total_attempts; ++$cur_attempt)
|
||||
{
|
||||
mtr_debug("Trying to connect to IM ($cur_attempt of $total_attempts)...");
|
||||
|
||||
if (mtr_ping_port($instance_manager->{'port'}))
|
||||
{
|
||||
mtr_debug("IM is accepting connections " .
|
||||
"on port $instance_manager->{port}.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
mtr_debug("Sleeping $connect_timeout...");
|
||||
sleep($connect_timeout);
|
||||
}
|
||||
|
||||
mtr_debug("IM does not accept connections " .
|
||||
"on port $instance_manager->{port} after " .
|
||||
($total_attempts * $connect_timeout) . " seconds.");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
##############################################################################
|
||||
|
||||
sub mtr_im_wait_for_mysqld($$$) {
|
||||
my $mysqld= shift;
|
||||
my $total_attempts= shift;
|
||||
my $connect_timeout= shift;
|
||||
|
||||
mtr_debug("Waiting for IM-guarded mysqld on port $mysqld->{port} " .
|
||||
"to start accepting connections...");
|
||||
|
||||
for (my $cur_attempt= 1; $cur_attempt <= $total_attempts; ++$cur_attempt)
|
||||
{
|
||||
mtr_debug("Trying to connect to mysqld " .
|
||||
"($cur_attempt of $total_attempts)...");
|
||||
|
||||
if (mtr_ping_port($mysqld->{'port'}))
|
||||
{
|
||||
mtr_debug("Mysqld is accepting connections " .
|
||||
"on port $mysqld->{port}.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
mtr_debug("Sleeping $connect_timeout...");
|
||||
sleep($connect_timeout);
|
||||
}
|
||||
|
||||
mtr_debug("Mysqld does not accept connections " .
|
||||
"on port $mysqld->{port} after " .
|
||||
($total_attempts * $connect_timeout) . " seconds.");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
##############################################################################
|
||||
|
||||
sub mtr_im_start($$) {
|
||||
my $instance_manager = shift;
|
||||
my $opts = shift;
|
||||
|
||||
mtr_debug("Starting Instance Manager...");
|
||||
|
||||
my $args;
|
||||
mtr_init_args(\$args);
|
||||
mtr_add_arg($args, "--defaults-file=%s",
|
||||
$instance_manager->{'defaults_file'});
|
||||
|
||||
foreach my $opt (@{$opts})
|
||||
{
|
||||
mtr_add_arg($args, $opt);
|
||||
}
|
||||
|
||||
$instance_manager->{'pid'} =
|
||||
mtr_spawn(
|
||||
$::exe_im, # path to the executable
|
||||
$args, # cmd-line args
|
||||
'', # stdin
|
||||
$instance_manager->{'path_log'}, # stdout
|
||||
$instance_manager->{'path_err'}, # stderr
|
||||
'', # pid file path (not used)
|
||||
{ append_log_file => 1 } # append log files
|
||||
);
|
||||
|
||||
if ( ! $instance_manager->{'pid'} )
|
||||
{
|
||||
mtr_report('Could not start Instance Manager');
|
||||
return;
|
||||
}
|
||||
|
||||
# Instance Manager can be run in daemon mode. In this case, it creates
|
||||
# several processes and the parent process, created by mtr_spawn(), exits just
|
||||
# after start. So, we have to obtain Instance Manager PID from the PID file.
|
||||
|
||||
if ( ! sleep_until_file_created(
|
||||
$instance_manager->{'path_pid'},
|
||||
$instance_manager->{'start_timeout'},
|
||||
-1)) # real PID is still unknown
|
||||
{
|
||||
mtr_report("Instance Manager PID file is missing");
|
||||
return;
|
||||
}
|
||||
|
||||
$instance_manager->{'pid'} =
|
||||
mtr_get_pid_from_file($instance_manager->{'path_pid'});
|
||||
|
||||
mtr_debug("Instance Manager started. PID: $instance_manager->{pid}.");
|
||||
|
||||
# Wait until we can connect to IM.
|
||||
|
||||
my $IM_CONNECT_TIMEOUT= 30;
|
||||
|
||||
unless (mtr_im_wait_for_connection($instance_manager,
|
||||
$IM_CONNECT_TIMEOUT, 1))
|
||||
{
|
||||
mtr_debug("Can not connect to Instance Manager " .
|
||||
"in $IM_CONNECT_TIMEOUT seconds after start.");
|
||||
mtr_debug("Aborting test suite...");
|
||||
|
||||
mtr_kill_leftovers();
|
||||
|
||||
mtr_error("Can not connect to Instance Manager " .
|
||||
"in $IM_CONNECT_TIMEOUT seconds after start.");
|
||||
}
|
||||
|
||||
# Wait until we can connect to guarded mysqld-instances
|
||||
# (in other words -- wait for IM to start guarded instances).
|
||||
|
||||
for (my $idx= 0; $idx < 2; ++$idx)
|
||||
{
|
||||
my $mysqld= $instance_manager->{'instances'}->[$idx];
|
||||
|
||||
next if exists $mysqld->{'nonguarded'};
|
||||
|
||||
mtr_debug("Waiting for mysqld[$idx] to start...");
|
||||
|
||||
unless (mtr_im_wait_for_mysqld($mysqld, 30, 1))
|
||||
{
|
||||
mtr_debug("Can not connect to mysqld[$idx] " .
|
||||
"in $IM_CONNECT_TIMEOUT seconds after start.");
|
||||
mtr_debug("Aborting test suite...");
|
||||
|
||||
mtr_kill_leftovers();
|
||||
|
||||
mtr_error("Can not connect to mysqld[$idx] " .
|
||||
"in $IM_CONNECT_TIMEOUT seconds after start.");
|
||||
}
|
||||
|
||||
mtr_debug("mysqld[$idx] started.");
|
||||
}
|
||||
|
||||
mtr_debug("Instance Manager started.");
|
||||
|
||||
mtr_im_load_pids($instance_manager);
|
||||
}
|
||||
|
||||
##############################################################################
|
||||
|
||||
sub mtr_im_stop($$) {
|
||||
my $instance_manager= shift;
|
||||
my $where= shift;
|
||||
|
||||
mtr_debug("Stopping Instance Manager...");
|
||||
|
||||
# Try graceful shutdown.
|
||||
|
||||
mtr_im_terminate($instance_manager);
|
||||
|
||||
# Check that all processes died.
|
||||
|
||||
unless (mtr_im_check_alive($instance_manager))
|
||||
{
|
||||
mtr_debug("Instance Manager has been stopped successfully.");
|
||||
mtr_im_cleanup($instance_manager);
|
||||
return 1;
|
||||
}
|
||||
|
||||
# Instance Manager don't want to die. We should kill it.
|
||||
|
||||
mtr_im_errlog("[$where] Instance Manager did not shutdown gracefully.");
|
||||
|
||||
mtr_im_kill($instance_manager);
|
||||
|
||||
# Check again that all IM-related processes have been killed.
|
||||
|
||||
my $im_is_alive= mtr_im_check_alive($instance_manager);
|
||||
|
||||
mtr_im_cleanup($instance_manager);
|
||||
|
||||
if ($im_is_alive)
|
||||
{
|
||||
mtr_error("Can not kill Instance Manager or its children.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
mtr_debug("Instance Manager has been killed successfully.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
###########################################################################
|
||||
|
||||
1;
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -446,52 +446,6 @@ INSERT INTO t1 VALUES(1, 1);
|
|||
ALTER TABLE t1 CHANGE t1 t1 INT(10) auto_increment;
|
||||
ERROR 23000: ALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '1' for key 'PRIMARY'
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE `t2` (
|
||||
`k` int(11) NOT NULL auto_increment,
|
||||
`a` int(11) default NULL,
|
||||
`c` int(11) default NULL,
|
||||
PRIMARY KEY (`k`),
|
||||
UNIQUE KEY `idx_1` (`a`)
|
||||
) ENGINE=InnoDB;
|
||||
insert into t2 ( a ) values ( 6 ) on duplicate key update c =
|
||||
ifnull( c,
|
||||
0 ) + 1;
|
||||
insert into t2 ( a ) values ( 7 ) on duplicate key update c =
|
||||
ifnull( c,
|
||||
0 ) + 1;
|
||||
select last_insert_id();
|
||||
last_insert_id()
|
||||
2
|
||||
select * from t2;
|
||||
k a c
|
||||
1 6 NULL
|
||||
2 7 NULL
|
||||
insert into t2 ( a ) values ( 6 ) on duplicate key update c =
|
||||
ifnull( c,
|
||||
0 ) + 1;
|
||||
select last_insert_id();
|
||||
last_insert_id()
|
||||
1
|
||||
select * from t2;
|
||||
k a c
|
||||
1 6 1
|
||||
2 7 NULL
|
||||
insert ignore into t2 values (null,6,1),(10,8,1);
|
||||
select last_insert_id();
|
||||
last_insert_id()
|
||||
1
|
||||
insert ignore into t2 values (null,6,1),(null,8,1),(null,15,1),(null,20,1);
|
||||
select last_insert_id();
|
||||
last_insert_id()
|
||||
11
|
||||
select * from t2;
|
||||
k a c
|
||||
1 6 1
|
||||
2 7 NULL
|
||||
10 8 1
|
||||
11 15 1
|
||||
12 20 1
|
||||
drop table t2;
|
||||
create table t1 (a int primary key auto_increment, b int, c int, d timestamp default current_timestamp, unique(b),unique(c));
|
||||
insert into t1 values(null,1,1,now());
|
||||
insert into t1 values(null,0,0,null);
|
||||
|
|
|
@ -42,3 +42,10 @@ CHAR(31) = '' '' = CHAR(31)
|
|||
SELECT CHAR(30) = '', '' = CHAR(30);
|
||||
CHAR(30) = '' '' = CHAR(30)
|
||||
0 0
|
||||
create table t1 (a tinyint(1),b binary(1));
|
||||
insert into t1 values (0x01,0x01);
|
||||
select * from t1 where a=b;
|
||||
a b
|
||||
select * from t1 where a=b and b=0x01;
|
||||
a b
|
||||
drop table if exists t1;
|
||||
|
|
|
@ -5195,3 +5195,13 @@ select * from t1 where i between 2 and 4 and v in ('def','3r4f','lmn');
|
|||
i v
|
||||
4 3r4f
|
||||
drop table t1;
|
||||
create table bug15205 (val int(11) default null) engine=csv;
|
||||
create table bug15205_2 (val int(11) default null) engine=csv;
|
||||
select * from bug15205;
|
||||
ERROR HY000: Can't get stat of './test/bug15205.CSV' (Errcode: 2)
|
||||
select * from bug15205_2;
|
||||
val
|
||||
select * from bug15205;
|
||||
val
|
||||
drop table bug15205;
|
||||
drop table bug15205_2;
|
||||
|
|
|
@ -248,3 +248,14 @@ select rpad(c1,3,'
|
|||
rpad(c1,3,'ö') rpad('ö',3,c1)
|
||||
ßöö ößß
|
||||
drop table t1;
|
||||
set names koi8r;
|
||||
create table t1(a char character set cp1251 default _koi8r 0xFF);
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` char(1) CHARACTER SET cp1251 DEFAULT '˙'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1(a char character set latin1 default _cp1251 0xFF);
|
||||
ERROR 42000: Invalid default value for 'a'
|
||||
End of 4.1 tests
|
||||
|
|
|
@ -730,6 +730,45 @@ id MIN(s)
|
|||
1 ZZZ
|
||||
2 ZZZ
|
||||
DROP TABLE t1;
|
||||
drop table if exists bug20536;
|
||||
set names latin1;
|
||||
create table bug20536 (id bigint not null auto_increment primary key, name
|
||||
varchar(255) character set ucs2 not null);
|
||||
insert into `bug20536` (`id`,`name`) values (1, _latin1 x'7465737431'), (2, "'test\\_2'");
|
||||
select md5(name) from bug20536;
|
||||
md5(name)
|
||||
f4b7ce8b45a20e3c4e84bef515d1525c
|
||||
48d95db0d8305c2fe11548a3635c9385
|
||||
select sha1(name) from bug20536;
|
||||
sha1(name)
|
||||
e0b52f38deddb9f9e8d5336b153592794cb49baf
|
||||
677d4d505355eb5b0549b865fcae4b7f0c28aef5
|
||||
select make_set(3, name, upper(name)) from bug20536;
|
||||
make_set(3, name, upper(name))
|
||||
test1,TEST1
|
||||
'test\_2','TEST\_2'
|
||||
select export_set(5, name, upper(name)) from bug20536;
|
||||
export_set(5, name, upper(name))
|
||||
test1,TEST1,test1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1,TEST1
|
||||
'test\_2','TEST\_2','test\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2','TEST\_2'
|
||||
select export_set(5, name, upper(name), ",", 5) from bug20536;
|
||||
export_set(5, name, upper(name), ",", 5)
|
||||
test1,TEST1,test1,TEST1,TEST1
|
||||
'test\_2','TEST\_2','test\_2','TEST\_2','TEST\_2'
|
||||
select password(name) from bug20536;
|
||||
password(name)
|
||||
????????????????????
|
||||
????????????????????
|
||||
select old_password(name) from bug20536;
|
||||
old_password(name)
|
||||
????????
|
||||
????????
|
||||
select quote(name) from bug20536;
|
||||
quote(name)
|
||||
????????
|
||||
????????????????
|
||||
drop table bug20536;
|
||||
End of 4.1 tests
|
||||
CREATE TABLE t1 (a varchar(64) character set ucs2, b decimal(10,3));
|
||||
INSERT INTO t1 VALUES ("1.1", 0), ("2.1", 0);
|
||||
update t1 set b=a;
|
||||
|
@ -765,3 +804,4 @@ blob 65535 65535
|
|||
text 65535 65535
|
||||
text 65535 32767
|
||||
drop table t1;
|
||||
End of 5.0 tests
|
||||
|
|
|
@ -924,6 +924,37 @@ NULL
|
|||
select ifnull(NULL, _utf8'string');
|
||||
ifnull(NULL, _utf8'string')
|
||||
string
|
||||
set names utf8;
|
||||
create table t1 (s1 char(5) character set utf8 collate utf8_lithuanian_ci);
|
||||
insert into t1 values ('I'),('K'),('Y');
|
||||
select * from t1 where s1 < 'K' and s1 = 'Y';
|
||||
s1
|
||||
I
|
||||
Y
|
||||
select * from t1 where 'K' > s1 and s1 = 'Y';
|
||||
s1
|
||||
I
|
||||
Y
|
||||
drop table t1;
|
||||
create table t1 (s1 char(5) character set utf8 collate utf8_czech_ci);
|
||||
insert into t1 values ('c'),('d'),('h'),('ch'),('CH'),('cH'),('Ch'),('i');
|
||||
select * from t1 where s1 > 'd' and s1 = 'CH';
|
||||
s1
|
||||
ch
|
||||
CH
|
||||
Ch
|
||||
select * from t1 where 'd' < s1 and s1 = 'CH';
|
||||
s1
|
||||
ch
|
||||
CH
|
||||
Ch
|
||||
select * from t1 where s1 = 'cH' and s1 <> 'ch';
|
||||
s1
|
||||
cH
|
||||
select * from t1 where 'cH' = s1 and s1 <> 'ch';
|
||||
s1
|
||||
cH
|
||||
drop table t1;
|
||||
create table t1 (a varchar(255)) default character set utf8;
|
||||
insert into t1 values (1.0);
|
||||
drop table t1;
|
||||
|
@ -1309,6 +1340,19 @@ select a from t1 group by a;
|
|||
a
|
||||
e
|
||||
drop table t1;
|
||||
set names utf8;
|
||||
grant select on test.* to юзер_юзер@localhost;
|
||||
user()
|
||||
юзер_юзер@localhost
|
||||
revoke all on test.* from юзер_юзер@localhost;
|
||||
drop user юзер_юзер@localhost;
|
||||
create database имя_базы_в_кодировке_утф8_длиной_больше_чем_45;
|
||||
use имя_базы_в_кодировке_утф8_длиной_больше_чем_45;
|
||||
select database();
|
||||
database()
|
||||
имя_базы_в_кодировке_утф8_длиной_больше_чем_45
|
||||
drop database имя_базы_в_кодировке_утф8_длиной_больше_чем_45;
|
||||
use test;
|
||||
CREATE TABLE t1(id varchar(20) NOT NULL) DEFAULT CHARSET=utf8;
|
||||
INSERT INTO t1 VALUES ('xxx'), ('aa'), ('yyy'), ('aa');
|
||||
SELECT id FROM t1;
|
||||
|
|
|
@ -563,6 +563,17 @@ id IFNULL(dsc, '-')
|
|||
2 line number two
|
||||
3 line number three
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (a int primary key, b int);
|
||||
INSERT INTO t1 (a,b) values (1,1), (2,3), (3,2);
|
||||
explain SELECT DISTINCT a, b FROM t1 ORDER BY b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using filesort
|
||||
SELECT DISTINCT a, b FROM t1 ORDER BY b;
|
||||
a b
|
||||
1 1
|
||||
3 2
|
||||
2 3
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (
|
||||
ID int(11) NOT NULL auto_increment,
|
||||
x varchar(20) default NULL,
|
||||
|
|
|
@ -74,3 +74,16 @@ show tables;
|
|||
Tables_in_test
|
||||
t1
|
||||
drop table t1;
|
||||
drop database if exists mysqltest;
|
||||
drop table if exists t1;
|
||||
create table t1 (i int);
|
||||
lock tables t1 read;
|
||||
create database mysqltest;
|
||||
drop table t1;
|
||||
show open tables;
|
||||
drop database mysqltest;
|
||||
select 1;
|
||||
1
|
||||
1
|
||||
unlock tables;
|
||||
End of 5.0 tests
|
||||
|
|
|
@ -17,13 +17,13 @@ db_x
|
|||
SHOW TABLES FROM db_x;
|
||||
Tables_in_db_x
|
||||
x_table
|
||||
SET GLOBAL event_scheduler=2;
|
||||
SET GLOBAL event_scheduler=off;
|
||||
DROP EVENT e_x1;
|
||||
DROP EVENT e_x2;
|
||||
DROP DATABASE db_x;
|
||||
DROP USER pauline@localhost;
|
||||
USE events_test;
|
||||
SET GLOBAL event_scheduler=2;
|
||||
SET GLOBAL event_scheduler=off;
|
||||
drop event if exists event1;
|
||||
Warnings:
|
||||
Note 1305 Event event1 does not exist
|
||||
|
@ -85,13 +85,24 @@ SHOW EVENTS;
|
|||
Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
|
||||
events_test event_starts_test root@localhost RECURRING NULL 20 SECOND # # ENABLED
|
||||
DROP EVENT event_starts_test;
|
||||
create table test_nested(a int);
|
||||
create event e_43 on schedule every 1 second do set @a = 5;
|
||||
set global event_scheduler = 1;
|
||||
alter event e_43 do alter event e_43 do set @a = 4;
|
||||
ERROR HY000: Recursivity of EVENT DDL statements is forbidden when body is present
|
||||
alter event e_43 do
|
||||
begin
|
||||
alter event e_43 on schedule every 5 minute;
|
||||
insert into test_nested values(1);
|
||||
end|
|
||||
set global event_scheduler = on;
|
||||
select db, name, body, status, interval_field, interval_value from mysql.event;
|
||||
db name body status interval_field interval_value
|
||||
events_test e_43 set @a = 4 ENABLED SECOND 1
|
||||
events_test e_43 begin
|
||||
alter event e_43 on schedule every 5 minute;
|
||||
insert into test_nested values(1);
|
||||
end ENABLED MINUTE 5
|
||||
drop event e_43;
|
||||
drop table test_nested;
|
||||
"Let's check whether we can use non-qualified names"
|
||||
create table non_qualif(a int);
|
||||
create event non_qualif_ev on schedule every 10 minute do insert into non_qualif values (800219);
|
||||
|
@ -100,7 +111,15 @@ a
|
|||
800219
|
||||
drop event non_qualif_ev;
|
||||
drop table non_qualif;
|
||||
set global event_scheduler = 2;
|
||||
alter event non_existant rename to non_existant_too;
|
||||
ERROR HY000: Unknown event 'non_existant'
|
||||
set global event_scheduler = off;
|
||||
create event existant on schedule at now() + interval 1 year do select 12;
|
||||
alter event non_existant rename to existant;
|
||||
ERROR HY000: Event 'existant' already exists
|
||||
alter event existant rename to events_test.existant;
|
||||
ERROR HY000: Same old and new event name
|
||||
drop event existant;
|
||||
create table t_event3 (a int, b float);
|
||||
drop event if exists event3;
|
||||
Warnings:
|
||||
|
@ -195,6 +214,10 @@ ERROR 42000: This version of MySQL doesn't yet support 'MICROSECOND'
|
|||
SHOW EVENTS;
|
||||
ERROR 42000: This version of MySQL doesn't yet support 'MICROSECOND'
|
||||
drop event root22;
|
||||
create event root23 on schedule every -100 year do select 1;
|
||||
ERROR HY000: INTERVAL is either not positive or too big
|
||||
create event root23 on schedule every 222222222222222222222 year do select 1;
|
||||
ERROR HY000: INTERVAL is either not positive or too big
|
||||
drop event root6;
|
||||
drop event root7;
|
||||
drop event root8;
|
||||
|
@ -285,19 +308,21 @@ select db, name, body, definer, convert_tz(execute_at, 'UTC', 'SYSTEM'), on_comp
|
|||
db name body definer convert_tz(execute_at, 'UTC', 'SYSTEM') on_completion
|
||||
events_test e_26 set @a = 5 root@localhost 2017-01-01 00:00:00 DROP
|
||||
drop event e_26;
|
||||
create event e_26 on schedule at NULL disabled do set @a = 5;
|
||||
create event e_26 on schedule at NULL disable do set @a = 5;
|
||||
ERROR HY000: Incorrect AT value: 'NULL'
|
||||
create event e_26 on schedule at 'definitely not a datetime' disabled do set @a = 5;
|
||||
create event e_26 on schedule at 'definitely not a datetime' disable do set @a = 5;
|
||||
ERROR HY000: Incorrect AT value: 'definitely not a datetime'
|
||||
set names utf8;
|
||||
create event задачка on schedule every 123 minute starts now() ends now() + interval 1 month do select 1;
|
||||
drop event задачка;
|
||||
set event_scheduler=2;
|
||||
set event_scheduler=off;
|
||||
ERROR HY000: Variable 'event_scheduler' is a GLOBAL variable and should be set with SET GLOBAL
|
||||
set global event_scheduler=3;
|
||||
ERROR 42000: Variable 'event_scheduler' can't be set to the value of '3'
|
||||
set global event_scheduler=disabled;
|
||||
ERROR 42000: Variable 'event_scheduler' can't be set to the value of 'disabled'
|
||||
"DISABLE the scheduler. Testing that it does not work when the variable is 0"
|
||||
set global event_scheduler=2;
|
||||
set global event_scheduler=off;
|
||||
select definer, name, db from mysql.event;
|
||||
definer name db
|
||||
select get_lock("test_lock1", 20);
|
||||
|
@ -309,9 +334,8 @@ select definer, name, db from mysql.event;
|
|||
definer name db
|
||||
root@localhost закачка events_test
|
||||
"Should be only 1 process"
|
||||
select /*1*/ user, host, db, command, state, 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, command, state, 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 command state info
|
||||
event_scheduler localhost NULL Connect Suspended NULL
|
||||
select release_lock("test_lock1");
|
||||
release_lock("test_lock1")
|
||||
1
|
||||
|
@ -321,7 +345,7 @@ select count(*) from mysql.event;
|
|||
count(*)
|
||||
0
|
||||
"ENABLE the scheduler and get a lock"
|
||||
set global event_scheduler=1;
|
||||
set global event_scheduler=on;
|
||||
select get_lock("test_lock2", 20);
|
||||
get_lock("test_lock2", 20)
|
||||
1
|
||||
|
@ -329,9 +353,9 @@ get_lock("test_lock2", 20)
|
|||
create event закачка on schedule every 10 hour do select get_lock("test_lock2", 20);
|
||||
"Let some time pass to the event starts"
|
||||
"Should have only 2 processes: the scheduler and the locked event"
|
||||
select /*2*/ user, host, db, command, state, info from information_schema.processlist where command!='Daemon' and (info is null or info not like '%processlist%') order by info;
|
||||
select /*2*/ user, host, db, command, state, 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 command state info
|
||||
event_scheduler localhost NULL Connect Sleeping NULL
|
||||
event_scheduler localhost NULL Daemon Waiting for next activation NULL
|
||||
root localhost events_test Connect User lock select get_lock("test_lock2", 20)
|
||||
"Release the mutex, the event worker should finish."
|
||||
"Release the mutex, the event worker should finish."
|
||||
|
@ -345,20 +369,19 @@ get_lock("test_lock2_1", 20)
|
|||
1
|
||||
create event закачка21 on schedule every 10 hour do select get_lock("test_lock2_1", 20);
|
||||
"Should have only 3 processes: the scheduler, our conn and the locked event"
|
||||
select /*3*/ user, host, db, command, state, info from information_schema.processlist where command!='Daemon' and (info is null or info not like '%processlist%') order by info;
|
||||
select /*3*/ user, host, db, command, state, 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 command state info
|
||||
event_scheduler localhost NULL Connect Sleeping NULL
|
||||
event_scheduler localhost NULL Daemon Waiting for next activation NULL
|
||||
root localhost events_test Connect User lock select get_lock("test_lock2_1", 20)
|
||||
set global event_scheduler=2;
|
||||
set global event_scheduler=off;
|
||||
"Should have only our process now:"
|
||||
select /*4*/ user, host, db, command, state, info from information_schema.processlist where command!='Daemon' and (info is null or info not like '%processlist%') order by info;
|
||||
select /*4*/ user, host, db, command, state, 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 command state info
|
||||
event_scheduler localhost NULL Connect Suspended NULL
|
||||
root localhost events_test Connect User lock select get_lock("test_lock2_1", 20)
|
||||
drop event закачка21;
|
||||
create table t_16 (s1 int);
|
||||
create trigger t_16_bi before insert on t_16 for each row create event e_16 on schedule every 1 second do set @a=5;
|
||||
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||
ERROR HY000: Recursivity of EVENT DDL statements is forbidden when body is present
|
||||
drop table t_16;
|
||||
create event white_space
|
||||
on schedule every 10 hour
|
||||
|
|
|
@ -17,28 +17,28 @@ DROP EVENT ДОЛЕН_регистър_утф8;
|
|||
SET NAMES latin1;
|
||||
set @a=3;
|
||||
CREATE PROCEDURE p_16 () CREATE EVENT e_16 ON SCHEDULE EVERY @a SECOND DO SET @a=5;
|
||||
call p_16();
|
||||
"Here we used to crash!"
|
||||
call p_16();
|
||||
ERROR HY000: Event 'e_16' already exists
|
||||
call p_16();
|
||||
ERROR HY000: Event 'e_16' already exists
|
||||
DROP EVENT e_16;
|
||||
CALL p_16();
|
||||
CALL p_16();
|
||||
ERROR HY000: Event 'e_16' already exists
|
||||
DROP PROCEDURE p_16;
|
||||
DROP EVENT e_16;
|
||||
ERROR HY000: Recursivity of EVENT DDL statements is forbidden when body is present
|
||||
create event e_55 on schedule at 99990101000000 do drop table t;
|
||||
ERROR HY000: Incorrect AT value: '99990101000000'
|
||||
create event e_55 on schedule every 10 hour starts 99990101000000 do drop table t;
|
||||
ERROR HY000: Incorrect STARTS value: '99990101000000'
|
||||
create event e_55 on schedule every 10 minute ends 99990101000000 do drop table t;
|
||||
ERROR HY000: ENDS is either invalid or before STARTS
|
||||
set global event_scheduler=2;
|
||||
"Wait a bit to settle down"
|
||||
create event e_55 on schedule at 10000101000000 do drop table t;
|
||||
ERROR HY000: Activation (AT) time is in the past
|
||||
create event e_55 on schedule at 20000101000000 do drop table t;
|
||||
ERROR HY000: Activation (AT) time is in the past
|
||||
create event e_55 on schedule at 20200101000000 starts 10000101000000 do drop table t;
|
||||
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 'starts 10000101000000 do drop table t' at line 1
|
||||
create event e_55 on schedule at 20200101000000 ends 10000101000000 do drop table t;
|
||||
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 'ends 10000101000000 do drop table t' at line 1
|
||||
create event e_55 on schedule at 20200101000000 starts 10000101000000 ends 10000101000000 do drop table t;
|
||||
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 'starts 10000101000000 ends 10000101000000 do drop table t' at line 1
|
||||
create event e_55 on schedule every 10 hour starts 10000101000000 do drop table t;
|
||||
ERROR HY000: Incorrect STARTS value: '10000101000000'
|
||||
set global event_scheduler=off;
|
||||
delete from mysql.event;
|
||||
set global event_scheduler= 1;
|
||||
set global event_scheduler= on;
|
||||
set @old_sql_mode:=@@sql_mode;
|
||||
set sql_mode=ansi;
|
||||
select get_lock('test_bug16407', 60);
|
||||
|
@ -50,14 +50,13 @@ select get_lock('test_bug16407', 60);
|
|||
drop table "hashed_num";
|
||||
end|
|
||||
"Now if everything is fine the event has compiled and is locked
|
||||
select /*1*/ user, host, db, command, state, info from information_schema.processlist where command!='Daemon' and (info is null or info not like '%processlist%') order by info;
|
||||
user host db command state info
|
||||
event_scheduler localhost NULL Connect Sleeping NULL
|
||||
root localhost events_test Connect User lock select get_lock('test_bug16407', 60)
|
||||
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;
|
||||
user host db info
|
||||
root localhost events_test select get_lock('test_bug16407', 60)
|
||||
select release_lock('test_bug16407');
|
||||
release_lock('test_bug16407')
|
||||
1
|
||||
set global event_scheduler= 2;
|
||||
set global event_scheduler= off;
|
||||
select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name;
|
||||
event_schema event_name sql_mode
|
||||
events_test e_16407 REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI
|
||||
|
@ -68,6 +67,11 @@ select event_schema, event_name, sql_mode from information_schema.events order b
|
|||
event_schema event_name sql_mode
|
||||
events_test e_16407 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
|
||||
drop event e_16407;
|
||||
set sql_mode="ansi";
|
||||
select get_lock('ee_16407_2', 60);
|
||||
get_lock('ee_16407_2', 60)
|
||||
1
|
||||
set global event_scheduler= 1;
|
||||
"Another sql_mode test"
|
||||
set sql_mode="traditional";
|
||||
create table events_smode_test(ev_name char(10), a date) engine=myisam;
|
||||
|
@ -75,6 +79,7 @@ create table events_smode_test(ev_name char(10), a date) engine=myisam;
|
|||
create event ee_16407_2 on schedule every 60 second do
|
||||
begin
|
||||
select get_lock('ee_16407_2', 60) /*ee_16407_2*/;
|
||||
select release_lock('ee_16407_2');
|
||||
insert into events_test.events_smode_test values('ee_16407_2','1980-19-02');
|
||||
end|
|
||||
insert into events_smode_test values ('test','1980-19-02')|
|
||||
|
@ -83,6 +88,7 @@ ERROR 22007: Incorrect date value: '1980-19-02' for column 'a' at row 1
|
|||
create event ee_16407_3 on schedule every 60 second do
|
||||
begin
|
||||
select get_lock('ee_16407_2', 60) /*ee_16407_3*/;
|
||||
select release_lock('ee_16407_2');
|
||||
insert into events_test.events_smode_test values ('ee_16407_3','1980-02-19');
|
||||
insert into events_test.events_smode_test values ('ee_16407_3','1980-02-29');
|
||||
end|
|
||||
|
@ -91,6 +97,7 @@ set sql_mode=""|
|
|||
create event ee_16407_4 on schedule every 60 second do
|
||||
begin
|
||||
select get_lock('ee_16407_2', 60) /*ee_16407_4*/;
|
||||
select release_lock('ee_16407_2');
|
||||
insert into events_test.events_smode_test values ('ee_16407_4','10-11-1956');
|
||||
end|
|
||||
select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name;
|
||||
|
@ -98,24 +105,19 @@ 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_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
|
||||
set sql_mode="ansi";
|
||||
select get_lock('ee_16407_2', 60);
|
||||
get_lock('ee_16407_2', 60)
|
||||
1
|
||||
set global event_scheduler= 1;
|
||||
select /*2*/ user, host, db, command, state, info from information_schema.processlist where command!='Daemon' and (info is null or info not like '%processlist%') order by info;
|
||||
user host db command state info
|
||||
event_scheduler localhost NULL Connect Sleeping NULL
|
||||
root localhost events_test Connect User lock select get_lock('ee_16407_2', 60)
|
||||
root localhost events_test Connect User lock select get_lock('ee_16407_2', 60)
|
||||
root localhost events_test Connect User lock select get_lock('ee_16407_2', 60)
|
||||
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;
|
||||
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)
|
||||
select release_lock('ee_16407_2');
|
||||
release_lock('ee_16407_2')
|
||||
1
|
||||
select /*3*/ user, host, db, command, state, info from information_schema.processlist where command!='Daemon' and (info is null or info not like '%processlist%') order by info;
|
||||
user host db command state info
|
||||
event_scheduler localhost NULL Connect Sleeping NULL
|
||||
set global event_scheduler= 2;
|
||||
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;
|
||||
user host db info
|
||||
event_scheduler localhost NULL NULL
|
||||
set global event_scheduler= off;
|
||||
select * from events_smode_test order by ev_name, a;
|
||||
ev_name a
|
||||
ee_16407_3 1980-02-19
|
||||
|
@ -132,37 +134,39 @@ drop event ee_16407_3;
|
|||
drop event ee_16407_4;
|
||||
"And now one last test regarding sql_mode and call of SP from an event"
|
||||
delete from events_smode_test;
|
||||
set sql_mode='ansi';
|
||||
select get_lock('ee_16407_5', 60);
|
||||
get_lock('ee_16407_5', 60)
|
||||
1
|
||||
set global event_scheduler= on;
|
||||
set sql_mode='traditional';
|
||||
create procedure ee_16407_5_pendant() begin insert into events_test.events_smode_test values('ee_16407_5','2001-02-29'); end|
|
||||
create procedure ee_16407_6_pendant() begin insert into events_test.events_smode_test values('ee_16407_6','2004-02-29'); end|
|
||||
create event ee_16407_5 on schedule every 60 second do
|
||||
begin
|
||||
select get_lock('ee_16407_5', 60) /*ee_16407_5*/;
|
||||
select release_lock('ee_16407_5');
|
||||
call events_test.ee_16407_5_pendant();
|
||||
end|
|
||||
create event ee_16407_6 on schedule every 60 second do
|
||||
begin
|
||||
select get_lock('ee_16407_5', 60) /*ee_16407_6*/;
|
||||
select release_lock('ee_16407_5');
|
||||
call events_test.ee_16407_6_pendant();
|
||||
end|
|
||||
set sql_mode='ansi';
|
||||
select get_lock('ee_16407_5', 60);
|
||||
get_lock('ee_16407_5', 60)
|
||||
1
|
||||
set global event_scheduler= 1;
|
||||
"Should have 2 locked processes"
|
||||
select /*4*/ user, host, db, command, state, info from information_schema.processlist where command!='Daemon' and (info is null or info not like '%processlist%') order by info;
|
||||
user host db command state info
|
||||
event_scheduler localhost NULL Connect Sleeping NULL
|
||||
root localhost events_test Connect User lock select get_lock('ee_16407_5', 60)
|
||||
root localhost events_test Connect User lock select get_lock('ee_16407_5', 60)
|
||||
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
|
||||
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)
|
||||
select release_lock('ee_16407_5');
|
||||
release_lock('ee_16407_5')
|
||||
1
|
||||
"Should have 0 processes locked"
|
||||
select /*5*/ user, host, db, command, state, info from information_schema.processlist where command!='Daemon' and (info is null or info not like '%processlist%') order by info;
|
||||
user host db command state info
|
||||
event_scheduler localhost NULL Connect Sleeping NULL
|
||||
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
|
||||
event_scheduler localhost NULL NULL
|
||||
select * from events_smode_test order by ev_name, a;
|
||||
ev_name a
|
||||
ee_16407_6 2004-02-29
|
||||
|
@ -175,10 +179,10 @@ drop event ee_16407_5;
|
|||
drop event ee_16407_6;
|
||||
drop procedure ee_16407_5_pendant;
|
||||
drop procedure ee_16407_6_pendant;
|
||||
set global event_scheduler= 2;
|
||||
set global event_scheduler= off;
|
||||
drop table events_smode_test;
|
||||
set sql_mode=@old_sql_mode;
|
||||
set global event_scheduler=2;
|
||||
set global event_scheduler=off;
|
||||
delete from mysql.user where User like 'mysqltest_%';
|
||||
delete from mysql.db where User like 'mysqltest_%';
|
||||
flush privileges;
|
||||
|
@ -201,4 +205,12 @@ events_test mysqltest_user1 mysqltest_user1@localhost RECURRING ENABLED
|
|||
drop event events_test.mysqltest_user1;
|
||||
drop user mysqltest_user1@localhost;
|
||||
drop database mysqltest_db1;
|
||||
create event e_53 on schedule at (select s1 from ttx) do drop table t;
|
||||
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 'select s1 from ttx) do drop table t' at line 1
|
||||
create event e_53 on schedule every (select s1 from ttx) second do drop table t;
|
||||
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 'select s1 from ttx) second do drop table t' at line 1
|
||||
create event e_53 on schedule every 5 second starts (select s1 from ttx) do drop table t;
|
||||
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 'select s1 from ttx) do drop table t' at line 1
|
||||
create event e_53 on schedule every 5 second ends (select s1 from ttx) do drop table t;
|
||||
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 'select s1 from ttx) do drop table t' at line 1
|
||||
drop database events_test;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
create database if not exists events_test;
|
||||
use events_test;
|
||||
CREATE DATABASE IF NOT EXISTS events_test;
|
||||
USE events_test;
|
||||
"We use procedure here because its statements won't be logged into the general log"
|
||||
"If we had used normal select that are logged in different ways depending on whether"
|
||||
"the test suite is run in normal mode or with --ps-protocol"
|
||||
|
@ -8,21 +8,24 @@ BEGIN
|
|||
SELECT user_host, argument FROM mysql.general_log WHERE argument LIKE '%alabala%';
|
||||
END|
|
||||
"Check General Query Log"
|
||||
SET GLOBAL event_scheduler=2;
|
||||
create event log_general on schedule every 1 minute do SELect 'alabala', sleep(3) from dual;
|
||||
CALL select_general_log();
|
||||
user_host argument
|
||||
USER_HOST CREATE procedure select_general_log()
|
||||
BEGIN
|
||||
SELECT user_host, argument FROM mysql.general_log WHERE argument LIKE '%alabala%';
|
||||
END
|
||||
SET GLOBAL event_scheduler=on;
|
||||
TRUNCATE mysql.general_log;
|
||||
"1 row, the current statement!"
|
||||
call select_general_log();
|
||||
user_host argument
|
||||
SET GLOBAL event_scheduler=1;
|
||||
CREATE EVENT log_general ON SCHEDULE EVERY 1 MINUTE DO SELECT 'alabala', SLEEP(1) FROM DUAL;
|
||||
"Wait the scheduler to start"
|
||||
"Should see 3 rows - the 'SELect' is in the middle. The other two are selects from general_log"
|
||||
call select_general_log();
|
||||
"Should see 2 rows - the 'SELECT' is in the middle. The other two are selects from general_log"
|
||||
CALL select_general_log();
|
||||
user_host argument
|
||||
USER_HOST SELect 'alabala', sleep(3) from dual
|
||||
USER_HOST CREATE EVENT log_general ON SCHEDULE EVERY 1 MINUTE DO SELECT 'alabala', SLEEP(1) FROM DUAL
|
||||
USER_HOST SELECT 'alabala', SLEEP(1) FROM DUAL
|
||||
DROP PROCEDURE select_general_log;
|
||||
DROP EVENT log_general;
|
||||
SET GLOBAL event_scheduler=2;
|
||||
SET GLOBAL event_scheduler=off;
|
||||
"Check slow query log"
|
||||
"Save the values"
|
||||
SET @old_global_long_query_time:=(select get_value());
|
||||
|
@ -52,19 +55,20 @@ TRUNCATE mysql.slow_log;
|
|||
CREATE TABLE slow_event_test (slo_val tinyint, val tinyint);
|
||||
SET SESSION long_query_time=1;
|
||||
"This won't go to the slow log"
|
||||
CREATE EVENT long_event ON SCHEDULE EVERY 1 MINUTE DO INSERT INTO slow_event_test SELECT @@long_query_time, SLEEP(3);
|
||||
SELECT * FROM slow_event_test;
|
||||
slo_val val
|
||||
SET GLOBAL event_scheduler=1;
|
||||
SET SESSION long_query_time=1;
|
||||
SET GLOBAL event_scheduler=on;
|
||||
CREATE EVENT long_event ON SCHEDULE EVERY 1 MINUTE DO INSERT INTO slow_event_test SELECT @@long_query_time, SLEEP(1.5);
|
||||
"Sleep some more time than the actual event run will take"
|
||||
SHOW VARIABLES LIKE 'event_scheduler';
|
||||
Variable_name Value
|
||||
event_scheduler 1
|
||||
event_scheduler ON
|
||||
"Check our table. Should see 1 row"
|
||||
SELECT * FROM slow_event_test;
|
||||
slo_val val
|
||||
4 0
|
||||
"Check slow log. Should not see anything because 3 is under the threshold of 4 for GLOBAL, though over SESSION which is 2"
|
||||
"Check slow log. Should not see anything because 1.5 is under the threshold of 300 for GLOBAL, though over SESSION which is 2"
|
||||
SELECT user_host, query_time, db, sql_text FROM mysql.slow_log;
|
||||
user_host query_time db sql_text
|
||||
"This should go to the slow log"
|
||||
|
@ -89,4 +93,4 @@ TRUNCATE mysql.slow_log;
|
|||
DROP TABLE slow_event_test;
|
||||
SET GLOBAL long_query_time =@old_global_long_query_time;
|
||||
SET SESSION long_query_time =@old_session_long_query_time;
|
||||
drop database events_test;
|
||||
DROP DATABASE events_test;
|
||||
|
|
12
mysql-test/r/events_restart_phase1.result
Normal file
12
mysql-test/r/events_restart_phase1.result
Normal file
|
@ -0,0 +1,12 @@
|
|||
create database if not exists mysqltest_events_test;
|
||||
use mysqltest_events_test;
|
||||
set global event_scheduler=off;
|
||||
create table execution_log(name char(10));
|
||||
create event abc1 on schedule every 1 second do insert into execution_log value('abc1');
|
||||
create event abc2 on schedule every 1 second do insert into execution_log value('abc2');
|
||||
create event abc3 on schedule every 1 second do insert into execution_log value('abc3');
|
||||
select name from execution_log;
|
||||
name
|
||||
insert into mysql.event values ('db1','bad','select 42','root@localhost',NULL,1000,'MICROSECOND','2006-05-05 17:39:11','2006-05-05 17:39:20','2016-05-05 15:39:24','2016-05-05 15:39:11',NULL,'ENABLED','DROP','','comment1');
|
||||
insert into mysql.event values ('db1','bad2','sect','root@localhost',NULL,1000,'SECOND','2006-05-05 17:39:11','2006-05-05 17:39:20','2016-05-05 15:39:24','2016-05-05 15:39:11',NULL,'ENABLED','DROP','','comment2');
|
||||
"Now we restart the server"
|
6
mysql-test/r/events_restart_phase2.result
Normal file
6
mysql-test/r/events_restart_phase2.result
Normal file
|
@ -0,0 +1,6 @@
|
|||
use mysqltest_events_test;
|
||||
"Should get 0 rows because the queue aborted run
|
||||
select distinct name from execution_log order by name;
|
||||
name
|
||||
delete from mysql.event where name like 'bad%';
|
||||
"Now restart the server again"
|
12
mysql-test/r/events_restart_phase3.result
Normal file
12
mysql-test/r/events_restart_phase3.result
Normal file
|
@ -0,0 +1,12 @@
|
|||
use mysqltest_events_test;
|
||||
"Should get 3 rows : abc1, abc2, abc3
|
||||
select distinct name from execution_log order by name;
|
||||
name
|
||||
abc1
|
||||
abc2
|
||||
abc3
|
||||
drop event abc1;
|
||||
drop event abc2;
|
||||
drop event abc3;
|
||||
drop table execution_log;
|
||||
drop database mysqltest_events_test;
|
|
@ -1,12 +1,47 @@
|
|||
CREATE DATABASE IF NOT EXISTS events_test;
|
||||
USE events_test;
|
||||
SET GLOBAL event_scheduler=OFF;
|
||||
SHOW VARIABLES LIKE 'event_scheduler';
|
||||
Variable_name Value
|
||||
event_scheduler OFF
|
||||
SET GLOBAL event_scheduler=1;
|
||||
SHOW VARIABLES LIKE 'event_scheduler';
|
||||
Variable_name Value
|
||||
event_scheduler ON
|
||||
SET GLOBAL event_scheduler=0;
|
||||
SHOW VARIABLES LIKE 'event_scheduler';
|
||||
Variable_name Value
|
||||
event_scheduler OFF
|
||||
SET GLOBAL event_scheduler=ON;
|
||||
SHOW VARIABLES LIKE 'event_scheduler';
|
||||
Variable_name Value
|
||||
event_scheduler ON
|
||||
SET GLOBAL event_scheduler=DISABLED;
|
||||
ERROR 42000: Variable 'event_scheduler' can't be set to the value of 'DISABLED'
|
||||
SHOW VARIABLES LIKE 'event_scheduler';
|
||||
Variable_name Value
|
||||
event_scheduler ON
|
||||
SET GLOBAL event_scheduler=-1;
|
||||
ERROR 42000: Variable 'event_scheduler' can't be set to the value of '-1'
|
||||
SHOW VARIABLES LIKE 'event_scheduler';
|
||||
Variable_name Value
|
||||
event_scheduler ON
|
||||
SET GLOBAL event_scheduler=2;
|
||||
ERROR 42000: Variable 'event_scheduler' can't be set to the value of '2'
|
||||
SHOW VARIABLES LIKE 'event_scheduler';
|
||||
Variable_name Value
|
||||
event_scheduler ON
|
||||
SET GLOBAL event_scheduler=5;
|
||||
ERROR 42000: Variable 'event_scheduler' can't be set to the value of '5'
|
||||
SHOW VARIABLES LIKE 'event_scheduler';
|
||||
Variable_name Value
|
||||
event_scheduler ON
|
||||
CREATE TABLE table_1(a int);
|
||||
CREATE TABLE table_2(a int);
|
||||
CREATE TABLE table_3(a int);
|
||||
CREATE TABLE table_4(a int);
|
||||
CREATE TABLE T19170(s1 TIMESTAMP);
|
||||
SET GLOBAL event_scheduler=1;
|
||||
CREATE EVENT E19170 ON SCHEDULE EVERY 2 SECOND DO INSERT INTO T19170 VALUES(CURRENT_TIMESTAMP);
|
||||
SET GLOBAL event_scheduler=ON;
|
||||
CREATE EVENT two_sec ON SCHEDULE EVERY 2 SECOND DO INSERT INTO table_1 VALUES(1);
|
||||
CREATE EVENT start_n_end
|
||||
ON SCHEDULE EVERY 1 SECOND
|
||||
|
@ -39,17 +74,12 @@ DROP EVENT start_n_end;
|
|||
DROP EVENT only_one_time;
|
||||
ERROR HY000: Unknown event 'only_one_time'
|
||||
"Should be preserved"
|
||||
SELECT EVENT_NAME, STATUS FROM INFORMATION_SCHEMA.EVENTS;
|
||||
SELECT EVENT_NAME, STATUS FROM INFORMATION_SCHEMA.EVENTS ORDER BY EVENT_NAME;
|
||||
EVENT_NAME STATUS
|
||||
E19170 ENABLED
|
||||
two_time DISABLED
|
||||
DROP EVENT two_time;
|
||||
DROP TABLE table_1;
|
||||
DROP TABLE table_2;
|
||||
DROP TABLE table_3;
|
||||
DROP TABLE table_4;
|
||||
"Checking for multiple executions in one second, should not happen -> 0 as result"
|
||||
SELECT COUNT(*) FROM (SELECT s1, COUNT(*) AS cnt FROM T19170 GROUP BY s1) AS tmp WHERE tmp.cnt > 1;
|
||||
COUNT(*)
|
||||
0
|
||||
DROP DATABASE events_test;
|
||||
|
|
|
@ -32,15 +32,15 @@ USE events_conn1_test2;
|
|||
SELECT COUNT(*) FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA='events_conn1_test2';
|
||||
COUNT(*)
|
||||
50
|
||||
SET GLOBAL event_scheduler=1;
|
||||
SET GLOBAL event_scheduler=on;
|
||||
DROP DATABASE events_conn1_test2;
|
||||
SET GLOBAL event_scheduler=2;
|
||||
SET GLOBAL event_scheduler=off;
|
||||
SELECT COUNT(*) FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA='events_conn1_test2';
|
||||
COUNT(*)
|
||||
0
|
||||
CREATE DATABASE events_conn1_test3;
|
||||
USE events_conn1_test3;
|
||||
SET GLOBAL event_scheduler=1;
|
||||
SET GLOBAL event_scheduler=on;
|
||||
SELECT COUNT(*) FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA='events_conn1_test3';
|
||||
COUNT(*)
|
||||
50
|
||||
|
@ -55,9 +55,9 @@ DROP DATABASE events_conn2_db;
|
|||
DROP DATABASE events_conn3_db;
|
||||
DROP DATABASE events_conn1_test2;
|
||||
DROP DATABASE events_conn1_test3;
|
||||
SET GLOBAL event_scheduler=2;
|
||||
SET GLOBAL event_scheduler=off;
|
||||
DROP DATABASE events_conn1_test4;
|
||||
SET GLOBAL event_scheduler=1;
|
||||
SET GLOBAL event_scheduler=on;
|
||||
USE events_test;
|
||||
DROP TABLE fill_it1;
|
||||
DROP TABLE fill_it2;
|
||||
|
|
|
@ -87,6 +87,10 @@ SELECT IS_USED_LOCK('bug16501');
|
|||
IS_USED_LOCK('bug16501')
|
||||
NULL
|
||||
DROP TABLE t1;
|
||||
select export_set(3, _latin1'foo', _utf8'bar', ',', 4);
|
||||
export_set(3, _latin1'foo', _utf8'bar', ',', 4)
|
||||
foo,foo,bar,bar
|
||||
End of 4.1 tests
|
||||
create table t1 as select uuid(), length(uuid());
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
|
@ -130,3 +134,4 @@ timediff(b, a) >= '00:00:03'
|
|||
drop table t2;
|
||||
drop table t1;
|
||||
set global query_cache_size=default;
|
||||
End of 5.0 tests
|
||||
|
|
|
@ -911,6 +911,18 @@ union
|
|||
(select time_format(timediff(now(), DATE_SUB(now(),INTERVAL 5 HOUR)),'%k') As H);
|
||||
H
|
||||
5
|
||||
SET NAMES latin1;
|
||||
SET character_set_results = NULL;
|
||||
SHOW VARIABLES LIKE 'character_set_results';
|
||||
Variable_name Value
|
||||
character_set_results
|
||||
CREATE TABLE testBug8868 (field1 DATE, field2 VARCHAR(32) CHARACTER SET BINARY);
|
||||
INSERT INTO testBug8868 VALUES ('2006-09-04', 'abcd');
|
||||
SELECT DATE_FORMAT(field1,'%b-%e %l:%i%p') as fmtddate, field2 FROM testBug8868;
|
||||
fmtddate field2
|
||||
Sep-4 12:00AM abcd
|
||||
DROP TABLE testBug8868;
|
||||
SET NAMES DEFAULT;
|
||||
End of 4.1 tests
|
||||
explain extended select timestampdiff(SQL_TSI_WEEK, '2001-02-01', '2001-05-01') as a1,
|
||||
timestampdiff(SQL_TSI_FRAC_SECOND, '2001-02-01 12:59:59.120000', '2001-05-01 12:58:58.119999') as a2;
|
||||
|
|
|
@ -945,6 +945,31 @@ DROP TABLE mysqltest3.t_nn;
|
|||
DROP DATABASE mysqltest3;
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'mysqltest_1'@'localhost';
|
||||
DROP USER 'mysqltest_1'@'localhost';
|
||||
use test;
|
||||
create user mysqltest1_thisisreallytoolong;
|
||||
ERROR HY000: Operation CREATE USER failed for 'mysqltest1_thisisreallytoolong'@'%'
|
||||
ERROR HY000: String 'mysqltest1_thisisreallytoolong' is too long for user name (should be no longer than 16)
|
||||
GRANT CREATE ON mysqltest.* TO 1234567890abcdefGHIKL@localhost;
|
||||
ERROR HY000: String '1234567890abcdefGHIKL' is too long for user name (should be no longer than 16)
|
||||
GRANT CREATE ON mysqltest.* TO some_user_name@1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY;
|
||||
ERROR HY000: String '1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY' is too long for host name (should be no longer than 60)
|
||||
REVOKE CREATE ON mysqltest.* FROM 1234567890abcdefGHIKL@localhost;
|
||||
ERROR HY000: String '1234567890abcdefGHIKL' is too long for user name (should be no longer than 16)
|
||||
REVOKE CREATE ON mysqltest.* FROM some_user_name@1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY;
|
||||
ERROR HY000: String '1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY' is too long for host name (should be no longer than 60)
|
||||
GRANT CREATE ON t1 TO 1234567890abcdefGHIKL@localhost;
|
||||
ERROR HY000: String '1234567890abcdefGHIKL' is too long for user name (should be no longer than 16)
|
||||
GRANT CREATE ON t1 TO some_user_name@1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY;
|
||||
ERROR HY000: String '1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY' is too long for host name (should be no longer than 60)
|
||||
REVOKE CREATE ON t1 FROM 1234567890abcdefGHIKL@localhost;
|
||||
ERROR HY000: String '1234567890abcdefGHIKL' is too long for user name (should be no longer than 16)
|
||||
REVOKE CREATE ON t1 FROM some_user_name@1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY;
|
||||
ERROR HY000: String '1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY' is too long for host name (should be no longer than 60)
|
||||
GRANT EXECUTE ON PROCEDURE p1 TO 1234567890abcdefGHIKL@localhost;
|
||||
ERROR HY000: String '1234567890abcdefGHIKL' is too long for user name (should be no longer than 16)
|
||||
GRANT EXECUTE ON PROCEDURE p1 TO some_user_name@1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY;
|
||||
ERROR HY000: String '1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY' is too long for host name (should be no longer than 60)
|
||||
REVOKE EXECUTE ON PROCEDURE p1 FROM 1234567890abcdefGHIKL@localhost;
|
||||
ERROR HY000: String '1234567890abcdefGHIKL' is too long for user name (should be no longer than 16)
|
||||
REVOKE EXECUTE ON PROCEDURE t1 FROM some_user_name@1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY;
|
||||
ERROR HY000: String '1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY' is too long for host name (should be no longer than 60)
|
||||
End of 5.0 tests
|
||||
|
|
|
@ -821,3 +821,12 @@ a b real_b
|
|||
68 France France
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE t1 (a INT, b INT, KEY(a));
|
||||
INSERT INTO t1 VALUES (1, 1), (2, 2), (3,3), (4,4);
|
||||
EXPLAIN SELECT a, SUM(b) FROM t1 GROUP BY a LIMIT 2;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index NULL a 5 NULL 4
|
||||
EXPLAIN SELECT a, SUM(b) FROM t1 IGNORE INDEX (a) GROUP BY a LIMIT 2;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using temporary; Using filesort
|
||||
DROP TABLE t1;
|
||||
|
|
2
mysql-test/r/have_ndbapi_examples.require
Normal file
2
mysql-test/r/have_ndbapi_examples.require
Normal file
|
@ -0,0 +1,2 @@
|
|||
have_ndb_example
|
||||
1
|
|
@ -294,3 +294,4 @@ DROP TABLE t1;
|
|||
CREATE TABLE t1 (a INT, UNIQUE USING BTREE(a)) ENGINE=MEMORY;
|
||||
INSERT INTO t1 VALUES(NULL),(NULL);
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
SHOW VARIABLES LIKE 'server_id';
|
||||
Variable_name Value
|
||||
server_id 1
|
||||
SHOW INSTANCES;
|
||||
instance_name state
|
||||
mysqld1 starting
|
||||
mysqld2 offline
|
||||
--> Listing users...
|
||||
im_admin
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
Success: the process has been started.
|
||||
SHOW VARIABLES LIKE 'server_id';
|
||||
Variable_name Value
|
||||
server_id 1
|
||||
|
|
|
@ -1,18 +1,14 @@
|
|||
--------------------------------------------------------------------
|
||||
server_id = 1
|
||||
server_id = 2
|
||||
--------------------------------------------------------------------
|
||||
SHOW VARIABLES LIKE 'server_id';
|
||||
Variable_name Value
|
||||
server_id 1
|
||||
SHOW INSTANCES;
|
||||
instance_name state
|
||||
mysqld1 online
|
||||
mysqld2 offline
|
||||
|
||||
---> connection: mysql1_con
|
||||
SHOW VARIABLES LIKE 'server_id';
|
||||
Variable_name Value
|
||||
server_id 1
|
||||
|
||||
---> connection: default
|
||||
--------------------------------------------------------------------
|
||||
server_id = 1
|
||||
server_id = 2
|
||||
--------------------------------------------------------------------
|
||||
CREATE INSTANCE mysqld3
|
||||
server_id = 3,
|
||||
socket = "$MYSQL_TMP_DIR/mysqld_3.sock";
|
||||
|
@ -71,6 +67,7 @@ test-B=test
|
|||
--------------------------------------------------------------------
|
||||
--------------------------------------------------------------------
|
||||
--------------------------------------------------------------------
|
||||
--------------------------------------------------------------------
|
||||
CREATE INSTANCE mysqld6
|
||||
test-C1 = 10 ,
|
||||
test-C2 = 02 ,
|
||||
|
@ -130,6 +127,9 @@ mysqld4 offline
|
|||
--------------------------------------------------------------------
|
||||
--------------------------------------------------------------------
|
||||
--------------------------------------------------------------------
|
||||
--------------------------------------------------------------------
|
||||
--------------------------------------------------------------------
|
||||
--------------------------------------------------------------------
|
||||
CREATE INSTANCE mysqld9
|
||||
test-1=" hello world ",
|
||||
test-2=' ',
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
Success: the process has been started.
|
||||
SHOW VARIABLES LIKE 'server_id';
|
||||
Variable_name Value
|
||||
server_id 1
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
Success: the process has been started.
|
||||
SHOW VARIABLES LIKE 'server_id';
|
||||
Variable_name Value
|
||||
server_id 1
|
||||
|
|
|
@ -282,3 +282,43 @@ kp1='279' AND kp2='ELM0678' AND kp3='6' AND kp4='10' AND kp5 = 'R ';
|
|||
COUNT(*)
|
||||
1
|
||||
drop table t1;
|
||||
create table t1
|
||||
(
|
||||
key1 int not null,
|
||||
key2 int not null default 0,
|
||||
key3 int not null default 0
|
||||
);
|
||||
insert into t1(key1) values (1),(2),(3),(4),(5),(6),(7),(8);
|
||||
set @d=8;
|
||||
insert into t1 (key1) select key1+@d from t1;
|
||||
set @d=@d*2;
|
||||
insert into t1 (key1) select key1+@d from t1;
|
||||
set @d=@d*2;
|
||||
insert into t1 (key1) select key1+@d from t1;
|
||||
set @d=@d*2;
|
||||
insert into t1 (key1) select key1+@d from t1;
|
||||
set @d=@d*2;
|
||||
insert into t1 (key1) select key1+@d from t1;
|
||||
set @d=@d*2;
|
||||
insert into t1 (key1) select key1+@d from t1;
|
||||
set @d=@d*2;
|
||||
insert into t1 (key1) select key1+@d from t1;
|
||||
set @d=@d*2;
|
||||
alter table t1 add index i2(key2);
|
||||
alter table t1 add index i3(key3);
|
||||
update t1 set key2=key1,key3=key1;
|
||||
explain select * from t1 where (key3 > 30 and key3<35) or (key2 >32 and key2 < 40);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index_merge i2,i3 i3,i2 4,4 NULL 11 Using sort_union(i3,i2); Using where
|
||||
select * from t1 where (key3 > 30 and key3<35) or (key2 >32 and key2 < 40);
|
||||
key1 key2 key3
|
||||
31 31 31
|
||||
32 32 32
|
||||
33 33 33
|
||||
34 34 34
|
||||
35 35 35
|
||||
36 36 36
|
||||
37 37 37
|
||||
38 38 38
|
||||
39 39 39
|
||||
drop table t1;
|
||||
|
|
|
@ -1295,24 +1295,16 @@ insert into t2 (a) select b from t1;
|
|||
insert into t1 (a) select b from t2;
|
||||
insert into t2 (a) select b from t1;
|
||||
insert into t1 (a) select b from t2;
|
||||
insert into t2 (a) select b from t1;
|
||||
insert into t1 (a) select b from t2;
|
||||
insert into t2 (a) select b from t1;
|
||||
insert into t1 (a) select b from t2;
|
||||
insert into t2 (a) select b from t1;
|
||||
insert into t1 (a) select b from t2;
|
||||
insert into t2 (a) select b from t1;
|
||||
insert into t1 (a) select b from t2;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
29267
|
||||
623
|
||||
explain select * from t1 where c between 1 and 2500;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range c c 5 NULL # Using where
|
||||
update t1 set c=a;
|
||||
explain select * from t1 where c between 1 and 2500;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range c c 5 NULL # Using where
|
||||
1 SIMPLE t1 ALL c NULL NULL NULL # Using where
|
||||
drop table t1,t2;
|
||||
create table t1 (id int primary key auto_increment, fk int, index index_fk (fk)) engine=innodb;
|
||||
insert into t1 (id) values (null),(null),(null),(null),(null);
|
||||
|
@ -1786,10 +1778,10 @@ Variable_name Value
|
|||
Innodb_rows_deleted 2070
|
||||
show status like "Innodb_rows_inserted";
|
||||
Variable_name Value
|
||||
Innodb_rows_inserted 31727
|
||||
Innodb_rows_inserted 3083
|
||||
show status like "Innodb_rows_updated";
|
||||
Variable_name Value
|
||||
Innodb_rows_updated 29530
|
||||
Innodb_rows_updated 886
|
||||
show status like "Innodb_row_lock_waits";
|
||||
Variable_name Value
|
||||
Innodb_row_lock_waits 0
|
||||
|
|
|
@ -89,6 +89,27 @@ b a
|
|||
3 3
|
||||
3 3
|
||||
DROP TABLE t1, t2, t3;
|
||||
CREATE TABLE `t1` (`id1` INT) ;
|
||||
INSERT INTO `t1` (`id1`) VALUES (1),(5),(2);
|
||||
CREATE TABLE `t2` (
|
||||
`id1` INT,
|
||||
`id2` INT NOT NULL,
|
||||
`id3` INT,
|
||||
`id4` INT NOT NULL,
|
||||
UNIQUE (`id2`,`id4`),
|
||||
KEY (`id1`)
|
||||
) ENGINE=InnoDB;
|
||||
INSERT INTO `t2`(`id1`,`id2`,`id3`,`id4`) VALUES
|
||||
(1,1,1,0),
|
||||
(1,1,2,1),
|
||||
(5,1,2,2),
|
||||
(6,1,2,3),
|
||||
(1,2,2,2),
|
||||
(1,2,1,1);
|
||||
SELECT `id1` FROM `t1` WHERE `id1` NOT IN (SELECT `id1` FROM `t2` WHERE `id2` = 1 AND `id3` = 2);
|
||||
id1
|
||||
2
|
||||
DROP TABLE t1, t2;
|
||||
create table t1m (a int) engine=myisam;
|
||||
create table t1i (a int) engine=innodb;
|
||||
create table t2m (a int) engine=myisam;
|
||||
|
@ -303,6 +324,25 @@ explain select distinct f1, f2 from t1;
|
|||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range NULL PRIMARY 5 NULL 3 Using index for group-by; Using temporary
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (id int(11) NOT NULL PRIMARY KEY, name varchar(20),
|
||||
INDEX (name)) ENGINE=InnoDB;
|
||||
CREATE TABLE t2 (id int(11) NOT NULL PRIMARY KEY, fkey int(11),
|
||||
FOREIGN KEY (fkey) REFERENCES t2(id)) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES (1,'A1'),(2,'A2'),(3,'B');
|
||||
INSERT INTO t2 VALUES (1,1),(2,2),(3,2),(4,3),(5,3);
|
||||
EXPLAIN
|
||||
SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id
|
||||
WHERE t1.name LIKE 'A%';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 index PRIMARY,name name 23 NULL 3 Using where; Using index
|
||||
1 SIMPLE t2 ref fkey fkey 5 test.t1.id 1 Using where; Using index
|
||||
EXPLAIN
|
||||
SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id
|
||||
WHERE t1.name LIKE 'A%' OR FALSE;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 index NULL fkey 5 NULL 5 Using index
|
||||
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.fkey 1 Using where
|
||||
DROP TABLE t1,t2;
|
||||
set storage_engine=innodb;
|
||||
CREATE TABLE t1 (a int, b int);
|
||||
insert into t1 values (1,1),(1,2);
|
||||
|
@ -367,3 +407,71 @@ Warnings:
|
|||
Warning 1071 Specified key was too long; max key length is 765 bytes
|
||||
insert into t1 values('aaa');
|
||||
drop table t1;
|
||||
CREATE TABLE `t2` (
|
||||
`k` int(11) NOT NULL auto_increment,
|
||||
`a` int(11) default NULL,
|
||||
`c` int(11) default NULL,
|
||||
PRIMARY KEY (`k`),
|
||||
UNIQUE KEY `idx_1` (`a`)
|
||||
) ENGINE=InnoDB;
|
||||
insert into t2 ( a ) values ( 6 ) on duplicate key update c =
|
||||
ifnull( c,
|
||||
0 ) + 1;
|
||||
insert into t2 ( a ) values ( 7 ) on duplicate key update c =
|
||||
ifnull( c,
|
||||
0 ) + 1;
|
||||
select last_insert_id();
|
||||
last_insert_id()
|
||||
2
|
||||
select * from t2;
|
||||
k a c
|
||||
1 6 NULL
|
||||
2 7 NULL
|
||||
insert into t2 ( a ) values ( 6 ) on duplicate key update c =
|
||||
ifnull( c,
|
||||
0 ) + 1;
|
||||
select last_insert_id();
|
||||
last_insert_id()
|
||||
2
|
||||
select last_insert_id(0);
|
||||
last_insert_id(0)
|
||||
0
|
||||
insert into t2 ( a ) values ( 6 ) on duplicate key update c =
|
||||
ifnull( c,
|
||||
0 ) + 1;
|
||||
select last_insert_id();
|
||||
last_insert_id()
|
||||
0
|
||||
select * from t2;
|
||||
k a c
|
||||
1 6 2
|
||||
2 7 NULL
|
||||
insert ignore into t2 values (null,6,1),(10,8,1);
|
||||
select last_insert_id();
|
||||
last_insert_id()
|
||||
0
|
||||
insert ignore into t2 values (null,6,1),(null,8,1),(null,15,1),(null,20,1);
|
||||
select last_insert_id();
|
||||
last_insert_id()
|
||||
11
|
||||
select * from t2;
|
||||
k a c
|
||||
1 6 2
|
||||
2 7 NULL
|
||||
10 8 1
|
||||
11 15 1
|
||||
12 20 1
|
||||
insert into t2 ( a ) values ( 6 ) on duplicate key update c =
|
||||
ifnull( c,
|
||||
0 ) + 1, k=last_insert_id(k);
|
||||
select last_insert_id();
|
||||
last_insert_id()
|
||||
1
|
||||
select * from t2;
|
||||
k a c
|
||||
1 6 3
|
||||
2 7 NULL
|
||||
10 8 1
|
||||
11 15 1
|
||||
12 20 1
|
||||
drop table t2;
|
||||
|
|
|
@ -695,6 +695,16 @@ CREATE TABLE t2 (z int, y int);
|
|||
CREATE TABLE t3 (a int, b int);
|
||||
INSERT INTO t3 (SELECT x, y FROM t1 JOIN t2 USING (y) WHERE z = 1);
|
||||
DROP TABLE IF EXISTS t1,t2,t3;
|
||||
CREATE DATABASE bug21774_1;
|
||||
CREATE DATABASE bug21774_2;
|
||||
CREATE TABLE bug21774_1.t1(id VARCHAR(10) NOT NULL,label VARCHAR(255));
|
||||
CREATE TABLE bug21774_2.t1(id VARCHAR(10) NOT NULL,label VARCHAR(255));
|
||||
CREATE TABLE bug21774_1.t2(id VARCHAR(10) NOT NULL,label VARCHAR(255));
|
||||
INSERT INTO bug21774_2.t1 SELECT t1.* FROM bug21774_1.t1;
|
||||
use bug21774_1;
|
||||
INSERT INTO bug21774_2.t1 SELECT t1.* FROM t1;
|
||||
DROP DATABASE bug21774_1;
|
||||
DROP DATABASE bug21774_2;
|
||||
CREATE DATABASE meow;
|
||||
CREATE TABLE table_target ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
|
||||
CREATE TABLE table_target2 ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
|
||||
|
|
|
@ -737,7 +737,7 @@ explain select s.*, '*', m.*, (s.match_1_h - m.home) UUX from
|
|||
(t2 s left join t1 m on m.match_id = 1)
|
||||
order by m.match_id desc;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE s ALL NULL NULL NULL NULL 10
|
||||
1 SIMPLE s ALL NULL NULL NULL NULL 10 Using temporary; Using filesort
|
||||
1 SIMPLE m const match_id,match_id_2 match_id 1 const 1
|
||||
explain select s.*, '*', m.*, (s.match_1_h - m.home) UUX from
|
||||
(t2 s left join t1 m on m.match_id = 1)
|
||||
|
|
|
@ -76,3 +76,17 @@ a
|
|||
a
|
||||
1
|
||||
drop table t1;
|
||||
create table t1 (a int);
|
||||
insert into t1 values (1),(2),(3),(4),(5),(6),(7);
|
||||
explain select count(*) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using where; Using temporary
|
||||
select count(*) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3;
|
||||
c
|
||||
7
|
||||
explain select sum(a) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using where; Using temporary
|
||||
select sum(a) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3;
|
||||
c
|
||||
28
|
||||
|
|
21
mysql-test/r/loaddata_autocom_innodb.result
Normal file
21
mysql-test/r/loaddata_autocom_innodb.result
Normal file
|
@ -0,0 +1,21 @@
|
|||
SET SESSION STORAGE_ENGINE = InnoDB;
|
||||
drop table if exists t1;
|
||||
create table t1 (id int unsigned not null auto_increment primary key, a text, b text);
|
||||
start transaction;
|
||||
load data infile '../std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''' (a, b);
|
||||
Warnings:
|
||||
Warning 1261 Row 3 doesn't contain data for all columns
|
||||
commit;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
4
|
||||
truncate table t1;
|
||||
start transaction;
|
||||
load data infile '../std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''' (a, b);
|
||||
Warnings:
|
||||
Warning 1261 Row 3 doesn't contain data for all columns
|
||||
rollback;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
0
|
||||
drop table t1;
|
23
mysql-test/r/loaddata_autocom_ndb.result
Normal file
23
mysql-test/r/loaddata_autocom_ndb.result
Normal file
|
@ -0,0 +1,23 @@
|
|||
SET SESSION STORAGE_ENGINE = ndbcluster;
|
||||
drop table if exists t1;
|
||||
create table t1 (id int unsigned not null auto_increment primary key, a text, b text);
|
||||
start transaction;
|
||||
load data infile '../std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''' (a, b);
|
||||
Warnings:
|
||||
Warning 1261 Row 3 doesn't contain data for all columns
|
||||
commit;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
4
|
||||
truncate table t1;
|
||||
start transaction;
|
||||
load data infile '../std_data_ln/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''' (a, b);
|
||||
Warnings:
|
||||
Warning 1261 Row 3 doesn't contain data for all columns
|
||||
rollback;
|
||||
Warnings:
|
||||
Warning 1196 Some non-transactional changed tables couldn't be rolled back
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
4
|
||||
drop table t1;
|
|
@ -59,16 +59,16 @@ database()
|
|||
test
|
||||
unlock tables;
|
||||
drop table t1;
|
||||
ソ
|
||||
ソ
|
||||
ƒ\
|
||||
ƒ\
|
||||
c_cp932
|
||||
ƒ\
|
||||
ƒ\
|
||||
ƒ\
|
||||
ソ
|
||||
ソ
|
||||
ソ
|
||||
ソ
|
||||
ソ
|
||||
ソ
|
||||
ソ
|
||||
ƒ\
|
||||
ƒ\
|
||||
+----------------------+------------+--------+
|
||||
| concat('>',col1,'<') | col2 | col3 |
|
||||
+----------------------+------------+--------+
|
||||
|
@ -85,6 +85,12 @@ c_cp932
|
|||
| NULL | NULL | Τη γλώσσα |
|
||||
| NULL | NULL | ᛖᚴ ᚷᛖᛏ |
|
||||
+------+------+---------------------------+
|
||||
i j k
|
||||
NULL 1 NULL
|
||||
Field Type Null Key Default Extra
|
||||
i int(11) YES NULL
|
||||
j int(11) NO
|
||||
k int(11) YES NULL
|
||||
+------+---+------+
|
||||
| i | j | k |
|
||||
+------+---+------+
|
||||
|
@ -97,6 +103,10 @@ c_cp932
|
|||
| j | int(11) | NO | | | |
|
||||
| k | int(11) | YES | | NULL | |
|
||||
+-------+---------+------+-----+---------+-------+
|
||||
i s1
|
||||
1 x
|
||||
2 NULL
|
||||
3
|
||||
+------+------+
|
||||
| i | s1 |
|
||||
+------+------+
|
||||
|
@ -104,6 +114,13 @@ c_cp932
|
|||
| 2 | NULL |
|
||||
| 3 | |
|
||||
+------+------+
|
||||
unhex('zz')
|
||||
NULL
|
||||
+-------------+
|
||||
| unhex('zz') |
|
||||
+-------------+
|
||||
| NULL |
|
||||
+-------------+
|
||||
create table t1(a int, b varchar(255), c int);
|
||||
Field Type Null Key Default Extra
|
||||
a int(11) YES NULL
|
||||
|
|
|
@ -1404,92 +1404,6 @@ UNLOCK TABLES;
|
|||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
DROP TABLE t1;
|
||||
create database db1;
|
||||
use db1;
|
||||
CREATE TABLE t2 (
|
||||
a varchar(30) default NULL,
|
||||
KEY a (a(5))
|
||||
);
|
||||
INSERT INTO t2 VALUES ('alfred');
|
||||
INSERT INTO t2 VALUES ('angie');
|
||||
INSERT INTO t2 VALUES ('bingo');
|
||||
INSERT INTO t2 VALUES ('waffle');
|
||||
INSERT INTO t2 VALUES ('lemon');
|
||||
create view v2 as select * from t2 where a like 'a%' with check option;
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!40101 SET NAMES utf8 */;
|
||||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
||||
/*!40103 SET TIME_ZONE='+00:00' */;
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t2`;
|
||||
CREATE TABLE `t2` (
|
||||
`a` varchar(30) DEFAULT NULL,
|
||||
KEY `a` (`a`(5))
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
|
||||
LOCK TABLES `t2` WRITE;
|
||||
/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
|
||||
INSERT INTO `t2` VALUES ('alfred'),('angie'),('bingo'),('waffle'),('lemon');
|
||||
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
DROP TABLE IF EXISTS `v2`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v2`*/;
|
||||
/*!50001 CREATE TABLE `v2` (
|
||||
`a` varchar(30)
|
||||
) */;
|
||||
/*!50001 DROP TABLE IF EXISTS `v2`*/;
|
||||
/*!50001 DROP VIEW IF EXISTS `v2`*/;
|
||||
/*!50001 CREATE ALGORITHM=UNDEFINED */
|
||||
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
|
||||
/*!50001 VIEW `v2` AS select `t2`.`a` AS `a` from `t2` where (`t2`.`a` like _latin1'a%') */
|
||||
/*!50002 WITH CASCADED CHECK OPTION */;
|
||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
drop table t2;
|
||||
drop view v2;
|
||||
drop database db1;
|
||||
create database db2;
|
||||
use db2;
|
||||
create table t1 (a int);
|
||||
create table t2 (a int, b varchar(10), primary key(a));
|
||||
insert into t2 values (1, "on"), (2, "off"), (10, "pol"), (12, "meg");
|
||||
insert into t1 values (289), (298), (234), (456), (789);
|
||||
create view v1 as select * from t2;
|
||||
create view v2 as select * from t1;
|
||||
drop table t1, t2;
|
||||
drop view v1, v2;
|
||||
drop database db2;
|
||||
create database db1;
|
||||
use db1;
|
||||
show tables;
|
||||
Tables_in_db1
|
||||
t1
|
||||
t2
|
||||
v1
|
||||
v2
|
||||
select * from t2 order by a;
|
||||
a b
|
||||
1 on
|
||||
2 off
|
||||
10 pol
|
||||
12 meg
|
||||
drop table t1, t2;
|
||||
drop database db1;
|
||||
--fields-optionally-enclosed-by="
|
||||
CREATE DATABASE mysqldump_test_db;
|
||||
USE mysqldump_test_db;
|
||||
CREATE TABLE t1 ( a INT );
|
||||
|
@ -1682,6 +1596,7 @@ select * from t1;
|
|||
a b
|
||||
Osnabrück Köln
|
||||
drop table t1;
|
||||
--fields-optionally-enclosed-by="
|
||||
create table `t1` (
|
||||
t1_name varchar(255) default null,
|
||||
t1_id int(10) unsigned not null auto_increment,
|
||||
|
@ -1756,8 +1671,9 @@ CREATE TABLE `t2` (
|
|||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
drop table t1, t2, t3;
|
||||
create table t1 (a binary(1), b blob);
|
||||
insert into t1 values ('','');
|
||||
create table t1 (a int);
|
||||
mysqldump: Couldn't execute 'SELECT /*!40001 SQL_NO_CACHE */ * FROM `t1` WHERE xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx': 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 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' at line 1 (1064)
|
||||
mysqldump: Got error: 1064: 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 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' at line 1 when retrieving data from server
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
|
@ -1771,47 +1687,9 @@ insert into t1 values ('','');
|
|||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
CREATE TABLE `t1` (
|
||||
`a` binary(1) DEFAULT NULL,
|
||||
`b` blob
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
|
||||
LOCK TABLES `t1` WRITE;
|
||||
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
|
||||
INSERT INTO `t1` VALUES (0x00,'');
|
||||
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!40101 SET NAMES utf8 */;
|
||||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
||||
/*!40103 SET TIME_ZONE='+00:00' */;
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
CREATE TABLE `t1` (
|
||||
`a` binary(1) DEFAULT NULL,
|
||||
`b` blob
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
|
||||
LOCK TABLES `t1` WRITE;
|
||||
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
|
||||
INSERT INTO `t1` VALUES (0x00,'');
|
||||
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
|
@ -1823,6 +1701,95 @@ UNLOCK TABLES;
|
|||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
drop table t1;
|
||||
End of 4.1 tests
|
||||
create database db1;
|
||||
use db1;
|
||||
CREATE TABLE t2 (
|
||||
a varchar(30) default NULL,
|
||||
KEY a (a(5))
|
||||
);
|
||||
INSERT INTO t2 VALUES ('alfred');
|
||||
INSERT INTO t2 VALUES ('angie');
|
||||
INSERT INTO t2 VALUES ('bingo');
|
||||
INSERT INTO t2 VALUES ('waffle');
|
||||
INSERT INTO t2 VALUES ('lemon');
|
||||
create view v2 as select * from t2 where a like 'a%' with check option;
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!40101 SET NAMES utf8 */;
|
||||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
||||
/*!40103 SET TIME_ZONE='+00:00' */;
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t2`;
|
||||
CREATE TABLE `t2` (
|
||||
`a` varchar(30) DEFAULT NULL,
|
||||
KEY `a` (`a`(5))
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
|
||||
LOCK TABLES `t2` WRITE;
|
||||
/*!40000 ALTER TABLE `t2` DISABLE KEYS */;
|
||||
INSERT INTO `t2` VALUES ('alfred'),('angie'),('bingo'),('waffle'),('lemon');
|
||||
/*!40000 ALTER TABLE `t2` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
DROP TABLE IF EXISTS `v2`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v2`*/;
|
||||
/*!50001 CREATE TABLE `v2` (
|
||||
`a` varchar(30)
|
||||
) */;
|
||||
/*!50001 DROP TABLE IF EXISTS `v2`*/;
|
||||
/*!50001 DROP VIEW IF EXISTS `v2`*/;
|
||||
/*!50001 CREATE ALGORITHM=UNDEFINED */
|
||||
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
|
||||
/*!50001 VIEW `v2` AS select `t2`.`a` AS `a` from `t2` where (`t2`.`a` like _latin1'a%') */
|
||||
/*!50002 WITH CASCADED CHECK OPTION */;
|
||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
drop table t2;
|
||||
drop view v2;
|
||||
drop database db1;
|
||||
use test;
|
||||
create database db2;
|
||||
use db2;
|
||||
create table t1 (a int);
|
||||
create table t2 (a int, b varchar(10), primary key(a));
|
||||
insert into t2 values (1, "on"), (2, "off"), (10, "pol"), (12, "meg");
|
||||
insert into t1 values (289), (298), (234), (456), (789);
|
||||
create view v1 as select * from t2;
|
||||
create view v2 as select * from t1;
|
||||
drop table t1, t2;
|
||||
drop view v1, v2;
|
||||
drop database db2;
|
||||
use test;
|
||||
create database db1;
|
||||
use db1;
|
||||
show tables;
|
||||
Tables_in_db1
|
||||
t1
|
||||
t2
|
||||
v1
|
||||
v2
|
||||
select * from t2 order by a;
|
||||
a b
|
||||
1 on
|
||||
2 off
|
||||
10 pol
|
||||
12 meg
|
||||
drop table t1, t2;
|
||||
drop database db1;
|
||||
use test;
|
||||
create table t1(a int);
|
||||
create view v1 as select * from t1;
|
||||
|
||||
|
@ -2605,44 +2572,6 @@ drop view v2;
|
|||
drop view v0;
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
drop table if exists t1;
|
||||
CREATE TABLE t1(a int, b int);
|
||||
INSERT INTO t1 VALUES (1,1);
|
||||
INSERT INTO t1 VALUES (2,3);
|
||||
INSERT INTO t1 VALUES (3,4), (4,5);
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!40101 SET NAMES utf8 */;
|
||||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
||||
/*!40103 SET TIME_ZONE='+00:00' */;
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL,
|
||||
`b` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
|
||||
LOCK TABLES `t1` WRITE;
|
||||
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
|
||||
REPLACE INTO `t1` VALUES (1,1),(2,3),(3,4),(4,5);
|
||||
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
DROP TABLE t1;
|
||||
SET @old_sql_mode = @@SQL_MODE;
|
||||
SET SQL_MODE = IGNORE_SPACE;
|
||||
CREATE TABLE t1 (a INT);
|
||||
|
@ -2698,7 +2627,73 @@ DELIMITER ;
|
|||
|
||||
DROP TRIGGER tr1;
|
||||
DROP TABLE t1;
|
||||
End of 4.1 tests
|
||||
create table t1 (a binary(1), b blob);
|
||||
insert into t1 values ('','');
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!40101 SET NAMES utf8 */;
|
||||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
||||
/*!40103 SET TIME_ZONE='+00:00' */;
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
CREATE TABLE `t1` (
|
||||
`a` binary(1) DEFAULT NULL,
|
||||
`b` blob
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
|
||||
LOCK TABLES `t1` WRITE;
|
||||
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
|
||||
INSERT INTO `t1` VALUES (0x00,'');
|
||||
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!40101 SET NAMES utf8 */;
|
||||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
||||
/*!40103 SET TIME_ZONE='+00:00' */;
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
CREATE TABLE `t1` (
|
||||
`a` binary(1) DEFAULT NULL,
|
||||
`b` blob
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
|
||||
LOCK TABLES `t1` WRITE;
|
||||
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
|
||||
INSERT INTO `t1` VALUES (0x00,'');
|
||||
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
drop table t1;
|
||||
create table t1 (a int);
|
||||
insert into t1 values (289), (298), (234), (456), (789);
|
||||
create definer = CURRENT_USER view v1 as select * from t1;
|
||||
|
@ -2925,7 +2920,78 @@ mysqldump: Couldn't execute 'SHOW MASTER STATUS': Access denied; you need the SU
|
|||
grant REPLICATION CLIENT on *.* to mysqltest_1@localhost;
|
||||
drop table t1;
|
||||
drop user mysqltest_1@localhost;
|
||||
create database mysqldump_myDB;
|
||||
use mysqldump_myDB;
|
||||
create user myDB_User;
|
||||
grant create, create view, select, insert on mysqldump_myDB.* to myDB_User@localhost;
|
||||
create table t1 (c1 int);
|
||||
insert into t1 values (3);
|
||||
use mysqldump_myDB;
|
||||
create table u1 (f1 int);
|
||||
insert into u1 values (4);
|
||||
create view v1 (c1) as select * from t1;
|
||||
use mysqldump_myDB;
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
drop table u1;
|
||||
revoke all privileges on mysqldump_myDB.* from myDB_User@localhost;
|
||||
drop user myDB_User;
|
||||
drop database mysqldump_myDB;
|
||||
flush privileges;
|
||||
use mysqldump_myDB;
|
||||
select * from mysqldump_myDB.v1;
|
||||
c1
|
||||
3
|
||||
select * from mysqldump_myDB.u1;
|
||||
f1
|
||||
4
|
||||
use mysqldump_myDB;
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
drop table u1;
|
||||
revoke all privileges on mysqldump_myDB.* from myDB_User@localhost;
|
||||
drop user myDB_User;
|
||||
drop database mysqldump_myDB;
|
||||
use test;
|
||||
End of 5.0 tests
|
||||
drop table if exists t1;
|
||||
CREATE TABLE t1(a int, b int);
|
||||
INSERT INTO t1 VALUES (1,1);
|
||||
INSERT INTO t1 VALUES (2,3);
|
||||
INSERT INTO t1 VALUES (3,4), (4,5);
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!40101 SET NAMES utf8 */;
|
||||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
|
||||
/*!40103 SET TIME_ZONE='+00:00' */;
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL,
|
||||
`b` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
|
||||
LOCK TABLES `t1` WRITE;
|
||||
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
|
||||
REPLACE INTO `t1` VALUES (1,1),(2,3),(3,4),(4,5);
|
||||
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
DROP TABLE t1;
|
||||
create table t1 (a text , b text);
|
||||
create table t2 (a text , b text);
|
||||
insert t1 values ("Duck, Duck", "goose");
|
||||
|
|
|
@ -27,13 +27,13 @@ master-bin1.000001 # Query # # use `test`; alter table t2 add column (b int)
|
|||
reset master;
|
||||
reset master;
|
||||
ALTER DATABASE mysqltest CHARACTER SET latin1;
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # ALTER DATABASE mysqltest CHARACTER SET latin1
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # ALTER DATABASE mysqltest CHARACTER SET latin1
|
||||
drop table mysqltest.t1;
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # ALTER DATABASE mysqltest CHARACTER SET latin1
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # ALTER DATABASE mysqltest CHARACTER SET latin1
|
||||
reset master;
|
||||
reset master;
|
||||
use test;
|
||||
|
|
|
@ -1307,7 +1307,7 @@ select auto from t1 where
|
|||
('1901-01-01 01:01:01' between date_time and date_time)
|
||||
order by auto;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where with pushed condition; Using filesort
|
||||
1 SIMPLE t1 range medium_index medium_index 3 NULL 1 Using where with pushed condition; Using filesort
|
||||
select auto from t1 where
|
||||
("aaaa" between string and string) and
|
||||
("aaaa" between vstring and vstring) and
|
||||
|
@ -1409,7 +1409,7 @@ select auto from t1 where
|
|||
('1901-01-01 01:01:01' not between date_time and date_time)
|
||||
order by auto;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where with pushed condition; Using filesort
|
||||
1 SIMPLE t1 range medium_index medium_index 3 NULL 3 Using where with pushed condition; Using filesort
|
||||
select auto from t1 where
|
||||
("aaaa" not between string and string) and
|
||||
("aaaa" not between vstring and vstring) and
|
||||
|
@ -1565,7 +1565,7 @@ time_field not in('01:01:01','03:03:03') and
|
|||
date_time not in('1901-01-01 01:01:01','1903-03-03 03:03:03')
|
||||
order by auto;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range medium_index medium_index 3 NULL 2 Using where with pushed condition; Using filesort
|
||||
1 SIMPLE t1 range medium_index medium_index 3 NULL 6 Using where with pushed condition; Using filesort
|
||||
select auto from t1 where
|
||||
string not in("aaaa","cccc") and
|
||||
vstring not in("aaaa","cccc") and
|
||||
|
@ -1782,6 +1782,28 @@ select * from t5 where b like '%jo%' order by a;
|
|||
a b
|
||||
1 jonas
|
||||
3 johan
|
||||
set engine_condition_pushdown = off;
|
||||
select auto from t1 where date_time like '1902-02-02 %' order by auto;
|
||||
auto
|
||||
2
|
||||
select auto from t1 where date_time not like '1902-02-02 %' order by auto;
|
||||
auto
|
||||
3
|
||||
4
|
||||
set engine_condition_pushdown = on;
|
||||
explain select auto from t1 where date_time like '1902-02-02 %';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where
|
||||
select auto from t1 where date_time like '1902-02-02 %' order by auto;
|
||||
auto
|
||||
2
|
||||
explain select auto from t1 where date_time not like '1902-02-02 %';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where
|
||||
select auto from t1 where date_time not like '1902-02-02 %' order by auto;
|
||||
auto
|
||||
3
|
||||
4
|
||||
drop table t1;
|
||||
create table t1 (a int, b varchar(3), primary key using hash(a))
|
||||
engine=ndb;
|
||||
|
|
File diff suppressed because it is too large
Load diff
441
mysql-test/r/ndb_dd_alter.result
Normal file
441
mysql-test/r/ndb_dd_alter.result
Normal file
|
@ -0,0 +1,441 @@
|
|||
DROP TABLE IF EXISTS test.t1;
|
||||
DROP TABLE IF EXISTS test.t2;
|
||||
**** Test Setup Section ****
|
||||
CREATE LOGFILE GROUP lg
|
||||
ADD UNDOFILE './lg_group/undofile.dat'
|
||||
INITIAL_SIZE 16M
|
||||
UNDO_BUFFER_SIZE = 1M
|
||||
ENGINE=NDB;
|
||||
CREATE TABLESPACE ts
|
||||
ADD DATAFILE './table_space/datafile.dat'
|
||||
USE LOGFILE GROUP lg
|
||||
INITIAL_SIZE 12M
|
||||
ENGINE NDB;
|
||||
CREATE TABLE test.t1 (
|
||||
a1 smallint NOT NULL,
|
||||
a2 int NOT NULL,
|
||||
a3 bigint NOT NULL,
|
||||
a4 char(10),
|
||||
a5 decimal(5,1),
|
||||
a6 time,
|
||||
a7 date,
|
||||
a8 datetime,
|
||||
a9 VARCHAR(255),
|
||||
a10 blob,
|
||||
PRIMARY KEY(a1)
|
||||
) ENGINE=InnoDB;
|
||||
SHOW CREATE TABLE test.t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a1` smallint(6) NOT NULL,
|
||||
`a2` int(11) NOT NULL,
|
||||
`a3` bigint(20) NOT NULL,
|
||||
`a4` char(10) DEFAULT NULL,
|
||||
`a5` decimal(5,1) DEFAULT NULL,
|
||||
`a6` time DEFAULT NULL,
|
||||
`a7` date DEFAULT NULL,
|
||||
`a8` datetime DEFAULT NULL,
|
||||
`a9` varchar(255) DEFAULT NULL,
|
||||
`a10` blob,
|
||||
PRIMARY KEY (`a1`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
SELECT * FROM test.t1 ORDER BY a1;
|
||||
a1 a2 a3 a4 a5 a6 a7 a8 a9 a10
|
||||
1 2 2000000001 aaa1 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb1 binary data
|
||||
2 3 2000000002 aaa2 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb2 binary data
|
||||
3 4 2000000003 aaa3 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb3 binary data
|
||||
4 5 2000000004 aaa4 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb4 binary data
|
||||
5 6 2000000005 aaa5 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb5 binary data
|
||||
6 7 2000000006 aaa6 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb6 binary data
|
||||
7 8 2000000007 aaa7 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb7 binary data
|
||||
8 9 2000000008 aaa8 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb8 binary data
|
||||
9 10 2000000009 aaa9 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb9 binary data
|
||||
10 11 2000000010 aaa10 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb10 binary data
|
||||
11 12 2000000011 aaa11 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb11 binary data
|
||||
12 13 2000000012 aaa12 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb12 binary data
|
||||
13 14 2000000013 aaa13 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb13 binary data
|
||||
14 15 2000000014 aaa14 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb14 binary data
|
||||
15 16 2000000015 aaa15 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb15 binary data
|
||||
16 17 2000000016 aaa16 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb16 binary data
|
||||
17 18 2000000017 aaa17 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb17 binary data
|
||||
18 19 2000000018 aaa18 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb18 binary data
|
||||
19 20 2000000019 aaa19 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb19 binary data
|
||||
20 21 2000000020 aaa20 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb20 binary data
|
||||
ALTER TABLE test.t1 TABLESPACE ts STORAGE DISK ENGINE=NDB;
|
||||
SHOW CREATE TABLE test.t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a1` smallint(6) NOT NULL,
|
||||
`a2` int(11) NOT NULL,
|
||||
`a3` bigint(20) NOT NULL,
|
||||
`a4` char(10) DEFAULT NULL,
|
||||
`a5` decimal(5,1) DEFAULT NULL,
|
||||
`a6` time DEFAULT NULL,
|
||||
`a7` date DEFAULT NULL,
|
||||
`a8` datetime DEFAULT NULL,
|
||||
`a9` varchar(255) DEFAULT NULL,
|
||||
`a10` blob,
|
||||
PRIMARY KEY (`a1`)
|
||||
) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||
SELECT * FROM test.t1 ORDER BY a1;
|
||||
a1 a2 a3 a4 a5 a6 a7 a8 a9 a10
|
||||
1 2 2000000001 aaa1 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb1 binary data
|
||||
2 3 2000000002 aaa2 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb2 binary data
|
||||
3 4 2000000003 aaa3 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb3 binary data
|
||||
4 5 2000000004 aaa4 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb4 binary data
|
||||
5 6 2000000005 aaa5 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb5 binary data
|
||||
6 7 2000000006 aaa6 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb6 binary data
|
||||
7 8 2000000007 aaa7 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb7 binary data
|
||||
8 9 2000000008 aaa8 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb8 binary data
|
||||
9 10 2000000009 aaa9 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb9 binary data
|
||||
10 11 2000000010 aaa10 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb10 binary data
|
||||
11 12 2000000011 aaa11 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb11 binary data
|
||||
12 13 2000000012 aaa12 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb12 binary data
|
||||
13 14 2000000013 aaa13 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb13 binary data
|
||||
14 15 2000000014 aaa14 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb14 binary data
|
||||
15 16 2000000015 aaa15 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb15 binary data
|
||||
16 17 2000000016 aaa16 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb16 binary data
|
||||
17 18 2000000017 aaa17 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb17 binary data
|
||||
18 19 2000000018 aaa18 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb18 binary data
|
||||
19 20 2000000019 aaa19 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb19 binary data
|
||||
20 21 2000000020 aaa20 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb20 binary data
|
||||
DROP TABLE test.t1;
|
||||
CREATE TABLE test.t1 (
|
||||
a1 smallint NOT NULL,
|
||||
a2 int NOT NULL,
|
||||
a3 bigint NOT NULL,
|
||||
a4 char(10),
|
||||
a5 decimal(5,1),
|
||||
a6 time,
|
||||
a7 date,
|
||||
a8 datetime,
|
||||
a9 VARCHAR(255),
|
||||
a10 blob,
|
||||
PRIMARY KEY(a1)
|
||||
) ENGINE=MyISAM;
|
||||
SHOW CREATE TABLE test.t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a1` smallint(6) NOT NULL,
|
||||
`a2` int(11) NOT NULL,
|
||||
`a3` bigint(20) NOT NULL,
|
||||
`a4` char(10) DEFAULT NULL,
|
||||
`a5` decimal(5,1) DEFAULT NULL,
|
||||
`a6` time DEFAULT NULL,
|
||||
`a7` date DEFAULT NULL,
|
||||
`a8` datetime DEFAULT NULL,
|
||||
`a9` varchar(255) DEFAULT NULL,
|
||||
`a10` blob,
|
||||
PRIMARY KEY (`a1`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
SELECT * FROM test.t1 ORDER BY a1;
|
||||
a1 a2 a3 a4 a5 a6 a7 a8 a9 a10
|
||||
1 2 2000000001 aaa1 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb1 binary data
|
||||
2 3 2000000002 aaa2 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb2 binary data
|
||||
3 4 2000000003 aaa3 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb3 binary data
|
||||
4 5 2000000004 aaa4 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb4 binary data
|
||||
5 6 2000000005 aaa5 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb5 binary data
|
||||
6 7 2000000006 aaa6 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb6 binary data
|
||||
7 8 2000000007 aaa7 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb7 binary data
|
||||
8 9 2000000008 aaa8 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb8 binary data
|
||||
9 10 2000000009 aaa9 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb9 binary data
|
||||
10 11 2000000010 aaa10 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb10 binary data
|
||||
11 12 2000000011 aaa11 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb11 binary data
|
||||
12 13 2000000012 aaa12 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb12 binary data
|
||||
13 14 2000000013 aaa13 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb13 binary data
|
||||
14 15 2000000014 aaa14 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb14 binary data
|
||||
15 16 2000000015 aaa15 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb15 binary data
|
||||
16 17 2000000016 aaa16 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb16 binary data
|
||||
17 18 2000000017 aaa17 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb17 binary data
|
||||
18 19 2000000018 aaa18 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb18 binary data
|
||||
19 20 2000000019 aaa19 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb19 binary data
|
||||
20 21 2000000020 aaa20 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb20 binary data
|
||||
ALTER TABLE test.t1 TABLESPACE ts STORAGE DISK ENGINE=NDB;
|
||||
SHOW CREATE TABLE test.t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a1` smallint(6) NOT NULL,
|
||||
`a2` int(11) NOT NULL,
|
||||
`a3` bigint(20) NOT NULL,
|
||||
`a4` char(10) DEFAULT NULL,
|
||||
`a5` decimal(5,1) DEFAULT NULL,
|
||||
`a6` time DEFAULT NULL,
|
||||
`a7` date DEFAULT NULL,
|
||||
`a8` datetime DEFAULT NULL,
|
||||
`a9` varchar(255) DEFAULT NULL,
|
||||
`a10` blob,
|
||||
PRIMARY KEY (`a1`)
|
||||
) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||
SELECT * FROM test.t1 ORDER BY a1;
|
||||
a1 a2 a3 a4 a5 a6 a7 a8 a9 a10
|
||||
1 2 2000000001 aaa1 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb1 binary data
|
||||
2 3 2000000002 aaa2 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb2 binary data
|
||||
3 4 2000000003 aaa3 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb3 binary data
|
||||
4 5 2000000004 aaa4 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb4 binary data
|
||||
5 6 2000000005 aaa5 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb5 binary data
|
||||
6 7 2000000006 aaa6 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb6 binary data
|
||||
7 8 2000000007 aaa7 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb7 binary data
|
||||
8 9 2000000008 aaa8 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb8 binary data
|
||||
9 10 2000000009 aaa9 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb9 binary data
|
||||
10 11 2000000010 aaa10 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb10 binary data
|
||||
11 12 2000000011 aaa11 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb11 binary data
|
||||
12 13 2000000012 aaa12 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb12 binary data
|
||||
13 14 2000000013 aaa13 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb13 binary data
|
||||
14 15 2000000014 aaa14 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb14 binary data
|
||||
15 16 2000000015 aaa15 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb15 binary data
|
||||
16 17 2000000016 aaa16 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb16 binary data
|
||||
17 18 2000000017 aaa17 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb17 binary data
|
||||
18 19 2000000018 aaa18 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb18 binary data
|
||||
19 20 2000000019 aaa19 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb19 binary data
|
||||
20 21 2000000020 aaa20 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb20 binary data
|
||||
ALTER TABLE test.t1 ENGINE=InnoDB;
|
||||
SHOW CREATE TABLE test.t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a1` smallint(6) NOT NULL,
|
||||
`a2` int(11) NOT NULL,
|
||||
`a3` bigint(20) NOT NULL,
|
||||
`a4` char(10) DEFAULT NULL,
|
||||
`a5` decimal(5,1) DEFAULT NULL,
|
||||
`a6` time DEFAULT NULL,
|
||||
`a7` date DEFAULT NULL,
|
||||
`a8` datetime DEFAULT NULL,
|
||||
`a9` varchar(255) DEFAULT NULL,
|
||||
`a10` blob,
|
||||
PRIMARY KEY (`a1`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
SELECT * FROM test.t1 ORDER BY a1;
|
||||
a1 a2 a3 a4 a5 a6 a7 a8 a9 a10
|
||||
1 2 2000000001 aaa1 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb1 binary data
|
||||
2 3 2000000002 aaa2 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb2 binary data
|
||||
3 4 2000000003 aaa3 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb3 binary data
|
||||
4 5 2000000004 aaa4 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb4 binary data
|
||||
5 6 2000000005 aaa5 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb5 binary data
|
||||
6 7 2000000006 aaa6 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb6 binary data
|
||||
7 8 2000000007 aaa7 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb7 binary data
|
||||
8 9 2000000008 aaa8 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb8 binary data
|
||||
9 10 2000000009 aaa9 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb9 binary data
|
||||
10 11 2000000010 aaa10 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb10 binary data
|
||||
11 12 2000000011 aaa11 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb11 binary data
|
||||
12 13 2000000012 aaa12 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb12 binary data
|
||||
13 14 2000000013 aaa13 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb13 binary data
|
||||
14 15 2000000014 aaa14 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb14 binary data
|
||||
15 16 2000000015 aaa15 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb15 binary data
|
||||
16 17 2000000016 aaa16 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb16 binary data
|
||||
17 18 2000000017 aaa17 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb17 binary data
|
||||
18 19 2000000018 aaa18 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb18 binary data
|
||||
19 20 2000000019 aaa19 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb19 binary data
|
||||
20 21 2000000020 aaa20 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb20 binary data
|
||||
ALTER TABLE test.t1 TABLESPACE ts STORAGE DISK ENGINE=NDB;
|
||||
SHOW CREATE TABLE test.t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a1` smallint(6) NOT NULL,
|
||||
`a2` int(11) NOT NULL,
|
||||
`a3` bigint(20) NOT NULL,
|
||||
`a4` char(10) DEFAULT NULL,
|
||||
`a5` decimal(5,1) DEFAULT NULL,
|
||||
`a6` time DEFAULT NULL,
|
||||
`a7` date DEFAULT NULL,
|
||||
`a8` datetime DEFAULT NULL,
|
||||
`a9` varchar(255) DEFAULT NULL,
|
||||
`a10` blob,
|
||||
PRIMARY KEY (`a1`)
|
||||
) /*!50100 TABLESPACE ts STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||
ALTER TABLE test.t1 ENGINE=MyISAM;
|
||||
SHOW CREATE TABLE test.t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a1` smallint(6) NOT NULL,
|
||||
`a2` int(11) NOT NULL,
|
||||
`a3` bigint(20) NOT NULL,
|
||||
`a4` char(10) DEFAULT NULL,
|
||||
`a5` decimal(5,1) DEFAULT NULL,
|
||||
`a6` time DEFAULT NULL,
|
||||
`a7` date DEFAULT NULL,
|
||||
`a8` datetime DEFAULT NULL,
|
||||
`a9` varchar(255) DEFAULT NULL,
|
||||
`a10` blob,
|
||||
PRIMARY KEY (`a1`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
DROP TABLE test.t1;
|
||||
CREATE TABLE test.t1 (a1 INT PRIMARY KEY) TABLESPACE ts STORAGE DISK ENGINE=NDB;
|
||||
SELECT * FROM test.t1 ORDER BY a1;
|
||||
a1
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
10
|
||||
11
|
||||
12
|
||||
13
|
||||
14
|
||||
15
|
||||
16
|
||||
17
|
||||
18
|
||||
19
|
||||
20
|
||||
ALTER TABLE test.t1 ADD a2 FLOAT, ADD a3 DOUBLE;
|
||||
SELECT * FROM test.t1 ORDER BY a1;
|
||||
a1 a2 a3
|
||||
1 2.2345 20000001
|
||||
2 3.2345 20000002
|
||||
3 4.2345 20000003
|
||||
4 5.2345 20000004
|
||||
5 6.2345 20000005
|
||||
6 7.2345 20000006
|
||||
7 8.2345 20000007
|
||||
8 9.2345 20000008
|
||||
9 10.2345 20000009
|
||||
10 11.2345 20000010
|
||||
11 12.2345 20000011
|
||||
12 13.2345 20000012
|
||||
13 14.2345 20000013
|
||||
14 15.2345 20000014
|
||||
15 16.2345 20000015
|
||||
16 17.2345 20000016
|
||||
17 18.2345 20000017
|
||||
18 19.2345 20000018
|
||||
19 20.2345 20000019
|
||||
20 21.2345 20000020
|
||||
ALTER TABLE test.t1 ADD a4 BIT, ADD a5 TINYINT, ADD a6 BIGINT, ADD a7 DATE, ADD a8 TIME;
|
||||
SELECT a1,a2,a3,hex(a4), a5,a6,a7,a8 FROM test.t1 ORDER BY a1;
|
||||
a1 a2 a3 hex(a4) a5 a6 a7 a8
|
||||
1 2.2345 20000001 0 1 23457 2006-01-01 07:04:00
|
||||
2 3.2345 20000002 0 1 23458 2006-01-01 07:04:00
|
||||
3 4.2345 20000003 0 1 23459 2006-01-01 07:04:00
|
||||
4 5.2345 20000004 0 1 23460 2006-01-01 07:04:00
|
||||
5 6.2345 20000005 0 1 23461 2006-01-01 07:04:00
|
||||
6 7.2345 20000006 0 1 23462 2006-01-01 07:04:00
|
||||
7 8.2345 20000007 0 1 23463 2006-01-01 07:04:00
|
||||
8 9.2345 20000008 0 1 23464 2006-01-01 07:04:00
|
||||
9 10.2345 20000009 0 1 23465 2006-01-01 07:04:00
|
||||
10 11.2345 20000010 0 1 23466 2006-01-01 07:04:00
|
||||
11 12.2345 20000011 0 1 23467 2006-01-01 07:04:00
|
||||
12 13.2345 20000012 0 1 23468 2006-01-01 07:04:00
|
||||
13 14.2345 20000013 0 1 23469 2006-01-01 07:04:00
|
||||
14 15.2345 20000014 0 1 23470 2006-01-01 07:04:00
|
||||
15 16.2345 20000015 0 1 23471 2006-01-01 07:04:00
|
||||
16 17.2345 20000016 0 1 23472 2006-01-01 07:04:00
|
||||
17 18.2345 20000017 0 1 23473 2006-01-01 07:04:00
|
||||
18 19.2345 20000018 0 1 23474 2006-01-01 07:04:00
|
||||
19 20.2345 20000019 0 1 23475 2006-01-01 07:04:00
|
||||
20 21.2345 20000020 0 1 23476 2006-01-01 07:04:00
|
||||
ALTER TABLE test.t1 ADD a9 DATETIME, ADD a10 TINYTEXT, ADD a11 MEDIUMTEXT, ADD a12 LONGTEXT, ADD a13 TEXT, ADD a14 BLOB;
|
||||
SELECT a1, a2,a3,hex(a4),a5,a6,a7,a8,a9,a10,a11,a12,a13 FROM test.t1 ORDER BY a1;
|
||||
a1 a2 a3 hex(a4) a5 a6 a7 a8 a9 a10 a11 a12 a13
|
||||
1 2.2345 20000001 0 1 23457 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
|
||||
2 3.2345 20000002 0 1 23458 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
|
||||
3 4.2345 20000003 0 1 23459 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
|
||||
4 5.2345 20000004 0 1 23460 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
|
||||
5 6.2345 20000005 0 1 23461 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
|
||||
6 7.2345 20000006 0 1 23462 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
|
||||
7 8.2345 20000007 0 1 23463 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
|
||||
8 9.2345 20000008 0 1 23464 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
|
||||
9 10.2345 20000009 0 1 23465 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
|
||||
10 11.2345 20000010 0 1 23466 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
|
||||
11 12.2345 20000011 0 1 23467 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
|
||||
12 13.2345 20000012 0 1 23468 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
|
||||
13 14.2345 20000013 0 1 23469 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
|
||||
14 15.2345 20000014 0 1 23470 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
|
||||
15 16.2345 20000015 0 1 23471 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
|
||||
16 17.2345 20000016 0 1 23472 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
|
||||
17 18.2345 20000017 0 1 23473 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
|
||||
18 19.2345 20000018 0 1 23474 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
|
||||
19 20.2345 20000019 0 1 23475 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
|
||||
20 21.2345 20000020 0 1 23476 2006-01-01 07:04:00 1971-05-28 16:55:03 abc abcdefg LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL Text Field
|
||||
SHOW CREATE TABLE test.t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a1` int(11) NOT NULL,
|
||||
`a2` float DEFAULT NULL,
|
||||
`a3` double DEFAULT NULL,
|
||||
`a4` bit(1) DEFAULT NULL,
|
||||
`a5` tinyint(4) DEFAULT NULL,
|
||||
`a6` bigint(20) DEFAULT NULL,
|
||||
`a7` date DEFAULT NULL,
|
||||
`a8` time DEFAULT NULL,
|
||||
`a9` datetime DEFAULT NULL,
|
||||
`a10` tinytext,
|
||||
`a11` mediumtext,
|
||||
`a12` longtext,
|
||||
`a13` text,
|
||||
`a14` blob,
|
||||
PRIMARY KEY (`a1`)
|
||||
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||
ALTER TABLE test.t1 ADD INDEX a2_i (a2), ADD INDEX a3_i (a3);
|
||||
SHOW CREATE TABLE test.t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a1` int(11) NOT NULL,
|
||||
`a2` float DEFAULT NULL,
|
||||
`a3` double DEFAULT NULL,
|
||||
`a4` bit(1) DEFAULT NULL,
|
||||
`a5` tinyint(4) DEFAULT NULL,
|
||||
`a6` bigint(20) DEFAULT NULL,
|
||||
`a7` date DEFAULT NULL,
|
||||
`a8` time DEFAULT NULL,
|
||||
`a9` datetime DEFAULT NULL,
|
||||
`a10` tinytext,
|
||||
`a11` mediumtext,
|
||||
`a12` longtext,
|
||||
`a13` text,
|
||||
`a14` blob,
|
||||
PRIMARY KEY (`a1`),
|
||||
KEY `a2_i` (`a2`),
|
||||
KEY `a3_i` (`a3`)
|
||||
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||
ALTER TABLE test.t1 DROP INDEX a2_i;
|
||||
SHOW CREATE TABLE test.t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a1` int(11) NOT NULL,
|
||||
`a2` float DEFAULT NULL,
|
||||
`a3` double DEFAULT NULL,
|
||||
`a4` bit(1) DEFAULT NULL,
|
||||
`a5` tinyint(4) DEFAULT NULL,
|
||||
`a6` bigint(20) DEFAULT NULL,
|
||||
`a7` date DEFAULT NULL,
|
||||
`a8` time DEFAULT NULL,
|
||||
`a9` datetime DEFAULT NULL,
|
||||
`a10` tinytext,
|
||||
`a11` mediumtext,
|
||||
`a12` longtext,
|
||||
`a13` text,
|
||||
`a14` blob,
|
||||
PRIMARY KEY (`a1`),
|
||||
KEY `a3_i` (`a3`)
|
||||
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||
ALTER TABLE test.t1 DROP a14;
|
||||
ALTER TABLE test.t1 DROP a13;
|
||||
ALTER TABLE test.t1 DROP a12;
|
||||
ALTER TABLE test.t1 DROP a11;
|
||||
ALTER TABLE test.t1 DROP a10;
|
||||
ALTER TABLE test.t1 DROP a9;
|
||||
ALTER TABLE test.t1 DROP a8;
|
||||
ALTER TABLE test.t1 DROP a7;
|
||||
ALTER TABLE test.t1 DROP a6;
|
||||
ALTER TABLE test.t1 DROP PRIMARY KEY;
|
||||
SHOW CREATE TABLE test.t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a1` int(11) NOT NULL,
|
||||
`a2` float DEFAULT NULL,
|
||||
`a3` double DEFAULT NULL,
|
||||
`a4` bit(1) DEFAULT NULL,
|
||||
`a5` tinyint(4) DEFAULT NULL,
|
||||
KEY `a3_i` (`a3`)
|
||||
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||
DROP TABLE test.t1;
|
||||
ALTER TABLESPACE ts
|
||||
DROP DATAFILE './table_space/datafile.dat'
|
||||
ENGINE NDB;
|
||||
DROP TABLESPACE ts ENGINE NDB;
|
||||
DROP LOGFILE GROUP lg ENGINE=NDB;
|
|
@ -175,7 +175,7 @@ t1 CREATE TABLE `t1` (
|
|||
`c3` int(11) NOT NULL,
|
||||
`c4` bit(1) NOT NULL,
|
||||
PRIMARY KEY (`pk1`,`c3`)
|
||||
) TABLESPACE table_space1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 4 */
|
||||
) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 4 */
|
||||
SHOW CREATE TABLE test.t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
|
@ -184,7 +184,7 @@ t2 CREATE TABLE `t2` (
|
|||
`c3` int(11) NOT NULL,
|
||||
`c4` bit(1) NOT NULL,
|
||||
PRIMARY KEY (`pk1`,`c3`)
|
||||
) TABLESPACE table_space2 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c3) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
|
||||
) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c3) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
|
||||
SHOW CREATE TABLE test.t3;
|
||||
Table Create Table
|
||||
t3 CREATE TABLE `t3` (
|
||||
|
@ -193,7 +193,7 @@ t3 CREATE TABLE `t3` (
|
|||
`c3` int(11) NOT NULL,
|
||||
`c4` bit(1) NOT NULL,
|
||||
PRIMARY KEY (`pk1`,`c3`)
|
||||
) TABLESPACE table_space2 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (c3) (PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) */
|
||||
) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (c3) (PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) */
|
||||
SHOW CREATE TABLE test.t4;
|
||||
Table Create Table
|
||||
t4 CREATE TABLE `t4` (
|
||||
|
@ -341,7 +341,7 @@ t1 CREATE TABLE `t1` (
|
|||
`c3` int(11) NOT NULL,
|
||||
`c4` bit(1) NOT NULL,
|
||||
PRIMARY KEY (`pk1`,`c3`)
|
||||
) TABLESPACE table_space1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 4 */
|
||||
) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (c3) PARTITIONS 4 */
|
||||
SHOW CREATE TABLE test.t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
|
@ -350,7 +350,7 @@ t2 CREATE TABLE `t2` (
|
|||
`c3` int(11) NOT NULL,
|
||||
`c4` bit(1) NOT NULL,
|
||||
PRIMARY KEY (`pk1`,`c3`)
|
||||
) TABLESPACE table_space2 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c3) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
|
||||
) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (c3) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
|
||||
SHOW CREATE TABLE test.t3;
|
||||
Table Create Table
|
||||
t3 CREATE TABLE `t3` (
|
||||
|
@ -359,7 +359,7 @@ t3 CREATE TABLE `t3` (
|
|||
`c3` int(11) NOT NULL,
|
||||
`c4` bit(1) NOT NULL,
|
||||
PRIMARY KEY (`pk1`,`c3`)
|
||||
) TABLESPACE table_space2 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (c3) (PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) */
|
||||
) /*!50100 TABLESPACE table_space2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (c3) (PARTITION x1 VALUES LESS THAN (105) ENGINE = ndbcluster, PARTITION x2 VALUES LESS THAN (333) ENGINE = ndbcluster, PARTITION x3 VALUES LESS THAN (720) ENGINE = ndbcluster) */
|
||||
SHOW CREATE TABLE test.t4;
|
||||
Table Create Table
|
||||
t4 CREATE TABLE `t4` (
|
||||
|
|
|
@ -49,7 +49,7 @@ t1 CREATE TABLE `t1` (
|
|||
`b` int(11) NOT NULL,
|
||||
`c` int(11) NOT NULL,
|
||||
PRIMARY KEY (`pk1`)
|
||||
) TABLESPACE ts1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||
) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||
INSERT INTO t1 VALUES (0, 0, 0);
|
||||
SELECT * FROM t1;
|
||||
pk1 b c
|
||||
|
@ -422,6 +422,47 @@ SELECT COUNT(*) FROM t1;
|
|||
COUNT(*)
|
||||
0
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (
|
||||
a int NOT NULL,
|
||||
b varchar(4000), -- must use 2 pages undo
|
||||
PRIMARY KEY using hash (a)
|
||||
)
|
||||
TABLESPACE ts1 STORAGE DISK ENGINE=NDBCLUSTER;
|
||||
set autocommit = 0;
|
||||
insert into t1 values(0,'x');
|
||||
insert into t1 values(1,'x');
|
||||
insert into t1 values(2,'x');
|
||||
insert into t1 values(3,'x');
|
||||
insert into t1 values(4,'x');
|
||||
insert into t1 values(5,'x');
|
||||
insert into t1 values(6,'x');
|
||||
insert into t1 values(7,'x');
|
||||
insert into t1 values(8,'x');
|
||||
delete from t1 where a = 0;
|
||||
commit;
|
||||
set autocommit = 1;
|
||||
drop table t1;
|
||||
create table test.t1 (f1 varchar(50) primary key, f2 text,f3 int)
|
||||
TABLESPACE ts1 STORAGE DISK engine=NDB;
|
||||
insert into test.t1 (f1,f2,f3)VALUES("111111","aaaaaa",1);
|
||||
insert into test.t1 (f1,f2,f3)VALUES("222222","bbbbbb",2);
|
||||
select * from test.t1 order by f1;
|
||||
f1 f2 f3
|
||||
111111 aaaaaa 1
|
||||
222222 bbbbbb 2
|
||||
select f1,f2 from test.t1 order by f2;
|
||||
f1 f2
|
||||
111111 aaaaaa
|
||||
222222 bbbbbb
|
||||
select f2 from test.t1 order by f2;
|
||||
f2
|
||||
aaaaaa
|
||||
bbbbbb
|
||||
select f1,f2 from test.t1 order by f1;
|
||||
f1 f2
|
||||
111111 aaaaaa
|
||||
222222 bbbbbb
|
||||
drop table test.t1;
|
||||
ALTER TABLESPACE ts1
|
||||
DROP DATAFILE 'datafile.dat'
|
||||
ENGINE = NDB;
|
||||
|
|
|
@ -226,7 +226,7 @@ t1 CREATE TABLE `t1` (
|
|||
`b` int(11) NOT NULL,
|
||||
`c` int(11) NOT NULL,
|
||||
PRIMARY KEY (`pk1`)
|
||||
) TABLESPACE table_space1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||
) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||
ALTER TABLE test.t2 TABLESPACE table_space1 STORAGE DISK
|
||||
ENGINE=NDB;
|
||||
SHOW CREATE TABLE test.t2;
|
||||
|
@ -236,7 +236,7 @@ t2 CREATE TABLE `t2` (
|
|||
`b2` int(11) NOT NULL,
|
||||
`c2` int(11) NOT NULL,
|
||||
PRIMARY KEY (`pk2`)
|
||||
) TABLESPACE table_space1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||
) /*!50100 TABLESPACE table_space1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||
ALTER TABLE test.t1 ENGINE=NDBCLUSTER;
|
||||
SHOW CREATE TABLE test.t1;
|
||||
Table Create Table
|
||||
|
@ -299,10 +299,207 @@ usr_id uniq_id increment usr2_id c_amount max
|
|||
|
||||
DROP TABLE test.t1;
|
||||
DROP TABLE test.t2;
|
||||
ALTER TABLESPACE table_space1
|
||||
DROP DATAFILE './table_space1/datafile.dat'
|
||||
ENGINE = NDB;
|
||||
DROP TABLESPACE table_space1
|
||||
ENGINE = NDB;
|
||||
DROP LOGFILE GROUP log_group1
|
||||
ENGINE =NDB;
|
||||
CREATE TABLE test.t1 (
|
||||
a1 smallint NOT NULL,
|
||||
a2 int NOT NULL,
|
||||
a3 bigint NOT NULL,
|
||||
a4 char(10),
|
||||
a5 decimal(5,1),
|
||||
a6 time,
|
||||
a7 date,
|
||||
a8 datetime,
|
||||
a9 VARCHAR(255),
|
||||
a10 blob,
|
||||
PRIMARY KEY(a1)
|
||||
) TABLESPACE table_space1 STORAGE DISK ENGINE=NDB;
|
||||
CREATE TABLE test.t2 (
|
||||
b1 smallint NOT NULL,
|
||||
b2 int NOT NULL,
|
||||
b3 bigint NOT NULL,
|
||||
b4 char(10),
|
||||
b5 decimal(5,1),
|
||||
b6 time,
|
||||
b7 date,
|
||||
b8 datetime,
|
||||
b9 VARCHAR(255),
|
||||
b10 blob,
|
||||
PRIMARY KEY(b1)
|
||||
) ENGINE=NDB;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a1` smallint(6) NOT NULL,
|
||||
`a2` int(11) NOT NULL,
|
||||
`a3` bigint(20) NOT NULL,
|
||||
`a4` char(10) DEFAULT NULL,
|
||||
`a5` decimal(5,1) DEFAULT NULL,
|
||||
`a6` time DEFAULT NULL,
|
||||
`a7` date DEFAULT NULL,
|
||||
`a8` datetime DEFAULT NULL,
|
||||
`a9` varchar(255) DEFAULT NULL,
|
||||
`a10` blob,
|
||||
PRIMARY KEY (`a1`),
|
||||
KEY `a2` (`a2`),
|
||||
KEY `a3` (`a3`),
|
||||
KEY `a8` (`a8`)
|
||||
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`b1` smallint(6) NOT NULL,
|
||||
`b2` int(11) NOT NULL,
|
||||
`b3` bigint(20) NOT NULL,
|
||||
`b4` char(10) DEFAULT NULL,
|
||||
`b5` decimal(5,1) DEFAULT NULL,
|
||||
`b6` time DEFAULT NULL,
|
||||
`b7` date DEFAULT NULL,
|
||||
`b8` datetime DEFAULT NULL,
|
||||
`b9` varchar(255) DEFAULT NULL,
|
||||
`b10` blob,
|
||||
PRIMARY KEY (`b1`),
|
||||
KEY `b2` (`b2`),
|
||||
KEY `b3` (`b3`),
|
||||
KEY `b8` (`b8`)
|
||||
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||
a1 a2 a3 a4 a5 a6 a7 a8 a9 a10
|
||||
1 2 2000000001 aaa1 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb1 binary data
|
||||
2 3 2000000002 aaa2 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb2 binary data
|
||||
3 4 2000000003 aaa3 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb3 binary data
|
||||
4 5 2000000004 aaa4 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb4 binary data
|
||||
5 6 2000000005 aaa5 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb5 binary data
|
||||
6 7 2000000006 aaa6 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb6 binary data
|
||||
7 8 2000000007 aaa7 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb7 binary data
|
||||
8 9 2000000008 aaa8 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb8 binary data
|
||||
9 10 2000000009 aaa9 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb9 binary data
|
||||
10 11 2000000010 aaa10 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb10 binary data
|
||||
11 12 2000000011 aaa11 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb11 binary data
|
||||
12 13 2000000012 aaa12 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb12 binary data
|
||||
13 14 2000000013 aaa13 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb13 binary data
|
||||
14 15 2000000014 aaa14 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb14 binary data
|
||||
15 16 2000000015 aaa15 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb15 binary data
|
||||
16 17 2000000016 aaa16 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb16 binary data
|
||||
17 18 2000000017 aaa17 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb17 binary data
|
||||
18 19 2000000018 aaa18 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb18 binary data
|
||||
19 20 2000000019 aaa19 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb19 binary data
|
||||
20 21 2000000020 aaa20 34.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb20 binary data
|
||||
b1 b2 b3 b4 b5 b6 b7 b8 b9 b10
|
||||
3 4 3000000001 aaa1 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb1 binary data
|
||||
4 5 3000000002 aaa2 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb2 binary data
|
||||
5 6 3000000003 aaa3 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb3 binary data
|
||||
6 7 3000000004 aaa4 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb4 binary data
|
||||
7 8 3000000005 aaa5 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb5 binary data
|
||||
8 9 3000000006 aaa6 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb6 binary data
|
||||
9 10 3000000007 aaa7 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb7 binary data
|
||||
10 11 3000000008 aaa8 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb8 binary data
|
||||
11 12 3000000009 aaa9 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb9 binary data
|
||||
12 13 3000000010 aaa10 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb10 binary data
|
||||
13 14 3000000011 aaa11 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb11 binary data
|
||||
14 15 3000000012 aaa12 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb12 binary data
|
||||
15 16 3000000013 aaa13 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb13 binary data
|
||||
16 17 3000000014 aaa14 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb14 binary data
|
||||
17 18 3000000015 aaa15 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb15 binary data
|
||||
18 19 3000000016 aaa16 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb16 binary data
|
||||
19 20 3000000017 aaa17 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb17 binary data
|
||||
20 21 3000000018 aaa18 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb18 binary data
|
||||
21 22 3000000019 aaa19 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb19 binary data
|
||||
22 23 3000000020 aaa20 35.2 04:03:02 2006-01-01 1971-05-28 16:55:03 bbbbbbbbbbbbb20 binary data
|
||||
COUNT(a1) a1 COUNT(a1)*a1
|
||||
1 1 1
|
||||
1 2 2
|
||||
1 3 3
|
||||
1 4 4
|
||||
1 5 5
|
||||
1 6 6
|
||||
1 7 7
|
||||
1 8 8
|
||||
1 9 9
|
||||
1 10 10
|
||||
1 11 11
|
||||
1 12 12
|
||||
1 13 13
|
||||
1 14 14
|
||||
1 15 15
|
||||
1 16 16
|
||||
1 17 17
|
||||
1 18 18
|
||||
1 19 19
|
||||
1 20 20
|
||||
COUNT(a2) (a2+1) COUNT(a2)*(a2+0)
|
||||
1 3 2
|
||||
1 4 3
|
||||
1 5 4
|
||||
1 6 5
|
||||
1 7 6
|
||||
1 8 7
|
||||
1 9 8
|
||||
1 10 9
|
||||
1 11 10
|
||||
1 12 11
|
||||
1 13 12
|
||||
1 14 13
|
||||
1 15 14
|
||||
1 16 15
|
||||
1 17 16
|
||||
1 18 17
|
||||
1 19 18
|
||||
1 20 19
|
||||
1 21 20
|
||||
1 22 21
|
||||
a
|
||||
8
|
||||
7
|
||||
6
|
||||
5
|
||||
a c
|
||||
8 Clavin
|
||||
7 Serge
|
||||
6 Jeb
|
||||
5 Stewart
|
||||
4 Martin
|
||||
3 Pekka
|
||||
a
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
a c
|
||||
4 Martin
|
||||
5 Stewart
|
||||
6 Jeb
|
||||
7 Serge
|
||||
8 Clavin
|
||||
a
|
||||
1
|
||||
1
|
||||
1
|
||||
2
|
||||
2
|
||||
3
|
||||
3
|
||||
a
|
||||
3
|
||||
2
|
||||
1
|
||||
a
|
||||
3
|
||||
2
|
||||
1
|
||||
a
|
||||
1
|
||||
2
|
||||
3
|
||||
email shipcode
|
||||
test1@testdomain.com Z001
|
||||
test2@testdomain.com R002
|
||||
test2@testdomain.com Z001
|
||||
test3@testdomain.com Z001
|
||||
email
|
||||
test1@testdomain.com
|
||||
test2@testdomain.com
|
||||
test3@testdomain.com
|
||||
email shipcode
|
||||
test1@testdomain.com Z001
|
||||
test2@testdomain.com Z001
|
||||
test2@testdomain.com R002
|
||||
test3@testdomain.com Z001
|
||||
|
|
|
@ -172,6 +172,7 @@ INITIAL_SIZE,
|
|||
ENGINE
|
||||
FROM INFORMATION_SCHEMA.FILES WHERE FILE_TYPE="UNDO LOG" ORDER BY FILE_NAME;
|
||||
LOGFILE_GROUP_NAME FILE_NAME TOTAL_EXTENTS INITIAL_SIZE ENGINE
|
||||
lg1 NULL NULL NULL ndbcluster
|
||||
lg1 undofile_lg1_01.dat 524288 2097152 ndbcluster
|
||||
lg1 undofile_lg1_02.dat 1048576 4194304 ndbcluster
|
||||
SELECT DISTINCT
|
||||
|
|
|
@ -2,7 +2,8 @@ DROP TABLE IF EXISTS test.t1;
|
|||
DROP TABLE IF EXISTS test.t2;
|
||||
DROP TABLE IF EXISTS test.t3;
|
||||
*****
|
||||
**** Copy data from table in one table space to table in different table space
|
||||
**** Copy data from table in one table space to table
|
||||
**** in different table space
|
||||
*****
|
||||
CREATE LOGFILE GROUP lg
|
||||
ADD UNDOFILE './lg_group/undofile.dat'
|
||||
|
@ -12,12 +13,12 @@ ENGINE=NDB;
|
|||
CREATE TABLESPACE ts1
|
||||
ADD DATAFILE './table_space1/datafile.dat'
|
||||
USE LOGFILE GROUP lg
|
||||
INITIAL_SIZE 12M
|
||||
INITIAL_SIZE 25M
|
||||
ENGINE NDB;
|
||||
CREATE TABLESPACE ts2
|
||||
ADD DATAFILE './table_space2/datafile.dat'
|
||||
USE LOGFILE GROUP lg
|
||||
INITIAL_SIZE 12M
|
||||
INITIAL_SIZE 20M
|
||||
ENGINE NDB;
|
||||
CREATE TABLE test.t1 (a1 int NOT NULL PRIMARY KEY, a2 VARCHAR(256), a3 BLOB)
|
||||
TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
|
||||
|
@ -30,7 +31,7 @@ t1 CREATE TABLE `t1` (
|
|||
`a2` varchar(256) DEFAULT NULL,
|
||||
`a3` blob,
|
||||
PRIMARY KEY (`a1`)
|
||||
) TABLESPACE ts1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||
) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||
SHOW CREATE TABLE test.t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
|
@ -38,7 +39,7 @@ t2 CREATE TABLE `t2` (
|
|||
`a2` varchar(256) DEFAULT NULL,
|
||||
`a3` blob,
|
||||
PRIMARY KEY (`a1`)
|
||||
) TABLESPACE ts2 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||
) /*!50100 TABLESPACE ts2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||
INSERT INTO test.t1 VALUES (1,'111111','aaaaaaaa');
|
||||
INSERT INTO test.t1 VALUES (2,'222222','bbbbbbbb');
|
||||
SELECT * FROM test.t1 ORDER BY a1;
|
||||
|
@ -93,7 +94,7 @@ t1 CREATE TABLE `t1` (
|
|||
`a2` varchar(5000) DEFAULT NULL,
|
||||
`a3` blob,
|
||||
PRIMARY KEY (`a1`)
|
||||
) TABLESPACE ts1 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||
) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||
SHOW CREATE TABLE test.t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
|
@ -101,7 +102,7 @@ t2 CREATE TABLE `t2` (
|
|||
`a2` varchar(5000) DEFAULT NULL,
|
||||
`a3` blob,
|
||||
PRIMARY KEY (`a1`)
|
||||
) TABLESPACE ts2 STORAGE DISK ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||
) /*!50100 TABLESPACE ts2 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
|
||||
INSERT INTO test.t1 VALUES (1,@vc1,@d1);
|
||||
INSERT INTO test.t1 VALUES (2,@vc2,@b1);
|
||||
INSERT INTO test.t1 VALUES (3,@vc3,@d2);
|
||||
|
@ -124,29 +125,9 @@ FROM test.t2 where a1=2;
|
|||
a1 length(a2) substr(a2,480,2) length(a3) substr(a3,1+2*900,3)
|
||||
2 500 bb 2256 b1b
|
||||
DROP TABLE test.t1, test.t2;
|
||||
ALTER TABLESPACE ts1
|
||||
DROP DATAFILE './table_space1/datafile.dat'
|
||||
ENGINE NDB;
|
||||
DROP TABLESPACE ts1 ENGINE NDB;
|
||||
ALTER TABLESPACE ts2
|
||||
DROP DATAFILE './table_space2/datafile.dat'
|
||||
ENGINE NDB;
|
||||
DROP TABLESPACE ts2 ENGINE NDB;
|
||||
DROP LOGFILE GROUP lg
|
||||
ENGINE=NDB;
|
||||
*****
|
||||
**** Insert, Update, Delete from NDB table with BLOB fields
|
||||
*****
|
||||
CREATE LOGFILE GROUP lg
|
||||
ADD UNDOFILE './lg_group/undofile.dat'
|
||||
INITIAL_SIZE 16M
|
||||
UNDO_BUFFER_SIZE = 1M
|
||||
ENGINE=NDB;
|
||||
CREATE TABLESPACE ts1
|
||||
ADD DATAFILE './table_space1/datafile.dat'
|
||||
USE LOGFILE GROUP lg
|
||||
INITIAL_SIZE 12M
|
||||
ENGINE NDB;
|
||||
set @vc1 = repeat('a', 200);
|
||||
set @vc2 = repeat('b', 500);
|
||||
set @vc3 = repeat('c', 1000);
|
||||
|
@ -157,10 +138,12 @@ set @bb2 = repeat('2', 5000);
|
|||
set @bb3 = repeat('3', 10000);
|
||||
set @bb4 = repeat('4', 40000);
|
||||
set @bb5 = repeat('5', 50000);
|
||||
select length(@vc1),length(@vc2),length(@vc3),length(@vc4),length(@vc5) from dual;
|
||||
select length(@vc1),length(@vc2),length(@vc3),length(@vc4),length(@vc5)
|
||||
from dual;
|
||||
length(@vc1) length(@vc2) length(@vc3) length(@vc4) length(@vc5)
|
||||
200 500 1000 4000 5000
|
||||
select length(@bb1),length(@bb2),length(@bb3),length(@bb4),length(@bb5) from dual;
|
||||
select length(@bb1),length(@bb2),length(@bb3),length(@bb4),length(@bb5)
|
||||
from dual;
|
||||
length(@bb1) length(@bb2) length(@bb3) length(@bb4) length(@bb5)
|
||||
2000 5000 10000 40000 50000
|
||||
CREATE TABLE test.t1 (a1 int NOT NULL PRIMARY KEY, a2 VARCHAR(5000), a3 BLOB)
|
||||
|
@ -216,25 +199,9 @@ SELECT count(*) from test.t1;
|
|||
count(*)
|
||||
0
|
||||
DROP TABLE test.t1;
|
||||
ALTER TABLESPACE ts1
|
||||
DROP DATAFILE './table_space1/datafile.dat'
|
||||
ENGINE NDB;
|
||||
DROP TABLESPACE ts1 ENGINE NDB;
|
||||
DROP LOGFILE GROUP lg
|
||||
ENGINE=NDB;
|
||||
*****
|
||||
**** Create Stored procedures that use disk based tables
|
||||
*****
|
||||
CREATE LOGFILE GROUP lg
|
||||
ADD UNDOFILE './lg_group/undofile.dat'
|
||||
INITIAL_SIZE 16M
|
||||
UNDO_BUFFER_SIZE = 1M
|
||||
ENGINE=NDB;
|
||||
CREATE TABLESPACE ts1
|
||||
ADD DATAFILE './table_space1/datafile.dat'
|
||||
USE LOGFILE GROUP lg
|
||||
INITIAL_SIZE 12M
|
||||
ENGINE NDB;
|
||||
CREATE TABLE test.t1 (a1 int NOT NULL PRIMARY KEY, a2 VARCHAR(256), a3 BLOB)
|
||||
TABLESPACE ts1 STORAGE DISK ENGINE=NDB//
|
||||
CREATE PROCEDURE test.sp1()
|
||||
|
@ -257,25 +224,9 @@ DELETE FROM test.t1;
|
|||
DROP PROCEDURE test.sp1;
|
||||
DROP PROCEDURE test.sp2;
|
||||
DROP TABLE test.t1;
|
||||
ALTER TABLESPACE ts1
|
||||
DROP DATAFILE './table_space1/datafile.dat'
|
||||
ENGINE=NDB;
|
||||
DROP TABLESPACE ts1 ENGINE=NDB;
|
||||
DROP LOGFILE GROUP lg
|
||||
ENGINE=NDB;
|
||||
*****
|
||||
***** Create function that operate on disk based tables
|
||||
*****
|
||||
CREATE LOGFILE GROUP lg
|
||||
ADD UNDOFILE './lg_group/undofile.dat'
|
||||
INITIAL_SIZE 16M
|
||||
UNDO_BUFFER_SIZE = 1M
|
||||
ENGINE=NDB;
|
||||
CREATE TABLESPACE ts1
|
||||
ADD DATAFILE './table_space1/datafile.dat'
|
||||
USE LOGFILE GROUP lg
|
||||
INITIAL_SIZE 12M
|
||||
ENGINE NDB;
|
||||
CREATE TABLE test.t1 (a1 int NOT NULL PRIMARY KEY, a2 VARCHAR(256), a3 BLOB)
|
||||
TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
|
||||
CREATE FUNCTION test.fn1(n INT) RETURNS INT
|
||||
|
@ -301,25 +252,9 @@ DELETE FROM test.t1;
|
|||
DROP FUNCTION test.fn1;
|
||||
DROP FUNCTION test.fn2;
|
||||
DROP TABLE test.t1;
|
||||
ALTER TABLESPACE ts1
|
||||
DROP DATAFILE './table_space1/datafile.dat'
|
||||
ENGINE=NDB;
|
||||
DROP TABLESPACE ts1 ENGINE=NDB;
|
||||
DROP LOGFILE GROUP lg
|
||||
ENGINE=NDB;
|
||||
*****
|
||||
***** Create triggers that operate on disk based tables
|
||||
*****
|
||||
CREATE LOGFILE GROUP lg
|
||||
ADD UNDOFILE './lg_group/undofile.dat'
|
||||
INITIAL_SIZE 16M
|
||||
UNDO_BUFFER_SIZE = 1M
|
||||
ENGINE=NDB;
|
||||
CREATE TABLESPACE ts1
|
||||
ADD DATAFILE './table_space1/datafile.dat'
|
||||
USE LOGFILE GROUP lg
|
||||
INITIAL_SIZE 12M
|
||||
ENGINE NDB;
|
||||
CREATE TABLE test.t1 (a1 int NOT NULL PRIMARY KEY, a2 VARCHAR(256), a3 BLOB)
|
||||
TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
|
||||
CREATE TRIGGER test.trg1 BEFORE INSERT ON test.t1 FOR EACH ROW
|
||||
|
@ -340,25 +275,9 @@ a1 a2 a3
|
|||
DELETE FROM test.t1;
|
||||
DROP TRIGGER test.trg1;
|
||||
DROP TABLE test.t1;
|
||||
ALTER TABLESPACE ts1
|
||||
DROP DATAFILE './table_space1/datafile.dat'
|
||||
ENGINE=NDB;
|
||||
DROP TABLESPACE ts1 ENGINE=NDB;
|
||||
DROP LOGFILE GROUP lg
|
||||
ENGINE=NDB;
|
||||
*****
|
||||
***** Create, update views that operate on disk based tables
|
||||
*****
|
||||
CREATE LOGFILE GROUP lg
|
||||
ADD UNDOFILE './lg_group/undofile.dat'
|
||||
INITIAL_SIZE 16M
|
||||
UNDO_BUFFER_SIZE = 1M
|
||||
ENGINE=NDB;
|
||||
CREATE TABLESPACE ts1
|
||||
ADD DATAFILE './table_space1/datafile.dat'
|
||||
USE LOGFILE GROUP lg
|
||||
INITIAL_SIZE 12M
|
||||
ENGINE NDB;
|
||||
CREATE TABLE test.t1 (a1 int NOT NULL PRIMARY KEY, a2 VARCHAR(256), a3 BLOB)
|
||||
TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
|
||||
CREATE VIEW test.v1 AS SELECT * FROM test.t1;
|
||||
|
@ -394,26 +313,12 @@ a1 a2 a3
|
|||
DROP VIEW test.v1;
|
||||
DELETE FROM test.t1;
|
||||
DROP TABLE test.t1;
|
||||
ALTER TABLESPACE ts1
|
||||
DROP DATAFILE './table_space1/datafile.dat'
|
||||
ENGINE=NDB;
|
||||
DROP TABLESPACE ts1 ENGINE=NDB;
|
||||
DROP LOGFILE GROUP lg
|
||||
ENGINE=NDB;
|
||||
*****
|
||||
***** Create and use disk based table that use auto inc
|
||||
*****
|
||||
CREATE LOGFILE GROUP lg
|
||||
ADD UNDOFILE './lg_group/undofile.dat'
|
||||
INITIAL_SIZE 16M
|
||||
UNDO_BUFFER_SIZE = 1M
|
||||
ENGINE=NDB;
|
||||
CREATE TABLESPACE ts1
|
||||
ADD DATAFILE './table_space1/datafile.dat'
|
||||
USE LOGFILE GROUP lg
|
||||
INITIAL_SIZE 12M
|
||||
ENGINE NDB;
|
||||
CREATE TABLE test.t1 (a1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, a2 VARCHAR(256), a3 BLOB) TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
|
||||
CREATE TABLE test.t1 (a1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
a2 VARCHAR(256), a3 BLOB)
|
||||
TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
|
||||
SELECT * FROM test.t1 ORDER BY a1;
|
||||
a1 a2 a3
|
||||
1 aaaaa10 bbbbb10
|
||||
|
@ -428,27 +333,13 @@ a1 a2 a3
|
|||
10 aaaaa1 bbbbb1
|
||||
DELETE FROM test.t1;
|
||||
DROP TABLE test.t1;
|
||||
ALTER TABLESPACE ts1
|
||||
DROP DATAFILE './table_space1/datafile.dat'
|
||||
ENGINE=NDB;
|
||||
DROP TABLESPACE ts1 ENGINE=NDB;
|
||||
DROP LOGFILE GROUP lg
|
||||
ENGINE=NDB;
|
||||
*****
|
||||
***** Create test that use transaction (commit, rollback)
|
||||
*****
|
||||
CREATE LOGFILE GROUP lg
|
||||
ADD UNDOFILE './lg_group/undofile.dat'
|
||||
INITIAL_SIZE 16M
|
||||
UNDO_BUFFER_SIZE = 1M
|
||||
ENGINE=NDB;
|
||||
CREATE TABLESPACE ts1
|
||||
ADD DATAFILE './table_space1/datafile.dat'
|
||||
USE LOGFILE GROUP lg
|
||||
INITIAL_SIZE 12M
|
||||
ENGINE NDB;
|
||||
SET AUTOCOMMIT=0;
|
||||
CREATE TABLE test.t1 (a1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, a2 VARCHAR(256), a3 BLOB) TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
|
||||
CREATE TABLE test.t1 (a1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
a2 VARCHAR(256), a3 BLOB)
|
||||
TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
|
||||
INSERT INTO test.t1 VALUES(NULL, "aaaaa1", "bbbbb1");
|
||||
COMMIT;
|
||||
SELECT * FROM test.t1 ORDER BY a1;
|
||||
|
@ -462,7 +353,9 @@ a1 a2 a3
|
|||
DELETE FROM test.t1;
|
||||
DROP TABLE test.t1;
|
||||
SET AUTOCOMMIT=1;
|
||||
CREATE TABLE test.t1 (a1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, a2 VARCHAR(256), a3 BLOB) TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
|
||||
CREATE TABLE test.t1 (a1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
a2 VARCHAR(256), a3 BLOB)
|
||||
TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
|
||||
START TRANSACTION;
|
||||
INSERT INTO test.t1 VALUES(NULL, "aaaaa1", "bbbbb1");
|
||||
COMMIT;
|
||||
|
@ -477,27 +370,13 @@ a1 a2 a3
|
|||
1 aaaaa1 bbbbb1
|
||||
DELETE FROM test.t1;
|
||||
DROP TABLE test.t1;
|
||||
ALTER TABLESPACE ts1
|
||||
DROP DATAFILE './table_space1/datafile.dat'
|
||||
ENGINE=NDB;
|
||||
DROP TABLESPACE ts1 ENGINE=NDB;
|
||||
DROP LOGFILE GROUP lg
|
||||
ENGINE=NDB;
|
||||
*****
|
||||
***** Create test that uses locks
|
||||
*****
|
||||
CREATE LOGFILE GROUP lg
|
||||
ADD UNDOFILE './lg_group/undofile.dat'
|
||||
INITIAL_SIZE 16M
|
||||
UNDO_BUFFER_SIZE = 1M
|
||||
ENGINE=NDB;
|
||||
CREATE TABLESPACE ts1
|
||||
ADD DATAFILE './table_space1/datafile.dat'
|
||||
USE LOGFILE GROUP lg
|
||||
INITIAL_SIZE 12M
|
||||
ENGINE NDB;
|
||||
drop table if exists test.t1;
|
||||
CREATE TABLE test.t1 (a1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, a2 VARCHAR(256), a3 BLOB) TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
|
||||
CREATE TABLE test.t1 (a1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
a2 VARCHAR(256), a3 BLOB)
|
||||
TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
|
||||
LOCK TABLES test.t1 write;
|
||||
INSERT INTO test.t1 VALUES(NULL, "aaaaa1", "bbbbb1");
|
||||
INSERT INTO test.t1 VALUES(NULL, "aaaaa2", "bbbbb2");
|
||||
|
@ -520,12 +399,6 @@ a1 a2 a3
|
|||
4 aaaaa3 bbbbb3
|
||||
DELETE FROM test.t1;
|
||||
DROP TABLE test.t1;
|
||||
ALTER TABLESPACE ts1
|
||||
DROP DATAFILE './table_space1/datafile.dat'
|
||||
ENGINE=NDB;
|
||||
DROP TABLESPACE ts1 ENGINE=NDB;
|
||||
DROP LOGFILE GROUP lg
|
||||
ENGINE=NDB;
|
||||
*****
|
||||
***** Create large disk base table, do random queries, check cache hits
|
||||
*****
|
||||
|
@ -562,16 +435,6 @@ length(@x0) length(@b1) length(@d1)
|
|||
select length(@x0),length(@b2),length(@d2) from dual;
|
||||
length(@x0) length(@b2) length(@d2)
|
||||
256 20000 30000
|
||||
CREATE LOGFILE GROUP lg
|
||||
ADD UNDOFILE './lg_group/undofile.dat'
|
||||
INITIAL_SIZE 16M
|
||||
UNDO_BUFFER_SIZE = 1M
|
||||
ENGINE=NDB;
|
||||
CREATE TABLESPACE ts1
|
||||
ADD DATAFILE './table_space1/datafile.dat'
|
||||
USE LOGFILE GROUP lg
|
||||
INITIAL_SIZE 12M
|
||||
ENGINE NDB;
|
||||
CREATE TABLE test.t1 (a1 int NOT NULL PRIMARY KEY, a2 VARCHAR(1000), a3 BLOB)
|
||||
TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
|
||||
INSERT INTO test.t1 values(1,@vc1,@d1);
|
||||
|
@ -599,26 +462,12 @@ a1 length(a2) substr(a2,1+2*900,2) length(a3) substr(a3,1+3*900,3)
|
|||
2 200 3000 dd1
|
||||
DELETE FROM test.t1;
|
||||
DROP TABLE test.t1;
|
||||
ALTER TABLESPACE ts1
|
||||
DROP DATAFILE './table_space1/datafile.dat'
|
||||
ENGINE=NDB;
|
||||
DROP TABLESPACE ts1 ENGINE=NDB;
|
||||
DROP LOGFILE GROUP lg
|
||||
ENGINE=NDB;
|
||||
*****
|
||||
***** Create test that uses COUNT(), SUM(), MAX(), MIN(), NOW(), USER(), TRUNCATE
|
||||
***** Create test that uses COUNT(), SUM(), MAX(), MIN(), NOW(),
|
||||
***** USER(), TRUNCATE
|
||||
*****
|
||||
CREATE LOGFILE GROUP lg
|
||||
ADD UNDOFILE './lg_group/undofile.dat'
|
||||
INITIAL_SIZE 16M
|
||||
UNDO_BUFFER_SIZE = 1M
|
||||
ENGINE=NDB;
|
||||
CREATE TABLESPACE ts1
|
||||
ADD DATAFILE './table_space1/datafile.dat'
|
||||
USE LOGFILE GROUP lg
|
||||
INITIAL_SIZE 12M
|
||||
ENGINE NDB;
|
||||
CREATE TABLE test.t1 (a1 int NOT NULL PRIMARY KEY, a2 VARCHAR(256), a3 BLOB, a4 DATE, a5 CHAR(250))
|
||||
CREATE TABLE test.t1 (a1 int NOT NULL PRIMARY KEY, a2 VARCHAR(256),
|
||||
a3 BLOB, a4 DATE, a5 CHAR(250))
|
||||
TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
|
||||
SELECT COUNT(*) from test.t1;
|
||||
COUNT(*)
|
||||
|
@ -742,5 +591,9 @@ ALTER TABLESPACE ts1
|
|||
DROP DATAFILE './table_space1/datafile.dat'
|
||||
ENGINE=NDB;
|
||||
DROP TABLESPACE ts1 ENGINE=NDB;
|
||||
ALTER TABLESPACE ts2
|
||||
DROP DATAFILE './table_space2/datafile.dat'
|
||||
ENGINE=NDB;
|
||||
DROP TABLESPACE ts2 ENGINE=NDB;
|
||||
DROP LOGFILE GROUP lg
|
||||
ENGINE=NDB;
|
|
@ -60,3 +60,37 @@ t2
|
|||
t3
|
||||
t4
|
||||
drop table t1, t2, t3, t4;
|
||||
create table t1(c1 int key)ENGINE=MyISAM;
|
||||
insert into t1 values(1),(3),(5);
|
||||
select * from t1 order by c1;
|
||||
c1
|
||||
1
|
||||
3
|
||||
5
|
||||
show tables;
|
||||
Tables_in_test
|
||||
create table t1(c1 int key)ENGINE=MyISAM;
|
||||
insert into t1 values(100),(344),(533);
|
||||
select * from t1 order by c1;
|
||||
c1
|
||||
100
|
||||
344
|
||||
533
|
||||
alter table t1 engine=ndb;
|
||||
show tables;
|
||||
Tables_in_test
|
||||
t1
|
||||
Warnings:
|
||||
Warning 1050 Local table test.t1 shadows ndb table
|
||||
select * from t1 order by c1;
|
||||
c1
|
||||
100
|
||||
344
|
||||
533
|
||||
drop table t1;
|
||||
select * from t1 order by c1;
|
||||
c1
|
||||
1
|
||||
3
|
||||
5
|
||||
drop table t1;
|
||||
|
|
|
@ -17,7 +17,7 @@ drop table t1;
|
|||
CREATE TABLE t1 (a int, b int, c int, d int, PRIMARY KEY(a,b))
|
||||
ENGINE = NDB
|
||||
PARTITION BY KEY (c);
|
||||
ERROR HY000: A PRIMARY KEY need to include all fields in the partition function
|
||||
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
|
||||
CREATE TABLE t1 (a int, b int, c int, PRIMARY KEY(a,b))
|
||||
ENGINE = NDB
|
||||
PARTITION BY KEY (a);
|
||||
|
|
22
mysql-test/r/ndbapi.result
Normal file
22
mysql-test/r/ndbapi.result
Normal file
|
@ -0,0 +1,22 @@
|
|||
DROP TABLE IF EXISTS t0;
|
||||
drop database if exists mysqltest;
|
||||
Running ndbapi_simple
|
||||
Running ndbapi_simple_index
|
||||
Running ndbapi_scan
|
||||
Running ndbapi_retries
|
||||
Running ndbapi_async
|
||||
Running ndbapi_async1
|
||||
use TEST_DB;
|
||||
create table t0(c0 int, c1 int, c2 char(4), c3 char(4), c4 text,
|
||||
primary key(c0, c2)) engine ndb charset latin1;
|
||||
insert into t0 values (1, 2, 'a', 'b', null);
|
||||
insert into t0 values (3, 4, 'c', 'd', null);
|
||||
update t0 set c3 = 'e' where c0 = 1 and c2 = 'a';
|
||||
update t0 set c3 = 'f';
|
||||
update t0 set c3 = 'F';
|
||||
update t0 set c2 = 'g' where c0 = 1;
|
||||
update t0 set c2 = 'G' where c0 = 1;
|
||||
update t0 set c0 = 5, c2 = 'H' where c0 = 3;
|
||||
delete from t0;
|
||||
drop table t0;
|
||||
Running mgmapi_logevent
|
|
@ -2,5 +2,4 @@ prepare stmt1 from ' SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND!
|
|||
execute stmt1;
|
||||
ID USER HOST DB COMMAND TIME STATE INFO
|
||||
number root localhost test Query time preparing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND!='Daemon'
|
||||
number event_scheduler localhost NULL Connect time Suspended NULL
|
||||
deallocate prepare stmt1;
|
||||
|
|
2
mysql-test/r/not_valgrind.require
Normal file
2
mysql-test/r/not_valgrind.require
Normal file
|
@ -0,0 +1,2 @@
|
|||
using_valgrind
|
||||
0
|
|
@ -854,3 +854,40 @@ b a
|
|||
20 1
|
||||
10 2
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a int, b int, PRIMARY KEY (a));
|
||||
INSERT INTO t1 VALUES (1,1), (2,2), (3,3);
|
||||
explain SELECT t1.b as a, t2.b as c FROM
|
||||
t1 LEFT JOIN t1 t2 ON (t1.a = t2.a AND t2.a = 2)
|
||||
ORDER BY c;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using temporary; Using filesort
|
||||
1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1
|
||||
SELECT t2.b as c FROM
|
||||
t1 LEFT JOIN t1 t2 ON (t1.a = t2.a AND t2.a = 2)
|
||||
ORDER BY c;
|
||||
c
|
||||
NULL
|
||||
NULL
|
||||
2
|
||||
explain SELECT t1.b as a, t2.b as c FROM
|
||||
t1 JOIN t1 t2 ON (t1.a = t2.a AND t2.a = 2)
|
||||
ORDER BY c;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1
|
||||
1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1
|
||||
CREATE TABLE t2 LIKE t1;
|
||||
INSERT INTO t2 SELECT * from t1;
|
||||
CREATE TABLE t3 LIKE t1;
|
||||
INSERT INTO t3 SELECT * from t1;
|
||||
CREATE TABLE t4 LIKE t1;
|
||||
INSERT INTO t4 SELECT * from t1;
|
||||
INSERT INTO t1 values (0,0),(4,4);
|
||||
SELECT t2.b FROM t1 LEFT JOIN (t2, t3 LEFT JOIN t4 ON t3.a=t4.a)
|
||||
ON (t1.a=t2.a AND t1.b=t3.b) order by t2.b;
|
||||
b
|
||||
NULL
|
||||
NULL
|
||||
1
|
||||
2
|
||||
3
|
||||
DROP TABLE t1,t2,t3,t4;
|
||||
|
|
|
@ -1,4 +1,60 @@
|
|||
drop table if exists t1;
|
||||
create table t1 (s1 char(2) character set utf8)
|
||||
partition by list (case when s1 > 'cz' then 1 else 2 end)
|
||||
(partition p1 values in (1),
|
||||
partition p2 values in (2));
|
||||
drop table t1;
|
||||
create table t1 (a int)
|
||||
partition by key(a)
|
||||
partitions 0.2+e1;
|
||||
ERROR 42000: Only normal integers allowed as number here near '0.2+e1' at line 3
|
||||
create table t1 (a int)
|
||||
partition by key(a)
|
||||
partitions -1;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1' at line 3
|
||||
create table t1 (a int)
|
||||
partition by key(a)
|
||||
partitions 1.5;
|
||||
ERROR 42000: Only normal integers allowed as number here near '1.5' at line 3
|
||||
create table t1 (a int)
|
||||
partition by key(a)
|
||||
partitions 1e+300;
|
||||
ERROR 42000: Only normal integers allowed as number here near '1e+300' at line 3
|
||||
create table t1 (a int)
|
||||
engine = innodb
|
||||
partition by key (a);
|
||||
show table status;
|
||||
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||
t1 InnoDB 10 Compact 2 8192 16384 0 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL partitioned
|
||||
insert into t1 values (0), (1), (2), (3);
|
||||
show table status;
|
||||
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||
t1 InnoDB 10 Compact 4 4096 16384 0 0 0 NULL NULL NULL NULL latin1_swedish_ci NULL partitioned
|
||||
drop table t1;
|
||||
create table t1 (a int auto_increment primary key)
|
||||
engine = innodb
|
||||
partition by key (a);
|
||||
show table status;
|
||||
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||
t1 InnoDB 10 Compact 2 8192 16384 0 0 0 1 NULL NULL NULL latin1_swedish_ci NULL partitioned
|
||||
insert into t1 values (NULL), (NULL), (NULL), (NULL);
|
||||
show table status;
|
||||
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||
t1 InnoDB 10 Compact 4 4096 16384 0 0 0 5 NULL NULL NULL latin1_swedish_ci NULL partitioned
|
||||
insert into t1 values (NULL), (NULL), (NULL), (NULL);
|
||||
show table status;
|
||||
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||
t1 InnoDB 10 Compact 8 2048 16384 0 0 0 9 NULL NULL NULL latin1_swedish_ci NULL partitioned
|
||||
drop table t1;
|
||||
create table t1 (a int)
|
||||
partition by key (a)
|
||||
(partition p0 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data');
|
||||
ERROR 42000: Incorrect table name 'part-data'
|
||||
create table t1 (a int)
|
||||
partition by key (a)
|
||||
(partition p0,
|
||||
partition p1 DATA DIRECTORY 'part-data' INDEX DIRECTORY 'part-data');
|
||||
ERROR 42000: Incorrect table name 'part-data'
|
||||
create table t1 (a int)
|
||||
partition by list (a)
|
||||
(partition p0 values in (1));
|
||||
|
@ -731,7 +787,7 @@ ERROR HY000: Cannot create temporary table with partitions
|
|||
create table t1 (a int, b int) partition by list (a)
|
||||
(partition p1 values in (1), partition p2 values in (2));
|
||||
alter table t1 add primary key (b);
|
||||
ERROR HY000: A PRIMARY KEY need to include all fields in the partition function
|
||||
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
|
@ -750,11 +806,6 @@ t2 CREATE TABLE `t2` (
|
|||
PRIMARY KEY (`a`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='no comment' /*!50100 PARTITION BY KEY (a) */
|
||||
drop table t2;
|
||||
create table t1 (s1 char(2) character set utf8)
|
||||
partition by list (case when s1 > 'cz' then 1 else 2 end)
|
||||
(partition p1 values in (1),
|
||||
partition p2 values in (2));
|
||||
drop table t1;
|
||||
create table t1 (f1 int) partition by hash (f1) as select 1;
|
||||
drop table t1;
|
||||
prepare stmt1 from 'create table t1 (s1 int) partition by hash (s1)';
|
||||
|
@ -1083,12 +1134,12 @@ partition by range (a)
|
|||
subpartition by hash (a)
|
||||
(partition p0 VALUES LESS THAN (1) DATA DIRECTORY = 'hello/master-data/tmpdata' INDEX DIRECTORY = 'hello/master-data/tmpinx'
|
||||
(SUBPARTITION subpart00, SUBPARTITION subpart01));
|
||||
hello/master-data/test/t1.frm
|
||||
hello/master-data/test/t1.par
|
||||
hello/master-data/test/t1#P#p0#SP#subpart00.MYD
|
||||
hello/master-data/test/t1#P#p0#SP#subpart00.MYI
|
||||
hello/master-data/test/t1#P#p0#SP#subpart01.MYD
|
||||
hello/master-data/test/t1#P#p0#SP#subpart01.MYI
|
||||
hello/master-data/test/t1.frm
|
||||
hello/master-data/test/t1.par
|
||||
hello/master-data/tmpdata/t1#P#p0#SP#subpart00.MYD
|
||||
hello/master-data/tmpdata/t1#P#p0#SP#subpart01.MYD
|
||||
hello/master-data/tmpinx/t1#P#p0#SP#subpart00.MYI
|
||||
|
@ -1098,6 +1149,8 @@ ALTER TABLE t1 REORGANIZE PARTITION p0 INTO
|
|||
(SUBPARTITION subpart10, SUBPARTITION subpart11),
|
||||
partition p2 VALUES LESS THAN (2) DATA DIRECTORY = 'hello/master-data/tmpdata' INDEX DIRECTORY = 'hello/master-data/tmpinx'
|
||||
(SUBPARTITION subpart20, SUBPARTITION subpart21));
|
||||
hello/master-data/test/t1.frm
|
||||
hello/master-data/test/t1.par
|
||||
hello/master-data/test/t1#P#p1#SP#subpart10.MYD
|
||||
hello/master-data/test/t1#P#p1#SP#subpart10.MYI
|
||||
hello/master-data/test/t1#P#p1#SP#subpart11.MYD
|
||||
|
@ -1106,8 +1159,6 @@ hello/master-data/test/t1#P#p2#SP#subpart20.MYD
|
|||
hello/master-data/test/t1#P#p2#SP#subpart20.MYI
|
||||
hello/master-data/test/t1#P#p2#SP#subpart21.MYD
|
||||
hello/master-data/test/t1#P#p2#SP#subpart21.MYI
|
||||
hello/master-data/test/t1.frm
|
||||
hello/master-data/test/t1.par
|
||||
hello/master-data/tmpdata/t1#P#p1#SP#subpart10.MYD
|
||||
hello/master-data/tmpdata/t1#P#p1#SP#subpart11.MYD
|
||||
hello/master-data/tmpdata/t1#P#p2#SP#subpart20.MYD
|
||||
|
@ -1117,4 +1168,32 @@ hello/master-data/tmpinx/t1#P#p1#SP#subpart11.MYI
|
|||
hello/master-data/tmpinx/t1#P#p2#SP#subpart20.MYI
|
||||
hello/master-data/tmpinx/t1#P#p2#SP#subpart21.MYI
|
||||
drop table t1;
|
||||
create table t1 (a bigint unsigned not null, primary key(a))
|
||||
engine = myisam
|
||||
partition by key (a)
|
||||
partitions 10;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` bigint(20) unsigned NOT NULL,
|
||||
PRIMARY KEY (`a`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 10 */
|
||||
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE),
|
||||
(18446744073709551613), (18446744073709551612);
|
||||
select * from t1;
|
||||
a
|
||||
18446744073709551612
|
||||
18446744073709551613
|
||||
18446744073709551614
|
||||
18446744073709551615
|
||||
select * from t1 where a = 18446744073709551615;
|
||||
a
|
||||
18446744073709551615
|
||||
delete from t1 where a = 18446744073709551615;
|
||||
select * from t1;
|
||||
a
|
||||
18446744073709551612
|
||||
18446744073709551613
|
||||
18446744073709551614
|
||||
drop table t1;
|
||||
End of 5.1 tests
|
||||
|
|
|
@ -1,4 +1,14 @@
|
|||
DROP TABLE IF EXISTS t1;
|
||||
create table t1 (a int)
|
||||
partition by range (a)
|
||||
subpartition by key (a)
|
||||
(partition p0 values less than (10) (subpartition sp00, subpartition sp01),
|
||||
partition p1 values less than (20) (subpartition sp10, subpartition sp11));
|
||||
alter table t1 reorganize partition p0 into
|
||||
(partition p0 values less than (10) (subpartition sp00,
|
||||
subpartition sp01, subpartition sp02));
|
||||
ERROR HY000: Wrong number of subpartitions defined, mismatch with previous setting
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (f_date DATE, f_varchar VARCHAR(30))
|
||||
PARTITION BY HASH(CAST(YEAR(f_date) AS SIGNED INTEGER)) PARTITIONS 2;
|
||||
SHOW CREATE TABLE t1;
|
||||
|
|
|
@ -1,4 +1,14 @@
|
|||
drop table if exists t1;
|
||||
create table t1 (a date)
|
||||
engine = innodb
|
||||
partition by range (year(a))
|
||||
(partition p0 values less than (2006),
|
||||
partition p1 values less than (2007));
|
||||
explain partitions select * from t1
|
||||
where a between '2006-01-01' and '2007-06-01';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p1 ALL NULL NULL NULL NULL 2 Using where
|
||||
drop table t1;
|
||||
create table t1 (a int unsigned)
|
||||
partition by range (a)
|
||||
(partition pnull values less than (0),
|
||||
|
|
|
@ -1277,3 +1277,900 @@ ERROR 3D000: No database selected
|
|||
create temporary table t1 (i int);
|
||||
ERROR 3D000: No database selected
|
||||
use test;
|
||||
DROP TABLE IF EXISTS t1, t2, t3;
|
||||
CREATE TABLE t1 (i BIGINT, j BIGINT);
|
||||
CREATE TABLE t2 (i BIGINT);
|
||||
CREATE TABLE t3 (i BIGINT, j BIGINT);
|
||||
PREPARE stmt FROM "SELECT * FROM t1 JOIN t2 ON (t2.i = t1.i)
|
||||
LEFT JOIN t3 ON ((t3.i, t3.j) = (t1.i, t1.j))
|
||||
WHERE t1.i = ?";
|
||||
SET @a= 1;
|
||||
EXECUTE stmt USING @a;
|
||||
i j i i j
|
||||
EXECUTE stmt USING @a;
|
||||
i j i i j
|
||||
DEALLOCATE PREPARE stmt;
|
||||
DROP TABLE IF EXISTS t1, t2, t3;
|
||||
End of 5.0 tests.
|
||||
create procedure proc_1() reset query cache;
|
||||
call proc_1();
|
||||
call proc_1();
|
||||
call proc_1();
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin reset query cache; return 1; end|
|
||||
select func_1(), func_1(), func_1() from dual;
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
drop function func_1;
|
||||
prepare abc from "reset query cache";
|
||||
execute abc;
|
||||
execute abc;
|
||||
execute abc;
|
||||
deallocate prepare abc;
|
||||
create procedure proc_1() reset master;
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin reset master; return 1; end|
|
||||
select func_1(), func_1(), func_1() from dual;
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
drop function func_1;
|
||||
prepare abc from "reset master";
|
||||
execute abc;
|
||||
execute abc;
|
||||
execute abc;
|
||||
deallocate prepare abc;
|
||||
create procedure proc_1() reset slave;
|
||||
call proc_1();
|
||||
call proc_1();
|
||||
call proc_1();
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin reset slave; return 1; end|
|
||||
select func_1(), func_1(), func_1() from dual;
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
drop function func_1;
|
||||
prepare abc from "reset slave";
|
||||
execute abc;
|
||||
execute abc;
|
||||
execute abc;
|
||||
deallocate prepare abc;
|
||||
create procedure proc_1(a integer) kill a;
|
||||
call proc_1(0);
|
||||
ERROR HY000: Unknown thread id: 0
|
||||
call proc_1(0);
|
||||
ERROR HY000: Unknown thread id: 0
|
||||
call proc_1(0);
|
||||
ERROR HY000: Unknown thread id: 0
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin kill 0; return 1; end|
|
||||
select func_1() from dual;
|
||||
ERROR HY000: Unknown thread id: 0
|
||||
select func_1() from dual;
|
||||
ERROR HY000: Unknown thread id: 0
|
||||
select func_1() from dual;
|
||||
ERROR HY000: Unknown thread id: 0
|
||||
drop function func_1;
|
||||
prepare abc from "kill 0";
|
||||
execute abc;
|
||||
ERROR HY000: Unknown thread id: 0
|
||||
execute abc;
|
||||
ERROR HY000: Unknown thread id: 0
|
||||
execute abc;
|
||||
ERROR HY000: Unknown thread id: 0
|
||||
deallocate prepare abc;
|
||||
create procedure proc_1() flush hosts;
|
||||
call proc_1();
|
||||
call proc_1();
|
||||
call proc_1();
|
||||
call proc_1();
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin flush hosts; return 1; end|
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
select func_1(), func_1(), func_1() from dual;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
drop function func_1;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
prepare abc from "flush hosts";
|
||||
execute abc;
|
||||
execute abc;
|
||||
execute abc;
|
||||
deallocate prepare abc;
|
||||
create procedure proc_1() flush privileges;
|
||||
call proc_1();
|
||||
call proc_1();
|
||||
call proc_1();
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin flush privileges; return 1; end|
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
select func_1(), func_1(), func_1() from dual;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
drop function func_1;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
prepare abc from "flush privileges";
|
||||
deallocate prepare abc;
|
||||
create procedure proc_1() flush tables with read lock;
|
||||
call proc_1();
|
||||
unlock tables;
|
||||
call proc_1();
|
||||
unlock tables;
|
||||
call proc_1();
|
||||
unlock tables;
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin flush tables with read lock; return 1; end|
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
prepare abc from "flush tables with read lock";
|
||||
execute abc;
|
||||
execute abc;
|
||||
execute abc;
|
||||
deallocate prepare abc;
|
||||
unlock tables;
|
||||
create procedure proc_1() flush tables;
|
||||
call proc_1();
|
||||
call proc_1();
|
||||
call proc_1();
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin flush tables; return 1; end|
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
select func_1(), func_1(), func_1() from dual;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
drop function func_1;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
prepare abc from "flush tables";
|
||||
execute abc;
|
||||
execute abc;
|
||||
execute abc;
|
||||
deallocate prepare abc;
|
||||
create procedure proc_1() flush tables;
|
||||
flush tables;
|
||||
show open tables from mysql;
|
||||
Database Table In_use Name_locked
|
||||
mysql general_log 1 0
|
||||
select Host, User from mysql.user limit 0;
|
||||
Host User
|
||||
select Host, Db from mysql.host limit 0;
|
||||
Host Db
|
||||
show open tables from mysql;
|
||||
Database Table In_use Name_locked
|
||||
mysql user 0 0
|
||||
mysql general_log 1 0
|
||||
mysql host 0 0
|
||||
call proc_1();
|
||||
show open tables from mysql;
|
||||
Database Table In_use Name_locked
|
||||
mysql general_log 1 0
|
||||
select Host, User from mysql.user limit 0;
|
||||
Host User
|
||||
select Host, Db from mysql.host limit 0;
|
||||
Host Db
|
||||
show open tables from mysql;
|
||||
Database Table In_use Name_locked
|
||||
mysql user 0 0
|
||||
mysql general_log 1 0
|
||||
mysql host 0 0
|
||||
call proc_1();
|
||||
show open tables from mysql;
|
||||
Database Table In_use Name_locked
|
||||
mysql general_log 1 0
|
||||
select Host, User from mysql.user limit 0;
|
||||
Host User
|
||||
select Host, Db from mysql.host limit 0;
|
||||
Host Db
|
||||
show open tables from mysql;
|
||||
Database Table In_use Name_locked
|
||||
mysql user 0 0
|
||||
mysql general_log 1 0
|
||||
mysql host 0 0
|
||||
call proc_1();
|
||||
show open tables from mysql;
|
||||
Database Table In_use Name_locked
|
||||
mysql general_log 1 0
|
||||
select Host, User from mysql.user limit 0;
|
||||
Host User
|
||||
select Host, Db from mysql.host limit 0;
|
||||
Host Db
|
||||
show open tables from mysql;
|
||||
Database Table In_use Name_locked
|
||||
mysql user 0 0
|
||||
mysql general_log 1 0
|
||||
mysql host 0 0
|
||||
flush tables;
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin flush tables; return 1; end|
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
select func_1(), func_1(), func_1() from dual;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
drop function func_1;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
flush tables;
|
||||
select Host, User from mysql.user limit 0;
|
||||
Host User
|
||||
select Host, Db from mysql.host limit 0;
|
||||
Host Db
|
||||
show open tables from mysql;
|
||||
Database Table In_use Name_locked
|
||||
mysql user 0 0
|
||||
mysql general_log 1 0
|
||||
mysql host 0 0
|
||||
prepare abc from "flush tables";
|
||||
execute abc;
|
||||
show open tables from mysql;
|
||||
Database Table In_use Name_locked
|
||||
mysql general_log 1 0
|
||||
select Host, User from mysql.user limit 0;
|
||||
Host User
|
||||
select Host, Db from mysql.host limit 0;
|
||||
Host Db
|
||||
show open tables from mysql;
|
||||
Database Table In_use Name_locked
|
||||
mysql user 0 0
|
||||
mysql general_log 1 0
|
||||
mysql host 0 0
|
||||
execute abc;
|
||||
show open tables from mysql;
|
||||
Database Table In_use Name_locked
|
||||
mysql general_log 1 0
|
||||
select Host, User from mysql.user limit 0;
|
||||
Host User
|
||||
select Host, Db from mysql.host limit 0;
|
||||
Host Db
|
||||
show open tables from mysql;
|
||||
Database Table In_use Name_locked
|
||||
mysql user 0 0
|
||||
mysql general_log 1 0
|
||||
mysql host 0 0
|
||||
execute abc;
|
||||
show open tables from mysql;
|
||||
Database Table In_use Name_locked
|
||||
mysql general_log 1 0
|
||||
select Host, User from mysql.user limit 0;
|
||||
Host User
|
||||
select Host, Db from mysql.host limit 0;
|
||||
Host Db
|
||||
show open tables from mysql;
|
||||
Database Table In_use Name_locked
|
||||
mysql user 0 0
|
||||
mysql general_log 1 0
|
||||
mysql host 0 0
|
||||
flush tables;
|
||||
deallocate prepare abc;
|
||||
create procedure proc_1() flush logs;
|
||||
call proc_1();
|
||||
call proc_1();
|
||||
call proc_1();
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin flush logs; return 1; end|
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
select func_1(), func_1(), func_1() from dual;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
drop function func_1;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
prepare abc from "flush logs";
|
||||
execute abc;
|
||||
execute abc;
|
||||
execute abc;
|
||||
deallocate prepare abc;
|
||||
create procedure proc_1() flush status;
|
||||
call proc_1();
|
||||
call proc_1();
|
||||
call proc_1();
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin flush status; return 1; end|
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
select func_1(), func_1(), func_1() from dual;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
drop function func_1;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
prepare abc from "flush status";
|
||||
execute abc;
|
||||
execute abc;
|
||||
execute abc;
|
||||
deallocate prepare abc;
|
||||
create procedure proc_1() flush slave;
|
||||
call proc_1();
|
||||
call proc_1();
|
||||
call proc_1();
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin flush slave; return 1; end|
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
select func_1(), func_1(), func_1() from dual;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
drop function func_1;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
prepare abc from "flush slave";
|
||||
execute abc;
|
||||
execute abc;
|
||||
execute abc;
|
||||
deallocate prepare abc;
|
||||
create procedure proc_1() flush master;
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin flush master; return 1; end|
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
select func_1(), func_1(), func_1() from dual;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
drop function func_1;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
prepare abc from "flush master";
|
||||
deallocate prepare abc;
|
||||
create procedure proc_1() flush des_key_file;
|
||||
call proc_1();
|
||||
call proc_1();
|
||||
call proc_1();
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin flush des_key_file; return 1; end|
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
select func_1(), func_1(), func_1() from dual;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
drop function func_1;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
prepare abc from "flush des_key_file";
|
||||
execute abc;
|
||||
execute abc;
|
||||
execute abc;
|
||||
deallocate prepare abc;
|
||||
create procedure proc_1() flush user_resources;
|
||||
call proc_1();
|
||||
call proc_1();
|
||||
call proc_1();
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin flush user_resources; return 1; end|
|
||||
ERROR 0A000: FLUSH is not allowed in stored function or trigger
|
||||
select func_1(), func_1(), func_1() from dual;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
drop function func_1;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
prepare abc from "flush user_resources";
|
||||
execute abc;
|
||||
execute abc;
|
||||
execute abc;
|
||||
deallocate prepare abc;
|
||||
create procedure proc_1() start slave;
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin start slave; return 1; end|
|
||||
drop function func_1;
|
||||
prepare abc from "start slave";
|
||||
deallocate prepare abc;
|
||||
create procedure proc_1() stop slave;
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin stop slave; return 1; end|
|
||||
drop function func_1;
|
||||
prepare abc from "stop slave";
|
||||
deallocate prepare abc;
|
||||
create procedure proc_1() show binlog events;
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin show binlog events; return 1; end|
|
||||
ERROR 0A000: Not allowed to return a result set from a function
|
||||
select func_1(), func_1(), func_1() from dual;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
drop function func_1;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
prepare abc from "show binlog events";
|
||||
deallocate prepare abc;
|
||||
create procedure proc_1() show slave status;
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin show slave status; return 1; end|
|
||||
ERROR 0A000: Not allowed to return a result set from a function
|
||||
select func_1(), func_1(), func_1() from dual;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
drop function func_1;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
prepare abc from "show slave status";
|
||||
deallocate prepare abc;
|
||||
create procedure proc_1() show master status;
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin show master status; return 1; end|
|
||||
ERROR 0A000: Not allowed to return a result set from a function
|
||||
select func_1(), func_1(), func_1() from dual;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
drop function func_1;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
prepare abc from "show master status";
|
||||
deallocate prepare abc;
|
||||
create procedure proc_1() show master logs;
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin show master logs; return 1; end|
|
||||
ERROR 0A000: Not allowed to return a result set from a function
|
||||
select func_1(), func_1(), func_1() from dual;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
drop function func_1;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
prepare abc from "show master logs";
|
||||
deallocate prepare abc;
|
||||
create procedure proc_1() show events;
|
||||
call proc_1();
|
||||
Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
|
||||
call proc_1();
|
||||
Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
|
||||
call proc_1();
|
||||
Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin show events; return 1; end|
|
||||
ERROR 0A000: Not allowed to return a result set from a function
|
||||
select func_1(), func_1(), func_1() from dual;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
drop function func_1;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
prepare abc from "show events";
|
||||
execute abc;
|
||||
Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
|
||||
execute abc;
|
||||
Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
|
||||
execute abc;
|
||||
Db Name Definer Type Execute at Interval value Interval field Starts Ends Status
|
||||
deallocate prepare abc;
|
||||
create procedure proc_1() show scheduler status;
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin show scheduler status; return 1; end|
|
||||
ERROR 0A000: Not allowed to return a result set from a function
|
||||
select func_1(), func_1(), func_1() from dual;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
drop function func_1;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
prepare abc from "show scheduler status";
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
deallocate prepare abc;
|
||||
ERROR HY000: Unknown prepared statement handler (abc) given to DEALLOCATE PREPARE
|
||||
drop procedure if exists a;
|
||||
create procedure a() select 42;
|
||||
create procedure proc_1(a char(2)) show create procedure a;
|
||||
call proc_1("bb");
|
||||
Procedure sql_mode Create Procedure
|
||||
a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`()
|
||||
select 42
|
||||
call proc_1("bb");
|
||||
Procedure sql_mode Create Procedure
|
||||
a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`()
|
||||
select 42
|
||||
call proc_1("bb");
|
||||
Procedure sql_mode Create Procedure
|
||||
a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`()
|
||||
select 42
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin show create procedure a; return 1; end|
|
||||
ERROR 0A000: Not allowed to return a result set from a function
|
||||
select func_1(), func_1(), func_1() from dual;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
drop function func_1;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
prepare abc from "show create procedure a";
|
||||
execute abc;
|
||||
Procedure sql_mode Create Procedure
|
||||
a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`()
|
||||
select 42
|
||||
execute abc;
|
||||
Procedure sql_mode Create Procedure
|
||||
a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`()
|
||||
select 42
|
||||
execute abc;
|
||||
Procedure sql_mode Create Procedure
|
||||
a CREATE DEFINER=`root`@`localhost` PROCEDURE `a`()
|
||||
select 42
|
||||
deallocate prepare abc;
|
||||
drop procedure a;
|
||||
drop function if exists a;
|
||||
create function a() returns int return 42+13;
|
||||
create procedure proc_1(a char(2)) show create function a;
|
||||
call proc_1("bb");
|
||||
Function sql_mode Create Function
|
||||
a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11)
|
||||
return 42+13
|
||||
call proc_1("bb");
|
||||
Function sql_mode Create Function
|
||||
a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11)
|
||||
return 42+13
|
||||
call proc_1("bb");
|
||||
Function sql_mode Create Function
|
||||
a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11)
|
||||
return 42+13
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin show create function a; return 1; end|
|
||||
ERROR 0A000: Not allowed to return a result set from a function
|
||||
select func_1(), func_1(), func_1() from dual;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
drop function func_1;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
prepare abc from "show create function a";
|
||||
execute abc;
|
||||
Function sql_mode Create Function
|
||||
a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11)
|
||||
return 42+13
|
||||
execute abc;
|
||||
Function sql_mode Create Function
|
||||
a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11)
|
||||
return 42+13
|
||||
execute abc;
|
||||
Function sql_mode Create Function
|
||||
a CREATE DEFINER=`root`@`localhost` FUNCTION `a`() RETURNS int(11)
|
||||
return 42+13
|
||||
deallocate prepare abc;
|
||||
drop function a;
|
||||
drop table if exists tab1;
|
||||
create table tab1(a int, b char(1), primary key(a,b));
|
||||
create procedure proc_1() show create table tab1;
|
||||
call proc_1();
|
||||
Table Create Table
|
||||
tab1 CREATE TABLE `tab1` (
|
||||
`a` int(11) NOT NULL DEFAULT '0',
|
||||
`b` char(1) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`a`,`b`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
call proc_1();
|
||||
Table Create Table
|
||||
tab1 CREATE TABLE `tab1` (
|
||||
`a` int(11) NOT NULL DEFAULT '0',
|
||||
`b` char(1) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`a`,`b`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
call proc_1();
|
||||
Table Create Table
|
||||
tab1 CREATE TABLE `tab1` (
|
||||
`a` int(11) NOT NULL DEFAULT '0',
|
||||
`b` char(1) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`a`,`b`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin show create table tab1; return 1; end|
|
||||
ERROR 0A000: Not allowed to return a result set from a function
|
||||
select func_1(), func_1(), func_1() from dual;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
drop function func_1;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
prepare abc from "show create table tab1";
|
||||
execute abc;
|
||||
Table Create Table
|
||||
tab1 CREATE TABLE `tab1` (
|
||||
`a` int(11) NOT NULL DEFAULT '0',
|
||||
`b` char(1) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`a`,`b`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
execute abc;
|
||||
Table Create Table
|
||||
tab1 CREATE TABLE `tab1` (
|
||||
`a` int(11) NOT NULL DEFAULT '0',
|
||||
`b` char(1) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`a`,`b`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
execute abc;
|
||||
Table Create Table
|
||||
tab1 CREATE TABLE `tab1` (
|
||||
`a` int(11) NOT NULL DEFAULT '0',
|
||||
`b` char(1) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`a`,`b`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
deallocate prepare abc;
|
||||
drop table tab1;
|
||||
drop view if exists v1;
|
||||
drop table if exists t1;
|
||||
create table t1(a int, b char(5));
|
||||
insert into t1 values (1, "one"), (1, "edno"), (2, "two"), (2, "dve");
|
||||
create view v1 as
|
||||
(select a, count(*) from t1 group by a)
|
||||
union all
|
||||
(select b, count(*) from t1 group by b);
|
||||
create procedure proc_1() show create view v1;
|
||||
call proc_1();
|
||||
View Create View
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`)
|
||||
call proc_1();
|
||||
View Create View
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`)
|
||||
call proc_1();
|
||||
View Create View
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`)
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin show create view v1; return 1; end|
|
||||
ERROR 0A000: Not allowed to return a result set from a function
|
||||
select func_1(), func_1(), func_1() from dual;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
drop function func_1;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
prepare abc from "show create view v1";
|
||||
execute abc;
|
||||
View Create View
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`)
|
||||
execute abc;
|
||||
View Create View
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`)
|
||||
execute abc;
|
||||
View Create View
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS (select `t1`.`a` AS `a`,count(0) AS `count(*)` from `t1` group by `t1`.`a`) union all (select `t1`.`b` AS `b`,count(0) AS `count(*)` from `t1` group by `t1`.`b`)
|
||||
deallocate prepare abc;
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
create procedure proc_1() install plugin my_plug soname '/root/some_plugin.so';
|
||||
call proc_1();
|
||||
ERROR HY000: No paths allowed for shared library
|
||||
call proc_1();
|
||||
ERROR HY000: No paths allowed for shared library
|
||||
call proc_1();
|
||||
ERROR HY000: No paths allowed for shared library
|
||||
drop procedure proc_1;
|
||||
create procedure proc_1() install plugin my_plug soname 'some_plugin.so';
|
||||
call proc_1();
|
||||
ERROR HY000: Can't open shared library '/work/mysql-5.1-runtime/mysql-test/lib/mysql/some_plugin.so' (errno: 0 cannot open shared object file: No such file or directory)
|
||||
call proc_1();
|
||||
ERROR HY000: Can't open shared library '/work/mysql-5.1-runtime/mysql-test/lib/mysql/some_plugin.so' (errno: 22 cannot open shared object file: No such file or directory)
|
||||
call proc_1();
|
||||
ERROR HY000: Can't open shared library '/work/mysql-5.1-runtime/mysql-test/lib/mysql/some_plugin.so' (errno: 22 cannot open shared object file: No such file or directory)
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin install plugin my_plug soname '/tmp/plugin'; return 1; end|
|
||||
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||
select func_1(), func_1(), func_1() from dual;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
drop function func_1;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
prepare abc from "install plugin my_plug soname '/root/some_plugin.so'";
|
||||
execute abc;
|
||||
ERROR HY000: No paths allowed for shared library
|
||||
execute abc;
|
||||
ERROR HY000: No paths allowed for shared library
|
||||
deallocate prepare abc;
|
||||
prepare abc from "install plugin my_plug soname 'some_plugin.so'";
|
||||
deallocate prepare abc;
|
||||
create procedure proc_1() uninstall plugin my_plug;
|
||||
call proc_1();
|
||||
ERROR 42000: PLUGIN my_plug does not exist
|
||||
call proc_1();
|
||||
ERROR 42000: PLUGIN my_plug does not exist
|
||||
call proc_1();
|
||||
ERROR 42000: PLUGIN my_plug does not exist
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin uninstall plugin my_plug; return 1; end|
|
||||
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||
select func_1(), func_1(), func_1() from dual;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
drop function func_1;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
prepare abc from "uninstall plugin my_plug";
|
||||
execute abc;
|
||||
ERROR 42000: PLUGIN my_plug does not exist
|
||||
execute abc;
|
||||
ERROR 42000: PLUGIN my_plug does not exist
|
||||
execute abc;
|
||||
ERROR 42000: PLUGIN my_plug does not exist
|
||||
deallocate prepare abc;
|
||||
drop database if exists mysqltest_xyz;
|
||||
create procedure proc_1() create database mysqltest_xyz;
|
||||
call proc_1();
|
||||
drop database if exists mysqltest_xyz;
|
||||
call proc_1();
|
||||
call proc_1();
|
||||
ERROR HY000: Can't create database 'mysqltest_xyz'; database exists
|
||||
drop database if exists mysqltest_xyz;
|
||||
call proc_1();
|
||||
drop database if exists mysqltest_xyz;
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin create database mysqltest_xyz; return 1; end|
|
||||
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||
select func_1(), func_1(), func_1() from dual;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
drop function func_1;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
prepare abc from "create database mysqltest_xyz";
|
||||
execute abc;
|
||||
drop database if exists mysqltest_xyz;
|
||||
execute abc;
|
||||
execute abc;
|
||||
ERROR HY000: Can't create database 'mysqltest_xyz'; database exists
|
||||
drop database if exists mysqltest_xyz;
|
||||
execute abc;
|
||||
drop database if exists mysqltest_xyz;
|
||||
deallocate prepare abc;
|
||||
drop table if exists t1;
|
||||
create table t1 (a int, b char(5));
|
||||
insert into t1 values (1, "one"), (2, "two"), (3, "three");
|
||||
create procedure proc_1() checksum table xyz;
|
||||
call proc_1();
|
||||
Table Checksum
|
||||
test.xyz NULL
|
||||
Warnings:
|
||||
Error 1146 Table 'test.xyz' doesn't exist
|
||||
call proc_1();
|
||||
Table Checksum
|
||||
test.xyz NULL
|
||||
Warnings:
|
||||
Error 1146 Table 'test.xyz' doesn't exist
|
||||
call proc_1();
|
||||
Table Checksum
|
||||
test.xyz NULL
|
||||
Warnings:
|
||||
Error 1146 Table 'test.xyz' doesn't exist
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin checksum table t1; return 1; end|
|
||||
ERROR 0A000: Not allowed to return a result set from a function
|
||||
select func_1(), func_1(), func_1() from dual;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
drop function func_1;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
prepare abc from "checksum table t1";
|
||||
execute abc;
|
||||
Table Checksum
|
||||
test.t1 645809265
|
||||
execute abc;
|
||||
Table Checksum
|
||||
test.t1 645809265
|
||||
execute abc;
|
||||
Table Checksum
|
||||
test.t1 645809265
|
||||
deallocate prepare abc;
|
||||
create procedure proc_1() create user pstest_xyz@localhost;
|
||||
call proc_1();
|
||||
drop user pstest_xyz@localhost;
|
||||
call proc_1();
|
||||
call proc_1();
|
||||
ERROR HY000: Operation CREATE USER failed for 'pstest_xyz'@'localhost'
|
||||
drop user pstest_xyz@localhost;
|
||||
call proc_1();
|
||||
drop user pstest_xyz@localhost;
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin create user pstest_xyz@localhost; return 1; end|
|
||||
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||
select func_1(), func_1(), func_1() from dual;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
drop function func_1;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
prepare abc from "create user pstest_xyz@localhost";
|
||||
execute abc;
|
||||
drop user pstest_xyz@localhost;
|
||||
execute abc;
|
||||
execute abc;
|
||||
ERROR HY000: Operation CREATE USER failed for 'pstest_xyz'@'localhost'
|
||||
drop user pstest_xyz@localhost;
|
||||
execute abc;
|
||||
drop user pstest_xyz@localhost;
|
||||
deallocate prepare abc;
|
||||
drop event if exists xyz;
|
||||
create function func_1() returns int begin create event xyz on schedule at now() do select 123; return 1; end|
|
||||
ERROR 0A000: Not allowed to return a result set from a function
|
||||
select func_1(), func_1(), func_1() from dual;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
drop function func_1;
|
||||
ERROR 42000: FUNCTION test.func_1 does not exist
|
||||
prepare abc from "create event xyz on schedule at now() do select 123";
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
deallocate prepare abc;
|
||||
ERROR HY000: Unknown prepared statement handler (abc) given to DEALLOCATE PREPARE
|
||||
drop event if exists xyz;
|
||||
create event xyz on schedule every 5 minute disable do select 123;
|
||||
create procedure proc_1() alter event xyz comment 'xyz';
|
||||
call proc_1();
|
||||
drop event xyz;
|
||||
create event xyz on schedule every 5 minute disable do select 123;
|
||||
call proc_1();
|
||||
drop event xyz;
|
||||
create event xyz on schedule every 5 minute disable do select 123;
|
||||
call proc_1();
|
||||
drop event xyz;
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin alter event xyz comment 'xyz'; return 1; end|
|
||||
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||
prepare abc from "alter event xyz comment 'xyz'";
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
deallocate prepare abc;
|
||||
ERROR HY000: Unknown prepared statement handler (abc) given to DEALLOCATE PREPARE
|
||||
drop event if exists xyz;
|
||||
create event xyz on schedule every 5 minute disable do select 123;
|
||||
create procedure proc_1() drop event xyz;
|
||||
call proc_1();
|
||||
create event xyz on schedule every 5 minute disable do select 123;
|
||||
call proc_1();
|
||||
call proc_1();
|
||||
ERROR HY000: Unknown event 'xyz'
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin drop event xyz; return 1; end|
|
||||
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
|
||||
prepare abc from "drop event xyz";
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
deallocate prepare abc;
|
||||
ERROR HY000: Unknown prepared statement handler (abc) given to DEALLOCATE PREPARE
|
||||
drop table if exists t1;
|
||||
create table t1 (a int, b char(5)) engine=myisam;
|
||||
insert into t1 values (1, "one"), (2, "two"), (3, "three");
|
||||
SET GLOBAL new_cache.key_buffer_size=128*1024;
|
||||
create procedure proc_1() cache index t1 in new_cache;
|
||||
call proc_1();
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 assign_to_keycache status OK
|
||||
call proc_1();
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 assign_to_keycache status OK
|
||||
call proc_1();
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 assign_to_keycache status OK
|
||||
drop procedure proc_1;
|
||||
SET GLOBAL second_cache.key_buffer_size=128*1024;
|
||||
prepare abc from "cache index t1 in second_cache";
|
||||
execute abc;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 assign_to_keycache status OK
|
||||
execute abc;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 assign_to_keycache status OK
|
||||
execute abc;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 assign_to_keycache status OK
|
||||
deallocate prepare abc;
|
||||
drop table t1;
|
||||
drop table if exists t1;
|
||||
drop table if exists t2;
|
||||
create table t1 (a int, b char(5)) engine=myisam;
|
||||
insert into t1 values (1, "one"), (2, "two"), (3, "three");
|
||||
create table t2 (a int, b char(5)) engine=myisam;
|
||||
insert into t2 values (1, "one"), (2, "two"), (3, "three");
|
||||
create procedure proc_1() load index into cache t1 ignore leaves;
|
||||
call proc_1();
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 preload_keys status OK
|
||||
call proc_1();
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 preload_keys status OK
|
||||
call proc_1();
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 preload_keys status OK
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin load index into cache t1 ignore leaves; return 1; end|
|
||||
ERROR 0A000: Not allowed to return a result set from a function
|
||||
prepare abc from "load index into cache t2 ignore leaves";
|
||||
execute abc;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t2 preload_keys status OK
|
||||
execute abc;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t2 preload_keys status OK
|
||||
execute abc;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t2 preload_keys status OK
|
||||
deallocate prepare abc;
|
||||
drop table t1, t2;
|
||||
create procedure proc_1() show errors;
|
||||
call proc_1();
|
||||
Level Code Message
|
||||
call proc_1();
|
||||
Level Code Message
|
||||
call proc_1();
|
||||
Level Code Message
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin show errors; return 1; end|
|
||||
ERROR 0A000: Not allowed to return a result set from a function
|
||||
prepare abc from "show errors";
|
||||
deallocate prepare abc;
|
||||
drop table if exists t1;
|
||||
drop table if exists t2;
|
||||
create procedure proc_1() show warnings;
|
||||
drop table if exists t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1'
|
||||
call proc_1();
|
||||
Level Code Message
|
||||
drop table if exists t2;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't2'
|
||||
call proc_1();
|
||||
Level Code Message
|
||||
drop table if exists t1, t2;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1'
|
||||
Note 1051 Unknown table 't2'
|
||||
call proc_1();
|
||||
Level Code Message
|
||||
drop procedure proc_1;
|
||||
create function func_1() returns int begin show warnings; return 1; end|
|
||||
ERROR 0A000: Not allowed to return a result set from a function
|
||||
prepare abc from "show warnings";
|
||||
drop table if exists t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1'
|
||||
execute abc;
|
||||
Level Code Message
|
||||
Note 1051 Unknown table 't1'
|
||||
drop table if exists t2;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't2'
|
||||
execute abc;
|
||||
Level Code Message
|
||||
Note 1051 Unknown table 't2'
|
||||
drop table if exists t1, t2;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1'
|
||||
Note 1051 Unknown table 't2'
|
||||
execute abc;
|
||||
Level Code Message
|
||||
Note 1051 Unknown table 't1'
|
||||
Note 1051 Unknown table 't2'
|
||||
deallocate prepare abc;
|
||||
|
|
|
@ -308,17 +308,11 @@ prepare stmt4 from ' show engine bdb logs ';
|
|||
execute stmt4;
|
||||
prepare stmt4 from ' show grants for user ';
|
||||
prepare stmt4 from ' show create table t2 ';
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
prepare stmt4 from ' show master status ';
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
prepare stmt4 from ' show master logs ';
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
prepare stmt4 from ' show slave status ';
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
prepare stmt4 from ' show warnings limit 20 ';
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
prepare stmt4 from ' show errors limit 20 ';
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
prepare stmt4 from ' show storage engines ';
|
||||
execute stmt4;
|
||||
drop table if exists t5;
|
||||
|
@ -387,10 +381,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
|
|||
prepare stmt4 from ' use test ' ;
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
prepare stmt3 from ' create database mysqltest ';
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
create database mysqltest ;
|
||||
prepare stmt3 from ' drop database mysqltest ';
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
drop database mysqltest ;
|
||||
prepare stmt3 from ' describe t2 ';
|
||||
execute stmt3;
|
||||
|
@ -412,7 +404,6 @@ execute stmt1 ;
|
|||
prepare stmt1 from ' optimize table t1 ' ;
|
||||
prepare stmt1 from ' analyze table t1 ' ;
|
||||
prepare stmt1 from ' checksum table t1 ' ;
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
prepare stmt1 from ' repair table t1 ' ;
|
||||
prepare stmt1 from ' restore table t1 from ''data.txt'' ' ;
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
|
@ -440,11 +431,8 @@ execute stmt5;
|
|||
1
|
||||
SET sql_mode="";
|
||||
prepare stmt1 from ' flush local privileges ' ;
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
prepare stmt1 from ' reset query cache ' ;
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
prepare stmt1 from ' KILL 0 ';
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
prepare stmt1 from ' explain select a from t1 order by b ';
|
||||
execute stmt1;
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue