1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

5.5-merge

This commit is contained in:
Sergei Golubchik
2011-07-02 22:08:51 +02:00
3220 changed files with 94894 additions and 422456 deletions

View File

@ -11,6 +11,7 @@
*.dir/
*.dll
*.dsp
*.dylib
*.exe
*.exp
*.gcda
@ -22,6 +23,7 @@
*.lai
*.lib
*.lo
*.manifest
*.map
*.o
*.obj
@ -32,6 +34,7 @@
*.Po
*.reject
*.res
*.rule
*.sbr
*.so
*.so.*
@ -40,7 +43,12 @@
*.user
*.vcproj
*.vcproj.cmake
*/*_pure_*warnings
*.vcxproj
*.vcxproj.filters
Debug
MySql.sdf
Win32
RelWithDebInfo
*~
.*.swp
./CMakeCache.txt
@ -55,23 +63,16 @@
.defs.mk
.depend
.depend.mk
.deps
.DS_Store
.gdb_history
.gdbinit
.libs
.o
.out
.snprj/*
.vimrc
ac_available_languages_fragment
acinclude.m4
aclocal.m4
autom4te-2.53.cache/*
autom4te.cache/*
BitKeeper/
client/*.ds?
client/.libs -prune
client/completion_hash.cpp
client/decimal.c
client/dtoa.c
@ -137,16 +138,7 @@ comments
comon.h
comp_err/*.ds?
compile
config.cache
config.guess
config.h
config.h.in
config.log
config.status
config.sub
configure
configure.am
configure.lineno
contrib/*.ds?
COPYING
COPYING.LIB
@ -216,7 +208,9 @@ include/mysql_h.ic
include/mysql_version.h
include/mysqld_ername.h
include/mysqld_error.h
include/mysqld_error.h.rule
include/openssl
include/probes_mysql_dtrace.h
include/readline
include/readline/*.h
include/readline/readline.h
@ -246,7 +240,6 @@ libmysql/release/libmysql.exp
libmysql/vio_priv.h
libmysql/viosocket.o.6WmSJk
libmysql_r/*.c
libmysql_r/acconfig.h
libmysql_r/client_settings.h
libmysql_r/conf_to_src
libmysql_r/link_sources
@ -557,7 +550,9 @@ scripts/mysql_find_rows
scripts/mysql_fix_extensions
scripts/mysql_fix_privilege_tables
scripts/mysql_fix_privilege_tables.sql
scripts/mysql_fix_privilege_tables.sql.rule
scripts/mysql_fix_privilege_tables_sql.c
scripts/mysql_fix_privilege_tables_sql.c.rule
scripts/mysql_install_db
scripts/mysql_secure_installation
scripts/mysql_setpermission
@ -609,6 +604,7 @@ sql/client_plugin.c
sql/Doxyfile
sql/gen_lex_hash
sql/lex_hash.h
sql/lex_hash.h.rule
sql/link_sources
sql/message.h
sql/message.mc
@ -630,6 +626,7 @@ sql/share/*/*.sys
sql/sql_builtin.cc
sql/sql_yacc.cc
sql/sql_yacc.h
sql/sql_yacc.h.rule
sql/sql_yacc.output
sql_error.cc
sql_prepare.cc
@ -812,7 +809,6 @@ storage/ndb/bin/testTimeout
storage/ndb/bin/testTransactions
storage/ndb/bin/verify_index
storage/ndb/bin/waiter
storage/ndb/config/autom4te.cache/*
storage/ndb/config/config.mk
storage/ndb/examples/ndbapi_example1/ndbapi_example1
storage/ndb/examples/ndbapi_example2/ndbapi_example2
@ -932,8 +928,6 @@ storage/ndb/tools/ndb_show_tables
storage/ndb/tools/ndb_test_platform
storage/ndb/tools/ndb_waiter
storage/pbxt/bin/xtstat
storage/xtradb/autom4te-2.53.cache/*
storage/xtradb/autom4te.cache/*
storage/xtradb/configure.lineno
storage/xtradb/conftest.s1
storage/xtradb/conftest.subs
@ -1028,7 +1022,6 @@ test1/*
test?.MA?
test_xml
tests/*.ds?
tests/.libs -prune
tests/bug25714
tests/client_test
tests/connect_test
@ -1038,7 +1031,6 @@ thr_test/*
thread_test
tmp
tmp/*
tools/.libs -prune
tools/my_vsnprintf.c
tools/mysqlmanager
tools/mysqlmngd
@ -1072,5 +1064,6 @@ vio/viotest.cpp
win/configure.data
win/vs71cache.txt
win/vs8cache.txt
win/nmake_cache.txt
ylwrap
zlib/*.ds?

View File

@ -1,11 +1,27 @@
# Copyright (C) 2000, 2005 MySQL AB, 2008 Sun Microsystems, Inc.
#
# 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
cflags="$c_warnings $extra_flags $EXTRA_FLAGS $EXTRA_CFLAGS"
cxxflags="$cxx_warnings $base_cxxflags $extra_flags $EXTRA_FLAGS $EXTRA_CXXFLAGS"
extra_configs="$extra_configs $local_infile_configs $EXTRA_CONFIGS"
configure="./configure $base_configs $extra_configs"
commands="\
$make -k maintainer-clean || true
/bin/rm -rf */.deps/*.P configure config.cache storage/*/configure storage/*/config.cache autom4te.cache storage/*/autom4te.cache;
/bin/rm -rf configure;
/bin/rm -rf CMakeCache.txt CMakeFiles/
path=`dirname $0`

View File

@ -1,83 +0,0 @@
# Copyright (C) 2002, 2004-2005 MySQL AB
#
# This library 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,
# 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
## Process this file with automake to create Makefile.in
EXTRA_DIST = FINISH.sh \
SETUP.sh \
autorun.sh \
cmake_configure.sh \
build_mccge.sh \
check-cpu \
cleanup \
compile-alpha \
compile-alpha-debug \
compile-amd64-debug-max \
compile-amd64-debug-max-no-ndb \
compile-amd64-gcov \
compile-amd64-gprof \
compile-amd64-max \
compile-amd64-max-sci \
compile-amd64-valgrind-max \
compile-bintar \
compile-darwin-mwcc \
compile-dist \
compile-hpux11-parisc2-aCC \
compile-ia64-debug-max \
compile-irix-mips64-mipspro \
compile-pentium \
compile-pentium-debug \
compile-pentium-debug-max \
compile-pentium-debug-max-no-embedded \
compile-pentium-debug-max-no-ndb \
compile-pentium-debug-openssl \
compile-pentium-debug-yassl \
compile-pentium-gcov \
compile-pentium-gprof \
compile-pentium-icc \
compile-pentium-icc-valgrind-max \
compile-pentium-icc-yassl \
compile-pentium-max \
compile-pentium-myodbc \
compile-pentium-pgcc \
compile-pentium-valgrind-max \
compile-pentium64 \
compile-pentium64-debug \
compile-pentium64-debug-max \
compile-pentium64-gcov \
compile-pentium64-gprof \
compile-pentium64-max \
compile-pentium64-max-sci \
compile-pentium64-valgrind-max \
compile-ppc \
compile-ppc-debug \
compile-ppc-debug-max \
compile-ppc-debug-max-no-ndb \
compile-ppc-max \
compile-solaris-amd64 \
compile-solaris-amd64-debug \
compile-solaris-amd64-debug-forte \
compile-solaris-amd64-forte \
compile-solaris-sparc \
compile-solaris-sparc-debug \
compile-solaris-sparc-forte \
compile-solaris-sparc-purify \
compile-solaris-x86-32 \
compile-solaris-x86-32-debug \
compile-solaris-x86-32-debug-forte \
compile-solaris-x86-forte-32 \
util.sh

View File

@ -1,5 +1,22 @@
#!/bin/sh
# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
#
# 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
########################################################################
get_key_value()
@ -14,6 +31,7 @@ Usage: $0 [-h|-n] [configure-options]
-h, --help Show this help message.
-n, --just-print Don't actually run any commands; just print them.
-c, --just-configure Stop after running configure.
--with-debug=full Build with full debug(no optimizations, keep call stack).
--warning-mode=[old|pedantic|maintainer]
Influences the debug flags. Old is default.
--prefix=path Build with prefix 'path'.
@ -29,6 +47,8 @@ parse_options()
case "$1" in
--prefix=*)
prefix=`get_key_value "$1"`;;
--with-debug=full)
full_debug="=full";;
--warning-mode=*)
warning_mode=`get_key_value "$1"`;;
--extra-flags=*)
@ -67,6 +87,7 @@ just_print=
just_configure=
warning_mode=
maintainer_mode=
full_debug=
parse_options "$@"
@ -119,7 +140,7 @@ else
# C++ warnings
cxx_warnings="$warnings -Wno-unused-parameter"
# cxx_warnings="$cxx_warnings -Woverloaded-virtual -Wsign-promo"
cxx_warnings="$cxx_warnings -Wctor-dtor-privacy -Wnon-virtual-dtor"
cxx_warnings="$cxx_warnings -Wnon-virtual-dtor"
debug_extra_cflags="-O0 -g3 -gdwarf-2"
fi
@ -145,7 +166,11 @@ base_cxxflags="-felide-constructors -fno-exceptions -fno-rtti"
fast_cflags="-O3 -fno-omit-frame-pointer"
debug_configs="--with-debug"
debug_cflags="$debug_cflags $debug_extra_cflags"
if [ -z "$full_debug" ]
then
debug_cflags="$debug_cflags $debug_extra_cflags"
fi
static_link="--with-mysqld-ldflags=-all-static "
static_link="$static_link --with-client-ldflags=-all-static"
@ -237,7 +262,7 @@ gcov_compile_flags="$gcov_compile_flags -DMYSQL_SERVER_SUFFIX=-gcov -DHAVE_gcov"
gcov_link_flags="-fprofile-arcs -ftest-coverage"
gcov_configs="--disable-shared"
gcov_configs="--with-gcov"
# gprof

View File

@ -1,38 +1,27 @@
#!/bin/sh
# Create MySQL autotools infrastructure
# Copyright (C) 2005 MySQL 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
# Create MySQL cmake configure wrapper
die() { echo "$@"; exit 1; }
# Handle "glibtoolize" (e.g., for native OS X autotools) as another
# name for "libtoolize". Use the first one, either name, found in PATH.
LIBTOOLIZE=libtoolize # Default
IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
for dir in $PATH
do
if test -x $dir/glibtoolize
then
LIBTOOLIZE=glibtoolize
break
elif test -x $dir/libtoolize
then
break
fi
done
IFS="$save_ifs"
rm -rf configure
aclocal || die "Can't execute aclocal"
autoheader || die "Can't execute autoheader"
# --force means overwrite ltmain.sh script if it already exists
$LIBTOOLIZE --automake --force --copy || die "Can't execute libtoolize"
# --add-missing instructs automake to install missing auxiliary files
# and --force to overwrite them if they already exist
automake --add-missing --force --copy || die "Can't execute automake"
autoconf || die "Can't execute autoconf"
# Do not use autotools generated configure directly. Instead, use a script
# that will either call CMake or original configure shell script at build
# time (CMake is preferred if installed).
mv configure configure.am
cp BUILD/cmake_configure.sh configure
chmod a+x configure
# Use a configure script that will call CMake.
path=`dirname $0`
cp $path/cmake_configure.sh $path/../configure
chmod +x $path/../configure

View File

@ -1,5 +1,22 @@
#!/bin/sh
# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
#
# 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;
@ -42,9 +59,7 @@ cat <<EOF
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.
Extended Edition.
More information for developers can be found in --help,
--sysadmin-help, and --extended-help.
@ -102,7 +117,8 @@ cat <<EOF
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
Linux, you need to set --compiler=icc.
Linux, you need to set --compiler=icc. If you want to use the AMD
compiler Open64 set --compiler=open64.
A synonym for forte is SunStudio, so one can also use
--compiler=SunStudio.
@ -150,14 +166,32 @@ Usage: $0 [options]
--without-debug Build non-debug version
--use-comment Set the comment in the build
--with-fast-mutexes Use try/retry method of acquiring mutex
--without-fast-mutexes Don't use try/retry method of acquiring mutex
--without-perfschema Don't build with performance schema
--generate-feedback path Compile with feedback using the specified directory
to store the feedback files
--use-feedback path Compile using feedback information from the specified
directory
--with-debug Build debug version
--extra-debug-flag flag Add -Dflag to compiler flags
InnoDB supports the following debug flags,
UNIV_DEBUG, UNIV_SYNC_DEBUG, UNIV_MEM_DEBUG,
UNIV_DEBUG_THREAD_CREATION, UNIV_DEBUG_LOCK_VALIDATE,
UNIV_DEBUG_PRINT, UNIV_DEBUG_FILE_ACCESS,
UNIV_LIGHT_MEM_DEBUG, UNIV_LOG_DEBUG,
UNIV_IBUF_COUNT_DEBUG, UNIV_SEARCH_DEBUG,
UNIV_LOG_LSN_DEBUG, UNIV_ZIP_DEBUG, UNIV_AHI_DEBUG,
UNIV_DEBUG_VALGRIND, UNIV_SQL_DEBUG, UNIV_AIO_DEBUG,
UNIV_BTR_DEBUG, UNIV_LRU_DEBUG, UNIV_BUF_DEBUG,
UNIV_HASH_DEBUG, UNIV_LIST_DEBUG, UNIV_IBUF_DEBUG
--with-link-time-optimizer
Link time optimizations enabled (Requires GCC 4.5
if GCC used), available for icc as well. This flag
is only considered if also fast is set.
--with-mso Special flag used by Open64 compiler (requres at
least version 4.2.3) that enables optimisations
for multi-core scalability.
--configure-only Stop after running configure.
--use-autotools Start by running autoconf, automake,.. tools
--no-autotools Start from configure
--print-only Print commands that the script will execute,
but do not actually execute
--prefix=path Build with prefix 'path'
@ -170,7 +204,7 @@ Usage: $0 [options]
MySQL use
--commercial Use commercial libraries
--gpl Use gpl libraries
--compiler=[gcc|icc|forte|SunStudio] Select compiler
--compiler=[gcc|icc|forte|SunStudio|open64] Select compiler
--cpu=[x86|x86_64|sparc|itanium] Select CPU type
x86 => x86 and 32-bit binary
x86_64 => x86 and 64 bit binary
@ -259,7 +293,8 @@ extended_usage()
version string suffix: [none]
All packages except Classic include support for user-defined
partitioning.
partitioning. All packages include support for Performance
Schema.
If --with-debug is used, an additional "-debug" is appended to the
version string.
@ -389,7 +424,8 @@ extended_usage()
platforms supported by this script.
The --fast option adds -mtune=cpu_arg to the C/C++ flags (provides
support for Nocona, K8, and other processors).
support for Nocona, K8, and other processors), this option is valid
when gcc is the compiler.
Use of the --debug option adds -g to the C/C++ flags.
@ -397,10 +433,35 @@ extended_usage()
by calling the script as follows:
CC="/usr/local/bin/gcc" CXX="/usr/local/bin/gcc" BUILD/build_mccge.sh
FreeBSD/x86/gcc
---------------
No flags are used. Instead, configure determines the proper flags to
use.
Feedback profiler on gcc
------------------------
Using gcc --generate-feedback=path causes the following flags to be added
to the compiler flags.
--fprofile-generate
--fprofile-dir=path
Using gcc with --use-feedback=path causes the following flags to be added
to the compiler flags. --fprofile-correction indicates MySQL is a multi-
threaded application and thus counters can be inconsistent with each other
and the compiler should take this into account.
--fprofile-use
--fprofile-dir=path
--fprofile-correction
Feedback compilation using Open64
---------------------------------
Using Open64 with --generate-feedback=path causes the following flags to
be added to the compiler flags.
-fb-create path/feedback
Using Open64 with --use-feedback=path causes the following flags to be
added to the compiler flags.
--fb-opt path/feedback
Linux/x86+Itanium/gcc
-------------
@ -410,6 +471,9 @@ extended_usage()
added to the C/C++ flags. (To build a 32-bit binary on a 64-bit CPU,
use the --32 option as described previously.)
When gcc 4.5 is used and the user set --with-link-time-optimizer then
also --flto is added to compiler flags and linker flags.
Linux/x86+Itanium/icc
-------------
Flags used:
@ -433,6 +497,19 @@ extended_usage()
added to the C/C++ flags; this provides optimisations specific to Core
2 Duo. This is added only when the --fast flag is set.
Linux/x86/Open64
----------------
For normal builds use -O3, when fast flag is set one also adds
--march=auto to generate optimized builds for the CPU used. If
--with-link-time-optimizer is set also -ipa is set. There is also
a special flag --with-mso which can be set to get --mso set which
activates optimisation for multi-core scalability.
FreeBSD/x86/gcc
---------------
No flags are used. Instead, configure determines the proper flags to
use.
Solaris/x86/gcc
---------------
All builds on Solaris are by default 64-bit, so -m64 is always used in
@ -653,6 +730,9 @@ parse_compiler()
forte | SunStudio | sunstudio )
compiler="forte"
;;
open64 | Open64 )
compiler="open64"
;;
*)
echo "Unknown compiler '$compiler'"
exit 1
@ -686,6 +766,15 @@ parse_options()
--with-fast-mutexes)
with_fast_mutexes="yes"
;;
--without-fast-mutexes)
with_fast_mutexes="no"
;;
--without-perfschema)
with_perfschema="no"
;;
--with-mso)
with_mso="yes"
;;
--use-tcmalloc)
use_tcmalloc="yes"
;;
@ -693,6 +782,10 @@ parse_options()
with_debug_flag="yes"
fast_flag="no"
;;
--extra-debug-flag)
shift
extra_debug_flags="$extra_debug_flags -D$1"
;;
--debug)
compile_debug_flag="yes"
;;
@ -712,6 +805,14 @@ parse_options()
compiler=`get_key_value "$1"`
parse_compiler
;;
--generate-feedback)
shift
GENERATE_FEEDBACK_PATH="$1"
;;
--use-feedback)
shift
USE_FEEDBACK_PATH="$1"
;;
--cpu=*)
cpu_type=`get_key_value "$1"`
parse_cpu_type
@ -746,12 +847,6 @@ parse_options()
--parallelism=*)
parallelism=`get_key_value "$1"`
;;
--use-autotools)
use_autotools="yes"
;;
--no-autotools)
use_autotools="no"
;;
--configure-only)
just_configure="yes"
;;
@ -896,6 +991,9 @@ set_cpu_base()
#
init_configure_commands()
{
path=`dirname $0`
cp $path/cmake_configure.sh $path/../configure
chmod +x $path/../configure
cflags="$c_warnings $base_cflags $compiler_flags"
cxxflags="$cxx_warnings $base_cxxflags $compiler_flags"
configure="./configure $base_configs $with_flags"
@ -1084,6 +1182,7 @@ set_with_debug_flags()
loc_debug_flags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS "
compiler_flags="$compiler_flags $loc_debug_flags"
fi
compiler_flags="$compiler_flags $extra_debug_flags"
fi
}
@ -1105,7 +1204,7 @@ set_no_omit_frame_pointer_for_developers()
#
set_debug_flag()
{
if test "x$compile_debug_flags" = "xyes" ; then
if test "x$compile_debug_flag" = "xyes" ; then
compiler_flags="$compiler_flags -g"
fi
}
@ -1152,7 +1251,9 @@ set_base_configs()
fi
base_configs="$base_configs --with-pic"
base_configs="$base_configs --with-csv-storage-engine"
base_configs="$base_configs --with-perfschema"
if test "x$with_perfschema" != "xno" ; then
base_configs="$base_configs --with-perfschema"
fi
}
#
@ -1251,6 +1352,19 @@ set_gcc_special_options()
fi
}
#
# If we discover a Core 2 Duo architecture and we have enabled the fast
# flag, we enable a compile especially optimised for Core 2 Duo. This
# feature is currently available on Intel's icc compiler only.
#
set_icc_special_options()
{
if test "x$fast_flag" = "xyes" && test "x$cpu_arg" = "xcore2" && \
test "x$compiler" = "xicc" ; then
compiler_flags="$compiler_flags -xT"
fi
}
set_cc_and_cxx_for_gcc()
{
if test "x$CC" = "x" ; then
@ -1271,6 +1385,16 @@ set_cc_and_cxx_for_icc()
fi
}
set_cc_and_cxx_for_open64()
{
if test "x$CC" = "x" ; then
CC="opencc -static-libgcc -fno-exceptions"
fi
if test "x$CXX" = "x" ; then
CXX="openCC -static-libgcc -fno-exceptions"
fi
}
set_cc_and_cxx_for_forte()
{
if test "x$CC" = "x" ; then
@ -1281,19 +1405,6 @@ set_cc_and_cxx_for_forte()
fi
}
#
# If we discover a Core 2 Duo architecture and we have enabled the fast
# flag, we enable a compile especially optimised for Core 2 Duo. This
# feature is currently available on Intel's icc compiler only.
#
set_icc_special_options()
{
if test "x$fast_flag" = "xyes" && test "x$cpu_arg" = "xcore2" && \
test "x$compiler" = "xicc" ; then
compiler_flags="$compiler_flags -xT"
fi
}
#
# FreeBSD Section
#
@ -1357,12 +1468,45 @@ get_gcc_version()
fi
}
#
# Link time optimizer (interprocedural optimizations) for Open64
#
check_for_open64_link_time_optimizer()
{
if test "x$with_link_time_optimizer" = "xyes" ; then
compiler_flags="$compiler_flags -ipa"
LDFLAGS="$LDFLAGS -ipa"
fi
}
#
# Link time optimizer (interprocedural optimizations) for icc
#
check_for_icc_link_time_optimizer()
{
if test "x$with_link_time_optimizer" = "xyes" ; then
compiler_flags="$compiler_flags -ipo"
LDFLAGS="$LDFLAGS -ipo"
fi
}
#
# Link time optimizer (interprocedural optimizations) for forte
#
check_for_forte_link_time_optimizer()
{
if test "x$with_link_time_optimizer" = "xyes" ; then
compiler_flags="$compiler_flags -ipo"
LDFLAGS="$LDFLAGS -ipo"
fi
}
#
# Link Time Optimizer in GCC (LTO) uses a parameter -flto
# which was added to GCC 4.5, if --with-link-time-optimizer
# is set then use this feature
#
check_for_link_time_optimizer()
check_for_gcc_link_time_optimizer()
{
get_gcc_version
if test "$gcc_version" -ge 405 && \
@ -1371,11 +1515,37 @@ check_for_link_time_optimizer()
LDFLAGS="$LDFLAGS -flto"
fi
}
set_feedback_for_gcc()
{
if test "x$GENERATE_FEEDBACK_PATH" != "x" ; then
compiler_flags="$compiler_flags -fprofile-generate"
compiler_flags="$compiler_flags -fprofile-dir=$GENERATE_FEEDBACK_PATH"
elif test "x$USE_FEEDBACK_PATH" != "x" ; then
compiler_flags="$compiler_flags -fprofile-use"
compiler_flags="$compiler_flags -fprofile-correction"
compiler_flags="$compiler_flags -fprofile-dir=$USE_FEEDBACK_PATH"
fi
}
set_feedback_for_open64()
{
if test "x$GENERATE_FEEDBACK_PATH" != "x" ; then
compiler_flags="$compiler_flags --fb-create=$GENERATE_FEEDBACK_PATH/feedback"
elif test "x$USE_FEEDBACK_PATH" != "x" ; then
compiler_flags="$compiler_flags --fb-opt=$USE_FEEDBACK_PATH/feedback"
fi
}
#
# Linux Section
#
set_linux_configs()
{
# Default to use --with-fast-mutexes on Linux
if test "x$with_fast_mutexes" = "x" ; then
base_configs="$base_configs --with-fast-mutexes"
fi
if test "x$cpu_base_type" != "xx86" && \
test "x$cpu_base_type" != "xitanium" ; then
usage "Only x86 and Itanium CPUs supported for Linux"
@ -1392,19 +1562,14 @@ set_linux_configs()
if test "x$fast_flag" != "xno" ; then
if test "x$fast_flag" = "xyes" ; then
compiler_flags="$compiler_flags -O3"
check_for_link_time_optimizer
check_for_gcc_link_time_optimizer
else
compiler_flags="$compiler_flags -O2"
compiler_flags="$compiler_flags -O3"
fi
else
compiler_flags="$compiler_flags -O0"
fi
check_64_bits
if test "x$m64" = "xyes" ; then
compiler_flags="$compiler_flags -m64"
else
compiler_flags="$compiler_flags -m32"
fi
set_feedback_for_gcc
# configure will set proper compiler flags for gcc on Linux
elif test "x$compiler" = "xicc" ; then
compiler_flags="$compiler_flags -mp -restrict"
@ -1414,16 +1579,36 @@ set_linux_configs()
fi
if test "x$fast_flag" != "xno" ; then
compiler_flags="$compiler_flags -O3 -unroll2 -ip"
if test "x$fast_flag" = "xyes" && \
test "x$with_link_time_optimizer" = "xyes" ; then
compiler_flags="$compiler_flags -ipo"
LDFLAGS="$LDFLAGS -ipo"
if test "x$fast_flag" = "xyes" ; then
check_for_icc_link_time_optimizer
fi
fi
elif test "x$compiler" = "xopen64" ; then
set_cc_and_cxx_for_open64
if test "x$fast_flag" != "xno" ; then
if test "x$fast_flag" = "xyes" ; then
compiler_flags="$compiler_flags -O3"
# Generate code specific for the machine you run on
compiler_flags="$compiler_flags -march=auto"
check_for_open64_link_time_optimizer
if test "x$with_mso" = "xyes" ; then
compiler_flags="$compiler_flags -mso"
fi
else
compiler_flags="$compiler_flags -O3"
fi
fi
set_feedback_for_open64
else
usage "Only gcc and icc compilers supported for Linux"
usage "Only gcc,icc and Open64 compilers supported for Linux"
exit 1
fi
check_64_bits
if test "x$m64" = "xyes" ; then
compiler_flags="$compiler_flags -m64"
else
compiler_flags="$compiler_flags -m32"
fi
}
#
@ -1475,7 +1660,7 @@ set_solaris_configs()
if test "x$fast_flag" = "xyes" ; then
LDFLAGS="$LDFLAGS -O3"
compiler_flags="$compiler_flags -O3"
check_for_link_time_optimizer
check_for_gcc_link_time_optimizer
else
if test "x$fast_flag" = "xgeneric" ; then
LDFLAGS="$LDFLAGS -O2"
@ -1498,10 +1683,7 @@ set_solaris_configs()
if test "x$fast_flag" = "xyes" ; then
compiler_flags="$compiler_flags -xtarget=native"
compiler_flags="$compiler_flags -xunroll=3"
if test "x$with_link_time_optimizer" = "xyes" ; then
compiler_flags="$compiler_flags -xipo"
LDFLAGS="$LDFLAGS -xipo"
fi
check_for_forte_link_time_optimizer
else
compiler_flags="$compiler_flags -xtarget=generic"
fi
@ -1612,17 +1794,6 @@ set_default_package()
fi
}
set_autotool_flags()
{
if test "x$use_autotools" = "x" ; then
if test "x$developer_flag" = "xno" ; then
use_autotools="no"
else
use_autotools="yes"
fi
fi
}
set_defaults_based_on_environment()
{
if test ! -z "$MYSQL_DEVELOPER" ; then
@ -1674,25 +1845,28 @@ base_cxxflags=
base_configs=
debug_flags=
cxxflags=
extra_debug_flags=
m64=
explicit_size_set=
datadir=
commands=
use_autotools=
engine_configs=
ASFLAGS=
LDFLAGS=
use_tcmalloc=
without_comment="yes"
with_fast_mutexes=
with_perfschema="yes"
with_link_time_optimizer=
with_mso=
gcc_version="0"
generate_feedback_path=
use_feedback_path=
set_defaults_based_on_environment
parse_options "$@"
set_autotool_flags
set_default_package
set -e
@ -1793,9 +1967,6 @@ set_ccache_usage
# Set up commands variable from variables prepared for base
# configurations, compiler flags, and warnings flags.
#
if test "x$use_autotools" = "xyes" ; then
init_auto_commands
fi
init_configure_commands
if test "x$just_configure" != "xyes" ; then
@ -1806,8 +1977,8 @@ fi
# The commands variable now contains the entire command to be run for
# the build; we either execute it, or merely print it out.
#
if test "x$just_print" = "xyes" ; then
echo "$commands"
else
echo "Running command:"
echo "$commands"
if test "x$just_print" != "xyes" ; then
eval "set -x; $commands"
fi

View File

@ -1,4 +1,20 @@
#!/bin/sh
# Copyright (C) 2005, 2008 MySQL AB, 2009 Sun Microsystems, 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; 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 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
#
# Check cpu of current machine and find the
# best compiler optimization flags for gcc

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2003 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"

View File

@ -1,14 +1,34 @@
#!/bin/sh
# Choose whether to use autoconf created configure
# of perl script that calls cmake.
# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
#
# 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
# Ensure cmake and perl are there
cmake -P cmake/check_minimal_version.cmake >/dev/null 2>&1 || HAVE_CMAKE=no
perl --version >/dev/null 2>&1 || HAVE_CMAKE=no
perl --version >/dev/null 2>&1 || HAVE_PERL=no
scriptdir=`dirname $0`
if test "$HAVE_CMAKE" = "no"
then
sh $scriptdir/configure.am "$@"
echo "CMake is required to build MySQL."
exit 1
elif test "$HAVE_PERL" = "no"
then
echo "Perl is required to build MySQL using the configure to CMake translator."
exit 1
else
perl $scriptdir/cmake/configure.pl "$@"
fi

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2000, 2002 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2000, 2005 MySQL 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
# 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 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
/bin/rm -f */.deps/*.P */*.o
make -k maintainer-clean
/bin/rm -f */.deps/*.P */*.o

View File

@ -1,4 +1,20 @@
#! /bin/sh
# Copyright (C) 2005 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$amd64_cflags $debug_cflags"

View File

@ -1,4 +1,22 @@
#! /bin/sh
# Copyright (C) 2005, 2006 MySQL 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
path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$amd64_cflags $debug_cflags"

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2007 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2007 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2005 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$amd64_cflags $fast_cflags -g"

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2007 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$amd64_cflags $fast_cflags -g"

View File

@ -1,5 +1,22 @@
#! /bin/sh
# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
#
# 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
path=`dirname $0`
. "$path/SETUP.sh"
@ -7,18 +24,3 @@ extra_flags="$amd64_cflags $debug_cflags $valgrind_flags"
extra_configs="$amd64_configs $debug_configs $valgrind_configs $max_configs"
. "$path/FINISH.sh"
if test -z "$just_print"
then
set +v +x
echo "\
******************************************************************************
Note that by default BUILD/compile-pentium-valgrind-max calls 'configure' with
--enable-assembler. When Valgrind detects an error involving an assembly
function (for example an uninitialized value used as an argument of an
assembly function), Valgrind will not print the stacktrace and 'valgrind
--gdb-attach=yes' will not work either. If you need a stacktrace in those
cases, you have to run BUILD/compile-pentium-valgrind-max with the
--disable-assembler argument.
******************************************************************************"
fi

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2005 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (C) 2009 Sun Microsystems, Inc
# Copyright (C) 2004, 2006 MySQL AB, 2008, 2009 Sun Microsystems, 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

View File

@ -1,5 +1,20 @@
#!/bin/sh
# Copyright (C) 2004, 2005 MySQL 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
# 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 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
if [ ! -f "sql/mysqld.cc" ]; then
echo "You must run this script from the MySQL top-level directory."
exit 1

View File

@ -1,3 +1,20 @@
#! /bin/sh
# Copyright (C) 2001, 2005 MySQL 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
# 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 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
gmake -k maintainer-clean || true
/bin/rm -f */.deps/*.P config.cache storage/innobase/config.cache

View File

@ -1,5 +1,20 @@
#!/bin/sh
# Copyright (C) 2004, 2005 MySQL 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
# 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 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
if [ ! -f "sql/mysqld.cc" ]; then
echo "You must run this script from the MySQL top-level directory."
exit 1

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2006 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2000, 2002 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2005 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2000, 2007 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2001, 2007 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2004, 2005 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2005, 2007 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2001, 2003 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2005 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2000, 2007 MySQL 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
# 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 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
# Need to disable ccache, or we loose the gcov-needed compiler output files.
USING_GCOV=1

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2001, 2007 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2005 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2005 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2005 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2001, 2005 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2000 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2000, 2005 MySQL 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
# 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 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
AM_MAKEFLAGS="-j 2"
gmake -k maintainer-clean || true
/bin/rm -f */.deps/*.P config.cache

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2002, 2005 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"
@ -7,18 +22,3 @@ extra_flags="$pentium_cflags $debug_cflags $valgrind_flags"
extra_configs="$pentium_configs $debug_configs $valgrind_configs $max_configs"
. "$path/FINISH.sh"
if test -z "$just_print"
then
set +v +x
echo "\
******************************************************************************
Note that by default BUILD/compile-pentium-valgrind-max calls 'configure' with
--enable-assembler. When Valgrind detects an error involving an assembly
function (for example an uninitialized value used as an argument of an
assembly function), Valgrind will not print the stacktrace and 'valgrind
--gdb-attach=yes' will not work either. If you need a stacktrace in those
cases, you have to run BUILD/compile-pentium-valgrind-max with the
--disable-assembler argument.
******************************************************************************"
fi

View File

@ -1,5 +1,22 @@
#! /bin/sh
# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
#
# 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
path=`dirname $0`
. "$path/SETUP.sh"
@ -7,18 +24,3 @@ extra_flags="$pentium_cflags $debug_cflags $valgrind_flags"
extra_configs="$pentium_configs $debug_configs $valgrind_configs $max_no_ndb_configs"
. "$path/FINISH.sh"
if test -z "$just_print"
then
set +v +x
echo "\
******************************************************************************
Note that by default BUILD/compile-pentium-valgrind-max calls 'configure' with
--enable-assembler. When Valgrind detects an error involving an assembly
function (for example an uninitialized value used as an argument of an
assembly function), Valgrind will not print the stacktrace and 'valgrind
--gdb-attach=yes' will not work either. If you need a stacktrace in those
cases, you have to run BUILD/compile-pentium-valgrind-max with the
--disable-assembler argument.
******************************************************************************"
fi

View File

@ -1,5 +1,22 @@
#! /bin/sh
# Copyright (C) 2006, 2007 MySQL 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
path=`dirname $0`
. "$path/SETUP.sh"

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2005, 2007 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2005, 2007 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2007 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2007 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"

View File

@ -1,5 +1,22 @@
#! /bin/sh
# Copyright (C) 2007 MySQL 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
path=`dirname $0`
. "$path/SETUP.sh"

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2007 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2005 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"
@ -7,18 +22,3 @@ extra_flags="$pentium64_cflags $debug_cflags $valgrind_flags"
extra_configs="$pentium_configs $debug_configs $valgrind_configs $max_configs"
. "$path/FINISH.sh"
if test -z "$just_print"
then
set +v +x
echo "\
******************************************************************************
Note that by default BUILD/compile-pentium-valgrind-max calls 'configure' with
--enable-assembler. When Valgrind detects an error involving an assembly
function (for example an uninitialized value used as an argument of an
assembly function), Valgrind will not print the stacktrace and 'valgrind
--gdb-attach=yes' will not work either. If you need a stacktrace in those
cases, you have to run BUILD/compile-pentium-valgrind-max with the
--disable-assembler argument.
******************************************************************************"
fi

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2004 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2004 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2004, 2005 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2005 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2004, 2005 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"

View File

@ -1,5 +1,20 @@
#!/bin/sh
# Copyright (C) 2007 MySQL 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
# 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 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
path=`dirname $0`
. "$path/SETUP.sh"
extra_flags="$amd64_cflags -D__sun -m64 -mtune=athlon64 $debug_cflags"

View File

@ -10,6 +10,9 @@
# After installing, add /opt/SUNWspro/bin to your $PATH
gmake -k maintainer-clean || true
/bin/rm -f */.deps/*.P config.cache
path=`dirname $0`
. "$path/SETUP.sh"

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2000, 2005 MySQL 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
# 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 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
make -k clean || true
/bin/rm -f */.deps/*.P config.cache

View File

@ -1,5 +1,20 @@
#!/bin/sh
# Copyright (C) 2001, 2005 MySQL 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
# 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 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
make -k clean || true
/bin/rm -f */.deps/*.P config.cache

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2001, 2005 MySQL 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
# 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 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
# Assume Forte is installed in /opt/SUNWSpro and ld is installed in
# /usr/ccs/bin

View File

@ -1,5 +1,20 @@
#! /bin/sh
# Copyright (C) 2000, 2005 MySQL 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
# 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 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
mode=""
cxxfilt=""

View File

@ -1,4 +1,4 @@
# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
#
# 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
@ -61,6 +61,13 @@ SET(BUILDTYPE_DOCSTRING
IF(WITH_DEBUG)
SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING ${BUILDTYPE_DOCSTRING} FORCE)
SET(MYSQL_MAINTAINER_MODE ON CACHE BOOL
"MySQL maintainer-specific development environment")
IF(UNIX AND NOT APPLE)
# Compiling with PIC speeds up embedded build, on PIC sensitive systems
# Predefine it to ON, in case user chooses to build embedded.
SET(WITH_PIC ON CACHE BOOL "Compile with PIC")
ENDIF()
SET(OLD_WITH_DEBUG 1 CACHE INTERNAL "" FORCE)
ELSEIF(NOT HAVE_CMAKE_BUILD_TYPE OR OLD_WITH_DEBUG)
IF(CUSTOM_C_FLAGS)
@ -72,12 +79,12 @@ ELSEIF(NOT HAVE_CMAKE_BUILD_TYPE OR OLD_WITH_DEBUG)
SET(OLD_WITH_DEBUG 0 CACHE INTERNAL "" FORCE)
ENDIF()
IF(BUILD_CONFIG)
SET(CMAKE_USER_MAKE_RULES_OVERRIDE
${CMAKE_SOURCE_DIR}/cmake/build_configurations/${BUILD_CONFIG}.cmake)
ENDIF()
PROJECT(MySQL)
IF(BUILD_CONFIG)
INCLUDE(
${CMAKE_SOURCE_DIR}/cmake/build_configurations/${BUILD_CONFIG}.cmake)
ENDIF()
# Include the platform-specific file. To allow exceptions, this code
# looks for files in order of how specific they are. If there is, for
@ -108,21 +115,24 @@ ENDIF()
# Control aspects of the development environment which are
# specific to MySQL maintainers and developers.
#
OPTION(MYSQL_MAINTAINER_MODE "MySQL maintainer-specific development environment" OFF)
# Whether the maintainer mode should be enabled.
INCLUDE(maintainer)
OPTION(MYSQL_MAINTAINER_MODE
"MySQL maintainer-specific development environment" OFF)
# Whether the maintainer mode compiler options should be enabled.
IF(MYSQL_MAINTAINER_MODE)
IF(CMAKE_COMPILER_IS_GNUCC)
SET(MY_MAINTAINER_C_WARNINGS
"-Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing -Werror"
CACHE STRING "C warning options used in maintainer builds.")
IF(CMAKE_C_COMPILER_ID MATCHES "GNU")
SET_MYSQL_MAINTAINER_GNU_C_OPTIONS()
ENDIF()
IF(CMAKE_COMPILER_IS_GNUCXX)
SET(MY_MAINTAINER_CXX_WARNINGS "${MY_MAINTAINER_C_WARNINGS} -Wno-unused-parameter"
CACHE STRING "C++ warning options used in maintainer builds.")
IF(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
SET_MYSQL_MAINTAINER_GNU_CXX_OPTIONS()
ENDIF()
# Do not make warnings in checks into errors.
IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Wno-error")
IF(CMAKE_C_COMPILER_ID MATCHES "Intel")
SET_MYSQL_MAINTAINER_INTEL_C_OPTIONS()
ENDIF()
IF(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
SET_MYSQL_MAINTAINER_INTEL_CXX_OPTIONS()
ENDIF()
ENDIF()
@ -162,6 +172,13 @@ IF(ENABLE_DEBUG_SYNC)
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DENABLED_DEBUG_SYNC")
ENDIF()
OPTION(ENABLE_GCOV "Enable gcov (debug, Linux builds only)" OFF)
IF (ENABLE_GCOV AND NOT WIN32 AND NOT APPLE)
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage")
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage -lgcov")
ENDIF()
OPTION(ENABLED_LOCAL_INFILE
"If we should should enable LOAD DATA LOCAL by default" ${IF_WIN})
MARK_AS_ADVANCED(ENABLED_LOCAL_INFILE)
@ -307,6 +324,24 @@ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/mysql_version.h.in
${CMAKE_BINARY_DIR}/include/mysql_version.h )
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc.in
${CMAKE_BINARY_DIR}/sql/sql_builtin.cc)
CONFIGURE_FILE(
${CMAKE_SOURCE_DIR}/cmake/info_macros.cmake.in ${CMAKE_BINARY_DIR}/info_macros.cmake @ONLY)
# Handle the "INFO_*" files.
INCLUDE(${CMAKE_BINARY_DIR}/info_macros.cmake)
# Source: This can be done during the cmake phase, all information is
# available, but should be repeated on each "make" just in case someone
# does "cmake ; make ; bzr pull ; make".
CREATE_INFO_SRC(${CMAKE_BINARY_DIR}/Docs)
ADD_CUSTOM_TARGET(INFO_SRC ALL
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/cmake/info_src.cmake
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
# Build flags: This must be postponed to the make phase.
ADD_CUSTOM_TARGET(INFO_BIN ALL
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/cmake/info_bin.cmake
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
# Packaging
IF(WIN32)
@ -315,23 +350,34 @@ ELSE()
SET(CPACK_GENERATOR "TGZ")
ENDIF()
ADD_SUBDIRECTORY(packaging/WiX)
# Create a single package with "make package"
# (see http://public.kitware.com/Bug/view.php?id=11452)
SET(CPACK_MONOLITHIC_INSTALL 1 CACHE INTERNAL "")
INCLUDE(CPack)
IF(UNIX)
INSTALL(FILES Docs/mysql.info DESTINATION ${INSTALL_INFODIR} OPTIONAL)
INSTALL(FILES Docs/mysql.info DESTINATION ${INSTALL_INFODIR} OPTIONAL COMPONENT Info)
ENDIF()
#
# RPM installs documentation directly from the source tree
#
IF(NOT INSTALL_LAYOUT MATCHES "RPM")
INSTALL(FILES COPYING EXCEPTIONS-CLIENT LICENSE.mysql DESTINATION ${INSTALL_DOCREADMEDIR} OPTIONAL)
INSTALL(FILES README DESTINATION ${INSTALL_DOCREADMEDIR})
INSTALL(FILES COPYING LICENSE.mysql
DESTINATION ${INSTALL_DOCREADMEDIR}
COMPONENT Readme
OPTIONAL
)
INSTALL(FILES README DESTINATION ${INSTALL_DOCREADMEDIR} COMPONENT Readme)
INSTALL(FILES ${CMAKE_BINARY_DIR}/Docs/INFO_SRC ${CMAKE_BINARY_DIR}/Docs/INFO_BIN DESTINATION ${INSTALL_DOCDIR})
IF(UNIX)
INSTALL(FILES Docs/INSTALL-BINARY DESTINATION ${INSTALL_DOCREADMEDIR})
INSTALL(FILES Docs/INSTALL-BINARY DESTINATION ${INSTALL_DOCREADMEDIR} COMPONENT Readme)
ENDIF()
# MYSQL_DOCS_LOCATON is used in "make dist", points to the documentation directory
SET(MYSQL_DOCS_LOCATION "" CACHE PATH "Location from where documentation is copied")
MARK_AS_ADVANCED(MYSQL_DOCS_LOCATION)
INSTALL(DIRECTORY Docs/ DESTINATION ${INSTALL_DOCDIR}
COMPONENT Documentation
PATTERN "INSTALL-BINARY" EXCLUDE
PATTERN "Makefile.*" EXCLUDE
PATTERN "glibc*" EXCLUDE

View File

@ -1,39 +0,0 @@
# Copyright (C) 2000-2006 MySQL 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
# 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 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
EXTRA_DIST = mysql.info INSTALL-BINARY @extra_docs@
# make sure that "make install" installs the info page, too
# automake only seems to take care of this automatically,
# if we're building the info page from texi directly.
install-data-hook: $(srcdir)/mysql.info
if test `basename $(prefix)` = "mysql" ; then \
$(mkinstalldirs) $(DESTDIR)$(prefix)/docs ; \
$(INSTALL_DATA) $(srcdir)/mysql.info $(DESTDIR)$(prefix)/docs ; \
test ! -f $(top_srcdir)/ChangeLog || $(INSTALL_DATA) $(top_srcdir)/ChangeLog $(DESTDIR)$(prefix)/docs ; \
else \
$(mkinstalldirs) $(DESTDIR)$(infodir) $(DESTDIR)$(pkgdatadir) ; \
$(INSTALL_DATA) $(srcdir)/mysql.info $(DESTDIR)$(infodir) ; \
test ! -f $(top_srcdir)/ChangeLog || $(INSTALL_DATA) $(top_srcdir)/ChangeLog $(DESTDIR)$(pkgdatadir) ; \
fi
uninstall-local:
if test `basename $(prefix)` = "mysql" ; then \
@RM@ -f $(DESTDIR)$(prefix)/docs/mysql.info ; \
@RM@ -f $(DESTDIR)$(prefix)/docs/ChangeLog ; \
else \
@RM@ -f $(DESTDIR)$(infodir)/mysql.info ; \
@RM@ -f $(DESTDIR)$(pkgdatadir)/ChangeLog ; \
fi

View File

@ -1,119 +0,0 @@
MySQL FLOSS License Exception
The MySQL AB Exception for Free/Libre and Open Source
Software-only Applications Using MySQL Client Libraries (the
"FLOSS Exception").
Version 0.6, 7 March 2007
Exception Intent
We want specified Free/Libre and Open Source Software (``FLOSS'')
applications to be able to use specified GPL-licensed MySQL client
libraries (the ``Program'') despite the fact that not all FLOSS
licenses are compatible with version 2 of the GNU General Public
License (the ``GPL'').
Legal Terms and Conditions
As a special exception to the terms and conditions of version 2.0
of the GPL:
1. You are free to distribute a Derivative Work that is formed
entirely from the Program and one or more works (each, a
"FLOSS Work") licensed under one or more of the licenses
listed below in section 1, as long as:
a. You obey the GPL in all respects for the Program and the
Derivative Work, except for identifiable sections of the
Derivative Work which are not derived from the Program,
and which can reasonably be considered independent and
separate works in themselves,
b. all identifiable sections of the Derivative Work which
are not derived from the Program, and which can
reasonably be considered independent and separate works
in themselves,
i. are distributed subject to one of the FLOSS licenses
listed below, and
ii. the object code or executable form of those sections
are accompanied by the complete corresponding
machine-readable source code for those sections on
the same medium and under the same FLOSS license as
the corresponding object code or executable forms of
those sections, and
c. any works which are aggregated with the Program or with a
Derivative Work on a volume of a storage or distribution
medium in accordance with the GPL, can reasonably be
considered independent and separate works in themselves
which are not derivatives of either the Program, a
Derivative Work or a FLOSS Work.
If the above conditions are not met, then the Program may only
be copied, modified, distributed or used under the terms and
conditions of the GPL or another valid licensing option from
MySQL AB.
2. FLOSS License List
License name Version(s)/Copyright Date
Academic Free License 2.0
Apache Software License 1.0/1.1/2.0
Apple Public Source License 2.0
Artistic license From Perl 5.8.0
BSD license "July 22 1999"
Common Development and Distribution License (CDDL) 1.0
Common Public License 1.0
Eclipse Public License 1.0
GNU Library or "Lesser" General Public License (LGPL) 2.0/2.1
Jabber Open Source License 1.0
MIT license (As listed in file MIT-License.txt) ---
Mozilla Public License (MPL) 1.0/1.1
Open Software License 2.0
OpenSSL license (with original SSLeay license) "2003" ("1998")
PHP License 3.0
Python license (CNRI Python License) ---
Python Software Foundation License 2.1.1
Sleepycat License "1999"
University of Illinois/NCSA Open Source License ---
W3C License "2001"
X11 License "2001"
Zlib/libpng License ---
Zope Public License 2.0
Due to the many variants of some of the above licenses, we
require that any version follow the 2003 version of the Free
Software Foundation's Free Software Definition
(http://www.gnu.org/philosophy/free-sw.html) or version 1.9 of
the Open Source Definition by the Open Source Initiative
(http://www.opensource.org/docs/definition.php).
3. Definitions
a. Terms used, but not defined, herein shall have the
meaning provided in the GPL.
b. Derivative Work means a derivative work under copyright
law.
4. Applicability: This FLOSS Exception applies to all Programs
that contain a notice placed by MySQL AB saying that the
Program may be distributed under the terms of this FLOSS
Exception. If you create or distribute a work which is a
Derivative Work of both the Program and any other work
licensed under the GPL, then this FLOSS Exception is not
available for that work; thus, you must remove the FLOSS
Exception notice from that work and comply with the GPL in all
respects, including by retaining all GPL notices. You may
choose to redistribute a copy of the Program exclusively under
the terms of the GPL by removing the FLOSS Exception notice
from that copy of the Program, provided that the copy has
never been modified by you or any third party.
Appendix A. Qualified Libraries and Packages
The following is a non-exhaustive list of libraries and packages
which are covered by the FLOSS License Exception. Please note that
this appendix is provided merely as an additional service to
specific FLOSS projects wishing to simplify licensing information
for their users. Compliance with one of the licenses noted under
the "FLOSS license list" section remains a prerequisite.
Package Name Qualifying License and Version
Apache Portable Runtime (APR) Apache Software License 2.0

View File

@ -1,347 +0,0 @@
# Copyright 2000-2008 MySQL AB, 2009 Sun Microsystems, 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; 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 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
# Process this file with automake to create Makefile.in
AUTOMAKE_OPTIONS = foreign
# These are built from source in the Docs directory
EXTRA_DIST = INSTALL-SOURCE INSTALL-WIN-SOURCE \
README COPYING EXCEPTIONS-CLIENT \
CMakeLists.txt configure.cmake config.h.cmake BUILD-CMAKE
SUBDIRS = . include @docs_dirs@ @zlib_dir@ \
@readline_topdir@ sql-common scripts \
@pstack_dir@ libservices \
@sql_union_dirs@ unittest \
@sql_server@ @man_dirs@ tests \
@libmysqld_dirs@ \
mysql-test support-files sql-bench \
win \
packaging \
cmake
DIST_SUBDIRS = . include Docs zlib \
cmd-line-utils sql-common scripts \
pstack libservices \
strings mysys dbug extra regex libmysql libmysql_r client unittest storage plugin \
vio sql man tests \
libmysqld \
mysql-test support-files sql-bench \
win \
cmake \
packaging \
BUILD
DISTCLEANFILES = ac_available_languages_fragment
# Create permission databases
init-db: all
$(top_builddir)/scripts/mysql_install_db
bin-dist: all
$(top_builddir)/scripts/make_binary_distribution @MAKE_BINARY_DISTRIBUTION_OPTIONS@
# Remove BK's "SCCS" subdirectories from source distribution
# Create initial database files for Windows installations and check them.
dist-hook:
mkdir -p $(distdir)/win
scripts/mysql_install_db --no-defaults --cross-bootstrap \
--builddir=$(top_builddir) \
--datadir=$(distdir)/win/data \
--srcdir=$(top_srcdir)
storage/myisam/myisamchk --silent --fast $(distdir)/win/data/mysql/*.MYI
test ! -f $(top_srcdir)/configure.am || \
$(INSTALL_DATA) $(top_srcdir)/configure.am $(distdir)
# Simple target to allow scripts etc. to get the name of the source
# tarball easily.
show-dist-name:
@echo "$(PACKAGE)-$(VERSION)"
all-local: @ABI_CHECK@
tags:
support-files/build-tags
.PHONY: init-db bin-dist \
test test-force test-full test-force-full test-force-mem \
test-pl test-force-pl test-full-pl test-force-full-pl test-force-pl-mem \
test-unit test-unit-big test-ps test-nr test-pr test-ns test-binlog-statement \
test-ext-funcs test-ext-rpl test-ext-partitions test-ext-jp \
test-ext-stress test-ext test-embedded test-reprepare \
test-fast test-fast-cursor test-fast-view test-fast-prepare \
test-full-qa
# Target 'test' will run the regression test suite using the built server.
#
# If you are running in a shared environment, users can avoid clashing
# port numbers by setting individual small numbers 1-100 to the
# environment variable MTR_BUILD_THREAD. The script "mysql-test-run"
# will then calculate the various port numbers it needs from this,
# making sure each user use different ports.
#
# Set MTR_EXTRA_OPTIONS to add custom options for mysql-test-run,
# like MTR_EXTRA_OPTIONS"--parallel=3 --mem".
test-unit:
cd unittest; $(MAKE) test
test-unit-big:
cd unittest; MYTAP_CONFIG=big $(MAKE) test
test-ps:
cd mysql-test ; \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) $(force) --ps-protocol --mysqld=--binlog-format=mixed
test-nr:
cd mysql-test ; \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) $(force) --mysqld=--binlog-format=row
test-pr:
cd mysql-test ; \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) $(force) $(mem) --ps-protocol --mysqld=--binlog-format=row #@libevent_test_option@
test-ns:
cd mysql-test ; \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) $(force) $(mem) --mysqld=--binlog-format=mixed ; \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) $(force) $(mem) --suite=funcs_1
test-binlog-statement:
cd mysql-test ; \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) $(force) --mysqld=--binlog-format=statement
# This code is duplicated in "test-bt", see the Changeset comment of 2007-Dec-07
test-embedded:
if [ -e bin/mysqltest_embedded -o -e libmysqld/examples/mysqltest_embedded ] ; then \
cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=embedded --force --timer \
--embedded-server --skip-rpl --skip-ndbcluster ; \
else \
echo "no program found for 'embedded' tests - skipped testing" ; \
fi
test-reprepare:
cd mysql-test ; \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) $(force) $(mem) --ps-protocol \
--mysqld=--debug=+d,reprepare_each_statement
test: test-ns test-pr
smoke:
cd mysql-test ; \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --do-test=s
test-full: test test-nr test-ps
test-force:
$(MAKE) -k force=--force test
test-force-full:
$(MAKE) -k force=--force test-full
#used by autopush.pl to run memory based tests
test-force-mem:
$(MAKE) -k force=--force mem=--mem test
EXP = --experimental=collections/default.experimental
test-bt:
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=normal --force --timer \
--skip-ndbcluster --report-features $(EXP)
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=ps --force --timer \
--skip-ndbcluster --ps-protocol $(EXP)
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --comment=PBXT --mysqld=--default-storage-engine=pbxt --suite=pbxt $(EXP)
-if [ -e bin/ndbd -o -e storage/ndb/src/kernel/ndbd ] ; then \
cd mysql-test ; \
MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=ndb+ps --force --timer \
--ps-protocol --mysqld=--binlog-format=row --suite=ndb $(EXP) ; \
MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=ndb --force --timer \
--with-ndbcluster-only $(EXP) ; \
else \
echo "no program found for 'ndbcluster' tests - skipped testing" ; \
fi
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --comment=funcs1+ps --ps-protocol --reorder --suite=funcs_1 $(EXP)
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --comment=funcs2 --suite=funcs_2 $(EXP)
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --comment=partitions --suite=parts $(EXP)
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --comment=stress --suite=stress $(EXP)
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --comment=jp --suite=jp $(EXP)
-if [ -d mysql-test/suite/nist ] ; then \
cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=nist --force --suite=nist $(EXP) ; \
fi
-if [ -d mysql-test/suite/nist ] ; then \
cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=nist+ps --force --suite=nist --ps-protocol $(EXP) ; \
fi
-if [ -e bin/mysqltest_embedded -o -e libmysqld/examples/mysqltest_embedded ] ; then \
cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=embedded --force --timer \
--embedded-server --skip-rpl --skip-ndbcluster $(EXP) ; \
else \
echo "no program found for 'embedded' tests - skipped testing" ; \
fi
test-bt-fast:
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl --comment=ps --force --timer \
--skip-ndbcluster --ps-protocol --report-features $(EXP)
-if [ -e bin/ndbd -o -e storage/ndb/src/kernel/ndbd ] ; then \
cd mysql-test ; \
MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=ndb --force --timer \
--with-ndbcluster-only $(EXP) ; \
else \
echo "no program found for 'ndbcluster' tests - skipped testing" ; \
fi
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --comment=stress --suite=stress $(EXP)
test-bt-debug:
-cd mysql-test ; MTR_BUILD_THREAD=auto \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --comment=debug --force --timer \
--skip-ndbcluster --skip-rpl --report-features $(EXP)
# Keep these for a while
test-pl: test
test-full-pl: test-full
test-force-pl: test-force
test-force-pl-mem: test-force-mem
test-force-full-pl: test-force-full
test-ext-funcs:
cd mysql-test ; \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --reorder --suite=funcs_1 ; \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --suite=funcs_2
test-ext-rpl:
cd mysql-test ; \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --suite=rpl
test-ext-partitions:
cd mysql-test ; \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --suite=parts
test-ext-jp:
cd mysql-test ; \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --suite=jp
test-ext-stress:
cd mysql-test ; \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) --force --big-test --suite=stress
test-ext: test-ext-funcs test-ext-rpl test-ext-partitions test-ext-jp test-ext-stress
test-fast:
cd mysql-test ; \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) $(subset) --force --skip-ndb --skip-innodb --skip-im --skip-rpl ; \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) $(subset) --force --suite=funcs_1 --do-test=myisam ; \
@PERL@ ./mysql-test-run.pl $(MTR_EXTRA_OPTIONS) $(subset) --force --suite=stress --do-test=ddl_myisam
test-fast-view:
$(MAKE) subset=--view-protocol test-fast
test-fast-cursor:
$(MAKE) subset=--cursor-protocol test-fast
test-fast-prepare:
$(MAKE) subset=--ps-protocol test-fast
test-full-qa:
$(MAKE) -k force=--force test-pr \
test-binlog-statement test-ext test-fast-view \
test-fast-cursor test-unit
#
# Headers which need to be checked for abi/api compatibility.
#
API_PREPROCESSOR_HEADER = $(top_srcdir)/include/mysql/plugin_audit.h \
$(top_srcdir)/include/mysql/plugin_ftparser.h \
$(top_srcdir)/include/mysql/plugin_auth.h \
$(top_srcdir)/include/mysql/client_plugin.h \
$(top_srcdir)/include/mysql.h \
$(top_srcdir)/include/mysql/psi/psi_abi_v1.h \
$(top_srcdir)/include/mysql/psi/psi_abi_v2.h
#
# Rules for checking that the abi/api has not changed.
#
# The following steps are followed in the do_abi_check rule below
#
# 1) Generate preprocessor output for the files that need to
# be tested for abi/api changes. use -nostdinc to prevent
# generation of preprocessor output for system headers. This
# results in messages in stderr saying that these headers
# were not found. Redirect the stderr output to /dev/null
# to prevent seeing these messages.
# 2) sed the output to
# 2.1) remove blank lines and lines that begin with "# "
# 2.2) When gcc -E is run on the Mac OS and solaris sparc platforms it
# introduces a line of output that shows up as a difference between
# the .pp and .out files. Remove these OS specific preprocessor text
# inserted by the preprocessor.
# 3) diff the generated file and the canons (.pp files already in
# the repository).
# 4) delete the .out file that is generated.
#
# If the diff fails, the generated file is not removed. This will
# be useful for analysis of ABI differences (e.g. using a visual
# diff tool).
#
# A ABI change that causes a build to fail will always be accompanied
# by new canons (.out files). The .out files that are not removed will
# be replaced as the new .pp files.
#
# e.g. If include/mysql/plugin.h has an ABI change then this rule would
# leave a <build directory>/abi_check.out file.
#
# A developer with a justified API change will then do a
# mv <build directory>/abi_check.out include/mysql/plugin.pp
# to replace the old canons with the new ones.
#
abi_check: $(API_PREPROCESSOR_HEADER)
$(MAKE) abi_headers="$^" do_abi_check
abi_check_all: abi_check
do_abi_check:
set -ex; \
for file in $(abi_headers); do \
@CC@ -E -nostdinc -dI -DMYSQL_ABI_CHECK \
-I$(top_srcdir)/include \
-I$(top_srcdir)/include/mysql \
-I$(top_srcdir)/sql \
-I$(top_builddir)/include \
-I$(top_builddir)/include/mysql \
-I$(top_builddir)/sql \
$$file 2>/dev/null | \
@SED@ -e '/^# /d' \
-e '/^[ ]*$$/d' \
-e '/^#pragma GCC set_debug_pwd/d' \
-e '/^#ident/d' > \
$(top_builddir)/abi_check.out; \
@DIFF@ -w $$file.pp $(top_builddir)/abi_check.out; \
@RM@ $(top_builddir)/abi_check.out; \
done

63
README
View File

@ -251,22 +251,19 @@ cmake-2.4.8/Utilities/cmzlib/zlib.h:
----------------------------------------------
This source code was modified by Martin Hedenfalk
for
use in Curl. His latest changes were done 2000-09-18.
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.
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) 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).
@ -2202,3 +2199,41 @@ Use of any of this software is governed by the terms of the license below:
*/
***************************************************************************
MySQL Server 5.5
This is a release of MySQL, a dual-license SQL database server.
For the avoidance of doubt, this particular copy of the software
is released under the version 2 of the GNU General Public License.
MySQL is brought to you by Oracle.
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
License information can be found in the COPYING file.
MySQL FOSS License Exception
We want free and open source software applications under certain
licenses to be able to use specified GPL-licensed MySQL client
libraries despite the fact that not all such FOSS licenses are
compatible with version 2 of the GNU General Public License.
Therefore there are special exceptions to the terms and conditions
of the GPLv2 as applied to these client libraries, which are
identified and described in more detail in the FOSS License
Exception at
<http://www.mysql.com/about/legal/licensing/foss-exception.html>.
This distribution may include materials developed by third
parties. For license and attribution notices for these
materials, please refer to the documentation that accompanies
this distribution (see the "Licenses for Third-Party Components"
appendix) or view the online documentation at
<http://dev.mysql.com/doc/>.
GPLv2 Disclaimer
For the avoidance of doubt, except that if any license choice
other than GPL or LGPL is available it will apply instead,
Oracle elects to use only the General Public License version 2
(GPLv2) at this time for any software where a choice of GPL
license versions is made available with the language indicating
that GPLv2 or any later version may be used, or where a choice
of which version of the GPL is applied is otherwise unspecified.

4
VERSION Normal file
View File

@ -0,0 +1,4 @@
MYSQL_VERSION_MAJOR=5
MYSQL_VERSION_MINOR=5
MYSQL_VERSION_PATCH=15
MYSQL_VERSION_EXTRA=

View File

@ -1,121 +0,0 @@
# Copyright (C) 2000-2006 MySQL 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
# 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 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
# This file is public domain and comes with NO WARRANTY of any kind
if THREAD_SAFE_CLIENT
LIBMYSQLCLIENT_LA = $(top_builddir)/libmysql_r/libmysqlclient_r.la
else
LIBMYSQLCLIENT_LA = $(top_builddir)/libmysql/libmysqlclient.la
endif
INCLUDES = -I$(top_builddir)/include \
-I$(top_srcdir)/include \
-I$(top_srcdir)/regex \
$(openssl_includes)
LIBS = @CLIENT_LIBS@
LDADD= @CLIENT_EXTRA_LDFLAGS@ $(CLIENT_THREAD_LIBS) \
$(top_builddir)/libmysql/libmysqlclient.la
noinst_HEADERS = sql_string.h completion_hash.h my_readline.h \
client_priv.h
EXTRA_DIST = get_password.c CMakeLists.txt echo.c
BUILT_SOURCES = link_sources
CLEANFILES = $(BUILT_SOURCES)
bin_PROGRAMS = mysql \
mysqladmin \
mysqlbinlog \
mysqlcheck \
mysqldump \
mysqlimport \
mysqlshow \
mysqlslap \
mysqltest \
mysql_upgrade
mysql_SOURCES = mysql.cc readline.cc sql_string.cc \
completion_hash.cc
mysql_LDADD = @readline_link@ @TERMCAP_LIB@ \
$(LDADD) $(CXXLDFLAGS)
mysqladmin_SOURCES = mysqladmin.cc
mysqlbinlog_SOURCES = mysqlbinlog.cc \
$(top_srcdir)/mysys/mf_tempdir.c \
$(top_srcdir)/mysys/my_new.cc \
$(top_srcdir)/mysys/my_bit.c \
$(top_srcdir)/mysys/my_bitmap.c \
$(top_srcdir)/mysys/base64.c
mysqlbinlog_CXXFLAGS= -I$(top_srcdir)/sql
mysqlbinlog_LDADD = $(LDADD) $(CXXLDFLAGS)
mysqldump_SOURCES= mysqldump.c \
my_user.c \
$(top_srcdir)/mysys/mf_getdate.c
mysqlimport_SOURCES= mysqlimport.c
mysqlimport_CFLAGS= -DTHREAD -UUNDEF_THREADS_HACK
mysqlimport_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \
@CLIENT_EXTRA_LDFLAGS@ \
$(LIBMYSQLCLIENT_LA) \
$(top_builddir)/mysys/libmysys.a
mysqlshow_SOURCES= mysqlshow.c
mysqlslap_SOURCES= mysqlslap.c
mysqlslap_CFLAGS= -DTHREAD -UMYSQL_CLIENT_NO_THREADS
mysqlslap_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \
@CLIENT_EXTRA_LDFLAGS@ \
$(LIBMYSQLCLIENT_LA) \
$(top_builddir)/mysys/libmysys.a
mysqltest_SOURCES= mysqltest.cc
mysqltest_CXXFLAGS= -DTHREAD -UMYSQL_CLIENT_NO_THREADS
mysqltest_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \
@CLIENT_EXTRA_LDFLAGS@ \
$(LIBMYSQLCLIENT_LA) \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/regex/libregex.a \
$(CLIENT_THREAD_LIBS)
mysql_upgrade_SOURCES= mysql_upgrade.c \
$(top_srcdir)/mysys/my_getpagesize.c
# Fix for mit-threads
DEFS = -DMYSQL_CLIENT_NO_THREADS \
-DDEFAULT_MYSQL_HOME='"$(prefix)"' \
-DMYSQL_DATADIR='"$(localstatedir)"'
sql_src=rpl_tblmap.cc log_event.cc my_decimal.cc log_event_old.cc \
rpl_record_old.cc rpl_utility.cc sql_list.cc rpl_filter.cc
strings_src=decimal.c dtoa.c
link_sources:
for f in $(sql_src) ; do \
rm -f $$f; \
@LN_CP_F@ $(top_srcdir)/sql/$$f $$f; \
done; \
for f in $(strings_src) ; do \
rm -f $(srcdir)/$$f; \
@LN_CP_F@ $(top_srcdir)/strings/$$f $$f; \
done; \
rm -f $(srcdir)/my_user.c; \
@LN_CP_F@ $(top_srcdir)/sql-common/my_user.c my_user.c;
echo timestamp > link_sources;

View File

@ -50,9 +50,6 @@ enum options_client
OPT_OPEN_FILES_LIMIT, OPT_SET_CHARSET, OPT_SERVER_ARG,
OPT_STOP_POSITION, OPT_START_DATETIME, OPT_STOP_DATETIME,
OPT_SIGINT_IGNORE, OPT_HEXBLOB, OPT_ORDER_BY_PRIMARY, OPT_COUNT,
#ifdef HAVE_NDBCLUSTER_DB
OPT_NDBCLUSTER, OPT_NDB_CONNECTSTRING,
#endif
OPT_TRIGGERS,
OPT_MYSQL_ONLY_PRINT,
OPT_MYSQL_LOCK_DIRECTORY,
@ -78,16 +75,17 @@ enum options_client
OPT_SLAP_POST_SYSTEM,
OPT_SLAP_COMMIT,
OPT_SLAP_DETACH,
OPT_SLAP_NO_DROP,
OPT_MYSQL_REPLACE_INTO, OPT_BASE64_OUTPUT_MODE, OPT_SERVER_ID,
OPT_FIX_TABLE_NAMES, OPT_FIX_DB_NAMES, OPT_SSL_VERIFY_SERVER_CERT,
OPT_AUTO_VERTICAL_OUTPUT,
OPT_DEBUG_INFO, OPT_DEBUG_CHECK, OPT_COLUMN_TYPES, OPT_ERROR_LOG_FILE,
OPT_WRITE_BINLOG, OPT_DUMP_DATE,
OPT_INIT_COMMAND,
OPT_PLUGIN_DIR,
OPT_DEFAULT_AUTH,
OPT_ABORT_SOURCE_ON_ERROR,
OPT_REWRITE_DB,
OPT_PLUGIN_DIR,
OPT_DEFAULT_PLUGIN,
OPT_MAX_CLIENT_OPTION /* should be always the last */
};

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

