Commit 5e60232d authored by mskold/marty@linux.site's avatar mskold/marty@linux.site

Merge mysql.com:/windows/Linux_space/MySQL/mysql-5.1-new-ndb

into  mysql.com:/windows/Linux_space/MySQL/mysql-5.1
parents 9707d43c 4525ea4b
...@@ -34,6 +34,8 @@ ...@@ -34,6 +34,8 @@
*.vcproj *.vcproj
*/*.dir/* */*.dir/*
*/*_pure_*warnings */*_pure_*warnings
*/.deps
*/.libs/*
*/.pure */.pure
*/debug/* */debug/*
*/release/* */release/*
......
#! /bin/sh #!/usr/bin/bash
gmake -k clean || true
/bin/rm -f */.deps/*.P config.cache
path=`dirname $0` path=`dirname $0`
. "$path/autorun.sh" . "$path/SETUP.sh"
extra_flags=""
CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa" CXX=gcc CXXFLAGS="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa -g" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client extra_configs="$max_configs"
gmake -j 4 . "$path/FINISH.sh"
#! /bin/sh #!/usr/bin/bash
gmake -k clean || true
/bin/rm -f */.deps/*.P config.cache
path=`dirname $0` path=`dirname $0`
. "$path/autorun.sh" . "$path/SETUP.sh"
extra_flags="$debug_cflags"
CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa" CXX=gcc CXXFLAGS="-Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa -g" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-debug extra_configs="$debug_configs $max_configs"
gmake -j 4 . "$path/FINISH.sh"
...@@ -75,5 +75,6 @@ hours: ...@@ -75,5 +75,6 @@ hours:
[tomas:]checkout:get [tomas:]checkout:get
[guilhem:]checkout:get [guilhem:]checkout:get
[pekka:]checkout:get [pekka:]checkout:get
[msvensson:]checkout:get
checkout:edit checkout:edit
eoln:unix eoln:unix
...@@ -146,5 +146,7 @@ ADD_SUBDIRECTORY(sql) ...@@ -146,5 +146,7 @@ ADD_SUBDIRECTORY(sql)
ADD_SUBDIRECTORY(server-tools/instance-manager) ADD_SUBDIRECTORY(server-tools/instance-manager)
ADD_SUBDIRECTORY(libmysql) ADD_SUBDIRECTORY(libmysql)
ADD_SUBDIRECTORY(tests) ADD_SUBDIRECTORY(tests)
ADD_SUBDIRECTORY(libmysqld)
ADD_SUBDIRECTORY(libmysqld/examples) # disable libmysqld until it's fixed, so we can use Cmake 2.2 and 2.4
#ADD_SUBDIRECTORY(libmysqld)
#ADD_SUBDIRECTORY(libmysqld/examples)
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
noinst_SCRIPTS = generate-text-files.pl noinst_SCRIPTS = generate-text-files.pl
EXTRA_DIST = $(noinst_SCRIPTS) mysql.info INSTALL-BINARY EXTRA_DIST = $(noinst_SCRIPTS) manual.chm mysql.info INSTALL-BINARY
TXT_FILES= ../INSTALL-SOURCE ../INSTALL-WIN-SOURCE ../EXCEPTIONS-CLIENT \ TXT_FILES= ../INSTALL-SOURCE ../INSTALL-WIN-SOURCE ../EXCEPTIONS-CLIENT \
INSTALL-BINARY ../support-files/MacOSX/ReadMe.txt INSTALL-BINARY ../support-files/MacOSX/ReadMe.txt
......
*********************************************************
This is a dummy placeholder file for "manual.chm" in the
MySQL source trees.
Note, that the documentation has been moved into a separate
BitKeeper source tree named "mysqldoc" - do not attempt to edit this
file! All changes to it should be done in the mysqldoc tree.
This dummy file is being replaced with the actual file from the
mysqldoc tree when building the official source distribution.
*********************************************************
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)
...@@ -420,7 +420,7 @@ AC_PATH_PROG(PS, ps, ps) ...@@ -420,7 +420,7 @@ AC_PATH_PROG(PS, ps, ps)
AC_MSG_CHECKING("how to check if pid exists") AC_MSG_CHECKING("how to check if pid exists")
PS=$ac_cv_path_PS PS=$ac_cv_path_PS
# Linux style # Linux style
if $PS p $$ 2> /dev/null | grep $0 > /dev/null if $PS p $$ 2> /dev/null | grep `echo $0 | sed s/\-//` > /dev/null
then then
FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null" FIND_PROC="$PS p \$\$PID | grep -v grep | grep \$\$MYSQLD > /dev/null"
# Solaris # Solaris
...@@ -1086,6 +1086,7 @@ EOF ...@@ -1086,6 +1086,7 @@ EOF
# #
echo -n "making sure specific build files are writable... " echo -n "making sure specific build files are writable... "
for file in \ for file in \
Docs/manual.chm \
Docs/mysql.info \ Docs/mysql.info \
Docs/INSTALL-BINARY \ Docs/INSTALL-BINARY \
INSTALL-SOURCE \ INSTALL-SOURCE \
...@@ -1861,7 +1862,7 @@ esac ...@@ -1861,7 +1862,7 @@ esac
# isinf() could be a function or a macro (HPUX) # isinf() could be a function or a macro (HPUX)
AC_MSG_CHECKING(for isinf with <math.h>) AC_MSG_CHECKING(for isinf with <math.h>)
AC_TRY_LINK([#include <math.h>], [float f = 0.0; isinf(f)], AC_TRY_LINK([#include <math.h>], [float f = 0.0; int r = isinf(f); return r],
AC_MSG_RESULT(yes) AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_ISINF, [1], [isinf() macro or function]), AC_DEFINE(HAVE_ISINF, [1], [isinf() macro or function]),
AC_MSG_RESULT(no)) AC_MSG_RESULT(no))
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#endif /* _WIN32 */ #endif /* _WIN32 */
#if !defined(_SOCKLEN_T) && (defined(__MACH__) || defined(_WIN32)) #if !defined(_SOCKLEN_T) && defined(_WIN32)
typedef int socklen_t; typedef int socklen_t;
#endif #endif
......
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)
...@@ -25,7 +25,6 @@ functions */ ...@@ -25,7 +25,6 @@ functions */
#if defined(_MSC_VER) && _MSC_VER >= 1400 #if defined(_MSC_VER) && _MSC_VER >= 1400
/* Avoid endless warnings about sprintf() etc. being unsafe. */ /* Avoid endless warnings about sprintf() etc. being unsafe. */
#define _CRT_SECURE_NO_DEPRECATE 1 #define _CRT_SECURE_NO_DEPRECATE 1
#define _USE_32BIT_TIME_T 1 /* force time_t to be 32 bit */
#endif #endif
#include <sys/locking.h> #include <sys/locking.h>
......
...@@ -372,7 +372,9 @@ enum ha_base_keytype { ...@@ -372,7 +372,9 @@ enum ha_base_keytype {
#define HA_ERR_TABLE_NEEDS_UPGRADE 164 /* The table changed in storage engine */ #define HA_ERR_TABLE_NEEDS_UPGRADE 164 /* The table changed in storage engine */
#define HA_ERR_TABLE_READONLY 165 /* The table is not writable */ #define HA_ERR_TABLE_READONLY 165 /* The table is not writable */
#define HA_ERR_LAST 165 /*Copy last error nr.*/ #define HA_ERR_AUTOINC_READ_FAILED 166/* Failed to get the next autoinc value */
#define HA_ERR_AUTOINC_ERANGE 167 /* Failed to set the row autoinc value */
#define HA_ERR_LAST 167 /*Copy last error nr.*/
/* Add error numbers before HA_ERR_LAST and change it accordingly. */ /* Add error numbers before HA_ERR_LAST and change it accordingly. */
#define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1) #define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1)
......
...@@ -210,7 +210,7 @@ ...@@ -210,7 +210,7 @@
/* Fix problem with S_ISLNK() on Linux */ /* Fix problem with S_ISLNK() on Linux */
#if defined(TARGET_OS_LINUX) #if defined(TARGET_OS_LINUX) || defined(__GLIBC__)
#undef _GNU_SOURCE #undef _GNU_SOURCE
#define _GNU_SOURCE 1 #define _GNU_SOURCE 1
#endif #endif
......
...@@ -55,6 +55,14 @@ C_MODE_START ...@@ -55,6 +55,14 @@ C_MODE_START
#if defined(__WIN__) #if defined(__WIN__)
#define O_NONBLOCK 1 /* For emulation of fcntl() */ #define O_NONBLOCK 1 /* For emulation of fcntl() */
/*
SHUT_RDWR is called SD_BOTH in windows and
is defined to 2 in winsock2.h
#define SD_BOTH 0x02
*/
#define SHUT_RDWR 0x02
#endif #endif
/* /*
......
...@@ -33,7 +33,12 @@ extern uchar days_in_month[]; ...@@ -33,7 +33,12 @@ extern uchar days_in_month[];
Portable time_t replacement. Portable time_t replacement.
Should be signed and hold seconds for 1902-2038 range. Should be signed and hold seconds for 1902-2038 range.
*/ */
#if defined(_WIN64) || defined(WIN64)
/* on Win64 long is still 4 bytes (not 8!) */
typedef LONG64 my_time_t;
#else
typedef long my_time_t; typedef long my_time_t;
#endif
#define MY_TIME_T_MAX LONG_MAX #define MY_TIME_T_MAX LONG_MAX
#define MY_TIME_T_MIN LONG_MIN #define MY_TIME_T_MIN LONG_MIN
......
...@@ -88,8 +88,8 @@ struct st_mysql_plugin ...@@ -88,8 +88,8 @@ struct st_mysql_plugin
const char *name; /* plugin name */ const char *name; /* plugin name */
const char *author; /* plugin author (for SHOW PLUGINS) */ const char *author; /* plugin author (for SHOW PLUGINS) */
const char *descr; /* general descriptive text (for SHOW PLUGINS ) */ const char *descr; /* general descriptive text (for SHOW PLUGINS ) */
int (*init)(void); /* the function to invoke when plugin is loaded */ int (*init)(void *); /* the function to invoke when plugin is loaded */
int (*deinit)(void); /* the function to invoke when plugin is unloaded */ int (*deinit)(void *);/* the function to invoke when plugin is unloaded */
unsigned int version; /* plugin version (for SHOW PLUGINS) */ unsigned int version; /* plugin version (for SHOW PLUGINS) */
struct st_mysql_show_var *status_vars; struct st_mysql_show_var *status_vars;
void * __reserved1; /* placeholder for system variables */ void * __reserved1; /* placeholder for system variables */
......
#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 )
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)
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)
# include/concurrent.inc
# #
# Concurrent InnoDB tests, mainly in UPDATE's # Concurrent tests for transactional storage engines, mainly in UPDATE's
# Bug#3300 # Bug#3300
# Designed and tested by Sinisa Milivojevic, sinisa@mysql.com # Designed and tested by Sinisa Milivojevic, sinisa@mysql.com
# #
# two non-interfering UPDATE's not changing result set # two non-interfering UPDATE's not changing result set
# #
# The variable
# test takes circa 5 minutes to run, so it's big # $engine_type -- storage engine to be tested
-- source include/big_test.inc # has to be set before sourcing this script.
#
# Last update:
# 2006-08-02 ML test refactored
# old name was t/innodb_concurrent.test
# main code went into include/concurrent.inc
#
connection default; connection default;
eval SET SESSION STORAGE_ENGINE = $engine_type;
--disable_warnings
drop table if exists t1; drop table if exists t1;
create table t1(eta int(11) not null, tipo int(11), c varchar(255)) engine=innodb; --enable_warnings
create table t1(eta int(11) not null, tipo int(11), c varchar(255));
connect (thread1, localhost, mysqltest,,); connect (thread1, localhost, mysqltest,,);
connection thread1; connection thread1;
eval SET SESSION STORAGE_ENGINE = $engine_type;
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc"); insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
...@@ -57,7 +68,7 @@ drop table t1; ...@@ -57,7 +68,7 @@ drop table t1;
# #
#connect (thread1, localhost, mysqltest,,); #connect (thread1, localhost, mysqltest,,);
connection thread1; connection thread1;
create table t1(eta int(11) not null, tipo int(11), c varchar(255)) engine=innodb; create table t1(eta int(11) not null, tipo int(11), c varchar(255));
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc"); insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
...@@ -103,7 +114,7 @@ drop table t1; ...@@ -103,7 +114,7 @@ drop table t1;
#connect (thread1, localhost, mysqltest,,); #connect (thread1, localhost, mysqltest,,);
connection thread1; connection thread1;
create table t1 (a int not null, b int not null) engine=innodb; create table t1 (a int not null, b int not null);
insert into t1 values (1,1),(2,1),(3,1),(4,1); insert into t1 values (1,1),(2,1),(3,1),(4,1);
select get_lock("hello2",1000); select get_lock("hello2",1000);
#connect (thread2, localhost, mysqltest,,); #connect (thread2, localhost, mysqltest,,);
...@@ -132,7 +143,7 @@ drop table t1; ...@@ -132,7 +143,7 @@ drop table t1;
# #
#connect (thread1, localhost, mysqltest,,); #connect (thread1, localhost, mysqltest,,);
connection thread1; connection thread1;
create table t1(eta int(11) not null, tipo int(11), c varchar(255)) engine=innodb; create table t1(eta int(11) not null, tipo int(11), c varchar(255));
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc"); insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
...@@ -175,7 +186,7 @@ drop table t1; ...@@ -175,7 +186,7 @@ drop table t1;
# #
#connect (thread1, localhost, mysqltest,,); #connect (thread1, localhost, mysqltest,,);
connection thread1; connection thread1;
create table t1(eta int(11) not null, tipo int(11), c varchar(255)) engine=innodb; create table t1(eta int(11) not null, tipo int(11), c varchar(255));
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc"); insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
...@@ -218,7 +229,7 @@ drop table t1; ...@@ -218,7 +229,7 @@ drop table t1;
# #
#connect (thread1, localhost, mysqltest,,); #connect (thread1, localhost, mysqltest,,);
connection thread1; connection thread1;
create table t1(eta int(11) not null, tipo int(11), c varchar(255)) engine=innodb; create table t1(eta int(11) not null, tipo int(11), c varchar(255));
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc"); insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
...@@ -261,7 +272,7 @@ drop table t1; ...@@ -261,7 +272,7 @@ drop table t1;
# #
#connect (thread1, localhost, mysqltest,,); #connect (thread1, localhost, mysqltest,,);
connection thread1; connection thread1;
create table t1(eta int(11) not null, tipo int(11), c varchar(255)) engine=innodb; create table t1(eta int(11) not null, tipo int(11), c varchar(255));
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc"); insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
...@@ -305,7 +316,7 @@ drop table t1; ...@@ -305,7 +316,7 @@ drop table t1;
# #
#connect (thread1, localhost, mysqltest,,); #connect (thread1, localhost, mysqltest,,);
connection thread1; connection thread1;
create table t1(eta int(11) not null, tipo int(11), c varchar(255)) engine=innodb; create table t1(eta int(11) not null, tipo int(11), c varchar(255));
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc"); insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
......
-- source include/have_innodb.inc # include/deadlock.inc
# Can't test this with embedded server #
-- source include/not_embedded.inc # The variable
# $engine_type -- storage engine to be tested
# has to be set before sourcing this script.
#
# Last update:
# 2006-07-26 ML refactoring + print when connection is switched
# old name was t/innodb-deadlock.test
# main code went into include/deadlock.inc
#
--echo # Establish connection con1 (user=root)
connect (con1,localhost,root,,); connect (con1,localhost,root,,);
--echo # Establish connection con2 (user=root)
connect (con2,localhost,root,,); connect (con2,localhost,root,,);
--disable_warnings --disable_warnings
...@@ -13,29 +23,34 @@ drop table if exists t1,t2; ...@@ -13,29 +23,34 @@ drop table if exists t1,t2;
# Testing of FOR UPDATE # Testing of FOR UPDATE
# #
--echo # Switch to connection con1
connection con1; connection con1;
create table t1 (id integer, x integer) engine=INNODB; eval create table t1 (id integer, x integer) engine = $engine_type;
insert into t1 values(0, 0); insert into t1 values(0, 0);
set autocommit=0; set autocommit=0;
SELECT * from t1 where id = 0 FOR UPDATE; SELECT * from t1 where id = 0 FOR UPDATE;
--echo # Switch to connection con2
connection con2; connection con2;
set autocommit=0; set autocommit=0;
# The following query should hang because con1 is locking the page # The following query should hang because con1 is locking the record
--send --send
update t1 set x=2 where id = 0; update t1 set x=2 where id = 0;
--sleep 2 --sleep 2
--echo # Switch to connection con1
connection con1; connection con1;
update t1 set x=1 where id = 0; update t1 set x=1 where id = 0;
select * from t1; select * from t1;
commit; commit;
--echo # Switch to connection con2
connection con2; connection con2;
reap; reap;
commit; commit;
--echo # Switch to connection con1
connection con1; connection con1;
select * from t1; select * from t1;
commit; commit;
...@@ -45,9 +60,10 @@ drop table t1; ...@@ -45,9 +60,10 @@ drop table t1;
# Testing of FOR UPDATE # Testing of FOR UPDATE
# #
--echo # Switch to connection con1
connection con1; connection con1;
create table t1 (id integer, x integer) engine=INNODB; eval create table t1 (id integer, x integer) engine = $engine_type;
create table t2 (b integer, a integer) engine=INNODB; eval create table t2 (b integer, a integer) engine = $engine_type;
insert into t1 values(0, 0), (300, 300); insert into t1 values(0, 0), (300, 300);
insert into t2 values(0, 10), (1, 20), (2, 30); insert into t2 values(0, 10), (1, 20), (2, 30);
commit; commit;
...@@ -57,61 +73,75 @@ update t2 set a=100 where b=(SELECT x from t1 where id = b FOR UPDATE); ...@@ -57,61 +73,75 @@ update t2 set a=100 where b=(SELECT x from t1 where id = b FOR UPDATE);
select * from t2; select * from t2;
select * from t1; select * from t1;
--echo # Switch to connection con2
connection con2; connection con2;
set autocommit=0; set autocommit=0;
# The following query should hang because con1 is locking the page # The following query should hang because con1 is locking the record
--send --send
update t1 set x=2 where id = 0; update t1 set x=2 where id = 0;
--sleep 2 --sleep 2
--echo # Switch to connection con1
connection con1; connection con1;
update t1 set x=1 where id = 0; update t1 set x=1 where id = 0;
select * from t1; select * from t1;
commit; commit;
--echo # Switch to connection con2
connection con2; connection con2;
reap; reap;
commit; commit;
--echo # Switch to connection con1
connection con1; connection con1;
select * from t1; select * from t1;
commit; commit;
drop table t1, t2; drop table t1, t2;
create table t1 (id integer, x integer) engine=INNODB; eval create table t1 (id integer, x integer) engine = $engine_type;
create table t2 (b integer, a integer) engine=INNODB; eval create table t2 (b integer, a integer) engine = $engine_type;
insert into t1 values(0, 0), (300, 300); insert into t1 values(0, 0), (300, 300);
insert into t2 values(0, 0), (1, 20), (2, 30); insert into t2 values(0, 0), (1, 20), (2, 30);
commit; commit;
--echo # Switch to connection con1
connection con1; connection con1;
select a,b from t2 UNION SELECT id, x from t1 FOR UPDATE; select a,b from t2 UNION SELECT id, x from t1 FOR UPDATE;
select * from t2; select * from t2;
select * from t1; select * from t1;
--echo # Switch to connection con2
connection con2; connection con2;
# The following query should hang because con1 is locking the page # The following query should hang because con1 is locking the record
update t2 set a=2 where b = 0; update t2 set a=2 where b = 0;
select * from t2; select * from t2;
--send --send
update t1 set x=2 where id = 0; update t1 set x=2 where id = 0;
--sleep 2 --sleep 2
--echo # Switch to connection con1
connection con1; connection con1;
update t1 set x=1 where id = 0; update t1 set x=1 where id = 0;
select * from t1; select * from t1;
commit; commit;
--echo # Switch to connection con2
connection con2; connection con2;
reap; reap;
commit; commit;
--echo # Switch to connection con1
connection con1; connection con1;
select * from t1; select * from t1;
commit; commit;
# Cleanup
--echo # Switch to connection default + disconnect con1 and con2
connection default;
disconnect con1;
disconnect con2;
drop table t1, t2; drop table t1, t2;
# End of 4.1 tests # End of 4.1 tests
# include/handler.inc
#
# The variables
# $engine_type -- storage engine to be tested
# $other_engine_type -- storage engine <> $engine_type
# $other_handler_engine_type -- storage engine <> $engine_type, if possible
# 1. $other_handler_engine_type must support handler
# 2. $other_handler_engine_type must point to an all
# time available storage engine
# 2006-08 MySQL 5.1 MyISAM and MEMORY only
# have to be set before sourcing this script.
-- source include/not_embedded.inc -- source include/not_embedded.inc
# #
# test of HANDLER ... # test of HANDLER ...
# #
# Last update:
# 2006-07-31 ML test refactored (MySQL 5.1)
# code of t/handler.test and t/innodb_handler.test united
# main testing code put into include/handler.inc
#
# should work in embedded server after mysqltest is fixed eval SET SESSION STORAGE_ENGINE = $engine_type;
-- source include/not_embedded.inc
--disable_warnings --disable_warnings
drop table if exists t1,t3,t4,t5; drop table if exists t1,t3,t4,t5;
...@@ -74,6 +89,22 @@ handler t2 read next; ...@@ -74,6 +89,22 @@ handler t2 read next;
handler t2 read last; handler t2 read last;
handler t2 close; handler t2 close;
handler t1 open;
handler t1 read a next; # this used to crash as a bug#5373
handler t1 read a next;
handler t1 close;
handler t1 open;
handler t1 read a prev; # this used to crash as a bug#5373
handler t1 read a prev;
handler t1 close;
handler t1 open as t2;
handler t2 read first;
eval alter table t1 engine = $engine_type;
--error 1109
handler t2 read first;
# #
# DROP TABLE / ALTER TABLE # DROP TABLE / ALTER TABLE
# #
...@@ -84,7 +115,7 @@ insert into t1 values (17); ...@@ -84,7 +115,7 @@ insert into t1 values (17);
--error 1109 --error 1109
handler t2 read first; handler t2 read first;
handler t1 open as t2; handler t1 open as t2;
alter table t1 engine=MyISAM; eval alter table t1 engine=$other_engine_type;
--error 1109 --error 1109
handler t2 read first; handler t2 read first;
drop table t1; drop table t1;
...@@ -303,7 +334,7 @@ insert into t5 values ("t5"); ...@@ -303,7 +334,7 @@ insert into t5 values ("t5");
handler t5 open as h5; handler t5 open as h5;
handler h5 read first limit 9; handler h5 read first limit 9;
# close first # close first
alter table t1 engine=MyISAM; eval alter table t1 engine=$other_handler_engine_type;
--error 1109 --error 1109
handler h1 read first limit 9; handler h1 read first limit 9;
handler h2 read first limit 9; handler h2 read first limit 9;
...@@ -311,7 +342,7 @@ handler h3 read first limit 9; ...@@ -311,7 +342,7 @@ handler h3 read first limit 9;
handler h4 read first limit 9; handler h4 read first limit 9;
handler h5 read first limit 9; handler h5 read first limit 9;
# close last # close last
alter table t5 engine=MyISAM; eval alter table t5 engine=$other_handler_engine_type;
--error 1109 --error 1109
handler h1 read first limit 9; handler h1 read first limit 9;
handler h2 read first limit 9; handler h2 read first limit 9;
...@@ -320,7 +351,7 @@ handler h4 read first limit 9; ...@@ -320,7 +351,7 @@ handler h4 read first limit 9;
--error 1109 --error 1109
handler h5 read first limit 9; handler h5 read first limit 9;
# close middle # close middle
alter table t3 engine=MyISAM; eval alter table t3 engine=$other_handler_engine_type;
--error 1109 --error 1109
handler h1 read first limit 9; handler h1 read first limit 9;
handler h2 read first limit 9; handler h2 read first limit 9;
...@@ -338,7 +369,7 @@ handler t1 open as h1_3; ...@@ -338,7 +369,7 @@ handler t1 open as h1_3;
handler h1_1 read first limit 9; handler h1_1 read first limit 9;
handler h1_2 read first limit 9; handler h1_2 read first limit 9;
handler h1_3 read first limit 9; handler h1_3 read first limit 9;
alter table t1 engine=MyISAM; eval alter table t1 engine=$engine_type;
--error 1109 --error 1109
handler h1_1 read first limit 9; handler h1_1 read first limit 9;
--error 1109 --error 1109
...@@ -379,6 +410,13 @@ reap; ...@@ -379,6 +410,13 @@ reap;
connection default; connection default;
drop table t1; drop table t1;
CREATE TABLE t1 ( no1 smallint(5) NOT NULL default '0', no2 int(10) NOT NULL default '0', PRIMARY KEY (no1,no2));
INSERT INTO t1 VALUES (1,274),(1,275),(2,6),(2,8),(4,1),(4,2);
HANDLER t1 OPEN;
HANDLER t1 READ `primary` = (1, 1000);
HANDLER t1 READ `primary` PREV;
DROP TABLE t1;
# End of 4.1 tests # End of 4.1 tests
# #
......
# include/index_merge1.inc
# #
# Index merge tests # Index merge tests
# #
# The variables
# $engine_type -- storage engine to be tested
# $merge_table_support -- 1 storage engine supports merge tables
# -- 0 storage engine does not support merge tables
# have to be set before sourcing this script.
#
# Note: The comments/expectations refer to MyISAM.
# They might be not valid for other storage engines.
#
# Last update:
# 2006-08-02 ML test refactored
# old name was t/index_merge.test
# main code went into include/index_merge1.inc
#
--echo #---------------- Index merge test 1 -------------------------------------------
eval SET SESSION STORAGE_ENGINE = $engine_type;
--disable_warnings --disable_warnings
drop table if exists t0, t1, t2, t3, t4; drop table if exists t0, t1, t2, t3, t4;
--enable_warnings --enable_warnings
...@@ -48,6 +68,7 @@ explain select * from t0 where key1 < 3 or key2 <4; ...@@ -48,6 +68,7 @@ explain select * from t0 where key1 < 3 or key2 <4;
explain explain
select * from t0 where (key1 > 30 and key1<35) or (key2 >32 and key2 < 40); select * from t0 where (key1 > 30 and key1<35) or (key2 >32 and key2 < 40);
# Bug#21277: InnoDB, wrong result set, index_merge strategy, second index not evaluated
select * from t0 where (key1 > 30 and key1<35) or (key2 >32 and key2 < 40); select * from t0 where (key1 > 30 and key1<35) or (key2 >32 and key2 < 40);
# 3. Check that index_merge doesn't break "ignore/force/use index" # 3. Check that index_merge doesn't break "ignore/force/use index"
...@@ -186,10 +207,8 @@ create table t4 ( ...@@ -186,10 +207,8 @@ create table t4 (
key2_1 int not null, key2_1 int not null,
key2_2 int not null, key2_2 int not null,
key3 int not null, key3 int not null,
index i1a (key1a, key1b), index i1a (key1a, key1b),
index i1b (key1b, key1a), index i1b (key1b, key1a),
index i2_1(key2, key2_1), index i2_1(key2, key2_1),
index i2_2(key2, key2_1) index i2_2(key2, key2_1)
); );
...@@ -268,9 +287,11 @@ select * from t3 where ...@@ -268,9 +287,11 @@ select * from t3 where
# Test for Bug#3183 # Test for Bug#3183
explain select * from t0 where key1 < 3 or key2 < 4; explain select * from t0 where key1 < 3 or key2 < 4;
# Bug#21277: InnoDB, wrong result set, index_merge strategy, second index not evaluated
select * from t0 where key1 < 3 or key2 < 4; select * from t0 where key1 < 3 or key2 < 4;
update t0 set key8=123 where key1 < 3 or key2 < 4; update t0 set key8=123 where key1 < 3 or key2 < 4;
# Bug#21277: InnoDB, wrong result set, index_merge strategy, second index not evaluated
select * from t0 where key1 < 3 or key2 < 4; select * from t0 where key1 < 3 or key2 < 4;
delete from t0 where key1 < 3 or key2 < 4; delete from t0 where key1 < 3 or key2 < 4;
...@@ -357,6 +378,8 @@ explain select * from t1 WHERE cola = 'foo' AND colb = 'bar'; ...@@ -357,6 +378,8 @@ explain select * from t1 WHERE cola = 'foo' AND colb = 'bar';
explain select * from t1 force index(cola,colb) WHERE cola = 'foo' AND colb = 'bar'; explain select * from t1 force index(cola,colb) WHERE cola = 'foo' AND colb = 'bar';
drop table t1; drop table t1;
if ($merge_table_support)
{
# #
# BUG#17314: Index_merge/intersection not choosen by the optimizer for MERGE tables # BUG#17314: Index_merge/intersection not choosen by the optimizer for MERGE tables
# #
...@@ -383,3 +406,36 @@ explain select * from t3 where a=1 and b=1; ...@@ -383,3 +406,36 @@ explain select * from t3 where a=1 and b=1;
drop table t3; drop table t3;
drop table t0, t1, t2; drop table t0, t1, t2;
}
#
# BUG#20256 - LOCK WRITE - MyISAM
#
CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES(1);
CREATE TABLE t2(a INT, b INT, dummy CHAR(16) DEFAULT '', KEY(a), KEY(b));
INSERT INTO t2(a,b) VALUES
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),(0,0),
(1,2);
LOCK TABLES t1 WRITE, t2 WRITE;
INSERT INTO t2(a,b) VALUES(1,2);
SELECT t2.a FROM t1,t2 WHERE t2.b=2 AND t2.a=1;
UNLOCK TABLES;
DROP TABLE t1, t2;
This diff is collapsed.
# include/index_merge_2sweeps.inc
# #
# 2-sweeps read Index_merge test # 2-sweeps read Index_merge test
# #
-- source include/have_innodb.inc # The variable
# $engine_type -- storage engine to be tested
# has to be set before sourcing this script.
#
# Last update:
# 2006-08-02 ML test refactored
# old name was index_merge_innodb2.test
# main code went into include/index_merge_2sweeps.inc
#
--echo #---------------- 2-sweeps read Index merge test 2 -------------------------------
eval SET SESSION STORAGE_ENGINE = $engine_type;
--disable_warnings --disable_warnings
drop table if exists t1; drop table if exists t1;
...@@ -15,7 +28,7 @@ create table t1 ( ...@@ -15,7 +28,7 @@ create table t1 (
filler2 char(200), filler2 char(200),
index(key1), index(key1),
index(key2) index(key2)
) engine=innodb; );
--disable_query_log --disable_query_log
......
# include/index_merge_ror.inc
# #
# ROR-index_merge tests. # ROR-index_merge tests.
# #
# The variable
# $engine_type -- storage engine to be tested
# has to be set before sourcing this script.
#
# Note: The comments/expectations refer to MyISAM.
# They might be not valid for other storage engines.
#
# Last update:
# 2006-08-02 ML test refactored
# old name was t/index_merge_ror.test
# main code went into include/index_merge_ror.inc
#
--echo #---------------- ROR-index_merge tests -----------------------
eval SET SESSION STORAGE_ENGINE = $engine_type;
--disable_warnings --disable_warnings
drop table if exists t0,t1,t2; drop table if exists t0,t1,t2;
--enable_warnings --enable_warnings
--disable_query_log
create table t1 create table t1
( (
/* Field names reflect value(rowid) distribution, st=STairs, swt= SaWTooth */ /* Field names reflect value(rowid) distribution, st=STairs, swt= SaWTooth */
...@@ -49,14 +66,19 @@ create table t1 ...@@ -49,14 +66,19 @@ create table t1
# Fill table # Fill table
create table t0 as select * from t1; create table t0 as select * from t1;
--disable_query_log
--echo # Printing of many insert into t0 values (....) disabled.
let $cnt=1000; let $cnt=1000;
while ($cnt) while ($cnt)
{ {
eval insert into t0 values (1, 2, 3, 1, 2, 3, 0, 0, 0, 0, 'data1', 'data2', 'data3', 'data4', 'data5', 'data6'); eval insert into t0 values (1, 2, 3, 1, 2, 3, 0, 0, 0, 0, 'data1', 'data2', 'data3', 'data4', 'data5', 'data6');
dec $cnt; dec $cnt;
} }
--enable_query_log
alter table t1 disable keys; alter table t1 disable keys;
--disable_query_log
--echo # Printing of many insert into t1 select .... from t0 disabled.
let $1=4; let $1=4;
while ($1) while ($1)
{ {
...@@ -74,6 +96,7 @@ while ($1) ...@@ -74,6 +96,7 @@ while ($1)
dec $1; dec $1;
} }
--echo # Printing of many insert into t1 (...) values (....) disabled.
# Row retrieval tests # Row retrieval tests
# -1 is used for values 'out of any range we are using' # -1 is used for values 'out of any range we are using'
# insert enough rows for index intersection to be used for (key1,key2) # insert enough rows for index intersection to be used for (key1,key2)
...@@ -90,8 +113,8 @@ while ($cnt) ...@@ -90,8 +113,8 @@ while ($cnt)
eval insert into t1 (key1, key2, key3, key4, filler1) values (-1, 100, -1, 100,'key2-key4'); eval insert into t1 (key1, key2, key3, key4, filler1) values (-1, 100, -1, 100,'key2-key4');
dec $cnt; dec $cnt;
} }
alter table t1 enable keys;
--enable_query_log --enable_query_log
alter table t1 enable keys;
select count(*) from t1; select count(*) from t1;
# One row results tests for cases where a single row matches all conditions # One row results tests for cases where a single row matches all conditions
......
# include/index_merge_ror_cpk.inc
# #
# Clustered PK ROR-index_merge tests # Clustered PK ROR-index_merge tests
# #
-- source include/have_innodb.inc # The variable
# $engine_type -- storage engine to be tested
# has to be set before sourcing this script.
#
# Note: The comments/expectations refer to InnoDB.
# They might be not valid for other storage engines.
#
# Last update:
# 2006-08-02 ML test refactored
# old name was t/index_merge_ror_cpk.test
# main code went into include/index_merge_ror_cpk.inc
#
--echo #---------------- Clustered PK ROR-index_merge tests -----------------------------
eval SET SESSION STORAGE_ENGINE = $engine_type;
--disable_warnings --disable_warnings
drop table if exists t1; drop table if exists t1;
...@@ -37,7 +53,7 @@ create table t1 ...@@ -37,7 +53,7 @@ create table t1
key (pktail5bad, pk1, pk2, pk2copy), key (pktail5bad, pk1, pk2, pk2copy),
primary key (pk1, pk2) primary key (pk1, pk2)
) engine=innodb; );
--disable_query_log --disable_query_log
set autocommit=0; set autocommit=0;
...@@ -70,7 +86,8 @@ explain select * from t1 where pk1 < 7500 and key1 = 10; ...@@ -70,7 +86,8 @@ explain select * from t1 where pk1 < 7500 and key1 = 10;
explain select * from t1 where pktail1ok=1 and key1=10; explain select * from t1 where pktail1ok=1 and key1=10;
explain select * from t1 where pktail2ok=1 and key1=10; explain select * from t1 where pktail2ok=1 and key1=10;
select ' The following is actually a deficiency, it uses sort_union currently:' as 'note:'; # Note: The following is actually a deficiency, it uses sort_union currently.
# This comment refers to InnoDB and is probably not valid for other engines.
explain select * from t1 where (pktail2ok=1 and pk1< 50000) or key1=10; explain select * from t1 where (pktail2ok=1 and pk1< 50000) or key1=10;
# The expected rows differs a bit from platform to platform # The expected rows differs a bit from platform to platform
...@@ -89,7 +106,7 @@ create table t1 ...@@ -89,7 +106,7 @@ create table t1
( (
RUNID varchar(22), RUNID varchar(22),
SUBMITNR varchar(5), SUBMITNR varchar(5),
ORDERNR char(1) , ORDERNR char(1),
PROGRAMM varchar(8), PROGRAMM varchar(8),
TESTID varchar(4), TESTID varchar(4),
UCCHECK char(1), UCCHECK char(1),
...@@ -100,7 +117,7 @@ create table t1 ...@@ -100,7 +117,7 @@ create table t1
TADIRFLAG char(1), TADIRFLAG char(1),
PRIMARY KEY (RUNID,SUBMITNR,ORDERNR,PROGRAMM,TESTID,UCCHECK), PRIMARY KEY (RUNID,SUBMITNR,ORDERNR,PROGRAMM,TESTID,UCCHECK),
KEY `TVERM~KEY` (PROGRAMM,TESTID,UCCHECK) KEY `TVERM~KEY` (PROGRAMM,TESTID,UCCHECK)
) ENGINE=InnoDB DEFAULT CHARSET=latin1; ) DEFAULT CHARSET=latin1;
update t1 set `ETEXT` = '', `ETEXT_TYPE`='', `INFO`='', `SEVERITY`='', `TADIRFLAG`='' update t1 set `ETEXT` = '', `ETEXT_TYPE`='', `INFO`='', `SEVERITY`='', `TADIRFLAG`=''
WHERE WHERE
......
This diff is collapsed.
This diff is collapsed.
-- source include/have_innodb.inc # include/query_cache.inc
-- source include/have_query_cache.inc #
# The variables
# $engine_type -- storage engine to be tested
# $test_foreign_keys -- 0, skip foreign key tests
# -- 1, do not skip foreign key tests
# have to be set before sourcing this script.
#
# Last update:
# 2006-08-02 ML test refactored
# old name was innodb_cache.test
# main code went into include/query_cache.inc
#
eval SET SESSION STORAGE_ENGINE = $engine_type;
# Initialise # Initialise
--disable_warnings --disable_warnings
...@@ -11,7 +24,7 @@ drop table if exists t1,t2,t3; ...@@ -11,7 +24,7 @@ drop table if exists t1,t2,t3;
# #
flush status; flush status;
set autocommit=0; set autocommit=0;
create table t1 (a int not null) engine=innodb; create table t1 (a int not null);
insert into t1 values (1),(2),(3); insert into t1 values (1),(2),(3);
select * from t1; select * from t1;
show status like "Qcache_queries_in_cache"; show status like "Qcache_queries_in_cache";
...@@ -19,15 +32,15 @@ drop table t1; ...@@ -19,15 +32,15 @@ drop table t1;
commit; commit;
set autocommit=1; set autocommit=1;
begin; begin;
create table t1 (a int not null) engine=innodb; create table t1 (a int not null);
insert into t1 values (1),(2),(3); insert into t1 values (1),(2),(3);
select * from t1; select * from t1;
show status like "Qcache_queries_in_cache"; show status like "Qcache_queries_in_cache";
drop table t1; drop table t1;
commit; commit;
create table t1 (a int not null) engine=innodb; create table t1 (a int not null);
create table t2 (a int not null) engine=innodb; create table t2 (a int not null);
create table t3 (a int not null) engine=innodb; create table t3 (a int not null);
insert into t1 values (1),(2); insert into t1 values (1),(2);
insert into t2 values (1),(2); insert into t2 values (1),(2);
insert into t3 values (1),(2); insert into t3 values (1),(2);
...@@ -54,20 +67,22 @@ commit; ...@@ -54,20 +67,22 @@ commit;
show status like "Qcache_queries_in_cache"; show status like "Qcache_queries_in_cache";
drop table t3,t2,t1; drop table t3,t2,t1;
CREATE TABLE t1 (id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=InnoDB; CREATE TABLE t1 (id int(11) NOT NULL auto_increment, PRIMARY KEY (id));
select count(*) from t1; select count(*) from t1;
insert into t1 (id) values (0); insert into t1 (id) values (0);
select count(*) from t1; select count(*) from t1;
drop table t1; drop table t1;
if ($test_foreign_keys)
{
# #
# one statement roll back inside transation # one statement roll back inside transation
# #
let $save_query_cache_size=`select @@global.query_cache_size`; let $save_query_cache_size=`select @@global.query_cache_size`;
set GLOBAL query_cache_size=1355776; set GLOBAL query_cache_size=1355776;
CREATE TABLE t1 ( id int(10) NOT NULL auto_increment, a varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY a (a)) ENGINE=innodb; CREATE TABLE t1 ( id int(10) NOT NULL auto_increment, a varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY a (a));
CREATE TABLE t2 ( id int(10) NOT NULL auto_increment, b varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY b (b)) ENGINE=innodb; CREATE TABLE t2 ( id int(10) NOT NULL auto_increment, b varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY b (b));
CREATE TABLE t3 ( id int(10) NOT NULL auto_increment, t1_id int(10) NOT NULL default '0', t2_id int(10) NOT NULL default '0', state int(11) default NULL, PRIMARY KEY (id), UNIQUE KEY t1_id (t1_id,t2_id), KEY t2_id (t2_id,t1_id), CONSTRAINT `t3_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `t1` (`id`), CONSTRAINT `t3_ibfk_2` FOREIGN KEY (`t2_id`) REFERENCES `t2` (`id`)) ENGINE=innodb; CREATE TABLE t3 ( id int(10) NOT NULL auto_increment, t1_id int(10) NOT NULL default '0', t2_id int(10) NOT NULL default '0', state int(11) default NULL, PRIMARY KEY (id), UNIQUE KEY t1_id (t1_id,t2_id), KEY t2_id (t2_id,t1_id), CONSTRAINT `t3_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `t1` (`id`), CONSTRAINT `t3_ibfk_2` FOREIGN KEY (`t2_id`) REFERENCES `t2` (`id`));
INSERT INTO t1 VALUES (1,'me'); INSERT INTO t1 VALUES (1,'me');
INSERT INTO t2 VALUES (1,'you'); INSERT INTO t2 VALUES (1,'you');
INSERT INTO t3 VALUES (2,1,1,2); INSERT INTO t3 VALUES (2,1,1,2);
...@@ -83,5 +98,6 @@ drop table t3,t2,t1; ...@@ -83,5 +98,6 @@ drop table t3,t2,t1;
--disable_query_log --disable_query_log
eval set GLOBAL query_cache_size=$save_query_cache_size; eval set GLOBAL query_cache_size=$save_query_cache_size;
--enable_query_log --enable_query_log
}
# End of 4.1 tests # End of 4.1 tests
# include/read_many_rows.inc
#
# Test how filesort and buffered-record-reads works
# This test needs a lot of time.
#
# The variables
# $engine_type -- storage engine to be tested
# $other_engine_type -- storage engine <> $engine_type, if possible
# 1. $other_engine_type must allow to store many rows
# without using non standard server options
# (does not need a t/read_many_rows_*-master.opt file)
# 2. $other_engine_type must point to an all time
# available storage engine
# 2006-08 MySQL 5.1 MyISAM and MEMORY only
# have to be set before sourcing this script.
#
# Last update:
# 2006-08-03 ML test refactored (MySQL 5.1)
# main code t/innodb-big.test --> include/read_many_rows.inc
# #
# Test some things that takes a long time
-- source include/big_test.inc eval SET SESSION STORAGE_ENGINE = $engine_type;
-- source include/have_innodb.inc
--disable_warnings --disable_warnings
DROP TABLE IF EXISTS t1, t2, t3, t4; DROP TABLE IF EXISTS t1, t2, t3, t4;
--enable_warnings --enable_warnings
# eval CREATE TABLE t1 (id INTEGER) ENGINE=$other_engine_type;
# Test test how filesort and buffered-record-reads works with innodb CREATE TABLE t2 (id INTEGER PRIMARY KEY);
# CREATE TABLE t3 (a CHAR(32) PRIMARY KEY,id INTEGER);
eval CREATE TABLE t4 (a CHAR(32) PRIMARY KEY,id INTEGER) ENGINE=$other_engine_type;
CREATE TABLE t1 (id INTEGER) ENGINE=MYISAM;
CREATE TABLE t2 (id INTEGER primary key) ENGINE=INNODB;
CREATE TABLE t3 (a char(32) primary key,id INTEGER) ENGINE=INNODB;
CREATE TABLE t4 (a char(32) primary key,id INTEGER) ENGINE=MYISAM;
INSERT INTO t1 (id) VALUES (1); INSERT INTO t1 (id) VALUES (1);
INSERT INTO t1 SELECT id+1 FROM t1; INSERT INTO t1 SELECT id+1 FROM t1;
...@@ -39,8 +52,10 @@ INSERT INTO t1 SELECT id+131072 FROM t1; ...@@ -39,8 +52,10 @@ INSERT INTO t1 SELECT id+131072 FROM t1;
INSERT INTO t1 SELECT id+262144 FROM t1; INSERT INTO t1 SELECT id+262144 FROM t1;
INSERT INTO t1 SELECT id+524288 FROM t1; INSERT INTO t1 SELECT id+524288 FROM t1;
INSERT INTO t1 SELECT id+1048576 FROM t1; INSERT INTO t1 SELECT id+1048576 FROM t1;
INSERT INTO t2 SELECT * FROM t1; INSERT INTO t2 SELECT * FROM t1;
INSERT INTO t3 SELECT concat(id),id from t2 ORDER BY -id; INSERT INTO t3 SELECT CONCAT(id),id FROM t2 ORDER BY -id;
INSERT INTO t4 SELECT * from t3 ORDER BY concat(a); INSERT INTO t4 SELECT * FROM t3 ORDER BY CONCAT(a);
select sum(id) from t3; SELECT SUM(id) FROM t3;
drop table t1,t2,t3,t4;
DROP TABLE t1,t2,t3,t4;
# include/rowid_order.inc
#
# Test for rowid ordering (and comparison) functions.
# do index_merge select for tables with PK of various types.
#
# The variable
# $engine_type -- storage engine to be tested
# has to be set before sourcing this script.
#
# Note: The comments/expections refer to InnoDB.
# They might be not valid for other storage engines.
#
# Last update:
# 2006-08-02 ML test refactored
# old name was t/rowid_order.test
# main code went into include/rowid_order.inc
#
eval SET SESSION STORAGE_ENGINE = $engine_type;
--disable_warnings
drop table if exists t1, t2, t3,t4;
--enable_warnings
# Signed number as rowid
create table t1 (
pk1 int not NULL,
key1 int(11),
key2 int(11),
PRIMARY KEY (pk1),
KEY key1 (key1),
KEY key2 (key2)
);
insert into t1 values (-5, 1, 1),
(-100, 1, 1),
(3, 1, 1),
(0, 1, 1),
(10, 1, 1);
explain select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
drop table t1;
# Unsigned numbers as rowids
create table t1 (
pk1 int unsigned not NULL,
key1 int(11),
key2 int(11),
PRIMARY KEY (pk1),
KEY key1 (key1),
KEY key2 (key2)
);
insert into t1 values (0, 1, 1),
(0xFFFFFFFF, 1, 1),
(0xFFFFFFFE, 1, 1),
(1, 1, 1),
(2, 1, 1);
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
drop table t1;
# Case-insensitive char(N)
create table t1 (
pk1 char(4) not NULL,
key1 int(11),
key2 int(11),
PRIMARY KEY (pk1),
KEY key1 (key1),
KEY key2 (key2)
) collate latin2_general_ci;
insert into t1 values ('a1', 1, 1),
('b2', 1, 1),
('A3', 1, 1),
('B4', 1, 1);
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
drop table t1;
# Multi-part PK
create table t1 (
pk1 int not NULL,
pk2 char(4) not NULL collate latin1_german1_ci,
pk3 char(4) not NULL collate latin1_bin,
key1 int(11),
key2 int(11),
PRIMARY KEY (pk1,pk2,pk3),
KEY key1 (key1),
KEY key2 (key2)
);
insert into t1 values
(1, 'u', 'u', 1, 1),
(1, 'u', char(0xEC), 1, 1),
(1, 'u', 'x', 1, 1);
insert ignore into t1 select pk1, char(0xEC), pk3, key1, key2 from t1;
insert ignore into t1 select pk1, 'x', pk3, key1, key2 from t1 where pk2='u';
insert ignore into t1 select 2, pk2, pk3, key1, key2 from t1;
select * from t1;
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
# Hidden PK
alter table t1 drop primary key;
select * from t1;
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
drop table t1;
# Variable-length PK
# this is also test for Bug#2688
create table t1 (
pk1 varchar(8) NOT NULL default '',
pk2 varchar(4) NOT NULL default '',
key1 int(11),
key2 int(11),
primary key(pk1, pk2),
KEY key1 (key1),
KEY key2 (key2)
);
insert into t1 values ('','empt',2,2),
('a','a--a',2,2),
('bb','b--b',2,2),
('ccc','c--c',2,2),
('dddd','d--d',2,2);
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
drop table t1;
#
# Test for strict-mode autoincrement
#
set @org_mode=@@sql_mode;
eval create table t1
(
`a` tinyint(4) NOT NULL auto_increment,
primary key (`a`)
) engine = $type ;
set @@sql_mode='strict_all_tables';
--error ER_WARN_DATA_OUT_OF_RANGE
insert into t1 values(1000);
select count(*) from t1;
set auto_increment_increment=1000;
set auto_increment_offset=700;
--error ER_WARN_DATA_OUT_OF_RANGE
insert into t1 values(null);
select count(*) from t1;
set @@sql_mode=@org_mode;
insert into t1 values(null);
select * from t1;
drop table t1;
# End of test
-- source include/have_innodb.inc # include/unsafe_binlog.inc
# #
# Note that these tests uses options # The variable
# $engine_type -- storage engine to be tested
# has to be set before sourcing this script.
#
# Notes:
# 1. This test uses at least in case of InnoDB options
# innodb_locks_unsafe_for_binlog = true # innodb_locks_unsafe_for_binlog = true
# innodb_lock_timeout = 5 # innodb_lock_timeout = 5
# 2. The comments/expectations refer to InnoDB.
# They might be not valid for other storage engines.
#
# Last update:
# 2006-08-02 ML test refactored
# old name was innodb_unsafe_binlog.test
# main code went into include/unsafe_binlog.inc
#
# #
# Test cases for a bug #15650 # Test cases for bug#15650
# DELETE with LEFT JOIN crashes server with innodb_locks_unsafe_for_binlog
# #
--disable_warnings --disable_warnings
drop table if exists t1,t2; drop table if exists t1,t2;
--enable_warnings --enable_warnings
create table t1 (id int not null, f_id int not null, f int not null, eval create table t1 (id int not null, f_id int not null, f int not null,
primary key(f_id, id)) engine=innodb; primary key(f_id, id)) engine = $engine_type;
create table t2 (id int not null,s_id int not null,s varchar(200), eval create table t2 (id int not null,s_id int not null,s varchar(200),
primary key(id)) engine=innodb; primary key(id)) engine = $engine_type;
INSERT INTO t1 VALUES (8, 1, 3); INSERT INTO t1 VALUES (8, 1, 3);
INSERT INTO t1 VALUES (1, 2, 1); INSERT INTO t1 VALUES (1, 2, 1);
INSERT INTO t2 VALUES (1, 0, ''); INSERT INTO t2 VALUES (1, 0, '');
...@@ -34,7 +48,7 @@ drop table t1,t2; ...@@ -34,7 +48,7 @@ drop table t1,t2;
connect (a,localhost,root,,); connect (a,localhost,root,,);
connect (b,localhost,root,,); connect (b,localhost,root,,);
connection a; connection a;
create table t1(a int not null, b int, primary key(a)) engine=innodb; eval create table t1(a int not null, b int, primary key(a)) engine = $engine_type;
insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2),(7,3); insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2),(7,3);
commit; commit;
set autocommit = 0; set autocommit = 0;
...@@ -63,7 +77,7 @@ disconnect b; ...@@ -63,7 +77,7 @@ disconnect b;
connect (a,localhost,root,,); connect (a,localhost,root,,);
connect (b,localhost,root,,); connect (b,localhost,root,,);
connection a; connection a;
create table t1(a int not null, b int, primary key(a)) engine=innodb; eval create table t1(a int not null, b int, primary key(a)) engine = $engine_type;
insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2),(7,3); insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2),(7,3);
commit; commit;
set autocommit = 0; set autocommit = 0;
...@@ -93,9 +107,9 @@ disconnect b; ...@@ -93,9 +107,9 @@ disconnect b;
connect (a,localhost,root,,); connect (a,localhost,root,,);
connect (b,localhost,root,,); connect (b,localhost,root,,);
connection a; connection a;
create table t1(a int not null, b int, primary key(a)) engine=innodb; eval create table t1(a int not null, b int, primary key(a)) engine = $engine_type;
insert into t1 values (1,2),(5,3),(4,2); insert into t1 values (1,2),(5,3),(4,2);
create table t2(d int not null, e int, primary key(d)) engine=innodb; eval create table t2(d int not null, e int, primary key(d)) engine = $engine_type;
insert into t2 values (8,6),(12,1),(3,1); insert into t2 values (8,6),(12,1),(3,1);
commit; commit;
set autocommit = 0; set autocommit = 0;
...@@ -104,7 +118,7 @@ connection b; ...@@ -104,7 +118,7 @@ connection b;
set autocommit = 0; set autocommit = 0;
insert into t1 select * from t2; insert into t1 select * from t2;
update t1 set b = (select e from t2 where a = d); update t1 set b = (select e from t2 where a = d);
create table t3(d int not null, e int, primary key(d)) engine=innodb eval create table t3(d int not null, e int, primary key(d)) engine = $engine_type
select * from t2; select * from t2;
commit; commit;
connection a; connection a;
...@@ -131,26 +145,29 @@ connect (a,localhost,root,,); ...@@ -131,26 +145,29 @@ connect (a,localhost,root,,);
connect (b,localhost,root,,); connect (b,localhost,root,,);
connect (c,localhost,root,,); connect (c,localhost,root,,);
connect (d,localhost,root,,); connect (d,localhost,root,,);
eval SET SESSION STORAGE_ENGINE = $engine_type;
connect (e,localhost,root,,); connect (e,localhost,root,,);
connect (f,localhost,root,,); connect (f,localhost,root,,);
connect (g,localhost,root,,); connect (g,localhost,root,,);
eval SET SESSION STORAGE_ENGINE = $engine_type;
connect (h,localhost,root,,); connect (h,localhost,root,,);
connect (i,localhost,root,,); connect (i,localhost,root,,);
connect (j,localhost,root,,); connect (j,localhost,root,,);
eval SET SESSION STORAGE_ENGINE = $engine_type;
connection a; connection a;
create table t1(a int not null, b int, primary key(a)) engine=innodb; eval create table t1(a int not null, b int, primary key(a)) engine = $engine_type;
insert into t1 values (1,2),(5,3),(4,2); insert into t1 values (1,2),(5,3),(4,2);
create table t2(a int not null, b int, primary key(a)) engine=innodb; eval create table t2(a int not null, b int, primary key(a)) engine = $engine_type;
insert into t2 values (8,6),(12,1),(3,1); insert into t2 values (8,6),(12,1),(3,1);
create table t3(d int not null, b int, primary key(d)) engine=innodb; eval create table t3(d int not null, b int, primary key(d)) engine = $engine_type;
insert into t3 values (8,6),(12,1),(3,1); insert into t3 values (8,6),(12,1),(3,1);
create table t5(a int not null, b int, primary key(a)) engine=innodb; eval create table t5(a int not null, b int, primary key(a)) engine = $engine_type;
insert into t5 values (1,2),(5,3),(4,2); insert into t5 values (1,2),(5,3),(4,2);
create table t6(d int not null, e int, primary key(d)) engine=innodb; eval create table t6(d int not null, e int, primary key(d)) engine = $engine_type;
insert into t6 values (8,6),(12,1),(3,1); insert into t6 values (8,6),(12,1),(3,1);
create table t8(a int not null, b int, primary key(a)) engine=innodb; eval create table t8(a int not null, b int, primary key(a)) engine = $engine_type;
insert into t8 values (1,2),(5,3),(4,2); insert into t8 values (1,2),(5,3),(4,2);
create table t9(d int not null, e int, primary key(d)) engine=innodb; eval create table t9(d int not null, e int, primary key(d)) engine = $engine_type;
insert into t9 values (8,6),(12,1),(3,1); insert into t9 values (8,6),(12,1),(3,1);
commit; commit;
set autocommit = 0; set autocommit = 0;
...@@ -169,7 +186,7 @@ connection d; ...@@ -169,7 +186,7 @@ connection d;
set autocommit = 0; set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
--send --send
create table t4(a int not null, b int, primary key(a)) engine=innodb select * from t2; create table t4(a int not null, b int, primary key(a)) select * from t2;
connection e; connection e;
set autocommit = 0; set autocommit = 0;
--send --send
...@@ -181,7 +198,7 @@ update t6 set e = (select b from t2 where a = d lock in share mode); ...@@ -181,7 +198,7 @@ update t6 set e = (select b from t2 where a = d lock in share mode);
connection g; connection g;
set autocommit = 0; set autocommit = 0;
--send --send
create table t7(a int not null, b int, primary key(a)) engine=innodb select * from t2 lock in share mode; create table t7(a int not null, b int, primary key(a)) select * from t2 lock in share mode;
connection h; connection h;
set autocommit = 0; set autocommit = 0;
--send --send
...@@ -193,7 +210,7 @@ update t9 set e = (select b from t2 where a = d for update); ...@@ -193,7 +210,7 @@ update t9 set e = (select b from t2 where a = d for update);
connection j; connection j;
set autocommit = 0; set autocommit = 0;
--send --send
create table t10(a int not null, b int, primary key(a)) engine=innodb select * from t2 for update; create table t10(a int not null, b int, primary key(a)) select * from t2 for update;
connection b; connection b;
--error 1205 --error 1205
......
...@@ -133,7 +133,6 @@ our @mysqld_src_dirs= ...@@ -133,7 +133,6 @@ our @mysqld_src_dirs=
our $glob_win32= 0; # OS and native Win32 executables our $glob_win32= 0; # OS and native Win32 executables
our $glob_win32_perl= 0; # ActiveState Win32 Perl our $glob_win32_perl= 0; # ActiveState Win32 Perl
our $glob_cygwin_perl= 0; # Cygwin Perl our $glob_cygwin_perl= 0; # Cygwin Perl
our $glob_cygwin_shell= undef;
our $glob_mysql_test_dir= undef; our $glob_mysql_test_dir= undef;
our $glob_mysql_bench_dir= undef; our $glob_mysql_bench_dir= undef;
our $glob_hostname= undef; our $glob_hostname= undef;
...@@ -484,10 +483,7 @@ sub initial_setup () { ...@@ -484,10 +483,7 @@ sub initial_setup () {
{ {
# Windows programs like 'mysqld' needs Windows paths # Windows programs like 'mysqld' needs Windows paths
$glob_mysql_test_dir= `cygpath -m "$glob_mysql_test_dir"`; $glob_mysql_test_dir= `cygpath -m "$glob_mysql_test_dir"`;
my $shell= $ENV{'SHELL'} || "/bin/bash";
$glob_cygwin_shell= `cygpath -w "$shell"`; # The Windows path c:\...
chomp($glob_mysql_test_dir); chomp($glob_mysql_test_dir);
chomp($glob_cygwin_shell);
} }
$glob_basedir= dirname($glob_mysql_test_dir); $glob_basedir= dirname($glob_mysql_test_dir);
# Expect mysql-bench to be located adjacent to the source tree, by default # Expect mysql-bench to be located adjacent to the source tree, by default
...@@ -1244,7 +1240,9 @@ sub executable_setup () { ...@@ -1244,7 +1240,9 @@ sub executable_setup () {
$exe_ndbd= "$glob_basedir/storage/ndb/src/kernel/ndbd"; $exe_ndbd= "$glob_basedir/storage/ndb/src/kernel/ndbd";
$exe_ndb_mgmd= "$glob_basedir/storage/ndb/src/mgmsrv/ndb_mgmd"; $exe_ndb_mgmd= "$glob_basedir/storage/ndb/src/mgmsrv/ndb_mgmd";
$lib_udf_example= $lib_udf_example=
mtr_file_exists("$glob_basedir/sql/.libs/udf_example.so"); mtr_file_exists("$glob_basedir/sql/.libs/udf_example.so",
"$glob_basedir/sql/release/udf_example.dll",
"$glob_basedir/sql/debug/udf_example.dll");
} }
else else
{ {
......
SET SESSION STORAGE_ENGINE = InnoDB;
drop table if exists t1,t2,t3; drop table if exists t1,t2,t3;
flush status; flush status;
set autocommit=0; set autocommit=0;
create table t1 (a int not null) engine=innodb; create table t1 (a int not null);
insert into t1 values (1),(2),(3); insert into t1 values (1),(2),(3);
select * from t1; select * from t1;
a a
...@@ -15,7 +16,7 @@ drop table t1; ...@@ -15,7 +16,7 @@ drop table t1;
commit; commit;
set autocommit=1; set autocommit=1;
begin; begin;
create table t1 (a int not null) engine=innodb; create table t1 (a int not null);
insert into t1 values (1),(2),(3); insert into t1 values (1),(2),(3);
select * from t1; select * from t1;
a a
...@@ -27,9 +28,9 @@ Variable_name Value ...@@ -27,9 +28,9 @@ Variable_name Value
Qcache_queries_in_cache 1 Qcache_queries_in_cache 1
drop table t1; drop table t1;
commit; commit;
create table t1 (a int not null) engine=innodb; create table t1 (a int not null);
create table t2 (a int not null) engine=innodb; create table t2 (a int not null);
create table t3 (a int not null) engine=innodb; create table t3 (a int not null);
insert into t1 values (1),(2); insert into t1 values (1),(2);
insert into t2 values (1),(2); insert into t2 values (1),(2);
insert into t3 values (1),(2); insert into t3 values (1),(2);
...@@ -99,7 +100,7 @@ show status like "Qcache_queries_in_cache"; ...@@ -99,7 +100,7 @@ show status like "Qcache_queries_in_cache";
Variable_name Value Variable_name Value
Qcache_queries_in_cache 1 Qcache_queries_in_cache 1
drop table t3,t2,t1; drop table t3,t2,t1;
CREATE TABLE t1 (id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) ENGINE=InnoDB; CREATE TABLE t1 (id int(11) NOT NULL auto_increment, PRIMARY KEY (id));
select count(*) from t1; select count(*) from t1;
count(*) count(*)
0 0
...@@ -109,9 +110,9 @@ count(*) ...@@ -109,9 +110,9 @@ count(*)
1 1
drop table t1; drop table t1;
set GLOBAL query_cache_size=1355776; set GLOBAL query_cache_size=1355776;
CREATE TABLE t1 ( id int(10) NOT NULL auto_increment, a varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY a (a)) ENGINE=innodb; CREATE TABLE t1 ( id int(10) NOT NULL auto_increment, a varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY a (a));
CREATE TABLE t2 ( id int(10) NOT NULL auto_increment, b varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY b (b)) ENGINE=innodb; CREATE TABLE t2 ( id int(10) NOT NULL auto_increment, b varchar(25) default NULL, PRIMARY KEY (id), UNIQUE KEY b (b));
CREATE TABLE t3 ( id int(10) NOT NULL auto_increment, t1_id int(10) NOT NULL default '0', t2_id int(10) NOT NULL default '0', state int(11) default NULL, PRIMARY KEY (id), UNIQUE KEY t1_id (t1_id,t2_id), KEY t2_id (t2_id,t1_id), CONSTRAINT `t3_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `t1` (`id`), CONSTRAINT `t3_ibfk_2` FOREIGN KEY (`t2_id`) REFERENCES `t2` (`id`)) ENGINE=innodb; CREATE TABLE t3 ( id int(10) NOT NULL auto_increment, t1_id int(10) NOT NULL default '0', t2_id int(10) NOT NULL default '0', state int(11) default NULL, PRIMARY KEY (id), UNIQUE KEY t1_id (t1_id,t2_id), KEY t2_id (t2_id,t1_id), CONSTRAINT `t3_ibfk_1` FOREIGN KEY (`t1_id`) REFERENCES `t1` (`id`), CONSTRAINT `t3_ibfk_2` FOREIGN KEY (`t2_id`) REFERENCES `t2` (`id`));
INSERT INTO t1 VALUES (1,'me'); INSERT INTO t1 VALUES (1,'me');
INSERT INTO t2 VALUES (1,'you'); INSERT INTO t2 VALUES (1,'you');
INSERT INTO t3 VALUES (2,1,1,2); INSERT INTO t3 VALUES (2,1,1,2);
......
SET SESSION STORAGE_ENGINE = InnoDB;
drop table if exists t1; drop table if exists t1;
Warnings: create table t1(eta int(11) not null, tipo int(11), c varchar(255));
Note 1051 Unknown table 't1' SET SESSION STORAGE_ENGINE = InnoDB;
create table t1(eta int(11) not null, tipo int(11), c varchar(255)) ENGINE=innodb;
Warnings:
Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc"); insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
...@@ -106,9 +104,7 @@ eta tipo c ...@@ -106,9 +104,7 @@ eta tipo c
2 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj 2 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
1 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk 1 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
drop table t1; drop table t1;
create table t1(eta int(11) not null, tipo int(11), c varchar(255)) ENGINE=innodb; create table t1(eta int(11) not null, tipo int(11), c varchar(255));
Warnings:
Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc"); insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
...@@ -211,7 +207,7 @@ eta tipo c ...@@ -211,7 +207,7 @@ eta tipo c
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj 80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk 90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
drop table t1; drop table t1;
create table t1 (a int not null, b int not null) engine=innodb; create table t1 (a int not null, b int not null);
insert into t1 values (1,1),(2,1),(3,1),(4,1); insert into t1 values (1,1),(2,1),(3,1),(4,1);
select get_lock("hello2",1000); select get_lock("hello2",1000);
get_lock("hello2",1000) get_lock("hello2",1000)
...@@ -239,9 +235,7 @@ a b ...@@ -239,9 +235,7 @@ a b
1 1 1 1
commit; commit;
drop table t1; drop table t1;
create table t1(eta int(11) not null, tipo int(11), c varchar(255)) ENGINE=innodb; create table t1(eta int(11) not null, tipo int(11), c varchar(255));
Warnings:
Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc"); insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
...@@ -323,9 +317,7 @@ eta tipo c ...@@ -323,9 +317,7 @@ eta tipo c
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj 80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk 90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
drop table t1; drop table t1;
create table t1(eta int(11) not null, tipo int(11), c varchar(255)) ENGINE=innodb; create table t1(eta int(11) not null, tipo int(11), c varchar(255));
Warnings:
Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc"); insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
...@@ -407,9 +399,7 @@ eta tipo c ...@@ -407,9 +399,7 @@ eta tipo c
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj 80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk 90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
drop table t1; drop table t1;
create table t1(eta int(11) not null, tipo int(11), c varchar(255)) ENGINE=innodb; create table t1(eta int(11) not null, tipo int(11), c varchar(255));
Warnings:
Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc"); insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
...@@ -478,9 +468,7 @@ eta tipo c ...@@ -478,9 +468,7 @@ eta tipo c
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj 80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk 90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
drop table t1; drop table t1;
create table t1(eta int(11) not null, tipo int(11), c varchar(255)) ENGINE=innodb; create table t1(eta int(11) not null, tipo int(11), c varchar(255));
Warnings:
Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc"); insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
...@@ -549,9 +537,7 @@ eta tipo c ...@@ -549,9 +537,7 @@ eta tipo c
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj 80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk 90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
drop table t1; drop table t1;
create table t1(eta int(11) not null, tipo int(11), c varchar(255)) ENGINE=innodb; create table t1(eta int(11) not null, tipo int(11), c varchar(255));
Warnings:
Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead
insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); insert into t1 values (7,7, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"); insert into t1 values (8,8, "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc"); insert into t1 values (10,1,"ccccccccccccccccccccccccccccccccccccccccccc");
......
...@@ -780,6 +780,8 @@ t1 CREATE TABLE `t1` ( ...@@ -780,6 +780,8 @@ t1 CREATE TABLE `t1` (
`i` int(11) DEFAULT NULL `i` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 MAX_ROWS=4294967295 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 MAX_ROWS=4294967295
drop table t1; drop table t1;
create table t1 (upgrade int);
drop table t1;
CREATE TABLE t1 (a int, b int); CREATE TABLE t1 (a int, b int);
insert into t1 values (1,1),(1,2); insert into t1 values (1,1),(1,2);
CREATE TABLE t2 (primary key (a)) select * from t1; CREATE TABLE t2 (primary key (a)) select * from t1;
......
...@@ -172,6 +172,10 @@ a ...@@ -172,6 +172,10 @@ a
0 0
2 2
DROP TABLE t1; DROP TABLE t1;
create table t1 (a int);
delete `4.t1` from t1 as `4.t1` where `4.t1`.a = 5;
delete FROM `4.t1` USING t1 as `4.t1` where `4.t1`.a = 5;
drop table t1;
CREATE TABLE t1 (a int not null,b int not null); CREATE TABLE t1 (a int not null,b int not null);
CREATE TABLE t2 (a int not null, b int not null, primary key (a,b)); CREATE TABLE t2 (a int not null, b int not null, primary key (a,b));
CREATE TABLE t3 (a int not null, b int not null, primary key (a,b)); CREATE TABLE t3 (a int not null, b int not null, primary key (a,b));
......
...@@ -572,14 +572,14 @@ COUNT(*) GROUP_CONCAT(DISTINCT t2.somename SEPARATOR ' |') ...@@ -572,14 +572,14 @@ COUNT(*) GROUP_CONCAT(DISTINCT t2.somename SEPARATOR ' |')
DROP TABLE t1,t2; DROP TABLE t1,t2;
select * from (select group_concat('c') from DUAL) t; select * from (select group_concat('c') from DUAL) t;
group_concat('c') group_concat('c')
NULL c
create table t1 ( a int not null default 0); create table t1 ( a int not null default 0);
select * from (select group_concat(a) from t1) t2; select * from (select group_concat(a) from t1) t2;
group_concat(a) group_concat(a)
NULL NULL
select group_concat('x') UNION ALL select 1; select group_concat('x') UNION ALL select 1;
group_concat('x') group_concat('x')
NULL x
1 1
drop table t1; drop table t1;
CREATE TABLE t1 (id int, a varchar(9)); CREATE TABLE t1 (id int, a varchar(9));
......
...@@ -847,6 +847,22 @@ EXPLAIN SELECT MAX(b) FROM t1; ...@@ -847,6 +847,22 @@ EXPLAIN SELECT MAX(b) FROM t1;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 1 SIMPLE t1 ALL NULL NULL NULL NULL 4
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (a INT, b INT);
INSERT INTO t1 VALUES (1,1),(1,2),(2,3);
SELECT (SELECT COUNT(DISTINCT t1.b)) FROM t1 GROUP BY t1.a;
(SELECT COUNT(DISTINCT t1.b))
0
2
SELECT (SELECT COUNT(DISTINCT 12)) FROM t1 GROUP BY t1.a;
(SELECT COUNT(DISTINCT 12))
1
1
SELECT AVG(2), BIT_AND(2), BIT_OR(2), BIT_XOR(2), COUNT(*), COUNT(12),
COUNT(DISTINCT 12), MIN(2),MAX(2),STD(2), VARIANCE(2),SUM(2),
GROUP_CONCAT(2),GROUP_CONCAT(DISTINCT 2);
AVG(2) BIT_AND(2) BIT_OR(2) BIT_XOR(2) COUNT(*) COUNT(12) COUNT(DISTINCT 12) MIN(2) MAX(2) STD(2) VARIANCE(2) SUM(2) GROUP_CONCAT(2) GROUP_CONCAT(DISTINCT 2)
2.00000 2 2 2 1 1 1 2 2 0.00000 0.00000 2 2 2
DROP TABLE t1;
create table t2 (ff double); create table t2 (ff double);
insert into t2 values (2.2); insert into t2 values (2.2);
select cast(sum(distinct ff) as decimal(5,2)) from t2; select cast(sum(distinct ff) as decimal(5,2)) from t2;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -807,8 +807,8 @@ explain ...@@ -807,8 +807,8 @@ explain
SELECT straight_join sql_no_cache v1.a, v1.b, v1.real_b from t2, v1 SELECT straight_join sql_no_cache v1.a, v1.b, v1.real_b from t2, v1
where t2.b=v1.a GROUP BY t2.b; where t2.b=v1.a GROUP BY t2.b;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 index b b 2 NULL 10 Using index 1 SIMPLE t2 index b b 2 NULL 10 Using index
1 PRIMARY t1 eq_ref PRIMARY PRIMARY 1 test.t2.b 1 1 SIMPLE t1 eq_ref PRIMARY PRIMARY 1 test.t2.b 1
SELECT straight_join sql_no_cache v1.a, v1.b, v1.real_b from t2, v1 SELECT straight_join sql_no_cache v1.a, v1.b, v1.real_b from t2, v1
where t2.b=v1.a GROUP BY t2.b; where t2.b=v1.a GROUP BY t2.b;
a b real_b a b real_b
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment