Merge MariaDB 5.2.5 release into MariaDB-5.2-rpl.

This commit is contained in:
unknown 2011-04-01 15:07:10 +02:00
commit c677fea7d0
1686 changed files with 28389 additions and 42301 deletions
.bzrignore
BUILD
CMakeLists.txtMakefile.amREADME
client
cmd-line-utils
config/ac-macros
configure.in
dbug
extra
libevent
yassl
src
taocrypt
include
libmysql
libmysqld
man
mysql-test

View file

@ -22,6 +22,7 @@
*.lai
*.lib
*.lo
*.manifest
*.map
*.o
*.obj
@ -96,7 +97,8 @@ BitKeeper/tmp/gone
BitKeeper/tmp
BitKeeper/log
BitKeeper/etc/SCCS
CMakeFiles/
CMakeFiles/*
CMakeFiles
COPYING
COPYING.LIB
Docs/#manual.texi#
@ -156,6 +158,7 @@ Makefile
Makefile.in
Makefile.in'
PENDING/*
scripts/scripts
TAGS
ac_available_languages_fragment
acinclude.m4
@ -1224,9 +1227,11 @@ sql-bench/test-transactions
sql-bench/test-wisconsin
sql/*.cpp
sql/*.ds?
sql/*.def
sql/*.vcproj
sql/.gdbinit
sql/client.c
sql/cmake_dummy.cc
sql/Doxyfile
sql/f.c
sql/gen_lex_hash
@ -1888,6 +1893,7 @@ vio/viotest.cpp
win/configure.data
win/vs71cache.txt
win/vs8cache.txt
win/nmake_cache.txt
ylwrap
zlib/*.ds?
zlib/*.vcproj
@ -1938,3 +1944,6 @@ libmysqld/create_options.cc
storage/pbxt/bin/xtstat
mysql-test/mtr_command
scripts/convert-debug-for-diff
client/strings_def.h
libmysql/strings_def.h
libmysql_r/strings_def.h

View file

@ -1,11 +1,11 @@
# Copyright (C) 2002, 2004-2005 MySQL AB
#
# This library is free software; you can redistribute it and/or
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; version 2
# of the License.
#
# This library is distributed in the hope that it will be useful,
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
@ -54,7 +54,6 @@ EXTRA_DIST = FINISH.sh \
compile-pentium-icc-yassl \
compile-pentium-max \
compile-pentium-myodbc \
compile-pentium-mysqlfs-debug \
compile-pentium-pgcc \
compile-pentium-valgrind-max \
compile-pentium64 \

View file

@ -98,7 +98,7 @@ SSL_LIBRARY=--with-ssl
if [ "x$warning_mode" != "xpedantic" ]; then
# Both C and C++ warnings
warnings="-Wall -Wextra -Wunused -Wwrite-strings"
warnings="-Wall -Wextra -Wunused -Wwrite-strings -Wno-uninitialized"
# For more warnings, uncomment the following line
# warnings="$warnings -Wshadow"
@ -112,7 +112,7 @@ if [ "x$warning_mode" != "xpedantic" ]; then
# Added unless --with-debug=full
debug_extra_cflags="-O0 -g3 -gdwarf-2"
else
warnings="-W -Wall -ansi -pedantic -Wno-long-long -Wno-unused -D_POSIX_SOURCE"
warnings="-W -Wall -ansi -pedantic -Wno-long-long -Wno-unused -Wno-uninitialized -D_POSIX_SOURCE"
c_warnings="$warnings"
cxx_warnings="$warnings -std=c++98"
# NOTE: warning mode should not influence optimize/debug mode.
@ -127,12 +127,13 @@ fi
# Override -DFORCE_INIT_OF_VARS from debug_cflags. It enables the macro
# LINT_INIT(), which is only useful for silencing spurious warnings
# of static analysis tools. We want LINT_INIT() to be a no-op in Valgrind.
valgrind_flags="-USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_valgrind "
valgrind_flags="-DHAVE_valgrind -USAFEMALLOC"
valgrind_flags="$valgrind_flags -UFORCE_INIT_OF_VARS -Wno-uninitialized"
valgrind_flags="$valgrind_flags -DMYSQL_SERVER_SUFFIX=-valgrind-max"
valgrind_configs="--with-valgrind"
#
# Used in -debug builds
debug_cflags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS "
debug_cflags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG"
debug_cflags="$debug_cflags -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC"
error_inject="--with-error-inject "
#
@ -207,6 +208,24 @@ if test -z "$CXX" ; then
CXX=g++
fi
#
# Set -Wuninitialized to debug flags for gcc 4.4 and above
# because it is allowed there without -O
#
if test `$CC -v 2>&1 | tail -1 | sed 's/ .*$//'` = 'gcc' ; then
GCCVERSION=`$CC -v 2>&1 | tail -1 | \
sed 's/^[a-zA-Z][a-zA-Z]* [a-zA-Z][a-zA-Z]* //' | sed 's/ .*$//'`
GCCV1=`echo $GCCVERSION | sed 's/\..*$//'`
GCCV2=`echo $GCCVERSION | sed 's/[0-9][0-9]*\.//'|sed 's/\..*$//'`
if test '(' "$GCCV1" -gt '4' ')' -o \
'(' '(' "$GCCV1" -eq '4' ')' -a '(' "$GCCV2" -ge '4' ')' ')'
then
debug_cflags="$debug_cflags -DFORCE_INIT_OF_VARS -Wuninitialized"
fi
fi
# If ccache (a compiler cache which reduces build time)
# (http://samba.org/ccache) is installed, use it.
# We use 'grep' and hope 'grep' will work as expected

View file

@ -1,5 +1,23 @@
#!/bin/sh
# Copyright (c) 2008, 2010, Oracle.
# Copyright (c) 2009-2011 Monty Program Ab
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; version 2
# of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
# MA 02111-1307, USA
die()
{
echo "ERROR: $@"; exit 1;
@ -13,23 +31,18 @@ get_key_value()
developer_usage()
{
cat <<EOF
This script can be used by developers of MariaDB wanting to try out
early versions before binary versions are available, anyone needing
a version with a special patch included that needs to be built from
source code, or anyone else wanting to exercise full control over
the build process.
This script can be used by developers of MySQL, early adopters wanting
to try out early versions of MySQL before binary versions are
available, anyone needing a version with a special patch included that
needs to be built from source code, or anyone else wanting to exercise
full control over the MySQL build process.
This help text is targeted towards those that want to debug and test
MySQL using source code releases. If you have downloaded a source code
release and simply want to build a usable binary, you should read the
This help text is targeted towards those that want to debug and test
source code releases. If you have downloaded a source code release
and simply want to build a usable binary, you should read the
--sysadmin-help instead.
The script is also designed to be used by anyone receiving a source
code release of MySQL Cluster Carrier Grade Edition. The default
behaviour is to build the standard MySQL Cluster Carrier Grade Edition
package. Three environment variables can be used to change the
default behaviour:
Three environment variables can be used to define the default behaviour:
MYSQL_DEVELOPER
Defining this variable is similar to setting the --developer flag
@ -40,11 +53,6 @@ cat <<EOF
Defining this variable sets the --with-debug flag
Options used with this script always override any default behaviour.
The default package is MySQL Cluster Carrier Grade (standard) Edition.
For developers, the default package is MySQL Cluster Carrier Grade
Extended Edition, and the default build behaviour is to build with
autotools. If you want to skip autotools and start from a source code
release you can use the --no-autotools flag.
More information for developers can be found in --help,
--sysadmin-help, and --extended-help.
@ -62,17 +70,12 @@ sysadmin_usage()
{
cat <<EOF
This script can be used to build MySQL Cluster Carrier Grade Edition
based on a source code release you received from MySQL. It can also
be used to build many variants other variants of MySQL, in particular
various performance-optimised versions of MySQL.
It is assumed that you are building on a computer which is of the
same type as that on which you intend to run MySQL/MySQL Cluster.
same type as that on which you intend to run the program.
The simplest possible way to run this script is to allow it to use the
built-in defaults everywhere, invoking it simply as (from top-level
MySQL directory):
MariaDB source directory):
shell> BUILD/build_mccge.sh
@ -84,21 +87,15 @@ cat <<EOF
with GCC, and x86 + SPARC for Solaris using the Forte compiler and
finally x86 on Linux using the Intel compiler.
3) Invokes the GCC compiler.
4) Builds a set of MySQL/MySQL Cluster binaries; for
more information about these, see --extended-help.
4) Builds a set of of binaries ; for more information about these,
see --extended-help.
5) Default compiler is always gcc.
The default version assumes that you have a source code tarball from
which you are building, and thus autoconf and automake do not need to
be run. If you have downloaded a BitKeeper tree then you should read
be run. If you have downloaded a launchpad tree then you should read
--developer-help.
If you are building MySQL/MySQL Cluster for commercial
use then you need to set the --commercial flag to ensure that the
commercial libraries are compiled in, rather than the GPL-only
libraries. The default is to build a GPL version of MySQL Cluster
Carrier Grade Edition.
If your building on a Solaris SPARC machine and you want to compile
using SunStudio you must set
--compiler=forte; if you want to build using the Intel compiler on
@ -117,20 +114,16 @@ cat <<EOF
want the binaries installed.
Using a data directory other than the default (PREFIX/data) can be
done when starting the MySQL Server, or by invoking this script with
done when starting the server, or by invoking this script with
the --datadir option.
If you want your binaries stripped of surplus debug or other
information, use the --strip option.
If you want debug information in the binary (for example, to be
able to send gdb core dumps to MySQL Support), then you should add the
able to send gdb core dumps to support), then you should add the
flag --with-debug; if you want a production build with only debugging
information in the binary then use --debug.
If your aim is not to build MySQL Cluster Carrier Grade Edition, you
can also use this script to build MySQL Classic and MySQL Enterprise Pro
versions; see the --extended-help for descriptions of these packages.
EOF
}
@ -141,9 +134,8 @@ cat <<EOF
Usage: $0 [options]
--help Show this help message.
--sysadmin-help Show help for system administrators wishing
to build MySQL Cluster Carrier Grade Edition
or other MySQL versions.
--developer-help Show help for developers trying to build MySQL
to build MariaDB
--developer-help Show help for developers trying to build MariaDB
--with-help Show extended help on --with-xxx options to
configure
--extended-help Show extended help message
@ -166,11 +158,9 @@ Usage: $0 [options]
'path'
--debug Build normal version, but add debug
information to binary
--developer Use extensions that most MySQL developers use
--developer Use extensions that most MariaDB developers use
--no-developer Do not use extensions that most developers of
MySQL use
--commercial Use commercial libraries
--gpl Use gpl libraries
MariaDB use
--compiler=[gcc|icc|forte|SunStudio] Select compiler
--cpu=[x86|x86_64|sparc|itanium] Select CPU type
x86 => x86 and 32-bit binary
@ -180,10 +170,10 @@ Usage: $0 [options]
--32 Build a 32-bit binary even if CPU is 64-bit
--64 Build a 64-bit binary even if not sure a
64-bit CPU is being used
--package=[cge|extended|pro|classic] Select package to build
--package=[pro|classic] Select package to build
--parallelism=number Define parallelism in make
--strip Strip binaries
--error-inject Enable error injection into MySQL Server and
--error-inject Enable error injection into MariaDB Server and
data nodes
--valgrind Build with valgrind
--fast Optimise for CPU architecture built on
@ -201,12 +191,12 @@ extended_usage()
cat <<EOF
Extended help text for this script:
-----------------------------------
This script is intended to make it easier for customers using MySQL
Cluster Carrier Grade Edition, customers using performance-optimised
MySQL versions and developers to build the product from source on
these platforms/compilers: Linux/x86 (32-bit and 64-bit) (either using
gcc or icc), Linux Itanium, Solaris 8,9,10 and 11 x86 and SPARC using
-----------------------------------
This script is intended to make it easier to build
performance-optimised MariaDB versions from source on these
platforms/compilers: Linux/x86 (32-bit and 64-bit) (either using gcc
or icc), Linux Itanium, Solaris 8,9,10 and 11 x86 and SPARC using
gcc or SunStudio and MacOSX/x86/gcc.
The script automatically detects CPU type and operating system; The
@ -214,49 +204,28 @@ extended_usage()
To build on other platforms you can use the --print-only option on a
supported platform and edit the output for a proper set of commands on
the specific platform you are using. MySQL also provides custom builds
for any type of platform that is officially supported for MySQL
Cluster. For a list of supported platforms, see
http://www.mysql.com/support/supportedplatforms/cluster.html.
the specific platform you are using.
Using the --package option, it is also possible to build a "classic"
version of MySQL having only the MyISAM storage engine, a "Pro"
package including all storage engines and other features except MySQL
Cluster, and an "extended" package including these features plus MySQL
version of MariaDB having only the MyISAM storage engine, a "Pro"
package including all storage engines and other features except MariaDB
Cluster, and an "extended" package including these features plus MariaDB
Cluster (this is the default if the --developer option is used).
Different MySQL storage engines are included in the build, depending
Different MariaDB storage engines are included in the build, depending
on which --package option is used. The comment and version strong
suffix are also set according to the package selected.
--package=cge
storage engines:
ARCHIVE, BLACKHOLE, CSV, FEDERATED, MYISAM, NDB
(All storage engines except InnoDB)
comment: MySQL Cluster Carrier Grade Edition GPL/Commercial version
built from source
version string suffix: -cge
--package=extended
storage engines:
ARCHIVE, BLACKHOLE, CSV, FEDERATED, MYISAM, INNODB, NDB
(All storage engines)
comment: MySQL Cluster Carrier Grade Extended Edition GPL/Commercial
version built from source
version string suffix: -cge-extended
--package=pro
storage engines:
ARCHIVE, BLACKHOLE, CSV, FEDERATED, INNODB, MYISAM
(All storage engines except NDB)
comment: MySQL Pro GPL/Commercial version built from
source
comment: Pro versions
version string suffix: [none]
--package=classic
storage engines: CSV, MYISAM
comment: MySQL Classic GPL/Commercial version built
from source
comment: Version without InnoDB and Maria
version string suffix: [none]
All packages except Classic include support for user-defined
@ -265,10 +234,6 @@ extended_usage()
If --with-debug is used, an additional "-debug" is appended to the
version string.
--commercial
This flag prevents the use of GPL libraries which cannot be used
under a commercial license, such as the readline library.
--with-debug[=full]
This option will ensure that the version is built with debug
information enabled; the optimisation level is decreased to -O.
@ -357,8 +322,7 @@ extended_usage()
Package-specific options:
-------------------------
--with-innodb
Specifically included in the "pro" and "extended" packages, and not
in any of the others.
Specifically included in the "pro" package.
--with-comment
Sets the comment for the MySQL version, by package, as described
@ -371,12 +335,10 @@ extended_usage()
Other options used:
-------------------
--with-readline
Use the GPL readline library for command editing functions; not
available with commercial packages.
Use the GPL readline library for command editing functions.
--with-libedit
Use the BSD licensed library for command editing functions; used for
commercial packages.
Use the BSD licensed library for command editing functions.
--with-zlib-dir=bundled
Use the zlib package bundled with MySQL.
@ -579,9 +541,6 @@ parse_package()
extended )
package="extended"
;;
cge )
package="cge"
;;
*)
echo "Unknown package '$package'"
exit 1
@ -712,12 +671,6 @@ parse_options()
--developer)
developer_flag="yes"
;;
--commercial)
gpl="no"
;;
--gpl)
gpl="yes"
;;
--compiler=*)
compiler=`get_key_value "$1"`
parse_compiler
@ -765,7 +718,7 @@ parse_options()
--configure-only)
just_configure="yes"
;;
--print-only)
--print-only|--just-print)
just_print="yes"
;;
--static-linking)
@ -1063,7 +1016,7 @@ set_warning_flags()
warnings="$warnings -Wcomment -W"
warnings="$warnings -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare"
warnings="$warnings -Wwrite-strings -Wunused-function -Wunused-label"
warnings="$warnings -Wunused-value -Wunused-variable"
warnings="$warnings -Wunused-value -Wunused-variable -Wno-uninitialized"
if test "x$warning_mode" = "extra" ; then
warnings="$warnings -Wshadow"
@ -1094,7 +1047,8 @@ set_with_debug_flags()
{
if test "x$with_debug_flag" = "xyes" ; then
if test "x$developer_flag" = "xyes" ; then
loc_debug_flags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS "
loc_debug_flags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG"
loc_debug_flags="$loc_debug_flags -Wuninitialized -DFORCE_INIT_OF_VARS"
loc_debug_flags="$loc_debug_flags -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC"
compiler_flags="$compiler_flags $loc_debug_flags"
fi
@ -1167,28 +1121,19 @@ set_base_configs()
base_configs="$base_configs --with-pic"
base_configs="$base_configs --with-csv-storage-engine"
base_configs="$base_configs --with-perfschema"
base_configs="$base_configs --with-libevent"
}
#
# Add all standard engines and partitioning (included as part of MySQL
# Cluster storage engine as well) as part of MySQL Server. These are
# added in all packages except the classic package.
# Add all standard engines and partitioning
#
set_base_engines()
set_max_engines()
{
engine_configs="--with-archive-storage-engine"
engine_configs="$engine_configs --with-blackhole-storage-engine"
engine_configs="$engine_configs --without-example-storage-engine"
engine_configs="$engine_configs --with-federated-storage-engine"
engine_configs="$engine_configs --with-partition"
engine_configs="--with-plugins=max --with-plugin-maria --with-maria-tmp-tables"
engine_configs="$engine_configs --without-plugin-innodb_plugin"
base_configs="$base_configs $engine_configs"
}
set_innodb_engine()
{
base_configs="$base_configs --with-innodb"
}
set_ndb_engine()
{
base_configs="$base_configs --with-ndbcluster"
@ -1198,41 +1143,17 @@ set_ndb_engine()
set_pro_package()
{
if test "x$without_comment" != "xyes" ; then
base_configs="$base_configs --with-comment=\"MySQL Enterprise Pro $version_text built from source\""
base_configs="$base_configs --with-comment=\"Pro $version_text built from source\""
fi
if test "x$with_debug_flag" = "xyes" ; then
base_configs="$base_configs --with-server-suffix=\"-debug\""
fi
}
set_cge_extended_package()
{
if test "x$without_comment" != "xyes" ; then
base_configs="$base_configs --with-comment=\"MySQL Cluster Carrier Grade Extended Edition $version_text built from source\""
fi
if test "x$with_debug_flag" = "xyes" ; then
base_configs="$base_configs --with-server-suffix=\"-cge-extended-debug\""
else
base_configs="$base_configs --with-server-suffix=\"-cge-extended\""
fi
}
set_cge_package()
{
if test "x$without_comment" != "xyes" ; then
base_configs="$base_configs --with-comment=\"MySQL Cluster Carrier Grade Edition $version_text built from source\""
fi
if test "x$with_debug_flag" = "xyes" ; then
base_configs="$base_configs --with-server-suffix=\"-cge-debug\""
else
base_configs="$base_configs --with-server-suffix=\"-cge\""
fi
}
set_classic_package()
{
if test "x$without_comment" != "xyes" ; then
base_configs="$base_configs --with-comment=\"MySQL Classic $version_text built from source\""
base_configs="$base_configs --with-comment=\"Classic $version_text built from source\""
fi
if test "x$with_debug_flag" = "xyes" ; then
base_configs="$base_configs --with-server-suffix=\"-debug\""
@ -1618,11 +1539,7 @@ set_error_inject_configs()
set_default_package()
{
if test "x$package" = "x" ; then
if test "x$developer_flag" = "xyes" ; then
package="extended"
else
package="cge"
fi
fi
}
@ -1749,28 +1666,13 @@ set_icc_special_options
#
# Definitions of various packages possible to compile. The default is to
# build a source variant of MySQL Cluster Carrier Grade Edition
# including all storage engines except InnoDB, and to use GPL libraries.
# build a source variant including all storage engines except InnoDB.
#
set_base_configs
if test "x$gpl" = "xyes" ; then
version_text="GPL version"
else
version_text="Commercial version"
fi
if test "x$package" = "xpro" ; then
set_base_engines
set_innodb_engine
set_max_engines
set_pro_package
elif test "x$package" = "xextended" ; then
set_base_engines
set_ndb_engine
set_innodb_engine
set_cge_extended_package
elif test "x$package" = "xcge" ; then
set_base_engines
set_ndb_engine
set_cge_package
elif test "x$package" = "xclassic" ; then
set_classic_package
else

View file

@ -1,11 +0,0 @@
#! /bin/sh
path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$pentium_cflags $debug_cflags"
extra_configs="$pentium_configs $debug_configs $static_link"
extra_configs="$extra_configs --with-debug=full --with-mysqlfs --without-server --without-pstack"
. "$path/FINISH.sh"

View file

@ -4,7 +4,10 @@ path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$pentium64_cflags $fast_cflags"
extra_configs="$pentium_configs $static_link"
# On CentOS/Fedora Core 10 amd64, there is system libz.so but not
# libz.a, so need to use bundled zlib when building static
# binary. Hence we use --with-zlib-dir=bundled
extra_configs="$pentium_configs $static_link --with-zlib-dir=bundled"
CC="$CC --pipe"
strip=yes

View file

@ -13,7 +13,7 @@
path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="-m64 -mt -D_FORTEC_ -xbuiltin=%all -xlibmil -xlibmopt -fns=no -xprefetch=auto -xprefetch_level=3"
extra_flags="-m64 -fast -mt -D_FORTEC_ -xbuiltin=%all -xlibmil -xlibmopt -fns=no -xprefetch=auto -xprefetch_level=3"
extra_configs="$max_configs --with-libevent"
warnings=""

View file

@ -0,0 +1,31 @@
#!/bin/sh
# See file compile-solaris-amd64 for basic pre-requisites.
# This build uses the Sun Studio compilers (cc, CC), available from:
# http://developers.sun.com/sunstudio/downloads/index.jsp
# Note that you may want to apply current patches, as the downloaded version
# is typically out of date. Download the PKG version if you intend to patch!
# After installing, add /opt/SUNWspro/bin to your $PATH
gmake -k clean || true
/bin/rm -f */.deps/*.P config.cache
. "$path/SETUP.sh"
extra_flags="-g -m64 -mt -D_FORTEC_ -xbuiltin=%all -xlibmil -xlibmopt -fns=no -xprefetch=auto -xprefetch_level=3"
extra_configs="$max_configs --with-libevent"
warnings=""
c_warnings=""
cxx_warnings=""
base_cxxflags="-noex"
CC=cc
CFLAGS="-xstrconst"
CXX=CC
LDFLAGS="-lmtmalloc"
. "$path/FINISH.sh"

View file

@ -43,8 +43,7 @@ ADD_DEFINITIONS(-DPLUGINDIR="lib/plugin")
# Set debug options
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DFORCE_INIT_OF_VARS")
SET(localstatedir "C:\\mysql\\data")
SET(localstatedir "C:\\\\mysql\\\\data\\\\")
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/support-files/my-huge.cnf.sh
${CMAKE_SOURCE_DIR}/support-files/my-huge.ini @ONLY)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/support-files/my-innodb-heavy-4G.cnf.sh

View file

@ -1,4 +1,5 @@
# Copyright 2000-2008 MySQL AB, 2009 Sun Microsystems, Inc.
# Copyright (c) 2000, 2010, Oracle and/or its affiliates.
# Copyright (c) 2009-2011 Monty Program Ab
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -22,10 +23,9 @@ EXTRA_DIST = INSTALL-SOURCE INSTALL-WIN-SOURCE \
README COPYING EXCEPTIONS-CLIENT \
CMakeLists.txt \
config/ac-macros/libevent_configure.m4
SUBDIRS = . include @docs_dirs@ @zlib_dir@ \
@readline_topdir@ sql-common scripts \
@pstack_dir@ libservices \
libservices \
@sql_union_dirs@ storage \
@sql_server@ @man_dirs@ tests \
netware @libmysqld_dirs@ \
@ -34,7 +34,7 @@ SUBDIRS = . include @docs_dirs@ @zlib_dir@ \
DIST_SUBDIRS = . include Docs zlib \
cmd-line-utils sql-common scripts \
pstack libservices \
libservices \
strings mysys dbug extra regex libmysql libmysql_r client unittest storage plugin \
vio sql man tests \
netware libmysqld \

900
README
View file

@ -7,8 +7,8 @@ MariaDB is brought to you by many of the original developers of MySQL
who now work for Monty Program Ab, and by many people in the
community.
MySQL, which is the base of MariaDB, is a product and trademark of Sun
Microsystems, Inc. For a list of developers and other contributors,
MySQL, which is the base of MariaDB, is a product and trademark of Oracle
Corporation, Inc. For a list of developers and other contributors,
see the Credits appendix. You can also do 'SHOW authors' to get a
list of active contributors.
@ -48,6 +48,475 @@ Bugs in the MySQL code can also be submitted at http://bugs.mysql.com
***************************************************************************
%%The following software may be included in this product:
FindGTest.cmake (part of CMake 2.8.0)
Use of any of this software is governed by the terms of the license below:
# Copyright 2009 Kitware, Inc.
# Copyright 2009 Philip Lowman
# Copyright 2009 Daniel Blezek
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#===========================================================================
# (To distributed this file outside of CMake, substitute the full
# License text for the above reference.)
#
# Thanks to Daniel Blezek for the GTEST_ADD_TESTS code
Text of Copyright.txt mentioned above:
CMake - Cross Platform Makefile Generator
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the names of Kitware, Inc., the Insight Software Consortium,
nor the names of their contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
***************************************************************************
%%The following software may be included in this product:
Cmake
Use of any of this software is governed by the terms of the license below:
CMake is distributed under BSD License
Copyright (c) 2008, Kitware, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of Kitware, Inc. nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY Kitware, Inc. "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL Kitware Inc. BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Additional License(s)
cmake-2.4.8/Utilities/cmtar/compat/gethostname.c:
gethostname.c: minimal substitute for missing gethostname() function
created 2000-Mar-02 jmk
requires SVR4 uname() and -lc
by Jim Knoble
Copyright ? 2000 Jim Knoble
Permission to use, copy, modify, distribute, and sell this software
and its documentation for any purpose is hereby granted without fee,
provided that the above copyright notice appear in all copies and
that both that copyright notice and this permission notice appear in
supporting documentation.
This software is provided "as is", without warranty of any kind,
express or implied, including but not limited to the warranties of
merchantability, fitness for a particular purpose and
noninfringement. In no event shall the author(s) be liable for any
claim, damages or other liability, whether in an action of contract,
tort or otherwise, arising from, out of or in connection with the
software or the use or other dealings in the software.
----------------------------------
* Originally written by Steven M. Bellovin while
* at the University of North Carolina at Chapel Hill. Later tweaked by
* a couple of people on Usenet. Completely overhauled by Rich $alz
* and Jim Berets in August, 1990.
*
* This code is in the public domain and has no copyright.
-------------------------------
THIS CODE IS SPECIFICALLY EXEMPTED FROM THE NCURSES PACKAGE COPYRIGHT.
You may freely copy it for use as a template for your own field types.
If you develop a field type that might be of general use, please send
it back to the ncurses maintainers for inclusion in the next version.
**************************************************************************
* Author : Per Foreby, perf@efd.lth.se
* Author : Juergen Pfeifer, juergen.pfeifer@gmx.net
**************************************************************************
----------------------------------------
Copyright (c) 2002 Insight Consortium. All rights reserved.
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for
details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
--------------------------------------------
Skeleton parser for Yacc-like parsing with Bison,
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software
Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
As a special exception, when this file is copied by Bison into a
Bison output file, you may use that output file without restriction.
This special exception was added by the Free Software Foundation
in version 1.24 of Bison.
---------------------------------------------------
cmake-2.4.8/Utilities/cmzlib/zlib.h:
zlib.h -- interface of the 'zlib' general purpose compression library
version 1.1.4, March 11th, 2002
Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
Jean-loup Gailly Mark Adler
----------------------------------------------
This source code was modified by Martin Hedenfalk for use in Curl. His
latest changes were done 2000-09-18.
It has since been patched away like a madman by Daniel Stenberg to make it
better applied to curl conditions, and to make it not use globals, pollute
name space and more. This source code awaits a rewrite to work around the
paragraph 2 in the BSD licenses as explained below.
Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Hgskolan
It has since been patched and modified a lot by Daniel Stenberg to make it
better applied to curl conditions, and to make it not use globals, pollute
name space and more. This source code awaits a rewrite to work around the
paragraph 2 in the BSD licenses as explained below.
Copyright (c) 1998, 1999 Kungliga Tekniska Hgskolan
(Royal Institute of Technology, Stockholm, Sweden).
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the Institute nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
---------------------------------------------
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
--------------------------------------------------
cmake-2.4.8/Utilities/cmcurl/inet_pton.c,
cmake-2.4.8/Source/CTest/Curl/inet_pton.c:
This is from the BIND 4.9.4 release, modified to compile by itself
Copyright (c) 1996 by Internet Software Consortium.
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT,
OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
-------------------------------------------------------
* Copyright (C) 2001 by Eric Kidd. All rights reserved.
* Copyright (C) 2001 by Luke Howard. All rights reserved.
* Copyright (C) 2002 Ximian, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
---------------------------------------------------
Copyright (c) 1994
The Regents of the University of California. All rights reserved.
This code is derived from software contributed to Berkeley by
Chuck Karish of Mindcraft, Inc.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the University nor the names of its contributors
Copyright (c) 1985, 1986 The Regents of the University of California.
All rights reserved.
This code is derived from software contributed to Berkeley by
James A. Woods, derived from original work by Spencer Thomas
and Joseph Orost.
------------------------------------------------
Copyright (c) 1989, 1993, 1994
The Regents of the University of California. All rights reserved.
This code is derived from software contributed to Berkeley by
Guido van Rossum.
Copyright (c) 1990 The Regents of the University of California.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. All advertising materials mentioning features or use of this software
must display the following acknowledgement:
This product includes software developed by the University of
California, Berkeley and its contributors.
4. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
------------------------------------------------------
Project ___| | | | _ \| |
/ __| | | | |_) | |
| (__| |_| | _ <| |___
\___|\___/|_| \_\_____|
Copyright (C) 1998 - 2004, Daniel Stenberg, , et al.
Copyright (C) 2004, Daniel Stenberg, , et al.
This software is licensed as described in the file COPYING, which
you should have received as part of this distribution. The terms
are also available at http://curl.haxx.se/docs/copyright.html.
You may opt to use, copy, modify, merge, publish, distribute and/or sell
copies of the Software, and permit persons to whom the Software is
furnished to do so, under the terms of the COPYING file.
This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
KIND, either express or implied.
------------------------------------------------------------
***************************************************************************
Copyright (c) 1998 Free Software Foundation, Inc.
Copyright (c) 1998,2000 Free Software Foundation, Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, distribute with modifications, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name(s) of the above copyright
holders shall not be used in advertising or otherwise to promote the sale,
use or other dealings in this Software without prior written
authorization.
***************************************************************************
------------------------------------------------------
Copyright (c) 1997 Todd C. Miller
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
***************************************************************************
@ -90,28 +559,27 @@ dbug_analyze.c (part of Fred Fish's Dbug Library)
Use of any of this software is governed by the terms of the license below:
* *
* Copyright Abandoned, 1987, Fred Fish *
* *
* *
* This previously copyrighted work has been placed into the public *
* domain by the author and may be freely used for any purpose, *
* private or commercial. *
* *
* Because of the number of inquiries I was receiving about the use *
* of this product in commercially developed works I have decided to *
* simply make it public domain to further its unrestricted use. I *
* specifically would be most happy to see this material become a *
* part of the standard Unix distributions by AT&T and the Berkeley *
* Computer Science Research Group, and a standard part of the GNU *
* system from the Free Software Foundation. *
* *
* I would appreciate it, as a courtesy, if this notice is left in *
* all copies and derivative works. Thank you. *
* *
* The author makes no warranty of any kind with respect to this *
* product and explicitly disclaims any implied warranties of mer- *
* chantability or fitness for any particular purpose.
* Copyright Abandoned, 1987, Fred Fish *
* *
* *
* This previously copyrighted work has been placed into the public *
* domain by the author and may be freely used for any purpose, *
* private or commercial. *
* *
* Because of the number of inquiries I was receiving about the use *
* of this product in commercially developed works I have decided to *
* simply make it public domain to further its unrestricted use. I *
* specifically would be most happy to see this material become a *
* part of the standard Unix distributions by AT&T and the Berkeley *
* Computer Science Research Group, and a standard part of the GNU *
* system from the Free Software Foundation. *
* *
* I would appreciate it, as a courtesy, if this notice is left in *
* all copies and derivative works. Thank you. *
* *
* The author makes no warranty of any kind with respect to this *
* product and explicitly disclaims any implied warranties of mer- *
* chantability or fitness for any particular purpose. *
***************************************************************************
@ -572,6 +1040,73 @@ Use of any of this software is governed by the terms of the license below:
***************************************************************************
%%The following software may be included in this product:
libevent
Use of any of this software is governed by the terms of the license below:
/*
* Copyright (c) 2000-2004 Niels Provos
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
Additional License(s)
http://creativecommons.org/licenses/publicdomain
***************************************************************************
%%The following software may be included in this product:
Async DNS Library
Use of any of this software is governed by the terms of the license below:
/* Async DNS Library
* Adam Langley
* http://www.imperialviolet.org/eventdns.html
* Public Domain code
*
* This software is Public Domain. To view a copy of the public domain dedication,
* visit http://creativecommons.org/licenses/publicdomain/ or send a letter to
* Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
*
* I ask and expect, but do not require, that all derivative works contain an
* attribution similar to:
* Parts developed by Adam Langley
*
* You may wish to replace the word "Parts" with something else depending on
* the amount of original code.
*
* (Derivative works does not include programs which link against, run or include
* the source verbatim in their source distributions)
*
* Version: 0.1b
*/
***************************************************************************
%%The following software may be included in this product:
regex++
@ -671,6 +1206,20 @@ http://bioinfo.mbb.yale.edu/genome/yeast/cluster/database/mysql/include/t_ctype.
***************************************************************************
%%The following software may be included in this product:
SHA-1 in C
Use of any of this software is governed by the terms of the license below:
SHA-1 in C
By Steve Reid
100% Public Domain
Additional License(s)
100% Public Domain
***************************************************************************
%%The following software may be included in this product:
The tz database
@ -722,6 +1271,184 @@ archived older versions of code and data; there is also a smaller HTTP mirror.
***************************************************************************
%%The following software may be included in this product:
UnicodeData.txt
Use of any of this software is governed by the terms of the license below:
Unicode Terms of Use
For the general privacy policy governing access to this site, see the
Unicode Privacy Policy. For trademark usage, see the Unicode
Consortium (R) Trademarks and Logo Policy.
Notice to End User: Terms of Use
Carefully read the following legal agreement ("Agreement"). Use or
copying of the software and/or codes provided with this agreement (The
"Software") constitutes your acceptance of these terms
1. Unicode Copyright.
1. Copyright (c) 1991-2008 Unicode, Inc. All rights reserved.
2. Certain documents and files on this website contain a
legend indicating that "Modification is permitted." Any person
is hereby authorized, without fee, to modify such documents
and files to create derivative works conforming to the
Unicode (R) Standard, subject to Terms and Conditions herein.
3. Any person is hereby authorized, without fee, to view, use,
reproduce, and distribute all documents and files solely for
informational purposes in the creation of products supporting
the Unicode Standard, subject to the Terms and Conditions
herein.
4. Further specifications of rights and restrictions
pertaining to the use of the particular set of data files
known as the "Unicode Character Database" can be found in
Exhibit 1.
5. Each version of the Unicode Standard has further
specifications of rights and restrictions of use. For the book
editions, these are found on the back of the title page. For
the online edition, certain files (such as the PDF files for
book chapters and code charts) carry specific restrictions.
All other files are covered under these general Terms of Use.
To request a permission to reproduce any part of the Unicode
Standard, please contact the Unicode Consortium.
6. No license is granted to "mirror" the Unicode website where
a fee is charged for access to the "mirror" site.
7. Modification is not permitted with respect to this
document. All copies of this document must be verbatim.
2. Restricted Rights Legend. Any technical data or software which is
licensed to the United States of America, its agencies and/or
instrumentalities under this Agreement is commercial technical data
or commercial computer software developed exclusively at private
expense as defined in FAR 2.101, or DFARS 252.227-7014 (June 1995),
as applicable. For technical data, use, duplication, or disclosure
by the Government is subject to restrictions as set forth in DFARS
202.227-7015 Technical Data, Commercial and Items (Nov 1995) and
this Agreement. For Software, in accordance with FAR 12-212 or DFARS
227-7202, as applicable, use, duplication or disclosure by the
Government is subject to the restrictions set forth in this
Agreement.
3. Warranties and Disclaimers.
1. This publication and/or website may include technical or
typographical errors or other inaccuracies . Changes are
periodically added to the information herein; these changes
will be incorporated in new editions of the publication and/or
website. Unicode may make improvements and/or changes in the
product(s) and/or program(s) described in this publication
and/or website at any time.
2. If this file has been purchased on magnetic or optical
media from Unicode, Inc. the sole and exclusive remedy for any
claim will be exchange of the defective media within ninety
(90) days of original purchase.
3. EXCEPT AS PROVIDED IN SECTION C.2, THIS PUBLICATION AND/OR
SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND
EITHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT
LIMITED TO, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UNICODE AND ITS
LICENSORS ASSUME NO RESPONSIBILITY FOR ERRORS OR OMISSIONS IN
THIS PUBLICATION AND/OR SOFTWARE OR OTHER DOCUMENTS WHICH ARE
REFERENCED BY OR LINKED TO THIS PUBLICATION OR THE UNICODE
WEBSITE.
4. Waiver of Damages. In no event shall Unicode or its licensors be
liable for any special, incidental, indirect or consequential
damages of any kind, or any damages whatsoever, whether or not
Unicode was advised of the possibility of the damage, including,
without limitation, those resulting from the following: loss of use,
data or profits, in connection with the use, modification or
distribution of this information or its derivatives.
5. Trademarks.
1. Unicode and the Unicode logo are registered trademarks of
Unicode, Inc.
2. This site contains product names and corporate names of
other companies. All product names and company names and logos
mentioned herein are the trademarks or registered trademarks
of their respective owners. Other products and corporate names
mentioned herein which are trademarks of a third party are
used only for explanation and for the owners' benefit and with
no intent to infringe.
3. Use of third party products or information referred to
herein is at the user's risk.
6. Miscellaneous.
1. Jurisdiction and Venue. This server is operated from a
location in the State of California, United States of America.
Unicode makes no representation that the materials are
appropriate for use in other locations. If you access this
server from other locations, you are responsible for
compliance with local laws. This Agreement, all use of this
site and any claims and damages resulting from use of this
site are governed solely by the laws of the State of
California without regard to any principles which would apply
the laws of a different jurisdiction. The user agrees that any
disputes regarding this site shall be resolved solely in the
courts located in Santa Clara County, California. The user
agrees said courts have personal jurisdiction and agree to
waive any right to transfer the dispute to any other forum.
2. Modification by Unicode Unicode shall have the right to
modify this Agreement at any time by posting it to this site.
The user may not assign any part of this Agreement without
Unicode's prior written consent.
3. Taxes. The user agrees to pay any taxes arising from access
to this website or use of the information herein, except for
those based on Unicode's net income.
4. Severability. If any provision of this Agreement is
declared invalid or unenforceable, the remaining provisions of
this Agreement shall remain in effect.
5. Entire Agreement. This Agreement constitutes the entire
agreement between the parties.
EXHIBIT 1
UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE
Unicode Data Files include all data files under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/, and
http://www.unicode.org/cldr/data/ . Unicode Software includes any source code
published in the Unicode Standard or under the directories
http://www.unicode.org/Public/, http://www.unicode.org/reports/, and
http://www.unicode.org/cldr/data/.
NOTICE TO USER: Carefully read the following legal agreement. BY
DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S DATA FILES
("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), YOU UNEQUIVOCALLY ACCEPT, AND
AGREE TO BE BOUND BY, ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU
DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES
OR SOFTWARE.
COPYRIGHT AND PERMISSION NOTICE
Copyright (c) 1991-2008 Unicode, Inc. All rights reserved. Distributed under
the Terms of Use in http://www.unicode.org/copyright.html.
Permission is hereby granted, free of charge, to any person obtaining a copy
of the Unicode data files and any associated documentation (the "Data Files") or
Unicode software and any associated documentation (the "Software") to deal in
the Data Files or Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files or
Software are furnished to do so, provided that (a) the above copyright notice(s)
and this permission notice appear with all copies of the Data Files or Software,
(b) both the above copyright notice(s) and this permission notice appear in
associated documentation, and (c) there is clear notice in each modified Data
File or in the Software as well as in the documentation associated with the Data
File(s) or Software that the data or software has been modified.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD
PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder shall not
be used in advertising or otherwise to promote the sale, use or other dealings
in these Data Files or Software without prior written authorization of the
copyright holder.
Unicode and the Unicode logo are trademarks of Unicode, Inc., and may be
registered in some jurisdictions. All other trademarks and registered trademarks
mentioned herein are the property of their respective owners.
***************************************************************************
%%The following software may be included in this product:
zlib
@ -755,6 +1482,35 @@ Use of any of this software is governed by the terms of the license below:
***************************************************************************
%%The following software may be included in this product:
dtoa.c
Use of any of this software is governed by the terms of the license below:
/****************************************************************
This file incorporates work covered by the following copyright and
permission notice:
The author of this software is David M. Gay.
Copyright (c) 1991, 2000, 2001 by Lucent Technologies.
Permission to use, copy, modify, and distribute this software for any
purpose without fee is hereby granted, provided that this entire
notice is included in all copies of any software which is or includes a copy
or modification of this software and in all copies of the supporting
documentation for such software.
THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY
REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
***************************************************************/
***************************************************************************
%%The following software may be included in this product:
getarg.{c,h}
@ -1195,99 +1951,3 @@ proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
***************************************************************************
%%The following software may be included in this product:
pstack (part of GNU Binutils)
Use of any of this software is governed by the terms of the license below:
pstack is comprised of various .c and .h files; all begin like this:
/* bucomm.h -- binutils common include file.
Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
This file is part of GNU Binutils.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
***************************************************************************
%%The following software may be included in this product:
libiberty.h (part of pstack GNU Binutils)
Use of any of this software is governed by the terms of the license below:
See
http://www.koders.com/c/fid99F596804BBE22C076522B848D5575F142079064.aspx
/* Function declarations for libiberty.
Written by Cygnus Support, 1994.
The libiberty library provides a number of functions which are
missing on some operating systems. We do not declare those here,
to avoid conflicts with the system header files on operating
systems that do support those functions. In this file we only
declare those functions which are specific to libiberty. */
***************************************************************************
%%The following software may be included in this product:
ieee.h (part of pstack GNU Binutils)
Use of any of this software is governed by the terms of the license below:
See
http://src.opensolaris.org/source/xref//sfw/usr/src/cmd/gdb/gdb-6.3/include/ieee.h
/* IEEE Standard 695-1980 "Universal Format for Object Modules"
header file
Contributed by Cygnus Support. */
***************************************************************************
%%The following software may be included in this product:
pstack.c (part of pstack GNU Binutils)
Use of any of this software is governed by the terms of the license below:
/*
pstack.c -- asynchronous stack trace of a running process
Copyright (c) 1999 Ross Thompson
Author: Ross Thompson
Critical bug fix: Tim Waugh
*/
/*
This file is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
***************************************************************************

View file

@ -107,7 +107,7 @@ sql_src=log_event.h mysql_priv.h rpl_constants.h \
log_event_old.h log_event_old.cc \
rpl_record_old.h rpl_record_old.cc \
sql_list.h rpl_filter.h sql_list.cc rpl_filter.cc
strings_src=decimal.c
strings_src=decimal.c strings_def.h
link_sources:
for f in $(sql_src) ; do \

View file

@ -1,11 +1,11 @@
/* Copyright (C) 2000-2002 MySQL AB
This library is free software; you can redistribute it and/or
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; version 2
of the License.
This library is distributed in the hope that it will be useful,
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.

View file

@ -1,5 +1,5 @@
/* Copyright (C) 2000-2009 MySQL AB
Copyright 2000, 2010, Oracle and/or its affiliates. All rights reserved.
Copyright 2000, 2010, Oracle and/or its affiliates.
Copyright 2000-2010 Monty Program Ab
This program is free software; you can redistribute it and/or modify
@ -1464,8 +1464,8 @@ static struct my_option my_long_options[] =
&opt_sigint_ignore, &opt_sigint_ignore, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"one-database", 'o',
"Only update the default database. This is useful for skipping updates "
"to other database in the update log.",
"Ignore statements except those that occur while the default "
"database is the one named at the command line.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef USE_POPEN
{"pager", OPT_PAGER,
@ -2766,6 +2766,10 @@ static void get_current_db()
{
MYSQL_RES *res;
/* If one_database is set, current_db is not supposed to change. */
if (one_database)
return;
my_free(current_db, MYF(MY_ALLOW_ZERO_PTR));
current_db= NULL;
/* In case of error below current_db will be NULL */

View file

@ -701,11 +701,16 @@ static bool shall_skip_database(const char *log_dbname)
producing USE statements by corresponding log event print-functions.
*/
void print_use_stmt(PRINT_EVENT_INFO* pinfo, const char* db, size_t db_len)
static void
print_use_stmt(PRINT_EVENT_INFO* pinfo, const Query_log_event *ev)
{
const char* db= ev->db;
const size_t db_len= ev->db_len;
// pinfo->db is the current db.
// If current db is the same as required db, do nothing.
if (!db || !memcmp(pinfo->db, db, db_len + 1))
if ((ev->flags & LOG_EVENT_SUPPRESS_USE_F) || !db ||
!memcmp(pinfo->db, db, db_len + 1))
return;
// Current db and required db are different.
@ -855,7 +860,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
*/
qe->flags|= LOG_EVENT_SUPPRESS_USE_F;
}
print_use_stmt(print_event_info, qe->db, qe->db_len);
print_use_stmt(print_event_info, qe);
if (opt_base64_output_mode == BASE64_OUTPUT_ALWAYS)
{
if ((retval= write_event_header_and_base64(ev, result_file,
@ -988,7 +993,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
if (!shall_skip_database(exlq->db))
{
print_use_stmt(print_event_info, exlq->db, exlq->db_len);
print_use_stmt(print_event_info, exlq);
if (fname)
{
convert_path_to_forward_slashes(fname);
@ -1599,7 +1604,7 @@ static int parse_args(int *argc, char*** argv)
*/
static Exit_status safe_connect()
{
/* Close and old connections to MySQL */
/* Close any old connections to MySQL */
if (mysql)
mysql_close(mysql);

View file

@ -68,7 +68,7 @@
#define MAX_COLUMNS 256
#define MAX_EMBEDDED_SERVER_ARGS 64
#define MAX_DELIMITER_LENGTH 16
#define DEFAULT_MAX_CONN 128
#define DEFAULT_MAX_CONN 64
/* Flags controlling send and reap */
#define QUERY_SEND_FLAG 1
@ -134,6 +134,7 @@ static char TMPDIR[FN_REFLEN];
static char global_subst_from[200];
static char global_subst_to[200];
static char *global_subst= NULL;
static MEM_ROOT require_file_root;
/* Block stack */
enum block_cmd {
@ -243,7 +244,7 @@ HASH var_hash;
struct st_connection
{
MYSQL mysql;
MYSQL *mysql;
/* Used when creating views and sp, to avoid implicit commit */
MYSQL* util_mysql;
char *name;
@ -458,9 +459,9 @@ struct st_command
char *query, *query_buf,*first_argument,*last_argument,*end;
DYNAMIC_STRING content;
int first_word_len, query_len;
my_bool abort_on_error;
my_bool abort_on_error, used_replace;
struct st_expected_errors expected_errors;
char require_file[FN_REFLEN];
char *require_file;
enum enum_commands type;
};
@ -488,7 +489,7 @@ VAR* var_init(VAR* v, const char *name, int name_len, const char *val,
void var_free(void* v);
VAR* var_get(const char *var_name, const char** var_name_end,
my_bool raw, my_bool ignore_not_existing);
void eval_expr(VAR* v, const char *p, const char** p_end);
void eval_expr(VAR* v, const char *p, const char** p_end, bool backtick= true);
my_bool match_delimiter(int c, const char *delim, uint length);
void dump_result_to_reject_file(char *buf, int size);
void dump_warning_messages();
@ -748,8 +749,11 @@ pthread_handler_t send_one_query(void *arg)
{
struct st_connection *cn= (struct st_connection*)arg;
if (!cn->mysql)
return 0;
mysql_thread_init();
VOID(mysql_send_query(&cn->mysql, cn->cur_query, cn->cur_query_len));
VOID(mysql_send_query(cn->mysql, cn->cur_query, cn->cur_query_len));
mysql_thread_end();
pthread_mutex_lock(&cn->mutex);
@ -763,8 +767,11 @@ pthread_handler_t send_one_query(void *arg)
static int do_send_query(struct st_connection *cn, const char *q, int q_len,
int flags)
{
if (!cn->mysql)
die("Trying to send a query without a connection");
if (flags & QUERY_REAP_FLAG)
return mysql_send_query(&cn->mysql, q, q_len);
return mysql_send_query(cn->mysql, q, q_len);
if (pthread_mutex_init(&cn->mutex, NULL) ||
pthread_cond_init(&cn->cond, NULL))
@ -801,7 +808,7 @@ static void wait_query_thread_end(struct st_connection *con)
#else /*EMBEDDED_LIBRARY*/
#define do_send_query(cn,q,q_len,flags) mysql_send_query(&cn->mysql, q, q_len)
#define do_send_query(cn,q,q_len,flags) mysql_send_query(cn->mysql, q, q_len)
#endif /*EMBEDDED_LIBRARY*/
@ -1113,8 +1120,9 @@ void handle_command_error(struct st_command *command, uint error,
int i;
if (command->abort_on_error)
die("command \"%.*s\" failed with error %d",
command->first_word_len, command->query, error);
die("command \"%.*s\" failed with error: %u my_errno: %d errno: %d",
command->first_word_len, command->query, error, my_errno,
sys_errno);
i= match_expected_error(command, error, NULL);
@ -1126,8 +1134,8 @@ void handle_command_error(struct st_command *command, uint error,
DBUG_VOID_RETURN;
}
if (command->expected_errors.count > 0)
die("command \"%.*s\" failed with wrong error: %u, errno: %d",
command->first_word_len, command->query, error, sys_errno);
die("command \"%.*s\" failed with wrong error: %u my_errno: %d errno: %d",
command->first_word_len, command->query, error, my_errno, sys_errno);
}
else if (command->expected_errors.err[0].type == ERR_ERRNO &&
command->expected_errors.err[0].code.errnum != 0)
@ -1149,7 +1157,8 @@ void close_connections()
if (next_con->stmt)
mysql_stmt_close(next_con->stmt);
next_con->stmt= 0;
mysql_close(&next_con->mysql);
mysql_close(next_con->mysql);
next_con->mysql= 0;
if (next_con->util_mysql)
mysql_close(next_con->util_mysql);
my_free(next_con->name, MYF(MY_ALLOW_ZERO_PTR));
@ -1220,25 +1229,23 @@ void free_used_memory()
free_all_replace();
my_free(opt_pass,MYF(MY_ALLOW_ZERO_PTR));
free_defaults(default_argv);
free_root(&require_file_root, MYF(0));
free_re();
#ifdef __WIN__
free_tmp_sh_file();
free_win_path_patterns();
#endif
/* Only call mysql_server_end if mysql_server_init has been called */
if (server_initialized)
mysql_server_end();
/* Don't use DBUG after mysql_server_end() */
DBUG_VIOLATION_HELPER_LEAVE;
return;
DBUG_VOID_RETURN;
}
static void cleanup_and_exit(int exit_code)
{
free_used_memory();
/* Only call mysql_server_end if mysql_server_init has been called */
if (server_initialized)
mysql_server_end();
my_end(my_end_arg);
if (!silent) {
@ -1302,7 +1309,7 @@ void die(const char *fmt, ...)
been produced prior to the error
*/
if (cur_con && !cur_con->pending)
show_warnings_before_error(&cur_con->mysql);
show_warnings_before_error(cur_con->mysql);
cleanup_and_exit(1);
}
@ -1352,6 +1359,8 @@ void verbose_msg(const char *fmt, ...)
{
va_list args;
DBUG_ENTER("verbose_msg");
DBUG_PRINT("enter", ("format: %s", fmt));
if (!verbose)
DBUG_VOID_RETURN;
@ -2009,7 +2018,7 @@ VAR *var_init(VAR *v, const char *name, int name_len, const char *val,
val_len = strlen(val) ;
val_alloc_len = val_len + 16; /* room to grow */
if (!(tmp_var=v) && !(tmp_var = (VAR*)my_malloc(sizeof(*tmp_var)
+ name_len+1, MYF(MY_WME))))
+ name_len+2, MYF(MY_WME))))
die("Out of memory");
if (name != NULL)
@ -2231,7 +2240,7 @@ void var_query_set(VAR *var, const char *query, const char** query_end)
*query_end : query + strlen(query));
MYSQL_RES *res;
MYSQL_ROW row;
MYSQL* mysql = &cur_con->mysql;
MYSQL* mysql = cur_con->mysql;
DYNAMIC_STRING ds_query;
DBUG_ENTER("var_query_set");
LINT_INIT(res);
@ -2281,7 +2290,8 @@ void var_query_set(VAR *var, const char *query, const char** query_end)
dynstr_append_mem(&result, "\t", 1);
}
end= result.str + result.length-1;
eval_expr(var, result.str, (const char**) &end);
/* Evaluation should not recurse via backtick */
eval_expr(var, result.str, (const char**) &end, false);
dynstr_free(&result);
}
else
@ -2319,7 +2329,7 @@ void var_set_query_get_value(struct st_command *command, VAR *var)
long row_no;
int col_no= -1;
MYSQL_RES* res;
MYSQL* mysql= &cur_con->mysql;
MYSQL* mysql= cur_con->mysql;
static DYNAMIC_STRING ds_query;
static DYNAMIC_STRING ds_col;
@ -2437,7 +2447,7 @@ void var_copy(VAR *dest, VAR *src)
}
void eval_expr(VAR *v, const char *p, const char **p_end)
void eval_expr(VAR *v, const char *p, const char **p_end, bool backtick)
{
DBUG_ENTER("eval_expr");
@ -2462,7 +2472,7 @@ void eval_expr(VAR *v, const char *p, const char **p_end)
DBUG_VOID_RETURN;
}
if (*p == '`')
if (*p == '`' && backtick)
{
var_query_set(v, p, p_end);
DBUG_VOID_RETURN;
@ -3025,6 +3035,7 @@ void do_remove_files_wildcard(struct st_command *command)
{
int error= 0, sys_errno= 0;
uint i;
size_t directory_length;
MY_DIR *dir_info;
FILEINFO *file;
char dir_separator[2];
@ -3055,8 +3066,8 @@ void do_remove_files_wildcard(struct st_command *command)
}
init_dynamic_string(&ds_file_to_remove, dirname, 1024, 1024);
dir_separator[0]= FN_LIBCHAR;
dir_separator[1]= 0;
dynstr_append(&ds_file_to_remove, dir_separator);
dynstr_append_mem(&ds_file_to_remove, dir_separator, 1);
directory_length= ds_file_to_remove.length;
/* Set default wild chars for wild_compare, is changed in embedded mode */
set_wild_chars(1);
@ -3072,8 +3083,7 @@ void do_remove_files_wildcard(struct st_command *command)
if (ds_wild.length &&
wild_compare(file->name, ds_wild.str, 0))
continue;
ds_file_to_remove.length= ds_directory.length + 1;
ds_file_to_remove.str[ds_directory.length + 1]= 0;
ds_file_to_remove.length= directory_length;
dynstr_append(&ds_file_to_remove, file->name);
DBUG_PRINT("info", ("removing file: %s", ds_file_to_remove.str));
if ((error= (my_delete(ds_file_to_remove.str, MYF(MY_WME)) != 0)))
@ -3338,7 +3348,7 @@ static int get_list_files(DYNAMIC_STRING *ds, const DYNAMIC_STRING *ds_dirname,
if (ds_wild && ds_wild->length &&
wild_compare(file->name, ds_wild->str, 0))
continue;
dynstr_append(ds, file->name);
replace_dynstr_append(ds, file->name);
dynstr_append(ds, "\n");
}
set_wild_chars(0);
@ -3368,6 +3378,7 @@ static void do_list_files(struct st_command *command)
{"file", ARG_STRING, FALSE, &ds_wild, "Filename (incl. wildcard)"}
};
DBUG_ENTER("do_list_files");
command->used_replace= 1;
check_command_args(command, command->first_argument,
list_files_args,
@ -3409,6 +3420,7 @@ static void do_list_files_write_file_command(struct st_command *command,
{"file", ARG_STRING, FALSE, &ds_wild, "Filename (incl. wildcard)"}
};
DBUG_ENTER("do_list_files_write_file");
command->used_replace= 1;
check_command_args(command, command->first_argument,
list_files_args,
@ -3749,7 +3761,7 @@ void do_send_quit(struct st_command *command)
if (!(con= find_connection_by_name(name)))
die("connection '%s' not found in connection pool", name);
simple_command(&con->mysql,COM_QUIT,0,0,1);
simple_command(con->mysql,COM_QUIT,0,0,1);
DBUG_VOID_RETURN;
}
@ -3773,7 +3785,7 @@ void do_send_quit(struct st_command *command)
void do_change_user(struct st_command *command)
{
MYSQL *mysql = &cur_con->mysql;
MYSQL *mysql = cur_con->mysql;
/* static keyword to make the NetWare compiler happy. */
static DYNAMIC_STRING ds_user, ds_passwd, ds_db;
const struct command_arg change_user_args[] = {
@ -3970,7 +3982,7 @@ int do_echo(struct st_command *command)
void do_wait_for_slave_to_stop(struct st_command *c __attribute__((unused)))
{
static int SLAVE_POLL_INTERVAL= 300000;
MYSQL* mysql = &cur_con->mysql;
MYSQL* mysql = cur_con->mysql;
for (;;)
{
MYSQL_RES *UNINIT_VAR(res);
@ -4000,7 +4012,7 @@ void do_sync_with_master2(struct st_command *command, long offset)
{
MYSQL_RES *res;
MYSQL_ROW row;
MYSQL *mysql= &cur_con->mysql;
MYSQL *mysql= cur_con->mysql;
char query_buf[FN_REFLEN+128];
int timeout= 300; /* seconds */
@ -4090,7 +4102,7 @@ int do_save_master_pos()
{
MYSQL_RES *res;
MYSQL_ROW row;
MYSQL *mysql = &cur_con->mysql;
MYSQL *mysql = cur_con->mysql;
const char *query;
int rpl_parse;
DBUG_ENTER("do_save_master_pos");
@ -4316,22 +4328,22 @@ void do_let(struct st_command *command)
int do_rpl_probe(struct st_command *command __attribute__((unused)))
{
DBUG_ENTER("do_rpl_probe");
if (mysql_rpl_probe(&cur_con->mysql))
die("Failed in mysql_rpl_probe(): '%s'", mysql_error(&cur_con->mysql));
if (mysql_rpl_probe(cur_con->mysql))
die("Failed in mysql_rpl_probe(): '%s'", mysql_error(cur_con->mysql));
DBUG_RETURN(0);
}
int do_enable_rpl_parse(struct st_command *command __attribute__((unused)))
{
mysql_enable_rpl_parse(&cur_con->mysql);
mysql_enable_rpl_parse(cur_con->mysql);
return 0;
}
int do_disable_rpl_parse(struct st_command *command __attribute__((unused)))
{
mysql_disable_rpl_parse(&cur_con->mysql);
mysql_disable_rpl_parse(cur_con->mysql);
return 0;
}
@ -4507,7 +4519,7 @@ void do_shutdown_server(struct st_command *command)
{
int timeout=60, pid;
DYNAMIC_STRING ds_pidfile_name;
MYSQL* mysql = &cur_con->mysql;
MYSQL* mysql = cur_con->mysql;
static DYNAMIC_STRING ds_timeout;
const struct command_arg shutdown_args[] = {
{"timeout", ARG_STRING, FALSE, &ds_timeout, "Timeout before killing server"}
@ -4848,7 +4860,7 @@ void set_current_connection(struct st_connection *con)
cur_con= con;
/* Update $mysql_get_server_version to that of current connection */
var_set_int("$mysql_get_server_version",
mysql_get_server_version(&con->mysql));
mysql_get_server_version(con->mysql));
/* Update $CURRENT_CONNECTION to the name of the current connection */
var_set_string("$CURRENT_CONNECTION", con->name);
}
@ -4921,10 +4933,10 @@ void do_close_connection(struct st_command *command)
#ifndef EMBEDDED_LIBRARY
if (command->type == Q_DIRTY_CLOSE)
{
if (con->mysql.net.vio)
if (con->mysql->net.vio)
{
vio_delete(con->mysql.net.vio);
con->mysql.net.vio = 0;
vio_delete(con->mysql->net.vio);
con->mysql->net.vio = 0;
}
}
#else
@ -4939,14 +4951,15 @@ void do_close_connection(struct st_command *command)
mysql_stmt_close(con->stmt);
con->stmt= 0;
mysql_close(&con->mysql);
mysql_close(con->mysql);
con->mysql= 0;
if (con->util_mysql)
mysql_close(con->util_mysql);
con->util_mysql= 0;
con->pending= FALSE;
my_free(con->name, MYF(0));
my_free(con->name, MYF(MY_ALLOW_ZERO_PTR));
/*
When the connection is closed set name to "-closed_connection-"
@ -5300,24 +5313,26 @@ void do_connect(struct st_command *command)
if (!(con_slot= find_connection_by_name("-closed_connection-")))
die("Connection limit exhausted, you can have max %d connections",
opt_max_connections);
my_free(con_slot->name, MYF(0));
con_slot->name= 0;
}
#ifdef EMBEDDED_LIBRARY
con_slot->query_done= 1;
con_slot->has_thread= FALSE;
#endif
if (!mysql_init(&con_slot->mysql))
if (!(con_slot->mysql= mysql_init(0)))
die("Failed on mysql_init()");
if (opt_compress || con_compress)
mysql_options(&con_slot->mysql, MYSQL_OPT_COMPRESS, NullS);
mysql_options(&con_slot->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
mysql_options(&con_slot->mysql, MYSQL_SET_CHARSET_NAME,
mysql_options(con_slot->mysql, MYSQL_OPT_COMPRESS, NullS);
mysql_options(con_slot->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
mysql_options(con_slot->mysql, MYSQL_SET_CHARSET_NAME,
charset_info->csname);
if (opt_charsets_dir)
mysql_options(&con_slot->mysql, MYSQL_SET_CHARSET_DIR,
mysql_options(con_slot->mysql, MYSQL_SET_CHARSET_DIR,
opt_charsets_dir);
if (opt_connect_timeout >= 0)
mysql_options(&con_slot->mysql, MYSQL_OPT_CONNECT_TIMEOUT,
mysql_options(con_slot->mysql, MYSQL_OPT_CONNECT_TIMEOUT,
&opt_connect_timeout);
#ifdef HAVE_OPENSSL
@ -5328,12 +5343,12 @@ void do_connect(struct st_command *command)
if (con_ssl)
{
#ifdef HAVE_OPENSSL
mysql_ssl_set(&con_slot->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
mysql_ssl_set(con_slot->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
#if MYSQL_VERSION_ID >= 50000
/* Turn on ssl_verify_server_cert only if host is "localhost" */
opt_ssl_verify_server_cert= !strcmp(ds_host.str, "localhost");
mysql_options(&con_slot->mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
mysql_options(con_slot->mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
&opt_ssl_verify_server_cert);
#endif
#endif
@ -5347,7 +5362,7 @@ void do_connect(struct st_command *command)
}
if (opt_protocol)
mysql_options(&con_slot->mysql, MYSQL_OPT_PROTOCOL, (char*) &opt_protocol);
mysql_options(con_slot->mysql, MYSQL_OPT_PROTOCOL, (char*) &opt_protocol);
#ifdef HAVE_SMEM
if (con_shm)
@ -5355,12 +5370,12 @@ void do_connect(struct st_command *command)
uint protocol= MYSQL_PROTOCOL_MEMORY;
if (!ds_shm.length)
die("Missing shared memory base name");
mysql_options(&con_slot->mysql, MYSQL_SHARED_MEMORY_BASE_NAME, ds_shm.str);
mysql_options(&con_slot->mysql, MYSQL_OPT_PROTOCOL, &protocol);
mysql_options(con_slot->mysql, MYSQL_SHARED_MEMORY_BASE_NAME, ds_shm.str);
mysql_options(con_slot->mysql, MYSQL_OPT_PROTOCOL, &protocol);
}
else if (shared_memory_base_name)
{
mysql_options(&con_slot->mysql, MYSQL_SHARED_MEMORY_BASE_NAME,
mysql_options(con_slot->mysql, MYSQL_SHARED_MEMORY_BASE_NAME,
shared_memory_base_name);
}
#endif
@ -5373,7 +5388,7 @@ void do_connect(struct st_command *command)
if (ds_database.length && !strcmp(ds_database.str,"*NO-ONE*"))
dynstr_set(&ds_database, "");
if (connect_n_handle_errors(command, &con_slot->mysql,
if (connect_n_handle_errors(command, con_slot->mysql,
ds_host.str,ds_user.str,
ds_password.str, ds_database.str,
con_port, ds_sock.str))
@ -5500,7 +5515,9 @@ void do_block(enum block_cmd cmd, struct st_command* command)
if (*expr_start == '!')
{
not_expr= TRUE;
expr_start++; /* Step past the '!' */
expr_start++; /* Step past the '!', then any whitespace */
while (*expr_start && my_isspace(charset_info, *expr_start))
expr_start++;
}
/* Find ending ')' */
expr_end= strrchr(expr_start, ')');
@ -6084,7 +6101,7 @@ static struct my_option my_long_options[] =
{"max-connections", OPT_MAX_CONNECTIONS,
"Max number of open connections to server",
&opt_max_connections, &opt_max_connections, 0,
GET_INT, REQUIRED_ARG, 128, 8, 5120, 0, 0, 0},
GET_INT, REQUIRED_ARG, DEFAULT_MAX_CONN, 8, 5120, 0, 0, 0},
{"password", 'p', "Password to use when connecting to server.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
@ -6236,6 +6253,7 @@ get_one_option(int optid, const struct my_option *opt,
#ifndef DBUG_OFF
DBUG_PUSH(argument ? argument : "d:t:S:i:O,/tmp/mysqltest.trace");
debug_check_flag= 1;
debug_info_flag= 1;
#endif
break;
case 'r':
@ -6351,7 +6369,7 @@ int parse_args(int argc, char **argv)
if (debug_info_flag)
my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO;
if (debug_check_flag)
my_end_arg= MY_CHECK_ERROR;
my_end_arg|= MY_CHECK_ERROR;
if (global_subst != NULL)
{
@ -6852,12 +6870,22 @@ void run_query_normal(struct st_connection *cn, struct st_command *command,
DYNAMIC_STRING *ds, DYNAMIC_STRING *ds_warnings)
{
MYSQL_RES *res= 0;
MYSQL *mysql= &cn->mysql;
MYSQL *mysql= cn->mysql;
int err= 0, counter= 0;
DBUG_ENTER("run_query_normal");
DBUG_PRINT("enter",("flags: %d", flags));
DBUG_PRINT("enter", ("query: '%-.60s'", query));
if (!mysql)
{
/* Emulate old behaviour of sending something on a closed connection */
handle_error(command, 2006, "MySQL server has gone away",
"000000", ds);
cn->pending= FALSE;
var_set_errno(2006);
DBUG_VOID_RETURN;
}
if (flags & QUERY_SEND_FLAG)
{
/*
@ -7057,7 +7085,7 @@ void handle_error(struct st_command *command,
DBUG_ENTER("handle_error");
if (command->require_file[0])
if (command->require_file)
{
/*
The query after a "--require" failed. This is fine as long the server
@ -7441,7 +7469,7 @@ int util_query(MYSQL* org_mysql, const char* query){
void run_query(struct st_connection *cn, struct st_command *command, int flags)
{
MYSQL *mysql= &cn->mysql;
MYSQL *mysql= cn->mysql;
DYNAMIC_STRING *ds;
DYNAMIC_STRING *save_ds= NULL;
DYNAMIC_STRING ds_result;
@ -7484,7 +7512,7 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
Create a temporary dynamic string to contain the output from
this query.
*/
if (command->require_file[0])
if (command->require_file)
{
init_dynamic_string(&ds_result, "", 1024, 1024);
ds= &ds_result;
@ -7642,7 +7670,7 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
mysql_errno(mysql), mysql_error(mysql));
}
if (command->require_file[0])
if (command->require_file)
{
/* A result file was specified for _this_ query
and the output should be checked against an already
@ -7724,6 +7752,16 @@ void init_re(void)
int match_re(my_regex_t *re, char *str)
{
while (my_isspace(charset_info, *str))
str++;
if (str[0] == '/' && str[1] == '*')
{
char *comm_end= strstr (str, "*/");
if (! comm_end)
die("Statement is unterminated comment");
str= comm_end + 2;
}
int err= my_regexec(re, str, (size_t)0, NULL, 0);
if (err == 0)
@ -7862,13 +7900,16 @@ static void dump_backtrace(void)
{
struct st_connection *conn= cur_con;
my_safe_print_str("read_command_buf", read_command_buf,
sizeof(read_command_buf));
fprintf(stderr, "read_command_buf (%p): ", read_command_buf);
my_safe_print_str(read_command_buf, sizeof(read_command_buf));
if (conn)
{
my_safe_print_str("conn->name", conn->name, conn->name_len);
fprintf(stderr, "conn->name (%p): ", conn->name);
my_safe_print_str(conn->name, conn->name_len);
#ifdef EMBEDDED_LIBRARY
my_safe_print_str("conn->cur_query", conn->cur_query, conn->cur_query_len);
fprintf(stderr, "conn->cur_query (%p): ", conn->cur_query);
my_safe_print_str(conn->cur_query, conn->cur_query_len);
#endif
}
fputs("Attempting backtrace...\n", stderr);
@ -7971,6 +8012,7 @@ int main(int argc, char **argv)
char save_file[FN_REFLEN];
bool empty_result= FALSE;
MY_INIT(argv[0]);
DBUG_ENTER("main");
save_file[0]= 0;
TMPDIR[0]= 0;
@ -8002,8 +8044,8 @@ int main(int argc, char **argv)
my_init_dynamic_array(&q_lines, sizeof(struct st_command*), 1024, 1024);
if (hash_init(&var_hash, charset_info,
1024, 0, 0, get_var_key, var_free, MYF(0)))
if (hash_init2(&var_hash, 64, charset_info,
128, 0, 0, get_var_key, var_free, MYF(0)))
die("Variable hash initialization failed");
var_set_string("MYSQL_SERVER_VERSION", MYSQL_SERVER_VERSION);
@ -8030,6 +8072,7 @@ int main(int argc, char **argv)
#endif
init_dynamic_string(&ds_res, "", 2048, 2048);
init_alloc_root(&require_file_root, 1024, 1024);
parse_args(argc, argv);
@ -8053,6 +8096,14 @@ int main(int argc, char **argv)
var_set_int("$VIEW_PROTOCOL", view_protocol);
var_set_int("$CURSOR_PROTOCOL", cursor_protocol);
var_set_int("$ENABLED_QUERY_LOG", 1);
var_set_int("$ENABLED_ABORT_ON_ERROR", 1);
var_set_int("$ENABLED_RESULT_LOG", 1);
var_set_int("$ENABLED_CONNECT_LOG", 0);
var_set_int("$ENABLED_WARNINGS", 1);
var_set_int("$ENABLED_INFO", 0);
var_set_int("$ENABLED_METADATA", 0);
DBUG_PRINT("info",("result_file: '%s'",
result_file_name ? result_file_name : ""));
verbose_msg("Results saved in '%s'.",
@ -8078,30 +8129,30 @@ int main(int argc, char **argv)
ps_protocol_enabled= 1;
st_connection *con= connections;
if (!( mysql_init(&con->mysql)))
if (! (con->mysql= mysql_init(0)))
die("Failed in mysql_init()");
if (opt_compress)
mysql_options(&con->mysql,MYSQL_OPT_COMPRESS,NullS);
mysql_options(&con->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
mysql_options(&con->mysql, MYSQL_SET_CHARSET_NAME,
mysql_options(con->mysql,MYSQL_OPT_COMPRESS,NullS);
mysql_options(con->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
mysql_options(con->mysql, MYSQL_SET_CHARSET_NAME,
charset_info->csname);
if (opt_charsets_dir)
mysql_options(&con->mysql, MYSQL_SET_CHARSET_DIR,
mysql_options(con->mysql, MYSQL_SET_CHARSET_DIR,
opt_charsets_dir);
if (opt_protocol)
mysql_options(&con->mysql,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol);
mysql_options(con->mysql,MYSQL_OPT_PROTOCOL,(char*)&opt_protocol);
#ifdef HAVE_OPENSSL
if (opt_use_ssl)
{
mysql_ssl_set(&con->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
mysql_ssl_set(con->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
#if MYSQL_VERSION_ID >= 50000
/* Turn on ssl_verify_server_cert only if host is "localhost" */
opt_ssl_verify_server_cert= opt_host && !strcmp(opt_host, "localhost");
mysql_options(&con->mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
mysql_options(con->mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
&opt_ssl_verify_server_cert);
#endif
}
@ -8109,13 +8160,13 @@ int main(int argc, char **argv)
#ifdef HAVE_SMEM
if (shared_memory_base_name)
mysql_options(&con->mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
mysql_options(con->mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
#endif
if (!(con->name = my_strdup("default", MYF(MY_WME))))
die("Out of memory");
safe_connect(&con->mysql, con->name, opt_host, opt_user, opt_pass,
safe_connect(con->mysql, con->name, opt_host, opt_user, opt_pass,
opt_db, opt_port, unix_sock);
/* Use all time until exit if no explicit 'start_timer' */
@ -8196,22 +8247,64 @@ int main(int argc, char **argv)
case Q_RPL_PROBE: do_rpl_probe(command); break;
case Q_ENABLE_RPL_PARSE: do_enable_rpl_parse(command); break;
case Q_DISABLE_RPL_PARSE: do_disable_rpl_parse(command); break;
case Q_ENABLE_QUERY_LOG: disable_query_log=0; break;
case Q_DISABLE_QUERY_LOG: disable_query_log=1; break;
case Q_ENABLE_ABORT_ON_ERROR: abort_on_error=1; break;
case Q_DISABLE_ABORT_ON_ERROR: abort_on_error=0; break;
case Q_ENABLE_RESULT_LOG: disable_result_log=0; break;
case Q_DISABLE_RESULT_LOG: disable_result_log=1; break;
case Q_ENABLE_CONNECT_LOG: disable_connect_log=0; break;
case Q_DISABLE_CONNECT_LOG: disable_connect_log=1; break;
case Q_ENABLE_WARNINGS: disable_warnings=0; break;
case Q_DISABLE_WARNINGS: disable_warnings=1; break;
case Q_ENABLE_PREPARE_WARNINGS: prepare_warnings_enabled=1; break;
case Q_DISABLE_PREPARE_WARNINGS: prepare_warnings_enabled=0; break;
case Q_ENABLE_INFO: disable_info=0; break;
case Q_DISABLE_INFO: disable_info=1; break;
case Q_ENABLE_METADATA: display_metadata=1; break;
case Q_DISABLE_METADATA: display_metadata=0; break;
case Q_ENABLE_QUERY_LOG:
disable_query_log= 0;
var_set_int("$ENABLED_QUERY_LOG", 1);
break;
case Q_DISABLE_QUERY_LOG:
disable_query_log= 1;
var_set_int("$ENABLED_QUERY_LOG", 0);
break;
case Q_ENABLE_ABORT_ON_ERROR:
abort_on_error= 1;
var_set_int("$ENABLED_ABORT_ON_ERROR", 1);
break;
case Q_DISABLE_ABORT_ON_ERROR:
abort_on_error= 0;
var_set_int("$ENABLED_ABORT_ON_ERROR", 0);
break;
case Q_ENABLE_RESULT_LOG:
disable_result_log= 0;
var_set_int("$ENABLED_RESULT_LOG", 1);
break;
case Q_DISABLE_RESULT_LOG:
disable_result_log=1;
var_set_int("$ENABLED_RESULT_LOG", 0);
break;
case Q_ENABLE_CONNECT_LOG:
disable_connect_log=0;
var_set_int("$ENABLED_CONNECT_LOG", 1);
break;
case Q_DISABLE_CONNECT_LOG:
disable_connect_log=1;
var_set_int("$ENABLED_CONNECT_LOG", 0);
break;
case Q_ENABLE_WARNINGS:
disable_warnings= 0;
var_set_int("$ENABLED_WARNINGS", 1);
break;
case Q_DISABLE_WARNINGS:
disable_warnings= 1;
var_set_int("$ENABLED_WARNINGS", 0);
break;
case Q_ENABLE_INFO:
disable_info= 0;
var_set_int("$ENABLED_INFO", 1);
break;
case Q_DISABLE_INFO:
disable_info= 1;
var_set_int("$ENABLED_INFO", 0);
break;
case Q_ENABLE_METADATA:
display_metadata= 1;
var_set_int("$ENABLED_METADATA", 1);
break;
case Q_DISABLE_METADATA:
display_metadata= 0;
var_set_int("$ENABLED_METADATA", 0);
break;
case Q_SOURCE: do_source(command); break;
case Q_SLEEP: do_sleep(command, 0); break;
case Q_REAL_SLEEP: do_sleep(command, 1); break;
@ -8301,7 +8394,9 @@ int main(int argc, char **argv)
if (save_file[0])
{
strmake(command->require_file, save_file, sizeof(save_file) - 1);
if (!(command->require_file= strdup_root(&require_file_root,
save_file)))
die("out of memory for require_file");
save_file[0]= 0;
}
run_query(cur_con, command, flags);
@ -8370,11 +8465,11 @@ int main(int argc, char **argv)
command->last_argument= command->end;
break;
case Q_PING:
handle_command_error(command, mysql_ping(&cur_con->mysql), -1);
handle_command_error(command, mysql_ping(cur_con->mysql), -1);
break;
case Q_SEND_SHUTDOWN:
handle_command_error(command,
mysql_shutdown(&cur_con->mysql,
mysql_shutdown(cur_con->mysql,
SHUTDOWN_DEFAULT), -1);
break;
case Q_SHUTDOWN_SERVER:
@ -8404,10 +8499,10 @@ int main(int argc, char **argv)
ps_protocol_enabled= ps_protocol;
break;
case Q_DISABLE_RECONNECT:
set_reconnect(&cur_con->mysql, 0);
set_reconnect(cur_con->mysql, 0);
break;
case Q_ENABLE_RECONNECT:
set_reconnect(&cur_con->mysql, 1);
set_reconnect(cur_con->mysql, 1);
/* Close any open statements - no reconnect, need new prepare */
close_statements();
break;
@ -8475,7 +8570,7 @@ int main(int argc, char **argv)
memset(&saved_expected_errors, 0, sizeof(saved_expected_errors));
}
if (command_executed != last_command_executed)
if (command_executed != last_command_executed || command->used_replace)
{
/*
As soon as any command has been executed,

View file

@ -1012,8 +1012,9 @@ vi_histedit(EditLine *el, int c __attribute__((__unused__)))
if (fd < 0)
return CC_ERROR;
cp = el->el_line.buffer;
write(fd, cp, el->el_line.lastchar - cp +0u);
write(fd, "\n", 1);
if (write(fd, cp, el->el_line.lastchar - cp +0u) == -1 ||
write(fd, "\n", 1) == -1)
return CC_ERROR;
pid = fork();
switch (pid) {
case -1:

View file

@ -855,7 +855,7 @@ _rl_read_init_file (filename, include_level)
{
register int i;
char *buffer, *openname, *line, *end;
size_t file_size;
size_t file_size = 0;
current_readline_init_file = filename;
current_readline_init_include_level = include_level;

View file

@ -673,8 +673,7 @@ fnprint (to_print)
w = wcwidth (wc);
width = (w >= 0) ? w : 1;
}
fwrite (s, 1, tlen, rl_outstream);
s += tlen;
s+= fwrite (s, 1, tlen, rl_outstream);
printed_len += width;
#else
putc (*s, rl_outstream);

View file

@ -621,7 +621,8 @@ _rl_output_some_chars (string, count)
const char *string;
int count;
{
fwrite (string, 1, count, _rl_out_stream);
if (fwrite (string, 1, count, _rl_out_stream) != (size_t)count)
fprintf(stderr, "Write failed\n");
}
/* Move the cursor back. */

View file

@ -15,10 +15,14 @@ AC_DEFUN([MY_MAINTAINER_MODE], [
# Set warning options required under maintainer mode.
AC_DEFUN([MY_MAINTAINER_MODE_WARNINGS], [
# Detect ICC posing as GCC.
AC_EGREP_CPP([^__INTEL_COMPILER], [__INTEL_COMPILER],
[INTEL_COMPILER=no], [INTEL_COMPILER=yes])
# Setup GCC warning options.
AS_IF([test "$GCC" = "yes"], [
AS_IF([test "$GCC" = "yes" -a "$INTEL_COMPILER" = "no"], [
C_WARNINGS="-Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing -Werror -DFORCE_INIT_OF_VARS"
CXX_WARNINGS="${C_WARNINGS} -Wno-unused-parameter"
C_WARNINGS="${C_WARNINGS} -Wdeclaration-after-statement"
])
# Test whether the warning options work.

View file

@ -20,6 +20,10 @@ save_CPPFLAGS="$CPPFLAGS"
save_LIBS="$LIBS"
CPPFLAGS="$ZLIB_INCLUDES $CPPFLAGS"
LIBS="$LIBS $ZLIB_LIBS"
case "$with_mysqld_ldflags " in
*"-all-static "*)
CPPFLAGS="$CPPFLAGS -static"
esac
if test X"$with_server" = Xno
then
zlibsym=zlibVersion

View file

@ -12,7 +12,8 @@ dnl
dnl When changing the major version number please also check the switch
dnl statement in mysqlbinlog::check_master_version(). You may also need
dnl to update version.c in ndb.
AC_INIT([MariaDB Server], [5.2.4-MariaDB-rpl], [], [mysql])
AC_INIT([MariaDB Server], [5.2.5-MariaDB-rpl], [], [mysql])
AC_CONFIG_SRCDIR([sql/mysqld.cc])
AC_CANONICAL_SYSTEM
@ -715,6 +716,17 @@ AC_ARG_ENABLE(assembler,
[ ENABLE_ASSEMBLER=no ]
)
# Don't use assembler if building on Solaris with native linker
# and with embedded. Because our asm code is not PIC and solaris ld
# aborts with an error when creating .so
if test "x$ENABLE_ASSEMBLER" = "xyes" -a \
"x$LD_VERSION_SCRIPT" = "x" -a \
"x$with_embedded_server" = "xyes" -a \
`expr "$SYSTEM_TYPE" : "^.*solaris"` -gt 0; then
ENABLE_ASSEMBLER=no
AC_MSG_WARN([No assembler functions when non-GNU linker is used and embedded-server is enabled])
fi
AC_MSG_CHECKING(if we should use assembler functions)
# For now we only support assembler on i386 and sparc systems
AM_CONDITIONAL(ASSEMBLER_x86, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "i386" && $CCAS $CCASFLAGS -c strings/strings-x86.s -o checkassembler >/dev/null 2>&1 && test -f checkassembler && (rm -f checkassembler; exit 0;))
@ -947,46 +959,6 @@ struct request_info *req;
])
AC_SUBST(WRAPLIBS)
if test "$TARGET_LINUX" = "true"; then
AC_ARG_WITH(pstack,
[ --with-pstack Use the pstack backtrace library],
[ USE_PSTACK=$withval ],
[ USE_PSTACK=no ])
pstack_libs=
pstack_dir=
if test "$USE_PSTACK" = yes -a "$TARGET_LINUX" = "true" -a "$BASE_MACHINE_TYPE" = "i386"
then
have_libiberty= have_libbfd=
my_save_LIBS="$LIBS"
dnl I have no idea if this is a good test - can not find docs for libiberty
AC_CHECK_LIB([iberty], [fdmatch],
[have_libiberty=yes
AC_CHECK_LIB([bfd], [bfd_openr], [have_libbfd=yes], , [-liberty])])
LIBS="$my_save_LIBS"
if test x"$have_libiberty" = xyes -a x"$have_libbfd" = xyes
then
pstack_dir="pstack"
pstack_libs="../pstack/libpstack.a -lbfd -liberty"
# We must link staticly when using pstack
with_mysqld_ldflags="-all-static"
AC_SUBST([pstack_dir])
AC_SUBST([pstack_libs])
AC_DEFINE([USE_PSTACK], [1], [the pstack backtrace library])
dnl This check isn't needed, but might be nice to give some feedback....
dnl AC_CHECK_HEADER(libiberty.h,
dnl have_libiberty_h=yes,
dnl have_libiberty_h=no)
else
USE_PSTACK="no"
fi
else
USE_PSTACK="no"
fi
fi
AC_MSG_CHECKING([if we should use pstack])
AC_MSG_RESULT([$USE_PSTACK])
# Check for gtty if termio.h doesn't exists
if test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no"
then
@ -1215,7 +1187,7 @@ dnl Is this the right match for DEC OSF on alpha?
sql/Makefile.in)
# Use gen_lex_hash.linux instead of gen_lex_hash
# Add library dependencies to mysqld_DEPENDENCIES
lib_DEPENDENCIES="\$(pstack_libs) \$(openssl_libs) \$(yassl_libs)"
lib_DEPENDENCIES="\$(openssl_libs) \$(yassl_libs)"
cat > $filesed << EOF
s,\(\./gen_lex_hash\)\$(EXEEXT),\1.linux,
s%\(mysqld_DEPENDENCIES = \)%\1$lib_DEPENDENCIES %
@ -1595,6 +1567,31 @@ else
fi
fi
#
# Solaris bug http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6611808
# Detect and work around.
#
AC_MSG_CHECKING([for OpenSolaris Bug 6611808])
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Werror"
AC_COMPILE_IFELSE([
#include <pthread.h>
void dummy() {}
int main()
{
pthread_once_t once_control = { PTHREAD_ONCE_INIT };
pthread_once(&once_control, dummy);
return 0;
}
], [
AC_DEFINE([PTHREAD_ONCE_INITIALIZER], [{PTHREAD_ONCE_INIT}],
[See OpenSolaris Bug 6611808])
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([no])
]);
CFLAGS="$save_CFLAGS"
#---START: Used in for client configure
# Must be checked after, because strtok_r may be in -lpthread
# On AIX strtok_r is in libc_r
@ -2934,9 +2931,6 @@ esac
AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS)
# Output results
if test -d "$srcdir/pstack" ; then
AC_CONFIG_FILES(pstack/Makefile pstack/aout/Makefile)
fi
if test -d "$srcdir/cmd-line-utils/readline" ; then
AC_CONFIG_FILES(cmd-line-utils/readline/Makefile)
fi

View file

@ -2446,6 +2446,25 @@ void _db_flush_()
}
#ifndef __WIN__
void _db_suicide_()
{
int retval;
sigset_t new_mask;
sigfillset(&new_mask);
fprintf(stderr, "SIGKILL myself\n");
fflush(stderr);
retval= kill(getpid(), SIGKILL);
assert(retval == 0);
retval= sigsuspend(&new_mask);
fprintf(stderr, "sigsuspend returned %d errno %d \n", retval, errno);
assert(FALSE); /* With full signal mask, we should never return here. */
}
#endif /* ! __WIN__ */
void _db_lock_file_()
{
CODE_STATE *cs;

View file

@ -70,4 +70,3 @@ while($src=shift)
}
warn "All done!\n";

View file

@ -185,7 +185,7 @@ devpoll_init(struct event_base *base)
}
static int
devpoll_recalc(struct event_base *base, void *arg, int max)
devpoll_recalc(struct event_base *base __attribute__((unused)), void *arg, int max)
{
struct devpollop *devpollop = arg;

View file

@ -21,6 +21,9 @@
* with SSL types and sockets
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <string.h> // memcpy
#include "runtime.hpp"

View file

@ -1,6 +1,10 @@
// benchmark.cpp
// TaoCrypt benchmark
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <string.h>
#include <stdio.h>

View file

@ -110,7 +110,7 @@ public:
word32 size(bool use_current = false);
private:
void put(Source&);
size_t put(Source&);
FileSink(const FileSink&); // hide
FileSink& operator=(const FileSink&); // hide

View file

@ -98,9 +98,9 @@ FileSink::~FileSink()
// fill source from file sink
void FileSink::put(Source& source)
size_t FileSink::put(Source& source)
{
fwrite(source.get_buffer(), 1, source.size(), file_);
return fwrite(source.get_buffer(), 1, source.size(), file_);
}

View file

@ -1,6 +1,10 @@
// test.cpp
// test taocrypt functionality
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <string.h>
#include <stdio.h>

View file

@ -1,11 +1,11 @@
# Copyright (C) 2000-2006 MySQL AB
#
# This library is free software; you can redistribute it and/or
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; version 2
# of the License.
#
# This library is distributed in the hope that it will be useful,
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.

View file

@ -122,6 +122,7 @@ extern "C" {
#define CANT_DELETE_OPEN_FILES 1
#define FN_LIBCHAR '\\'
#define FN_DIRSEP "/\\" /* Valid directory separators */
#define FN_ROOTDIR "\\"
#define FN_DEVCHAR ':'

View file

@ -364,6 +364,7 @@ inline ulonglong double2ulonglong(double d)
/* File name handling */
#define FN_LIBCHAR '\\'
#define FN_DIRSEP "/\\" /* Valid directory separators */
#define FN_ROOTDIR "\\"
#define FN_DEVCHAR ':'
#define FN_NETWORK_DRIVES /* Uses \\ to indicate network drives */

View file

@ -490,6 +490,8 @@ extern my_bool my_parse_charset_xml(const char *bug, size_t len,
int (*add)(struct charset_info_st *cs));
extern char *my_strchr(CHARSET_INFO *cs, const char *str, const char *end,
pchar c);
extern size_t my_strcspn(CHARSET_INFO *cs, const char *str, const char *end,
const char *accept);
my_bool my_propagate_simple(CHARSET_INFO *cs, const uchar *str, size_t len);
my_bool my_propagate_complex(CHARSET_INFO *cs, const uchar *str, size_t len);

View file

@ -77,7 +77,9 @@ extern "C" {
extern void *(*my_str_malloc)(size_t);
extern void (*my_str_free)(void *);
#if defined(HAVE_STPCPY)
#if defined(HAVE_STPCPY) && MY_GNUC_PREREQ(3, 4) && !defined(__INTEL_COMPILER)
#define strmov(A,B) __builtin_stpcpy((A),(B))
#elif defined(HAVE_STPCPY)
#define strmov(A,B) stpcpy((A),(B))
#ifndef stpcpy
extern char *stpcpy(char *, const char *); /* For AIX with gcc 2.95.3 */

View file

@ -1,7 +1,7 @@
#ifndef MY_COMPILER_INCLUDED
#define MY_COMPILER_INCLUDED
/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2010, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -76,6 +76,11 @@
/**
Generic (compiler-independent) features.
*/
#ifndef MY_GNUC_PREREQ
# define MY_GNUC_PREREQ(maj, min) (0)
#endif
#ifndef MY_ALIGNOF
# ifdef __cplusplus
template<typename type> struct my_alignof_helper { char m1; type m2; };

View file

@ -126,7 +126,7 @@ extern void _db_flush_();
#define DBUG_END() _db_end_ ()
#define DBUG_LOCK_FILE _db_lock_file_()
#define DBUG_UNLOCK_FILE _db_unlock_file_()
#define DBUG_ASSERT(A) assert(A)
#define DBUG_ASSERT(A) do { _db_flush_(); assert(A); } while(0)
#define DBUG_EXPLAIN(buf,len) _db_explain_(0, (buf),(len))
#define DBUG_EXPLAIN_INITIAL(buf,len) _db_explain_init_((buf),(len))
#define DEBUGGER_OFF do { _dbug_on_= 0; } while(0)
@ -157,7 +157,8 @@ extern void _db_flush_();
#ifdef __WIN__
#define DBUG_SUICIDE() DBUG_ABORT()
#else
#define DBUG_SUICIDE() (_db_flush_(), kill(getpid(), SIGKILL), pause())
extern void _db_suicide_();
#define DBUG_SUICIDE() (_db_flush_(), _db_suicide_())
#endif
#else /* No debugger */

View file

@ -781,6 +781,7 @@ typedef SOCKET_SIZE_TYPE size_socket;
#ifndef FN_LIBCHAR
#define FN_LIBCHAR '/'
#define FN_DIRSEP "/" /* Valid directory separators */
#define FN_ROOTDIR "/"
#endif
#define MY_NFILE 64 /* This is only used to save filenames */

View file

@ -1,4 +1,5 @@
/* Copyright (C) 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc.
/* Copyright (C) 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc,
2010-2011 Oracle and/or its affiliates, 2009-2010 Monty Program Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -125,11 +126,10 @@ int my_pthread_once(my_pthread_once_t *once_control,void (*init_routine)(void));
struct tm *localtime_r(const time_t *timep,struct tm *tmp);
struct tm *gmtime_r(const time_t *timep,struct tm *tmp);
void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/
#ifndef ETIMEDOUT
#define ETIMEDOUT 145 /* Win32 doesn't have this */
#define ETIMEDOUT 145 /* Win32 might not have this */
#endif
#define getpid() GetCurrentThreadId()
#define HAVE_LOCALTIME_R 1
@ -224,7 +224,11 @@ extern int my_pthread_getprio(pthread_t thread_id);
typedef void *(* pthread_handler)(void *);
#define my_pthread_once_t pthread_once_t
#if defined(PTHREAD_ONCE_INITIALIZER)
#define MY_PTHREAD_ONCE_INIT PTHREAD_ONCE_INITIALIZER
#else
#define MY_PTHREAD_ONCE_INIT PTHREAD_ONCE_INIT
#endif
#define my_pthread_once(C,F) pthread_once(C,F)
/* Test first for RTS or FSU threads */

View file

@ -47,7 +47,7 @@ C_MODE_START
#if defined(HAVE_STACKTRACE) || defined(HAVE_BACKTRACE)
void my_init_stacktrace();
void my_print_stacktrace(uchar* stack_bottom, ulong thread_stack);
void my_safe_print_str(const char* name, const char* val, int max_len);
void my_safe_print_str(const char* val, int max_len);
void my_write_core(int sig);
#if BACKTRACE_DEMANGLE
char *my_demangle(const char *mangled_name, int *status);

View file

@ -675,6 +675,7 @@ extern void init_glob_errs(void);
extern void wait_for_free_space(const char *filename, int errors);
extern FILE *my_fopen(const char *FileName,int Flags,myf MyFlags);
extern FILE *my_fdopen(File Filedes,const char *name, int Flags,myf MyFlags);
extern FILE *my_freopen(const char *path, const char *mode, FILE *stream);
extern int my_fclose(FILE *fd,myf MyFlags);
extern int my_chsize(File fd,my_off_t newlength, int filler, myf MyFlags);
extern int my_chmod(const char *name, mode_t mode, myf my_flags);

View file

@ -20,7 +20,6 @@
/* Things we don't need in the embedded version of MySQL */
/* TODO HF add #undef HAVE_VIO if we don't want client in embedded library */
#undef HAVE_PSTACK /* No stacktrace */
#undef HAVE_OPENSSL
#undef HAVE_SMEM /* No shared memory */
#undef HAVE_NDBCLUSTER_DB /* No NDB cluster */

View file

@ -64,10 +64,11 @@ extern const char * NEAR globerrs[]; /* my_error_messages is here */
#define EE_FILE_NOT_CLOSED 30
#define EE_CHANGE_OWNERSHIP 31
#define EE_CHANGE_PERMISSIONS 32
#define EE_CANT_CHMOD 33
#define EE_CANT_SEEK 34
#define EE_CANT_SEEK 33
#define EE_CANT_CHMOD 34
#define EE_CANT_COPY_OWNERSHIP 35
#define EE_ERROR_LAST 35 /* Copy last error nr */
/* Add error numbers before EE_ERROR_LAST and change it accordingly. */
/* exit codes for all MySQL programs */
@ -86,9 +87,7 @@ extern const char * NEAR globerrs[]; /* my_error_messages is here */
#define EXIT_OPTION_DISABLED 12
#define EXIT_ARGUMENT_INVALID 13
#ifdef __cplusplus
}
#endif
#endif

View file

@ -123,7 +123,7 @@ typedef struct st_thr_lock_data {
struct st_thr_lock *lock;
pthread_cond_t *cond;
void *status_param; /* Param to status functions */
void *debug_print_param;
void *debug_print_param; /* Used by MariaDB for TABLE ref */
enum thr_lock_type type;
uint priority;
} THR_LOCK_DATA;
@ -149,6 +149,7 @@ typedef struct st_thr_lock {
my_bool (*start_trans)(void*); /* When all locks are taken */
my_bool (*check_status)(void *);
void (*fix_status)(void *, void *);/* For thr_merge_locks() */
const char *name; /* Used for error reporting */
my_bool allow_multiple_concurrent_insert;
} THR_LOCK;

View file

@ -41,7 +41,7 @@ link_sources:
ms=`echo $(mysysobjects) | sed "s;\.lo;.c;g"`; \
vs=`echo $(vio_objects) | sed "s;\.lo;.c;g"`; \
scs=`echo $(sql_cmn_objects) | sed "s;\.lo;.c;g"`; \
for f in $$ss; do \
for f in $$ss $(mystringsheaders); do \
rm -f $$f; \
@LN_CP_F@ $(top_srcdir)/strings/$$f $$f; \
done; \

View file

@ -51,6 +51,7 @@ mystringsobjects = strmov.lo strxmov.lo strxnmov.lo strnmov.lo \
strmov_overlapp.lo
mystringsextra= strto.c
mystringsheaders= strings_def.h
dbugobjects = dbug.lo # IT IS IN SAFEMALLOC.C sanity.lo
mysysheaders = mysys_priv.h my_static.h
vioheaders = vio_priv.h

View file

@ -133,7 +133,7 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)),
mysql_port = MYSQL_PORT;
#ifndef MSDOS
{
char *env;
char *env;
/*
if builder specifically requested a default port, use that
@ -213,11 +213,19 @@ void STDCALL mysql_server_end()
{
my_end(0);
}
#ifdef NOT_NEEDED
/*
The following is not needed as if the program explicitely called
my_init() then we can assume it will also call my_end().
The reason to not also do it here is in that case we can't get
statistics from my_end() to debug log.
*/
else
{
free_charsets();
mysql_thread_end();
}
#endif
mysql_client_init= org_my_init_done= 0;
#ifdef EMBEDDED_SERVER

View file

@ -154,6 +154,12 @@ ADD_LIBRARY(mysqlserver STATIC ${LIBMYSQLD_SOURCES})
ADD_DEPENDENCIES(mysqlserver GenServerSource GenError)
TARGET_LINK_LIBRARIES(mysqlserver psapi.lib)
IF(MSVC AND CMAKE_SIZEOF_VOID_P MATCHES 8)
# Workaround cmake bug http://www.vtk.org/Bug/view.php?id=11240
SET_TARGET_PROPERTIES(mysqlserver PROPERTIES STATIC_LIBRARY_FLAGS
"/MACHINE:AMD64")
ENDIF()
# Add any additional libraries requested by engine(s)
FOREACH (ENGINE_LIB ${MYSQLD_STATIC_ENGINE_LIBS})
STRING(TOUPPER ${ENGINE_LIB} ENGINE_LIB_UPPER)

View file

@ -1,14 +0,0 @@
/*
* Copyright (c) 2000
* SWsoft company
*
* This material is provided "as is", with absolutely no warranty expressed
* or implied. Any use is at your own risk.
*
* Permission to use or copy this software for any purpose is hereby granted
* without fee, provided the above notices are retained on all copies.
* Permission to modify the code and to distribute modified code is granted,
* provided the above notices are retained, and a notice that the code was
* modified is included with the above copyright notice.
*
*/

View file

@ -1,11 +1,11 @@
# Copyright (C) 2000-2001, 2003-2006 MySQL AB
#
# This library is free software; you can redistribute it and/or
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; version 2
# of the License.
#
# This library is distributed in the hope that it will be useful,
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.

View file

@ -1,11 +1,11 @@
# Copyright (C) 2000-2006 MySQL AB
#
# This library is free software; you can redistribute it and/or
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; version 2
# of the License.
#
# This library is distributed in the hope that it will be useful,
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
@ -109,6 +109,7 @@ TEST_DIRS = t r include std_data std_data/parts collections \
suite/innodb suite/innodb/t suite/innodb/r suite/innodb/include \
suite/innodb_plugin suite/innodb_plugin/t suite/innodb_plugin/r \
suite/innodb_plugin/include \
suite/handler \
suite/engines suite/engines/funcs suite/engines/iuds suite/engines/rr_trx \
suite/engines/funcs/r suite/engines/funcs/t suite/engines/iuds/r \
suite/engines/iuds/t suite/engines/rr_trx/include suite/engines/rr_trx/r \

View file

@ -4,13 +4,14 @@ this directory. It will fire up the newly built mysqld and test it.
Note that you do not have to have to do "make install", and you could
actually have a co-existing MySQL installation. The tests will not
conflict with it.
conflict with it. To run the test suite in a source directory, you
must do make first.
All tests must pass. If one or more of them fail on your system, please
read the following manual section for instructions on how to report the
problem:
http://dev.mysql.com/doc/mysql/en/mysql-test-suite.html
http://kb.askmonty.org/v/reporting-bugs
If you want to use an already running MySQL server for specific tests,
use the --extern option to mysql-test-run. Please note that in this mode,
@ -27,7 +28,6 @@ With no test cases named on the command line, mysql-test-run falls back
to the normal "non-extern" behavior. The reason for this is that some
tests cannot run with an external server.
You can create your own test cases. To create a test case, create a new
file in the t subdirectory using a text editor. The file should have a .test
extension. For example:
@ -60,14 +60,19 @@ extension. For example:
mysql test < t/test_case_name.test > r/test_case_name.result
mysqltest --record --record-file=r/test_case_name.result < t/test_case_name.test
mysqltest --record --database test --result-file=r/test_case_name.result < t/test_case_name.test
When this is done, take a look at r/test_case_name.result
- If the result is incorrect, you have found a bug. In this case, you should
edit the test result to the correct results so that we can verify
that the bug is corrected in future releases.
To submit your test case, put your .test file and .result file(s) into
a tar.gz archive, add a README that explains the problem, ftp the
archive to ftp://support.mysql.com/pub/mysql/secret/ and send a mail
to bugs@lists.mysql.com
If you want to submit your test case you can send it
to maria-developers@lists.launchpad.com or attach it to a bug report on
https://bugs.launchpad.net/maria/.
If the test case is really big or if it contains 'not public' data,
then put your .test file and .result file(s) into a tar.gz archive,
add a README that explains the problem, ftp the archive to
ftp://ftp.askmonty.org/private and send a mail to
https://bugs.launchpad.net/maria/ about it.

8
mysql-test/collections/default.weekly Normal file → Executable file
View file

@ -0,0 +1,8 @@
perl mysql-test-run.pl --timer --force --comment=1st --experimental=collections/default.experimental 1st
perl mysql-test-run.pl --timer --force --comment=big-tests --experimental=collections/default.experimental --vardir=var-big-tests --big-test --testcase-timeout=60 --suite-timeout=600 parts.partition_alter1_2_ndb parts.part_supported_sql_func_innodb parts.partition_alter1_2_innodb parts.partition_alter4_innodb parts.partition_alter1_1_2_ndb parts.partition_alter1_1_2_innodb parts.partition_alter1_1_ndb rpl_ndb.rpl_truncate_7ndb_2 main.archive-big main.sum_distinct-big main.mysqlbinlog_row_big main.alter_table-big main.variables-big main.type_newdecimal-big main.read_many_rows_innodb main.log_tables-big main.count_distinct3 main.events_time_zone main.merge-big main.create-big main.events_stress main.ssl-big funcs_1.myisam_views-big
perl mysql-test-run.pl --timer --force --parallel=auto --comment=eits-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-stmt-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam
perl mysql-test-run.pl --timer --force --parallel=auto --comment=eits-rpl-binlog-row-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-binlog-row-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam --do-test=rpl --mysqld=--binlog-format=row
perl mysql-test-run.pl --timer --force --parallel=auto --comment=eits-rpl-binlog-mixed-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-binlog-mixed-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam --do-test=rpl --mysqld=--binlog-format=mixed
perl mysql-test-run.pl --timer --force --parallel=auto --comment=eits-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-stmt-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb
perl mysql-test-run.pl --timer --force --parallel=auto --comment=eits-rpl-binlog-row-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-binlog-row-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --do-test=rpl --mysqld=--binlog-format=row
perl mysql-test-run.pl --timer --force --parallel=auto --comment=eits-rpl-binlog-mixed-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-binlog-mixed-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --do-test=rpl --mysqld=--binlog-format=mixed

View file

@ -0,0 +1,5 @@
perl mysql-test-run.pl --timer --force --parallel=auto --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --experimental=collections/default.experimental
perl mysql-test-run.pl --timer --force --parallel=auto --comment=ps_row --vardir=var-ps_row --ps-protocol --mysqld=--binlog-format=row --experimental=collections/default.experimental
perl mysql-test-run.pl --timer --force --parallel=auto --comment=embedded --vardir=var-emebbed --embedded --experimental=collections/default.experimental
perl mysql-test-run.pl --timer --force --parallel=auto --comment=rpl_binlog_row --vardir=var-rpl_binlog_row --suite=rpl,binlog --mysqld=--binlog-format=row --experimental=collections/default.experimental
perl mysql-test-run.pl --timer --force --parallel=auto --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1 --experimental=collections/default.experimental

View file

@ -0,0 +1,4 @@
perl mysql-test-run.pl --timer --force --parallel=auto --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --experimental=collections/default.experimental --skip-ndb
perl mysql-test-run.pl --timer --force --parallel=auto --comment=ps_row --vardir=var-ps_row --suite=main --ps-protocol --mysqld=--binlog-format=row --experimental=collections/default.experimental --skip-ndb
perl mysql-test-run.pl --timer --force --parallel=auto --comment=embedded --vardir=var-emebbed --suite=main --embedded --experimental=collections/default.experimental --skip-ndb
perl mysql-test-run.pl --timer --force --parallel=auto --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1 --experimental=collections/default.experimental --skip-ndb

View file

@ -302,5 +302,58 @@ BINLOG '
SHOW BINLOG EVENTS;
DROP TABLE t1;
--echo
--echo # BUG#54903 BINLOG statement toggles session variables
--echo # ----------------------------------------------------------------------
--echo # This test verify that BINLOG statement doesn't change current session's
--echo # variables foreign_key_checks and unique_checks.
--echo
CREATE TABLE t1 (c1 INT KEY);
SET @@SESSION.foreign_key_checks= ON;
SET @@SESSION.unique_checks= ON;
--echo # INSERT INTO t1 VALUES (1)
--echo # foreign_key_checks=0 and unique_checks=0
BINLOG '
dfLtTBMBAAAAKQAAANcAAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE=
dfLtTBcBAAAAIgAAAPkAAAAAABcAAAAAAAcAAf/+AQAAAA==
';
SELECT * FROM t1;
--echo # Their values should be ON
SHOW SESSION VARIABLES LIKE "%_checks";
--echo
SET @@SESSION.foreign_key_checks= OFF;
SET @@SESSION.unique_checks= OFF;
--echo # INSERT INTO t1 VALUES(2)
--echo # foreign_key_checks=1 and unique_checks=1
BINLOG '
dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE=
dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA==
';
SELECT * FROM t1;
--echo # Their values should be OFF
SHOW SESSION VARIABLES LIKE "%_checks";
--echo # INSERT INTO t1 VALUES(2)
--echo # foreign_key_checks=1 and unique_checks=1
--echo # It should not change current session's variables, even error happens
--error 1062
BINLOG '
dfLtTBMBAAAAKQAAAKsBAAAAABcAAAAAAAEABHRlc3QAAnQxAAEDAAE=
dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA==
';
SELECT * FROM t1;
--echo # Their values should be OFF
SHOW SESSION VARIABLES LIKE "%_checks";
DROP TABLE t1;
disconnect fresh;

View file

@ -60,6 +60,7 @@
# Please, remove this test case after pushing WL#2687.
################################################################################
RESET MASTER;
--echo ###################################################################################
--echo # CONFIGURATION

View file

@ -9,10 +9,6 @@
# check if START SLAVE, RESET SLAVE, CHANGE MASTER reset Last_slave_error and
# Last_slave_errno in SHOW SLAVE STATUS (1st and 3rd commands did not: bug 986).
####################################
# Change Author: JBM
# Change Date: 2006-01-11
# Change: Split test per lars review
####################################
#"REQUIREMENT: A master DROP TABLE on a table with non-existing MYI
# file must be correctly replicated to the slave"
####################################
@ -23,8 +19,5 @@ flush tables;
let $MYSQLD_DATADIR= `select @@datadir`;
remove_file $MYSQLD_DATADIR/test/t1.MYI ;
drop table if exists t1;
save_master_pos;
connection slave;
sync_with_master;
# End of 4.1 tests
--source include/rpl_end.inc

View file

@ -1,14 +1,6 @@
#
# Test of auto_increment with offset
#
#####################################
# By: JBM
# Date: 2006-02-10
# Change: NDB does not support auto inc
# in this usage. Currently there is no
# plan to implment. Skipping test when
# NDB is default engine.
#####################################
-- source include/not_ndb_default.inc
-- source include/master-slave.inc
@ -169,7 +161,7 @@ drop table t1;
# auto_increment fields if the values of them are 0. There is an inconsistency
# between slave and master. When MODE_NO_AUTO_VALUE_ON_ZERO are masters treat
#
source include/master-slave-reset.inc;
source include/rpl_reset.inc;
connection master;
--disable_warnings
@ -210,12 +202,10 @@ INSERT INTO t2 VALUES(4);
FLUSH LOGS;
sync_slave_with_master;
let $diff_table_1= master:test.t1;
let $diff_table_2= slave:test.t1;
let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
let $diff_table_1= master:test.t2;
let $diff_table_2= slave:test.t2;
let $diff_tables= master:t2, slave:t2;
source include/diff_tables.inc;
connection master;
@ -228,15 +218,14 @@ let $MYSQLD_DATADIR= `SELECT @@DATADIR`;
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 | $MYSQL test
sync_slave_with_master;
let $diff_table_1= master:test.t1;
let $diff_table_2= slave:test.t1;
let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
let $diff_table_1= master:test.t2;
let $diff_table_2= slave:test.t2;
let $diff_tables= master:t2, slave:t2;
source include/diff_tables.inc;
# End cleanup
--connection master
DROP TABLE t1;
DROP TABLE t2;
SET SQL_MODE='';
@ -297,4 +286,29 @@ DROP TABLE t1;
DROP TABLE t_ignored1;
DROP TABLE t_ignored2;
#
# BUG#56662
# The test verifies if the assertion of "next_insert_id == 0"
# will fail in ha_external_lock() function.
#
connection master;
CREATE TABLE t1 (id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, data INT) ENGINE=innodb;
BEGIN;
--echo # Set sql_mode with NO_AUTO_VALUE_ON_ZERO for allowing
--echo # zero to fill the auto_increment field.
SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
INSERT INTO t1(id,data) VALUES(0,2);
--echo # Resetting sql_mode without NO_AUTO_VALUE_ON_ZERO to
--echo # affect the execution of the transaction on slave.
SET SQL_MODE=0;
COMMIT;
SELECT * FROM t1;
sync_slave_with_master;
SELECT * FROM t1;
connection master;
DROP TABLE t1;
sync_slave_with_master;
--source include/rpl_end.inc

View file

@ -29,8 +29,7 @@ commit;
sync_slave_with_master;
--echo #Test if the results are consistent on master and slave
--echo #for 'INSERT DATA INTO VIEW WHICH INVOKES TRIGGERS'
let $diff_table_1=master:test.t3;
let $diff_table_2=slave:test.t3;
let $diff_tables= master:t3, slave:t3;
source include/diff_tables.inc;
connection master;

View file

@ -60,14 +60,11 @@ connection master;
sync_slave_with_master;
--echo #Test if the results are consistent on master and slave
--echo #for 'INVOKES A TRIGGER with $trigger_action action'
let $diff_table_1=master:test.t2;
let $diff_table_2=slave:test.t2;
let $diff_tables= master:t2, slave:t2;
source include/diff_tables.inc;
let $diff_table_1=master:test.t4;
let $diff_table_2=slave:test.t4;
let $diff_tables= master:t4, slave:t4;
source include/diff_tables.inc;
let $diff_table_1=master:test.t6;
let $diff_table_2=slave:test.t6;
let $diff_tables= master:t6, slave:t6;
source include/diff_tables.inc;
connection master;

View file

@ -41,11 +41,9 @@ connection master;
sync_slave_with_master;
--echo #Test if the results are consistent on master and slave
--echo #for 'CALLS A FUNCTION which INVOKES A TRIGGER with $insert_action action'
let $diff_table_1=master:test.t2;
let $diff_table_2=slave:test.t2;
let $diff_tables= master:t2, slave:t2;
source include/diff_tables.inc;
let $diff_table_1=master:test.t3;
let $diff_table_2=slave:test.t3;
let $diff_tables= master:t3, slave:t3;
source include/diff_tables.inc;
connection master;

View file

@ -2,11 +2,7 @@
# This test will fail if the server/client does not support enough charsets.
source include/master-slave.inc;
--disable_warnings
set timestamp=1000000000;
drop database if exists mysqltest2;
drop database if exists mysqltest3;
--enable_warnings
create database mysqltest2 character set latin2;
set @@character_set_server=latin5;
@ -151,6 +147,6 @@ eval create table `t1` (
set @p=_latin1 'test';
update t1 set pk='test' where pk=@p;
drop table t1;
sync_slave_with_master;
# End of 4.1 tests
--source include/rpl_end.inc

View file

@ -1,16 +1,10 @@
#################################
# Test updated to use a wrapper #
#################################
eval CREATE TABLE t1 (a INT) ENGINE=$engine_type;
begin;
insert into t1 values(1);
flush tables with read lock;
commit;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
# cleanup
connection master;
unlock tables;

View file

@ -139,8 +139,13 @@ if (`SELECT @@global.binlog_format = 'ROW' AND @@global.slave_exec_mode = 'STRIC
--echo ---- Wait until slave stops with an error ----
let $slave_sql_errno= 1032; # ER_KEY_NOT_FOUND
source include/wait_for_slave_sql_error.inc;
let $err= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
--echo Last_SQL_Error = $err (expected "can't find record" error)
--let $err= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1)
--replace_regex /end_log_pos [0-9]+/end_log_pos END_LOG_POS/
--disable_query_log
--eval SELECT "$err" as 'Last_SQL_Error (expected "duplicate key" error)'
--enable_query_log
SELECT * FROM t1;
--echo ---- Resolve the conflict on the slave and restart SQL thread ----
@ -165,4 +170,4 @@ connection master;
DROP TABLE t1;
--echo [on slave]
sync_slave_with_master;
--sync_slave_with_master

View file

@ -136,14 +136,6 @@ sync_slave_with_master;
connection master;
SET AUTOCOMMIT = 1;
#
# 1. DROP all objects, which probably already exist, but must be created here
#
--disable_warnings
DROP DATABASE IF EXISTS mysqltest1;
DROP DATABASE IF EXISTS mysqltest2;
DROP DATABASE IF EXISTS mysqltest3;
--enable_warnings
#
# 2. CREATE all objects needed
# working database is mysqltest1
# working table (transactional!) is mysqltest1.t1
@ -619,6 +611,3 @@ connection master;
DROP DATABASE mysqltest1;
# mysqltest2 was alreday DROPPED some tests before.
DROP DATABASE mysqltest3;
--enable_warnings
-- source include/master-slave-end.inc

View file

@ -131,3 +131,4 @@ sync_slave_with_master;
SET global max_relay_log_size= @my_max_relay_log_size;
--echo End of 5.1 tests
--source include/rpl_end.inc

View file

@ -1,24 +1,7 @@
#############################################################
# Author: Chuck
#############################################################
# Purpose: To test having extra columns on the master WL#3915
# engine inspecific sourced part
#############################################################
# Change Author: Jeb
# Change: Cleanup and extend testing
#############################################################
# TODO: partition specific
# -- source include/have_partition.inc
# Note: Will be done in different test due to NDB using this
# test case.
############################################################
########### Clean up ################
--disable_warnings
--disable_query_log
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t10,t11,t12,t13,t14,t15,t16,t17,t18,t31;
--enable_query_log
--enable_warnings
#
# Setup differently defined tables on master and slave
@ -1025,8 +1008,3 @@ SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1;
connection master;
DROP TABLE t5;
sync_slave_with_master;
--echo
# END of 5.1 tests case

View file

@ -1,19 +1,10 @@
#################################################
# Author: Jeb
# Date: 2006-09-07
# Purpose: To test having extra columns on the slave.
##################################################
# Some tests in here requre partitioning
-- source include/have_partition.inc
########### Clean up ################
--disable_warnings
--disable_query_log
DROP TABLE IF EXISTS t1, t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t14a,t15,t16,t17;
--enable_query_log
--enable_warnings
#################################################
############ Different Table Def Test ###########
#################################################
@ -448,9 +439,9 @@ if (`SELECT $engine_type != 'NDB'`)
}
#--echo *** Drop t9 ***
#connection master;
#DROP TABLE t9;
#sync_slave_with_master;
connection master;
DROP TABLE t9;
sync_slave_with_master;
############################################
# More columns in slave at middle of table #
@ -725,6 +716,10 @@ sync_slave_with_master;
--replace_column 5 CURRENT_TIMESTAMP
SELECT * FROM t14a ORDER BY c1;
--connection master
DROP TABLE t14a;
--sync_slave_with_master
####################################################
# - Alter Master Dropping columns from the middle. #
# Expect: columns dropped #
@ -912,17 +907,3 @@ connection slave;
connection master;
DROP TABLE t17;
sync_slave_with_master;
#### Clean Up ####
--disable_warnings
--disable_query_log
connection master;
DROP TABLE IF EXISTS t1, t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t14a,t15,t16,t17;
sync_slave_with_master;
connection master;
--enable_query_log
--enable_warnings
# END 5.1 Test Case

View file

@ -22,4 +22,5 @@ connection master;
select * from t1;
commit;
drop table t1;
-- sync_slave_with_master
--source include/rpl_end.inc

View file

@ -54,7 +54,6 @@ unlock tables;
connection master;
drop table t3, t4, t5;
sync_slave_with_master;
# End of 4.1 tests
--source include/rpl_end.inc

View file

@ -60,6 +60,4 @@ select count(*) from t1 /* must be zero */;
connection master;
drop table t2,t1;
sync_slave_with_master;
--source include/rpl_end.inc

View file

@ -40,28 +40,16 @@ if (!$debug_sync_action)
}
# Restart slave
--disable_warnings
stop slave;
source include/wait_for_slave_to_stop.inc;
--source include/stop_slave.inc
eval SET @@global.debug= "+d,$dbug_sync_point";
start slave;
source include/wait_for_slave_to_start.inc;
--source include/start_slave.inc
--echo slave is going to hang in get_master_version_and_clock
connection master;
# Write file to make mysql-test-run.pl expect the "crash", but don't start
# it until it's told to
--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
wait
EOF
--let $rpl_server_number= 1
--source include/rpl_stop_server.inc
# Send shutdown to the connected server and give
# it 10 seconds to die before zapping it
shutdown_server 10;
connection slave;
--echo slave is unblocked
eval SET DEBUG_SYNC=$debug_sync_action;
@ -76,6 +64,7 @@ connection slave;
# '1040' ER_CON_COUNT_ERROR
# '1053' ER_SERVER_SHUTDOWN
let $slave_io_errno= 1040, 1053, 2002, 2003, 2006, 2013;
--let $slave_io_error_is_nonfatal= 1
source include/wait_for_slave_io_error.inc;
# deactivate the sync point of get_master_version_and_clock()
@ -84,21 +73,12 @@ source include/wait_for_slave_io_error.inc;
# unset.
eval set @@global.debug = "-d,$dbug_sync_point";
# Write file to make mysql-test-run.pl start up the server again
--append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
restart
EOF
connection master;
# Turn on reconnect
--enable_reconnect
# Call script that will poll the server waiting for it to be back online again
--source include/wait_until_connected_again.inc
# Turn off reconnect again
--disable_reconnect
connection slave;
source include/wait_for_slave_to_start.inc;
--let $rpl_server_number= 1
--source include/rpl_start_server.inc
# We don't source include/wait_for_slave_io_to_start.inc, because the
# IO thread has an error and wait_for_slave_io_to_start.inc fails if
# the IO thread has an error.
--let $slave_param= Slave_IO_Running
--let $slave_param_value= Yes
--source include/wait_for_slave_param.inc

View file

@ -1,6 +1,4 @@
###########################################################
# 2006-02-01: By JBM: Added 1022, ORDER BY
###########################################################
# See if queries that use both auto_increment and LAST_INSERT_ID()
# are replicated well
############################################################
@ -14,9 +12,6 @@
--echo #
use test;
--disable_warnings
drop table if exists t1, t2, t3;
--enable_warnings
--echo #
--echo # See if queries that use both auto_increment and LAST_INSERT_ID()
@ -42,9 +37,7 @@ eval create table t2(b int auto_increment, c int, key(b)) engine=$engine_type;
insert into t1 values (1),(2),(3);
insert into t1 values (null);
insert into t2 values (null,last_insert_id());
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
select * from t1 ORDER BY a;
select * from t2 ORDER BY b;
connection master;
@ -63,9 +56,7 @@ insert into t1 values (null),(null),(null);
insert into t2 values (5,0);
insert into t2 values (null,last_insert_id());
SET FOREIGN_KEY_CHECKS=1;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
select * from t1;
select * from t2;
connection master;
@ -83,17 +74,13 @@ insert into t1 values (null),(null),(null);
insert into t2 values (5,0);
insert into t2 (c) select * from t1 ORDER BY a;
select * from t2 ORDER BY b;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
select * from t1 ORDER BY a;
select * from t2 ORDER BY b;
connection master;
drop table t1;
drop table t2;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
--echo #
--echo # Bug#8412: Error codes reported in binary log for CHARACTER SET,
@ -208,9 +195,7 @@ call foo();
select * from t1;
select * from t2;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
select * from t1;
select * from t2;
connection master;
@ -548,4 +533,5 @@ connection master;
drop table t1, t2;
drop procedure foo;
SET @@global.concurrent_insert= @old_concurrent_insert;
sync_slave_with_master;
--source include/rpl_end.inc

View file

@ -1,6 +1,4 @@
###########################################################
# 2006-02-08: By JBM:
###########################################################
# See if queries that use both auto_increment and LAST_INSERT_ID()
# are replicated well
############################################################
@ -20,9 +18,7 @@ create table t2(b int auto_increment, c int, primary key(b));
insert into t1 values (1),(2),(3);
insert into t1 values (null);
insert into t2 values (null,last_insert_id());
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
select * from t1 ORDER BY a;
select * from t2 ORDER BY b;
connection master;
@ -41,9 +37,7 @@ insert into t1 values (null),(null),(null);
insert into t2 values (5,0);
insert into t2 values (null,last_insert_id());
SET FOREIGN_KEY_CHECKS=1;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
select * from t1;
select * from t2;
connection master;
@ -59,17 +53,13 @@ insert into t1 values (null),(null),(null);
insert into t2 values (5,0);
insert into t2 (c) select * from t1 ORDER BY a;
select * from t2 ORDER BY b;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
select * from t1 ORDER BY a;
select * from t2 ORDER BY b;
connection master;
drop table t1;
drop table t2;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
#
# Bug#8412: Error codes reported in binary log for CHARACTER SET,
@ -85,3 +75,5 @@ INSERT INTO t1 VALUES (1),(1);
drop table t1;
sync_slave_with_master;
# End of 4.1 tests
--source include/rpl_end.inc

View file

@ -1,6 +1,3 @@
# Requires statement logging
-- source include/have_binlog_format_statement.inc
# See if replication of a "LOAD DATA in an autoincrement column"
# Honours autoincrement values
# i.e. if the master and slave have the same sequence
@ -14,13 +11,10 @@
# check if START SLAVE, RESET SLAVE, CHANGE MASTER reset Last_slave_error and
# Last_slave_errno in SHOW SLAVE STATUS (1st and 3rd commands did not: bug 986)
-- source include/have_binlog_format_statement.inc
-- source include/master-slave.inc
source include/have_innodb.inc;
connection slave;
reset master;
connection master;
# MTR is not case-sensitive.
let $lower_stmt_head= load data;
let $UPPER_STMT_HEAD= LOAD DATA;
@ -45,9 +39,7 @@ eval $lower_stmt_head infile '../../std_data/rpl_loaddata2.dat' into table t2 fi
create table t3 (day date,id int(9),category enum('a','b','c'),name varchar(60));
insert into t3 select * from t2;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
select * from t1;
select * from t3;
@ -59,9 +51,7 @@ drop table t2;
drop table t3;
create table t1(a int, b int, unique(b));
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
# See if slave stops when there's a duplicate entry for key error in LOAD DATA
@ -72,21 +62,16 @@ eval $lower_stmt_head infile '../../std_data/rpl_loaddata.dat' into table t1;
save_master_pos;
connection slave;
# The SQL slave thread should be stopped now.
--source include/wait_for_slave_sql_to_stop.inc
# 1062 = ER_DUP_ENTRY
--let $slave_sql_errno= 1062
--source include/wait_for_slave_sql_error_and_skip.inc
# Skip the bad event and see if error is cleared in SHOW SLAVE STATUS by START
# SLAVE, even though we are not executing any event (as sql_slave_skip_counter
# takes us directly to the end of the relay log).
set global sql_slave_skip_counter=1;
start slave;
sync_with_master;
let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
echo Last_SQL_Errno=$last_error;
let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
echo Last_SQL_Error;
echo $last_error;
--source include/check_slave_no_error.inc
# Trigger error again to test CHANGE MASTER
@ -100,17 +85,15 @@ connection slave;
# The SQL slave thread should be stopped now.
# Exec_Master_Log_Pos should point to the start of Execute event
# for last load data.
--source include/wait_for_slave_sql_to_stop.inc
# 1062 = ER_DUP_ENTRY
--let $slave_sql_errno= 1062
--source include/wait_for_slave_sql_error.inc
# CHANGE MASTER and see if error is cleared in SHOW SLAVE STATUS.
stop slave;
--source include/stop_slave_io.inc
change master to master_user='test';
change master to master_user='root';
let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
echo Last_SQL_Errno=$last_error;
let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
echo Last_SQL_Error;
echo $last_error;
--source include/check_slave_no_error.inc
# Trigger error again to test RESET SLAVE
@ -125,16 +108,14 @@ eval $lower_stmt_head infile '../../std_data/rpl_loaddata.dat' into table t1;
save_master_pos;
connection slave;
# The SQL slave thread should be stopped now.
--source include/wait_for_slave_sql_to_stop.inc
# 1062 = ER_DUP_ENTRY
--let $slave_sql_errno= 1062
--source include/wait_for_slave_sql_error.inc
# RESET SLAVE and see if error is cleared in SHOW SLAVE STATUS.
stop slave;
reset slave;
let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
echo Last_SQL_Errno=$last_error;
let $last_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
echo Last_SQL_Error;
echo $last_error;
--source include/check_slave_no_error.inc
# Finally, see if logging is done ok on master for a failing LOAD DATA INFILE
@ -165,6 +146,7 @@ terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
connection slave;
--source include/wait_for_slave_sql_to_stop.inc
drop table t1, t2;
--source include/stop_slave_io.inc
connection master;
drop table t1, t2;
@ -178,7 +160,8 @@ DROP TABLE IF EXISTS t1;
# BUG#48297: Schema name is ignored when LOAD DATA is written into binlog,
# replication aborts
-- source include/master-slave-reset.inc
-- let $rpl_only_running_threads= 1
-- source include/rpl_reset.inc
-- let $db1= b48297_db1
-- let $db2= b42897_db2
@ -239,8 +222,7 @@ connect (conn2,localhost,root,,*NO-ONE*);
-- sync_slave_with_master
-- eval use $db1
let $diff_table_1=master:$db1.t1;
let $diff_table_2=slave:$db1.t1;
let $diff_tables= master:$db1.t1, slave:$db1.t1;
source include/diff_tables.inc;
-- connection master
@ -251,7 +233,7 @@ source include/diff_tables.inc;
-- sync_slave_with_master
# BUG#49479: LOAD DATA INFILE is binlogged without escaping field names
-- source include/master-slave-reset.inc
-- source include/rpl_reset.inc
-- connection master
use test;
CREATE TABLE t1 (`key` TEXT, `text` TEXT);
@ -262,6 +244,6 @@ SELECT * FROM t1;
-- sync_slave_with_master
-- connection master
DROP TABLE t1;
-- sync_slave_with_master
# End of 4.1 tests
--source include/rpl_end.inc

View file

@ -125,7 +125,7 @@ DROP TABLE t3;
# Reset binlog so that show binlog events will not show the tests
# above.
source include/master-slave-reset.inc;
source include/rpl_reset.inc;
connection master;
create table t1(a int auto_increment primary key, b int);

View file

@ -6,9 +6,6 @@
# Requires statement logging
-- source include/master-slave.inc
# We have to sync with master, to ensure slave had time to start properly
# before we stop it. If not, we get errors about UNIX_TIMESTAMP() in the log.
sync_slave_with_master;
connection slave;
stop slave;
connection master;
@ -117,3 +114,4 @@ set global max_binlog_size= @my_max_binlog_size;
--echo #
--echo # End of 4.1 tests
--echo #
--source include/rpl_end.inc

View file

@ -7,9 +7,6 @@
# PS doesn't support multi-statements
--disable_ps_protocol
-- source include/master-slave.inc
--disable_warnings
drop database if exists mysqltest;
--enable_warnings
create database mysqltest;
delimiter /;
@ -25,4 +22,5 @@ select * from mysqltest.t1;
connection master;
source include/show_binlog_events.inc;
drop database mysqltest;
sync_slave_with_master;
--source include/rpl_end.inc

View file

@ -19,12 +19,11 @@ SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a;
UPDATE t1, t2 SET t1.b = t2.b WHERE t1.a = t2.a;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
# End of 4.1 tests
connection master;
drop table t1, t2;
sync_slave_with_master;
--source include/rpl_end.inc

View file

@ -226,7 +226,7 @@ connection master;
# Reset both slave and master
# This should reset binlog to #1
--source include/master-slave-reset.inc
--source include/rpl_reset.inc
--echo

View file

@ -71,12 +71,10 @@ INSERT INTO t4(a) VALUES (5);
sync_slave_with_master;
--echo TABLES t1 and t2 must be equal otherwise an error will be thrown.
let $diff_table_1=master:test.t1;
let $diff_table_2=slave:test.t1;
let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
let $diff_table_1=master:test.t2;
let $diff_table_2=slave:test.t2;
let $diff_tables= master:t2, slave:t2;
source include/diff_tables.inc;
--echo TABLES t2 and t3 must be different.
@ -101,8 +99,7 @@ REPLACE INTO t1(a,b,c) VALUES (2, NULL, 300);
sync_slave_with_master;
--echo TABLES t1 and t2 must be equal otherwise an error will be thrown.
let $diff_table_1=master:test.t1;
let $diff_table_2=slave:test.t1;
let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
--echo ************* CLEANING *************
@ -154,8 +151,7 @@ REPLACE INTO t1(a,b,c) VALUES (2, NULL, b'00');
--echo ************* SHOWING THE RESULT SETS WITH UPDATES and REPLACES *************
--echo TABLES t1 and t2 must be equal otherwise an error will be thrown.
sync_slave_with_master;
let $diff_table_1=master:test.t1;
let $diff_table_2=slave:test.t1;
let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
connection master;
@ -273,7 +269,7 @@ sync_slave_with_master;
# SELECT * FROM t3 ORDER BY a;
# connection slave;
# SELECT * FROM t3 ORDER BY a;
# --source include/reset_master_and_slave.inc
# --source include/rpl_reset.inc
#
# connection master;
#

View file

@ -4,7 +4,7 @@
#
-- echo ## case #1 - last_null_bit_pos==0 in record_compare without X bit
-- source include/master-slave-reset.inc
-- source include/rpl_reset.inc
-- connection master
-- eval CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 varchar(1) DEFAULT '', c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0, c8 bigint(20) DEFAULT 0) ENGINE=$engine DEFAULT CHARSET=latin1
@ -16,8 +16,7 @@ UPDATE t1 SET c5 = 'a';
-- enable_warnings
-- sync_slave_with_master
-- let $diff_table_1= master:test.t1
-- let $diff_table_2= slave:test.t1
-- let $diff_tables= master:t1, slave:t1
-- source include/diff_tables.inc
--connection master
@ -26,7 +25,7 @@ DROP TABLE t1;
-- echo ## case #1.1 - last_null_bit_pos==0 in record_compare with X bit
-- echo ## (1 column less and no varchar)
-- source include/master-slave-reset.inc
-- source include/rpl_reset.inc
-- connection master
-- eval CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 bigint(20) DEFAULT 0, c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0) ENGINE=$engine DEFAULT CHARSET=latin1
@ -38,8 +37,7 @@ UPDATE t1 SET c5 = 'a';
-- enable_warnings
-- sync_slave_with_master
-- let $diff_table_1= master:test.t1
-- let $diff_table_2= slave:test.t1
-- let $diff_tables= master:t1, slave:t1
-- source include/diff_tables.inc
--connection master
@ -48,7 +46,7 @@ DROP TABLE t1;
-- echo ## case #2 - X bit is wrongly set.
-- source include/master-slave-reset.inc
-- source include/rpl_reset.inc
-- connection master
-- eval CREATE TABLE t1 (c1 int, c2 varchar(1) default '') ENGINE=$engine DEFAULT CHARSET= latin1
@ -57,8 +55,7 @@ INSERT INTO t1(c1) VALUES (NULL);
UPDATE t1 SET c1= 0;
-- sync_slave_with_master
-- let $diff_table_1= master:test.t1
-- let $diff_table_2= slave:test.t1
-- let $diff_tables= master:t1, slave:t1
-- source include/diff_tables.inc
-- connection master

View file

@ -54,9 +54,9 @@ source include/check_slave_no_error.inc;
change master to master_user='impossible_user_name';
start slave;
let $slave_io_errno= 1045;
source include/wait_for_slave_io_error.inc;
--source include/wait_for_slave_io_error.inc
--source include/stop_slave_sql.inc
source include/stop_slave.inc;
change master to master_user='root';
source include/start_slave.inc;
source include/check_slave_no_error.inc;
@ -69,8 +69,11 @@ source include/stop_slave.inc;
change master to master_user='impossible_user_name';
start slave;
let $slave_io_errno= 1045;
source include/wait_for_slave_io_error.inc;
--source include/wait_for_slave_io_error.inc
--source include/stop_slave_sql.inc
source include/stop_slave.inc;
reset slave;
source include/check_slave_no_error.inc;
--let $rpl_only_running_threads= 1
--source include/rpl_end.inc

View file

@ -75,5 +75,3 @@ diff_files $MYSQLTEST_VARDIR/tmp/rpl_row_UUID_master.sql $MYSQLTEST_VARDIR/tmp/r
# this cleanup as no other test will use these files and they'll
# be removed at next testsuite run.
# End of 5.0 test case
-- source include/master-slave-end.inc

View file

@ -153,3 +153,4 @@ DROP DATABASE test1;
sync_slave_with_master;
--enable_query_log
--source include/rpl_end.inc

View file

@ -2,6 +2,13 @@
# Basic tests of row-level logging
#
--disable_query_log
--disable_result_log
# Add suppression for expected warning(s) in error log
call mtr.add_suppression("Can't find record in 't.'");
--enable_query_log
--enable_result_log
#
# First we test tables with only an index.
#
@ -241,7 +248,7 @@ DELETE FROM t1;
sync_slave_with_master;
# Just to get a clean binary log
source include/reset_master_and_slave.inc;
--source include/rpl_reset.inc
--echo **** On Master ****
connection master;
@ -353,8 +360,7 @@ INSERT INTO t1 VALUES (1, "", 1);
INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2);
sync_slave_with_master;
let $diff_table_1=master:test.t1;
let $diff_table_2=slave:test.t1;
let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
--echo [expecting slave to replicate correctly]
@ -363,8 +369,7 @@ INSERT INTO t2 VALUES (1, "", 1);
INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2);
sync_slave_with_master;
let $diff_table_1=master:test.t2;
let $diff_table_2=slave:test.t2;
let $diff_tables= master:t2, slave:t2;
source include/diff_tables.inc;
--echo [expecting slave to stop]
@ -374,16 +379,12 @@ INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2);
connection slave;
# 1535 = ER_BINLOG_ROW_WRONG_TABLE_DEF
--let $slave_sql_errno= 1535
--let $slave_sql_errno= 1535
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error.inc
connection master;
RESET MASTER;
connection slave;
STOP SLAVE;
RESET SLAVE;
START SLAVE;
source include/wait_for_slave_to_start.inc;
--let $rpl_only_running_threads= 1
--source include/rpl_reset.inc
--echo [expecting slave to replicate correctly]
connection master;
@ -391,8 +392,7 @@ INSERT INTO t4 VALUES (1, "", 1);
INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2);
sync_slave_with_master;
let $diff_table_1=master:test.t4;
let $diff_table_2=slave:test.t4;
let $diff_tables= master:t4, slave:t4;
source include/diff_tables.inc;
--echo [expecting slave to stop]
@ -402,16 +402,11 @@ INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2);
connection slave;
# 1535 = ER_BINLOG_ROW_WRONG_TABLE_DEF
--let $slave_sql_errno= 1535
--let $slave_sql_errno= 1535
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error.inc
connection master;
RESET MASTER;
connection slave;
STOP SLAVE;
RESET SLAVE;
START SLAVE;
source include/wait_for_slave_to_start.inc;
--source include/rpl_reset.inc
--echo [expecting slave to stop]
connection master;
@ -420,16 +415,11 @@ INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2);
connection slave;
# 1535 = ER_BINLOG_ROW_WRONG_TABLE_DEF
--let $slave_sql_errno= 1535
--let $slave_sql_errno= 1535
--let $show_slave_sql_error= 1
--source include/wait_for_slave_sql_error.inc
connection master;
RESET MASTER;
connection slave;
STOP SLAVE;
RESET SLAVE;
START SLAVE;
source include/wait_for_slave_to_start.inc;
--source include/rpl_reset.inc
--echo [expecting slave to replicate correctly]
connection master;
@ -437,8 +427,7 @@ INSERT INTO t7 VALUES (1, "", 1);
INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2);
sync_slave_with_master;
let $diff_table_1=master:test.t7;
let $diff_table_2=slave:test.t7;
let $diff_tables= master:t7, slave:t7;
source include/diff_tables.inc;
connection master;
@ -458,8 +447,7 @@ UPDATE t1 SET a = 10;
INSERT INTO t1 VALUES (4);
sync_slave_with_master;
let $diff_table_1=master:test.t1;
let $diff_table_2=slave:test.t1;
let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
connection master;
@ -537,8 +525,7 @@ UPDATE t1 SET `int_key` = 4 ORDER BY `pk` LIMIT 6;
--sync_slave_with_master
--echo *** results: t2 must be consistent ****
let $diff_table_1=master:test.t2;
let $diff_table_2=master:test.t2;
let $diff_tables= master:t2, slave:t2;
source include/diff_tables.inc;
--connection master
@ -576,8 +563,7 @@ UPDATE t1 SET a = 8 WHERE a < 5;
sync_slave_with_master;
let $diff_table_1=master:test.t1;
let $diff_table_2=slave:test.t1;
let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
connection master;
@ -639,8 +625,7 @@ UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 3;
sync_slave_with_master;
let $diff_table_1=master:test.t1;
let $diff_table_2=slave:test.t1;
let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
connection master;

View file

@ -14,9 +14,8 @@ flush tables;
SELECT * FROM t1 ORDER BY a;
sync_slave_with_master;
connection master;
sync_slave_with_master;
SELECT * FROM t1 ORDER BY a;
connection master;
drop table t1;
sync_slave_with_master;
--source include/rpl_end.inc

View file

@ -1,9 +1,6 @@
#############################################################################
# This test is being created to test out the non deterministic items with #
# row based replication. #
# Original Author: JBM #
# Original Date: Aug/09/2005 #
# Updated: Aug/29/2005 #
#############################################################################
# Test: Contains two stored procedures test one that insert data into tables#
# and use the LAST_INSERTED_ID() on tables with FOREIGN KEY(a) #
@ -13,9 +10,6 @@
# the table depending on the CASE outcome. The test uses this SP in a#
# transaction first rolling back and then commiting, #
#############################################################################
# Mod Date: 08/22/2005 #
# TEST: Added test to include UPDATE CASCADE on table with FK per Trudy #
#############################################################################
@ -24,18 +18,6 @@
-- source include/master-slave.inc
# Begin clean up test section
connection master;
--disable_warnings
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP PROCEDURE IF EXISTS test.p3;
DROP TABLE IF EXISTS test.t3;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
--enable_warnings
# End of cleanup
# Begin test section 1
eval CREATE TABLE test.t1 (a INT AUTO_INCREMENT KEY, t CHAR(6)) ENGINE=$engine_type;
@ -71,9 +53,7 @@ SELECT * FROM test.t2;
let $message=< -- test 1 select slave after p1 -- >;
--source include/show_msg.inc
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
SELECT * FROM test.t1;
SELECT * FROM test.t2;
@ -86,9 +66,7 @@ SELECT * FROM test.t2;
let $message=< -- test 1 select slave after p2 -- >;
--source include/show_msg.inc
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
SELECT * FROM test.t1;
SELECT * FROM test.t2;
@ -136,9 +114,7 @@ SELECT * FROM test.t2;
let $message=< -- test 2 select Slave after p1 -- >;
--source include/show_msg.inc
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
SELECT * FROM test.t1;
SELECT * FROM test.t2;
@ -153,9 +129,7 @@ SELECT * FROM test.t2;
let $message=< -- test 1 select Slave after p2 -- >;
--source include/show_msg.inc
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
SELECT * FROM test.t1;
SELECT * FROM test.t2;
@ -195,9 +169,7 @@ while ($n)
ROLLBACK;
select * from test.t3;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
select * from test.t3;
connection master;
@ -216,9 +188,7 @@ while ($n)
COMMIT;
select * from test.t3;
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
select * from test.t3;
connection master;
@ -228,12 +198,12 @@ connection master;
# First lets cleanup
SET AUTOCOMMIT=1;
SET FOREIGN_KEY_CHECKS=0;
DROP PROCEDURE IF EXISTS test.p3;
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
DROP TABLE IF EXISTS test.t3;
sync_slave_with_master;
DROP PROCEDURE test.p3;
DROP PROCEDURE test.p1;
DROP PROCEDURE test.p2;
DROP TABLE test.t1;
DROP TABLE test.t2;
DROP TABLE test.t3;
# End of 5.0 test case
--source include/rpl_end.inc

View file

@ -1,8 +1,4 @@
#############################################################################
# Original Author: JBM #
# Original Date: Aug/15/2005 #
# Updated: 08/29/2005 Remove sleeps #
#############################################################################
# TEST: SP that creates table, starts tranaction inserts. Save point, insert#
# rollback to save point and then commits. #
#############################################################################
@ -10,14 +6,6 @@
-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
# Begin clean up test section
connection master;
--disable_warnings
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1;
--enable_warnings
# End of cleanup
# Begin test section 1
delimiter |;
eval CREATE PROCEDURE test.p1(IN i INT)
@ -42,9 +30,7 @@ SELECT * FROM test.t1;
let $message=< ---- Slave selects-- >;
--source include/show_msg.inc
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
SELECT * FROM test.t1;
let $message=< ---- Master selects-- >;
@ -55,16 +41,15 @@ SELECT * FROM test.t1;
let $message=< ---- Slave selects-- >;
--source include/show_msg.inc
save_master_pos;
connection slave;
sync_with_master;
sync_slave_with_master;
SELECT * FROM test.t1;
connection master;
#show binlog events;
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1;
DROP PROCEDURE test.p1;
DROP TABLE test.t1;
# End of 5.0 test case
--source include/rpl_end.inc

View file

@ -29,7 +29,7 @@
# BUG#49481: RBR: MyISAM and bit fields may cause slave to stop on
# delete cant find record
-- source include/master-slave-reset.inc
-- source include/rpl_reset.inc
-- connection master
-- eval CREATE TABLE t1 (c1 BIT, c2 INT) Engine=$engine
@ -37,8 +37,7 @@ INSERT INTO `t1` VALUES ( 1, 1 );
UPDATE t1 SET c1=NULL where c2=1;
-- sync_slave_with_master
-- let $diff_table_1=master:test.t1
-- let $diff_table_2=slave:test.t1
-- let $diff_tables= master:t1, slave:t1
-- source include/diff_tables.inc
-- connection master
@ -46,15 +45,14 @@ UPDATE t1 SET c1=NULL where c2=1;
DELETE FROM t1 WHERE c2=1 LIMIT 1;
-- sync_slave_with_master
-- let $diff_table_1=master:test.t1
-- let $diff_table_2=slave:test.t1
-- let $diff_tables= master:t1, slave:t1
-- source include/diff_tables.inc
-- connection master
DROP TABLE t1;
-- sync_slave_with_master
-- source include/master-slave-reset.inc
-- source include/rpl_reset.inc
-- connection master
@ -68,8 +66,7 @@ SELECT * FROM t1;
UPDATE t1 SET c1=NULL WHERE c1='w';
-- sync_slave_with_master
-- let $diff_table_1=master:test.t1
-- let $diff_table_2=slave:test.t1
-- let $diff_tables= master:t1, slave:t1
-- source include/diff_tables.inc
-- connection master
@ -77,8 +74,7 @@ UPDATE t1 SET c1=NULL WHERE c1='w';
DELETE FROM t1 LIMIT 2;
-- sync_slave_with_master
-- let $diff_table_1=master:test.t1
-- let $diff_table_2=slave:test.t1
-- let $diff_tables= master:t1, slave:t1
-- source include/diff_tables.inc
-- connection master

View file

@ -1,131 +0,0 @@
# Requires binlog_format=statement format since query involving
# get_lock() is logged in row format if binlog_format=mixed or row.
-- source include/have_binlog_format_statement.inc
-- source include/master-slave.inc
CALL mtr.add_suppression("Statement may not be safe to log in statement format.");
# Load some data into t1
create table t1 (word char(20) not null);
load data infile '../../std_data/words.dat' into table t1;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data local infile '$MYSQL_TEST_DIR/std_data/words.dat' into table t1;
select * from t1 limit 10;
#
# Test slave with wrong password
#
sync_slave_with_master;
stop slave;
connection master;
set password for root@"localhost" = password('foo');
connection slave;
start slave;
connection master;
#
# Give slave time to do at last one failed connect retry
# This one must be short so that the slave will not stop retrying
real_sleep 2;
set password for root@"localhost" = password('');
# Give slave time to connect (will retry every second)
sleep 2;
create table t3(n int);
insert into t3 values(1),(2);
sync_slave_with_master;
select * from t3;
select sum(length(word)) from t1;
connection master;
drop table t1,t3;
sync_slave_with_master;
# Test if the slave SQL thread can be more than 16K behind the slave
# I/O thread (> IO_SIZE)
connection master;
# we'll use table-level locking to delay slave SQL thread
eval create table t1 (n int) engine=$engine_type;
sync_slave_with_master;
connection master;
reset master;
connection slave;
stop slave;
reset slave;
connection master;
let $1=5000;
# Generate 16K of relay log
disable_query_log;
while ($1)
{
eval insert into t1 values($1);
dec $1;
}
enable_query_log;
# Try to cause a large relay log lag on the slave by locking t1
connection slave;
lock tables t1 read;
start slave;
#hope this is long enough for I/O thread to fetch over 16K relay log data
sleep 3;
unlock tables;
#test handling of aborted connection in the middle of update
connection master;
create table t2(id int);
insert into t2 values(connection_id());
connection master1;
# Avoid generating result
create temporary table t3(n int);
--disable_warnings
insert into t3 select get_lock('crash_lock%20C', 1) from t2;
--enable_warnings
connection master;
send update t1 set n = n + get_lock('crash_lock%20C', 2);
connection master1;
sleep 3;
select (@id := id) - id from t2;
kill @id;
# We don't drop t3 as this is a temporary table
drop table t2;
connection master;
# The get_lock function causes warning for unsafe statement.
--disable_warnings
--error 1317,2013
reap;
--enable_warnings
connection slave;
# The SQL slave thread should now have stopped because the query was killed on
# the master (so it has a non-zero error code in the binlog).
--source include/wait_for_slave_sql_to_stop.inc
# The following test can't be done because the result of Pos will differ
# on different computers
# --replace_result $MASTER_MYPORT MASTER_PORT
# show slave status;
set global sql_slave_skip_counter=1;
start slave;
select count(*) from t1;
connection master1;
drop table t1;
create table t1 (n int);
insert into t1 values(3456);
insert into mysql.user (Host, User, Password)
VALUES ("10.10.10.%", "blafasel2", password("blafasel2"));
select select_priv,user from mysql.user where user = _binary'blafasel2';
update mysql.user set Select_priv = "Y" where User= _binary"blafasel2";
select select_priv,user from mysql.user where user = _binary'blafasel2';
sync_slave_with_master;
select n from t1;
select select_priv,user from mysql.user where user = _binary'blafasel2';
connection master1;
drop table t1;
delete from mysql.user where user="blafasel2";
sync_slave_with_master;
# End of 4.1 tests

View file

@ -30,6 +30,11 @@ let $errno= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
--echo Error: "$error" (expected different error codes on master and slave)
--echo Errno: "$errno" (expected 0)
drop table t1;
--source include/stop_slave.inc
# Clear error messages.
RESET SLAVE;
# End of 4.1 tests
--let $rpl_only_running_threads= 1
--source include/rpl_end.inc

View file

@ -19,10 +19,13 @@ eval CREATE $_temporary TABLE IF NOT EXISTS t1 (c1 INT , c2 INT, c3 char(10), c4
SELECT 'abc' AS c3, 1 AS c4;
source include/show_binlog_events.inc;
--sync_slave_with_master
--connection master
if (!$is_temporary)
{
let $diff_table= test.t1;
source include/rpl_diff_tables.inc;
--let $diff_tables= master:t1,slave:t1
--source include/diff_tables.inc
}
--echo
@ -36,10 +39,13 @@ eval CREATE $_temporary TABLE IF NOT EXISTS t1
SELECT 'abc', 2;
source include/show_binlog_events.inc;
--sync_slave_with_master
--connection master
if (!$is_temporary)
{
let $diff_table= test.t1;
source include/rpl_diff_tables.inc;
--let $diff_tables= master:t1,slave:t1
--source include/diff_tables.inc
}
--echo
@ -57,10 +63,13 @@ eval CREATE $_temporary TABLE IF NOT EXISTS test.t1
SELECT 'abc', 20;
source include/show_binlog_events.inc;
--sync_slave_with_master
--connection master
if (!$is_temporary)
{
let $diff_table= test.t1;
source include/rpl_diff_tables.inc;
--let $diff_tables= master:test.t1,slave:test.t1
--source include/diff_tables.inc
}
USE test;
DROP DATABASE db1;
@ -74,10 +83,13 @@ eval CREATE $_temporary TABLE IF NOT EXISTS t1
REPLACE SELECT '123', 2;
source include/show_binlog_events.inc;
--sync_slave_with_master
--connection master
if (!$is_temporary)
{
let $diff_table= test.t1;
source include/rpl_diff_tables.inc;
--let $diff_tables= master:t1,slave:t1
--source include/diff_tables.inc
}
--echo
@ -89,10 +101,13 @@ eval CREATE $_temporary TABLE IF NOT EXISTS t1
IGNORE SELECT '123', 2;
source include/show_binlog_events.inc;
--sync_slave_with_master
--connection master
if (!$is_temporary)
{
let $diff_table= test.t1;
source include/rpl_diff_tables.inc;
--let $diff_tables= master:t1,slave:t1
--source include/diff_tables.inc
}
--echo
@ -103,10 +118,14 @@ let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
eval CREATE $_temporary TABLE IF NOT EXISTS t1
SELECT '123', 2;
source include/show_binlog_events.inc;
--sync_slave_with_master
--connection master
if (!$is_temporary)
{
let $diff_table= test.t1;
source include/rpl_diff_tables.inc;
--let $diff_tables= master:t1,slave:t1
--source include/diff_tables.inc
}
--echo
@ -121,10 +140,13 @@ eval CREATE $_temporary TABLE IF NOT EXISTS t1
IGNORE (SELECT '123', 3) UNION (SELECT '123', 4);
source include/show_binlog_events.inc;
--sync_slave_with_master
--connection master
if (!$is_temporary)
{
let $diff_table= test.t1;
source include/rpl_diff_tables.inc;
--let $diff_tables= master:t1,slave:t1
--source include/diff_tables.inc
}
if (!$is_temporary)
@ -155,10 +177,14 @@ let binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
call p1(500);
call p1(600);
source include/show_binlog_events.inc;
--sync_slave_with_master
--connection master
if (!$is_temporary)
{
let $diff_table= test.t1;
source include/rpl_diff_tables.inc;
--let $diff_tables= master:t1,slave:t1
--source include/diff_tables.inc
}
DROP PROCEDURE p1;
@ -173,10 +199,14 @@ EXECUTE stm USING @a;
SET @a= 800;
EXECUTE stm USING @a;
source include/show_binlog_events.inc;
--sync_slave_with_master
--connection master
if (!$is_temporary)
{
let $diff_table= test.t1;
source include/rpl_diff_tables.inc;
--let $diff_tables= master:t1,slave:t1
--source include/diff_tables.inc
}
--echo
@ -224,10 +254,13 @@ eval /*!CREATE $_temporary TABLE IF NOT EXISTS t1
*/SELECT 'abc', 905;
source include/show_binlog_events.inc;
--sync_slave_with_master
--connection master
if (!$is_temporary)
{
let $diff_table= test.t1;
source include/rpl_diff_tables.inc;
--let $diff_tables= master:t1,slave:t1
--source include/diff_tables.inc
}
DROP TABLE t2;

View file

@ -42,6 +42,7 @@ send STOP SLAVE SQL_THREAD;
connection slave1;
--echo # To resume slave SQL thread
SET DEBUG_SYNC= 'now SIGNAL signal.continue';
SET DEBUG_SYNC= 'now WAIT_FOR signal.continued';
SET DEBUG_SYNC= 'RESET';
--echo
@ -52,8 +53,7 @@ source include/wait_for_slave_sql_to_stop.inc;
--echo # Slave should stop after the transaction has committed.
--echo # So t1 on master is same to t1 on slave.
let diff_table_1=master:test.t1;
let diff_table_2=slave:test.t1;
let diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
connection slave;

View file

@ -1,12 +1,3 @@
####################
# Change Author: JBM
# Change Date: 2006-01-17
# Change: Added order by in select
####################
# Change Date: 2006-02-02
# Change: renamed to make bettre sense,
# and wrapped per Engine test
############################
source include/master-slave.inc;
#
@ -32,4 +23,4 @@ connection master;
DROP TABLE t1;
sync_slave_with_master;
# End of 4.1 tests
--source include/rpl_end.inc

View file

@ -0,0 +1,86 @@
# ==== Purpose ====
#
# Auxiliary file used by suite/rpl/t/rpl_test_framework.test
#
# The purpose is to check that the sync chain generated in
# rpl_change_topology.inc (invoked from rpl_init.inc) is correct. This
# is done in two ways:
# (1) Print the sync chain.
# (2) Execute a statement and verify that it replicates to all slaves.
#
#
# ==== Implementation ====
#
# Does this:
# (1) Set up a given replication topology (rpl_init.inc)
# (2) Print $rpl_sync_chain
# (3) Execute "DELETE FROM t1" and then "INSERT INTO t1" on the master
# (4) Sync and compare all servers.
# (5) Clean up the replication topology (rpl_end.inc)
#
# (Technical detail: Since DELETE FROM t1 is not executed at the end,
# some servers may have rows left in t1 from a previous invocation of
# rpl_test_framework.inc. Therefore, this file will only work in
# statement mode where "DELETE FROM t1" removes rows that exist on
# slave but not on master.)
#
#
# ==== Usage ====
#
# --let $rpl_server_count= <number>
# --let $rpl_topology= <topology specification>
# --let $masters= <list of masters>
# [--let $rpl_diff_servers= <list of servers>]
# --source extra/rpl_tests/rpl_test_framework.inc
#
# Parameters:
# $next_number
# The INSERT statement will insert $next_number into t1, and
# $next_number will increase by 1.
#
# $rpl_server_count, $rpl_topology:
# See include/rpl_init.inc
#
# $masters
# This should be a list of numbers, each identifying a server.
# The DELETE and INSERT statements will be executed on all servers
# in the list.
#
# $rpl_diff_servers
# See include/rpl_diff.inc
--source include/rpl_init.inc
--source include/rpl_generate_sync_chain.inc
--echo rpl_sync_chain= '$rpl_sync_chain'
--inc $next_number
# Iterate over masters
while ($masters)
{
--let $master_i= `SELECT SUBSTRING_INDEX('$masters', ',', 1)`
--let $masters= `SELECT SUBSTRING('$masters', LENGTH('$master_i') + 2)`
# Connect to master and execute statement
--let $rpl_connection_name= server_$master_i
--source include/rpl_connection.inc
DELETE FROM t1;
--eval INSERT INTO t1 VALUES ($next_number)
}
--source include/rpl_sync.inc
# Compare all servers.
--let $diff_tables= server_$rpl_server_count:t1
--let $server_i= $rpl_server_count
--dec $server_i
while ($server_i)
{
--let $diff_tables= server_$server_i:t1,$diff_tables
--dec $server_i
}
--source include/diff_tables.inc
--let $diff_servers=
--let $masters=
--source include/rpl_end.inc

View file

@ -1,11 +1,6 @@
#
# Copyright 2006 MySQL. All rights reserved.
#
# Test to check for the different version of truncating a table.
# The statements are "TRUNCATE tbl" and "DELETE FROM tbl". We check
# the behaviour of each possible value for BINLOG_FORMAT.
#
# Author(s): Mats Kindahl
--source include/master-slave.inc
@ -14,3 +9,5 @@ let $trunc_stmt = TRUNCATE TABLE;
let $trunc_stmt = DELETE FROM;
--source extra/rpl_tests/rpl_truncate_helper.test
--source include/rpl_end.inc

View file

@ -1,4 +1,4 @@
source include/reset_master_and_slave.inc;
--source include/rpl_reset.inc
--echo **** On Master ****
connection master;
@ -10,8 +10,7 @@ connection master;
eval $trunc_stmt t1;
sync_slave_with_master;
let $diff_table_1=master:test.t1;
let $diff_table_2=slave:test.t1;
let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
--echo ==== Test using a table with delete triggers ====
@ -26,8 +25,7 @@ connection master;
eval $trunc_stmt t1;
sync_slave_with_master;
let $diff_table_1=master:test.t2;
let $diff_table_2=slave:test.t2;
let $diff_tables= master:t2, slave:t2;
source include/diff_tables.inc;
connection master;

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