@ -28,11 +28,13 @@ typedef struct st_line_buffer
uint eof;
ulong max_size;
ulong read_length; /* Length of last read string */
int error;
bool truncated;
} LINE_BUFFER;
extern LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file);
extern LINE_BUFFER *batch_readline_command(LINE_BUFFER *buffer, char * str);
extern char *batch_readline(LINE_BUFFER *buffer, bool *truncated);
extern char *batch_readline(LINE_BUFFER *buffer);
extern void batch_readline_end(LINE_BUFFER *buffer);
#endif /* CLIENT_MY_READLINE_INCLUDED */

View File

@ -15,10 +15,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#define COPYRIGHT_NOTICE "\
This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n\
and you are welcome to modify and redistribute it under the GPL v2 license\n"
/* mysql command tool
* Commands compatible with mSQL by David J. Hughes
*
@ -111,6 +107,7 @@ extern "C" {
#endif
#include "completion_hash.h"
#include <welcome_copyright_notice.h> // ORACLE_WELCOME_COPYRIGHT_NOTICE
#define PROMPT_CHAR '\\'
#define DEFAULT_DELIMITER ";"
@ -169,7 +166,7 @@ static int wait_time = 5;
static STATUS status;
static ulong select_limit,max_join_size,opt_connect_timeout=0;
static char mysql_charsets_dir[FN_REFLEN+1];
static char *opt_plugin_dir= 0, *opt_default_auth;
static char *opt_plugin_dir= 0, *opt_default_auth= 0;
static const char *xmlmeta[] = {
"&", "&amp;",
"<", "&lt;",
@ -1135,6 +1132,8 @@ int main(int argc,char *argv[])
if (status.batch && !status.line_buff &&
!(status.line_buff= batch_readline_init(MAX_BATCH_BUFFER_SIZE, stdin)))
{
put_info("Can't initialize batch_readline - may be the input source is "
"a directory or a block device.", INFO_ERROR, 0);
free_defaults(defaults_argv);
my_end(0);
exit(1);
@ -1182,7 +1181,7 @@ int main(int argc,char *argv[])
mysql_thread_id(&mysql), server_version_string(&mysql));
put_info((char*) glob_buffer.ptr(),INFO_INFO);
put_info(COPYRIGHT_NOTICE, INFO_INFO);
put_info(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"), INFO_INFO);
#ifdef HAVE_READLINE
initialize_readline((char*) my_progname);
@ -1474,8 +1473,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,
@ -1580,11 +1579,11 @@ static struct my_option my_long_options[] =
&show_warnings, &show_warnings, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
(uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0,
&opt_plugin_dir, &opt_plugin_dir, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"default_auth", OPT_PLUGIN_DIR,
{"default_auth", OPT_DEFAULT_AUTH,
"Default authentication client-side plugin to use.",
(uchar**) &opt_default_auth, (uchar**) &opt_default_auth, 0,
&opt_default_auth, &opt_default_auth, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@ -1609,7 +1608,7 @@ static void usage(int version)
if (version)
return;
printf("%s", COPYRIGHT_NOTICE);
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
printf("Usage: %s [OPTIONS] [database]\n", my_progname);
my_print_help(my_long_options);
print_defaults("my", load_default_groups);
@ -1860,14 +1859,13 @@ static int read_and_execute(bool interactive)
ulong line_number=0;
bool ml_comment= 0;
COMMANDS *com;
bool truncated= 0;
status.exit_status=1;
while (!aborted)
{
if (!interactive)
{
line=batch_readline(status.line_buff, &truncated);
line=batch_readline(status.line_buff);
/*
Skip UTF8 Byte Order Marker (BOM) 0xEFBBBF.
Editors like "notepad" put this marker in
@ -1930,9 +1928,13 @@ static int read_and_execute(bool interactive)
if (opt_outfile && line)
fprintf(OUTFILE, "%s\n", line);
}
if (!line) // End of file
// End of file or system error
if (!line)
{
status.exit_status=0;
if (status.line_buff && status.line_buff->error)
status.exit_status= 1;
else
status.exit_status= 0;
break;
}
@ -1953,7 +1955,8 @@ static int read_and_execute(bool interactive)
#endif
continue;
}
if (add_line(glob_buffer,line,&in_string,&ml_comment, truncated))
if (add_line(glob_buffer, line, &in_string, &ml_comment,
status.line_buff ? status.line_buff->truncated : 0))
break;
}
/* if in batch mode, send last query even if it doesn't end with \g or go */
@ -2718,6 +2721,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);
current_db= NULL;
/* In case of error below current_db will be NULL */
@ -3760,7 +3767,8 @@ print_tab_data(MYSQL_RES *result)
}
static int
com_tee(String *buffer, char *line __attribute__((unused)))
com_tee(String *buffer __attribute__((unused)),
char *line __attribute__((unused)))
{
char file_name[FN_REFLEN], *end, *param;
@ -3819,7 +3827,8 @@ com_notee(String *buffer __attribute__((unused)),
#ifdef USE_POPEN
static int
com_pager(String *buffer, char *line __attribute__((unused)))
com_pager(String *buffer __attribute__((unused)),
char *line __attribute__((unused)))
{
char pager_name[FN_REFLEN], *end, *param;
@ -3949,7 +3958,8 @@ com_rehash(String *buffer __attribute__((unused)),
#ifdef USE_POPEN
static int
com_shell(String *buffer, char *line __attribute__((unused)))
com_shell(String *buffer __attribute__((unused)),
char *line __attribute__((unused)))
{
char *shell_cmd;
@ -4041,7 +4051,8 @@ com_connect(String *buffer, char *line)
}
static int com_source(String *buffer, char *line)
static int com_source(String *buffer __attribute__((unused)),
char *line)
{
char source_name[FN_REFLEN], *end, *param;
LINE_BUFFER *line_buff;
@ -4395,8 +4406,8 @@ sql_real_connect(char *host,char *database,char *user,char *password,
mysql_options(&mysql, MYSQL_DEFAULT_AUTH, opt_default_auth);
if (!mysql_real_connect(&mysql, host, user, password,
database, opt_mysql_port, opt_mysql_unix_port,
connect_flag | CLIENT_MULTI_STATEMENTS))
database, opt_mysql_port, opt_mysql_unix_port,
connect_flag | CLIENT_MULTI_STATEMENTS))
{
if (!silent ||
(mysql_errno(&mysql) != CR_CONN_HOST_ERROR &&
@ -5032,7 +5043,8 @@ static void init_username()
}
}
static int com_prompt(String *buffer, char *line)
static int com_prompt(String *buffer __attribute__((unused)),
char *line)
{
char *ptr=strchr(line, ' ');
prompt_counter = 0;

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2000 MySQL AB
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
Copyright (C) 2010 Monty Program Ab
This program is free software; you can redistribute it and/or modify
@ -18,6 +18,8 @@
#include <sslopt-vars.h>
#include "../scripts/mysql_fix_privilege_tables_sql.c"
#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
#define VER "1.2"
#ifdef HAVE_SYS_WAIT_H
@ -45,6 +47,8 @@ static DYNAMIC_STRING ds_args;
static DYNAMIC_STRING conn_args;
static char *opt_password= 0;
static char *opt_plugin_dir= 0, *opt_default_auth= 0;
static my_bool tty_password= 0;
static char opt_tmpdir[FN_REFLEN] = "";
@ -92,6 +96,10 @@ static struct my_option my_long_options[]=
{"default-character-set", OPT_DEFAULT_CHARSET,
"Not used by mysql_upgrade. Only for backward compatibility.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"default_auth", OPT_DEFAULT_AUTH,
"Default authentication client-side plugin to use.",
&opt_default_auth, &opt_default_auth, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"force", 'f', "Force execution of mysqlcheck even if mysql_upgrade "
"has already been executed for the current version of MySQL.",
&opt_force, &opt_force, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
@ -105,6 +113,9 @@ static struct my_option my_long_options[]=
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0,
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
&opt_plugin_dir, &opt_plugin_dir, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"port", 'P', "Port number to use for connection or 0 for default to, in "
"order of preference, my.cnf, $MYSQL_TCP_PORT, "
#if MYSQL_PORT_DEFAULT == 0
@ -238,7 +249,8 @@ get_one_option(int optid, const struct my_option *opt,
case '?':
printf("%s Ver %s Distrib %s, for %s (%s)\n",
my_progname, VER, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE);
puts("MySQL utility for upgrading databases to new MySQL versions.\n");
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
puts("MariaDB utility for upgrading databases to new MariaDB versions.\n");
my_print_help(my_long_options);
exit(0);
break;
@ -301,6 +313,8 @@ get_one_option(int optid, const struct my_option *opt,
case 'S': /* --socket */
case OPT_MYSQL_PROTOCOL: /* --protocol */
case OPT_SHARED_MEMORY_BASE_NAME: /* --shared-memory-base-name */
case OPT_PLUGIN_DIR: /* --plugin-dir */
case OPT_DEFAULT_AUTH: /* --default-auth */
add_one_option(&conn_args, opt, argument);
break;
}

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2000-2006 MySQL AB
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@ -17,12 +17,11 @@
#include "client_priv.h"
#include <signal.h>
#ifdef THREAD
#include <my_pthread.h> /* because of signal() */
#endif
#include <sys/stat.h>
#include <mysql.h>
#include <sql_common.h>
#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
#define ADMIN_VERSION "9.0"
#define MAX_MYSQL_VAR 512
@ -43,6 +42,7 @@ static uint tcp_port = 0, option_wait = 0, option_silent=0, nr_iterations;
static uint opt_count_iterations= 0, my_end_arg;
static ulong opt_connect_timeout, opt_shutdown_timeout;
static char * unix_port=0;
static char *opt_plugin_dir= 0, *opt_default_auth= 0;
#ifdef HAVE_SMEM
static char *shared_memory_base_name=0;
@ -211,6 +211,13 @@ static struct my_option my_long_options[] =
{"shutdown_timeout", OPT_SHUTDOWN_TIMEOUT, "", &opt_shutdown_timeout,
&opt_shutdown_timeout, 0, GET_ULONG, REQUIRED_ARG,
SHUTDOWN_DEF_TIMEOUT, 0, 3600*12, 0, 1, 0},
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
&opt_plugin_dir, &opt_plugin_dir, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"default_auth", OPT_DEFAULT_AUTH,
"Default authentication client-side plugin to use.",
&opt_default_auth, &opt_default_auth, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@ -347,6 +354,12 @@ int main(int argc,char *argv[])
mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset);
error_flags= (myf)(opt_nobeep ? 0 : ME_BELL);
if (opt_plugin_dir && *opt_plugin_dir)
mysql_options(&mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir);
if (opt_default_auth && *opt_default_auth)
mysql_options(&mysql, MYSQL_DEFAULT_AUTH, opt_default_auth);
if (sql_connect(&mysql, option_wait))
{
/*
@ -362,7 +375,8 @@ int main(int argc,char *argv[])
/* Return 0 if all commands are PING */
for (; argc > 0; argv++, argc--)
{
if (find_type(argv[0], &command_typelib, 2) != ADMIN_PING)
if (find_type(argv[0], &command_typelib, FIND_TYPE_BASIC) !=
ADMIN_PING)
{
error= 1;
break;
@ -406,6 +420,9 @@ int main(int argc,char *argv[])
if (interval) /* --sleep=interval given */
{
if (opt_count_iterations && --nr_iterations == 0)
break;
/*
If connection was dropped (unintentionally, or due to SHUTDOWN),
re-establish it if --wait ("retry-connect") was given and user
@ -583,7 +600,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
for (; argc > 0 ; argv++,argc--)
{
int command;
switch ((command= find_type(argv[0],&command_typelib,2))) {
switch ((command= find_type(argv[0],&command_typelib,FIND_TYPE_BASIC))) {
case ADMIN_CREATE:
{
char buff[FN_REFLEN+20];
@ -681,9 +698,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
case ADMIN_VER:
new_line=1;
print_version();
puts("Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc,\n"
"2009 Monty Program Ab");
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
printf("Server version\t\t%s\n", mysql_get_server_info(mysql));
printf("Protocol version\t%d\n", mysql_get_proto_info(mysql));
printf("Connection\t\t%s\n",mysql_get_host_info(mysql));
@ -1001,7 +1016,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
if (typed_password[0])
{
bool old= (find_type(argv[0], &command_typelib, 2) ==
bool old= (find_type(argv[0], &command_typelib, FIND_TYPE_BASIC) ==
ADMIN_OLD_PASSWORD);
#ifdef __WIN__
size_t pw_len= strlen(typed_password);
@ -1155,9 +1170,7 @@ static void print_version(void)
static void usage(void)
{
print_version();
puts("Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc,\n"
"2009 Monty Program Ab");
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
puts("Administration program for the mysqld daemon.");
printf("Usage: %s [OPTIONS] command command....\n", my_progname);
my_print_help(my_long_options);

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2001-2004 MySQL AB
/* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
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
@ -35,6 +35,7 @@
#include "sql_priv.h"
#include "log_event.h"
#include "sql_common.h"
#include <welcome_copyright_notice.h> // ORACLE_WELCOME_COPYRIGHT_NOTICE
/* Needed for Rpl_filter */
CHARSET_INFO* system_charset_info= &my_charset_utf8_general_ci;
@ -88,6 +89,8 @@ static char* host = 0;
static int port= 0;
static uint my_end_arg;
static const char* sock= 0;
static char *opt_plugin_dir= 0, *opt_default_auth= 0;
#ifdef HAVE_SMEM
static char *shared_memory_base_name= 0;
#endif
@ -757,10 +760,18 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
*/
start_datetime= 0;
offset= 0; // print everything and protect against cycling rec_count
/*
Skip events according to the --server-id flag. However, don't
skip format_description or rotate events, because they they
are really "global" events that are relevant for the entire
binlog, even if they have a server_id. Also, we have to read
the format_description event so that we can parse subsequent
events.
*/
if (ev_type != ROTATE_EVENT &&
server_id && (server_id != ev->server_id))
goto end;
}
if (server_id && (server_id != ev->server_id))
/* skip just this event, continue processing the log. */
goto end;
if (((my_time_t)(ev->when) >= stop_datetime)
|| (pos >= stop_position_mot))
{
@ -1012,7 +1023,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
passed --short-form, because --short-form disables printing
row events.
*/
if (!print_event_info->printed_fd_event && !short_form)
if (!print_event_info->printed_fd_event && !short_form &&
opt_base64_output_mode != BASE64_OUTPUT_DECODE_ROWS)
{
const char* type_str= ev->get_type_str();
if (opt_base64_output_mode == BASE64_OUTPUT_NEVER)
@ -1068,10 +1080,11 @@ static struct my_option my_long_options[] =
"row-based events; 'decode-rows' decodes row events into commented SQL "
"statements if the --verbose option is also given; 'auto' prints base64 "
"only when necessary (i.e., for row-based events and format description "
"events); 'always' prints base64 whenever possible. 'always' is for "
"debugging only and should not be used in a production system. If this "
"argument is not given, the default is 'auto'; if it is given with no "
"argument, 'always' is used.",
"events); 'always' prints base64 whenever possible. 'always' is "
"deprecated, will be removed in a future version, and should not be used "
"in a production system. --base64-output with no 'name' argument is "
"equivalent to --base64-output=always and is also deprecated. If no "
"--base64-output[=name] option is given at all, the default is 'auto'.",
&opt_base64_output_mode_str, &opt_base64_output_mode_str,
0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
/*
@ -1096,6 +1109,10 @@ static struct my_option my_long_options[] =
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
&debug_info_flag, &debug_info_flag,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"default_auth", OPT_DEFAULT_AUTH,
"Default authentication client-side plugin to use.",
&opt_default_auth, &opt_default_auth, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"disable-log-bin", 'D', "Disable binary log. This is useful, if you "
"enabled --to-last-log and are sending the output to the same MySQL server. "
"This way you could avoid an endless loop. You would also like to use it "
@ -1121,6 +1138,9 @@ static struct my_option my_long_options[] =
0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"password", 'p', "Password to connect to remote server.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
&opt_plugin_dir, &opt_plugin_dir, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"port", 'P', "Port number to use for connection or 0 for default to, in "
"order of preference, my.cnf, $MYSQL_TCP_PORT, "
#if MYSQL_PORT_DEFAULT == 0
@ -1302,10 +1322,7 @@ static void print_version()
static void usage()
{
print_version();
puts("By Monty and Sasha, for your professional use\n\
This software comes with NO WARRANTY: This is free software,\n\
and you are welcome to modify and redistribute it under the GPL license.\n");
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2001, 2010"));
printf("\
Dumps a MySQL binary log in a format usable for viewing or for piping to\n\
the mysql command line client.\n\n");
@ -1496,6 +1513,12 @@ static Exit_status safe_connect()
return ERROR_STOP;
}
if (opt_plugin_dir && *opt_plugin_dir)
mysql_options(mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir);
if (opt_default_auth && *opt_default_auth)
mysql_options(mysql, MYSQL_DEFAULT_AUTH, opt_default_auth);
if (opt_protocol)
mysql_options(mysql, MYSQL_OPT_PROTOCOL, (char*) &opt_protocol);
#ifdef HAVE_SMEM
@ -2150,6 +2173,13 @@ int main(int argc, char** argv)
if (opt_base64_output_mode == BASE64_OUTPUT_UNSPEC)
opt_base64_output_mode= BASE64_OUTPUT_AUTO;
if (opt_base64_output_mode == BASE64_OUTPUT_ALWAYS)
warning("The --base64-output=always flag and the --base64-output flag "
"(with '=MODE' omitted), are deprecated. "
"The output generated when these flags are used cannot be "
"parsed by mysql 5.6.0 and later. "
"The flags will be removed in a future version. "
"Please use --base64-output=auto instead.");
my_set_max_open_files(open_files_limit);

View File

@ -1,6 +1,5 @@
/* Copyright (C) 2000 MySQL AB & Jani Tolonen
Copyright (C) 2009 Sun Microsystems, Inc
Copyright (C) 2010 Monty Program Ab
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
Copyright (C) 2010-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
@ -24,6 +23,7 @@
#include <mysql_version.h>
#include <mysqld_error.h>
#include <sslopt-vars.h>
#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
/* Exit codes */
@ -43,14 +43,15 @@ static int my_end_arg;
static char * opt_mysql_unix_port = 0;
static char *opt_password = 0, *current_user = 0,
*default_charset= 0, *current_host= 0;
static char *opt_plugin_dir= 0, *opt_default_auth= 0;
static int first_error = 0;
DYNAMIC_ARRAY tables4repair;
DYNAMIC_ARRAY tables4repair, tables4rebuild;
#ifdef HAVE_SMEM
static char *shared_memory_base_name=0;
#endif
static uint opt_protocol=0;
enum operations { DO_CHECK, DO_REPAIR, DO_ANALYZE, DO_OPTIMIZE, DO_UPGRADE };
enum operations { DO_CHECK=1, DO_REPAIR, DO_ANALYZE, DO_OPTIMIZE, DO_UPGRADE };
static struct my_option my_long_options[] =
{
@ -102,6 +103,10 @@ static struct my_option my_long_options[] =
{"default-character-set", OPT_DEFAULT_CHARSET,
"Set the default character set.", &default_charset,
&default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"default_auth", OPT_DEFAULT_AUTH,
"Default authentication client-side plugin to use.",
&opt_default_auth, &opt_default_auth, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"fast",'F', "Check only tables that haven't been closed properly.",
&opt_fast, &opt_fast, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
0},
@ -139,6 +144,9 @@ static struct my_option my_long_options[] =
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
&opt_plugin_dir, &opt_plugin_dir, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"port", 'P', "Port number to use for connection or 0 for default to, in "
"order of preference, my.cnf, $MYSQL_TCP_PORT, "
#if MYSQL_PORT_DEFAULT == 0
@ -217,9 +225,7 @@ static void print_version(void)
static void usage(void)
{
print_version();
puts("By Jani Tolonen, 2001-04-20, MySQL Development Team.\n");
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,");
puts("and you are welcome to modify and redistribute it under the GPL license.\n");
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
printf("Usage: %s [OPTIONS] database [tables]\n", my_progname);
printf("OR %s [OPTIONS] --databases DB1 [DB2 DB3...]\n",
my_progname);
@ -248,6 +254,8 @@ static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument)
{
int orig_what_to_do= what_to_do;
switch(optid) {
case 'a':
what_to_do = DO_ANALYZE;
@ -322,6 +330,13 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
opt->name);
break;
}
if (orig_what_to_do && (what_to_do != orig_what_to_do))
{
fprintf(stderr, "Error: %s doesn't support multiple contradicting commands.\n",
my_progname);
return 1;
}
return 0;
}
@ -628,6 +643,27 @@ static int fix_database_storage_name(const char *name)
return rc;
}
static int rebuild_table(char *name)
{
char *query, *ptr;
int rc= 0;
query= (char*)my_malloc(sizeof(char) * (12 + fixed_name_length(name) + 6 + 1),
MYF(MY_WME));
if (!query)
return 1;
ptr= strmov(query, "ALTER TABLE ");
ptr= fix_table_name(ptr, name);
ptr= strxmov(ptr, " FORCE", NullS);
if (mysql_real_query(sock, query, (uint)(ptr - query)))
{
fprintf(stderr, "Failed to %s\n", query);
fprintf(stderr, "Error: %s\n", mysql_error(sock));
rc= 1;
}
my_free(query);
return rc;
}
static int process_one_db(char *database)
{
if (verbose)
@ -744,7 +780,7 @@ static void print_result()
MYSQL_ROW row;
char prev[(NAME_LEN+9)*2+2];
uint i;
my_bool found_error=0;
my_bool found_error=0, table_rebuild=0;
res = mysql_use_result(sock);
@ -763,8 +799,14 @@ static void print_result()
*/
if (found_error && opt_auto_repair && what_to_do != DO_REPAIR &&
strcmp(row[3],"OK"))
insert_dynamic(&tables4repair, (uchar*) prev);
{
if (table_rebuild)
insert_dynamic(&tables4rebuild, (uchar*) prev);
else
insert_dynamic(&tables4repair, (uchar*) prev);
}
found_error=0;
table_rebuild=0;
if (opt_silent)
continue;
}
@ -782,7 +824,11 @@ static void print_result()
else
printf("%s\n%-9s: %s", row[0], row[2], row[3]);
if (strcmp(row[2],"note"))
{
found_error=1;
if (opt_auto_repair && strstr(row[3], "ALTER TABLE") != NULL)
table_rebuild=1;
}
}
else
printf("%-9s: %s", row[2], row[3]);
@ -791,7 +837,12 @@ static void print_result()
}
/* add the last table to be repaired to the list */
if (found_error && opt_auto_repair && what_to_do != DO_REPAIR)
insert_dynamic(&tables4repair, (uchar*) prev);
{
if (table_rebuild)
insert_dynamic(&tables4rebuild, (uchar*) prev);
else
insert_dynamic(&tables4repair, (uchar*) prev);
}
mysql_free_result(res);
}
@ -817,6 +868,13 @@ static int dbConnect(char *host, char *user, char *passwd)
if (shared_memory_base_name)
mysql_options(&mysql_connection,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
#endif
if (opt_plugin_dir && *opt_plugin_dir)
mysql_options(&mysql_connection, MYSQL_PLUGIN_DIR, opt_plugin_dir);
if (opt_default_auth && *opt_default_auth)
mysql_options(&mysql_connection, MYSQL_DEFAULT_AUTH, opt_default_auth);
mysql_options(&mysql_connection, MYSQL_SET_CHARSET_NAME, default_charset);
if (!(sock = mysql_real_connect(&mysql_connection, host, user, passwd,
NULL, opt_mysql_port, opt_mysql_unix_port, 0)))
@ -883,7 +941,8 @@ int main(int argc, char **argv)
}
if (opt_auto_repair &&
my_init_dynamic_array(&tables4repair, sizeof(char)*(NAME_LEN*2+2),16,64))
(my_init_dynamic_array(&tables4repair, sizeof(char)*(NAME_LEN*2+2),16,64) ||
my_init_dynamic_array(&tables4rebuild, sizeof(char)*(NAME_LEN*2+2),16,64)))
{
first_error = 1;
goto end;
@ -901,7 +960,7 @@ int main(int argc, char **argv)
{
uint i;
if (!opt_silent && tables4repair.elements)
if (!opt_silent && (tables4repair.elements || tables4rebuild.elements))
puts("\nRepairing tables");
what_to_do = DO_REPAIR;
for (i = 0; i < tables4repair.elements ; i++)
@ -909,11 +968,16 @@ int main(int argc, char **argv)
char *name= (char*) dynamic_array_ptr(&tables4repair, i);
handle_request_for_tables(name, fixed_name_length(name));
}
for (i = 0; i < tables4rebuild.elements ; i++)
rebuild_table((char*) dynamic_array_ptr(&tables4rebuild, i));
}
end:
dbDisconnect(current_host);
if (opt_auto_repair)
{
delete_dynamic(&tables4repair);
delete_dynamic(&tables4rebuild);
}
my_free(opt_password);
#ifdef HAVE_SMEM
my_free(shared_memory_base_name);

View File

@ -1,4 +1,4 @@
/* Copyright 2000-2008 MySQL AB, 2008, 2009 Sun Microsystems, Inc.
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@ -51,6 +51,8 @@
#include "mysql_version.h"
#include "mysqld_error.h"
#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
/* Exit codes */
#define EX_USAGE 1
@ -135,6 +137,7 @@ FILE *stderror_file=0;
static char *shared_memory_base_name=0;
#endif
static uint opt_protocol= 0;
static char *opt_plugin_dir= 0, *opt_default_auth= 0;
/*
Dynamic_string wrapper functions. In this file use these
@ -497,6 +500,13 @@ static struct my_option my_long_options[] =
&where, &where, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"xml", 'X', "Dump a database as well formed XML.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
&opt_plugin_dir, &opt_plugin_dir, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"default_auth", OPT_DEFAULT_AUTH,
"Default authentication client-side plugin to use.",
&opt_default_auth, &opt_default_auth, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@ -584,8 +594,7 @@ static void short_usage_sub(void)
static void usage(void)
{
print_version();
puts("By Igor Romanenko, Monty, Jani & Sinisa.");
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license.\n");
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
puts("Dumping structure and contents of MySQL databases and tables.");
short_usage_sub();
print_defaults("my",load_default_groups);
@ -1144,6 +1153,9 @@ static int switch_db_collation(FILE *sql_file,
{
if (strcmp(current_db_cl_name, required_db_cl_name) != 0)
{
char quoted_db_buf[NAME_LEN * 2 + 3];
char *quoted_db_name= quote_name(db_name, quoted_db_buf, FALSE);
CHARSET_INFO *db_cl= get_charset_by_name(required_db_cl_name, MYF(0));
if (!db_cl)
@ -1151,7 +1163,7 @@ static int switch_db_collation(FILE *sql_file,
fprintf(sql_file,
"ALTER DATABASE %s CHARACTER SET %s COLLATE %s %s\n",
(const char *) db_name,
(const char *) quoted_db_name,
(const char *) db_cl->csname,
(const char *) db_cl->name,
(const char *) delimiter);
@ -1172,6 +1184,9 @@ static int restore_db_collation(FILE *sql_file,
const char *delimiter,
const char *db_cl_name)
{
char quoted_db_buf[NAME_LEN * 2 + 3];
char *quoted_db_name= quote_name(db_name, quoted_db_buf, FALSE);
CHARSET_INFO *db_cl= get_charset_by_name(db_cl_name, MYF(0));
if (!db_cl)
@ -1179,7 +1194,7 @@ static int restore_db_collation(FILE *sql_file,
fprintf(sql_file,
"ALTER DATABASE %s CHARACTER SET %s COLLATE %s %s\n",
(const char *) db_name,
(const char *) quoted_db_name,
(const char *) db_cl->csname,
(const char *) db_cl->name,
(const char *) delimiter);
@ -1452,6 +1467,13 @@ static int connect_to_db(char *host, char *user,char *passwd)
mysql_options(&mysql_connection,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
#endif
mysql_options(&mysql_connection, MYSQL_SET_CHARSET_NAME, default_charset);
if (opt_plugin_dir && *opt_plugin_dir)
mysql_options(&mysql_connection, MYSQL_PLUGIN_DIR, opt_plugin_dir);
if (opt_default_auth && *opt_default_auth)
mysql_options(&mysql_connection, MYSQL_DEFAULT_AUTH, opt_default_auth);
if (!(mysql= mysql_real_connect(&mysql_connection,host,user,passwd,
NULL,opt_mysql_port,opt_mysql_unix_port,
0)))
@ -2222,6 +2244,15 @@ static uint get_table_structure(char *table, char *db, char *table_type,
const char *insert_option;
char name_buff[NAME_LEN+3],table_buff[NAME_LEN*2+3];
char table_buff2[NAME_LEN*2+3], query_buff[QUERY_LENGTH];
const char *show_fields_stmt= "SELECT `COLUMN_NAME` AS `Field`, "
"`COLUMN_TYPE` AS `Type`, "
"`IS_NULLABLE` AS `Null`, "
"`COLUMN_KEY` AS `Key`, "
"`COLUMN_DEFAULT` AS `Default`, "
"`EXTRA` AS `Extra`, "
"`COLUMN_COMMENT` AS `Comment` "
"FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE "
"TABLE_SCHEMA = '%s' AND TABLE_NAME = '%s'";
FILE *sql_file= md_result_file;
int len;
MYSQL_RES *result;
@ -2489,8 +2520,8 @@ static uint get_table_structure(char *table, char *db, char *table_type,
verbose_msg("%s: Warning: Can't set SQL_QUOTE_SHOW_CREATE option (%s)\n",
my_progname, mysql_error(mysql));
my_snprintf(query_buff, sizeof(query_buff), "show fields from %s",
result_table);
my_snprintf(query_buff, sizeof(query_buff), show_fields_stmt, db, table);
if (mysql_query_with_error_report(mysql, &result, query_buff))
DBUG_RETURN(0);
@ -4620,7 +4651,7 @@ static ulong find_set(TYPELIB *lib, const char *x, uint length,
for (; pos != end && *pos != ','; pos++) ;
var_len= (uint) (pos - start);
strmake(buff, start, min(sizeof(buff) - 1, var_len));
find= find_type(buff, lib, var_len);
find= find_type(buff, lib, FIND_TYPE_BASIC);
if (!find)
{
*err_pos= (char*) start;

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2000-2006 MySQL AB, 2009 Sun Microsystems, Inc.
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
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
@ -32,6 +32,8 @@
#include <my_pthread.h>
#endif
#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
/* Global Thread counter */
uint counter;
@ -58,6 +60,7 @@ static char *opt_password=0, *current_user=0,
*default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME;
static uint opt_mysql_port= 0, opt_protocol= 0;
static char * opt_mysql_unix_port=0;
static char *opt_plugin_dir= 0, *opt_default_auth= 0;
static longlong opt_ignore_lines= -1;
#include <sslopt-vars.h>
@ -88,6 +91,10 @@ static struct my_option my_long_options[] =
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
&debug_info_flag, &debug_info_flag,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"default_auth", OPT_DEFAULT_AUTH,
"Default authentication client-side plugin to use.",
&opt_default_auth, &opt_default_auth, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"delete", 'd', "First delete all rows from table.", &opt_delete,
&opt_delete, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"fields-terminated-by", OPT_FTB,
@ -137,6 +144,9 @@ static struct my_option my_long_options[] =
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
&opt_plugin_dir, &opt_plugin_dir, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"port", 'P', "Port number to use for connection or 0 for default to, in "
"order of preference, my.cnf, $MYSQL_TCP_PORT, "
#if MYSQL_PORT_DEFAULT == 0
@ -191,8 +201,7 @@ static void print_version(void)
static void usage(void)
{
print_version();
puts("Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.");
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license.\n");
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
printf("\
Loads tables from text files in various formats. The base name of the\n\
text file must be the name of the table that should be used.\n\
@ -428,6 +437,13 @@ static MYSQL *db_connect(char *host, char *database,
if (shared_memory_base_name)
mysql_options(mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
#endif
if (opt_plugin_dir && *opt_plugin_dir)
mysql_options(mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir);
if (opt_default_auth && *opt_default_auth)
mysql_options(mysql, MYSQL_DEFAULT_AUTH, opt_default_auth);
mysql_options(mysql, MYSQL_SET_CHARSET_NAME, default_charset);
if (!(mysql_real_connect(mysql,host,user,passwd,
database,opt_mysql_port,opt_mysql_unix_port,

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2000-2006 MySQL AB
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
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
@ -25,6 +25,7 @@
#include <signal.h>
#include <stdarg.h>
#include <sslopt-vars.h>
#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
static char * host=0, *opt_password=0, *user=0;
static my_bool opt_show_keys= 0, opt_compress= 0, opt_count=0, opt_status= 0;
@ -33,6 +34,7 @@ static my_bool debug_info_flag= 0, debug_check_flag= 0;
static uint my_end_arg= 0;
static uint opt_verbose=0;
static char *default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME;
static char *opt_plugin_dir= 0, *opt_default_auth= 0;
#ifdef HAVE_SMEM
static char *shared_memory_base_name=0;
@ -123,6 +125,12 @@ int main(int argc, char **argv)
#endif
mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset);
if (opt_plugin_dir && *opt_plugin_dir)
mysql_options(&mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir);
if (opt_default_auth && *opt_default_auth)
mysql_options(&mysql, MYSQL_DEFAULT_AUTH, opt_default_auth);
if (!(mysql_real_connect(&mysql,host,user,opt_password,
(first_argument_uses_wildcards) ? "" :
argv[0],opt_mysql_port,opt_mysql_unix_port,
@ -181,6 +189,10 @@ static struct my_option my_long_options[] =
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
&debug_info_flag, &debug_info_flag,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"default_auth", OPT_DEFAULT_AUTH,
"Default authentication client-side plugin to use.",
&opt_default_auth, &opt_default_auth, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG,
0, 0, 0, 0, 0, 0},
{"host", 'h', "Connect to host.", &host, &host, 0, GET_STR,
@ -194,6 +206,9 @@ static struct my_option my_long_options[] =
"Password to use when connecting to server. If password is not given, it's "
"solicited on the tty.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
&opt_plugin_dir, &opt_plugin_dir, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"port", 'P', "Port number to use for connection or 0 for default to, in "
"order of preference, my.cnf, $MYSQL_TCP_PORT, "
#if MYSQL_PORT_DEFAULT == 0
@ -247,8 +262,7 @@ static void print_version(void)
static void usage(void)
{
print_version();
puts("Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.");
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license.\n");
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010)"));
puts("Shows the structure of a MySQL database (databases, tables, and columns).\n");
printf("Usage: %s [OPTIONS] [database [table [column]]]\n",my_progname);
puts("\n\

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2005 MySQL AB, 2009 Sun Microsystems, Inc.
/* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
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
@ -11,12 +11,7 @@
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
original idea: Brian Aker via playing with ab for too many years
coded by: Patrick Galbraith
*/
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/*
MySQL Slap
@ -94,6 +89,7 @@ TODO:
#include <sys/wait.h>
#endif
#include <ctype.h>
#include <welcome_copyright_notice.h> /* ORACLE_WELCOME_COPYRIGHT_NOTICE */
#ifdef __WIN__
#define srandom srand
@ -126,12 +122,13 @@ static char *host= NULL, *opt_password= NULL, *user= NULL,
*pre_system= NULL,
*post_system= NULL,
*opt_mysql_unix_port= NULL;
static char *opt_plugin_dir= 0, *opt_default_auth= 0;
const char *delimiter= "\n";
const char *create_schema_string= "mysqlslap";
static my_bool opt_preserve= TRUE;
static my_bool opt_preserve= TRUE, opt_no_drop= FALSE;
static my_bool debug_info_flag= 0, debug_check_flag= 0;
static my_bool opt_only_print= FALSE;
static my_bool opt_compress= FALSE, tty_password= FALSE,
@ -348,6 +345,12 @@ int main(int argc, char **argv)
mysql_init(&mysql);
set_mysql_connect_options(&mysql);
if (opt_plugin_dir && *opt_plugin_dir)
mysql_options(&mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir);
if (opt_default_auth && *opt_default_auth)
mysql_options(&mysql, MYSQL_DEFAULT_AUTH, opt_default_auth);
if (!opt_only_print)
{
if (!(mysql_real_connect(&mysql, host, user, opt_password,
@ -599,6 +602,10 @@ static struct my_option my_long_options[] =
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"debug-info", 'T', "Print some debug info at exit.", &debug_info_flag,
&debug_info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"default_auth", OPT_DEFAULT_AUTH,
"Default authentication client-side plugin to use.",
&opt_default_auth, &opt_default_auth, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"delimiter", 'F',
"Delimiter to use in SQL statements supplied in file or command line.",
(char**) &delimiter, (char**) &delimiter, 0, GET_STR, REQUIRED_ARG,
@ -617,6 +624,8 @@ static struct my_option my_long_options[] =
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"iterations", 'i', "Number of times to run the tests.", &iterations,
&iterations, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0},
{"no-drop", OPT_SLAP_NO_DROP, "Do not drop the schema after the test.",
&opt_no_drop, &opt_no_drop, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"number-char-cols", 'x',
"Number of VARCHAR columns to create in table if specifying --auto-generate-sql.",
(char**) &num_char_cols_opt, (char**) &num_char_cols_opt, 0, GET_STR, REQUIRED_ARG,
@ -641,6 +650,9 @@ static struct my_option my_long_options[] =
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
&opt_plugin_dir, &opt_plugin_dir, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"port", 'P', "Port number to use for connection.", &opt_mysql_port,
&opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0,
0},
@ -703,8 +715,7 @@ static void print_version(void)
static void usage(void)
{
print_version();
puts("Copyright (C) 2005 MySQL AB");
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license.\n");
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2005, 2010"));
puts("Run a query multiple times against the server.\n");
printf("Usage: %s [OPTIONS]\n",my_progname);
print_defaults("my",load_default_groups);
@ -1159,8 +1170,11 @@ get_options(int *argc,char ***argv)
if (!user)
user= (char *)"root";
/* If something is created we clean it up, otherwise we leave schemas alone */
if (create_string || auto_generate_sql)
/*
If something is created and --no-drop is not specified, we drop the
schema.
*/
if (!opt_no_drop && (create_string || auto_generate_sql))
opt_preserve= FALSE;
if (auto_generate_sql && (create_string || user_supplied_query))
@ -1533,7 +1547,12 @@ generate_primary_key_list(MYSQL *mysql, option_string *engine_stmt)
exit(1);
}
result= mysql_store_result(mysql);
if (!(result= mysql_store_result(mysql)))
{
fprintf(stderr, "%s: Error when storing result: %d %s\n",
my_progname, mysql_errno(mysql), mysql_error(mysql));
exit(1);
}
primary_keys_number_of= mysql_num_rows(result);
/* So why check this? Blackhole :) */
@ -1907,16 +1926,14 @@ limit_not_met:
{
if (mysql_field_count(mysql))
{
if ((result= mysql_store_result(mysql)))
{
while ((row = mysql_fetch_row(result)))
counter++;
mysql_free_result(result);
}
if (!(result= mysql_store_result(mysql)))
fprintf(stderr, "%s: Error when storing result: %d %s\n",
my_progname, mysql_errno(mysql), mysql_error(mysql));
else
{
fprintf(stderr,"%s: Error in mysql_store_result(): %d %s\n",
my_progname, mysql_errno(mysql), mysql_error(mysql));
while ((row= mysql_fetch_row(result)))
counter++;
mysql_free_result(result);
}
}
} while(mysql_next_result(mysql) == 0);

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2000 MySQL AB
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
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
@ -11,7 +11,7 @@
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 */
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
mysqltest
@ -52,6 +52,8 @@
#include <signal.h>
#include <my_stacktrace.h>
#include <welcome_copyright_notice.h> // ORACLE_WELCOME_COPYRIGHT_NOTICE
#ifdef __WIN__
#include <crtdbg.h>
#define SIGNAL_FMT "exception 0x%x"
@ -197,6 +199,8 @@ static ulonglong timer_now(void);
static ulong connection_retry_sleep= 100000; /* Microseconds */
static char *opt_plugin_dir= 0;
/* Precompiled re's */
static my_regex_t ps_re; /* the query can be run using PS protocol */
static my_regex_t sp_re; /* the query can be run as a SP */
@ -238,8 +242,9 @@ typedef struct
int str_val_len;
int int_val;
int alloced_len;
int int_dirty; /* do not update string if int is updated until first read */
int alloced;
bool int_dirty; /* do not update string if int is updated until first read */
bool is_int;
bool alloced;
} VAR;
/*Perl/shell-like variable registers */
@ -465,7 +470,7 @@ 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];
enum enum_commands type;
@ -475,6 +480,8 @@ TYPELIB command_typelib= {array_elements(command_names),"",
command_names, 0};
DYNAMIC_STRING ds_res;
/* Points to ds_warning in run_query, so it can be freed */
DYNAMIC_STRING *ds_warn= 0;
char builtin_echo[FN_REFLEN];
@ -494,7 +501,8 @@ VAR* var_init(VAR* v, const char *name, int name_len, const char *val,
int val_len);
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 open_end=false, bool do_eval=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();
@ -788,7 +796,7 @@ end_thread:
static void wait_query_thread_done(struct st_connection *con)
{
DBUG_ASSERT(con->tid);
DBUG_ASSERT(con->has_thread);
if (!con->query_done)
{
pthread_mutex_lock(&con->result_mutex);
@ -801,7 +809,7 @@ static void wait_query_thread_done(struct st_connection *con)
static void signal_connection_thd(struct st_connection *cn, int command)
{
DBUG_ASSERT(cn->tid);
DBUG_ASSERT(cn->has_thread);
cn->query_done= 0;
cn->command= command;
pthread_mutex_lock(&cn->query_mutex);
@ -813,13 +821,13 @@ static void signal_connection_thd(struct st_connection *cn, int command)
/*
Sometimes we try to execute queries when the connection is closed.
It's done to make sure it was closed completely.
So that if our connection is closed (cn->tid == 0), we just return
So that if our connection is closed (cn->has_thread == 0), we just return
the mysql_send_query() result which is an error in this case.
*/
static int do_send_query(struct st_connection *cn, const char *q, int q_len)
{
if (!cn->tid)
if (!cn->has_thread)
return mysql_send_query(&cn->mysql, q, q_len);
cn->cur_query= q;
cn->cur_query_len= q_len;
@ -829,7 +837,7 @@ static int do_send_query(struct st_connection *cn, const char *q, int q_len)
static int do_read_query_result(struct st_connection *cn)
{
DBUG_ASSERT(cn->tid);
DBUG_ASSERT(cn->has_thread);
wait_query_thread_done(cn);
signal_connection_thd(cn, EMB_READ_QUERY_RESULT);
wait_query_thread_done(cn);
@ -840,12 +848,12 @@ static int do_read_query_result(struct st_connection *cn)
static void emb_close_connection(struct st_connection *cn)
{
if (!cn->tid)
if (!cn->has_thread)
return;
wait_query_thread_done(cn);
signal_connection_thd(cn, EMB_END_CONNECTION);
pthread_join(cn->tid, NULL);
cn->tid= 0;
cn->has_thread= FALSE;
pthread_mutex_destroy(&cn->query_mutex);
pthread_cond_destroy(&cn->query_cond);
pthread_mutex_destroy(&cn->result_mutex);
@ -863,6 +871,7 @@ static void init_connection_thd(struct st_connection *cn)
pthread_cond_init(&cn->result_cond, NULL) ||
pthread_create(&cn->tid, &cn_thd_attrib, connection_thread, (void*)cn))
die("Error in the thread library");
cn->has_thread=TRUE;
}
#else /*EMBEDDED_LIBRARY*/
@ -1180,8 +1189,8 @@ 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 %d. my_errno=%d",
command->first_word_len, command->query, error, my_errno);
i= match_expected_error(command, error, NULL);
@ -1287,6 +1296,8 @@ void free_used_memory()
my_free(embedded_server_args[--embedded_server_arg_count]);
delete_dynamic(&q_lines);
dynstr_free(&ds_res);
if (ds_warn)
dynstr_free(ds_warn);
free_all_replace();
my_free(opt_pass);
free_defaults(default_argv);
@ -1330,6 +1341,17 @@ static void cleanup_and_exit(int exit_code)
exit(exit_code);
}
void print_file_stack()
{
for (struct st_test_file* err_file= cur_file;
err_file != file_stack;
err_file--)
{
fprintf(stderr, "included from %s at line %d:\n",
err_file->file_name, err_file->lineno);
}
}
void die(const char *fmt, ...)
{
static int dying= 0;
@ -1340,8 +1362,12 @@ void die(const char *fmt, ...)
/* Print the error message */
fprintf(stderr, "mysqltest: ");
if (cur_file && cur_file != file_stack)
fprintf(stderr, "In included file \"%s\": ",
{
fprintf(stderr, "In included file \"%s\": \n",
cur_file->file_name);
print_file_stack();
}
if (start_lineno > 0)
fprintf(stderr, "At line %u: ", start_lineno);
if (fmt)
@ -1380,7 +1406,6 @@ void die(const char *fmt, ...)
void abort_not_supported_test(const char *fmt, ...)
{
va_list args;
struct st_test_file* err_file= cur_file;
DBUG_ENTER("abort_not_supported_test");
/* Print include filestack */
@ -1388,13 +1413,8 @@ void abort_not_supported_test(const char *fmt, ...)
fprintf(stderr, "The test '%s' is not supported by this installation\n",
file_stack->file_name);
fprintf(stderr, "Detected in file %s at line %d\n",
err_file->file_name, err_file->lineno);
while (err_file != file_stack)
{
err_file--;
fprintf(stderr, "included from %s at line %d\n",
err_file->file_name, err_file->lineno);
}
cur_file->file_name, cur_file->lineno);
print_file_stack();
/* Print error message */
va_start(args, fmt);
@ -2079,6 +2099,23 @@ static void var_free(void *v)
C_MODE_END
void var_check_int(VAR *v)
{
char *endptr;
char *str= v->str_val;
/* Initially assume not a number */
v->int_val= 0;
v->is_int= false;
v->int_dirty= false;
if (!str) return;
v->int_val = (int) strtol(str, &endptr, 10);
/* It is an int if strtol consumed something up to end/space/tab */
if (endptr > str && (!*endptr || *endptr == ' ' || *endptr == '\t'))
v->is_int= true;
}
VAR *var_init(VAR *v, const char *name, int name_len, const char *val,
int val_len)
@ -2089,9 +2126,11 @@ VAR *var_init(VAR *v, const char *name, int name_len, const char *val,
name_len = strlen(name);
if (!val_len && val)
val_len = strlen(val) ;
if (!val)
val_len= 0;
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)
@ -2109,15 +2148,13 @@ VAR *var_init(VAR *v, const char *name, int name_len, const char *val,
die("Out of memory");
if (val)
{
memcpy(tmp_var->str_val, val, val_len);
tmp_var->str_val[val_len]= 0;
}
tmp_var->str_val[val_len]= 0;
var_check_int(tmp_var);
tmp_var->name_len = name_len;
tmp_var->str_val_len = val_len;
tmp_var->alloced_len = val_alloc_len;
tmp_var->int_val = (val) ? atoi(val) : 0;
tmp_var->int_dirty = 0;
return tmp_var;
}
@ -2178,7 +2215,7 @@ VAR* var_get(const char *var_name, const char **var_name_end, my_bool raw,
if (!raw && v->int_dirty)
{
sprintf(v->str_val, "%d", v->int_val);
v->int_dirty = 0;
v->int_dirty= false;
v->str_val_len = strlen(v->str_val);
}
if (var_name_end)
@ -2240,7 +2277,7 @@ void var_set(const char *var_name, const char *var_name_end,
if (v->int_dirty)
{
sprintf(v->str_val, "%d", v->int_val);
v->int_dirty= 0;
v->int_dirty=false;
v->str_val_len= strlen(v->str_val);
}
/* setenv() expects \0-terminated strings */
@ -2355,7 +2392,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, false);
dynstr_free(&result);
}
else
@ -2534,7 +2572,7 @@ void var_set_query_get_value(struct st_command *command, VAR *var)
break;
}
}
eval_expr(var, value, 0);
eval_expr(var, value, 0, false, false);
}
dynstr_free(&ds_query);
mysql_free_result(res);
@ -2546,6 +2584,7 @@ void var_set_query_get_value(struct st_command *command, VAR *var)
void var_copy(VAR *dest, VAR *src)
{
dest->int_val= src->int_val;
dest->is_int= src->is_int;
dest->int_dirty= src->int_dirty;
/* Alloc/realloc data for str_val in dest */
@ -2564,12 +2603,17 @@ 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 open_end, bool do_eval)
{
DBUG_ENTER("eval_expr");
DBUG_PRINT("enter", ("p: '%s'", p));
/* Skip to treat as pure string if no evaluation */
if (! do_eval)
goto NO_EVAL;
if (*p == '$')
{
VAR *vp;
@ -2582,7 +2626,7 @@ void eval_expr(VAR *v, const char *p, const char **p_end)
/* Make sure there was just a $variable and nothing else */
const char* end= *p_end + 1;
if (end < expected_end)
if (end < expected_end && !open_end)
die("Found junk '%.*s' after $variable in expression",
(int)(expected_end - end - 1), end);
@ -2612,6 +2656,7 @@ void eval_expr(VAR *v, const char *p, const char **p_end)
}
}
NO_EVAL:
{
int new_val_len = (p_end && *p_end) ?
(int) (*p_end - p) : (int) strlen(p);
@ -2629,9 +2674,7 @@ void eval_expr(VAR *v, const char *p, const char **p_end)
v->str_val_len = new_val_len;
memcpy(v->str_val, p, new_val_len);
v->str_val[new_val_len] = 0;
v->int_val=atoi(p);
DBUG_PRINT("info", ("atoi on '%s', returns: %d", p, v->int_val));
v->int_dirty=0;
var_check_int(v);
}
DBUG_VOID_RETURN;
}
@ -2978,6 +3021,8 @@ int do_modify_var(struct st_command *command,
die("The argument to %.*s must be a variable (start with $)",
command->first_word_len, command->query);
v= var_get(p, &p, 1, 0);
if (! v->is_int)
die("Cannot perform inc/dec on a non-numeric value");
switch (op) {
case DO_DEC:
v->int_val--;
@ -2989,7 +3034,7 @@ int do_modify_var(struct st_command *command,
die("Invalid operator to do_modify_var");
break;
}
v->int_dirty= 1;
v->int_dirty= true;
command->last_argument= (char*)++p;
return 0;
}
@ -3465,7 +3510,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);
@ -3495,6 +3540,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,
@ -3536,6 +3582,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,
@ -4260,7 +4307,7 @@ int do_save_master_pos()
const char latest_applied_binlog_epoch_str[]=
"latest_applied_binlog_epoch=";
if (count)
sleep(1);
my_sleep(100*1000); /* 100ms */
if (mysql_query(mysql, query= "show engine ndb status"))
die("failed in '%s': %d %s", query,
mysql_errno(mysql), mysql_error(mysql));
@ -4349,7 +4396,7 @@ int do_save_master_pos()
count++;
if (latest_handled_binlog_epoch >= start_epoch)
do_continue= 0;
else if (count > 30)
else if (count > 300) /* 30s */
{
break;
}
@ -4594,13 +4641,14 @@ static int my_kill(int pid, int sig)
command called command
DESCRIPTION
shutdown [<timeout>]
shutdown_server [<timeout>]
*/
void do_shutdown_server(struct st_command *command)
{
int timeout=60, pid;
long timeout=60;
int pid;
DYNAMIC_STRING ds_pidfile_name;
MYSQL* mysql = &cur_con->mysql;
static DYNAMIC_STRING ds_timeout;
@ -4615,8 +4663,9 @@ void do_shutdown_server(struct st_command *command)
if (ds_timeout.length)
{
timeout= atoi(ds_timeout.str);
if (timeout == 0)
char* endptr;
timeout= strtol(ds_timeout.str, &endptr, 10);
if (*endptr != '\0')
die("Illegal argument for timeout: '%s'", ds_timeout.str);
}
dynstr_free(&ds_timeout);
@ -4658,7 +4707,7 @@ void do_shutdown_server(struct st_command *command)
DBUG_PRINT("info", ("Process %d does not exist anymore", pid));
DBUG_VOID_RETURN;
}
DBUG_PRINT("info", ("Sleeping, timeout: %d", timeout));
DBUG_PRINT("info", ("Sleeping, timeout: %ld", timeout));
my_sleep(1000000L);
}
@ -5300,6 +5349,7 @@ void do_connect(struct st_command *command)
static DYNAMIC_STRING ds_port;
static DYNAMIC_STRING ds_sock;
static DYNAMIC_STRING ds_options;
static DYNAMIC_STRING ds_default_auth;
#ifdef HAVE_SMEM
static DYNAMIC_STRING ds_shm;
#endif
@ -5311,7 +5361,8 @@ void do_connect(struct st_command *command)
{ "database", ARG_STRING, FALSE, &ds_database, "Database to select after connect" },
{ "port", ARG_STRING, FALSE, &ds_port, "Port to connect to" },
{ "socket", ARG_STRING, FALSE, &ds_sock, "Socket to connect with" },
{ "options", ARG_STRING, FALSE, &ds_options, "Options to use while connecting" }
{ "options", ARG_STRING, FALSE, &ds_options, "Options to use while connecting" },
{ "default_auth", ARG_STRING, FALSE, &ds_default_auth, "Default authentication to use" }
};
DBUG_ENTER("do_connect");
@ -5419,8 +5470,13 @@ void do_connect(struct st_command *command)
opt_charsets_dir);
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
if (opt_use_ssl || con_ssl)
if (opt_use_ssl)
con_ssl= 1;
#endif
if (con_ssl)
{
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
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
@ -5429,15 +5485,15 @@ void do_connect(struct st_command *command)
mysql_options(&con_slot->mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
&opt_ssl_verify_server_cert);
#endif
}
#endif
}
#ifdef __WIN__
if (con_pipe)
{
#ifdef __WIN__
opt_protocol= MYSQL_PROTOCOL_PIPE;
}
#endif
}
if (opt_protocol)
mysql_options(&con_slot->mysql, MYSQL_OPT_PROTOCOL, (char*) &opt_protocol);
@ -5462,6 +5518,12 @@ void do_connect(struct st_command *command)
if (ds_database.length == 0)
dynstr_set(&ds_database, opt_db);
if (opt_plugin_dir && *opt_plugin_dir)
mysql_options(&con_slot->mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir);
if (ds_default_auth.length)
mysql_options(&con_slot->mysql, MYSQL_DEFAULT_AUTH, ds_default_auth.str);
/* Special database to allow one to connect without a database name */
if (ds_database.length && !strcmp(ds_database.str,"*NO-ONE*"))
dynstr_set(&ds_database, "");
@ -5490,6 +5552,7 @@ void do_connect(struct st_command *command)
dynstr_free(&ds_port);
dynstr_free(&ds_sock);
dynstr_free(&ds_options);
dynstr_free(&ds_default_auth);
#ifdef HAVE_SMEM
dynstr_free(&ds_shm);
#endif
@ -5529,6 +5592,40 @@ int do_done(struct st_command *command)
return 0;
}
/* Operands available in if or while conditions */
enum block_op {
EQ_OP,
NE_OP,
GT_OP,
GE_OP,
LT_OP,
LE_OP,
ILLEG_OP
};
enum block_op find_operand(const char *start)
{
char first= *start;
char next= *(start+1);
if (first == '=' && next == '=')
return EQ_OP;
if (first == '!' && next == '=')
return NE_OP;
if (first == '>' && next == '=')
return GE_OP;
if (first == '>')
return GT_OP;
if (first == '<' && next == '=')
return LE_OP;
if (first == '<')
return LT_OP;
return ILLEG_OP;
}
/*
Process start of a "if" or "while" statement
@ -5554,6 +5651,13 @@ int do_done(struct st_command *command)
A '!' can be used before the <expr> to indicate it should
be executed if it evaluates to zero.
<expr> can also be a simple comparison condition:
<variable> <op> <expr>
The left hand side must be a variable, the right hand side can be a
variable, number, string or `query`. Operands are ==, !=, <, <=, >, >=.
== and != can be used for strings, all can be used for numerical values.
*/
void do_block(enum block_cmd cmd, struct st_command* command)
@ -5589,11 +5693,16 @@ void do_block(enum block_cmd cmd, struct st_command* command)
if (!expr_start++)
die("missing '(' in %s", cmd_name);
while (my_isspace(charset_info, *expr_start))
expr_start++;
/* Check for !<expr> */
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, ')');
@ -5607,14 +5716,110 @@ void do_block(enum block_cmd cmd, struct st_command* command)
die("Missing '{' after %s. Found \"%s\"", cmd_name, p);
var_init(&v,0,0,0,0);
eval_expr(&v, expr_start, &expr_end);
/* If expression starts with a variable, it may be a compare condition */
if (*expr_start == '$')
{
const char *curr_ptr= expr_end;
eval_expr(&v, expr_start, &curr_ptr, true);
while (my_isspace(charset_info, *++curr_ptr))
{}
/* If there was nothing past the variable, skip condition part */
if (curr_ptr == expr_end)
goto NO_COMPARE;
enum block_op operand= find_operand(curr_ptr);
if (operand == ILLEG_OP)
die("Found junk '%.*s' after $variable in condition",
(int)(expr_end - curr_ptr), curr_ptr);
/* We could silently allow this, but may be confusing */
if (not_expr)
die("Negation and comparison should not be combined, please rewrite");
/* Skip the 1 or 2 chars of the operand, then white space */
if (operand == LT_OP || operand == GT_OP)
{
curr_ptr++;
}
else
{
curr_ptr+= 2;
}
while (my_isspace(charset_info, *curr_ptr))
curr_ptr++;
if (curr_ptr == expr_end)
die("Missing right operand in comparison");
/* Strip off trailing white space */
while (my_isspace(charset_info, expr_end[-1]))
expr_end--;
/* strip off ' or " around the string */
if (*curr_ptr == '\'' || *curr_ptr == '"')
{
if (expr_end[-1] != *curr_ptr)
die("Unterminated string value");
curr_ptr++;
expr_end--;
}
VAR v2;
var_init(&v2,0,0,0,0);
eval_expr(&v2, curr_ptr, &expr_end);
if ((operand!=EQ_OP && operand!=NE_OP) && ! (v.is_int && v2.is_int))
die ("Only == and != are supported for string values");
/* Now we overwrite the first variable with 0 or 1 (for false or true) */
switch (operand)
{
case EQ_OP:
if (v.is_int)
v.int_val= (v2.is_int && v2.int_val == v.int_val);
else
v.int_val= !strcmp (v.str_val, v2.str_val);
break;
case NE_OP:
if (v.is_int)
v.int_val= ! (v2.is_int && v2.int_val == v.int_val);
else
v.int_val= (strcmp (v.str_val, v2.str_val) != 0);
break;
case LT_OP:
v.int_val= (v.int_val < v2.int_val);
break;
case LE_OP:
v.int_val= (v.int_val <= v2.int_val);
break;
case GT_OP:
v.int_val= (v.int_val > v2.int_val);
break;
case GE_OP:
v.int_val= (v.int_val >= v2.int_val);
break;
case ILLEG_OP:
die("Impossible operator, this cannot happen");
}
v.is_int= TRUE;
var_free(&v2);
} else
{
if (*expr_start != '`' && ! my_isdigit(charset_info, *expr_start))
die("Expression in if/while must beging with $, ` or a number");
eval_expr(&v, expr_start, &expr_end);
}
NO_COMPARE:
/* Define inner block */
cur_block++;
cur_block->cmd= cmd;
if (v.int_val)
if (v.is_int)
{
cur_block->ok= TRUE;
cur_block->ok= (v.int_val != 0);
} else
/* Any non-empty string which does not begin with 0 is also TRUE */
{
@ -5891,7 +6096,7 @@ int read_line(char *buf, int size)
/* Could be a multibyte character */
/* This code is based on the code in "sql_load.cc" */
#ifdef USE_MB
int charlen = my_mbcharlen(charset_info, c);
int charlen = my_mbcharlen(charset_info, (unsigned char) c);
/* We give up if multibyte character is started but not */
/* completed before we pass buf_end */
if ((charlen > 1) && (p + charlen) <= buf_end)
@ -5903,16 +6108,16 @@ int read_line(char *buf, int size)
for (i= 1; i < charlen; i++)
{
c= my_getc(cur_file->file);
if (feof(cur_file->file))
goto found_eof;
c= my_getc(cur_file->file);
*p++ = c;
}
if (! my_ismbchar(charset_info, mb_start, p))
{
/* It was not a multiline char, push back the characters */
/* We leave first 'c', i.e. pretend it was a normal char */
while (p > mb_start)
while (p-1 > mb_start)
my_ungetc(*--p);
}
}
@ -6260,6 +6465,9 @@ static struct my_option my_long_options[] =
"Number of seconds before connection timeout.",
&opt_connect_timeout, &opt_connect_timeout, 0, GET_UINT, REQUIRED_ARG,
120, 0, 3600 * 12, 0, 0, 0},
{"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
&opt_plugin_dir, &opt_plugin_dir, 0,
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@ -6273,8 +6481,7 @@ void print_version(void)
void usage()
{
print_version();
printf("MySQL AB, by Sasha, Matt, Monty & Jani\n");
printf("This software comes with ABSOLUTELY NO WARRANTY\n\n");
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000, 2010"));
printf("Runs a test against the mysql server and compares output with a results file.\n\n");
printf("Usage: %s [OPTIONS] [database] < test_file\n", my_progname);
my_print_help(my_long_options);
@ -7551,6 +7758,8 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
die ("Cannot reap on a connection without pending send");
init_dynamic_string(&ds_warnings, NULL, 0, 256);
ds_warn= &ds_warnings;
/*
Evaluate query if this is an eval command
*/
@ -7707,7 +7916,8 @@ void run_query(struct st_connection *cn, struct st_command *command, int flags)
ds, &ds_warnings);
dynstr_free(&ds_warnings);
if (command->type == Q_EVAL)
ds_warn= 0;
if (command->type == Q_EVAL || command->type == Q_SEND_EVAL)
dynstr_free(&eval_query);
if (display_result_sorted)
@ -7813,6 +8023,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)
@ -7853,7 +8073,7 @@ void get_command_type(struct st_command* command)
save= command->query[command->first_word_len];
command->query[command->first_word_len]= 0;
type= find_type(command->query, &command_typelib, 1+2);
type= find_type(command->query, &command_typelib, FIND_TYPE_NO_PREFIX);
command->query[command->first_word_len]= save;
if (type > 0)
{
@ -7951,13 +8171,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);
@ -8142,6 +8365,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'.",
@ -8159,13 +8390,15 @@ int main(int argc, char **argv)
}
var_set_string("MYSQLTEST_FILE", cur_file->file_name);
init_re();
/* Cursor protcol implies ps protocol */
if (cursor_protocol)
ps_protocol= 1;
ps_protocol_enabled= ps_protocol;
sp_protocol_enabled= sp_protocol;
view_protocol_enabled= view_protocol;
cursor_protocol_enabled= cursor_protocol;
/* Cursor protcol implies ps protocol */
if (cursor_protocol_enabled)
ps_protocol_enabled= 1;
st_connection *con= connections;
#ifdef EMBEDDED_LIBRARY
@ -8289,22 +8522,64 @@ int main(int argc, char **argv)
case Q_DISCONNECT:
case Q_DIRTY_CLOSE:
do_close_connection(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;
@ -8598,7 +8873,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,
@ -9854,7 +10129,7 @@ int find_set(REP_SETS *sets,REP_SET *find)
return i;
}
}
return i; /* return new postion */
return i; /* return new position */
}
/* find if there is a found_set with same table_offset & found_offset
@ -9874,7 +10149,7 @@ int find_found(FOUND_SET *found_set,uint table_offset, int found_offset)
found_set[i].table_offset=table_offset;
found_set[i].found_offset=found_offset;
found_sets++;
return -i-2; /* return new postion */
return -i-2; /* return new position */
}
/* Return 1 if regexp starts with \b or ends with \b*/
@ -9990,6 +10265,7 @@ void free_pointer_array(POINTER_ARRAY *pa)
void replace_dynstr_append_mem(DYNAMIC_STRING *ds,
const char *val, int len)
{
char lower[512];
#ifdef __WIN__
fix_win_paths(val, len);
#endif
@ -9997,7 +10273,6 @@ void replace_dynstr_append_mem(DYNAMIC_STRING *ds,
if (display_result_lower)
{
/* Convert to lower case, and do this first */
char lower[512];
char *c= lower;
for (const char *v= val; *v; v++)
*c++= my_tolower(charset_info, *v);

View File

@ -18,18 +18,28 @@
#include <my_global.h>
#include <my_sys.h>
#include <m_string.h>
#include <my_dir.h>
#include "my_readline.h"
static bool init_line_buffer(LINE_BUFFER *buffer,File file,ulong size,
ulong max_size);
static bool init_line_buffer_from_string(LINE_BUFFER *buffer,char * str);
static size_t fill_buffer(LINE_BUFFER *buffer);
static char *intern_read_line(LINE_BUFFER *buffer, ulong *out_length, bool *truncated);
static char *intern_read_line(LINE_BUFFER *buffer, ulong *out_length);
LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file)
{
LINE_BUFFER *line_buff;
MY_STAT input_file_stat;
#ifndef __WIN__
if (my_fstat(fileno(file), &input_file_stat, MYF(MY_WME)) ||
MY_S_ISDIR(input_file_stat.st_mode) ||
MY_S_ISBLK(input_file_stat.st_mode))
return 0;
#endif
if (!(line_buff=(LINE_BUFFER*)
my_malloc(sizeof(*line_buff),MYF(MY_WME | MY_ZEROFILL))))
return 0;
@ -42,13 +52,12 @@ LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file)
}
char *batch_readline(LINE_BUFFER *line_buff, bool *truncated)
char *batch_readline(LINE_BUFFER *line_buff)
{
char *pos;
ulong out_length;
DBUG_ASSERT(truncated != NULL);
if (!(pos=intern_read_line(line_buff,&out_length, truncated)))
if (!(pos=intern_read_line(line_buff, &out_length)))
return 0;
if (out_length && pos[out_length-1] == '\n')
if (--out_length && pos[out_length-1] == '\r') /* Remove '\n' */
@ -162,7 +171,10 @@ static size_t fill_buffer(LINE_BUFFER *buffer)
if (!(buffer->buffer = (char*) my_realloc(buffer->buffer,
buffer->bufread+1,
MYF(MY_WME | MY_FAE))))
return (uint) -1;
{
buffer->error= my_errno;
return (size_t) -1;
}
buffer->start_of_line=buffer->buffer+start_offset;
buffer->end=buffer->buffer+bufbytes;
}
@ -177,7 +189,10 @@ static size_t fill_buffer(LINE_BUFFER *buffer)
/* Read in new stuff. */
if ((read_count= my_read(buffer->file, (uchar*) buffer->end, read_count,
MYF(MY_WME))) == MY_FILE_ERROR)
{
buffer->error= my_errno;
return (size_t) -1;
}
DBUG_PRINT("fill_buff", ("Got %lu bytes", (ulong) read_count));
@ -198,8 +213,7 @@ static size_t fill_buffer(LINE_BUFFER *buffer)
}
char *intern_read_line(LINE_BUFFER *buffer, ulong *out_length, bool *truncated)
char *intern_read_line(LINE_BUFFER *buffer, ulong *out_length)
{
char *pos;
size_t length;
@ -214,22 +228,25 @@ char *intern_read_line(LINE_BUFFER *buffer, ulong *out_length, bool *truncated)
if (pos == buffer->end)
{
/*
fill_buffer() can return 0 either on EOF in which case we abort
or when the internal buffer has hit the size limit. In the latter case
return what we have read so far and signal string truncation.
fill_buffer() can return NULL on EOF (in which case we abort),
on error, or when the internal buffer has hit the size limit.
In the latter case return what we have read so far and signal
string truncation.
*/
if (!(length=fill_buffer(buffer)) || length == (uint) -1)
if (!(length= fill_buffer(buffer)))
{
if (buffer->eof)
DBUG_RETURN(0);
}
else if (length == (size_t) -1)
DBUG_RETURN(NULL);
else
continue;
pos--; /* break line here */
*truncated= 1;
buffer->truncated= 1;
}
else
*truncated= 0;
buffer->truncated= 0;
buffer->end_of_line=pos+1;
*out_length=(ulong) (pos + 1 - buffer->eof - buffer->start_of_line);
DBUG_RETURN(buffer->start_of_line);

View File

@ -69,9 +69,13 @@ public:
}
static void *operator new(size_t size, MEM_ROOT *mem_root)
{ return (void*) alloc_root(mem_root, (uint) size); }
static void operator delete(void *ptr_arg,size_t size)
{ TRASH(ptr_arg, size); }
static void operator delete(void *ptr_arg, MEM_ROOT *mem_root)
static void operator delete(void *ptr_arg, size_t size)
{
(void) ptr_arg;
(void) size;
TRASH(ptr_arg, size);
}
static void operator delete(void *, MEM_ROOT *)
{ /* never called */ }
~String() { free(); }

View File

@ -1,40 +0,0 @@
EXTRA_DIST = \
cmake_parse_arguments.cmake \
cpack_source_ignore_files.cmake \
package_name.cmake \
configurable_file_content.in \
check_minimal_version.cmake \
create_initial_db.cmake.in \
make_dist.cmake.in \
dtrace.cmake \
abi_check.cmake \
bison.cmake \
configure.pl \
character_sets.cmake \
libutils.cmake \
readline.cmake \
mysql_version.cmake \
install_macros.cmake \
ssl.cmake \
plugin.cmake \
zlib.cmake \
stack_direction.c \
do_abi_check.cmake \
merge_archives_unix.cmake.in \
dtrace_prelink.cmake \
versioninfo.rc.in \
mysql_add_executable.cmake \
tags.cmake \
install_layout.cmake \
build_configurations/mysql_release.cmake \
os/Windows.cmake \
os/WindowsCache.cmake \
os/Linux.cmake \
os/SunOS.cmake \
os/Darwin.cmake \
os/HP-UX.cmake \
os/AIX.cmake \
os/OS400.cmake \
os/Cygwin.cmake

View File

@ -19,8 +19,16 @@
# plugin_audit.h and plugin_ftparser.h.
#
# We use gcc specific preprocessing command and sed/diff, so it will
# only be run on Unix and only if gcc is used.
IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_SYSTEM_NAME MATCHES "Linux")
# only be run on Unix and only if gcc is used. On some Unixes,
# (Solaris) sed or diff might act differently from GNU, so we run only
# on systems we can trust.
IF(APPLE OR CMAKE_SYSTEM_NAME MATCHES "Linux")
SET(RUN_ABI_CHECK 1)
ELSE()
SET(RUN_ABI_CHECK 0)
ENDIF()
IF(CMAKE_COMPILER_IS_GNUCC AND RUN_ABI_CHECK)
IF(CMAKE_C_COMPILER MATCHES "ccache$")
SET(COMPILER ${CMAKE_C_COMPILER_ARG1})
STRING(REGEX REPLACE "^ " "" COMPILER ${COMPILER})
@ -33,6 +41,8 @@ IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_SYSTEM_NAME MATCHES "Linux")
${CMAKE_SOURCE_DIR}/include/mysql.h
${CMAKE_SOURCE_DIR}/include/mysql/psi/psi_abi_v1.h
${CMAKE_SOURCE_DIR}/include/mysql/psi/psi_abi_v2.h
${CMAKE_SOURCE_DIR}/include/mysql/client_plugin.h
${CMAKE_SOURCE_DIR}/include/mysql/plugin_auth.h
)
ADD_CUSTOM_TARGET(abi_check ALL

View File

@ -101,8 +101,10 @@ IF(NOT COMPILATION_COMMENT)
ENDIF()
IF(WIN32)
# Sign executables with authenticode certificate
SET(SIGNCODE 1 CACHE BOOL "")
IF(NOT CMAKE_USING_VC_FREE_TOOLS)
# Sign executables with authenticode certificate
SET(SIGNCODE 1 CACHE BOOL "")
ENDIF()
ENDIF()
IF(UNIX)
@ -115,13 +117,26 @@ IF(UNIX)
OPTION(WITH_PIC "" ON) # Why?
# Ensure aio is available on Linux (required by InnoDB)
IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
CHECK_INCLUDE_FILES(libaio.h HAVE_LIBAIO_H)
CHECK_LIBRARY_EXISTS(aio io_queue_init "" HAVE_LIBAIO)
IF(NOT HAVE_LIBAIO_H OR NOT HAVE_LIBAIO)
MESSAGE(FATAL_ERROR "aio is required on Linux")
IF(NOT IGNORE_AIO_CHECK)
# Ensure aio is available on Linux (required by InnoDB)
CHECK_INCLUDE_FILES(libaio.h HAVE_LIBAIO_H)
CHECK_LIBRARY_EXISTS(aio io_queue_init "" HAVE_LIBAIO)
IF(NOT HAVE_LIBAIO_H OR NOT HAVE_LIBAIO)
MESSAGE(FATAL_ERROR "
aio is required on Linux, you need to install the required library:
Debian/Ubuntu: apt-get install libaio-dev
RedHat/Fedora/Oracle Linux: yum install libaio-devel
SuSE: zypper install libaio-devel
If you really do not want it, pass -DIGNORE_AIO_CHECK to cmake.
")
ENDIF()
ENDIF()
# Enable fast mutexes on Linux
OPTION(WITH_FAST_MUTEXES "" ON)
ENDIF()
ENDIF()
@ -131,12 +146,12 @@ IF(UNIX)
# Default GCC flags
IF(CMAKE_COMPILER_IS_GNUCC)
SET(COMMON_C_FLAGS "-g -static-libgcc -fno-omit-frame-pointer")
SET(COMMON_C_FLAGS "-g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing")
SET(CMAKE_C_FLAGS_DEBUG "-O ${COMMON_C_FLAGS}")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_C_FLAGS}")
ENDIF()
IF(CMAKE_COMPILER_IS_GNUCXX)
SET(COMMON_CXX_FLAGS "-g -static-libgcc -fno-omit-frame-pointer")
SET(COMMON_CXX_FLAGS "-g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing")
SET(CMAKE_CXX_FLAGS_DEBUG "-O ${COMMON_CXX_FLAGS}")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_CXX_FLAGS}")
ENDIF()
@ -176,9 +191,9 @@ IF(UNIX)
# OSX flags
IF(APPLE)
SET(COMMON_C_FLAGS "-g -fno-common")
SET(COMMON_C_FLAGS "-g -fno-common -fno-strict-aliasing")
# XXX: why are we using -felide-constructors on OSX?
SET(COMMON_CXX_FLAGS "-g -fno-common -felide-constructors")
SET(COMMON_CXX_FLAGS "-g -fno-common -felide-constructors -fno-strict-aliasing")
SET(CMAKE_C_FLAGS_DEBUG "-O ${COMMON_C_FLAGS}")
SET(CMAKE_CXX_FLAGS_DEBUG "-O ${COMMON_CXX_FLAGS}")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-Os ${COMMON_C_FLAGS}")
@ -219,22 +234,4 @@ IF(UNIX)
ENDIF()
ENDIF()
ENDIF()
IF(CMAKE_C_FLAGS_DEBUG)
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}"
CACHE STRING "Debug C compile flags")
ENDIF()
IF(CMAKE_CXX_FLAGS_DEBUG)
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}"
CACHE STRING "Debug C++ compile flags")
ENDIF()
IF(CMAKE_C_FLAGS_RELWITHDEBINFO)
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}"
CACHE STRING "RelWithDebInfo C compile flags")
ENDIF()
IF(CMAKE_CXX_FLAGS_RELWITHDEBINFO)
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}"
CACHE STRING "RelWithDebInfo C++ compile flags")
ENDIF()
ENDIF()

View File

@ -1,4 +1,4 @@
# Copyright (C) 2009 Sun Microsystems, Inc
# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
#
# 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
@ -13,17 +13,19 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#Charsets and collations
# Charsets and collations
IF(NOT DEFAULT_CHARSET)
SET(DEFAULT_CHARSET "latin1")
SET(DEFAULT_CHARSET "latin1")
ENDIF()
IF(NOT DEFAULT_COLLATIONS)
SET(DEFAULT_COLLATION "latin1_swedish_ci")
IF(NOT DEFAULT_COLLATION)
SET(DEFAULT_COLLATION "latin1_swedish_ci")
ENDIF()
SET(CHARSETS ${DEFAULT_CHARSET} latin1 utf8 utf8mb4)
SET(CHARSETS_COMPLEX big5 cp1250 cp932 eucjpms euckr gb2312 gbk latin1 latin2 sjis tis620 ucs2 ujis utf8 utf8mb4 utf16 utf32)
SET(CHARSETS_COMPLEX
big5 cp1250 cp932 eucjpms euckr gb2312 gbk latin1 latin2
sjis tis620 ucs2 ujis utf8 utf8mb4 utf16 utf32)
SET(CHARSETS_AVAILABLE
binary armscii8 ascii big5 cp1250 cp1251 cp1256 cp1257

View File

@ -15,7 +15,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Handy macro to parse macro arguments
MACRO(CMAKE_PARSE_ARGUMENTS prefix arg_names option_names)
MACRO(MYSQL_PARSE_ARGUMENTS prefix arg_names option_names)
SET(DEFAULT_ARGS)
FOREACH(arg_name ${arg_names})
SET(${prefix}_${arg_name})

View File

@ -185,6 +185,16 @@ foreach my $option (@ARGV)
($option =~ /enable/ ? "1" : "0");
next;
}
if ($option =~ /with-comment=/)
{
$cmakeargs = $cmakeargs." \"-DWITH_COMMENT=".substr($option,13)."\"";
next;
}
if ($option =~ /with-gcov/)
{
$cmakeargs = $cmakeargs." -DENABLE_GCOV=ON";
next;
}
$option = uc($option);
$option =~ s/-/_/g;

View File

@ -53,23 +53,27 @@
SET(abi_check_out ${BINARY_DIR}/abi_check.out)
FOREACH(file ${ABI_HEADERS})
SET(tmpfile ${file}.pp.tmp)
EXECUTE_PROCESS(
COMMAND ${COMPILER}
-E -nostdinc -dI -DMYSQL_ABI_CHECK -I${SOURCE_DIR}/include
-I${BINARY_DIR}/include -I${SOURCE_DIR}/include/mysql -I${SOURCE_DIR}/sql
${file}
ERROR_QUIET OUTPUT_FILE ${tmpfile})
EXECUTE_PROCESS(
COMMAND sed -e
"/^# /d" -e "/^[ ]*$/d" -e "/^#pragma GCC set_debug_pwd/d" -e "/^#ident/d"
RESULT_VARIABLE result OUTPUT_FILE ${abi_check_out} INPUT_FILE ${tmpfile})
GET_FILENAME_COMPONENT(header_basename ${file} NAME)
SET(tmpfile ${BINARY_DIR}/${header_basename}.pp.tmp)
EXECUTE_PROCESS(
COMMAND ${COMPILER}
-E -nostdinc -dI -DMYSQL_ABI_CHECK -I${SOURCE_DIR}/include
-I${BINARY_DIR}/include -I${SOURCE_DIR}/include/mysql -I${SOURCE_DIR}/sql
${file}
ERROR_QUIET OUTPUT_FILE ${tmpfile})
EXECUTE_PROCESS(
COMMAND sed -e "/^# /d"
-e "/^[ ]*$/d"
-e "/^#pragma GCC set_debug_pwd/d"
-e "/^#ident/d"
RESULT_VARIABLE result OUTPUT_FILE ${abi_check_out} INPUT_FILE ${tmpfile})
IF(NOT ${result} EQUAL 0)
MESSAGE(FATAL_ERROR "sed returned error ${result}")
ENDIF()
FILE(REMOVE ${tmpfile})
EXECUTE_PROCESS(COMMAND diff -w ${file}.pp ${abi_check_out} RESULT_VARIABLE
result)
EXECUTE_PROCESS(
COMMAND diff -w ${file}.pp ${abi_check_out} RESULT_VARIABLE result)
IF(NOT ${result} EQUAL 0)
MESSAGE(FATAL_ERROR
"ABI check found difference between ${file}.pp and ${abi_check_out}")

View File

@ -153,13 +153,23 @@ ENDFUNCTION()
# to mysqld.
MACRO (DTRACE_INSTRUMENT_STATIC_LIBS target libs)
IF(CMAKE_SYSTEM_NAME MATCHES "SunOS" AND ENABLE_DTRACE)
# Filter out non-static libraries in the list, if any
SET(static_libs)
FOREACH(lib ${libs})
GET_TARGET_PROPERTY(libtype ${lib} TYPE)
IF(libtype MATCHES STATIC_LIBRARY)
SET(static_libs ${static_lics} ${lib})
ENDIF()
ENDFOREACH()
FOREACH(lib ${static_libs})
SET(dirs ${dirs} ${TARGET_OBJECT_DIRECTORY_${lib}})
ENDFOREACH()
SET (obj ${CMAKE_CURRENT_BINARY_DIR}/${target}_dtrace_all.o)
ADD_CUSTOM_COMMAND(
OUTPUT ${obj}
DEPENDS ${libs}
DEPENDS ${static_libs}
COMMAND ${CMAKE_COMMAND}
-DDTRACE=${DTRACE}
-DOUTFILE=${obj}

View File

@ -1,4 +1,4 @@
# Copyright (C) 2007 MySQL AB
# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
#
# 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
@ -11,22 +11,20 @@
#
# 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 St, Fifth Floor, Boston, MA 02110-1301 USA
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#Makefile.am example for a plugin
pkgplugindir= $(pkglibdir)/plugin
# The sole purpose of this cmake control file is to create the "INFO_BIN" file.
AM_CPPFLAGS = -I$(top_srcdir)/include
# By having a separate cmake file for this, it is ensured this happens
# only in the build (Unix: "make") phase, not when cmake runs.
# This, in turn, avoids creating stuff in the source directory -
# it should get into the binary directory only.
EXTRA_LTLIBRARIES= adt_null.la
pkgplugin_LTLIBRARIES= @plugin_audit_null_shared_target@
adt_null_la_LDFLAGS= -module -rpath $(pkgplugindir)
adt_null_la_CPPFLAGS= $(AM_CPPFLAGS) -DMYSQL_DYNAMIC_PLUGIN
adt_null_la_SOURCES= audit_null.c
EXTRA_LIBRARIES= libadtnull.a
noinst_LIBRARIES= @plugin_audit_null_static_target@
libadtnull_a_SOURCES= audit_null.c
# Get the macros which the "INFO_*" files.
INCLUDE(${CMAKE_BINARY_DIR}/info_macros.cmake)
# Here is where the action is.
CREATE_INFO_BIN()
EXTRA_DIST= plug.in CMakeLists.txt

132
cmake/info_macros.cmake.in Normal file
View File

@ -0,0 +1,132 @@
# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
#
# 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; 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 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 St, Fifth Floor, Boston, MA 02110-1301 USA
# Handle/create the "INFO_*" files describing a MySQL (server) binary.
# This is part of the fix for bug#42969.
# Several of cmake's variables need to be translated from '@' notation
# to '${}', this is done by the "configure" call in top level "CMakeLists.txt".
# If further variables are used in this file, add them to this list.
SET(VERSION "@VERSION@")
SET(CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@")
SET(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@")
SET(CMAKE_GENERATOR "@CMAKE_GENERATOR@")
SET(CMAKE_SIZEOF_VOID_P "@CMAKE_SIZEOF_VOID_P@")
SET(BZR_EXECUTABLE "@BZR_EXECUTABLE@")
SET(CMAKE_CROSSCOMPILING "@CMAKE_CROSSCOMPILING@")
SET(CMAKE_HOST_SYSTEM "@CMAKE_HOST_SYSTEM@")
SET(CMAKE_HOST_SYSTEM_PROCESSOR "@CMAKE_HOST_SYSTEM_PROCESSOR@")
SET(CMAKE_SYSTEM "@CMAKE_SYSTEM@")
SET(CMAKE_SYSTEM_PROCESSOR "@CMAKE_SYSTEM_PROCESSOR@")
# Create an "INFO_SRC" file with information about the source (only).
# We use "bzr version-info", if possible, and the "VERSION" contents.
#
# Outside development (BZR tree), the "INFO_SRC" file will not be modified
# provided it exists (from "make dist" or a source tarball creation).
MACRO(CREATE_INFO_SRC target_dir)
SET(INFO_SRC "${target_dir}/INFO_SRC")
IF(EXISTS ${CMAKE_SOURCE_DIR}/.bzr)
# Sources are in a BZR repository: Always update.
EXECUTE_PROCESS(
COMMAND ${BZR_EXECUTABLE} version-info ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE VERSION_INFO
RESULT_VARIABLE RESULT
)
FILE(WRITE ${INFO_SRC} "${VERSION_INFO}\n")
# to debug, add: FILE(APPEND ${INFO_SRC} "\nResult ${RESULT}\n")
# For better readability ...
FILE(APPEND ${INFO_SRC} "\nMySQL source ${VERSION}\n")
ELSEIF(EXISTS ${INFO_SRC})
# Outside a BZR tree, there is no need to change an existing "INFO_SRC",
# it cannot be improved.
ELSEIF(EXISTS ${CMAKE_SOURCE_DIR}/Docs/INFO_SRC)
# If we are building from a source distribution, it also contains "INFO_SRC".
# Similar, the export used for a release build already has the file.
FILE(READ ${CMAKE_SOURCE_DIR}/Docs/INFO_SRC SOURCE_INFO)
FILE(WRITE ${INFO_SRC} "${SOURCE_INFO}\n")
ELSEIF(EXISTS ${CMAKE_SOURCE_DIR}/INFO_SRC)
# This is not the proper location, but who knows ...
FILE(READ ${CMAKE_SOURCE_DIR}/INFO_SRC SOURCE_INFO)
FILE(WRITE ${INFO_SRC} "${SOURCE_INFO}\n")
ELSE()
# This is a fall-back.
FILE(WRITE ${INFO_SRC} "\nMySQL source ${VERSION}\n")
ENDIF()
ENDMACRO(CREATE_INFO_SRC)
# This is for the "real" build, must be run again with each cmake run
# to make sure we report the current flags (not those of some previous run).
MACRO(CREATE_INFO_BIN)
SET(INFO_BIN "Docs/INFO_BIN")
FILE(WRITE ${INFO_BIN} "===== Information about the build process: =====\n")
IF (WIN32)
EXECUTE_PROCESS(COMMAND cmd /c date /T OUTPUT_VARIABLE TMP_DATE)
ELSEIF(UNIX)
EXECUTE_PROCESS(COMMAND date "+%Y-%m-%d %H:%M:%S" OUTPUT_VARIABLE TMP_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
ELSE()
SET(TMP_DATE "(no date command known for this platform)")
ENDIF()
SITE_NAME(HOSTNAME)
FILE(APPEND ${INFO_BIN} "Build was run at ${TMP_DATE} on host '${HOSTNAME}'\n\n")
# According to the cmake docs, these variables should always be set.
# However, they are empty in my tests, using cmake 2.6.4 on Linux, various Unix, and Windows.
# Still, include this code, so we will profit if a build environment does provide that info.
IF(CMAKE_HOST_SYSTEM)
FILE(APPEND ${INFO_BIN} "Build was done on ${CMAKE_HOST_SYSTEM} using ${CMAKE_HOST_SYSTEM_PROCESSOR}\n")
ENDIF()
IF(CMAKE_CROSSCOMPILING)
FILE(APPEND ${INFO_BIN} "Build was done for ${CMAKE_SYSTEM} using ${CMAKE_SYSTEM_PROCESSOR}\n")
ENDIF()
# ${CMAKE_VERSION} doesn't work in 2.6.0, use the separate components.
FILE(APPEND ${INFO_BIN} "Build was done using cmake ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} \n\n")
IF (WIN32)
FILE(APPEND ${INFO_BIN} "===== Compiler / generator used: =====\n")
FILE(APPEND ${INFO_BIN} ${CMAKE_GENERATOR} "\n\n")
ELSEIF(UNIX)
FILE(APPEND ${INFO_BIN} "===== Compiler flags used (from the 'sql/' subdirectory): =====\n")
IF(EXISTS sql/CMakeFiles/sql.dir/flags.make)
EXECUTE_PROCESS(COMMAND egrep "^# compile|^C_|^CXX_" sql/CMakeFiles/sql.dir/flags.make OUTPUT_VARIABLE COMPILE_FLAGS)
FILE(APPEND ${INFO_BIN} ${COMPILE_FLAGS} "\n")
ELSE()
FILE(APPEND ${INFO_BIN} "File 'sql/CMakeFiles/sql.dir/flags.make' is not yet found.\n\n")
ENDIF()
ENDIF()
FILE(APPEND ${INFO_BIN} "Pointer size: ${CMAKE_SIZEOF_VOID_P}\n\n")
FILE(APPEND ${INFO_BIN} "===== Feature flags used: =====\n")
IF(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
# Attention: "-N" prevents cmake from entering a recursion, and it must be a separate flag from "-L".
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -N -L ${CMAKE_BINARY_DIR} OUTPUT_VARIABLE FEATURE_FLAGS)
FILE(APPEND ${INFO_BIN} ${FEATURE_FLAGS} "\n")
ELSE()
FILE(APPEND ${INFO_BIN} "File 'CMakeCache.txt' is not yet found.\n\n")
ENDIF()
FILE(APPEND ${INFO_BIN} "===== EOF =====\n")
ENDMACRO(CREATE_INFO_BIN)

View File

@ -1,4 +1,4 @@
# Copyright (C) 2006 MySQL AB
# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
#
# 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
@ -11,14 +11,21 @@
#
# 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 St, Fifth Floor, Boston, MA 02110-1301 USA
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
AM_CPPFLAGS = -I$(srcdir) -I$(top_builddir)/include \
-I$(top_srcdir)/unittest/mytap -I$(top_srcdir)/include
AM_LDFLAGS = -L$(top_builddir)/unittest/mytap
# The sole purpose of this cmake control file is to create the "INFO_SRC" file.
LDADD = -lmytap
# As long as and "bzr pull" (or "bzr commit") is followed by a "cmake",
# the call in top level "CMakeLists.txt" is sufficient.
# This file is to provide a separate target for the "make" phase,
# to ensure the BZR revision-id is correct even after a sequence
# cmake ; make ; bzr pull ; make
# Get the macros which handle the "INFO_*" files.
INCLUDE(${CMAKE_BINARY_DIR}/info_macros.cmake)
# Here is where the action is.
CREATE_INFO_SRC(${CMAKE_BINARY_DIR}/Docs)
# We omit core-t here, since it will always fail.
noinst_PROGRAMS = simple-t skip-t todo-t skip_all-t no_plan-t

View File

@ -26,7 +26,7 @@
# Build as per default RPM layout, with prefix=/usr
#
# DEB
# Build as per STANDALONE, prefix=/opt/mysql-$major.$minor
# Build as per STANDALONE, prefix=/opt/mysql/server-$major.$minor
#
# SVR4
# Solaris package layout suitable for pkg* tools, prefix=/opt/mysql/mysql
@ -59,19 +59,22 @@
# - INSTALL_SUPPORTFILESDIR (various extra support files)
#
# - INSTALL_MYSQLDATADIR (data directory)
#
# When changing this page, _please_ do not forget to update public Wiki
# http://forge.mysql.com/wiki/CMake#Fine-tuning_installation_paths
IF(NOT INSTALL_LAYOUT)
SET(DEFAULT_INSTALL_LAYOUT "STANDALONE")
ENDIF()
SET(INSTALL_LAYOUT "${DEFAULT_INSTALL_LAYOUT}"
CACHE STRING "Installation directory layout. Options are: STANDALONE (as in zip or tar.gz installer) or UNIX")
CACHE STRING "Installation directory layout. Options are: STANDALONE (as in zip or tar.gz installer), RPM, DEB, SVR4")
IF(UNIX)
IF(INSTALL_LAYOUT MATCHES "RPM")
SET(default_prefix "/usr")
ELSEIF(INSTALL_LAYOUT MATCHES "DEB")
SET(default_prefix "/opt/${MYSQL_BASE_VERSION}")
SET(default_prefix "/opt/mysql/server-${MYSQL_BASE_VERSION}")
# This is required to avoid "cpack -GDEB" default of prefix=/usr
SET(CPACK_SET_DESTDIR ON)
ELSEIF(INSTALL_LAYOUT MATCHES "SVR4")
@ -83,11 +86,25 @@ IF(UNIX)
SET(CMAKE_INSTALL_PREFIX ${default_prefix}
CACHE PATH "install prefix" FORCE)
ENDIF()
SET(VALID_INSTALL_LAYOUTS "RPM" "STANDALONE" "DEB" "SVR4")
LIST(FIND VALID_INSTALL_LAYOUTS "${INSTALL_LAYOUT}" ind)
IF(ind EQUAL -1)
MESSAGE(FATAL_ERROR "Invalid INSTALL_LAYOUT parameter:${INSTALL_LAYOUT}."
" Choose between ${VALID_INSTALL_LAYOUTS}" )
ENDIF()
SET(SYSCONFDIR "${CMAKE_INSTALL_PREFIX}/etc"
CACHE PATH "config directory (for my.cnf)")
MARK_AS_ADVANCED(SYSCONFDIR)
ENDIF()
#
# plugin_tests's value should not be used by imported plugins,
# just use if(INSTALL_PLUGINTESTDIR).
# The plugin must set its own install path for tests
#
FILE(GLOB plugin_tests ${CMAKE_SOURCE_DIR}/plugin/*/tests)
#
# STANDALONE layout
#
@ -112,6 +129,7 @@ SET(INSTALL_SQLBENCHDIR_STANDALONE ".")
SET(INSTALL_SUPPORTFILESDIR_STANDALONE "support-files")
#
SET(INSTALL_MYSQLDATADIR_STANDALONE "data")
SET(INSTALL_PLUGINTESTDIR_STANDALONE ${plugin_tests})
#
# RPM layout
@ -142,6 +160,7 @@ SET(INSTALL_SQLBENCHDIR_RPM "")
SET(INSTALL_SUPPORTFILESDIR_RPM "share/mysql")
#
SET(INSTALL_MYSQLDATADIR_RPM "/var/lib/mysql")
SET(INSTALL_PLUGINTESTDIR_RPM ${plugin_tests})
#
# DEB layout
@ -167,6 +186,7 @@ SET(INSTALL_SQLBENCHDIR_DEB ".")
SET(INSTALL_SUPPORTFILESDIR_DEB "support-files")
#
SET(INSTALL_MYSQLDATADIR_DEB "data")
SET(INSTALL_PLUGINTESTDIR_DEB ${plugin_tests})
#
# SVR4 layout
@ -192,6 +212,7 @@ SET(INSTALL_SQLBENCHDIR_SVR4 ".")
SET(INSTALL_SUPPORTFILESDIR_SVR4 "support-files")
#
SET(INSTALL_MYSQLDATADIR_SVR4 "/var/lib/mysql")
SET(INSTALL_PLUGINTESTDIR_SVR4 ${plugin_tests})
# Clear cached variables if install layout was changed
@ -206,7 +227,7 @@ SET(OLD_INSTALL_LAYOUT ${INSTALL_LAYOUT} CACHE INTERNAL "")
# will be defined as ${INSTALL_BINDIR_STANDALONE} by default if STANDALONE
# layout is chosen)
FOREACH(var BIN SBIN LIB MYSQLSHARE SHARE PLUGIN INCLUDE SCRIPT DOC MAN
INFO MYSQLTEST SQLBENCH DOCREADME SUPPORTFILES MYSQLDATA)
INFO MYSQLTEST SQLBENCH DOCREADME SUPPORTFILES MYSQLDATA PLUGINTEST)
SET(INSTALL_${var}DIR ${INSTALL_${var}DIR_${INSTALL_LAYOUT}}
CACHE STRING "${var} installation directory" ${FORCE})
MARK_AS_ADVANCED(INSTALL_${var}DIR)

View File

@ -78,12 +78,14 @@ FUNCTION(INSTALL_MANPAGE file)
ELSE()
SET(SECTION man8)
ENDIF()
INSTALL(FILES "${MANPAGE}" DESTINATION "${INSTALL_MANDIR}/${SECTION}")
MESSAGE("huj!")
INSTALL(FILES "${MANPAGE}" DESTINATION "${INSTALL_MANDIR}/${SECTION}"
COMPONENT ManPages)
ENDIF()
ENDFUNCTION()
FUNCTION(INSTALL_SCRIPT)
CMAKE_PARSE_ARGUMENTS(ARG
MYSQL_PARSE_ARGUMENTS(ARG
"DESTINATION;COMPONENT"
""
${ARGN}
@ -137,12 +139,7 @@ IF(UNIX)
STRING(REPLACE "${CMAKE_CFG_INTDIR}"
"\${CMAKE_INSTALL_CONFIG_NAME}" output ${output})
ENDIF()
IF(component)
SET(COMP COMPONENT ${component})
ELSE()
SET(COMP)
ENDIF()
INSTALL(FILES ${output} DESTINATION ${destination} ${COMP})
INSTALL(FILES ${output} DESTINATION ${destination} COMPONENT ${component})
ENDIF()
ENDMACRO()
@ -205,7 +202,7 @@ ENDMACRO()
#
FUNCTION(MYSQL_INSTALL_TARGETS)
CMAKE_PARSE_ARGUMENTS(ARG
MYSQL_PARSE_ARGUMENTS(ARG
"DESTINATION;COMPONENT"
""
${ARGN}
@ -224,8 +221,6 @@ FUNCTION(MYSQL_INSTALL_TARGETS)
IF(SIGNCODE AND SIGNCODE_ENABLED)
SIGN_TARGET(${target})
ENDIF()
# For Windows, add version info to executables
ADD_VERSION_INFO(${target})
# Install man pages on Unix
IF(UNIX)
GET_TARGET_PROPERTY(target_location ${target} LOCATION)
@ -249,7 +244,7 @@ SET(DEBUGBUILDDIR "${BINARY_PARENTDIR}/debug" CACHE INTERNAL "Directory of debug
FUNCTION(INSTALL_DEBUG_TARGET target)
CMAKE_PARSE_ARGUMENTS(ARG
MYSQL_PARSE_ARGUMENTS(ARG
"DESTINATION;RENAME;PDB_DESTINATION;COMPONENT"
""
${ARGN}

View File

@ -213,7 +213,7 @@ ENDMACRO()
# [OUTPUT_NAME output_name]
#)
MACRO(MERGE_LIBRARIES)
CMAKE_PARSE_ARGUMENTS(ARG
MYSQL_PARSE_ARGUMENTS(ARG
"EXPORTS;OUTPUT_NAME;COMPONENT"
"STATIC;SHARED;MODULE;NOINSTALL"
${ARGN}
@ -250,6 +250,9 @@ MACRO(MERGE_LIBRARIES)
ENDFOREACH()
ENDIF()
CREATE_EXPORT_FILE(SRC ${TARGET} "${ARG_EXPORTS}")
IF(NOT ARG_NOINSTALL)
ADD_VERSION_INFO(${TARGET} SHARED SRC)
ENDIF()
ADD_LIBRARY(${TARGET} ${LIBTYPE} ${SRC})
TARGET_LINK_LIBRARIES(${TARGET} ${LIBS})
IF(ARG_OUTPUT_NAME)

54
cmake/maintainer.cmake Normal file
View File

@ -0,0 +1,54 @@
# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
#
# 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; 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 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 St, Fifth Floor, Boston, MA 02110-1301 USA
INCLUDE(CheckCCompilerFlag)
# Setup GCC (GNU C compiler) warning options.
MACRO(SET_MYSQL_MAINTAINER_GNU_C_OPTIONS)
SET(MY_MAINTAINER_WARNINGS
"-Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing -Werror")
CHECK_C_COMPILER_FLAG("-Wdeclaration-after-statement"
HAVE_DECLARATION_AFTER_STATEMENT)
IF(HAVE_DECLARATION_AFTER_STATEMENT)
SET(MY_MAINTAINER_DECLARATION_AFTER_STATEMENT
"-Wdeclaration-after-statement")
ENDIF()
SET(MY_MAINTAINER_C_WARNINGS
"${MY_MAINTAINER_WARNINGS} ${MY_MAINTAINER_DECLARATION_AFTER_STATEMENT}"
CACHE STRING "C warning options used in maintainer builds.")
# Do not make warnings in checks into errors.
SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Wno-error")
ENDMACRO()
# Setup G++ (GNU C++ compiler) warning options.
MACRO(SET_MYSQL_MAINTAINER_GNU_CXX_OPTIONS)
SET(MY_MAINTAINER_CXX_WARNINGS
"${MY_MAINTAINER_WARNINGS} -Wno-unused-parameter -Woverloaded-virtual"
CACHE STRING "C++ warning options used in maintainer builds.")
ENDMACRO()
# Setup ICC (Intel C Compiler) warning options.
MACRO(SET_MYSQL_MAINTAINER_INTEL_C_OPTIONS)
SET(MY_MAINTAINER_WARNINGS "-Wcheck")
SET(MY_MAINTAINER_C_WARNINGS "${MY_MAINTAINER_WARNINGS}"
CACHE STRING "C warning options used in maintainer builds.")
ENDMACRO()
# Setup ICPC (Intel C++ Compiler) warning options.
MACRO(SET_MYSQL_MAINTAINER_INTEL_CXX_OPTIONS)
SET(MY_MAINTAINER_CXX_WARNINGS "${MY_MAINTAINER_WARNINGS}"
CACHE STRING "C++ warning options used in maintainer builds.")
ENDMACRO()

View File

@ -1,4 +1,4 @@
# Copyright (C) 2009 Sun Microsystems, Inc
# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
#
# 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
@ -14,19 +14,12 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Make source distribution
# If bzr is present, run bzr export, add output of BUILD/autorun.sh
# if autotools are present, also pack bison output into it.
# If bzr is present, run bzr export.
# Otherwise, just run cpack with source configuration.
SET(CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@")
SET(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "@CPACK_SOURCE_PACKAGE_FILE_NAME@")
SET(GLIBTOOLIZE_EXECUTABLE "@GLIBTOOLIZE_EXECUTABLE@")
SET(LIBTOOLIZE_EXECUTABLE "@LIBTOOLIZE_EXECUTABLE@")
SET(ACLOCAL_EXECUTABLE "@ACLOCAL_EXECUTABLE@")
SET(AUTOCONF_EXECUTABLE "@AUTOCONF_EXECUTABLE@")
SET(AUTOHEADER_EXECUTABLE "@AUTOHEADER_EXECUTABLE@")
SET(AUTOMAKE_EXECUTABLE "@AUTOMAKE_EXECUTABLE@")
SET(CMAKE_CPACK_COMMAND "@CMAKE_CPACK_COMMAND@")
SET(CMAKE_COMMAND "@CMAKE_COMMAND@")
SET(BZR_EXECUTABLE "@BZR_EXECUTABLE@")
@ -35,6 +28,9 @@ SET(TAR_EXECUTABLE "@TAR_EXECUTABLE@")
SET(CMAKE_GENERATOR "@CMAKE_GENERATOR@")
SET(CMAKE_MAKE_PROGRAM "@CMAKE_MAKE_PROGRAM@")
SET(CMAKE_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@")
SET(PLUGIN_REPOS "@PLUGIN_REPOS@")
SET(VERSION "@VERSION@")
SET(MYSQL_DOCS_LOCATION "@MYSQL_DOCS_LOCATION@")
@ -58,6 +54,22 @@ IF(BZR_EXECUTABLE)
ENDIF()
ENDIF()
IF(BZR_EXECUTABLE)
FOREACH(REPO ${PLUGIN_REPOS})
GET_FILENAME_COMPONENT(PLUGIN_NAME ${REPO} NAME)
SET(DEST ${PACKAGE_DIR}/plugin/${PLUGIN_NAME})
MESSAGE(STATUS "Running bzr export for plugin/${PLUGIN_NAME}")
EXECUTE_PROCESS(
COMMAND "${BZR_EXECUTABLE}" export ${DEST}
WORKING_DIRECTORY ${REPO}
RESULT_VARIABLE RESULT
)
IF(NOT RESULT EQUAL 0)
MESSAGE(STATUS "bzr export failed")
ENDIF()
ENDFOREACH()
ENDIF()
IF(NOT BZR_EXECUTABLE)
MESSAGE(STATUS "bzr not found or source dir is not a repo, use CPack")
@ -101,44 +113,31 @@ IF(NOT BZR_EXECUTABLE)
)
ENDIF()
# Try to pack output of BUILD/autorun, if autotools are present
IF(GLIBTOOLIZE_EXECUTABLE OR LIBTOOLIZE_EXECUTABLE)
IF(ACLOCAL_EXECUTABLE AND AUTOMAKE_EXECUTABLE AND AUTOCONF_EXECUTABLE
AND AUTOHEADER_EXECUTABLE)
SET(HAVE_AUTOTOOLS 1)
ENDIF()
ENDIF()
IF(HAVE_AUTOTOOLS)
EXECUTE_PROCESS(COMMAND BUILD/autorun.sh
WORKING_DIRECTORY ${PACKAGE_DIR})
ELSE()
MESSAGE( "Autotools not found, resulting source package can only be built"
" with cmake")
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake/configure.pl
${PACKAGE_DIR}/configure
COPYONLY)
IF(UNIX)
EXECUTE_PROCESS(COMMAND chmod +x ${PACKAGE_DIR}/configure)
ENDIF()
ENDIF()
# Copy bison output
CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql/sql_yacc.h
${PACKAGE_DIR}/sql/sql_yacc.h COPYONLY)
CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql/sql_yacc.cc
${PACKAGE_DIR}/sql/sql_yacc.cc COPYONLY)
# Copy spec files
CONFIGURE_FILE(${CMAKE_BINARY_DIR}/support-files/mysql.${VERSION}.spec
${PACKAGE_DIR}/support-files/mysql.${VERSION}.spec COPYONLY)
# Add documentation, if user has specified where to find them
IF(MYSQL_DOCS_LOCATION)
MESSAGE("Copying documentation files from " ${MYSQL_DOCS_LOCATION})
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_directory "${MYSQL_DOCS_LOCATION}" "${PACKAGE_DIR}")
ENDIF()
# Ensure there is an "INFO_SRC" file.
INCLUDE(${CMAKE_BINARY_DIR}/info_macros.cmake)
IF(NOT EXISTS ${PACKAGE_DIR}/Docs/INFO_SRC)
CREATE_INFO_SRC(${PACKAGE_DIR}/Docs)
ENDIF()
# In case we used CPack, it could have copied some
# extra files that are not usable on different machines.
FILE(REMOVE ${PACKAGE_DIR}/CMakeCache.txt)
FILE(REMOVE_RECURSE ${PACKAGE_DIR}/autom4te.cache)
# When packing source, prefer gnu tar to "cmake -P tar"
# cmake does not preserve timestamps.gnuwin32 tar is broken, cygwin is ok

View File

@ -28,7 +28,7 @@ INCLUDE(cmake_parse_arguments)
FUNCTION (MYSQL_ADD_EXECUTABLE)
# Pass-through arguments for ADD_EXECUTABLE
CMAKE_PARSE_ARGUMENTS(ARG
MYSQL_PARSE_ARGUMENTS(ARG
"WIN32;MACOSX_BUNDLE;EXCLUDE_FROM_ALL;DESTINATION;COMPONENT"
""
${ARGN}
@ -37,7 +37,7 @@ FUNCTION (MYSQL_ADD_EXECUTABLE)
LIST(REMOVE_AT ARG_DEFAULT_ARGS 0)
SET(sources ${ARG_DEFAULT_ARGS})
ADD_VERSION_INFO(${target} EXECUTABLE sources)
ADD_EXECUTABLE(${target} ${ARG_WIN32} ${ARG_MACOSX_BUNDLE} ${ARG_EXCLUDE_FROM_ALL} ${sources})
# tell CPack where to install
IF(NOT ARG_EXCLUDE_FROM_ALL)

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