diff --git a/.bzrignore b/.bzrignore index 4c437cdd36c..e420b1590d1 100644 --- a/.bzrignore +++ b/.bzrignore @@ -9,15 +9,20 @@ *.core *.d *.da +*.dll +*.dylib *.exe +*.exp *.gcda *.gcno *.gcov *.idb +*.ilk *.la *.lai *.lib *.lo +*.manifest *.map *.o *.obj @@ -148,6 +153,7 @@ Makefile Makefile.in Makefile.in' PENDING/* +scripts/scripts TAGS VC++Files/client/mysql_amd64.dsp ac_available_languages_fragment @@ -606,6 +612,7 @@ include/mysql_version.h include/mysqld_ername.h include/mysqld_error.h include/openssl +include/probes_mysql_dtrace.h include/readline include/readline/*.h include/readline/readline.h @@ -1981,6 +1988,7 @@ sql-bench/test-transactions sql-bench/test-wisconsin sql/*.cpp sql/*.ds? +sql/*.def sql/*.vcproj sql/.deps/client.Po sql/.deps/derror.Po @@ -2116,6 +2124,7 @@ sql/.libs/udf_example.lai sql/.libs/udf_example.so.0 sql/.libs/udf_example.so.0.0.0 sql/client.c +sql/cmake_dummy.cc sql/Doxyfile sql/f.c sql/gen_lex_hash @@ -3046,6 +3055,7 @@ vio/viotest.cpp win/configure.data win/vs71cache.txt win/vs8cache.txt +win/nmake_cache.txt ylwrap zlib/*.ds? zlib/*.vcproj diff --git a/BUILD/FINISH.sh b/BUILD/FINISH.sh index b7f7a1db77e..e0d505a948f 100644 --- a/BUILD/FINISH.sh +++ b/BUILD/FINISH.sh @@ -4,8 +4,7 @@ extra_configs="$extra_configs $local_infile_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` diff --git a/BUILD/Makefile.am b/BUILD/Makefile.am deleted file mode 100644 index 56c86e7a80c..00000000000 --- a/BUILD/Makefile.am +++ /dev/null @@ -1,77 +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-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-forte \ - compile-solaris-amd64-forte-debug \ - compile-solaris-sparc \ - compile-solaris-sparc-debug \ - compile-solaris-sparc-forte \ - compile-solaris-sparc-purify diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index a23a801e7e0..a58360cc063 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -111,7 +111,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 diff --git a/BUILD/autorun.sh b/BUILD/autorun.sh index f4508ab12b6..e4ca52f00fe 100755 --- a/BUILD/autorun.sh +++ b/BUILD/autorun.sh @@ -1,38 +1,9 @@ #!/bin/sh -# Create MySQL autotools infrastructure +# 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 diff --git a/BUILD/cmake_configure.sh b/BUILD/cmake_configure.sh index 80423205274..f5efc13e011 100644 --- a/BUILD/cmake_configure.sh +++ b/BUILD/cmake_configure.sh @@ -1,14 +1,17 @@ #!/bin/sh -# Choose whether to use autoconf created configure -# of perl script that calls cmake. # 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 diff --git a/BUILD/compile-amd64-valgrind-max b/BUILD/compile-amd64-valgrind-max index fb8dce38df3..d9072ef56dd 100755 --- a/BUILD/compile-amd64-valgrind-max +++ b/BUILD/compile-amd64-valgrind-max @@ -7,18 +7,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 diff --git a/BUILD/compile-pentium-valgrind-max b/BUILD/compile-pentium-valgrind-max index 8ef47bfbc17..9b58c4321c9 100755 --- a/BUILD/compile-pentium-valgrind-max +++ b/BUILD/compile-pentium-valgrind-max @@ -7,18 +7,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 diff --git a/BUILD/compile-pentium-valgrind-max-no-ndb b/BUILD/compile-pentium-valgrind-max-no-ndb index f480f83ebf7..b78303fb136 100755 --- a/BUILD/compile-pentium-valgrind-max-no-ndb +++ b/BUILD/compile-pentium-valgrind-max-no-ndb @@ -7,18 +7,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 diff --git a/BUILD/compile-pentium64-valgrind-max b/BUILD/compile-pentium64-valgrind-max index eb3d20c874d..ebc7fc68b88 100755 --- a/BUILD/compile-pentium64-valgrind-max +++ b/BUILD/compile-pentium64-valgrind-max @@ -7,18 +7,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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 5eddad4ad15..07809a8e29b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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,18 +115,27 @@ ENDIF() # Control aspects of the development environment which are # specific to MySQL maintainers and developers. # +INCLUDE (CheckCCompilerFlag) OPTION(MYSQL_MAINTAINER_MODE "MySQL maintainer-specific development environment" OFF) # Whether the maintainer mode should be enabled. IF(MYSQL_MAINTAINER_MODE) IF(CMAKE_COMPILER_IS_GNUCC) + 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 - "-Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing -Werror" - CACHE STRING "C warning options used in maintainer builds.") + "-Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing -Werror") 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.") ENDIF() + IF(CMAKE_COMPILER_IS_GNUCC) + SET(MY_MAINTAINER_C_WARNINGS + "${MY_MAINTAINER_C_WARNINGS} ${MY_MAINTAINER_DECLARATION_AFTER_STATEMENT}" + CACHE STRING "C warning options used in maintainer builds.") + 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") @@ -315,23 +331,33 @@ 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) 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 diff --git a/Docs/Makefile.am b/Docs/Makefile.am deleted file mode 100644 index 48030153a4e..00000000000 --- a/Docs/Makefile.am +++ /dev/null @@ -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 diff --git a/EXCEPTIONS-CLIENT b/EXCEPTIONS-CLIENT deleted file mode 100644 index c570ff7ba24..00000000000 --- a/EXCEPTIONS-CLIENT +++ /dev/null @@ -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 diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index fadd73d5094..00000000000 --- a/Makefile.am +++ /dev/null @@ -1,335 +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 \ - 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 \ - 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: - rm -rf `find $(distdir) -type d -name SCCS -print` - 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) - -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-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. - -test-unit: - cd unittest && $(MAKE) test - -test-ps: - cd mysql-test ; \ - @PERL@ ./mysql-test-run.pl $(force) --ps-protocol --mysqld=--binlog-format=mixed - -test-nr: - cd mysql-test ; \ - @PERL@ ./mysql-test-run.pl $(force) --mysqld=--binlog-format=row - -test-pr: - cd mysql-test ; \ - @PERL@ ./mysql-test-run.pl $(force) $(mem) --ps-protocol --mysqld=--binlog-format=row - -test-ns: - cd mysql-test ; \ - @PERL@ ./mysql-test-run.pl $(force) $(mem) --mysqld=--binlog-format=mixed ; \ - @PERL@ ./mysql-test-run.pl $(force) $(mem) --suite=funcs_1 - -test-binlog-statement: - cd mysql-test ; \ - @PERL@ ./mysql-test-run.pl $(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 --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 $(force) $(mem) --ps-protocol \ - --mysqld=--debug=+d,reprepare_each_statement - -test: test-unit test-ns test-pr - -smoke: - cd mysql-test ; \ - @PERL@ ./mysql-test-run.pl --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 --comment=normal --force --timer \ - --skip-ndbcluster --report-features $(EXP) - -cd mysql-test ; MTR_BUILD_THREAD=auto \ - @PERL@ ./mysql-test-run.pl --comment=ps --force --timer \ - --skip-ndbcluster --ps-protocol $(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 --comment=ndb+ps --force --timer \ - --ps-protocol --mysqld=--binlog-format=row --suite=ndb $(EXP) ; \ - MTR_BUILD_THREAD=auto \ - @PERL@ ./mysql-test-run.pl --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 --force --comment=funcs1+ps --ps-protocol --reorder --suite=funcs_1 $(EXP) - -cd mysql-test ; MTR_BUILD_THREAD=auto \ - @PERL@ ./mysql-test-run.pl --force --comment=funcs2 --suite=funcs_2 $(EXP) - -cd mysql-test ; MTR_BUILD_THREAD=auto \ - @PERL@ ./mysql-test-run.pl --force --comment=partitions --suite=parts $(EXP) - -cd mysql-test ; MTR_BUILD_THREAD=auto \ - @PERL@ ./mysql-test-run.pl --force --comment=stress --suite=stress $(EXP) - -cd mysql-test ; MTR_BUILD_THREAD=auto \ - @PERL@ ./mysql-test-run.pl --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 --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 --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 --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 --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 --force --comment=stress --suite=stress $(EXP) - -test-bt-debug: - -cd mysql-test ; MTR_BUILD_THREAD=auto \ - @PERL@ ./mysql-test-run.pl --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 --force --reorder --suite=funcs_1 ; \ - @PERL@ ./mysql-test-run.pl --force --suite=funcs_2 - -test-ext-rpl: - cd mysql-test ; \ - @PERL@ ./mysql-test-run.pl --force --suite=rpl - -test-ext-partitions: - cd mysql-test ; \ - @PERL@ ./mysql-test-run.pl --force --suite=parts - -test-ext-jp: - cd mysql-test ; \ - @PERL@ ./mysql-test-run.pl --force --suite=jp - -test-ext-stress: - cd mysql-test ; \ - @PERL@ ./mysql-test-run.pl --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 $(subset) --force --skip-ndb --skip-innodb --skip-im --skip-rpl ; \ - @PERL@ ./mysql-test-run.pl $(subset) --force --suite=funcs_1 --do-test=myisam ; \ - @PERL@ ./mysql-test-run.pl $(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) 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.h \ - $(top_srcdir)/include/mysql/psi/psi_abi_v1.h \ - $(top_srcdir)/include/mysql/psi/psi_abi_v2.h \ - $(top_srcdir)/include/mysql/client_plugin.h \ - $(top_srcdir)/include/mysql/plugin_auth.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 /abi_check.out file. -# -# A developer with a justified API change will then do a -# mv /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 diff --git a/README b/README index 42d80612174..5463de4a7e8 100644 --- a/README +++ b/README @@ -1,2210 +1,2254 @@ -This is a release of MySQL, a dual-license SQL DBMS. -MySQL is brought to you by the MySQL team at Oracle Corporation. - -************************************************************ -LICENSE -************************************************************ -License information and use restrictions of this software can -be found in these files: -- For GPL (free) distributions, see the COPYING file and - the EXCEPTIONS-CLIENT file. -- For commercial distributions, see the LICENSE.mysql file. - -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. - -************************************************************ -FURTHER INFORMATION -************************************************************ -For further information about MySQL or additional documentation, see: -- The latest information about MySQL: http://dev.mysql.com/ -- The current MySQL documentation: http://dev.mysql.com/doc/ - -Some manual sections of special interest: -- If you are migrating from an older version of MySQL, please read -the "Upgrading from..." section first! -- To see what MySQL can do, take a look at the features section. -- For installation instructions, see the Installing and Upgrading -chapter. -- For the new features/bugfix history, see the Change History appendix. -- For the currently known bugs/misfeatures (known errors) see the -Problems and Common Errors appendix. -- For a list of developers and other contributors, see the Credits -appendix. - -A local copy of the MySQL Reference Manual can be found in the Docs -directory in GNU Info format. You can also browse the manual online or -download it in any of several formats at the URL given earlier in this -file. - -************************************************************ -IMPORTANT: - -Bug or error reports should be sent to http://bugs.mysql.com. -************************************************************ - - -************************************************************ -THIRD-PARTY SOFTWARE -************************************************************ - -%%The following software may be included in this product: -FindGTest.cmake (part of CMake 2.8.0) - -Use of any of this software is governed by the terms of the license below: - -# Copyright 2009 Kitware, Inc. -# Copyright 2009 Philip Lowman -# Copyright 2009 Daniel Blezek -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#=========================================================================== -== -# (To distributed this file outside of CMake, substitute the full -# License text for the above reference.) -# -# Thanks to Daniel Blezek for the GTEST_ADD_TESTS code - - -Text of Copyright.txt mentioned above: - -CMake - Cross Platform Makefile Generator -Copyright 2000-2009 Kitware, Inc., Insight Software Consortium -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -* Neither the names of Kitware, Inc., the Insight Software Consortium, - nor the names of their contributors may be used to endorse or promote - products derived from this software without specific prior written - permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -*************************************************************************** - -%%The following software may be included in this product: -Cmake - -Use of any of this software is governed by the terms of the license below: - -CMake is distributed under BSD License - - Copyright (c) 2008, Kitware, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, -this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. - * Neither the name of Kitware, Inc. nor the names of its contributors -may be used to endorse or promote products derived from this software without -specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY Kitware, Inc. "AS IS" AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT -SHALL Kitware Inc. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT -OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY -OF SUCH DAMAGE. - -Additional License(s) - -cmake-2.4.8/Utilities/cmtar/compat/gethostname.c: - gethostname.c: minimal substitute for missing gethostname() function - created 2000-Mar-02 jmk - requires SVR4 uname() and -lc - - by Jim Knoble - Copyright ? 2000 Jim Knoble - - Permission to use, copy, modify, distribute, and sell this software - and its documentation for any purpose is hereby granted without fee, - provided that the above copyright notice appear in all copies and - that both that copyright notice and this permission notice appear in - supporting documentation. - - This software is provided "as is", without warranty of any kind, - express or implied, including but not limited to the warranties of - merchantability, fitness for a particular purpose and - noninfringement. In no event shall the author(s) be liable for any - claim, damages or other liability, whether in an action of contract, - tort or otherwise, arising from, out of or in connection with the - software or the use or other dealings in the software. - ----------------------------------- - -* Originally written by Steven M. Bellovin while -* at the University of North Carolina at Chapel Hill. Later tweaked by -* a couple of people on Usenet. Completely overhauled by Rich $alz -* and Jim Berets in August, 1990. -* -* This code is in the public domain and has no copyright. - -------------------------------- - - THIS CODE IS SPECIFICALLY EXEMPTED FROM THE NCURSES PACKAGE COPYRIGHT. - You may freely copy it for use as a template for your own field types. - If you develop a field type that might be of general use, please send - it back to the ncurses maintainers for inclusion in the next version. - -************************************************************************** - - * - Author : Per Foreby, perf@efd.lth.se - * - Author : Juergen Pfeifer, juergen.pfeifer@gmx.net - * - - * -************************************************************************** - ----------------------------------------- - - Copyright (c) 2002 Insight Consortium. All rights reserved. - See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for -details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - --------------------------------------------- - - Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free -Software Foundati -on, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. - ---------------------------------------------------- - -cmake-2.4.8/Utilities/cmzlib/zlib.h: - zlib.h -- interface of the 'zlib' general purpose compression library - version 1.1.4, March 11th, 2002 - - Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must -not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source -distribution. - - Jean-loup Gailly Mark Adler - ----------------------------------------------- - - This source code was modified by Martin Hedenfalk - for - use in Curl. His latest changes were done 2000-09-18. - - It has since been patched away like a madman by Daniel Stenberg - to make it better applied to curl conditions, and to -make - it not use globals, pollute name space and more. This source code -awaits a - rewrite to work around the paragraph 2 in the BSD licenses as explained - below. - - Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Hgskolan - It has since been patched and modified a lot by Daniel Stenberg - to make it better applied to curl conditions, and to -make - it not use globals, pollute name space and more. This source code -awaits a - rewrite to work around the paragraph 2 in the BSD licenses as explained - below. - - Copyright (c) 1998, 1999 Kungliga Tekniska Hgskolan - (Royal Institute of Technology, Stockholm, Sweden). - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Institute nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE -LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - ---------------------------------------------- - - Permission to use, copy, modify, and distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED - WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF - MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND - CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER. - --------------------------------------------------- - -cmake-2.4.8/Utilities/cmcurl/inet_pton.c, -cmake-2.4.8/Source/CTest/Curl/inet_pto -n.c: - This is from the BIND 4.9.4 release, modified to compile by itself - - Copyright (c) 1996 by Internet Software Consortium. - - Permission to use, copy, modify, and distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM -DISCLAIMS - ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED -WARRANTIES - OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE - CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE -OF THIS - SOFTWARE. - -------------------------------------------------------- - -* Copyright (C) 2001 by Eric Kidd. All rights reserved. -* Copyright (C) 2001 by Luke Howard. All rights reserved. -* Copyright (C) 2002 Ximian, Inc. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* 1. Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* 2. Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* 3. The name of the author may not be used to endorse or promote products -* derived from this software without specific prior written -permission. -* -* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE -* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL -* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT -* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -ANY WAY -* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -** SUCH DAMAGE. - ---------------------------------------------------- - - Copyright (c) 1994 - The Regents of the University of California. All rights reserved. - - This code is derived from software contributed to Berkeley by - Chuck Karish of Mindcraft, Inc. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. Neither the name of the University nor the names of its contributors - Copyright (c) 1985, 1986 The Regents of the University of California. - All rights reserved. - - This code is derived from software contributed to Berkeley by - James A. Woods, derived from original work by Spencer Thomas - and Joseph Orost. - ------------------------------------------------- - - Copyright (c) 1989, 1993, 1994 - The Regents of the University of California. All rights reserved. - - This code is derived from software contributed to Berkeley by - Guido van Rossum. - - Copyright (c) 1990 The Regents of the University of California. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - This product includes software developed by the University of - California, Berkeley and its contributors. - 4. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - ------------------------------------------------------- - - Project ___| | | | _ \| | - / __| | | | |_) | | - | (__| |_| | _ <| |___ - \___|\___/|_| \_\_____| - - Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. - - Copyright (C) 2004, Daniel Stenberg, , et al. - - This software is licensed as described in the file COPYING, which - you should have received as part of this distribution. The terms - are also available at http://curl.haxx.se/docs/copyright.html. - - You may opt to use, copy, modify, merge, publish, distribute and/or sell - copies of the Software, and permit persons to whom the Software is - furnished to do so, under the terms of the COPYING file. - - This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - KIND, either express or implied. - ------------------------------------------------------------- - -*************************************************************************** - Copyright (c) 1998 Free Software Foundation, Inc. - * - Copyright (c) 1998,2000 Free Software Foundation, Inc. - * - - * - Permission is hereby granted, free of charge, to any person obtaining -a * - copy of this software and associated documentation files (the - * - "Software"), to deal in the Software without restriction, including - * - without limitation the rights to use, copy, modify, merge, publish, - * - distribute, distribute with modifications, sublicense, and/or sell - * - copies of the Software, and to permit persons to whom the Software is - * - furnished to do so, subject to the following conditions: - * - - * - The above copyright notice and this permission notice shall be -included * - in all copies or substantial portions of the Software. - * - - * - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS * - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. * - IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, * - DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * - OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR - * - THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - - * - - * - Except as contained in this notice, the name(s) of the above -copyright * - holders shall not be used in advertising or otherwise to promote the - * - sale, use or other dealings in this Software without prior written - * - authorization. - * - *************************************************************************** - ------------------------------------------------------- - - Copyright (c) 1997 Todd C. Miller - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED -WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; - OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - -*************************************************************************** - -%%The following software may be included in this product: -Fred Fish's Dbug Library - -Use of any of this software is governed by the terms of the license below: - -* - * N O T I C E * - * * - * Copyright Abandoned, 1987, Fred Fish * - * * - * * - * This previously copyrighted work has been placed into the public * - * domain by the author and may be freely used for any purpose, * - * private or commercial. * - * * - * Because of the number of inquiries I was receiving about the use * - * of this product in commercially developed works I have decided to * - * simply make it public domain to further its unrestricted use. I * - * specifically would be most happy to see this material become a * - * part of the standard Unix distributions by AT&T and the Berkeley * - * Computer Science Research Group, and a standard part of the GNU * - * system from the Free Software Foundation. * - * * - * I would appreciate it, as a courtesy, if this notice is left in * - * all copies and derivative works. Thank you. * - * * - * The author makes no warranty of any kind with respect to this * - * product and explicitly disclaims any implied warranties of mer- * - * chantability or fitness for any particular purpose. * - * - -*************************************************************************** - -%%The following software may be included in this product: -dbug_analyze.c (part of Fred Fish's Dbug Library) - -Use of any of this software is governed by the terms of the license below: - -* * -* Copyright Abandoned, 1987, Fred Fish * -* * -* * -* This previously copyrighted work has been placed into the public * -* domain by the author and may be freely used for any purpose, * -* private or commercial. * -* * -* Because of the number of inquiries I was receiving about the use * -* of this product in commercially developed works I have decided to * -* simply make it public domain to further its unrestricted use. I * -* specifically would be most happy to see this material become a * -* part of the standard Unix distributions by AT&T and the Berkeley * -* Computer Science Research Group, and a standard part of the GNU * -* system from the Free Software Foundation. * -* * -* I would appreciate it, as a courtesy, if this notice is left in * -* all copies and derivative works. Thank you. * -* * -* The author makes no warranty of any kind with respect to this * -* product and explicitly disclaims any implied warranties of mer- * -* chantability or fitness for any particular purpose. - -*************************************************************************** - -%%The following software may be included in this product: -GNU Libtool, only ltmain.sh, libtool, auto-gen fil - -Use of any of this software is governed by the terms of the license below: - -ltmain.sh inclusion: -# ltmain.sh - Provide generalized library-building support services. -# NOTE: Changing this file will not affect anything until you rerun configure. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, -# 2007 Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit , 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -libtool inclusion: -# libtoolT - Provide generalized library-building support services. -# Generated automatically by (GNU mysql 5.1.30) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, -# 2006, 2007 Free Software Foundation, Inc. -# -# This file is part of GNU Libtool: -# Originally by Gordon Matzigkeit , 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -Auto-generated files: -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building -# support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, -# 2004, 2005, 2006, 2007 Free Software Foundation, Inc. -# -# This file is part of GNU Libtool: -# Originally by Gordon Matzigkeit , 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -Additional License(s) - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -*************************************************************************** - -%%The following software may be included in this product: -innochecksum.c - -Use of any of this software is governed by the terms of the license below: - -GNU GENERAL PUBLIC LICENSE - -Version 2, June 1991 - -Copyright (C) 1989, 1991 Free Software Foundation, Inc. -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - -Everyone is permitted to copy and distribute verbatim copies -of this license document, but changing it is not allowed. - -Preamble - -The licenses for most software are designed to take away your freedom to share -and change it. By contrast, the GNU General Public License is intended to -guarantee your freedom to share and change free software--to make sure the -software is free for all its users. This General Public License applies to most -of the Free Software Foundation's software and to any other program whose -authors commit to using it. (Some other Free Software Foundation software is -covered by the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - -When we speak of free software, we are referring to freedom, not price. Our -General Public Licenses are designed to make sure that you have the freedom to -distribute copies of free software (and charge for this service if you wish), -that you receive source code or can get it if you want it, that you can change -the software or use pieces of it in new free programs; and that you know you can -do these things. - -To protect your rights, we need to make restrictions that forbid anyone to deny -you these rights or to ask you to surrender the rights. These restrictions -translate to certain responsibilities for you if you distribute copies of the -software, or if you modify it. - -For example, if you distribute copies of such a program, whether gratis or for a -fee, you must give the recipients all the rights that you have. You must make -sure that they, too, receive or can get the source code. And you must show them -these terms so they know their rights. - -We protect your rights with two steps: (1) copyright the software, and (2) offer -you this license which gives you legal permission to copy, distribute and/or -modify the software. - -Also, for each author's protection and ours, we want to make certain that -everyone understands that there is no warranty for this free software. If the -software is modified by someone else and passed on, we want its recipients to -know that what they have is not the original, so that any problems introduced by -others will not reflect on the original authors' reputations. - -Finally, any free program is threatened constantly by software patents. We wish -to avoid the danger that redistributors of a free program will individually -obtain patent licenses, in effect making the program proprietary. To prevent -this, we have made it clear that any patent must be licensed for everyone's free -use or not licensed at all. - -The precise terms and conditions for copying, distribution and modification follow. -TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - -0. This License applies to any program or other work which contains a notice -placed by the copyright holder saying it may be distributed under the terms of -this General Public License. The "Program", below, refers to any such program or -work, and a "work based on the Program" means either the Program or any -derivative work under copyright law: that is to say, a work containing the -Program or a portion of it, either verbatim or with modifications and/or -translated into another language. (Hereinafter, translation is included without -limitation in the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not covered by -this License; they are outside its scope. The act of running the Program is not -restricted, and the output from the Program is covered only if its contents -constitute a work based on the Program (independent of having been made by -running the Program). Whether that is true depends on what the Program does. - -1. You may copy and distribute verbatim copies of the Program's source code as -you receive it, in any medium, provided that you conspicuously and appropriately -publish on each copy an appropriate copyright notice and disclaimer of warranty; -keep intact all the notices that refer to this License and to the absence of any -warranty; and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and you may at -your option offer warranty protection in exchange for a fee. - -2. You may modify your copy or copies of the Program or any portion of it, thus -forming a work based on the Program, and copy and distribute such modifications -or work under the terms of Section 1 above, provided that you also meet all of -these conditions: - - a) You must cause the modified files to carry prominent notices stating that -you changed the files and the date of any change. - b) You must cause any work that you distribute or publish, that in whole or -in part contains or is derived from the Program or any part thereof, to be -licensed as a whole at no charge to all third parties under the terms of this -License. - c) If the modified program normally reads commands interactively when run, -you must cause it, when started running for such interactive use in the most -ordinary way, to print or display an announcement including an appropriate -copyright notice and a notice that there is no warranty (or else, saying that -you provide a warranty) and that users may redistribute the program under these -conditions, and telling the user how to view a copy of this License. (Exception: -if the Program itself is interactive but does not normally print such an -announcement, your work based on the Program is not required to print an -announcement.) - -These requirements apply to the modified work as a whole. If identifiable -sections of that work are not derived from the Program, and can be reasonably -considered independent and separate works in themselves, then this License, and -its terms, do not apply to those sections when you distribute them as separate -works. But when you distribute the same sections as part of a whole which is a -work based on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the entire whole, -and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest your -rights to work written entirely by you; rather, the intent is to exercise the -right to control the distribution of derivative or collective works based on the -Program. - -In addition, mere aggregation of another work not based on the Program with the -Program (or with a work based on the Program) on a volume of a storage or -distribution medium does not bring the other work under the scope of this License. - -3. You may copy and distribute the Program (or a work based on it, under Section -2) in object code or executable form under the terms of Sections 1 and 2 above -provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable source -code, which must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange; or, - b) Accompany it with a written offer, valid for at least three years, to -give any third party, for a charge no more than your cost of physically -performing source distribution, a complete machine-readable copy of the -corresponding source code, to be distributed under the terms of Sections 1 and 2 -above on a medium customarily used for software interchange; or, - c) Accompany it with the information you received as to the offer to -distribute corresponding source code. (This alternative is allowed only for -noncommercial distribution and only if you received the program in object code -or executable form with such an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for making -modifications to it. For an executable work, complete source code means all the -source code for all modules it contains, plus any associated interface -definition files, plus the scripts used to control compilation and installation -of the executable. However, as a special exception, the source code distributed -need not include anything that is normally distributed (in either source or -binary form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component itself -accompanies the executable. - -If distribution of executable or object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the source code -from the same place counts as distribution of the source code, even though third -parties are not compelled to copy the source along with the object code. - -4. You may not copy, modify, sublicense, or distribute the Program except as -expressly provided under this License. Any attempt otherwise to copy, modify, -sublicense or distribute the Program is void, and will automatically terminate -your rights under this License. However, parties who have received copies, or -rights, from you under this License will not have their licenses terminated so -long as such parties remain in full compliance. - -5. You are not required to accept this License, since you have not signed it. -However, nothing else grants you permission to modify or distribute the Program -or its derivative works. These actions are prohibited by law if you do not -accept this License. Therefore, by modifying or distributing the Program (or any -work based on the Program), you indicate your acceptance of this License to do -so, and all its terms and conditions for copying, distributing or modifying the -Program or works based on it. - -6. Each time you redistribute the Program (or any work based on the Program), -the recipient automatically receives a license from the original licensor to -copy, distribute or modify the Program subject to these terms and conditions. -You may not impose any further restrictions on the recipients' exercise of the -rights granted herein. You are not responsible for enforcing compliance by third -parties to this License. - -7. If, as a consequence of a court judgment or allegation of patent infringement -or for any other reason (not limited to patent issues), conditions are imposed -on you (whether by court order, agreement or otherwise) that contradict the -conditions of this License, they do not excuse you from the conditions of this -License. If you cannot distribute so as to satisfy simultaneously your -obligations under this License and any other pertinent obligations, then as a -consequence you may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by all those -who receive copies directly or indirectly through you, then the only way you -could satisfy both it and this License would be to refrain entirely from -distribution of the Program. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply and the -section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any patents or -other property right claims or to contest validity of any such claims; this -section has the sole purpose of protecting the integrity of the free software -distribution system, which is implemented by public license practices. Many -people have made generous contributions to the wide range of software -distributed through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing to -distribute software through any other system and a licensee cannot impose that -choice. - -This section is intended to make thoroughly clear what is believed to be a -consequence of the rest of this License. - -8. If the distribution and/or use of the Program is restricted in certain -countries either by patents or by copyrighted interfaces, the original copyright -holder who places the Program under this License may add an explicit -geographical distribution limitation excluding those countries, so that -distribution is permitted only in or among countries not thus excluded. In such -case, this License incorporates the limitation as if written in the body of this -License. - -9. The Free Software Foundation may publish revised and/or new versions of the -General Public License from time to time. Such new versions will be similar in -spirit to the present version, but may differ in detail to address new problems -or concerns. - -Each version is given a distinguishing version number. If the Program specifies -a version number of this License which applies to it and "any later version", -you have the option of following the terms and conditions either of that version -or of any later version published by the Free Software Foundation. If the -Program does not specify a version number of this License, you may choose any -version ever published by the Free Software Foundation. - -10. If you wish to incorporate parts of the Program into other free programs -whose distribution conditions are different, write to the author to ask for -permission. For software which is copyrighted by the Free Software Foundation, -write to the Free Software Foundation; we sometimes make exceptions for this. -Our decision will be guided by the two goals of preserving the free status of -all derivatives of our free software and of promoting the sharing and reuse of -software generally. - -NO WARRANTY - -11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE -PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED -IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS -IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT -NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - -12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL -ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE -PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, -SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY -TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF -THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER -PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -END OF TERMS AND CONDITIONS -How to Apply These Terms to Your New Programs - -If you develop a new program, and you want it to be of the greatest possible use -to the public, the best way to achieve this is to make it free software which -everyone can redistribute and change under these terms. - -To do so, attach the following notices to the program. It is safest to attach -them to the start of each source file to most effectively convey the exclusion -of warranty; and each file should have at least the "copyright" line and a -pointer to where the full notice is found. - -one line to give the program's name and an idea of what it does. -Copyright (C) yyyy name of author - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this when it -starts in an interactive mode: - -Gnomovision version 69, Copyright (C) year name of author -Gnomovision comes with ABSOLUTELY NO WARRANTY; for details -type `show w'. This is free software, and you are welcome -to redistribute it under certain conditions; type `show c' -for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may be -called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your school, -if any, to sign a "copyright disclaimer" for the program, if necessary. Here is -a sample; alter the names: - -Yoyodyne, Inc., hereby disclaims all copyright -interest in the program `Gnomovision' -(which makes passes at compilers) written -by James Hacker. - -signature of Ty Coon, 1 April 1989 -Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may consider -it more useful to permit linking proprietary applications with the library. If -this is what you want to do, use the GNU Lesser General Public License instead -of this License. - -Additional Documentation License(s) - -innochecksum.c is documented in the MySQL Reference -Manual at http://dev.mysql.com/doc/refman/5.1/en/innochecksum.html -The Reference Manual is not licensed under the GPL; rather, it -is offered under normal copyright, but with permission to -copy/redistribute electronically. - -*************************************************************************** - -%%The following software may be included in this product: -lib_sql.cc - -Use of any of this software is governed by the terms of the license below: - -/* - * Copyright (c) 2000 - * SWsoft company - * - * This material is provided "as is", with absolutely no warranty expressed - * or implied. Any use is at your own risk. - * - * Permission to use or copy this software for any purpose is hereby granted - * without fee, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is granted, - * provided the above notices are retained, and a notice that the code was - * modified is included with the above copyright notice. - * - - This code was modified by the MySQL team -*/ - -*************************************************************************** - -%%The following software may be included in this product: -libevent - -Use of any of this software is governed by the terms of the license below: - -/* - * Copyright (c) 2000-2004 Niels Provos - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -Additional License(s) - -http://creativecommons.org/licenses/publicdomain - -*************************************************************************** - -%%The following software may be included in this product: -Async DNS Library - -Use of any of this software is governed by the terms of the license below: - -/* Async DNS Library - * Adam Langley - * http://www.imperialviolet.org/eventdns.html - * Public Domain code - * - * This software is Public Domain. To view a copy of the public domain dedication, - * visit http://creativecommons.org/licenses/publicdomain/ or send a letter to - * Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. - * - * I ask and expect, but do not require, that all derivative works contain an - * attribution similar to: - * Parts developed by Adam Langley - * - * You may wish to replace the word "Parts" with something else depending on - * the amount of original code. - * - * (Derivative works does not include programs which link against, run or include - * the source verbatim in their source distributions) - * - * Version: 0.1b - */ - -*************************************************************************** - -%%The following software may be included in this product: -log.c - -Use of any of this software is governed by the terms of the license below: - -/* $OpenBSD: err.c,v 1.2 2002/06/25 15:50:15 mickey Exp $ */ - -/* - * log.c - * - * Based on err.c, which was adapted from OpenBSD libc *err* *warn* code. - * - * Copyright (c) 2005 Nick Mathewson - * - * Copyright (c) 2000 Dug Song - * - * Copyright (c) 1993 - * The Regents of the University of California. All rights -reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -*************************************************************************** - -%%The following software may be included in this product: -min_heap.h - -Use of any of this software is governed by the terms of the license below: - -/* - * Copyright (c) 2006 Maxim Yegorushkin - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -*************************************************************************** - -%%The following software may be included in this product: -win32.c - -Use of any of this software is governed by the terms of the license below: - -/* - * Copyright 2000-2002 Niels Provos - * Copyright 2003 Michael A. Davis - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -*************************************************************************** - -%%The following software may be included in this product: -regex++ - -Use of any of this software is governed by the terms of the license below: - -Copyright 1992, 1993, 1994 Henry Spencer. All rights reserved. -This software is not subject to any license of the American Telephone -and Telegraph Company or of the Regents of the University of California. - -Permission is granted to anyone to use this software for any purpose on -any computer system, and to alter it and redistribute it, subject -to the following restrictions: - -1. The author is not responsible for the consequences of use of this - software, no matter how awful, even if they arise from flaws in it. - -2. The origin of this software must not be misrepresented, either by - explicit claim or by omission. Since few users ever read sources, - credits must appear in the documentation. - -3. Altered versions must be plainly marked as such, and must not be - misrepresented as being the original software. Since few users - ever read sources, credits must appear in the documentation. - -4. This notice may not be removed or altered. - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -/*- - * Copyright (c) 1994 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)COPYRIGHT 8.1 (Berkeley) 3/16/94 - */ - -*************************************************************************** - -%%The following software may be included in this product: -Richard A. O'Keefe strings package - -Use of any of this software is governed by the terms of the license below: - -These files are in the public domain. This includes getopt.c, which -is the work of Henry Spencer, University of Toronto Zoology, who says of -it "None of this software is derived from Bell software. I had no access -to the source for Bell's versions at the time I wrote it. This software -is hereby explicitly placed in the public domain. It may be used for -any purpose on any machine by anyone." I would greatly prefer it if *my* -material received no military use. - -*************************************************************************** - -%%The following software may be included in this product: -t_ctype.h - -Use of any of this software is governed by the terms of the license below: - -http://bioinfo.mbb.yale.edu/genome/yeast/cluster/database/mysql/include/t_ctype.h - -/* - Copyright (C) 1998, 1999 by Pruet Boonma, all rights reserved. - Copyright (C) 1998 by Theppitak Karoonboonyanan, all rights reserved. - Permission to use, copy, modify, distribute and sell this software - and its documentation for any purpose is hereby granted without fee, - provided that the above copyright notice appear in all copies. - Smaphan Raruenrom and Pruet Boonma makes no representations about - the suitability of this software for any purpose. It is provided - "as is" without express or implied warranty. -*/ - -*************************************************************************** - -%%The following software may be included in this product: -SHA-1 in C - -Use of any of this software is governed by the terms of the license below: - - SHA-1 in C - By Steve Reid - 100% Public Domain - -Additional License(s) - -100% Public Domain - -*************************************************************************** - -%%The following software may be included in this product: -TCMalloc (part of google-perftools) - -Use of any of this software is governed by the terms of the license below: - -# Copyright (c) 1998-2006, Google Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -Additional License(s) - -*** File src/tests/ptmalloc/thread-m.h contains this GPLv2 (or later) -text: - -/* Basic platform-independent macro definitions for mutexes and - thread-specific data. - Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Wolfram Gloger , 1996. - - The GNU C 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; either version 2 of the - License, or (at your option) any later version. - - The GNU C 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 the GNU C Library; see the file COPYING.LIB. If -not, - write to the Free Software Foundation, Inc., 59 Temple Place - -Suite 330, - Boston, MA 02111-1307, USA. */ - - - -*** File src/tests/ptmalloc/malloc-machine.h contains this BSD like text: - -/* Basic platform-independent macro definitions for mutexes, - thread-specific data and parameters for malloc. - Posix threads (pthreads) version. - Copyright (C) 2004 Wolfram Gloger . - -Permission to use, copy, modify, distribute, and sell this software -and its documentation for any purpose is hereby granted without fee, -provided that (i) the above copyright notices and this permission -notice appear in all copies of the software and related documentation, -and (ii) the name of Wolfram Gloger may not be used in any advertising -or publicity relating to the software. - -THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, -EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY -WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. - -IN NO EVENT SHALL WOLFRAM GLOGER BE LIABLE FOR ANY SPECIAL, -INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY -DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY -OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -*/ - -*************************************************************************** - -%%The following software may be included in this product: -The tz database - -Use of any of this software is governed by the terms of the license below: - -Sources for Time Zone and Daylight Saving Time Data -@(#)tz-link.htm 7.54 - -Please send corrections to this web page to the time zone mailing list. -The tz database - -The public-domain time zone database contains code and data that represent the -history of local time for many representative locations around the globe. It is -updated periodically to reflect changes made by political bodies to time zone -boundaries, UTC offsets, and daylight-saving rules. This database (often called -tz or zoneinfo) is used by several implementations, including the GNU C Library -used in GNU/Linux, FreeBSD, NetBSD, OpenBSD, Cygwin, DJGPP, HP-UX, IRIX, Mac OS -X, OpenVMS, Solaris, Tru64, and UnixWare. - -Each location in the database represents a national region where all clocks -keeping local time have agreed since 1970. Locations are identified by continent -or ocean and then by the name of the location, which is typically the largest -city within the region. For example, America/New_York represents most of the US -eastern time zone; America/Phoenix represents most of Arizona, which uses -mountain time without daylight saving time (DST); America/Detroit represents -most of Michigan, which uses eastern time but with different DST rules in 1975; -and other entries represent smaller regions like Starke County, Indiana, which -switched from central to eastern time in 1991 and switched back in 2006. To use -the database on an extended POSIX implementation set the TZ environment variable -to the location's full name, e.g., TZ="America/New_York". - -In the tz database's FTP distribution the code is in the file tzcodeC.tar.gz, -where C is the code's version; similarly, the data are in tzdataD.tar.gz, where -D is the data's version. The following shell commands download these files to a -GNU/Linux or similar host; see the downloaded README file for what to do next. - -wget 'ftp://elsie.nci.nih.gov/pub/tz*.tar.gz' -gzip -dc tzcode*.tar.gz | tar -xf - -gzip -dc tzdata*.tar.gz | tar -xf - - -The code lets you compile the tz source files into machine-readable binary -files, one for each location. It also lets you read a tz binary file and -interpret time stamps for that location. - -The data are by no means authoritative. If you find errors, please send changes -to the time zone mailing list. You can also subscribe to the mailing list, -retrieve the archive of old messages (in gzip compressed format), or retrieve -archived older versions of code and data; there is also a smaller HTTP mirror. - -*************************************************************************** - -%%The following software may be included in this product: -UnicodeData.txt - -Use of any of this software is governed by the terms of the license below: - -Unicode Terms of Use - - For the general privacy policy governing access to this site, see the -Unicode Privacy Policy. For trademark usage, see the Unicode Consortium® -Trademarks and Logo Policy. - Notice to End User: Terms of Use - Carefully read the following legal agreement ("Agreement"). Use or copying -of the software and/or codes provided with this agreement (The "Software") -constitutes your acceptance of these terms - - 1. Unicode Copyright. - 1. Copyright © 1991-2008 Unicode, Inc. All rights reserved. - 2. Certain documents and files on this website contain a legend -indicating that "Modification is permitted." Any person is hereby authorized, -without fee, to modify such documents and files to create derivative works -conforming to the Unicode® Standard, subject to Terms and Conditions herein. - 3. Any person is hereby authorized, without fee, to view, use, -reproduce, and distribute all documents and files solely for informational -purposes in the creation of products supporting the Unicode Standard, subject to -the Terms and Conditions herein. - 4. Further specifications of rights and restrictions pertaining to -the use of the particular set of data files known as the "Unicode Character -Database" can be found in Exhibit 1. - 5. Each version of the Unicode Standard has further specifications -of rights and restrictions of use. For the book editions, these are found on the -back of the title page. For the online edition, certain files (such as the PDF -files for book chapters and code charts) carry specific restrictions. All other -files are covered under these general Terms of Use. To request a permission to -reproduce any part of the Unicode Standard, please contact the Unicode Consortium. - 6. No license is granted to "mirror" the Unicode website where a -fee is charged for access to the "mirror" site. - 7. Modification is not permitted with respect to this document. All -copies of this document must be verbatim. - 2. Restricted Rights Legend. Any technical data or software which is -licensed to the United States of America, its agencies and/or instrumentalities -under this Agreement is commercial technical data or commercial computer -software developed exclusively at private expense as defined in FAR 2.101, or -DFARS 252.227-7014 (June 1995), as applicable. For technical data, use, -duplication, or disclosure by the Government is subject to restrictions as set -forth in DFARS 202.227-7015 Technical Data, Commercial and Items (Nov 1995) and -this Agreement. For Software, in accordance with FAR 12-212 or DFARS 227-7202, -as applicable, use, duplication or disclosure by the Government is subject to -the restrictions set forth in this Agreement. - 3. Warranties and Disclaimers. - 1. This publication and/or website may include technical or -typographical errors or other inaccuracies . Changes are periodically added to -the information herein; these changes will be incorporated in new editions of -the publication and/or website. Unicode may make improvements and/or changes in -the product(s) and/or program(s) described in this publication and/or website at -any time. - 2. If this file has been purchased on magnetic or optical media -from Unicode, Inc. the sole and exclusive remedy for any claim will be exchange -of the defective media within ninety (90) days of original purchase. - 3. EXCEPT AS PROVIDED IN SECTION C.2, THIS PUBLICATION AND/OR -SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND EITHER EXPRESS, -IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UNICODE -AND ITS LICENSORS ASSUME NO RESPONSIBILITY FOR ERRORS OR OMISSIONS IN THIS -PUBLICATION AND/OR SOFTWARE OR OTHER DOCUMENTS WHICH ARE REFERENCED BY OR LINKED -TO THIS PUBLICATION OR THE UNICODE WEBSITE. - 4. Waiver of Damages. In no event shall Unicode or its licensors be -liable for any special, incidental, indirect or consequential damages of any -kind, or any damages whatsoever, whether or not Unicode was advised of the -possibility of the damage, including, without limitation, those resulting from -the following: loss of use, data or profits, in connection with the use, -modification or distribution of this information or its derivatives. - 5. Trademarks. - 1. Unicode and the Unicode logo are registered trademarks of -Unicode, Inc. - 2. This site contains product names and corporate names of other -companies. All product names and company names and logos mentioned herein are -the trademarks or registered trademarks of their respective owners. Other -products and corporate names mentioned herein which are trademarks of a third -party are used only for explanation and for the owners' benefit and with no -intent to infringe. - 3. Use of third party products or information referred to herein is -at the user’s risk. - 6. Miscellaneous. - 1. Jurisdiction and Venue. This server is operated from a location -in the State of California, United States of America. Unicode makes no -representation that the materials are appropriate for use in other locations. If -you access this server from other locations, you are responsible for compliance -with local laws. This Agreement, all use of this site and any claims and damages -resulting from use of this site are governed solely by the laws of the State of -California without regard to any principles which would apply the laws of a -different jurisdiction. The user agrees that any disputes regarding this site -shall be resolved solely in the courts located in Santa Clara County, -California. The user agrees said courts have personal jurisdiction and agree to -waive any right to transfer the dispute to any other forum. - 2. Modification by Unicode Unicode shall have the right to modify -this Agreement at any time by posting it to this site. The user may not assign -any part of this Agreement without Unicode’s prior written consent. - 3. Taxes. The user agrees to pay any taxes arising from access to -this website or use of the information herein, except for those based on -Unicode’s net income. - 4. Severability. If any provision of this Agreement is declared -invalid or unenforceable, the remaining provisions of this Agreement shall -remain in effect. - 5. Entire Agreement. This Agreement constitutes the entire -agreement between the parties. - -EXHIBIT 1 -UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE - - Unicode Data Files include all data files under the directories -http://www.unicode.org/Public/, http://www.unicode.org/reports/, and -http://www.unicode.org/cldr/data/ . Unicode Software includes any source code -published in the Unicode Standard or under the directories -http://www.unicode.org/Public/, http://www.unicode.org/reports/, and -http://www.unicode.org/cldr/data/. - - NOTICE TO USER: Carefully read the following legal agreement. BY -DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S DATA FILES -("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), YOU UNEQUIVOCALLY ACCEPT, AND -AGREE TO BE BOUND BY, ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU -DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES -OR SOFTWARE. - - COPYRIGHT AND PERMISSION NOTICE - - Copyright © 1991-2008 Unicode, Inc. All rights reserved. Distributed under -the Terms of Use in http://www.unicode.org/copyright.html. - - Permission is hereby granted, free of charge, to any person obtaining a copy -of the Unicode data files and any associated documentation (the "Data Files") or -Unicode software and any associated documentation (the "Software") to deal in -the Data Files or Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, and/or sell copies of -the Data Files or Software, and to permit persons to whom the Data Files or -Software are furnished to do so, provided that (a) the above copyright notice(s) -and this permission notice appear with all copies of the Data Files or Software, -(b) both the above copyright notice(s) and this permission notice appear in -associated documentation, and (c) there is clear notice in each modified Data -File or in the Software as well as in the documentation associated with the Data -File(s) or Software that the data or software has been modified. - - THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD -PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS -NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL -DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING -OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR SOFTWARE. - - Except as contained in this notice, the name of a copyright holder shall not -be used in advertising or otherwise to promote the sale, use or other dealings -in these Data Files or Software without prior written authorization of the -copyright holder. - - Unicode and the Unicode logo are trademarks of Unicode, Inc., and may be -registered in some jurisdictions. All other trademarks and registered trademarks -mentioned herein are the property of their respective owners. - -*************************************************************************** - -%%The following software may be included in this product: -zlib - -Use of any of this software is governed by the terms of the license below: - -/* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.3, July 18th, 2005 - - Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. - - Jean-loup Gailly jloup@gzip.org - Mark Adler madler@alumni.caltech.edu - -*/ - -*************************************************************************** - -%%The following software may be included in this product: -dtoa.c - -Use of any of this software is governed by the terms of the license below: - -/**************************************************************** - - This file incorporates work covered by the following copyright and - permission notice: - - The author of this software is David M. Gay. - - Copyright (c) 1991, 2000, 2001 by Lucent Technologies. - - Permission to use, copy, modify, and distribute this software for any - purpose without fee is hereby granted, provided that this entire - notice is included in all copies of any software which is or includes a copy - or modification of this software and in all copies of the supporting - documentation for such software. - - THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED - WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY - REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY - OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. - - ***************************************************************/ - -*************************************************************************** - -%%The following software may be included in this product: -getarg.{c,h} - -Use of any of this software is governed by the terms of the license below: - -/* 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 */ - -/* - * Copyright (c) 1997, 1999 Kungliga Tekniska H366gskolan - * (Royal Institute of Technology, Stockholm, Sweden). - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -*************************************************************************** - -%%The following software may be included in this product: -MD5 message-digest algorithm (md5_hash.cpp) - -Use of any of this software is governed by the terms of the license below: - -/* - * This code implements the MD5 message-digest algorithm. - * The algorithm is due to Ron Rivest. This code was - * written by Colin Plumb in 1993, no copyright is claimed. - * This code is in the public domain; do with it what you wish. - * - * Equivalent code is available from RSA Data Security, Inc. - * This code has been tested against that, and is equivalent, - * except that you don't need to include two pages of legalese - * with every copy. - * - * The code has been modified by Mikael Ronstroem to handle - * calculating a hash value of a key that is always a multiple - * of 4 bytes long. Word 0 of the calculated 4-word hash value - * is returned as the hash value. - */ - -*************************************************************************** - -%%The following software may be included in this product: -nt_servc.{cc,h} - -Use of any of this software is governed by the terms of the license below: - -/** - @file - - @brief - Windows NT Service class library. - - Copyright Abandoned 1998 Irena Pancirov - Irnet Snc - This file is public domain and comes with NO WARRANTY of any kind -*/ - -*************************************************************************** - -%%The following software may be included in this product: -GNU Readline - -Use of any of this software is governed by the terms of the license below: - -GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. - -*************************************************************************** +MySQL Server + +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 the MySQL team at Oracle. + +Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + +License information can be found in the COPYING file. + +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). A copy of the license/notices is also reproduced +below. + +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. + +For further information about MySQL or additional documentation, +see: +- The latest information about MySQL: http://www.mysql.com +- The current MySQL documentation: http://dev.mysql.com/doc + +Some Reference Manual sections of special interest: +- If you are migrating from an older version of MySQL, please + read the "Upgrading from..." section. +- To see what MySQL can do, take a look at the features section. +- For installation instructions, see the Installing and Upgrading + chapter. +- For the new features/bugfix history, see the MySQL Change History + appendix. +- For currently known bugs, see the Errors and Common Problems + appendix. + +You can browse the MySQL Reference Manual online or download it +in any of several formats at the URL given earlier in this file. +Source distributions include a local copy of the manual in the +Docs directory. + +******************************************************************** + +Third-Party Component Notices + +********************************************************************* + +%%The following software may be included in this product: +FindGTest.cmake (part of CMake 2.8.0) + +Use of any of this software is governed by the terms of the license below: + +# Copyright 2009 Kitware, Inc. +# Copyright 2009 Philip Lowman +# Copyright 2009 Daniel Blezek +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#=========================================================================== +# (To distributed this file outside of CMake, substitute the full +# License text for the above reference.) +# +# Thanks to Daniel Blezek for the GTEST_ADD_TESTS code + + +Text of Copyright.txt mentioned above: + +CMake - Cross Platform Makefile Generator +Copyright 2000-2009 Kitware, Inc., Insight Software Consortium +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +* Neither the names of Kitware, Inc., the Insight Software Consortium, + nor the names of their contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +*************************************************************************** + +%%The following software may be included in this product: +Cmake + +Use of any of this software is governed by the terms of the license below: + +CMake is distributed under BSD License + + Copyright (c) 2008, Kitware, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + * Neither the name of Kitware, Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY Kitware, Inc. "AS IS" AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL Kitware Inc. BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +Additional License(s) + +cmake-2.4.8/Utilities/cmtar/compat/gethostname.c: + gethostname.c: minimal substitute for missing gethostname() function + created 2000-Mar-02 jmk + requires SVR4 uname() and -lc + + by Jim Knoble + Copyright ? 2000 Jim Knoble + + Permission to use, copy, modify, distribute, and sell this software + and its documentation for any purpose is hereby granted without fee, + provided that the above copyright notice appear in all copies and + that both that copyright notice and this permission notice appear in + supporting documentation. + + This software is provided "as is", without warranty of any kind, + express or implied, including but not limited to the warranties of + merchantability, fitness for a particular purpose and + noninfringement. In no event shall the author(s) be liable for any + claim, damages or other liability, whether in an action of contract, + tort or otherwise, arising from, out of or in connection with the + software or the use or other dealings in the software. + +---------------------------------- + +* Originally written by Steven M. Bellovin while +* at the University of North Carolina at Chapel Hill. Later tweaked by +* a couple of people on Usenet. Completely overhauled by Rich $alz +* and Jim Berets in August, 1990. +* +* This code is in the public domain and has no copyright. + +------------------------------- + + THIS CODE IS SPECIFICALLY EXEMPTED FROM THE NCURSES PACKAGE COPYRIGHT. + You may freely copy it for use as a template for your own field types. + If you develop a field type that might be of general use, please send + it back to the ncurses maintainers for inclusion in the next version. + +************************************************************************** + + * Author : Per Foreby, perf@efd.lth.se + * Author : Juergen Pfeifer, juergen.pfeifer@gmx.net + +************************************************************************** + +---------------------------------------- + + Copyright (c) 2002 Insight Consortium. All rights reserved. + See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for + details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +-------------------------------------------- + + Skeleton parser for Yacc-like parsing with Bison, + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 Free Software + Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + + As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. + +--------------------------------------------------- + +cmake-2.4.8/Utilities/cmzlib/zlib.h: + zlib.h -- interface of the 'zlib' general purpose compression library + version 1.1.4, March 11th, 2002 + + Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + 3. This notice may not be removed or altered from any source + distribution. + + Jean-loup Gailly Mark Adler + +---------------------------------------------- + + This source code was modified by Martin Hedenfalk for use in Curl. His + latest changes were done 2000-09-18. + + It has since been patched away like a madman by Daniel Stenberg to make it + better applied to curl conditions, and to make it not use globals, pollute + name space and more. This source code awaits a rewrite to work around the + paragraph 2 in the BSD licenses as explained below. + + Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Hgskolan + It has since been patched and modified a lot by Daniel Stenberg to make it + better applied to curl conditions, and to make it not use globals, pollute + name space and more. This source code awaits a rewrite to work around the + paragraph 2 in the BSD licenses as explained below. + + Copyright (c) 1998, 1999 Kungliga Tekniska Hgskolan + (Royal Institute of Technology, Stockholm, Sweden). + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of the Institute nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + +--------------------------------------------- + + Permission to use, copy, modify, and distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED + WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF + MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND + CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER. + +-------------------------------------------------- + +cmake-2.4.8/Utilities/cmcurl/inet_pton.c, +cmake-2.4.8/Source/CTest/Curl/inet_pton.c: + This is from the BIND 4.9.4 release, modified to compile by itself + + Copyright (c) 1996 by Internet Software Consortium. + + Permission to use, copy, modify, and distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM + DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL + INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, + OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF + USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + +------------------------------------------------------- + +* Copyright (C) 2001 by Eric Kidd. All rights reserved. +* Copyright (C) 2001 by Luke Howard. All rights reserved. +* Copyright (C) 2002 Ximian, Inc. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: +* 1. Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* 2. Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* 3. The name of the author may not be used to endorse or promote products +* derived from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR +* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +* SUCH DAMAGE. + +--------------------------------------------------- + + Copyright (c) 1994 + The Regents of the University of California. All rights reserved. + + This code is derived from software contributed to Berkeley by + Chuck Karish of Mindcraft, Inc. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the University nor the names of its contributors + Copyright (c) 1985, 1986 The Regents of the University of California. + All rights reserved. + + This code is derived from software contributed to Berkeley by + James A. Woods, derived from original work by Spencer Thomas + and Joseph Orost. + +------------------------------------------------ + + Copyright (c) 1989, 1993, 1994 + The Regents of the University of California. All rights reserved. + + This code is derived from software contributed to Berkeley by + Guido van Rossum. + + Copyright (c) 1990 The Regents of the University of California. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by the University of + California, Berkeley and its contributors. + 4. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + +------------------------------------------------------ + + Project ___| | | | _ \| | + / __| | | | |_) | | + | (__| |_| | _ <| |___ + \___|\___/|_| \_\_____| + + Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. + + Copyright (C) 2004, Daniel Stenberg, , et al. + + This software is licensed as described in the file COPYING, which + you should have received as part of this distribution. The terms + are also available at http://curl.haxx.se/docs/copyright.html. + + You may opt to use, copy, modify, merge, publish, distribute and/or sell + copies of the Software, and permit persons to whom the Software is + furnished to do so, under the terms of the COPYING file. + + This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + KIND, either express or implied. + +------------------------------------------------------------ + +*************************************************************************** + Copyright (c) 1998 Free Software Foundation, Inc. + Copyright (c) 1998,2000 Free Software Foundation, Inc. + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, distribute with modifications, sublicense, and/or sell copies + of the Software, and to permit persons to whom the Software is furnished + to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN + NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + USE OR OTHER DEALINGS IN THE SOFTWARE. + + + Except as contained in this notice, the name(s) of the above copyright + holders shall not be used in advertising or otherwise to promote the sale, + use or other dealings in this Software without prior written + authorization. +*************************************************************************** + +------------------------------------------------------ + + Copyright (c) 1997 Todd C. Miller + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR + ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + +*************************************************************************** + +%%The following software may be included in this product: +Fred Fish's Dbug Library + +Use of any of this software is governed by the terms of the license below: + + * N O T I C E * + * * + * Copyright Abandoned, 1987, Fred Fish * + * * + * * + * This previously copyrighted work has been placed into the public * + * domain by the author and may be freely used for any purpose, * + * private or commercial. * + * * + * Because of the number of inquiries I was receiving about the use * + * of this product in commercially developed works I have decided to * + * simply make it public domain to further its unrestricted use. I * + * specifically would be most happy to see this material become a * + * part of the standard Unix distributions by AT&T and the Berkeley * + * Computer Science Research Group, and a standard part of the GNU * + * system from the Free Software Foundation. * + * * + * I would appreciate it, as a courtesy, if this notice is left in * + * all copies and derivative works. Thank you. * + * * + * The author makes no warranty of any kind with respect to this * + * product and explicitly disclaims any implied warranties of mer- * + * chantability or fitness for any particular purpose. * + +*************************************************************************** + +%%The following software may be included in this product: +dbug_analyze.c (part of Fred Fish's Dbug Library) + +Use of any of this software is governed by the terms of the license below: + +* Copyright Abandoned, 1987, Fred Fish * +* * +* * +* This previously copyrighted work has been placed into the public * +* domain by the author and may be freely used for any purpose, * +* private or commercial. * +* * +* Because of the number of inquiries I was receiving about the use * +* of this product in commercially developed works I have decided to * +* simply make it public domain to further its unrestricted use. I * +* specifically would be most happy to see this material become a * +* part of the standard Unix distributions by AT&T and the Berkeley * +* Computer Science Research Group, and a standard part of the GNU * +* system from the Free Software Foundation. * +* * +* I would appreciate it, as a courtesy, if this notice is left in * +* all copies and derivative works. Thank you. * +* * +* The author makes no warranty of any kind with respect to this * +* product and explicitly disclaims any implied warranties of mer- * +* chantability or fitness for any particular purpose. * + +*************************************************************************** + +%%The following software may be included in this product: +GNU Libtool, only ltmain.sh, libtool, auto-gen fil + +Use of any of this software is governed by the terms of the license below: + +ltmain.sh inclusion: +# ltmain.sh - Provide generalized library-building support services. +# NOTE: Changing this file will not affect anything until you rerun configure. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +# 2007 Free Software Foundation, Inc. +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +libtool inclusion: +# libtoolT - Provide generalized library-building support services. +# Generated automatically by (GNU mysql 5.1.30) +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, +# 2006, 2007 Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +Auto-generated files: +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building +# support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, +# 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +Additional License(s) + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +*************************************************************************** + +%%The following software may be included in this product: +innochecksum.c + +Use of any of this software is governed by the terms of the license below: + +GNU GENERAL PUBLIC LICENSE + +Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc. +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + +Preamble + +The licenses for most software are designed to take away your freedom to share +and change it. By contrast, the GNU General Public License is intended to +guarantee your freedom to share and change free software--to make sure the +software is free for all its users. This General Public License applies to most +of the Free Software Foundation's software and to any other program whose +authors commit to using it. (Some other Free Software Foundation software is +covered by the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not price. Our +General Public Licenses are designed to make sure that you have the freedom to +distribute copies of free software (and charge for this service if you wish), +that you receive source code or can get it if you want it, that you can change +the software or use pieces of it in new free programs; and that you know you can +do these things. + +To protect your rights, we need to make restrictions that forbid anyone to deny +you these rights or to ask you to surrender the rights. These restrictions +translate to certain responsibilities for you if you distribute copies of the +software, or if you modify it. + +For example, if you distribute copies of such a program, whether gratis or for a +fee, you must give the recipients all the rights that you have. You must make +sure that they, too, receive or can get the source code. And you must show them +these terms so they know their rights. + +We protect your rights with two steps: (1) copyright the software, and (2) offer +you this license which gives you legal permission to copy, distribute and/or +modify the software. + +Also, for each author's protection and ours, we want to make certain that +everyone understands that there is no warranty for this free software. If the +software is modified by someone else and passed on, we want its recipients to +know that what they have is not the original, so that any problems introduced by +others will not reflect on the original authors' reputations. + +Finally, any free program is threatened constantly by software patents. We wish +to avoid the danger that redistributors of a free program will individually +obtain patent licenses, in effect making the program proprietary. To prevent +this, we have made it clear that any patent must be licensed for everyone's free +use or not licensed at all. + +The precise terms and conditions for copying, distribution and modification follow. +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains a notice +placed by the copyright holder saying it may be distributed under the terms of +this General Public License. The "Program", below, refers to any such program or +work, and a "work based on the Program" means either the Program or any +derivative work under copyright law: that is to say, a work containing the +Program or a portion of it, either verbatim or with modifications and/or +translated into another language. (Hereinafter, translation is included without +limitation in the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not covered by +this License; they are outside its scope. The act of running the Program is not +restricted, and the output from the Program is covered only if its contents +constitute a work based on the Program (independent of having been made by +running the Program). Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's source code as +you receive it, in any medium, provided that you conspicuously and appropriately +publish on each copy an appropriate copyright notice and disclaimer of warranty; +keep intact all the notices that refer to this License and to the absence of any +warranty; and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and you may at +your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion of it, thus +forming a work based on the Program, and copy and distribute such modifications +or work under the terms of Section 1 above, provided that you also meet all of +these conditions: + + a) You must cause the modified files to carry prominent notices stating that +you changed the files and the date of any change. + b) You must cause any work that you distribute or publish, that in whole or +in part contains or is derived from the Program or any part thereof, to be +licensed as a whole at no charge to all third parties under the terms of this +License. + c) If the modified program normally reads commands interactively when run, +you must cause it, when started running for such interactive use in the most +ordinary way, to print or display an announcement including an appropriate +copyright notice and a notice that there is no warranty (or else, saying that +you provide a warranty) and that users may redistribute the program under these +conditions, and telling the user how to view a copy of this License. (Exception: +if the Program itself is interactive but does not normally print such an +announcement, your work based on the Program is not required to print an +announcement.) + +These requirements apply to the modified work as a whole. If identifiable +sections of that work are not derived from the Program, and can be reasonably +considered independent and separate works in themselves, then this License, and +its terms, do not apply to those sections when you distribute them as separate +works. But when you distribute the same sections as part of a whole which is a +work based on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the entire whole, +and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest your +rights to work written entirely by you; rather, the intent is to exercise the +right to control the distribution of derivative or collective works based on the +Program. + +In addition, mere aggregation of another work not based on the Program with the +Program (or with a work based on the Program) on a volume of a storage or +distribution medium does not bring the other work under the scope of this License. + +3. You may copy and distribute the Program (or a work based on it, under Section +2) in object code or executable form under the terms of Sections 1 and 2 above +provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable source +code, which must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange; or, + b) Accompany it with a written offer, valid for at least three years, to +give any third party, for a charge no more than your cost of physically +performing source distribution, a complete machine-readable copy of the +corresponding source code, to be distributed under the terms of Sections 1 and 2 +above on a medium customarily used for software interchange; or, + c) Accompany it with the information you received as to the offer to +distribute corresponding source code. (This alternative is allowed only for +noncommercial distribution and only if you received the program in object code +or executable form with such an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for making +modifications to it. For an executable work, complete source code means all the +source code for all modules it contains, plus any associated interface +definition files, plus the scripts used to control compilation and installation +of the executable. However, as a special exception, the source code distributed +need not include anything that is normally distributed (in either source or +binary form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component itself +accompanies the executable. + +If distribution of executable or object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the source code +from the same place counts as distribution of the source code, even though third +parties are not compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program except as +expressly provided under this License. Any attempt otherwise to copy, modify, +sublicense or distribute the Program is void, and will automatically terminate +your rights under this License. However, parties who have received copies, or +rights, from you under this License will not have their licenses terminated so +long as such parties remain in full compliance. + +5. You are not required to accept this License, since you have not signed it. +However, nothing else grants you permission to modify or distribute the Program +or its derivative works. These actions are prohibited by law if you do not +accept this License. Therefore, by modifying or distributing the Program (or any +work based on the Program), you indicate your acceptance of this License to do +so, and all its terms and conditions for copying, distributing or modifying the +Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the Program), +the recipient automatically receives a license from the original licensor to +copy, distribute or modify the Program subject to these terms and conditions. +You may not impose any further restrictions on the recipients' exercise of the +rights granted herein. You are not responsible for enforcing compliance by third +parties to this License. + +7. If, as a consequence of a court judgment or allegation of patent infringement +or for any other reason (not limited to patent issues), conditions are imposed +on you (whether by court order, agreement or otherwise) that contradict the +conditions of this License, they do not excuse you from the conditions of this +License. If you cannot distribute so as to satisfy simultaneously your +obligations under this License and any other pertinent obligations, then as a +consequence you may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by all those +who receive copies directly or indirectly through you, then the only way you +could satisfy both it and this License would be to refrain entirely from +distribution of the Program. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply and the +section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or +other property right claims or to contest validity of any such claims; this +section has the sole purpose of protecting the integrity of the free software +distribution system, which is implemented by public license practices. Many +people have made generous contributions to the wide range of software +distributed through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing to +distribute software through any other system and a licensee cannot impose that +choice. + +This section is intended to make thoroughly clear what is believed to be a +consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in certain +countries either by patents or by copyrighted interfaces, the original copyright +holder who places the Program under this License may add an explicit +geographical distribution limitation excluding those countries, so that +distribution is permitted only in or among countries not thus excluded. In such +case, this License incorporates the limitation as if written in the body of this +License. + +9. The Free Software Foundation may publish revised and/or new versions of the +General Public License from time to time. Such new versions will be similar in +spirit to the present version, but may differ in detail to address new problems +or concerns. + +Each version is given a distinguishing version number. If the Program specifies +a version number of this License which applies to it and "any later version", +you have the option of following the terms and conditions either of that version +or of any later version published by the Free Software Foundation. If the +Program does not specify a version number of this License, you may choose any +version ever published by the Free Software Foundation. + +10. If you wish to incorporate parts of the Program into other free programs +whose distribution conditions are different, write to the author to ask for +permission. For software which is copyrighted by the Free Software Foundation, +write to the Free Software Foundation; we sometimes make exceptions for this. +Our decision will be guided by the two goals of preserving the free status of +all derivatives of our free software and of promoting the sharing and reuse of +software generally. + +NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE +PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED +IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS +IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT +NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL +ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE +PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, +SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY +TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF +THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER +PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. +END OF TERMS AND CONDITIONS +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest possible use +to the public, the best way to achieve this is to make it free software which +everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest to attach +them to the start of each source file to most effectively convey the exclusion +of warranty; and each file should have at least the "copyright" line and a +pointer to where the full notice is found. + +one line to give the program's name and an idea of what it does. +Copyright (C) yyyy name of author + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this when it +starts in an interactive mode: + +Gnomovision version 69, Copyright (C) year name of author +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details +type `show w'. This is free software, and you are welcome +to redistribute it under certain conditions; type `show c' +for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may be +called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your school, +if any, to sign a "copyright disclaimer" for the program, if necessary. Here is +a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright +interest in the program `Gnomovision' +(which makes passes at compilers) written +by James Hacker. + +signature of Ty Coon, 1 April 1989 +Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may consider +it more useful to permit linking proprietary applications with the library. If +this is what you want to do, use the GNU Lesser General Public License instead +of this License. + +Additional Documentation License(s) + +innochecksum.c is documented in the MySQL Reference +Manual at http://dev.mysql.com/doc/refman/5.1/en/innochecksum.html +The Reference Manual is not licensed under the GPL; rather, it +is offered under normal copyright, but with permission to +copy/redistribute electronically. + +*************************************************************************** + +%%The following software may be included in this product: +lib_sql.cc + +Use of any of this software is governed by the terms of the license below: + +/* + * Copyright (c) 2000 + * SWsoft company + * + * This material is provided "as is", with absolutely no warranty expressed + * or implied. Any use is at your own risk. + * + * Permission to use or copy this software for any purpose is hereby granted + * without fee, provided the above notices are retained on all copies. + * Permission to modify the code and to distribute modified code is granted, + * provided the above notices are retained, and a notice that the code was + * modified is included with the above copyright notice. + * + + This code was modified by the MySQL team +*/ + +*************************************************************************** + +%%The following software may be included in this product: +libevent + +Use of any of this software is governed by the terms of the license below: + +/* + * Copyright (c) 2000-2004 Niels Provos + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +Additional License(s) + +http://creativecommons.org/licenses/publicdomain + +*************************************************************************** + +%%The following software may be included in this product: +Async DNS Library + +Use of any of this software is governed by the terms of the license below: + +/* Async DNS Library + * Adam Langley + * http://www.imperialviolet.org/eventdns.html + * Public Domain code + * + * This software is Public Domain. To view a copy of the public domain dedication, + * visit http://creativecommons.org/licenses/publicdomain/ or send a letter to + * Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. + * + * I ask and expect, but do not require, that all derivative works contain an + * attribution similar to: + * Parts developed by Adam Langley + * + * You may wish to replace the word "Parts" with something else depending on + * the amount of original code. + * + * (Derivative works does not include programs which link against, run or include + * the source verbatim in their source distributions) + * + * Version: 0.1b + */ + +*************************************************************************** + +%%The following software may be included in this product: +log.c + +Use of any of this software is governed by the terms of the license below: + +/* $OpenBSD: err.c,v 1.2 2002/06/25 15:50:15 mickey Exp $ */ + +/* + * log.c + * + * Based on err.c, which was adapted from OpenBSD libc *err* *warn* code. + * + * Copyright (c) 2005 Nick Mathewson + * + * Copyright (c) 2000 Dug Song + * + * Copyright (c) 1993 + * The Regents of the University of California. All rights +reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +*************************************************************************** + +%%The following software may be included in this product: +min_heap.h + +Use of any of this software is governed by the terms of the license below: + +/* + * Copyright (c) 2006 Maxim Yegorushkin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +*************************************************************************** + +%%The following software may be included in this product: +win32.c + +Use of any of this software is governed by the terms of the license below: + +/* + * Copyright 2000-2002 Niels Provos + * Copyright 2003 Michael A. Davis + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +*************************************************************************** + +%%The following software may be included in this product: +regex++ + +Use of any of this software is governed by the terms of the license below: + +Copyright 1992, 1993, 1994 Henry Spencer. All rights reserved. +This software is not subject to any license of the American Telephone +and Telegraph Company or of the Regents of the University of California. + +Permission is granted to anyone to use this software for any purpose on +any computer system, and to alter it and redistribute it, subject +to the following restrictions: + +1. The author is not responsible for the consequences of use of this + software, no matter how awful, even if they arise from flaws in it. + +2. The origin of this software must not be misrepresented, either by + explicit claim or by omission. Since few users ever read sources, + credits must appear in the documentation. + +3. Altered versions must be plainly marked as such, and must not be + misrepresented as being the original software. Since few users + ever read sources, credits must appear in the documentation. + +4. This notice may not be removed or altered. + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +/*- + * Copyright (c) 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)COPYRIGHT 8.1 (Berkeley) 3/16/94 + */ + +*************************************************************************** + +%%The following software may be included in this product: +Richard A. O'Keefe strings package + +Use of any of this software is governed by the terms of the license below: + +These files are in the public domain. This includes getopt.c, which +is the work of Henry Spencer, University of Toronto Zoology, who says of +it "None of this software is derived from Bell software. I had no access +to the source for Bell's versions at the time I wrote it. This software +is hereby explicitly placed in the public domain. It may be used for +any purpose on any machine by anyone." I would greatly prefer it if *my* +material received no military use. + +*************************************************************************** + +%%The following software may be included in this product: +t_ctype.h + +Use of any of this software is governed by the terms of the license below: + +http://bioinfo.mbb.yale.edu/genome/yeast/cluster/database/mysql/include/t_ctype.h + +/* + Copyright (C) 1998, 1999 by Pruet Boonma, all rights reserved. + Copyright (C) 1998 by Theppitak Karoonboonyanan, all rights reserved. + Permission to use, copy, modify, distribute and sell this software + and its documentation for any purpose is hereby granted without fee, + provided that the above copyright notice appear in all copies. + Smaphan Raruenrom and Pruet Boonma makes no representations about + the suitability of this software for any purpose. It is provided + "as is" without express or implied warranty. +*/ + +*************************************************************************** + +%%The following software may be included in this product: +SHA-1 in C + +Use of any of this software is governed by the terms of the license below: + + SHA-1 in C + By Steve Reid + 100% Public Domain + +Additional License(s) + +100% Public Domain + +*************************************************************************** + +%%The following software may be included in this product: +TCMalloc (part of google-perftools) + +Use of any of this software is governed by the terms of the license below: + +# Copyright (c) 1998-2006, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Additional License(s) + +*** File src/tests/ptmalloc/thread-m.h contains this GPLv2 (or later) +text: + +/* Basic platform-independent macro definitions for mutexes and + thread-specific data. + Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Wolfram Gloger , 1996. + + The GNU C 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; either version 2 of the + License, or (at your option) any later version. + + The GNU C 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 the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite + 330, Boston, MA 02111-1307, USA. */ + + + +*** File src/tests/ptmalloc/malloc-machine.h contains this BSD like text: + +/* Basic platform-independent macro definitions for mutexes, + thread-specific data and parameters for malloc. + Posix threads (pthreads) version. + Copyright (C) 2004 Wolfram Gloger . + +Permission to use, copy, modify, distribute, and sell this software +and its documentation for any purpose is hereby granted without fee, +provided that (i) the above copyright notices and this permission +notice appear in all copies of the software and related documentation, +and (ii) the name of Wolfram Gloger may not be used in any advertising +or publicity relating to the software. + +THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + +IN NO EVENT SHALL WOLFRAM GLOGER BE LIABLE FOR ANY SPECIAL, +INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY +DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY +OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +*/ + +*************************************************************************** + +%%The following software may be included in this product: +The tz database + +Use of any of this software is governed by the terms of the license below: + +Sources for Time Zone and Daylight Saving Time Data +@(#)tz-link.htm 7.54 + +Please send corrections to this web page to the time zone mailing list. +The tz database + +The public-domain time zone database contains code and data that represent the +history of local time for many representative locations around the globe. It is +updated periodically to reflect changes made by political bodies to time zone +boundaries, UTC offsets, and daylight-saving rules. This database (often called +tz or zoneinfo) is used by several implementations, including the GNU C Library +used in GNU/Linux, FreeBSD, NetBSD, OpenBSD, Cygwin, DJGPP, HP-UX, IRIX, Mac OS +X, OpenVMS, Solaris, Tru64, and UnixWare. + +Each location in the database represents a national region where all clocks +keeping local time have agreed since 1970. Locations are identified by continent +or ocean and then by the name of the location, which is typically the largest +city within the region. For example, America/New_York represents most of the US +eastern time zone; America/Phoenix represents most of Arizona, which uses +mountain time without daylight saving time (DST); America/Detroit represents +most of Michigan, which uses eastern time but with different DST rules in 1975; +and other entries represent smaller regions like Starke County, Indiana, which +switched from central to eastern time in 1991 and switched back in 2006. To use +the database on an extended POSIX implementation set the TZ environment variable +to the location's full name, e.g., TZ="America/New_York". + +In the tz database's FTP distribution the code is in the file tzcodeC.tar.gz, +where C is the code's version; similarly, the data are in tzdataD.tar.gz, where +D is the data's version. The following shell commands download these files to a +GNU/Linux or similar host; see the downloaded README file for what to do next. + +wget 'ftp://elsie.nci.nih.gov/pub/tz*.tar.gz' +gzip -dc tzcode*.tar.gz | tar -xf - +gzip -dc tzdata*.tar.gz | tar -xf - + +The code lets you compile the tz source files into machine-readable binary +files, one for each location. It also lets you read a tz binary file and +interpret time stamps for that location. + +The data are by no means authoritative. If you find errors, please send changes +to the time zone mailing list. You can also subscribe to the mailing list, +retrieve the archive of old messages (in gzip compressed format), or retrieve +archived older versions of code and data; there is also a smaller HTTP mirror. + +*************************************************************************** + +%%The following software may be included in this product: +UnicodeData.txt + +Use of any of this software is governed by the terms of the license below: + +Unicode Terms of Use + + For the general privacy policy governing access to this site, see the + Unicode Privacy Policy. For trademark usage, see the Unicode + Consortium (R) Trademarks and Logo Policy. + Notice to End User: Terms of Use + Carefully read the following legal agreement ("Agreement"). Use or + copying of the software and/or codes provided with this agreement (The + "Software") constitutes your acceptance of these terms + + 1. Unicode Copyright. + 1. Copyright (c) 1991-2008 Unicode, Inc. All rights reserved. + 2. Certain documents and files on this website contain a + legend indicating that "Modification is permitted." Any person + is hereby authorized, without fee, to modify such documents + and files to create derivative works conforming to the + Unicode (R) Standard, subject to Terms and Conditions herein. + 3. Any person is hereby authorized, without fee, to view, use, + reproduce, and distribute all documents and files solely for + informational purposes in the creation of products supporting + the Unicode Standard, subject to the Terms and Conditions + herein. + 4. Further specifications of rights and restrictions + pertaining to the use of the particular set of data files + known as the "Unicode Character Database" can be found in + Exhibit 1. + 5. Each version of the Unicode Standard has further + specifications of rights and restrictions of use. For the book + editions, these are found on the back of the title page. For + the online edition, certain files (such as the PDF files for + book chapters and code charts) carry specific restrictions. + All other files are covered under these general Terms of Use. + To request a permission to reproduce any part of the Unicode + Standard, please contact the Unicode Consortium. + 6. No license is granted to "mirror" the Unicode website where + a fee is charged for access to the "mirror" site. + 7. Modification is not permitted with respect to this + document. All copies of this document must be verbatim. + 2. Restricted Rights Legend. Any technical data or software which is + licensed to the United States of America, its agencies and/or + instrumentalities under this Agreement is commercial technical data + or commercial computer software developed exclusively at private + expense as defined in FAR 2.101, or DFARS 252.227-7014 (June 1995), + as applicable. For technical data, use, duplication, or disclosure + by the Government is subject to restrictions as set forth in DFARS + 202.227-7015 Technical Data, Commercial and Items (Nov 1995) and + this Agreement. For Software, in accordance with FAR 12-212 or DFARS + 227-7202, as applicable, use, duplication or disclosure by the + Government is subject to the restrictions set forth in this + Agreement. + 3. Warranties and Disclaimers. + 1. This publication and/or website may include technical or + typographical errors or other inaccuracies . Changes are + periodically added to the information herein; these changes + will be incorporated in new editions of the publication and/or + website. Unicode may make improvements and/or changes in the + product(s) and/or program(s) described in this publication + and/or website at any time. + 2. If this file has been purchased on magnetic or optical + media from Unicode, Inc. the sole and exclusive remedy for any + claim will be exchange of the defective media within ninety + (90) days of original purchase. + 3. EXCEPT AS PROVIDED IN SECTION C.2, THIS PUBLICATION AND/OR + SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND + EITHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT + LIMITED TO, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UNICODE AND ITS + LICENSORS ASSUME NO RESPONSIBILITY FOR ERRORS OR OMISSIONS IN + THIS PUBLICATION AND/OR SOFTWARE OR OTHER DOCUMENTS WHICH ARE + REFERENCED BY OR LINKED TO THIS PUBLICATION OR THE UNICODE + WEBSITE. + 4. Waiver of Damages. In no event shall Unicode or its licensors be + liable for any special, incidental, indirect or consequential + damages of any kind, or any damages whatsoever, whether or not + Unicode was advised of the possibility of the damage, including, + without limitation, those resulting from the following: loss of use, + data or profits, in connection with the use, modification or + distribution of this information or its derivatives. + 5. Trademarks. + 1. Unicode and the Unicode logo are registered trademarks of + Unicode, Inc. + 2. This site contains product names and corporate names of + other companies. All product names and company names and logos + mentioned herein are the trademarks or registered trademarks + of their respective owners. Other products and corporate names + mentioned herein which are trademarks of a third party are + used only for explanation and for the owners' benefit and with + no intent to infringe. + 3. Use of third party products or information referred to + herein is at the user's risk. + 6. Miscellaneous. + 1. Jurisdiction and Venue. This server is operated from a + location in the State of California, United States of America. + Unicode makes no representation that the materials are + appropriate for use in other locations. If you access this + server from other locations, you are responsible for + compliance with local laws. This Agreement, all use of this + site and any claims and damages resulting from use of this + site are governed solely by the laws of the State of + California without regard to any principles which would apply + the laws of a different jurisdiction. The user agrees that any + disputes regarding this site shall be resolved solely in the + courts located in Santa Clara County, California. The user + agrees said courts have personal jurisdiction and agree to + waive any right to transfer the dispute to any other forum. + 2. Modification by Unicode Unicode shall have the right to + modify this Agreement at any time by posting it to this site. + The user may not assign any part of this Agreement without + Unicode's prior written consent. + 3. Taxes. The user agrees to pay any taxes arising from access + to this website or use of the information herein, except for + those based on Unicode's net income. + 4. Severability. If any provision of this Agreement is + declared invalid or unenforceable, the remaining provisions of + this Agreement shall remain in effect. + 5. Entire Agreement. This Agreement constitutes the entire + agreement between the parties. + +EXHIBIT 1 +UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE + + Unicode Data Files include all data files under the directories +http://www.unicode.org/Public/, http://www.unicode.org/reports/, and +http://www.unicode.org/cldr/data/ . Unicode Software includes any source code +published in the Unicode Standard or under the directories +http://www.unicode.org/Public/, http://www.unicode.org/reports/, and +http://www.unicode.org/cldr/data/. + + NOTICE TO USER: Carefully read the following legal agreement. BY +DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S DATA FILES +("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), YOU UNEQUIVOCALLY ACCEPT, AND +AGREE TO BE BOUND BY, ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU +DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES +OR SOFTWARE. + + COPYRIGHT AND PERMISSION NOTICE + + Copyright (c) 1991-2008 Unicode, Inc. All rights reserved. Distributed under +the Terms of Use in http://www.unicode.org/copyright.html. + + Permission is hereby granted, free of charge, to any person obtaining a copy +of the Unicode data files and any associated documentation (the "Data Files") or +Unicode software and any associated documentation (the "Software") to deal in +the Data Files or Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, and/or sell copies of +the Data Files or Software, and to permit persons to whom the Data Files or +Software are furnished to do so, provided that (a) the above copyright notice(s) +and this permission notice appear with all copies of the Data Files or Software, +(b) both the above copyright notice(s) and this permission notice appear in +associated documentation, and (c) there is clear notice in each modified Data +File or in the Software as well as in the documentation associated with the Data +File(s) or Software that the data or software has been modified. + + THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD +PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS +NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING +OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR SOFTWARE. + + Except as contained in this notice, the name of a copyright holder shall not +be used in advertising or otherwise to promote the sale, use or other dealings +in these Data Files or Software without prior written authorization of the +copyright holder. + + Unicode and the Unicode logo are trademarks of Unicode, Inc., and may be +registered in some jurisdictions. All other trademarks and registered trademarks +mentioned herein are the property of their respective owners. + +*************************************************************************** + +%%The following software may be included in this product: +zlib + +Use of any of this software is governed by the terms of the license below: + +/* zlib.h -- interface of the 'zlib' general purpose compression library + version 1.2.3, July 18th, 2005 + + Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly jloup@gzip.org + Mark Adler madler@alumni.caltech.edu + +*/ + +*************************************************************************** + +%%The following software may be included in this product: +dtoa.c + +Use of any of this software is governed by the terms of the license below: + +/**************************************************************** + + This file incorporates work covered by the following copyright and + permission notice: + + The author of this software is David M. Gay. + + Copyright (c) 1991, 2000, 2001 by Lucent Technologies. + + Permission to use, copy, modify, and distribute this software for any + purpose without fee is hereby granted, provided that this entire + notice is included in all copies of any software which is or includes a copy + or modification of this software and in all copies of the supporting + documentation for such software. + + THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY + REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY + OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. + + ***************************************************************/ + +*************************************************************************** + +%%The following software may be included in this product: +getarg.{c,h} + +Use of any of this software is governed by the terms of the license below: + +/* 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 */ + +/* + * Copyright (c) 1997, 1999 Kungliga Tekniska H366gskolan + * (Royal Institute of Technology, Stockholm, Sweden). + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +*************************************************************************** + +%%The following software may be included in this product: +MD5 message-digest algorithm (md5_hash.cpp) + +Use of any of this software is governed by the terms of the license below: + +/* + * This code implements the MD5 message-digest algorithm. + * The algorithm is due to Ron Rivest. This code was + * written by Colin Plumb in 1993, no copyright is claimed. + * This code is in the public domain; do with it what you wish. + * + * Equivalent code is available from RSA Data Security, Inc. + * This code has been tested against that, and is equivalent, + * except that you don't need to include two pages of legalese + * with every copy. + * + * The code has been modified by Mikael Ronstroem to handle + * calculating a hash value of a key that is always a multiple + * of 4 bytes long. Word 0 of the calculated 4-word hash value + * is returned as the hash value. + */ + +*************************************************************************** + +%%The following software may be included in this product: +nt_servc.{cc,h} + +Use of any of this software is governed by the terms of the license below: + +/** + @file + + @brief + Windows NT Service class library. + + Copyright Abandoned 1998 Irena Pancirov - Irnet Snc + This file is public domain and comes with NO WARRANTY of any kind +*/ + +*************************************************************************** + +%%The following software may be included in this product: +GNU Readline + +Use of any of this software is governed by the terms of the license below: + +GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. + +*************************************************************************** + +%%The following software may be included in this product: +pstack (part of GNU Binutils) + +Use of any of this software is governed by the terms of the license below: + +pstack is comprised of various .c and .h files; all begin like this: + +/* bucomm.h -- binutils common include file. + Copyright (C) 1992, 93, 94, 95, 96, 1997 Free Software Foundation, Inc. + +This file is part of GNU Binutils. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ + +*************************************************************************** + +%%The following software may be included in this product: +libiberty.h (part of pstack GNU Binutils) + +Use of any of this software is governed by the terms of the license below: + +See +http://www.koders.com/c/fid99F596804BBE22C076522B848D5575F142079064.aspx + +/* Function declarations for libiberty. + Written by Cygnus Support, 1994. + + The libiberty library provides a number of functions which are + missing on some operating systems. We do not declare those here, + to avoid conflicts with the system header files on operating + systems that do support those functions. In this file we only + declare those functions which are specific to libiberty. */ + +*************************************************************************** + +%%The following software may be included in this product: +ieee.h (part of pstack GNU Binutils) + +Use of any of this software is governed by the terms of the license below: + +See +http://src.opensolaris.org/source/xref//sfw/usr/src/cmd/gdb/gdb-6.3/include/ieee.h + + +/* IEEE Standard 695-1980 "Universal Format for Object Modules" + header file + Contributed by Cygnus Support. */ + +*************************************************************************** + +%%The following software may be included in this product: +pstack.c (part of pstack GNU Binutils) + +Use of any of this software is governed by the terms of the license below: + +/* + pstack.c -- asynchronous stack trace of a running process + Copyright (c) 1999 Ross Thompson + Author: Ross Thompson + Critical bug fix: Tim Waugh +*/ + +/* + This file is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +********************************************************************** diff --git a/VERSION b/VERSION new file mode 100644 index 00000000000..f85cac84d7e --- /dev/null +++ b/VERSION @@ -0,0 +1,4 @@ +MYSQL_VERSION_MAJOR=5 +MYSQL_VERSION_MINOR=5 +MYSQL_VERSION_PATCH=9 +MYSQL_VERSION_EXTRA= diff --git a/client/Makefile.am b/client/Makefile.am deleted file mode 100644 index 393573a061e..00000000000 --- a/client/Makefile.am +++ /dev/null @@ -1,125 +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_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=log_event.h sql_priv.h rpl_constants.h \ - rpl_tblmap.h rpl_tblmap.cc \ - log_event.cc my_decimal.h my_decimal.cc \ - log_event_old.h log_event_old.cc \ - rpl_record_old.h rpl_record_old.cc \ - rpl_utility.h rpl_utility.cc \ - transaction.h sql_const.h -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; diff --git a/client/mysql.cc b/client/mysql.cc index 4a8579bbd4d..51c8b34b0a8 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -3739,7 +3739,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; @@ -3798,7 +3799,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; @@ -3923,7 +3925,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; @@ -4015,7 +4018,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; @@ -4929,7 +4933,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; diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 226776e4404..bf4920c6f77 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -1010,10 +1010,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}, /* @@ -2024,6 +2025,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); diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 376ce0fa59d..e0fed9704a5 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -487,7 +487,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 backtick=true); my_bool match_delimiter(int c, const char *delim, uint length); void dump_result_to_reject_file(char *buf, int size); void dump_warning_messages(); @@ -2045,9 +2046,11 @@ static void var_free(void *v) C_MODE_END -void var_set_int(VAR *v, const char *str) +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; @@ -2094,7 +2097,7 @@ VAR *var_init(VAR *v, const char *name, int name_len, const char *val, memcpy(tmp_var->str_val, val, val_len); tmp_var->str_val[val_len]= 0; } - var_set_int(tmp_var, val); + 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; @@ -2335,7 +2338,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 @@ -2545,7 +2549,8 @@ 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 backtick) { DBUG_ENTER("eval_expr"); @@ -2563,14 +2568,14 @@ 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); DBUG_VOID_RETURN; } - if (*p == '`') + if (*p == '`' && backtick) { var_query_set(v, p, p_end); DBUG_VOID_RETURN; @@ -2610,7 +2615,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; - var_set_int(v, p); + var_check_int(v); } DBUG_VOID_RETURN; } @@ -4240,7 +4245,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)); @@ -4329,7 +4334,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; } @@ -5398,8 +5403,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 @@ -5408,36 +5418,37 @@ 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); -#ifdef HAVE_SMEM if (con_shm) { +#ifdef HAVE_SMEM uint protocol= MYSQL_PROTOCOL_MEMORY; if (!ds_shm.length) die("Missing shared memory base name"); mysql_options(&con_slot->mysql, MYSQL_SHARED_MEMORY_BASE_NAME, ds_shm.str); mysql_options(&con_slot->mysql, MYSQL_OPT_PROTOCOL, &protocol); +#endif } - else if(shared_memory_base_name) +#ifdef HAVE_SMEM + else if (shared_memory_base_name) { mysql_options(&con_slot->mysql, MYSQL_SHARED_MEMORY_BASE_NAME, - shared_memory_base_name); + shared_memory_base_name); } #endif - /* Use default db name */ if (ds_database.length == 0) dynstr_set(&ds_database, opt_db); @@ -5515,6 +5526,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 @@ -5540,6 +5585,13 @@ int do_done(struct st_command *command) A '!' can be used before the to indicate it should be executed if it evaluates to zero. + can also be a simple comparison condition: + + + + 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) @@ -5575,11 +5627,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 ! */ 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, ')'); @@ -5593,14 +5650,96 @@ 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++; + + 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; + } 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 */ { @@ -5877,7 +6016,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) @@ -5889,16 +6028,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); } } @@ -9959,6 +10098,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 @@ -9966,7 +10106,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); diff --git a/client/sql_string.h b/client/sql_string.h index bafc287c73e..f406da28995 100644 --- a/client/sql_string.h +++ b/client/sql_string.h @@ -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(); } diff --git a/cmake/Makefile.am b/cmake/Makefile.am deleted file mode 100644 index af3ec4f980d..00000000000 --- a/cmake/Makefile.am +++ /dev/null @@ -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 - - diff --git a/cmake/abi_check.cmake b/cmake/abi_check.cmake index b9ff9f7af73..2488bcefe33 100644 --- a/cmake/abi_check.cmake +++ b/cmake/abi_check.cmake @@ -27,12 +27,14 @@ IF(CMAKE_COMPILER_IS_GNUCC AND CMAKE_SYSTEM_NAME MATCHES "Linux") ELSE() SET(COMPILER ${CMAKE_C_COMPILER}) ENDIF() - SET(API_PREPROCESSOR_HEADER + SET(API_PREPROCESSOR_HEADER ${CMAKE_SOURCE_DIR}/include/mysql/plugin_audit.h ${CMAKE_SOURCE_DIR}/include/mysql/plugin_ftparser.h ${CMAKE_SOURCE_DIR}/include/mysql.h - ${CMAKE_SOURCE_DIR}/include/mysql/psi/psi_abi_v1.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 diff --git a/cmake/build_configurations/mysql_release.cmake b/cmake/build_configurations/mysql_release.cmake index 48d3765ea67..56a6d897318 100644 --- a/cmake/build_configurations/mysql_release.cmake +++ b/cmake/build_configurations/mysql_release.cmake @@ -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) @@ -120,7 +122,13 @@ IF(UNIX) 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") + 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 + ") ENDIF() ENDIF() @@ -219,22 +227,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() diff --git a/cmake/configure.pl b/cmake/configure.pl index 1dc8080810c..b24afa034c7 100644 --- a/cmake/configure.pl +++ b/cmake/configure.pl @@ -185,6 +185,11 @@ foreach my $option (@ARGV) ($option =~ /enable/ ? "1" : "0"); next; } + if ($option =~ /with-comment=/) + { + $cmakeargs = $cmakeargs." \"-DWITH_COMMENT=".substr($option,13)."\""; + next; + } $option = uc($option); $option =~ s/-/_/g; diff --git a/cmake/install_layout.cmake b/cmake/install_layout.cmake index 19a8a61df2d..601e208d96d 100644 --- a/cmake/install_layout.cmake +++ b/cmake/install_layout.cmake @@ -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 @@ -74,7 +74,7 @@ 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") diff --git a/cmake/install_macros.cmake b/cmake/install_macros.cmake index bc8d9945690..e244e4262e0 100644 --- a/cmake/install_macros.cmake +++ b/cmake/install_macros.cmake @@ -78,7 +78,9 @@ 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() @@ -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() @@ -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) diff --git a/cmake/libutils.cmake b/cmake/libutils.cmake index 0cc8895f43e..89eb5a74d80 100644 --- a/cmake/libutils.cmake +++ b/cmake/libutils.cmake @@ -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) diff --git a/cmake/make_dist.cmake.in b/cmake/make_dist.cmake.in index 13950e08553..95412370c28 100644 --- a/cmake/make_dist.cmake.in +++ b/cmake/make_dist.cmake.in @@ -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@") @@ -101,28 +94,6 @@ 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) @@ -138,7 +109,6 @@ 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 diff --git a/cmake/mysql_add_executable.cmake b/cmake/mysql_add_executable.cmake index b49a737716c..ac812fbcdfd 100644 --- a/cmake/mysql_add_executable.cmake +++ b/cmake/mysql_add_executable.cmake @@ -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) diff --git a/cmake/mysql_version.cmake b/cmake/mysql_version.cmake index 6adca2ccc2f..b4be85ff657 100644 --- a/cmake/mysql_version.cmake +++ b/cmake/mysql_version.cmake @@ -13,16 +13,24 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# Read value for a variable from configure.in +# +# Global constants, only to be changed between major releases. +# + +SET(SHARED_LIB_MAJOR_VERSION "16") +SET(PROTOCOL_VERSION "10") +SET(DOT_FRM_VERSION "6") + +# Read value for a variable from VERSION. MACRO(MYSQL_GET_CONFIG_VALUE keyword var) IF(NOT ${var}) - IF (EXISTS ${CMAKE_SOURCE_DIR}/configure.in) - FILE (STRINGS ${CMAKE_SOURCE_DIR}/configure.in str REGEX "^[ ]*${keyword}=") + IF (EXISTS ${CMAKE_SOURCE_DIR}/VERSION) + FILE (STRINGS ${CMAKE_SOURCE_DIR}/VERSION str REGEX "^[ ]*${keyword}=") IF(str) STRING(REPLACE "${keyword}=" "" str ${str}) - STRING(REGEX REPLACE "[ ].*" "" str ${str}) - SET(${var} ${str} CACHE INTERNAL "Config variable") + STRING(REGEX REPLACE "[ ].*" "" str "${str}") + SET(${var} ${str}) ENDIF() ENDIF() ENDIF() @@ -32,57 +40,32 @@ ENDMACRO() # Read mysql version for configure script MACRO(GET_MYSQL_VERSION) + MYSQL_GET_CONFIG_VALUE("MYSQL_VERSION_MAJOR" MAJOR_VERSION) + MYSQL_GET_CONFIG_VALUE("MYSQL_VERSION_MINOR" MINOR_VERSION) + MYSQL_GET_CONFIG_VALUE("MYSQL_VERSION_PATCH" PATCH_VERSION) + MYSQL_GET_CONFIG_VALUE("MYSQL_VERSION_EXTRA" EXTRA_VERSION) - IF(NOT VERSION_STRING) - IF(EXISTS ${CMAKE_SOURCE_DIR}/configure.in) - FILE(STRINGS ${CMAKE_SOURCE_DIR}/configure.in str REGEX "AM_INIT_AUTOMAKE") - STRING(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+[-][^ \\)]+" VERSION_STRING "${str}") - IF(NOT VERSION_STRING) - STRING(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" VERSION_STRING "${str}") - IF(NOT VERSION_STRING) - FILE(STRINGS configure.in str REGEX "AC_INIT\\(") - STRING(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+[-][a-zAZ0-9]+" VERSION_STRING "${str}") - ENDIF() - ENDIF() - ENDIF() + IF(NOT MAJOR_VERSION OR NOT MINOR_VERSION OR NOT PATCH_VERSION) + MESSAGE(FATAL_ERROR "VERSION file cannot be parsed.") ENDIF() - - IF(NOT VERSION_STRING) - MESSAGE(FATAL_ERROR - "VERSION_STRING cannot be parsed, please specify -DVERSION_STRING=major.minor.patch-extra" - "when calling cmake") - ENDIF() - - SET(VERSION ${VERSION_STRING}) - STRING(REPLACE "-" "_" MYSQL_U_SCORE_VERSION "${VERSION_STRING}") - - # Remove trailing (non-numeric) part of the version string - STRING(REGEX REPLACE "[^\\.0-9].*" "" VERSION_STRING ${VERSION_STRING}) - - STRING(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" MAJOR_VERSION "${VERSION_STRING}") - STRING(REGEX REPLACE "[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" MINOR_VERSION "${VERSION_STRING}") - STRING(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" PATCH "${VERSION_STRING}") + SET(VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}${EXTRA_VERSION}") + MESSAGE("-- MySQL ${VERSION}") SET(MYSQL_BASE_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}" CACHE INTERNAL "MySQL Base version") - SET(MYSQL_NO_DASH_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH}") - MATH(EXPR MYSQL_VERSION_ID "10000*${MAJOR_VERSION} + 100*${MINOR_VERSION} + ${PATCH}") + SET(MYSQL_NO_DASH_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}") + STRING(REPLACE "-" "_" MYSQL_RPM_VERSION "${VERSION}") + MATH(EXPR MYSQL_VERSION_ID "10000*${MAJOR_VERSION} + 100*${MINOR_VERSION} + ${PATCH_VERSION}") MARK_AS_ADVANCED(VERSION MYSQL_VERSION_ID MYSQL_BASE_VERSION) SET(CPACK_PACKAGE_VERSION_MAJOR ${MAJOR_VERSION}) SET(CPACK_PACKAGE_VERSION_MINOR ${MINOR_VERSION}) - SET(CPACK_PACKAGE_VERSION_PATCH ${PATCH}) + SET(CPACK_PACKAGE_VERSION_PATCH ${PATCH_VERSION}) ENDMACRO() # Get mysql version and other interesting variables GET_MYSQL_VERSION() -MYSQL_GET_CONFIG_VALUE("PROTOCOL_VERSION" PROTOCOL_VERSION) -MYSQL_GET_CONFIG_VALUE("DOT_FRM_VERSION" DOT_FRM_VERSION) -MYSQL_GET_CONFIG_VALUE("MYSQL_TCP_PORT_DEFAULT" MYSQL_TCP_PORT_DEFAULT) -MYSQL_GET_CONFIG_VALUE("MYSQL_UNIX_ADDR_DEFAULT" MYSQL_UNIX_ADDR_DEFAULT) -MYSQL_GET_CONFIG_VALUE("SHARED_LIB_MAJOR_VERSION" SHARED_LIB_MAJOR_VERSION) -IF(NOT MYSQL_TCP_PORT_DEFAULT) - SET(MYSQL_TCP_PORT_DEFAULT "3306") -ENDIF() +SET(MYSQL_TCP_PORT_DEFAULT "3306") + IF(NOT MYSQL_TCP_PORT) SET(MYSQL_TCP_PORT ${MYSQL_TCP_PORT_DEFAULT}) SET(MYSQL_TCP_PORT_DEFAULT "0") @@ -130,9 +113,8 @@ ENDIF() # Refer to http://msdn.microsoft.com/en-us/library/aa381058(VS.85).aspx # for more info. IF(MSVC) - GET_TARGET_PROPERTY(location gen_versioninfo LOCATION) - IF(NOT location) GET_FILENAME_COMPONENT(MYSQL_CMAKE_SCRIPT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) + SET(FILETYPE VFT_APP) CONFIGURE_FILE(${MYSQL_CMAKE_SCRIPT_DIR}/versioninfo.rc.in ${CMAKE_BINARY_DIR}/versioninfo_exe.rc) @@ -140,31 +122,14 @@ IF(MSVC) SET(FILETYPE VFT_DLL) CONFIGURE_FILE(${MYSQL_CMAKE_SCRIPT_DIR}/versioninfo.rc.in ${CMAKE_BINARY_DIR}/versioninfo_dll.rc) - - ADD_CUSTOM_COMMAND( - OUTPUT ${CMAKE_BINARY_DIR}/versioninfo_exe.res - ${CMAKE_BINARY_DIR}/versioninfo_dll.res - COMMAND ${CMAKE_RC_COMPILER} versioninfo_exe.rc - COMMAND ${CMAKE_RC_COMPILER} versioninfo_dll.rc - WORKING_DIRECTORY ${CMAKE_BINARY_DIR} - ) - ADD_CUSTOM_TARGET(gen_versioninfo - DEPENDS - ${CMAKE_BINARY_DIR}/versioninfo_exe.res - ${CMAKE_BINARY_DIR}/versioninfo_dll.res - ) - ENDIF() - - FUNCTION(ADD_VERSION_INFO target) - GET_TARGET_PROPERTY(target_type ${target} TYPE) - ADD_DEPENDENCIES(${target} gen_versioninfo) - IF(target_type MATCHES "SHARED" OR target_type MATCHES "MODULE") - SET_PROPERTY(TARGET ${target} APPEND PROPERTY LINK_FLAGS - "\"${CMAKE_BINARY_DIR}/versioninfo_dll.res\"") - ELSEIF(target_type MATCHES "EXE") - SET_PROPERTY(TARGET ${target} APPEND PROPERTY LINK_FLAGS - "${target_link_flags} \"${CMAKE_BINARY_DIR}/versioninfo_exe.res\"") + + FUNCTION(ADD_VERSION_INFO target target_type sources_var) + IF("${target_type}" MATCHES "SHARED" OR "${target_type}" MATCHES "MODULE") + SET(rcfile ${CMAKE_BINARY_DIR}/versioninfo_dll.rc) + ELSEIF("${target_type}" MATCHES "EXE") + SET(rcfile ${CMAKE_BINARY_DIR}/versioninfo_exe.rc) ENDIF() + SET(${sources_var} ${${sources_var}} ${rcfile} PARENT_SCOPE) ENDFUNCTION() ELSE() FUNCTION(ADD_VERSION_INFO) diff --git a/cmake/os/Linux.cmake b/cmake/os/Linux.cmake index 946e020d6f4..10d3a719609 100644 --- a/cmake/os/Linux.cmake +++ b/cmake/os/Linux.cmake @@ -33,7 +33,7 @@ ENDFOREACH() # Ensure we have clean build for shared libraries # without unresolved symbols -SET(LINK_FLAG_NO_UNDEFINED "--Wl,--no-undefined") +SET(LINK_FLAG_NO_UNDEFINED "-Wl,--no-undefined") # 64 bit file offset support flag SET(_FILE_OFFSET_BITS 64) diff --git a/cmake/os/Windows.cmake b/cmake/os/Windows.cmake index aac7e484f26..0dbfde5294c 100644 --- a/cmake/os/Windows.cmake +++ b/cmake/os/Windows.cmake @@ -91,7 +91,6 @@ IF(MSVC) STRING(REGEX REPLACE "/INCREMENTAL:([^ ]+)" "" CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO}") ENDFOREACH() - ADD_DEFINITIONS(-DPTHREAD_STACK_MIN=1048576) # Mark 32 bit executables large address aware so they can # use > 2GB address space IF(CMAKE_SIZEOF_VOID_P MATCHES 4) @@ -105,14 +104,9 @@ IF(MSVC) ENDIF() #TODO: update the code and remove the disabled warnings - ADD_DEFINITIONS(/wd4800 /wd4805) - IF (MSVC_VERSION GREATER 1310) - ADD_DEFINITIONS(/wd4996) - ENDIF() + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4800 /wd4805 /wd4996") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4800 /wd4805 /wd4996 /we4099") - # Make class/struct definition mismatch an error (overseen too often, - # adds tons of new warnings) - ADD_DEFINITIONS(/we4099) IF(CMAKE_SIZEOF_VOID_P MATCHES 8) # _WIN64 is defined by the compiler itself. diff --git a/cmake/os/WindowsCache.cmake b/cmake/os/WindowsCache.cmake index 4936ae369bc..ff068bfeaf6 100644 --- a/cmake/os/WindowsCache.cmake +++ b/cmake/os/WindowsCache.cmake @@ -57,6 +57,7 @@ SET(HAVE_FCNTL_H 1 CACHE INTERNAL "") SET(HAVE_FCNTL_NONBLOCK CACHE INTERNAL "") SET(HAVE_FCONVERT CACHE INTERNAL "") SET(HAVE_FDATASYNC CACHE INTERNAL "") +SET(HAVE_DECL_FDATASYNC CACHE INTERNAL "") SET(HAVE_FENV_H CACHE INTERNAL "") SET(HAVE_FESETROUND CACHE INTERNAL "") SET(HAVE_FGETLN CACHE INTERNAL "") diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake index 94fdc8bf1e9..bf34407db25 100644 --- a/cmake/plugin.cmake +++ b/cmake/plugin.cmake @@ -151,6 +151,7 @@ MACRO(MYSQL_ADD_PLUGIN) ENDIF() ENDIF() + ADD_VERSION_INFO(${target} MODULE SOURCES) ADD_LIBRARY(${target} MODULE ${SOURCES}) DTRACE_INSTRUMENT(${target}) SET_TARGET_PROPERTIES (${target} PROPERTIES PREFIX "" diff --git a/cmake/versioninfo.rc.in b/cmake/versioninfo.rc.in index 97c45ec86c0..c625ce8c7f4 100644 --- a/cmake/versioninfo.rc.in +++ b/cmake/versioninfo.rc.in @@ -1,7 +1,7 @@ #include VS_VERSION_INFO VERSIONINFO -FILEVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH@,0 -PRODUCTVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH@,0 +FILEVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH_VERSION@,0 +PRODUCTVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH_VERSION@,0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0 FILEOS VOS__WINDOWS32 @@ -12,8 +12,8 @@ BEGIN BEGIN BLOCK "040904E4" BEGIN - VALUE "FileVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH@.0\0" - VALUE "ProductVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH@.0\0" + VALUE "FileVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@.0\0" + VALUE "ProductVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@.0\0" END END BLOCK "VarFileInfo" diff --git a/cmd-line-utils/Makefile.am b/cmd-line-utils/Makefile.am deleted file mode 100644 index 622aa72fd43..00000000000 --- a/cmd-line-utils/Makefile.am +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright (C) 2004 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 - -SUBDIRS= @readline_basedir@ -DIST_SUBDIRS= libedit readline diff --git a/cmd-line-utils/libedit/Makefile.am b/cmd-line-utils/libedit/Makefile.am deleted file mode 100644 index 88ea97afffd..00000000000 --- a/cmd-line-utils/libedit/Makefile.am +++ /dev/null @@ -1,92 +0,0 @@ -## Process this file with automake to create Makefile.in - -ASRC = $(srcdir)/vi.c $(srcdir)/emacs.c $(srcdir)/common.c -AHDR = vi.h emacs.h common.h - -INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include - -noinst_LIBRARIES = libedit.a - -libedit_a_SOURCES = chared.c el.c history.c map.c prompt.c readline.c \ - search.c tokenizer.c vi.c common.c emacs.c \ - hist.c key.c parse.c read.c refresh.c sig.c term.c \ - tty.c help.c fcns.c filecomplete.c \ - np/unvis.c np/strlcpy.c np/vis.c np/strlcat.c \ - np/fgetln.c - -libedit_a_LIBADD = @LIBEDIT_LOBJECTS@ -libedit_a_DEPENDENCIES = @LIBEDIT_LOBJECTS@ - -pkginclude_HEADERS = readline/readline.h - -noinst_HEADERS = chared.h el.h el_term.h histedit.h key.h parse.h refresh.h sig.h \ - sys.h config.h hist.h map.h prompt.h read.h \ - search.h tty.h filecomplete.h np/vis.h - -EXTRA_DIST = makelist.sh CMakeLists.txt - -CLEANFILES = makelist common.h emacs.h vi.h fcns.h help.h fcns.c help.c - -SUFFIXES = .sh - -.sh: - @RM@ -f $@ $@-t - @SED@ \ - -e 's!@''AWK''@!@AWK@!' \ - $< > $@-t - @MV@ $@-t $@ - -vi.h: $(srcdir)/vi.c makelist - sh ./makelist -h $(srcdir)/vi.c > $@.tmp && \ - mv $@.tmp $@ - -emacs.h: $(srcdir)/emacs.c makelist - sh ./makelist -h $(srcdir)/emacs.c > $@.tmp && \ - mv $@.tmp $@ - -common.h: $(srcdir)/common.c makelist - sh ./makelist -h $(srcdir)/common.c > $@.tmp && \ - mv $@.tmp $@ - -help.c: ${ASRC} makelist - sh ./makelist -bc ${ASRC} > $@.tmp && \ - mv $@.tmp $@ - -help.h: ${ASRC} makelist - sh ./makelist -bh ${ASRC} > $@.tmp && \ - mv $@.tmp $@ - -fcns.h: ${AHDR} makelist - sh ./makelist -fh ${AHDR} > $@.tmp && \ - mv $@.tmp $@ - -fcns.c: ${AHDR} fcns.h makelist - sh ./makelist -fc ${AHDR} > $@.tmp && \ - mv $@.tmp $@ - -#%.o: vi.h emacs.h common.h help.h fcns.h -#objects := $(patsubst %.c,%.o,$(wildcard *.c)) -#$(objects): vi.h emacs.h - -chared.o: vi.h emacs.h common.h help.h fcns.h -el.o: vi.h emacs.h common.h help.h fcns.h -history.o: vi.h emacs.h common.h help.h fcns.h -map.o: vi.h emacs.h common.h help.h fcns.h -prompt.o: vi.h emacs.h common.h help.h fcns.h -readline.o: vi.h emacs.h common.h help.h fcns.h -search.o: vi.h emacs.h common.h help.h fcns.h -tokenizer.o: vi.h emacs.h common.h help.h fcns.h -vi.o: vi.h emacs.h common.h help.h fcns.h -common.o: vi.h emacs.h common.h help.h fcns.h -emacs.o: vi.h emacs.h common.h help.h fcns.h -hist.o: vi.h emacs.h common.h help.h fcns.h -key.o: vi.h emacs.h common.h help.h fcns.h -parse.o: vi.h emacs.h common.h help.h fcns.h -read.o: vi.h emacs.h common.h help.h fcns.h -refresh.o: vi.h emacs.h common.h help.h fcns.h -sig.o: vi.h emacs.h common.h help.h fcns.h -term.o: vi.h emacs.h common.h help.h fcns.h -tty.o: vi.h emacs.h common.h help.h fcns.h -help.o: vi.h emacs.h common.h help.h fcns.h -fcns.o: vi.h emacs.h common.h help.h fcns.h -filecomplete.o: vi.h emacs.h common.h help.h fcns.h diff --git a/cmd-line-utils/libedit/common.c b/cmd-line-utils/libedit/common.c index d4d024eae10..ba5890fa606 100644 --- a/cmd-line-utils/libedit/common.c +++ b/cmd-line-utils/libedit/common.c @@ -136,7 +136,7 @@ ed_delete_prev_word(EditLine *el, int c __attribute__((__unused__))) */ protected el_action_t /*ARGSUSED*/ -ed_delete_next_char(EditLine *el, int c) +ed_delete_next_char(EditLine *el, int c __attribute__((__unused__))) { #ifdef notdef /* XXX */ #define EL el->el_line @@ -431,7 +431,8 @@ ed_argument_digit(EditLine *el, int c) */ protected el_action_t /*ARGSUSED*/ -ed_unassigned(EditLine *el, int c __attribute__((__unused__))) +ed_unassigned(EditLine *el __attribute__((__unused__)), + int c __attribute__((__unused__))) { return (CC_ERROR); diff --git a/cmd-line-utils/libedit/readline.c b/cmd-line-utils/libedit/readline.c index 1f1b18c97d8..0318ab409b3 100644 --- a/cmd-line-utils/libedit/readline.c +++ b/cmd-line-utils/libedit/readline.c @@ -202,7 +202,7 @@ _move_history(int op) */ static int /*ARGSUSED*/ -_getc_function(EditLine *el, char *c) +_getc_function(EditLine *el __attribute__((__unused__)), char *c) { int i; @@ -1613,7 +1613,8 @@ rl_insert(int count, int c) /*ARGSUSED*/ int -rl_newline(int count, int c) +rl_newline(int count __attribute__((__unused__)), + int c __attribute__((__unused__))) { /* * Readline-4.0 appears to ignore the args. @@ -1623,7 +1624,7 @@ rl_newline(int count, int c) /*ARGSUSED*/ static unsigned char -rl_bind_wrapper(EditLine *el, unsigned char c) +rl_bind_wrapper(EditLine *el __attribute__((__unused__)), unsigned char c) { if (map[c] == NULL) return CC_ERROR; @@ -1718,7 +1719,7 @@ rl_get_previous_history(int count, int key) void /*ARGSUSED*/ -rl_prep_terminal(int meta_flag) +rl_prep_terminal(int meta_flag __attribute__((__unused__))) { el_set(e, EL_PREP_TERM, 1); } @@ -1922,7 +1923,8 @@ _rl_qsort_string_compare(char **s1, char **s2) int /*ARGSUSED*/ -rl_kill_text(int from, int to) +rl_kill_text(int from __attribute__((__unused__)), + int to __attribute__((__unused__))) { return 0; } @@ -1941,20 +1943,25 @@ rl_get_keymap(void) void /*ARGSUSED*/ -rl_set_keymap(Keymap k) +rl_set_keymap(Keymap k __attribute__((__unused__))) { } int /*ARGSUSED*/ -rl_generic_bind(int type, const char * keyseq, const char * data, Keymap k) +rl_generic_bind(int type __attribute__((__unused__)), + const char * keyseq __attribute__((__unused__)), + const char * data __attribute__((__unused__)), + Keymap k __attribute__((__unused__))) { return 0; } int /*ARGSUSED*/ -rl_bind_key_in_map(int key, Function *fun, Keymap k) +rl_bind_key_in_map(int key __attribute__((__unused__)), + Function *fun __attribute__((__unused__)), + Keymap k __attribute__((__unused__))) { return 0; } diff --git a/cmd-line-utils/libedit/vi.c b/cmd-line-utils/libedit/vi.c index 00a9f493a9b..d628f076a1d 100644 --- a/cmd-line-utils/libedit/vi.c +++ b/cmd-line-utils/libedit/vi.c @@ -145,7 +145,7 @@ vi_paste_prev(EditLine *el, int c __attribute__((__unused__))) */ protected el_action_t /*ARGSUSED*/ -vi_prev_big_word(EditLine *el, int c) +vi_prev_big_word(EditLine *el, int c __attribute__((__unused__))) { if (el->el_line.cursor == el->el_line.buffer) @@ -195,7 +195,7 @@ vi_prev_word(EditLine *el, int c __attribute__((__unused__))) */ protected el_action_t /*ARGSUSED*/ -vi_next_big_word(EditLine *el, int c) +vi_next_big_word(EditLine *el, int c __attribute__((__unused__))) { if (el->el_line.cursor >= el->el_line.lastchar - 1) @@ -462,7 +462,7 @@ vi_delete_meta(EditLine *el, int c __attribute__((__unused__))) */ protected el_action_t /*ARGSUSED*/ -vi_end_big_word(EditLine *el, int c) +vi_end_big_word(EditLine *el, int c __attribute__((__unused__))) { if (el->el_line.cursor == el->el_line.lastchar) @@ -797,7 +797,7 @@ vi_repeat_prev_char(EditLine *el, int c __attribute__((__unused__))) */ protected el_action_t /*ARGSUSED*/ -vi_match(EditLine *el, int c) +vi_match(EditLine *el, int c __attribute__((__unused__))) { const char match_chars[] = "()[]{}"; char *cp; @@ -844,7 +844,7 @@ vi_match(EditLine *el, int c) */ protected el_action_t /*ARGSUSED*/ -vi_undo_line(EditLine *el, int c) +vi_undo_line(EditLine *el, int c __attribute__((__unused__))) { cv_undo(el); @@ -858,7 +858,7 @@ vi_undo_line(EditLine *el, int c) */ protected el_action_t /*ARGSUSED*/ -vi_to_column(EditLine *el, int c) +vi_to_column(EditLine *el, int c __attribute__((__unused__))) { el->el_line.cursor = el->el_line.buffer; @@ -872,7 +872,7 @@ vi_to_column(EditLine *el, int c) */ protected el_action_t /*ARGSUSED*/ -vi_yank_end(EditLine *el, int c) +vi_yank_end(EditLine *el, int c __attribute__((__unused__))) { cv_yank(el, el->el_line.cursor, @@ -886,7 +886,7 @@ vi_yank_end(EditLine *el, int c) */ protected el_action_t /*ARGSUSED*/ -vi_yank(EditLine *el, int c) +vi_yank(EditLine *el, int c __attribute__((__unused__))) { return cv_action(el, YANK); @@ -898,7 +898,7 @@ vi_yank(EditLine *el, int c) */ protected el_action_t /*ARGSUSED*/ -vi_comment_out(EditLine *el, int c) +vi_comment_out(EditLine *el, int c __attribute__((__unused__))) { el->el_line.cursor = el->el_line.buffer; @@ -919,7 +919,8 @@ extern char *get_alias_text(const char *) __weak_reference(get_alias_text); #endif protected el_action_t /*ARGSUSED*/ -vi_alias(EditLine *el, int c) +vi_alias(EditLine *el __attribute__((__unused__)), + int c __attribute__((__unused__))) { #if defined(__weak_reference) && !defined(__FreeBSD__) char alias_name[3]; @@ -949,7 +950,7 @@ vi_alias(EditLine *el, int c) */ protected el_action_t /*ARGSUSED*/ -vi_to_history_line(EditLine *el, int c) +vi_to_history_line(EditLine *el, int c __attribute__((__unused__))) { int sv_event_no = el->el_history.eventno; el_action_t rval; @@ -994,7 +995,7 @@ vi_to_history_line(EditLine *el, int c) */ protected el_action_t /*ARGSUSED*/ -vi_histedit(EditLine *el, int c) +vi_histedit(EditLine *el, int c __attribute__((__unused__))) { int fd; pid_t pid; @@ -1050,7 +1051,7 @@ vi_histedit(EditLine *el, int c) */ protected el_action_t /*ARGSUSED*/ -vi_history_word(EditLine *el, int c) +vi_history_word(EditLine *el, int c __attribute__((__unused__))) { const char *wp = HIST_FIRST(el); const char *wep, *wsp; @@ -1099,7 +1100,7 @@ vi_history_word(EditLine *el, int c) */ protected el_action_t /*ARGSUSED*/ -vi_redo(EditLine *el, int c) +vi_redo(EditLine *el, int c __attribute__((__unused__))) { c_redo_t *r = &el->el_chared.c_redo; diff --git a/cmd-line-utils/readline/Makefile.am b/cmd-line-utils/readline/Makefile.am deleted file mode 100644 index 48d3af34412..00000000000 --- a/cmd-line-utils/readline/Makefile.am +++ /dev/null @@ -1,34 +0,0 @@ -## Process this file with automake to create Makefile.in -# Makefile for the GNU readline library. -# Copyright (C) 1994,1996,1997 Free Software Foundation, Inc. - -# Last -I$(top_srcdir) needed for RedHat! -INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \ - -I$(top_srcdir) - -noinst_LIBRARIES = libreadline.a - -libreadline_a_SOURCES = readline.c funmap.c keymaps.c \ - vi_mode.c parens.c rltty.c \ - complete.c bind.c isearch.c \ - display.c signals.c \ - util.c kill.c \ - undo.c macro.c input.c \ - callback.c terminal.c xmalloc.c \ - history.c histsearch.c histexpand.c \ - histfile.c nls.c search.c \ - shell.c tilde.c misc.c text.c mbutil.c \ - compat.c savestring.c - -noinst_HEADERS = readline.h chardefs.h keymaps.h \ - history.h tilde.h rlmbutil.h rltypedefs.h rlprivate.h \ - rlshell.h xmalloc.h \ -\ - config_readline.h rldefs.h histlib.h rlwinsize.h \ - posixstat.h posixdir.h posixjmp.h \ - tilde.h rlconf.h rltty.h ansi_stdlib.h \ - tcap.h rlstdc.h - -EXTRA_DIST= emacs_keymap.c vi_keymap.c CMakeLists.txt - -DEFS = -DMYSQL_CLIENT_NO_THREADS -DHAVE_CONFIG_H -DNO_KILL_INTR -D_GNU_SOURCE=1 diff --git a/cmd-line-utils/readline/bind.c b/cmd-line-utils/readline/bind.c index c669322f436..0ea8b1ca126 100644 --- a/cmd-line-utils/readline/bind.c +++ b/cmd-line-utils/readline/bind.c @@ -855,7 +855,7 @@ _rl_read_init_file (filename, include_level) { register int i; char *buffer, *openname, *line, *end; - size_t file_size; + size_t file_size = 0; current_readline_init_file = filename; current_readline_init_include_level = include_level; diff --git a/cmd-line-utils/readline/complete.c b/cmd-line-utils/readline/complete.c index 2745e4e4801..d11ea2493a6 100644 --- a/cmd-line-utils/readline/complete.c +++ b/cmd-line-utils/readline/complete.c @@ -1839,8 +1839,11 @@ rl_username_completion_function (text, state) #else /* !__WIN32__ && !__OPENNT) */ static char *username = (char *)NULL; static struct passwd *entry; - static int namelen, first_char, first_char_loc; + static int first_char, first_char_loc; char *value; +#if defined (HAVE_GETPWENT) + static int namelen; +#endif if (state == 0) { @@ -1850,7 +1853,9 @@ rl_username_completion_function (text, state) first_char_loc = first_char == '~'; username = savestring (&text[first_char_loc]); +#if defined (HAVE_GETPWENT) namelen = strlen (username); +#endif setpwent (); } diff --git a/cmd-line-utils/readline/histexpand.c b/cmd-line-utils/readline/histexpand.c index ab8d8ecc866..7b51c369827 100644 --- a/cmd-line-utils/readline/histexpand.c +++ b/cmd-line-utils/readline/histexpand.c @@ -693,7 +693,7 @@ history_expand_internal (string, start, end_index_ptr, ret_string, current_line) case 's': { char *new_event; - int delimiter, failed, si, l_temp, ws, we; + int delimiter, failed, si, l_temp, we; if (c == 's') { @@ -792,7 +792,6 @@ history_expand_internal (string, start, end_index_ptr, ret_string, current_line) { for (; temp[si] && whitespace (temp[si]); si++) ; - ws = si; we = history_tokenize_word (temp, si); } diff --git a/cmd-line-utils/readline/histfile.c b/cmd-line-utils/readline/histfile.c index cbd367542ce..1a6d69b6684 100644 --- a/cmd-line-utils/readline/histfile.c +++ b/cmd-line-utils/readline/histfile.c @@ -402,6 +402,7 @@ history_truncate_file (fname, lines) if (bp > buffer && ((file = open (filename, O_WRONLY|O_TRUNC|O_BINARY, 0600)) != -1)) { bytes_written= write (file, bp, chars_read - (bp - buffer)); + (void) bytes_written; #if defined (__BEOS__) /* BeOS ignores O_TRUNC. */ diff --git a/cmd-line-utils/readline/isearch.c b/cmd-line-utils/readline/isearch.c index 305c847d8da..977e08eb9ba 100644 --- a/cmd-line-utils/readline/isearch.c +++ b/cmd-line-utils/readline/isearch.c @@ -617,7 +617,7 @@ rl_search_history (direction, invoking_key) int direction, invoking_key __attribute__((unused)); { _rl_search_cxt *cxt; /* local for now, but saved globally */ - int c, r; + int r; RL_SETSTATE(RL_STATE_ISEARCH); cxt = _rl_isearch_init (direction); @@ -632,7 +632,7 @@ rl_search_history (direction, invoking_key) r = -1; for (;;) { - c = _rl_search_getchar (cxt); + _rl_search_getchar (cxt); /* We might want to handle EOF here (c == 0) */ r = _rl_isearch_dispatch (cxt, cxt->lastc); if (r <= 0) @@ -655,9 +655,9 @@ int _rl_isearch_callback (cxt) _rl_search_cxt *cxt; { - int c, r; + int r; - c = _rl_search_getchar (cxt); + _rl_search_getchar (cxt); /* We might want to handle EOF here */ r = _rl_isearch_dispatch (cxt, cxt->lastc); diff --git a/cmd-line-utils/readline/parens.c b/cmd-line-utils/readline/parens.c index fe1578ed3e2..58f22291172 100644 --- a/cmd-line-utils/readline/parens.c +++ b/cmd-line-utils/readline/parens.c @@ -115,7 +115,7 @@ rl_insert_close (count, invoking_key) else { #if defined (HAVE_SELECT) - int orig_point, match_point, ready; + int orig_point, match_point; struct timeval timer; fd_set readfds; @@ -136,7 +136,7 @@ rl_insert_close (count, invoking_key) orig_point = rl_point; rl_point = match_point; (*rl_redisplay_function) (); - ready = select (1, &readfds, (fd_set *)NULL, (fd_set *)NULL, &timer); + select (1, &readfds, (fd_set *)NULL, (fd_set *)NULL, &timer); rl_point = orig_point; #else /* !HAVE_SELECT */ _rl_insert_char (count, invoking_key); diff --git a/cmd-line-utils/readline/readline.c b/cmd-line-utils/readline/readline.c index fb92becdbf9..95947551823 100644 --- a/cmd-line-utils/readline/readline.c +++ b/cmd-line-utils/readline/readline.c @@ -447,11 +447,10 @@ readline_internal_char () readline_internal_charloop () #endif { - static int lastc, eof_found; + static int lastc; int c, code, lk; lastc = -1; - eof_found = 0; #if !defined (READLINE_CALLBACKS) while (rl_done == 0) diff --git a/cmd-line-utils/readline/terminal.c b/cmd-line-utils/readline/terminal.c index 3f92821f9dd..e2785908160 100644 --- a/cmd-line-utils/readline/terminal.c +++ b/cmd-line-utils/readline/terminal.c @@ -268,7 +268,7 @@ _rl_get_screen_size (tty, ignore_env) #if !defined (__DJGPP__) if (_rl_screenwidth <= 0 && term_string_buffer) - _rl_screenwidth = tgetnum ("co"); + _rl_screenwidth = tgetnum ((char *)"co"); #endif } @@ -284,7 +284,7 @@ _rl_get_screen_size (tty, ignore_env) #if !defined (__DJGPP__) if (_rl_screenheight <= 0 && term_string_buffer) - _rl_screenheight = tgetnum ("li"); + _rl_screenheight = tgetnum ((char *)"li"); #endif } @@ -516,7 +516,7 @@ _rl_init_terminal_io (terminal_name) if (!_rl_term_cr) _rl_term_cr = "\r"; - _rl_term_autowrap = tgetflag ("am") && tgetflag ("xn"); + _rl_term_autowrap = tgetflag ((char *)"am") && tgetflag ((char *)"xn"); /* Allow calling application to set default height and width, using rl_set_screen_size */ @@ -531,7 +531,7 @@ _rl_init_terminal_io (terminal_name) /* Check to see if this terminal has a meta key and clear the capability variables if there is none. */ - term_has_meta = (tgetflag ("km") || tgetflag ("MT")); + term_has_meta = (tgetflag ((char *)"km") || tgetflag ((char *)"MT")); if (!term_has_meta) _rl_term_mm = _rl_term_mo = (char *)NULL; diff --git a/cmd-line-utils/readline/text.c b/cmd-line-utils/readline/text.c index bb0f5d97160..02b28750c86 100644 --- a/cmd-line-utils/readline/text.c +++ b/cmd-line-utils/readline/text.c @@ -811,11 +811,10 @@ _rl_overwrite_char (count, c) int i; #if defined (HANDLE_MULTIBYTE) char mbkey[MB_LEN_MAX]; - int k; /* Read an entire multibyte character sequence to insert COUNT times. */ if (count > 0 && MB_CUR_MAX > 1 && rl_byte_oriented == 0) - k = _rl_read_mbstring (c, mbkey, MB_LEN_MAX); + _rl_read_mbstring (c, mbkey, MB_LEN_MAX); #endif rl_begin_undo_group (); diff --git a/config/ac-macros/alloca.m4 b/config/ac-macros/alloca.m4 deleted file mode 100644 index 8c730dd671f..00000000000 --- a/config/ac-macros/alloca.m4 +++ /dev/null @@ -1,68 +0,0 @@ -AC_DEFUN([MYSQL_FUNC_ALLOCA], -[ -# Since we have heard that alloca fails on IRIX never define it on a -# SGI machine -if test ! "$host_vendor" = "sgi" -then - AC_REQUIRE_CPP()dnl Set CPP; we run AC_EGREP_CPP conditionally. - # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works - # for constant arguments. Useless! - AC_CACHE_CHECK([for working alloca.h], ac_cv_header_alloca_h, - [AC_TRY_LINK([#include ], [char *p = alloca(2 * sizeof(int));], - ac_cv_header_alloca_h=yes, ac_cv_header_alloca_h=no)]) - if test "$ac_cv_header_alloca_h" = "yes" - then - AC_DEFINE(HAVE_ALLOCA, 1) - fi - - AC_CACHE_CHECK([for alloca], ac_cv_func_alloca_works, - [AC_TRY_LINK([ - #ifdef __GNUC__ - # define alloca __builtin_alloca - #else - # if HAVE_ALLOCA_H - # include - # else - # ifdef _AIX - #pragma alloca - # else - # ifndef alloca /* predefined by HP cc +Olibcalls */ - char *alloca (); - # endif - # endif - # endif - #endif - ], [char *p = (char *) alloca(1);], - ac_cv_func_alloca_works=yes, ac_cv_func_alloca_works=no)]) - if test "$ac_cv_func_alloca_works" = "yes"; then - AC_DEFINE([HAVE_ALLOCA], [1], [If we have a working alloca() implementation]) - fi - - if test "$ac_cv_func_alloca_works" = "no"; then - # The SVR3 libPW and SVR4 libucb both contain incompatible functions - # that cause trouble. Some versions do not even contain alloca or - # contain a buggy version. If you still want to use their alloca, - # use ar to extract alloca.o from them instead of compiling alloca.c. - ALLOCA=alloca.o - AC_DEFINE(C_ALLOCA, 1) - - AC_CACHE_CHECK(whether alloca needs Cray hooks, ac_cv_os_cray, - [AC_EGREP_CPP(webecray, - [#if defined(CRAY) && ! defined(CRAY2) - webecray - #else - wenotbecray - #endif - ], ac_cv_os_cray=yes, ac_cv_os_cray=no)]) - if test "$ac_cv_os_cray" = "yes"; then - for ac_func in _getb67 GETB67 getb67; do - AC_CHECK_FUNC($ac_func, [AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func) - break]) - done - fi - fi - AC_SUBST(ALLOCA)dnl -else - AC_MSG_RESULT("Skipped alloca tests") -fi -]) diff --git a/config/ac-macros/character_sets.m4 b/config/ac-macros/character_sets.m4 deleted file mode 100644 index c49e4f89316..00000000000 --- a/config/ac-macros/character_sets.m4 +++ /dev/null @@ -1,501 +0,0 @@ -dnl In order to add new charset, you must add charset name to -dnl this CHARSETS_AVAILABLE list and sql/share/charsets/Index.xml. -dnl If the character set uses strcoll or other special handling, -dnl you must also create strings/ctype-$charset_name.c - -AC_DIVERT_PUSH(0) - -define(CHARSETS_AVAILABLE0,binary) -define(CHARSETS_AVAILABLE1,armscii8 ascii big5 cp1250 cp1251 cp1256 cp1257) -define(CHARSETS_AVAILABLE2,cp850 cp852 cp866 cp932 dec8 eucjpms euckr gb2312 gbk geostd8) -define(CHARSETS_AVAILABLE3,greek hebrew hp8 keybcs2 koi8r koi8u) -define(CHARSETS_AVAILABLE4,latin1 latin2 latin5 latin7 macce macroman) -define(CHARSETS_AVAILABLE5,sjis swe7 tis620 ucs2 ujis utf8mb4 utf8 utf16 utf32) - -DEFAULT_CHARSET=latin1 -CHARSETS_AVAILABLE="CHARSETS_AVAILABLE0 CHARSETS_AVAILABLE1 CHARSETS_AVAILABLE2 CHARSETS_AVAILABLE3 CHARSETS_AVAILABLE4 CHARSETS_AVAILABLE5" -CHARSETS_COMPLEX="big5 cp1250 cp932 eucjpms euckr gb2312 gbk latin1 latin2 sjis tis620 ucs2 ujis utf8mb4 utf8 utf16 utf32" - -AC_DIVERT_POP - -AC_ARG_WITH(charset, - [ --with-charset=CHARSET - Default character set, use one of: - CHARSETS_AVAILABLE0 - CHARSETS_AVAILABLE1 - CHARSETS_AVAILABLE2 - CHARSETS_AVAILABLE3 - CHARSETS_AVAILABLE4 - CHARSETS_AVAILABLE5], - [default_charset="$withval"], - [default_charset="$DEFAULT_CHARSET"]) - -AC_ARG_WITH(collation, - [ --with-collation=COLLATION - Default collation], - [default_collation="$withval"], - [default_collation="default"]) - - -AC_ARG_WITH(extra-charsets, - [ --with-extra-charsets=CHARSET[,CHARSET,...] - Use charsets in addition to default (none, complex, - all, or a list selected from the above sets)], - [extra_charsets="$withval"], - [extra_charsets="none"]) - - -AC_MSG_CHECKING("character sets") - -CHARSETS="$default_charset latin1 utf8mb4 utf8" - -if test "$extra_charsets" = no; then - CHARSETS="$CHARSETS" -elif test "$extra_charsets" = none; then - CHARSETS="$CHARSETS" -elif test "$extra_charsets" = complex; then - CHARSETS="$CHARSETS $CHARSETS_COMPLEX" - AC_DEFINE([DEFINE_ALL_CHARACTER_SETS],1,[all charsets are available]) -elif test "$extra_charsets" = all; then - CHARSETS="$CHARSETS $CHARSETS_AVAILABLE" - AC_DEFINE([DEFINE_ALL_CHARACTER_SETS],1,[all charsets are available]) -else - EXTRA_CHARSETS=`echo $extra_charsets | sed -e 's/,/ /g'` - CHARSETS="$CHARSETS $EXTRA_CHARSETS" -fi - -for cs in $CHARSETS -do - case $cs in - armscii8) - AC_DEFINE(HAVE_CHARSET_armscii8, 1, - [Define to enable charset armscii8]) - ;; - ascii) - AC_DEFINE(HAVE_CHARSET_ascii, 1, - [Define to enable ascii character set]) - ;; - big5) - AC_DEFINE(HAVE_CHARSET_big5, 1, [Define to enable charset big5]) - AC_DEFINE([USE_MB], [1], [Use multi-byte character routines]) - AC_DEFINE(USE_MB_IDENT, [1], [ ]) - ;; - binary) - ;; - cp1250) - AC_DEFINE(HAVE_CHARSET_cp1250, 1, [Define to enable cp1250]) - ;; - cp1251) - AC_DEFINE(HAVE_CHARSET_cp1251, 1, [Define to enable charset cp1251]) - ;; - cp1256) - AC_DEFINE(HAVE_CHARSET_cp1256, 1, [Define to enable charset cp1256]) - ;; - cp1257) - AC_DEFINE(HAVE_CHARSET_cp1257, 1, [Define to enable charset cp1257]) - ;; - cp850) - AC_DEFINE(HAVE_CHARSET_cp850, 1, [Define to enable charset cp850]) - ;; - cp852) - AC_DEFINE(HAVE_CHARSET_cp852, 1, [Define to enable charset cp852]) - ;; - cp866) - AC_DEFINE(HAVE_CHARSET_cp866, 1, [Define to enable charset cp866]) - ;; - cp932) - AC_DEFINE(HAVE_CHARSET_cp932, 1, [Define to enable charset cp932]) - AC_DEFINE([USE_MB], 1, [Use multi-byte character routines]) - AC_DEFINE(USE_MB_IDENT, 1) - ;; - dec8) - AC_DEFINE(HAVE_CHARSET_dec8, 1, [Define to enable charset dec8]) - ;; - eucjpms) - AC_DEFINE(HAVE_CHARSET_eucjpms, 1, [Define to enable charset eucjpms]) - AC_DEFINE([USE_MB], [1], [Use multi-byte character routines]) - AC_DEFINE(USE_MB_IDENT, 1) - ;; - euckr) - AC_DEFINE(HAVE_CHARSET_euckr, 1, [Define to enable charset euckr]) - AC_DEFINE([USE_MB], [1], [Use multi-byte character routines]) - AC_DEFINE(USE_MB_IDENT, 1) - ;; - gb2312) - AC_DEFINE(HAVE_CHARSET_gb2312, 1, [Define to enable charset gb2312]) - AC_DEFINE([USE_MB], 1, [Use multi-byte character routines]) - AC_DEFINE(USE_MB_IDENT, 1) - ;; - gbk) - AC_DEFINE(HAVE_CHARSET_gbk, 1, [Define to enable charset gbk]) - AC_DEFINE([USE_MB], [1], [Use multi-byte character routines]) - AC_DEFINE(USE_MB_IDENT, 1) - ;; - geostd8) - AC_DEFINE(HAVE_CHARSET_geostd8, 1, [Define to enable charset geostd8]) - ;; - greek) - AC_DEFINE(HAVE_CHARSET_greek, 1, [Define to enable charset greek]) - ;; - hebrew) - AC_DEFINE(HAVE_CHARSET_hebrew, 1, [Define to enable charset hebrew]) - ;; - hp8) - AC_DEFINE(HAVE_CHARSET_hp8, 1, [Define to enable charset hp8]) - ;; - keybcs2) - AC_DEFINE(HAVE_CHARSET_keybcs2, 1, [Define to enable charset keybcs2]) - ;; - koi8r) - AC_DEFINE(HAVE_CHARSET_koi8r, 1, [Define to enable charset koi8r]) - ;; - koi8u) - AC_DEFINE(HAVE_CHARSET_koi8u, 1, [Define to enable charset koi8u]) - ;; - latin1) - AC_DEFINE(HAVE_CHARSET_latin1, 1, [Define to enable charset latin1]) - ;; - latin2) - AC_DEFINE(HAVE_CHARSET_latin2, 1, [Define to enable charset latin2]) - ;; - latin5) - AC_DEFINE(HAVE_CHARSET_latin5, 1, [Define to enable charset latin5]) - ;; - latin7) - AC_DEFINE(HAVE_CHARSET_latin7, 1, [Define to enable charset latin7]) - ;; - macce) - AC_DEFINE(HAVE_CHARSET_macce, 1, [Define to enable charset macce]) - ;; - macroman) - AC_DEFINE(HAVE_CHARSET_macroman, 1, - [Define to enable charset macroman]) - ;; - sjis) - AC_DEFINE(HAVE_CHARSET_sjis, 1, [Define to enable charset sjis]) - AC_DEFINE([USE_MB], 1, [Use multi-byte character routines]) - AC_DEFINE(USE_MB_IDENT, 1) - ;; - swe7) - AC_DEFINE(HAVE_CHARSET_swe7, 1, [Define to enable charset swe7]) - ;; - tis620) - AC_DEFINE(HAVE_CHARSET_tis620, 1, [Define to enable charset tis620]) - ;; - ucs2) - AC_DEFINE(HAVE_CHARSET_ucs2, 1, [Define to enable charset ucs2]) - AC_DEFINE([USE_MB], [1], [Use multi-byte character routines]) - AC_DEFINE(USE_MB_IDENT, 1) - ;; - ujis) - AC_DEFINE(HAVE_CHARSET_ujis, 1, [Define to enable charset ujis]) - AC_DEFINE([USE_MB], [1], [Use multi-byte character routines]) - AC_DEFINE(USE_MB_IDENT, 1) - ;; - utf8mb4) - AC_DEFINE(HAVE_CHARSET_utf8mb4, 1, [Define to enable utf8mb4]) - AC_DEFINE([USE_MB], 1, [Use multi-byte character routines]) - AC_DEFINE(USE_MB_IDENT, 1) - ;; - utf8) - AC_DEFINE(HAVE_CHARSET_utf8, 1, [Define to enable utf8]) - AC_DEFINE([USE_MB], 1, [Use multi-byte character routines]) - AC_DEFINE(USE_MB_IDENT, 1) - ;; - utf16) - AC_DEFINE(HAVE_CHARSET_utf16, 1, [Define to enable utf16]) - AC_DEFINE([USE_MB], 1, [Use multi-byte character routines]) - AC_DEFINE(USE_MB_IDENT, 1) - ;; - utf32) - AC_DEFINE(HAVE_CHARSET_utf32, 1, [Define to enable utf32]) - AC_DEFINE([USE_MB], 1, [Use multi-byte character routines]) - AC_DEFINE(USE_MB_IDENT, 1) - ;; - *) - AC_MSG_ERROR([Charset '$cs' not available. (Available are: $CHARSETS_AVAILABLE). - See the Installation chapter in the Reference Manual.]) - esac -done - - - default_charset_collations="" - -case $default_charset in - armscii8) - default_charset_default_collation="armscii8_general_ci" - default_charset_collations="armscii8_general_ci armscii8_bin" - ;; - ascii) - default_charset_default_collation="ascii_general_ci" - default_charset_collations="ascii_general_ci ascii_bin" - ;; - big5) - default_charset_default_collation="big5_chinese_ci" - default_charset_collations="big5_chinese_ci big5_bin" - ;; - binary) - default_charset_default_collation="binary" - default_charset_collations="binary" - ;; - cp1250) - default_charset_default_collation="cp1250_general_ci" - default_charset_collations="cp1250_general_ci cp1250_czech_cs cp1250_bin" - ;; - cp1251) - default_charset_default_collation="cp1251_general_ci" - default_charset_collations="cp1251_general_ci cp1251_general_cs cp1251_bin cp1251_bulgarian_ci cp1251_ukrainian_ci" - ;; - cp1256) - default_charset_default_collation="cp1256_general_ci" - default_charset_collations="cp1256_general_ci cp1256_bin" - ;; - cp1257) - default_charset_default_collation="cp1257_general_ci" - default_charset_collations="cp1257_general_ci cp1257_lithuanian_ci cp1257_bin" - ;; - cp850) - default_charset_default_collation="cp850_general_ci" - default_charset_collations="cp850_general_ci cp850_bin" - ;; - cp852) - default_charset_default_collation="cp852_general_ci" - default_charset_collations="cp852_general_ci cp852_bin" - ;; - cp866) - default_charset_default_collation="cp866_general_ci" - default_charset_collations="cp866_general_ci cp866_bin" - ;; - cp932) - default_charset_default_collation="cp932_japanese_ci" - default_charset_collations="cp932_japanese_ci cp932_bin" - ;; - dec8) - default_charset_default_collation="dec8_swedish_ci" - default_charset_collations="dec8_swedish_ci dec8_bin" - ;; - eucjpms) - default_charset_default_collation="eucjpms_japanese_ci" - default_charset_collations="eucjpms_japanese_ci ujis_bin" - ;; - euckr) - default_charset_default_collation="euckr_korean_ci" - default_charset_collations="euckr_korean_ci euckr_bin" - ;; - gb2312) - default_charset_default_collation="gb2312_chinese_ci" - default_charset_collations="gb2312_chinese_ci gb2312_bin" - ;; - gbk) - default_charset_default_collation="gbk_chinese_ci" - default_charset_collations="gbk_chinese_ci gbk_bin" - ;; - geostd8) - default_charset_default_collation="geostd8_general_ci" - default_charset_collations="geostd8_general_ci geostd8_bin" - ;; - greek) - default_charset_default_collation="greek_general_ci" - default_charset_collations="greek_general_ci greek_bin" - ;; - hebrew) - default_charset_default_collation="hebrew_general_ci" - default_charset_collations="hebrew_general_ci hebrew_bin" - ;; - hp8) - default_charset_default_collation="hp8_english_ci" - default_charset_collations="hp8_english_ci hp8_bin" - ;; - keybcs2) - default_charset_default_collation="keybcs2_general_ci" - default_charset_collations="keybcs2_general_ci keybcs2_bin" - ;; - koi8r) - default_charset_default_collation="koi8r_general_ci" - default_charset_collations="koi8r_general_ci koi8r_bin" - ;; - koi8u) - default_charset_default_collation="koi8u_general_ci" - default_charset_collations="koi8u_general_ci koi8u_bin" - ;; - latin1) - default_charset_default_collation="latin1_swedish_ci" - default_charset_collations="latin1_general_ci latin1_general_cs latin1_bin latin1_german1_ci latin1_german2_ci latin1_danish_ci latin1_spanish_ci latin1_swedish_ci" - ;; - latin2) - default_charset_default_collation="latin2_general_ci" - default_charset_collations="latin2_general_ci latin2_bin latin2_czech_cs latin2_hungarian_ci latin2_croatian_ci" - ;; - latin5) - default_charset_default_collation="latin5_turkish_ci" - default_charset_collations="latin5_turkish_ci latin5_bin" - ;; - latin7) - default_charset_default_collation="latin7_general_ci" - default_charset_collations="latin7_general_ci latin7_general_cs latin7_bin latin7_estonian_cs" - ;; - macce) - default_charset_default_collation="macce_general_ci" - default_charset_collations="macce_general_ci macce_bin" - ;; - macroman) - default_charset_default_collation="macroman_general_ci" - default_charset_collations="macroman_general_ci macroman_bin" - ;; - sjis) - default_charset_default_collation="sjis_japanese_ci" - default_charset_collations="sjis_japanese_ci sjis_bin" - ;; - swe7) - default_charset_default_collation="swe7_swedish_ci" - default_charset_collations="swe7_swedish_ci swe7_bin" - ;; - tis620) - default_charset_default_collation="tis620_thai_ci" - default_charset_collations="tis620_thai_ci tis620_bin" - ;; - ucs2) - default_charset_default_collation="ucs2_general_ci" - define(UCSC1, ucs2_general_ci ucs2_bin) - define(UCSC2, ucs2_czech_ci ucs2_danish_ci) - define(UCSC3, ucs2_esperanto_ci ucs2_estonian_ci ucs2_hungarian_ci) - define(UCSC4, ucs2_icelandic_ci ucs2_latvian_ci ucs2_lithuanian_ci) - define(UCSC5, ucs2_persian_ci ucs2_polish_ci ucs2_romanian_ci) - define(UCSC6, ucs2_slovak_ci ucs2_slovenian_ci) - define(UCSC7, ucs2_spanish2_ci ucs2_spanish_ci) - define(UCSC8, ucs2_swedish_ci ucs2_turkish_ci) - define(UCSC9, ucs2_unicode_ci) - UCSC="UCSC1 UCSC2 UCSC3 UCSC4 UCSC5 UCSC6 UCSC7 UCSC8 UCSC9" - default_charset_collations="$UCSC" - ;; - ujis) - default_charset_default_collation="ujis_japanese_ci" - default_charset_collations="ujis_japanese_ci ujis_bin" - ;; - utf8) - default_charset_default_collation="utf8_general_ci" - if test "$default_collation" = "utf8_general_cs"; then - # For those who explicitly desire "utf8_general_cs", support it, - # and then also set the CPP switch enabling that code. - UTFC="utf8_general_cs" - AC_DEFINE([HAVE_UTF8_GENERAL_CS], [1], [certain Japanese customer]) - else - define(UTFC1, utf8_general_ci utf8_bin) - define(UTFC2, utf8_czech_ci utf8_danish_ci) - define(UTFC3, utf8_esperanto_ci utf8_estonian_ci utf8_hungarian_ci) - define(UTFC4, utf8_icelandic_ci utf8_latvian_ci utf8_lithuanian_ci) - define(UTFC5, utf8_persian_ci utf8_polish_ci utf8_romanian_ci) - define(UTFC6, utf8_slovak_ci utf8_slovenian_ci) - define(UTFC7, utf8_spanish2_ci utf8_spanish_ci) - define(UTFC8, utf8_swedish_ci utf8_turkish_ci) - define(UTFC9, utf8_unicode_ci) - UTFC="UTFC1 UTFC2 UTFC3 UTFC4 UTFC5 UTFC6 UTFC7 UTFC8 UTFC9" - fi - default_charset_collations="$UTFC" - ;; - utf8mb4) - default_charset_default_collation="utf8mb4_general_ci" - define(UTFC1, utf8mb4_general_ci utf8mb4_bin) - define(UTFC2, utf8mb4_czech_ci utf8mb4_danish_ci) - define(UTFC3, utf8mb4_esperanto_ci utf8mb4_estonian_ci utf8mb4_hungarian_ci) - define(UTFC4, utf8mb4_icelandic_ci utf8mb4_latvian_ci utf8mb4_lithuanian_ci) - define(UTFC5, utf8mb4_persian_ci utf8mb4_polish_ci utf8mb4_romanian_ci) - define(UTFC6, utf8mb4_sinhala_ci utf8mb4_slovak_ci utf8mb4_slovenian_ci) - define(UTFC7, utf8mb4_spanish2_ci utf8mb4_spanish_ci) - define(UTFC8, utf8mb4_swedish_ci utf8mb4_turkish_ci) - define(UTFC9, utf8mb4_unicode_ci) - UTFC="UTFC1 UTFC2 UTFC3 UTFC4 UTFC5 UTFC6 UTFC7 UTFC8 UTFC9" - default_charset_collations="$UTFC" - ;; - utf16) - default_charset_default_collation="utf16_general_ci" - define(UTFC1, utf16_general_ci utf16_bin) - define(UTFC2, utf16_czech_ci utf16_danish_ci) - define(UTFC3, utf16_esperanto_ci utf16_estonian_ci utf16_hungarian_ci) - define(UTFC4, utf16_icelandic_ci utf16_latvian_ci utf16_lithuanian_ci) - define(UTFC5, utf16_persian_ci utf16_polish_ci utf16_romanian_ci) - define(UTFC6, utf16_sinhala_ci utf16_slovak_ci utf16_slovenian_ci) - define(UTFC7, utf16_spanish2_ci utf16_spanish_ci) - define(UTFC8, utf16_swedish_ci utf16_turkish_ci) - define(UTFC9, utf16_unicode_ci) - UTFC="UTFC1 UTFC2 UTFC3 UTFC4 UTFC5 UTFC6 UTFC7 UTFC8 UTFC9" - default_charset_collations="$UTFC" - ;; - utf32) - default_charset_default_collation="utf32_general_ci" - define(UTFC1, utf32_general_ci utf32_bin) - define(UTFC2, utf32_czech_ci utf32_danish_ci) - define(UTFC3, utf32_esperanto_ci utf32_estonian_ci utf32_hungarian_ci) - define(UTFC4, utf32_icelandic_ci utf32_latvian_ci utf32_lithuanian_ci) - define(UTFC5, utf32_persian_ci utf32_polish_ci utf32_romanian_ci) - define(UTFC6, utf32_sinhala_ci utf32_slovak_ci utf32_slovenian_ci) - define(UTFC7, utf32_spanish2_ci utf32_spanish_ci) - define(UTFC8, utf32_swedish_ci utf32_turkish_ci) - define(UTFC9, utf32_unicode_ci) - UTFC="UTFC1 UTFC2 UTFC3 UTFC4 UTFC5 UTFC6 UTFC7 UTFC8 UTFC9" - default_charset_collations="$UTFC" - ;; - *) - AC_MSG_ERROR([Charset $cs not available. (Available are: $CHARSETS_AVAILABLE). - See the Installation chapter in the Reference Manual.]) -esac - -if test "$default_collation" = default; then - default_collation=$default_charset_default_collation -fi - -valid_default_collation=no -for cl in $default_charset_collations -do - if test x"$cl" = x"$default_collation" - then - valid_default_collation=yes - break - fi -done - -if test x$valid_default_collation = xyes -then - AC_MSG_RESULT([default: $default_charset, collation: $default_collation; compiled in: $CHARSETS]) -else - AC_MSG_ERROR([ - Collation $default_collation is not valid for character set $default_charset. - Valid collations are: $default_charset_collations. - See the Installation chapter in the Reference Manual. - ]) -fi - -AC_DEFINE_UNQUOTED([MYSQL_DEFAULT_CHARSET_NAME], ["$default_charset"], - [Define the default charset name]) -AC_DEFINE_UNQUOTED([MYSQL_DEFAULT_COLLATION_NAME], ["$default_collation"], - [Define the default charset name]) - -# Shall we build the UCA-based Unicode collations -AC_ARG_WITH(uca, - [ --without-uca Skip building of the national Unicode collations.], - [with_uca=$withval], - [with_uca=yes] -) - -AC_MSG_CHECKING([whether to compile national Unicode collations]) - -if test "$with_uca" = "yes" -then - AC_MSG_RESULT(yes) - AC_DEFINE([HAVE_UCA_COLLATIONS], [1], [national Unicode collations]) -else - AC_MSG_RESULT(no) -fi - - -# Shall we build experimental collations -AC_ARG_WITH(experimental-collations, - [], - [with_exp_coll=$withval], - [with_exp_coll=no] -) - -if test "$with_exp_coll" = "yes" -then - AC_DEFINE([HAVE_UTF8_GENERAL_CS], [1], [certain Japanese customer]) -fi diff --git a/config/ac-macros/check_cpu.m4 b/config/ac-macros/check_cpu.m4 deleted file mode 100644 index d551f47769e..00000000000 --- a/config/ac-macros/check_cpu.m4 +++ /dev/null @@ -1,47 +0,0 @@ -AC_DEFUN([MYSQL_CHECK_CPU], -[AC_CACHE_CHECK([if compiler supports optimizations for current cpu], -mysql_cv_cpu,[ - -ac_save_CFLAGS="$CFLAGS" -if test -r /proc/cpuinfo ; then - cpuinfo="cat /proc/cpuinfo" - cpu_family=`$cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1` - cpu_vendor=`$cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1` -fi -if test "$cpu_vendor" = "AuthenticAMD"; then - if test $cpu_family -ge 6; then - cpu_set="athlon pentiumpro k5 pentium i486 i386"; - elif test $cpu_family -eq 5; then - cpu_set="k5 pentium i486 i386"; - elif test $cpu_family -eq 4; then - cpu_set="i486 i386" - else - cpu_set="i386" - fi -elif test "$cpu_vendor" = "GenuineIntel"; then - if test $cpu_family -ge 6; then - cpu_set="pentiumpro pentium i486 i386"; - elif test $cpu_family -eq 5; then - cpu_set="pentium i486 i386"; - elif test $cpu_family -eq 4; then - cpu_set="i486 i386" - else - cpu_set="i386" - fi -fi - -for ac_arg in $cpu_set; -do - CFLAGS="$ac_save_CFLAGS -mcpu=$ac_arg -march=$ac_arg -DCPU=$ac_arg" - AC_TRY_COMPILE([],[int i],mysql_cv_cpu=$ac_arg; break;, mysql_cv_cpu="unknown") -done - -if test "$mysql_cv_cpu" = "unknown" -then - CFLAGS="$ac_save_CFLAGS" - AC_MSG_RESULT(none) -else - AC_MSG_RESULT($mysql_cv_cpu) -fi -])]) - diff --git a/config/ac-macros/compiler_flag.m4 b/config/ac-macros/compiler_flag.m4 deleted file mode 100644 index ce2ce6cbdfa..00000000000 --- a/config/ac-macros/compiler_flag.m4 +++ /dev/null @@ -1,62 +0,0 @@ -# option, cache_name, variable, -# code to execute if yes, code to exectute if fail -AC_DEFUN([AC_SYS_COMPILER_FLAG], -[ - AC_MSG_CHECKING($1) - OLD_CFLAGS="[$]CFLAGS" - AC_CACHE_VAL(mysql_cv_option_$2, - [ - CFLAGS="[$]OLD_CFLAGS $1" - AC_TRY_LINK([int main(){exit(0);}],mysql_cv_option_$2=yes,mysql_cv_option_$2=no,mysql_cv_option_$2=no) - ]) - - CFLAGS="[$]OLD_CFLAGS" - - if test x"[$]mysql_cv_option_$2" = "xyes" ; then - $3="[$]$3 $1" - AC_MSG_RESULT(yes) - $5 - else - AC_MSG_RESULT(no) - $4 - fi -]) - -# arch, option, cache_name, variable -AC_DEFUN([AC_SYS_CPU_COMPILER_FLAG], -[ - if test "`uname -m 2>/dev/null`" = "$1" ; then - AC_SYS_COMPILER_FLAG($2,$3,$4) - fi -]) - -# os, option, cache_name, variable -AC_DEFUN([AC_SYS_OS_COMPILER_FLAG], -[ - if test "x$mysql_cv_sys_os" = "x$1" ; then - AC_SYS_COMPILER_FLAG($2,$3,$4) - fi -]) - -AC_DEFUN([AC_CHECK_NOEXECSTACK], -[ - AC_CACHE_CHECK(whether --noexecstack is desirable for .S files, - mysql_cv_as_noexecstack, [dnl - cat > conftest.c <&AS_MESSAGE_LOG_FD]) \ - && grep .note.GNU-stack conftest.s >/dev/null \ - && AC_TRY_COMMAND([${CC-cc} $CCASFLAGS $CPPFLAGS -Wa,--noexecstack - -c -o conftest.o conftest.s 1>&AS_MESSAGE_LOG_FD]) - then - mysql_cv_as_noexecstack=yes - else - mysql_cv_as_noexecstack=no - fi - rm -f conftest*]) - if test $mysql_cv_as_noexecstack = yes; then - CCASFLAGS="$CCASFLAGS -Wa,--noexecstack" - fi -]) diff --git a/config/ac-macros/dtrace.m4 b/config/ac-macros/dtrace.m4 deleted file mode 100644 index a42d78d97fe..00000000000 --- a/config/ac-macros/dtrace.m4 +++ /dev/null @@ -1,38 +0,0 @@ -dnl --------------------------------------------------------------------------- -dnl Macro: DTRACE_TEST -dnl --------------------------------------------------------------------------- -AC_ARG_ENABLE(dtrace, - AC_HELP_STRING([--enable-dtrace],[Build with support for the DTRACE.]), - [ - ENABLE_DTRACE="$enable_dtrace" - ], - [ - ENABLE_DTRACE="yes" - ] -) -DTRACEFLAGS="" -HAVE_DTRACE="" -HAVE_DTRACE_DASH_G="" -if test "$ENABLE_DTRACE" = "yes"; then - AC_PATH_PROGS(DTRACE, dtrace, [not found], [$PATH:/usr/sbin]) - if test "$DTRACE" = "not found"; then - ENABLE_DTRACE="no" - else - AC_DEFINE([HAVE_DTRACE], [1], [Defined to 1 if DTrace support is enabled]) - case "$target_os" in - *solaris*) - HAVE_DTRACE_DASH_G="yes" - ;; - *) - HAVE_DTRACE_DASH_G="no" - ;; - esac - fi -fi -AC_SUBST(DTRACEFLAGS) -AC_SUBST(HAVE_DTRACE) -AM_CONDITIONAL([HAVE_DTRACE], [ test "$ENABLE_DTRACE" = "yes" ]) -AM_CONDITIONAL([HAVE_DTRACE_DASH_G], [ test "$HAVE_DTRACE_DASH_G" = "yes" ]) -dnl --------------------------------------------------------------------------- -dnl End Macro: DTRACE_TEST -dnl --------------------------------------------------------------------------- diff --git a/config/ac-macros/large_file.m4 b/config/ac-macros/large_file.m4 deleted file mode 100644 index 279ce6d60f1..00000000000 --- a/config/ac-macros/large_file.m4 +++ /dev/null @@ -1,142 +0,0 @@ - -dnl By default, many hosts won't let programs access large files; -dnl one must use special compiler options to get large-file access to work. -dnl For more details about this brain damage please see: -dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html - -dnl Written by Paul Eggert . - -dnl Internal subroutine of AC_SYS_LARGEFILE. -dnl AC_SYS_LARGEFILE_FLAGS(FLAGSNAME) -AC_DEFUN([AC_SYS_LARGEFILE_FLAGS], - [AC_CACHE_CHECK([for $1 value to request large file support], - ac_cv_sys_largefile_$1, - [if ($GETCONF LFS_$1) >conftest.1 2>conftest.2 && test ! -s conftest.2 - then - ac_cv_sys_largefile_$1=`cat conftest.1` - else - ac_cv_sys_largefile_$1=no - ifelse($1, CFLAGS, - [case "$host_os" in - # HP-UX 10.20 requires -D__STDC_EXT__ with gcc 2.95.1. -changequote(, )dnl - hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*) -changequote([, ])dnl - if test "$GCC" = yes; then - case `$CC --version 2>/dev/null` in - 2.95.*) ac_cv_sys_largefile_CFLAGS=-D__STDC_EXT__ ;; - esac - fi - ;; - # IRIX 6.2 and later require cc -n32. -changequote(, )dnl - irix6.[2-9]* | irix6.1[0-9]* | irix[7-9].* | irix[1-9][0-9]*) -changequote([, ])dnl - if test "$GCC" != yes; then - ac_cv_sys_largefile_CFLAGS=-n32 - fi - esac - if test "$ac_cv_sys_largefile_CFLAGS" != no; then - ac_save_CC="$CC" - CC="$CC $ac_cv_sys_largefile_CFLAGS" - AC_TRY_LINK(, , , ac_cv_sys_largefile_CFLAGS=no) - CC="$ac_save_CC" - fi]) - fi - rm -f conftest*])]) - -dnl Internal subroutine of AC_SYS_LARGEFILE. -dnl AC_SYS_LARGEFILE_SPACE_APPEND(VAR, VAL) -AC_DEFUN([AC_SYS_LARGEFILE_SPACE_APPEND], - [case $2 in - no) ;; - ?*) - case "[$]$1" in - '') $1=$2 ;; - *) $1=[$]$1' '$2 ;; - esac ;; - esac]) - -dnl Internal subroutine of AC_SYS_LARGEFILE. -dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, CACHE-VAR, COMMENT, CODE-TO-SET-DEFAULT) -AC_DEFUN([AC_SYS_LARGEFILE_MACRO_VALUE], - [AC_CACHE_CHECK([for $1], $2, - [$2=no -changequote(, )dnl - for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do - case "$ac_flag" in - -D$1) - $2=1 ;; - -D$1=*) - $2=`expr " $ac_flag" : '[^=]*=\(.*\)'` ;; - esac - done - $4 -changequote([, ])dnl - ]) - if test "[$]$2" != no; then - AC_DEFINE_UNQUOTED([$1], [$]$2, [$3]) - fi]) - -AC_DEFUN([MYSQL_SYS_LARGEFILE], - [AC_REQUIRE([AC_CANONICAL_HOST]) - AC_ARG_ENABLE(largefile, - [ --disable-largefile Omit support for large files]) - if test "$enable_largefile" != no; then - AC_CHECK_TOOL(GETCONF, getconf) - AC_SYS_LARGEFILE_FLAGS(CFLAGS) - AC_SYS_LARGEFILE_FLAGS(LDFLAGS) - AC_SYS_LARGEFILE_FLAGS(LIBS) - - for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do - case "$ac_flag" in - no) ;; - -D_FILE_OFFSET_BITS=*) ;; - -D_LARGEFILE_SOURCE | -D_LARGEFILE_SOURCE=*) ;; - -D_LARGE_FILES | -D_LARGE_FILES=*) ;; - -D?* | -I?*) - AC_SYS_LARGEFILE_SPACE_APPEND(CPPFLAGS, "$ac_flag") ;; - *) - AC_SYS_LARGEFILE_SPACE_APPEND(CFLAGS, "$ac_flag") ;; - esac - done - AC_SYS_LARGEFILE_SPACE_APPEND(LDFLAGS, "$ac_cv_sys_largefile_LDFLAGS") - AC_SYS_LARGEFILE_SPACE_APPEND(LIBS, "$ac_cv_sys_largefile_LIBS") - - AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, - ac_cv_sys_file_offset_bits, - [Number of bits in a file offset, on hosts where this is settable.], - [case "$host_os" in - # HP-UX 10.20 and later - hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*) - ac_cv_sys_file_offset_bits=64 ;; - # We can't declare _FILE_OFFSET_BITS here as this will cause - # compile errors as AC_PROG_CC adds include files in confdefs.h - # We solve this (until autoconf is fixed) by instead declaring it - # as define instead - solaris2.[8,9]) - CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64" - CXXFLAGS="$CXXFLAGS -D_FILE_OFFSET_BITS=64" - ac_cv_sys_file_offset_bits=no ;; - esac]) - AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, - ac_cv_sys_largefile_source, - [makes fseeko etc. visible, on some hosts.], - [case "$host_os" in - # HP-UX 10.20 and later - hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*) - ac_cv_sys_largefile_source=1 ;; - esac]) - - AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, - ac_cv_sys_large_files, - [Large files support on AIX-style hosts.], - [case "$host_os" in - # Large file support on AIX is available starting from version 4.2 - # Tested only on 5.2 and up - aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*) - ac_cv_sys_large_files=1 ;; - esac]) - fi - ]) - diff --git a/config/ac-macros/maintainer.m4 b/config/ac-macros/maintainer.m4 deleted file mode 100644 index 24be31395f2..00000000000 --- a/config/ac-macros/maintainer.m4 +++ /dev/null @@ -1,64 +0,0 @@ -# -# Control aspects of the development environment which are -# specific to MySQL maintainers and developers. -# -AC_DEFUN([MY_MAINTAINER_MODE], [ - AC_MSG_CHECKING([whether to enable the maintainer-specific development environment]) - AC_ARG_ENABLE([mysql-maintainer-mode], - [AS_HELP_STRING([--enable-mysql-maintainer-mode], - [Enable a MySQL maintainer-specific development environment])], - [USE_MYSQL_MAINTAINER_MODE=$enableval], - [USE_MYSQL_MAINTAINER_MODE=no]) - AC_MSG_RESULT([$USE_MYSQL_MAINTAINER_MODE]) -]) - -# Set warning options required under maintainer mode. -AC_DEFUN([MY_MAINTAINER_MODE_WARNINGS], [ - # Setup GCC warning options. - AS_IF([test "$GCC" = "yes"], [ - C_WARNINGS="-Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing -Werror" - CXX_WARNINGS="${C_WARNINGS} -Wno-unused-parameter" - ]) - - # Test whether the warning options work. - # Test C options - AS_IF([test -n "$C_WARNINGS"], [ - save_CFLAGS="$CFLAGS" - AC_MSG_CHECKING([whether to use C warning options ${C_WARNINGS}]) - AC_LANG_PUSH(C) - CFLAGS="$CFLAGS ${C_WARNINGS}" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [myac_c_warning_flags=yes], - [myac_c_warning_flags=no]) - AC_LANG_POP() - AC_MSG_RESULT([$myac_c_warning_flags]) - CFLAGS="$save_CFLAGS" - ]) - - # Test C++ options - AS_IF([test -n "$CXX_WARNINGS"], [ - save_CXXFLAGS="$CXXFLAGS" - AC_MSG_CHECKING([whether to use C++ warning options ${CXX_WARNINGS}]) - AC_LANG_PUSH(C++) - CXXFLAGS="$CXXFLAGS ${CXX_WARNINGS}" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [myac_cxx_warning_flags=yes], - [myac_cxx_warning_flags=no]) - AC_LANG_POP() - AC_MSG_RESULT([$myac_cxx_warning_flags]) - CXXFLAGS="$save_CXXFLAGS" - ]) - - # Set compile flag variables. - AS_IF([test "$myac_c_warning_flags" = "yes"], [ - AM_CFLAGS="${AM_CFLAGS} ${C_WARNINGS}" - AC_SUBST([AM_CFLAGS])]) - AS_IF([test "$myac_cxx_warning_flags" = "yes"], [ - AM_CXXFLAGS="${AM_CXXFLAGS} ${CXX_WARNINGS}" - AC_SUBST([AM_CXXFLAGS])]) -]) - - -# Set compiler flags required under maintainer mode. -AC_DEFUN([MY_MAINTAINER_MODE_SETUP], [ - AS_IF([test "$USE_MYSQL_MAINTAINER_MODE" = "yes"], - [MY_MAINTAINER_MODE_WARNINGS]) -]) diff --git a/config/ac-macros/misc.m4 b/config/ac-macros/misc.m4 deleted file mode 100644 index 89de1e5f8fa..00000000000 --- a/config/ac-macros/misc.m4 +++ /dev/null @@ -1,688 +0,0 @@ -# Local macros for automake & autoconf - -#---START: Used in for client configure -AC_DEFUN([MYSQL_TYPE_ACCEPT], -[ac_save_CXXFLAGS="$CXXFLAGS" -AC_CACHE_CHECK([base type of last arg to accept], mysql_cv_btype_last_arg_accept, -AC_LANG_PUSH(C++) -if test "$ac_cv_prog_gxx" = "yes" -then - # Add -Werror, remove -fbranch-probabilities (Bug #268) - CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-Wcheck//'` -fi -mysql_cv_btype_last_arg_accept=none -[AC_TRY_COMPILE([#if defined(inline) -#undef inline -#endif -#include -#include -#include -], -[int a = accept(1, (struct sockaddr *) 0, (socklen_t *) 0); return (a != 0);], -mysql_cv_btype_last_arg_accept=socklen_t)] -if test "$mysql_cv_btype_last_arg_accept" = "none"; then -[AC_TRY_COMPILE([#if defined(inline) -#undef inline -#endif -#include -#include -#include -], -[int a = accept(1, (struct sockaddr *) 0, (size_t *) 0); return (a != 0);], -mysql_cv_btype_last_arg_accept=size_t)] -fi -if test "$mysql_cv_btype_last_arg_accept" = "none"; then -mysql_cv_btype_last_arg_accept=int -fi) -AC_LANG_POP(C++) -AC_DEFINE_UNQUOTED([SOCKET_SIZE_TYPE], [$mysql_cv_btype_last_arg_accept], - [The base type of the last arg to accept]) -CXXFLAGS="$ac_save_CXXFLAGS" -]) -#---END: - -dnl Find type of qsort -AC_DEFUN([MYSQL_TYPE_QSORT], -[AC_CACHE_CHECK([return type of qsort], mysql_cv_type_qsort, -[AC_TRY_COMPILE([#include -#ifdef __cplusplus -extern "C" -#endif -void qsort(void *base, size_t nel, size_t width, - int (*compar) (const void *, const void *)); -], -[int i;], mysql_cv_type_qsort=void, mysql_cv_type_qsort=int)]) -AC_DEFINE_UNQUOTED([RETQSORTTYPE], [$mysql_cv_type_qsort], - [The return type of qsort (int or void).]) -if test "$mysql_cv_type_qsort" = "void" -then - AC_DEFINE_UNQUOTED([QSORT_TYPE_IS_VOID], [1], [qsort returns void]) -fi -]) - -#---START: Figure out whether to use 'struct rlimit' or 'struct rlimit64' -AC_DEFUN([MYSQL_TYPE_STRUCT_RLIMIT], -[ac_save_CXXFLAGS="$CXXFLAGS" -AC_CACHE_CHECK([struct type to use with setrlimit], mysql_cv_btype_struct_rlimit, -AC_LANG_PUSH(C++) -if test "$ac_cv_prog_gxx" = "yes" -then - # Add -Werror, remove -fbranch-probabilities (Bug #268) - CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-Wcheck//'` -fi -mysql_cv_btype_struct_rlimit=none -[AC_TRY_COMPILE([#if defined(inline) -#undef inline -#endif -#include -#include -], -[struct rlimit64 rl; setrlimit(RLIMIT_CORE, &rl);], -mysql_cv_btype_struct_rlimit="struct rlimit64")] -if test "$mysql_cv_btype_struct_rlimit" = "none"; then -mysql_cv_btype_struct_rlimit="struct rlimit" -fi) -AC_LANG_POP(C++) -AC_DEFINE_UNQUOTED([STRUCT_RLIMIT], [$mysql_cv_btype_struct_rlimit], - [The struct rlimit type to use with setrlimit]) -CXXFLAGS="$ac_save_CXXFLAGS" -]) -#---END: - -AC_DEFUN([MYSQL_TIMESPEC_TS], -[AC_CACHE_CHECK([if struct timespec has a ts_sec member], mysql_cv_timespec_ts, -[AC_TRY_COMPILE([#include -#ifdef __cplusplus -extern "C" -#endif -], -[struct timespec abstime; - -abstime.ts_sec = time(NULL)+1; -abstime.ts_nsec = 0; -], mysql_cv_timespec_ts=yes, mysql_cv_timespec_ts=no)]) -if test "$mysql_cv_timespec_ts" = "yes" -then - AC_DEFINE([HAVE_TIMESPEC_TS_SEC], [1], - [Timespec has a ts_sec instead of tv_sev]) -fi -]) - -AC_DEFUN([MYSQL_TZNAME], -[AC_CACHE_CHECK([if we have tzname variable], mysql_cv_tzname, -[AC_TRY_COMPILE([#include -#ifdef __cplusplus -extern "C" -#endif -], -[ tzset(); - return tzname[0] != 0; -], mysql_cv_tzname=yes, mysql_cv_tzname=no)]) -if test "$mysql_cv_tzname" = "yes" -then - AC_DEFINE([HAVE_TZNAME], [1], [Have the tzname variable]) -fi -]) - - -AC_DEFUN([MYSQL_PTHREAD_YIELD], -[AC_CACHE_CHECK([if pthread_yield takes zero arguments], ac_cv_pthread_yield_zero_arg, -[AC_TRY_LINK([#define _GNU_SOURCE -#include -#ifdef __cplusplus -extern "C" -#endif -], -[ - pthread_yield(); -], ac_cv_pthread_yield_zero_arg=yes, ac_cv_pthread_yield_zero_arg=yeso)]) -if test "$ac_cv_pthread_yield_zero_arg" = "yes" -then - AC_DEFINE([HAVE_PTHREAD_YIELD_ZERO_ARG], [1], - [pthread_yield that doesn't take any arguments]) -fi -] -[AC_CACHE_CHECK([if pthread_yield takes 1 argument], ac_cv_pthread_yield_one_arg, -[AC_TRY_LINK([#define _GNU_SOURCE -#include -#ifdef __cplusplus -extern "C" -#endif -], -[ - pthread_yield(0); -], ac_cv_pthread_yield_one_arg=yes, ac_cv_pthread_yield_one_arg=no)]) -if test "$ac_cv_pthread_yield_one_arg" = "yes" -then - AC_DEFINE([HAVE_PTHREAD_YIELD_ONE_ARG], [1], - [pthread_yield function with one argument]) -fi -] -) - - - -#---END: - -# From fileutils-3.14/aclocal.m4 - -# @defmac AC_PROG_CC_STDC -# @maindex PROG_CC_STDC -# @ovindex CC -# If the C compiler in not in ANSI C mode by default, try to add an option -# to output variable @code{CC} to make it so. This macro tries various -# options that select ANSI C on some system or another. It considers the -# compiler to be in ANSI C mode if it defines @code{__STDC__} to 1 and -# handles function prototypes correctly. -# -# Patched by monty to only check if __STDC__ is defined. With the original -# check it's impossible to get things to work with the Sunpro compiler from -# Workshop 4.2 -# -# If you use this macro, you should check after calling it whether the C -# compiler has been set to accept ANSI C; if not, the shell variable -# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source -# code in ANSI C, you can make an un-ANSIfied copy of it by using the -# program @code{ansi2knr}, which comes with Ghostscript. -# @end defmac - -AC_DEFUN([AM_PROG_CC_STDC], -[AC_REQUIRE([AC_PROG_CC]) -AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C) -AC_CACHE_VAL(am_cv_prog_cc_stdc, -[am_cv_prog_cc_stdc=no -ac_save_CC="$CC" -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -# removed "-Xc -D__EXTENSIONS__" beacause sun c++ does not like it. -for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" -do - CC="$ac_save_CC $ac_arg" - AC_TRY_COMPILE( -[#if !defined(__STDC__) -choke me -#endif -/* DYNIX/ptx V4.1.3 can't compile sys/stat.h with -Xc -D__EXTENSIONS__. */ -#ifdef _SEQUENT_ -# include -# include -#endif -], [ -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);};], -[am_cv_prog_cc_stdc="$ac_arg"; break]) -done -CC="$ac_save_CC" -]) -AC_MSG_RESULT($am_cv_prog_cc_stdc) -case "x$am_cv_prog_cc_stdc" in - x|xno) ;; - *) CC="$CC $am_cv_prog_cc_stdc" ;; -esac -]) - -# Orginal from bash-2.0 aclocal.m4, Changed to use termcap last by monty. - -AC_DEFUN([MYSQL_CHECK_LIB_TERMCAP], -[ -AC_CACHE_VAL(mysql_cv_termcap_lib, - [AC_CHECK_LIB(ncursesw, tgetent, mysql_cv_termcap_lib=libncursesw, - [AC_CHECK_LIB(ncurses, tgetent, mysql_cv_termcap_lib=libncurses, - [AC_CHECK_LIB(curses, tgetent, mysql_cv_termcap_lib=libcurses, - [AC_CHECK_LIB(termcap, tgetent, mysql_cv_termcap_lib=libtermcap, - [AC_CHECK_LIB(tinfo, tgetent, mysql_cv_termcap_lib=libtinfo, - mysql_cv_termcap_lib=NOT_FOUND)])])])])]) -AC_MSG_CHECKING(for termcap functions library) -if test "$mysql_cv_termcap_lib" = "NOT_FOUND"; then -AC_MSG_ERROR([No curses/termcap library found]) -elif test "$mysql_cv_termcap_lib" = "libtermcap"; then -TERMCAP_LIB=-ltermcap -elif test "$mysql_cv_termcap_lib" = "libncursesw"; then -TERMCAP_LIB=-lncursesw -elif test "$mysql_cv_termcap_lib" = "libncurses"; then -TERMCAP_LIB=-lncurses -elif test "$mysql_cv_termcap_lib" = "libtinfo"; then -TERMCAP_LIB=-ltinfo -else -TERMCAP_LIB=-lcurses -fi -AC_MSG_RESULT($TERMCAP_LIB) -]) - -dnl Check type of signal routines (posix, 4.2bsd, 4.1bsd or v7) -AC_DEFUN([MYSQL_SIGNAL_CHECK], -[AC_REQUIRE([AC_TYPE_SIGNAL]) -AC_MSG_CHECKING(for type of signal functions) -AC_CACHE_VAL(mysql_cv_signal_vintage, -[ - AC_TRY_LINK([#include ],[ - sigset_t ss; - struct sigaction sa; - sigemptyset(&ss); sigsuspend(&ss); - sigaction(SIGINT, &sa, (struct sigaction *) 0); - sigprocmask(SIG_BLOCK, &ss, (sigset_t *) 0); - ], mysql_cv_signal_vintage=posix, - [ - AC_TRY_LINK([#include ], [ - int mask = sigmask(SIGINT); - sigsetmask(mask); sigblock(mask); sigpause(mask); - ], mysql_cv_signal_vintage=4.2bsd, - [ - AC_TRY_LINK([ - #include - RETSIGTYPE foo() { }], [ - int mask = sigmask(SIGINT); - sigset(SIGINT, foo); sigrelse(SIGINT); - sighold(SIGINT); sigpause(SIGINT); - ], mysql_cv_signal_vintage=svr3, mysql_cv_signal_vintage=v7 - )] - )] -) -]) -AC_MSG_RESULT($mysql_cv_signal_vintage) -if test "$mysql_cv_signal_vintage" = posix; then -AC_DEFINE(HAVE_POSIX_SIGNALS, [1], - [Signal handling is POSIX (sigset/sighold, etc)]) -elif test "$mysql_cv_signal_vintage" = "4.2bsd"; then -AC_DEFINE([HAVE_BSD_SIGNALS], [1], [BSD style signals]) -elif test "$mysql_cv_signal_vintage" = svr3; then -AC_DEFINE(HAVE_USG_SIGHOLD, [1], [sighold() is present and usable]) -fi -]) - -AC_DEFUN([MYSQL_CHECK_GETPW_FUNCS], -[AC_MSG_CHECKING(whether programs are able to redeclare getpw functions) -AC_CACHE_VAL(mysql_cv_can_redecl_getpw, -[AC_TRY_COMPILE([#include -#include -extern struct passwd *getpwent();], [struct passwd *z; z = getpwent();], - mysql_cv_can_redecl_getpw=yes,mysql_cv_can_redecl_getpw=no)]) -AC_MSG_RESULT($mysql_cv_can_redecl_getpw) -if test "$mysql_cv_can_redecl_getpw" = "no"; then -AC_DEFINE(HAVE_GETPW_DECLS, [1], [getpwent() declaration present]) -fi -]) - -AC_DEFUN([MYSQL_HAVE_TIOCGWINSZ], -[AC_MSG_CHECKING(for TIOCGWINSZ in sys/ioctl.h) -AC_CACHE_VAL(mysql_cv_tiocgwinsz_in_ioctl, -[AC_TRY_COMPILE([#include -#include ], [int x = TIOCGWINSZ;], - mysql_cv_tiocgwinsz_in_ioctl=yes,mysql_cv_tiocgwinsz_in_ioctl=no)]) -AC_MSG_RESULT($mysql_cv_tiocgwinsz_in_ioctl) -if test "$mysql_cv_tiocgwinsz_in_ioctl" = "yes"; then -AC_DEFINE([GWINSZ_IN_SYS_IOCTL], [1], - [READLINE: your system defines TIOCGWINSZ in sys/ioctl.h.]) -fi -]) - -AC_DEFUN([MYSQL_HAVE_FIONREAD], -[AC_MSG_CHECKING(for FIONREAD in sys/ioctl.h) -AC_CACHE_VAL(mysql_cv_fionread_in_ioctl, -[AC_TRY_COMPILE([#include -#include ], [int x = FIONREAD;], - mysql_cv_fionread_in_ioctl=yes,mysql_cv_fionread_in_ioctl=no)]) -AC_MSG_RESULT($mysql_cv_fionread_in_ioctl) -if test "$mysql_cv_fionread_in_ioctl" = "yes"; then -AC_DEFINE([FIONREAD_IN_SYS_IOCTL], [1], [Do we have FIONREAD]) -fi -]) - -AC_DEFUN([MYSQL_HAVE_TIOCSTAT], -[AC_MSG_CHECKING(for TIOCSTAT in sys/ioctl.h) -AC_CACHE_VAL(mysql_cv_tiocstat_in_ioctl, -[AC_TRY_COMPILE([#include -#include ], [int x = TIOCSTAT;], - mysql_cv_tiocstat_in_ioctl=yes,mysql_cv_tiocstat_in_ioctl=no)]) -AC_MSG_RESULT($mysql_cv_tiocstat_in_ioctl) -if test "$mysql_cv_tiocstat_in_ioctl" = "yes"; then -AC_DEFINE(TIOCSTAT_IN_SYS_IOCTL, [1], - [declaration of TIOCSTAT in sys/ioctl.h]) -fi -]) - -AC_DEFUN([MYSQL_STRUCT_DIRENT_D_INO], -[AC_REQUIRE([AC_HEADER_DIRENT]) -AC_MSG_CHECKING(if struct dirent has a d_ino member) -AC_CACHE_VAL(mysql_cv_dirent_has_dino, -[AC_TRY_COMPILE([ -#include -#include -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ -#if defined(HAVE_DIRENT_H) -# include -#else -# define dirent direct -# ifdef HAVE_SYS_NDIR_H -# include -# endif /* SYSNDIR */ -# ifdef HAVE_SYS_DIR_H -# include -# endif /* SYSDIR */ -# ifdef HAVE_NDIR_H -# include -# endif -#endif /* HAVE_DIRENT_H */ -],[ -struct dirent d; int z; z = d.d_ino; -], mysql_cv_dirent_has_dino=yes, mysql_cv_dirent_has_dino=no)]) -AC_MSG_RESULT($mysql_cv_dirent_has_dino) -if test "$mysql_cv_dirent_has_dino" = "yes"; then -AC_DEFINE(STRUCT_DIRENT_HAS_D_INO, [1], - [d_ino member present in struct dirent]) -fi -]) - -AC_DEFUN([MYSQL_STRUCT_DIRENT_D_NAMLEN], -[AC_REQUIRE([AC_HEADER_DIRENT]) -AC_MSG_CHECKING(if struct dirent has a d_namlen member) -AC_CACHE_VAL(mysql_cv_dirent_has_dnamlen, -[AC_TRY_COMPILE([ -#include -#include -#ifdef HAVE_UNISTD_H -# include -#endif /* HAVE_UNISTD_H */ -#if defined(HAVE_DIRENT_H) -# include -#else -# define dirent direct -# ifdef HAVE_SYS_NDIR_H -# include -# endif /* SYSNDIR */ -# ifdef HAVE_SYS_DIR_H -# include -# endif /* SYSDIR */ -# ifdef HAVE_NDIR_H -# include -# endif -#endif /* HAVE_DIRENT_H */ -],[ -struct dirent d; int z; z = (int)d.d_namlen; -], mysql_cv_dirent_has_dnamlen=yes, mysql_cv_dirent_has_dnamlen=no)]) -AC_MSG_RESULT($mysql_cv_dirent_has_dnamlen) -if test "$mysql_cv_dirent_has_dnamlen" = "yes"; then -AC_DEFINE(STRUCT_DIRENT_HAS_D_NAMLEN, [1], - [d_namlen member present in struct dirent]) -fi -]) - - -AC_DEFUN([MYSQL_TYPE_SIGHANDLER], -[AC_MSG_CHECKING([whether signal handlers are of type void]) -AC_CACHE_VAL(mysql_cv_void_sighandler, -[AC_TRY_COMPILE([#include -#include -#ifdef signal -#undef signal -#endif -#ifdef __cplusplus -extern "C" -#endif -void (*signal ()) ();], -[int i;], mysql_cv_void_sighandler=yes, mysql_cv_void_sighandler=no)])dnl -AC_MSG_RESULT($mysql_cv_void_sighandler) -if test "$mysql_cv_void_sighandler" = "yes"; then -AC_DEFINE(VOID_SIGHANDLER, [1], [sighandler type is void (*signal ()) ();]) -fi -]) - -AC_DEFUN([MYSQL_CXX_BOOL], -[ -AC_REQUIRE([AC_PROG_CXX]) -AC_MSG_CHECKING(if ${CXX} supports bool types) -AC_CACHE_VAL(mysql_cv_have_bool, -[ -AC_LANG_SAVE -AC_LANG_CPLUSPLUS -AC_TRY_COMPILE(,[bool b = true;], -mysql_cv_have_bool=yes, -mysql_cv_have_bool=no) -AC_LANG_RESTORE -]) -AC_MSG_RESULT($mysql_cv_have_bool) -if test "$mysql_cv_have_bool" = yes; then -AC_DEFINE([HAVE_BOOL], [1], [bool is not defined by all C++ compilators]) -fi -])dnl - -AC_DEFUN([MYSQL_STACK_DIRECTION], - [AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction, - [AC_TRY_RUN([#include - /* Prevent compiler optimization by HP's compiler, see bug#42213 */ -#if defined(__HP_cc) || defined (__HP_aCC) || defined (__hpux) -#pragma noinline -#endif - int find_stack_direction () - { - static char *addr = 0; - auto char dummy; - if (addr == 0) - { - addr = &dummy; - return find_stack_direction (); - } - else - return (&dummy > addr) ? 1 : -1; - } - int main () - { - exit (find_stack_direction() < 0); - }], ac_cv_c_stack_direction=1, ac_cv_c_stack_direction=-1, - ac_cv_c_stack_direction=)]) - AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction) -])dnl - -AC_DEFUN([MYSQL_CHECK_LONGLONG_TO_FLOAT], -[ -AC_MSG_CHECKING(if conversion of longlong to float works) -AC_CACHE_VAL(ac_cv_conv_longlong_to_float, -[AC_TRY_RUN([#include -typedef long long longlong; -int main() -{ - longlong ll=1; - float f; - FILE *file=fopen("conftestval", "w"); - f = (float) ll; - fprintf(file,"%g\n",f); - fclose(file); - return (0); -}], ac_cv_conv_longlong_to_float=`cat conftestval`, - ac_cv_conv_longlong_to_float=0, - ac_cv_conv_longlong_to_float="yes")])dnl # Cross compiling, assume can convert -if test "$ac_cv_conv_longlong_to_float" = "1" -o "$ac_cv_conv_longlong_to_float" = "yes" -then - ac_cv_conv_longlong_to_float=yes -else - ac_cv_conv_longlong_to_float=no -fi -AC_MSG_RESULT($ac_cv_conv_longlong_to_float) -]) - -AC_DEFUN([MYSQL_CHECK_VIO], [ -dnl -dnl we always use vio: no need for special defines -dnl - AC_DEFINE([HAVE_VIO_READ_BUFF], [1], - [Define to enable buffered read. This works only if syscalls - read/recv return as soon as there is some data in the kernel - buffer, no matter how big the given buffer is.]) -]) - -# Local version of _AC_PROG_CXX_EXIT_DECLARATION that does not -# include #stdlib.h as default as this breaks things on Solaris -# (Conflicts with pthreads and big file handling) - -m4_define([_AC_PROG_CXX_EXIT_DECLARATION], -[for ac_declaration in \ - ''\ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' \ - '#include ' -do - _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$ac_declaration -@%:@include ], - [exit (42);])], - [], - [continue]) - _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$ac_declaration], - [exit (42);])], - [break]) -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi -])# _AC_PROG_CXX_EXIT_DECLARATION - -dnl --------------------------------------------------------------------------- - - -dnl --------------------------------------------------------------------------- -dnl Macro: MYSQL_CHECK_BIG_TABLES -dnl Sets BIG_TABLES if --with-big-tables is used -dnl --------------------------------------------------------------------------- -AC_DEFUN([MYSQL_CHECK_BIG_TABLES], [ - AC_ARG_WITH([big-tables], - AS_HELP_STRING([--with-big-tables], - [Support tables with more than 4 G rows even on 32 bit platforms]), - [bigtables="$withval"], - [bigtables=no]) - AC_MSG_CHECKING([for big tables support]) - - case "$bigtables" in - yes ) - AC_DEFINE([BIG_TABLES], [1], [Support big tables]) - AC_MSG_RESULT([yes]) - ;; - * ) - AC_MSG_RESULT([no]) - ;; - esac - -]) -dnl --------------------------------------------------------------------------- -dnl END OF MYSQL_CHECK_BIG_TABLES SECTION -dnl --------------------------------------------------------------------------- - - -dnl --------------------------------------------------------------------------- -dnl Macro: MYSQL_CHECK_MAX_INDEXES -dnl Sets MAX_INDEXES -dnl --------------------------------------------------------------------------- -AC_DEFUN([MYSQL_CHECK_MAX_INDEXES], [ - AC_ARG_WITH([max-indexes], - AS_HELP_STRING([--with-max-indexes=N], - [Sets the maximum number of indexes per table, default 64]), - [max_indexes="$withval"], - [max_indexes=64]) - AC_MSG_CHECKING([max indexes per table]) - AC_DEFINE_UNQUOTED([MAX_INDEXES], [$max_indexes], - [Maximum number of indexes per table]) - AC_MSG_RESULT([$max_indexes]) -]) -dnl --------------------------------------------------------------------------- -dnl END OF MYSQL_CHECK_MAX_INDEXES SECTION -dnl --------------------------------------------------------------------------- - - -dnl MYSQL_NEEDS_MYSYS_NEW -AC_DEFUN([MYSQL_NEEDS_MYSYS_NEW], -[AC_CACHE_CHECK([needs mysys_new helpers], mysql_cv_use_mysys_new, -[ -AC_LANG_PUSH(C++) -AC_TRY_LINK([], [ -class A { public: int b; }; A *a=new A; a->b=10; delete a; -], mysql_cv_use_mysys_new=no, mysql_cv_use_mysys_new=yes) -AC_LANG_POP(C++) -]) -if test "$mysql_cv_use_mysys_new" = "yes" -then - AC_DEFINE([USE_MYSYS_NEW], [1], [Needs to use mysys_new helpers]) -fi -]) - - -AC_DEFUN([MYSQL_CHECK_CXX_VERSION], [ -CXX_VERSION=`$CXX --version | sed 1q` -if test $? -ne "0" -o -z "$CXX_VERSION" -then - CXX_VERSION=`$CXX -V 2>&1|sed 1q` # trying harder for Sun and SGI -fi -if test $? -ne "0" -o -z "$CXX_VERSION" -then - CXX_VERSION=`$CXX -v 2>&1|sed 1q` # even harder for Alpha -fi -if test $? -ne "0" -o -z "$CXX_VERSION" -then - CXX_VERSION="" -fi -if test "$CXX_VERSION" -then - AC_MSG_CHECKING("C++ compiler version") - AC_MSG_RESULT("$CXX $CXX_VERSION") -fi -AC_SUBST(CXX_VERSION) -]) - -AC_DEFUN([MYSQL_PROG_AR], [ -case $CXX_VERSION in - MIPSpro*) - AR=$CXX - ARFLAGS="-ar -o" - ;; - *Forte*) - AR=$CXX - ARFLAGS="-xar -o" - ;; - *) - AC_CHECK_PROG([AR], [ar], [ar]) - if test -z "$AR" || test "$AR" = "false" - then - AC_MSG_ERROR([You need ar to build the library]) - fi - if test -z "$ARFLAGS" - then - ARFLAGS="cru" - fi -esac -AC_SUBST(AR) -AC_SUBST(ARFLAGS) -]) - -dnl -dnl Macro to check time_t range: according to C standard -dnl array index must be greater than 0 => if time_t is signed, -dnl the code in the macros below won't compile. -dnl - -AC_DEFUN([MYSQL_CHECK_TIME_T],[ - AC_MSG_CHECKING(if time_t is unsigned) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM( - [[ -#include - ]], - [[ - int array[(((time_t)-1) > 0) ? 1 : -1]; - ]] ) - ], [ - AC_DEFINE([TIME_T_UNSIGNED], 1, [Define to 1 if time_t is unsigned]) - AC_MSG_RESULT(yes) - ], - [AC_MSG_RESULT(no)] - ) -]) - diff --git a/config/ac-macros/plugins.m4 b/config/ac-macros/plugins.m4 deleted file mode 100644 index 2aed1267fe6..00000000000 --- a/config/ac-macros/plugins.m4 +++ /dev/null @@ -1,862 +0,0 @@ -dnl =========================================================================== -dnl Support for mysql server plugins -dnl =========================================================================== -dnl -dnl WorkLog#3201 -dnl -dnl Framework for pluggable static and dynamic plugins for mysql -dnl -dnl --------------------------------------------------------------------------- -dnl Macro: MYSQL_PLUGIN -dnl -dnl SYNOPSIS -dnl MYSQL_PLUGIN([name],[Plugin name], -dnl [Plugin description], -dnl [group,group...]) -dnl -dnl DESCRIPTION -dnl First declaration for a plugin (mandatory). -dnl Adds plugin as member to configuration groups (if specified) -dnl -dnl --------------------------------------------------------------------------- - -AC_DEFUN([MYSQL_PLUGIN],[ - _MYSQL_PLUGIN( - [$1], - [__MYSQL_PLUGIN_]AS_TR_CPP([$1])[__], - m4_default([$2], [$1 plugin]), - m4_default([$3], [plugin for $1]), - m4_default([$4], []), - ) -]) - -AC_DEFUN([_MYSQL_PLUGIN],[ - m4_ifdef([$2], [ - AC_FATAL([Duplicate MYSQL_PLUGIN declaration for $3]) - ],[ - m4_define([$2], [$1]) - _MYSQL_PLUGAPPEND([__mysql_plugin_list__],[$1]) - m4_define([MYSQL_PLUGIN_NAME_]AS_TR_CPP([$1]), [$3]) - m4_define([MYSQL_PLUGIN_DESC_]AS_TR_CPP([$1]), [$4]) - _MYSQL_PLUGAPPEND_META([$1], $5) - ifelse(m4_bregexp(__mysql_include__,[/plug\.in$]),-1,[],[ - MYSQL_PLUGIN_DIRECTORY([$1], - m4_bregexp(__mysql_include__,[^\(.*\)/plug\.in$],[\1])) - ]) - ]) -]) - - -dnl --------------------------------------------------------------------------- -dnl Macro: MYSQL_STORAGE_ENGINE -dnl -dnl SYNOPSIS -dnl MYSQL_STORAGE_ENGINE([name],[legacy-option],[Storage engine name], -dnl [Storage engine description],[group,group...]) -dnl -dnl DESCRIPTION -dnl Short cut for storage engine declarations -dnl -dnl --------------------------------------------------------------------------- - -AC_DEFUN([MYSQL_STORAGE_ENGINE],[ - MYSQL_PLUGIN([$1], [$3], [$4], [[$5]]) - MYSQL_PLUGIN_DEFINE([$1], [WITH_]AS_TR_CPP([$1])[_STORAGE_ENGINE]) - ifelse([$2],[no],[],[ - _MYSQL_LEGACY_STORAGE_ENGINE( - m4_bpatsubst([$1], -, _), - m4_bpatsubst(m4_default([$2], [$1-storage-engine]), -, _)) - ]) -]) - -AC_DEFUN([_MYSQL_LEGACY_STORAGE_ENGINE],[ -if test "[${with_]$2[+set}]" = set; then - [with_plugin_]$1="[$with_]$2" -fi -]) - - -dnl --------------------------------------------------------------------------- -dnl Macro: MYSQL_PLUGIN_DEFINE -dnl -dnl SYNOPSIS -dnl MYSQL_PLUGIN_DEFINE([name],[MYSQL_CPP_DEFINE]) -dnl -dnl DESCRIPTION -dnl When a plugin is to be statically linked, define the C macro -dnl -dnl --------------------------------------------------------------------------- - -AC_DEFUN([MYSQL_PLUGIN_DEFINE],[ - MYSQL_REQUIRE_PLUGIN([$1]) - m4_define([MYSQL_PLUGIN_DEFINE_]AS_TR_CPP([$1]), [$2]) -]) - - -dnl --------------------------------------------------------------------------- -dnl Macro: MYSQL_PLUGIN_DIRECTORY -dnl -dnl SYNOPSIS -dnl MYSQL_PLUGIN_DIRECTORY([name],[plugin/dir]) -dnl -dnl DESCRIPTION -dnl Adds a directory to the build process -dnl if it contains 'configure' it will be picked up automatically -dnl -dnl --------------------------------------------------------------------------- - -AC_DEFUN([MYSQL_PLUGIN_DIRECTORY],[ - MYSQL_REQUIRE_PLUGIN([$1]) - m4_define([MYSQL_PLUGIN_DIRECTORY_]AS_TR_CPP([$1]), [$2]) -]) - - -dnl --------------------------------------------------------------------------- -dnl Macro: MYSQL_PLUGIN_STATIC -dnl -dnl SYNOPSIS -dnl MYSQL_PLUGIN_STATIC([name],[libmyplugin.a]) -dnl -dnl DESCRIPTION -dnl Declare the name for the static library -dnl -dnl --------------------------------------------------------------------------- - -AC_DEFUN([MYSQL_PLUGIN_STATIC],[ - MYSQL_REQUIRE_PLUGIN([$1]) - m4_define([MYSQL_PLUGIN_STATIC_]AS_TR_CPP([$1]), [$2]) -]) - - -dnl --------------------------------------------------------------------------- -dnl Macro: MYSQL_PLUGIN_DYNAMIC -dnl -dnl SYNOPSIS -dnl MYSQL_PLUGIN_DYNAMIC([name],[myplugin.la]) -dnl -dnl DESCRIPTION -dnl Declare the name for the shared library -dnl -dnl --------------------------------------------------------------------------- - -AC_DEFUN([MYSQL_PLUGIN_DYNAMIC],[ - MYSQL_REQUIRE_PLUGIN([$1]) - m4_define([MYSQL_PLUGIN_DYNAMIC_]AS_TR_CPP([$1]), [$2]) -]) - - -dnl --------------------------------------------------------------------------- -dnl Macro: MYSQL_PLUGIN_MANDATORY -dnl -dnl SYNOPSIS -dnl MYSQL_PLUGIN_MANDATORY([name]) -dnl -dnl DESCRIPTION -dnl Marks the specified plugin as a mandatory plugin -dnl -dnl --------------------------------------------------------------------------- - -AC_DEFUN([MYSQL_PLUGIN_MANDATORY],[ - MYSQL_REQUIRE_PLUGIN([$1]) - _MYSQL_PLUGIN_MANDATORY([$1], - [MYSQL_PLUGIN_MANDATORY_]AS_TR_CPP([$1]), - [MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1]) - ) -]) - -AC_DEFUN([_MYSQL_PLUGIN_MANDATORY],[ - m4_define([$2], [yes]) - m4_ifdef([$3], [ - AC_FATAL([mandatory plugin $1 has been disabled]) - m4_undefine([$2]) - ]) -]) - - -dnl --------------------------------------------------------------------------- -dnl Macro: MYSQL_PLUGIN_DISABLED -dnl -dnl SYNOPSIS -dnl MYSQL_PLUGIN_DISABLED([name]) -dnl -dnl DESCRIPTION -dnl Marks the specified plugin as a disabled plugin -dnl -dnl --------------------------------------------------------------------------- - -AC_DEFUN([MYSQL_PLUGIN_DISABLED],[ - MYSQL_REQUIRE_PLUGIN([$1]) - _MYSQL_PLUGIN_DISABLED([$1], - [MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1]), - [MYSQL_PLUGIN_MANDATORY_]AS_TR_CPP([$1]) - ) -]) - -AC_DEFUN([_MYSQL_PLUGIN_DISABLED],[ - m4_define([$2], [yes]) - m4_ifdef([$3], [ - AC_FATAL([attempt to disable mandatory plugin $1]) - m4_undefine([$2]) - ]) -]) - - -dnl --------------------------------------------------------------------------- -dnl Macro: MYSQL_PLUGIN_DEPENDS -dnl -dnl SYNOPSIS -dnl MYSQL_PLUGIN_DEPENDS([name],[prereq,prereq...]) -dnl -dnl DESCRIPTION -dnl Enables other plugins neccessary for the named plugin -dnl Dependency checking is not recursive so if any -dnl required plugin requires further plugins, list them -dnl here too! -dnl -dnl --------------------------------------------------------------------------- - -AC_DEFUN([MYSQL_PLUGIN_DEPENDS],[ - MYSQL_REQUIRE_PLUGIN([$1]) - ifelse($#, 2, [ - _MYSQL_PLUGIN_DEPEND([$1], $2) - ], [ - AC_FATAL([bad number of arguments]) - ]) -]) - -AC_DEFUN([_MYSQL_PLUGIN_DEPEND],[ - ifelse($#, 1, [], [$#:$2], [2:], [], [ - MYSQL_REQUIRE_PLUGIN([$2]) - _MYSQL_PLUGAPPEND([__mysql_plugdepends_$1__],[$2]) - _MYSQL_PLUGIN_DEPEND([$1], m4_shift(m4_shift($@))) - ]) -]) - - -dnl --------------------------------------------------------------------------- -dnl Macro: MYSQL_PLUGIN_ACTIONS -dnl -dnl SYNOPSIS -dnl MYSQL_PLUGIN_ACTIONS([name],[PLUGIN_CONFIGURE_STUFF]) -dnl -dnl DESCRIPTION -dnl Declares additional autoconf actions required to configure the plugin -dnl -dnl --------------------------------------------------------------------------- - -AC_DEFUN([MYSQL_PLUGIN_ACTIONS],[ - MYSQL_REQUIRE_PLUGIN([$1]) - m4_ifdef([$2],[ - m4_define([MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1]),m4_defn([$2])) - ],[ - m4_define([MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1]), [$2]) - ]) -]) - -dnl --------------------------------------------------------------------------- -dnl Macro: MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS -dnl -dnl SYNOPSIS -dnl MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS([name],[file name]) -dnl -dnl DESCRIPTION -dnl Some modules in plugins keep dependance on structures -dnl declared in sql/ (THD class usually) -dnl That has to be fixed in the future, but until then -dnl we have to recompile these modules when we want to -dnl to compile server parts with the different #defines -dnl Normally it happens when we compile the embedded server -dnl Thus one should mark such files in his handler using this macro -dnl (currently only one such a file per plugin is supported) -dnl -dnl --------------------------------------------------------------------------- - -AC_DEFUN([MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS],[ - MYSQL_REQUIRE_PLUGIN([$1]) - m4_define([MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS_]AS_TR_CPP([$1]), [$2]) -]) - -dnl --------------------------------------------------------------------------- -dnl Macro: MYSQL_CONFIGURE_PLUGINS -dnl -dnl SYNOPSIS -dnl MYSQL_PLUGIN_DEPENDS([name,name...]) -dnl -dnl DESCRIPTION -dnl Used last, emits all required shell code to configure the plugins -dnl Argument is a list of default plugins or meta-plugin -dnl -dnl --------------------------------------------------------------------------- - -AC_DEFUN([MYSQL_CONFIGURE_PLUGINS],[ - m4_ifdef([__mysql_plugin_configured__],[ - AC_FATAL([cannot use [MYSQL_CONFIGURE_PLUGINS] multiple times]) - ],[ - m4_define([__mysql_plugin_configured__],[done]) - _MYSQL_INCLUDE_LIST( - m4_bpatsubst(m4_esyscmd([ls plugin/*/plug.in storage/*/plug.in 2>/dev/null]), -[[ -]],[,])) - m4_ifdef([__mysql_plugin_list__],[ - _MYSQL_CHECK_PLUGIN_ARGS([$1]) - _MYSQL_CONFIGURE_PLUGINS(m4_bpatsubst(__mysql_plugin_list__, :, [,])) - _MYSQL_EMIT_PLUGIN_ACTIONS(m4_bpatsubst(__mysql_plugin_list__, :, [,])) - AC_SUBST([mysql_se_dirs]) - AC_SUBST([mysql_se_distdirs]) - AC_SUBST([mysql_pg_dirs]) - AC_SUBST([mysql_pg_distdirs]) - AC_SUBST([mysql_se_unittest_dirs]) - AC_SUBST([mysql_pg_unittest_dirs]) - AC_SUBST([condition_dependent_plugin_modules]) - AC_SUBST([condition_dependent_plugin_objects]) - AC_SUBST([condition_dependent_plugin_links]) - AC_SUBST([condition_dependent_plugin_includes]) - ]) - ]) -]) - -AC_DEFUN([_MYSQL_CONFIGURE_PLUGINS],[ - ifelse($#, 0, [], $#, 1, [ - _MYSQL_EMIT_CHECK_PLUGIN([$1]) - ],[ - _MYSQL_EMIT_CHECK_PLUGIN([$1]) - _MYSQL_CONFIGURE_PLUGINS(m4_shift($@)) - ]) -]) - -AC_DEFUN([_MYSQL_EMIT_CHECK_PLUGIN],[ - __MYSQL_EMIT_CHECK_PLUGIN( - [$1], - m4_bpatsubst([$1], -, _), - [MYSQL_PLUGIN_NAME_]AS_TR_CPP([$1]), - [MYSQL_PLUGIN_DESC_]AS_TR_CPP([$1]), - [MYSQL_PLUGIN_DEFINE_]AS_TR_CPP([$1]), - [MYSQL_PLUGIN_DIRECTORY_]AS_TR_CPP([$1]), - [MYSQL_PLUGIN_STATIC_]AS_TR_CPP([$1]), - [MYSQL_PLUGIN_DYNAMIC_]AS_TR_CPP([$1]), - [MYSQL_PLUGIN_MANDATORY_]AS_TR_CPP([$1]), - [MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1]), - [MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS_]AS_TR_CPP([$1]), - [MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1]) - ) -]) - -AC_DEFUN([__MYSQL_EMIT_CHECK_PLUGIN],[ - m4_ifdef([$5],[ - AH_TEMPLATE($5, [Include ]$4[ into mysqld]) - ]) - AC_MSG_CHECKING([whether to use ]$3) - mysql_use_plugin_dir="" - m4_ifdef([$10],[ - if test "X[$mysql_plugin_]$2" = Xyes -a \ - "X[$with_plugin_]$2" != Xno -o \ - "X[$with_plugin_]$2" = Xyes; then - AC_MSG_RESULT([error]) - AC_MSG_ERROR([disabled]) - fi - AC_MSG_RESULT([no]) - ],[ - - # Plugin is not disabled, determine if it should be built, - # or only distributed - - m4_ifdef([$6], [ - if test ! -d "$srcdir/$6"; then - # Plugin directory was removed after autoconf was run; treat - # this as a disabled plugin - if test "X[$with_plugin_]$2" = Xyes; then - AC_MSG_RESULT([error]) - AC_MSG_ERROR([disabled]) - fi - - # The result message will be printed below - [with_plugin_]$2=no - fi - ]) - - m4_ifdef([$9],[ - if test "X[$with_plugin_]$2" = Xno; then - AC_MSG_RESULT([error]) - AC_MSG_ERROR([cannot disable mandatory plugin]) - fi - [mysql_plugin_]$2=yes - ],[ - case "$with_mysqld_ldflags " in - *"-all-static "*) - # No need to build shared plugins when mysqld is linked with - # -all-static as it won't be able to load them. - if test "X[$mysql_plugin_]$2" != Xyes -a \ - "X[$with_plugin_]$2" != Xyes; then - [with_plugin_]$2=no - fi - ;; - esac - ]) - - - if test "X[$with_plugin_]$2" = Xno; then - AC_MSG_RESULT([no]) - else - m4_ifdef([$8],m4_ifdef([$7],[],[[with_plugin_]$2=''])) - if test "X[$mysql_plugin_]$2" != Xyes -a \ - "X[$with_plugin_]$2" != Xyes; then - m4_ifdef([$8],[ - m4_ifdef([$6],[ - if test -d "$srcdir/$6" ; then - mysql_use_plugin_dir="$6" - ]) - AC_SUBST([plugin_]$2[_shared_target], "$8") - AC_SUBST([plugin_]$2[_static_target], [""]) - [with_plugin_]$2=yes - AC_MSG_RESULT([plugin]) - m4_ifdef([$6],[ - else - [mysql_plugin_]$2=no - AC_MSG_RESULT([no]) - fi - ]) - ],[ - [with_plugin_]$2=no - AC_MSG_RESULT([no]) - ]) - else - m4_ifdef([$7],[ - ifelse(m4_bregexp($7, [^lib[^.]+\.a$]), -2, [ -dnl change above "-2" to "0" to enable this section -dnl Although this is "pretty", it breaks libmysqld build - m4_ifdef([$6],[ - mysql_use_plugin_dir="$6" - mysql_plugin_libs="$mysql_plugin_libs -L[\$(top_builddir)]/$6" - ]) - mysql_plugin_libs="$mysql_plugin_libs dnl -[-l]m4_bregexp($7, [^lib\([^.]+\)], [\1])" - ], m4_bregexp($7, [^\\\$]), 0, [ - m4_ifdef([$6],[ - mysql_use_plugin_dir="$6" - ]) - mysql_plugin_libs="$mysql_plugin_libs $7" - ], [ - m4_ifdef([$6],[ - mysql_use_plugin_dir="$6" - mysql_plugin_libs="$mysql_plugin_libs \$(top_builddir)/$6/$7" - ],[ - mysql_plugin_libs="$mysql_plugin_libs $7" - ]) - ]) - m4_ifdef([$5],[ - AC_DEFINE($5) - ]) - AC_SUBST([plugin_]$2[_static_target], "$7") - AC_SUBST([plugin_]$2[_shared_target], [""]) - ],[ - m4_ifdef([$6],[ - AC_MSG_RESULT([error]) - AC_MSG_ERROR([Plugin $1 does not support static linking]) - ],[ - m4_ifdef([$5],[ - AC_DEFINE($5) - AC_SUBST([plugin_]$2[_static_target], ["yes"]) - AC_SUBST([plugin_]$2[_shared_target], [""]) - ]) - ]) - ]) - m4_ifdef([$9],[ - mysql_mandatory_plugins="$mysql_mandatory_plugins [builtin_]$2[_plugin]," - ],[ - mysql_optional_plugins="$mysql_optional_plugins [builtin_]$2[_plugin]," - ]) - [with_plugin_]$2=yes - AC_MSG_RESULT([yes]) - m4_ifdef([$11],[ - condition_dependent_plugin_modules="$condition_dependent_plugin_modules m4_bregexp($11, [[^/]+$], [\&])" - condition_dependent_plugin_objects="$condition_dependent_plugin_objects m4_bregexp($11, [[^/]+\.], [\&o])" - condition_dependent_plugin_links="$condition_dependent_plugin_links $6/$11" - condition_dependent_plugin_includes="$condition_dependent_plugin_includes -I[\$(top_srcdir)]/$6/m4_bregexp($11, [^.+[/$]], [\&])" - ]) - fi - fi - - m4_ifdef([$6], [ - if test -d "$srcdir/$6"; then - # Even if we don't build a plugin, we bundle its source into the dist - # file. So its Makefile (and Makefiles for any subdirs) must be - # generated for 'make dist' to work. - m4_syscmd([test -f "]$6[/configure"]) - ifelse(m4_sysval, 0, - [AC_CONFIG_SUBDIRS($6)], - [ - # autoconf doesn't provide an automatic way to configure DIST_SUBDIRS of - # a subdir; for our purposes, it's enough to just check for existing - # Makefile.am files and add them in here -dnl -dnl Warning, don't try to quote the m4_esyscmd() macro, it doesn't -dnl work. Quoting here is tricky. -dnl -dnl The $FIND or $SED variable can be set by the user when calling autoconf itself -dnl to if they need to pass a specific path. This is *NOT* used when calling -dnl running configure! -dnl - AC_CONFIG_FILES(m4_esyscmd([${FIND-find} "]$6[" -name Makefile.am -print | ${SED-sed} 's,\.am$,,'])) - ] - ) - - ifelse( - m4_substr($6, 0, 8), [storage/], [ - mysql_se_distdirs="$mysql_se_distdirs m4_substr($6, 8)" - if test -n "$mysql_use_plugin_dir" ; then - mysql_se_dirs="$mysql_se_dirs m4_substr($6, 8)" - mysql_se_unittest_dirs="$mysql_se_unittest_dirs ../$6" - fi], - - m4_substr($6, 0, 7), [plugin/], [ - mysql_pg_distdirs="$mysql_pg_distdirs m4_substr($6, 7)" - if test -n "$mysql_use_plugin_dir" ; then - mysql_pg_dirs="$mysql_pg_dirs m4_substr($6, 7)" - mysql_pg_unittest_dirs="$mysql_pg_unittest_dirs ../$6" - fi], - [AC_FATAL([don't know how to handle plugin dir ]$6)]) - fi - ]) - ]) -]) - -AC_DEFUN([_MYSQL_EMIT_PLUGIN_ACTIONS],[ - ifelse($#, 0, [], $#, 1, [ - _MYSQL_EMIT_PLUGIN_ACTION([$1]) - ],[ - _MYSQL_EMIT_PLUGIN_ACTION([$1]) - _MYSQL_EMIT_PLUGIN_ACTIONS(m4_shift($@)) - ]) -]) - -AC_DEFUN([_MYSQL_EMIT_PLUGIN_ACTION],[ - __MYSQL_EMIT_PLUGIN_ACTION( - [$1], - m4_bpatsubst([$1], -, _), - [MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1]), - [MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1]) - ) -]) - - -AC_DEFUN([__MYSQL_EMIT_PLUGIN_ACTION],[ - m4_ifdef([$3], [], [ - if test "X[$with_plugin_]$2" = Xyes; then - if test "X[$plugin_]$2[_static_target]" = X -a \ - "X[$plugin_]$2[_shared_target]" = X; then - AC_MSG_ERROR([that's strange, $1 failed sanity check]) - fi - $4 - fi - ]) -]) - - - -dnl =========================================================================== -dnl Private helper macros -dnl =========================================================================== - - -dnl SYNOPSIS -dnl MYSQL_REQUIRE_PLUGIN([name]) -dnl -dnl DESCRIPTION -dnl Checks that the specified plugin does exist - -AC_DEFUN([MYSQL_REQUIRE_PLUGIN],[ - _MYSQL_REQUIRE_PLUGIN([$1], [__MYSQL_PLUGIN_]AS_TR_CPP([$1])[__]) -]) - -define([_MYSQL_REQUIRE_PLUGIN],[ - ifdef([$2],[ - ifelse($2, [$1], [], [ - AC_FATAL([Misspelt MYSQL_PLUGIN declaration for $1]) - ]) - ],[ - AC_FATAL([Missing MYSQL_PLUGIN declaration for $1]) - ]) -]) - - -dnl --------------------------------------------------------------------------- - - -dnl SYNOPSIS -dnl _MYSQL_EMIT_METAPLUGINS([name,name...]) -dnl -dnl DESCRIPTION -dnl Emits shell code for metaplugins - -AC_DEFUN([_MYSQL_EMIT_METAPLUGINS], [ifelse($#, 0, [], $#, 1, -[_MYSQL_EMIT_METAPLUGIN([$1], [__mysql_]m4_bpatsubst($1, -, _)[_plugins__]) -], -[_MYSQL_EMIT_METAPLUGIN([$1], [__mysql_]m4_bpatsubst($1, -, _)[_plugins__]) -_MYSQL_EMIT_METAPLUGINS(m4_shift($@))]) -]) - -AC_DEFUN([_MYSQL_EMIT_METAPLUGIN], [ - [$1] ) -m4_ifdef([$2], [ - mysql_plugins='m4_bpatsubst($2, :, [ ])' -],[ - mysql_plugins='' -]) - ;; -]) - - -dnl --------------------------------------------------------------------------- - - -dnl SYNOPSIS -dnl _MYSQL_PLUGAPPEND([name],[to-append]) -dnl -dnl DESCRIPTION -dnl Helper macro for appending to colon-delimited lists -dnl Optinal 3rd argument is for actions only required when defining -dnl macro named for the first time. - -AC_DEFUN([_MYSQL_PLUGAPPEND],[ - m4_ifdef([$1],[ - m4_define([__plugin_append_tmp__], m4_defn([$1])) - m4_undefine([$1]) - m4_define([$1], __plugin_append_tmp__[:$2]) - m4_undefine([__plugin_append_tmp__]) - ],[ - m4_define([$1], [$2]) - $3 - ]) -]) - - -dnl SYNOPSIS -dnl _MYSQL_PLUGAPPEND_META([name],[meta,meta...]) -dnl -dnl DESCRIPTION -dnl Helper macro for adding plugins to meta plugins - -AC_DEFUN([_MYSQL_PLUGAPPEND_META],[ - ifelse($#, 1, [], [$#:$2], [2:], [], [$2], [all], [ - AC_FATAL([protected plugin group: all]) - ], [$2], [none], [ - AC_FATAL([protected plugin group: none]) - ],[ - _MYSQL_PLUGAPPEND([__mysql_$1_configs__],[$2]) - _MYSQL_PLUGAPPEND([__mysql_]m4_bpatsubst($2, -, _)[_plugins__],[$1], [ - _MYSQL_PLUGAPPEND([__mysql_metaplugin_list__],[$2]) - ]) - _MYSQL_PLUGAPPEND_META([$1], m4_shift(m4_shift($@))) - ]) -]) - - -dnl --------------------------------------------------------------------------- - - -dnl SYNOPSIS -dnl MYSQL_LIST_PLUGINS -dnl -dnl DESCRIPTION -dnl Emits formatted list of declared plugins - -AC_DEFUN([MYSQL_LIST_PLUGINS],[dnl - m4_ifdef([__mysql_plugin_list__],[dnl - _MYSQL_LIST_PLUGINS(m4_bpatsubst(__mysql_plugin_list__, :, [,]))dnl - ])dnl -]) - -AC_DEFUN([_MYSQL_LIST_PLUGINS],[dnl - ifelse($#, 0, [], $#, 1, [dnl - MYSQL_SHOW_PLUGIN([$1])dnl - ],[dnl - MYSQL_SHOW_PLUGIN([$1])dnl - _MYSQL_LIST_PLUGINS(m4_shift($@))dnl - ])dnl -]) - -AC_DEFUN([MYSQL_SHOW_PLUGIN],[ - _MYSQL_SHOW_PLUGIN( - [$1], - [$1-plugin], - [MYSQL_PLUGIN_NAME_]AS_TR_CPP([$1]), - [MYSQL_PLUGIN_DESC_]AS_TR_CPP([$1]), - [MYSQL_PLUGIN_DEFINE_]AS_TR_CPP([$1]), - [MYSQL_PLUGIN_DIRECTORY_]AS_TR_CPP([$1]), - [MYSQL_PLUGIN_STATIC_]AS_TR_CPP([$1]), - [MYSQL_PLUGIN_DYNAMIC_]AS_TR_CPP([$1]), - [MYSQL_PLUGIN_MANDATORY_]AS_TR_CPP([$1]), - [MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1]), - [MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1]), - __mysql_[$1]_configs__, - ) -]) - -AC_DEFUN([_MYSQL_SHOW_PLUGIN],[dnl - === $3 === - Plugin Name: [$1] - Description: $4 - Supports build: _PLUGIN_BUILD_TYPE([$7],[$8])[]dnl -m4_ifdef([$12],[ - Configurations: m4_bpatsubst($12, :, [, ])])[]dnl -m4_ifdef([$10],[ - Status: disabled])[]dnl -m4_ifdef([$9],[ - Status: mandatory])[]dnl -]) - -AC_DEFUN([_PLUGIN_BUILD_TYPE], -[m4_ifdef([$1],[static ]m4_ifdef([$2],[and dnl -]))[]m4_ifdef([$2],[dynamic],[m4_ifdef([$1],[],[static])])]) - - -dnl --------------------------------------------------------------------------- - - -AC_DEFUN([_MYSQL_EMIT_PLUGINS],[ - ifelse($#, 0, [], [$#:$1], [1:], [], [ - m4_ifdef([MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1]), [], [ - m4_define([MYSQL_PLUGIN_ACTIONS_]AS_TR_CPP([$1]),[ ]) - ]) - [$1] ) - m4_ifdef([MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1]),[ - AC_MSG_ERROR([plugin $1 is disabled]) - ],[ - _MYSQL_EMIT_PLUGIN_ENABLE([$1], m4_bpatsubst([$1], -, _), - [MYSQL_PLUGIN_NAME_]AS_TR_CPP([$1]), - [MYSQL_PLUGIN_STATIC_]AS_TR_CPP([$1]), - [MYSQL_PLUGIN_DYNAMIC_]AS_TR_CPP([$1])) - ]) - ;; - _MYSQL_EMIT_PLUGINS(m4_shift($@)) - ]) -]) - -AC_DEFUN([_MYSQL_EMIT_PLUGIN_ENABLE],[ - m4_ifdef([$5],m4_ifdef([$4],[ - [mysql_plugin_]$2=yes - ],[ - AC_MSG_WARN([$3 can only be built as a plugin]) - ]),[ - [mysql_plugin_]$2=yes - ]) -]) - -AC_DEFUN([_MYSQL_EMIT_PLUGIN_DEPENDS], [ - ifelse($#, 0, [], [$#:$1], [1:], [], [ - _MYSQL_EMIT_CHECK_DEPENDS(m4_bpatsubst([$1], -, _), - [__mysql_plugdepends_$1__]) - _MYSQL_EMIT_PLUGIN_DEPENDS(m4_shift($@)) - ]) -]) - -AC_DEFUN([_MYSQL_EMIT_CHECK_DEPENDS], [ - m4_ifdef([$2], [ - if test "X[$mysql_plugin_]$1" = Xyes -a \ - "X[$with_plugin_]$1" != Xno -o \ - "X[$with_plugin_]$1" = Xyes; then - _MYSQL_EMIT_PLUGIN_DEPENDENCIES(m4_bpatsubst($2, :, [,])) - fi - ]) -]) - -AC_DEFUN([_MYSQL_EMIT_PLUGIN_DEPENDENCIES], [ - ifelse([$1], [], [], [ - m4_ifdef([MYSQL_PLUGIN_DISABLED_]AS_TR_CPP([$1]),[ - AC_MSG_ERROR([depends upon disabled plugin $1]) - ],[ - [mysql_plugin_]m4_bpatsubst([$1], -, _)=yes - if test "X[$with_plugin_]m4_bpatsubst([$1], -, _)" = Xno; then - AC_MSG_ERROR([depends upon disabled plugin $1]) - fi - ]) - _MYSQL_EMIT_PLUGIN_DEPENDENCIES(m4_shift($@)) - ]) -]) - -dnl SYNOPSIS -dnl _MYSQL_CHECK_PLUGIN_ARGS([plugin],[plugin]...) -dnl -dnl DESCRIPTION -dnl Emits shell script for checking configure arguments -dnl Arguments to this macro is default value for selected plugins - -AC_DEFUN([_MYSQL_CHECK_PLUGIN_ARGS],[ - __MYSQL_CHECK_PLUGIN_ARGS(m4_default([$1], [default])) -]) - -AC_DEFUN([__MYSQL_CHECK_PLUGIN_ARGS],[ - AC_ARG_WITH([plugins], -AS_HELP_STRING([--with-plugins=PLUGIN[[[[[,PLUGIN..]]]]]], - [Plugins to include in mysqld. (default is: $1) Must be a - configuration name or a comma separated list of plugins.]) -AS_HELP_STRING([], - [Available configurations are:] dnl -m4_bpatsubst([none:]m4_ifdef([__mysql_metaplugin_list__], - __mysql_metaplugin_list__:)[all], :, [ ])[.]) -AS_HELP_STRING([], - [Available plugins are:] dnl -m4_bpatsubst(__mysql_plugin_list__, :, [ ])[.]) -AS_HELP_STRING([--without-plugin-PLUGIN], - [Disable the named plugin from being built. Otherwise, for - plugins which are not selected for inclusion in mysqld will be - built dynamically (if supported)]) -AS_HELP_STRING([--with-plugin-PLUGIN], - [Forces the named plugin to be linked into mysqld statically.]), - [mysql_plugins="`echo $withval | tr ',.:;*[]' ' '`"], - [mysql_plugins=['$1']]) - -m4_divert_once([HELP_VAR_END],[ -Description of plugins: -MYSQL_LIST_PLUGINS]) - - case "$mysql_plugins" in - all ) - mysql_plugins='m4_bpatsubst(__mysql_plugin_list__, :, [ ])' - ;; - none ) - mysql_plugins='' - ;; -m4_ifdef([__mysql_metaplugin_list__],[ -_MYSQL_EMIT_METAPLUGINS(m4_bpatsubst(__mysql_metaplugin_list__, :, [,])) -]) - esac - - for plugin in $mysql_plugins; do - case "$plugin" in - all | none ) - AC_MSG_ERROR([bad plugin name: $plugin]) - ;; -_MYSQL_EMIT_PLUGINS(m4_bpatsubst(__mysql_plugin_list__, :, [,])) - * ) - AC_MSG_ERROR([unknown plugin: $plugin]) - ;; - esac - done - - _MYSQL_EMIT_PLUGIN_DEPENDS(m4_bpatsubst(__mysql_plugin_list__, :, [,])) -]) - -dnl --------------------------------------------------------------------------- -dnl Macro: _MYSQL_INCLUDE_LIST -dnl -dnl SYNOPSIS -dnl _MYSQL_INCLUDE_LIST([filename,filename...]) -dnl -dnl DESCRIPTION -dnl includes all files from the list -dnl -dnl --------------------------------------------------------------------------- -AC_DEFUN([_MYSQL_INCLUDE_LIST],[ - ifelse([$1], [], [], [ - m4_define([__mysql_include__],[$1]) - dnl We have to use builtin(), because sinclude would generate an error - dnl "file $1 does not exists" in aclocal-1.8 - which is a bug, clearly - dnl violating m4 specs, and which is fixed in aclocal-1.9 - builtin([include],$1) - m4_undefine([__mysql_include__]) - _MYSQL_INCLUDE_LIST(m4_shift($@)) - ]) -]) - -dnl =========================================================================== diff --git a/config/ac-macros/readline.m4 b/config/ac-macros/readline.m4 deleted file mode 100644 index e1ed8420bfb..00000000000 --- a/config/ac-macros/readline.m4 +++ /dev/null @@ -1,143 +0,0 @@ -AC_DEFUN([MYSQL_CHECK_READLINE_DECLARES_HIST_ENTRY], [ - AC_CACHE_CHECK([HIST_ENTRY is declared in readline/readline.h], mysql_cv_hist_entry_declared, - AC_TRY_COMPILE( - [ - #include "stdio.h" - #include "readline/readline.h" - ], - [ - HIST_ENTRY entry; - ], - [ - mysql_cv_hist_entry_declared=yes - AC_DEFINE_UNQUOTED(HAVE_HIST_ENTRY, [1], - [HIST_ENTRY is defined in the outer libeditreadline]) - ], - [mysql_cv_libedit_interface=no] - ) - ) -]) - -AC_DEFUN([MYSQL_CHECK_LIBEDIT_INTERFACE], [ - AC_CACHE_CHECK([libedit variant of rl_completion_entry_function], mysql_cv_libedit_interface, - AC_TRY_COMPILE( - [ - #include "stdio.h" - #include "readline/readline.h" - ], - [ - char res= *(*rl_completion_entry_function)(0,0); - completion_matches(0,0); - ], - [ - mysql_cv_libedit_interface=yes - AC_DEFINE_UNQUOTED([USE_LIBEDIT_INTERFACE], [1], - [used libedit interface (can we dereference result of rl_completion_entry_function)]) - ], - [mysql_cv_libedit_interface=no] - ) - ) -]) - -AC_DEFUN([MYSQL_CHECK_NEW_RL_INTERFACE], [ - AC_CACHE_CHECK([defined rl_compentry_func_t and rl_completion_func_t], mysql_cv_new_rl_interface, - AC_TRY_COMPILE( - [ - #include "stdio.h" - #include "readline/readline.h" - ], - [ - rl_completion_func_t *func1= (rl_completion_func_t*)0; - rl_compentry_func_t *func2= (rl_compentry_func_t*)0; - ], - [ - mysql_cv_new_rl_interface=yes - AC_DEFINE_UNQUOTED([USE_NEW_READLINE_INTERFACE], [1], - [used new readline interface (are rl_completion_func_t and rl_compentry_func_t defined)]) - ], - [mysql_cv_new_rl_interface=no] - ) - ) -]) - -dnl -dnl check for availability of multibyte characters and functions -dnl (Based on BASH_CHECK_MULTIBYTE in aclocal.m4 of readline-5.0) -dnl -AC_DEFUN([MYSQL_CHECK_MULTIBYTE], -[ -AC_CHECK_HEADERS(wctype.h) -AC_CHECK_HEADERS(wchar.h) -AC_CHECK_HEADERS(langinfo.h) - -AC_CHECK_FUNC(mbrlen, AC_DEFINE(HAVE_MBRLEN,[],[Define if you have mbrlen])) -AC_CHECK_FUNC(mbscmp, AC_DEFINE(HAVE_MBSCMP,[],[Define if you have mbscmp])) -AC_CHECK_FUNC(mbsrtowcs, AC_DEFINE(HAVE_MBSRTOWCS,[],[Define if you have mbsrtowcs])) - -AC_CHECK_FUNC(wcrtomb, AC_DEFINE(HAVE_WCRTOMB,[],[Define if you have wcrtomb])) -AC_CHECK_FUNC(mbrtowc, AC_DEFINE(HAVE_MBRTOWC,[],[Define if you have mbrtowc])) -AC_CHECK_FUNC(wcscoll, AC_DEFINE(HAVE_WCSCOLL,[],[Define if you have wcscoll])) -AC_CHECK_FUNC(wcsdup, AC_DEFINE(HAVE_WCSDUP,[],[Define if you have wcsdup])) -AC_CHECK_FUNC(wcwidth, AC_DEFINE(HAVE_WCWIDTH,[],[Define if you have wcwidth])) -AC_CHECK_FUNC(wctype, AC_DEFINE(HAVE_WCTYPE,[],[Define if you have wctype])) - -AC_CACHE_CHECK([for mbstate_t], mysql_cv_have_mbstate_t, -[AC_TRY_COMPILE([ -#include ], [ - mbstate_t ps; - mbstate_t *psp; - psp = (mbstate_t *)0; -], mysql_cv_have_mbstate_t=yes, mysql_cv_have_mbstate_t=no)]) -if test $mysql_cv_have_mbstate_t = yes; then - AC_DEFINE([HAVE_MBSTATE_T],[],[Define if mysql_cv_have_mbstate_t=yes]) -fi - -AC_CHECK_FUNCS(iswlower iswupper towlower towupper iswctype) - -AC_CACHE_CHECK([for nl_langinfo and CODESET], mysql_cv_langinfo_codeset, -[AC_TRY_LINK( -[#include ], -[char* cs = nl_langinfo(CODESET);], -mysql_cv_langinfo_codeset=yes, mysql_cv_langinfo_codeset=no)]) -if test $mysql_cv_langinfo_codeset = yes; then - AC_DEFINE([HAVE_LANGINFO_CODESET],[],[Define if mysql_cv_langinfo_codeset=yes]) -fi - -dnl check for wchar_t in -AC_CACHE_CHECK([for wchar_t in wchar.h], bash_cv_type_wchar_t, -[AC_TRY_COMPILE( -[#include -], -[ - wchar_t foo; - foo = 0; -], bash_cv_type_wchar_t=yes, bash_cv_type_wchar_t=no)]) -if test $bash_cv_type_wchar_t = yes; then - AC_DEFINE(HAVE_WCHAR_T, 1, [systems should define this type here]) -fi - -dnl check for wctype_t in -AC_CACHE_CHECK([for wctype_t in wctype.h], bash_cv_type_wctype_t, -[AC_TRY_COMPILE( -[#include ], -[ - wctype_t foo; - foo = 0; -], bash_cv_type_wctype_t=yes, bash_cv_type_wctype_t=no)]) -if test $bash_cv_type_wctype_t = yes; then - AC_DEFINE(HAVE_WCTYPE_T, 1, [systems should define this type here]) -fi - -dnl check for wint_t in -AC_CACHE_CHECK([for wint_t in wctype.h], bash_cv_type_wint_t, -[AC_TRY_COMPILE( -[#include ], -[ - wint_t foo; - foo = 0; -], bash_cv_type_wint_t=yes, bash_cv_type_wint_t=no)]) -if test $bash_cv_type_wint_t = yes; then - AC_DEFINE(HAVE_WINT_T, 1, [systems should define this type here]) -fi - -]) diff --git a/config/ac-macros/ssl.m4 b/config/ac-macros/ssl.m4 deleted file mode 100644 index fc55f93d8d6..00000000000 --- a/config/ac-macros/ssl.m4 +++ /dev/null @@ -1,219 +0,0 @@ -dnl =========================================================================== -dnl Support for SSL -dnl =========================================================================== -dnl -dnl - -dnl --------------------------------------------------------------------------- -dnl Macro: MYSQL_USE_BUNDLED_YASSL -dnl -dnl SYNOPSIS -dnl MYSQL_USE_BUNDLED_YASSL() -dnl -dnl DESCRIPTION -dnl Add defines so yassl is built and linked with -dnl --------------------------------------------------------------------------- -AC_DEFUN([MYSQL_USE_BUNDLED_YASSL], [ - - with_bundled_yassl="yes" - - yassl_dir="yassl" - AC_SUBST([yassl_dir]) - - yassl_libs="\$(top_builddir)/extra/yassl/src/libyassl.la \ - \$(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.la" - AC_SUBST(yassl_libs) - - AC_DEFINE([HAVE_OPENSSL], [1], [Defined by configure. Using yaSSL for SSL.]) - AC_DEFINE([HAVE_YASSL], [1], [Defined by configure. Using yaSSL for SSL.]) - - # System specific checks - yassl_integer_extra_cxxflags="" - case $host_cpu--$CXX_VERSION in - sparc*--*Sun*C++*5.6*) - # Disable inlining when compiling taocrypt/src/ - yassl_taocrypt_extra_cxxflags="+d" - AC_MSG_NOTICE([disabling inlining for yassl/taocrypt/src/]) - ;; - esac - AC_SUBST([yassl_taocrypt_extra_cxxflags]) - - # Thread safe check - yassl_thread_cxxflags="" - yassl_thread_safe="" - if test "$with_server" != "no" -o "$THREAD_SAFE_CLIENT" != "no"; then - yassl_thread_cxxflags="-DYASSL_THREAD_SAFE" - yassl_thread_safe="(thread-safe)" - fi - AC_SUBST([yassl_thread_cxxflags]) - - # Link extra/yassl/include/openssl subdir to include/ - yassl_h_ln_cmd="\$(LN) -s \$(top_srcdir)/extra/yassl/include/openssl openssl" - AC_SUBST(yassl_h_ln_cmd) - - AC_MSG_RESULT([using bundled yaSSL $yassl_thread_safe]) -]) - - -dnl --------------------------------------------------------------------------- -dnl Macro: MYSQL_CHECK_SSL_DIR -dnl -dnl SYNOPSIS -dnl MYSQL_CHECK_SSL_DIR(includes, libs) -dnl -dnl DESCRIPTION -dnl Auxiliary macro to check for ssl at given path -dnl -dnl --------------------------------------------------------------------------- - -AC_DEFUN([MYSQL_CHECK_SSL_DIR], [ -ssl_incs="$1" -ssl_libs="$2" -save_CPPFLAGS="$CPPFLAGS" -save_LIBS="$LIBS" -CPPFLAGS="$ssl_incs $CPPFLAGS" -LIBS="$LIBS $ssl_libs" -AC_TRY_LINK([#include ], - [return SSL_library_init();], - [mysql_ssl_found="yes"], - [mysql_ssl_found="no"]) -CPPFLAGS="$save_CPPFLAGS" -LIBS="$save_LIBS" -]) - - -dnl --------------------------------------------------------------------------- -dnl Macro: MYSQL_FIND_OPENSSL -dnl -dnl SYNOPSIS -dnl MYSQL_FIND_OPENSSL(location) -dnl -dnl DESCRIPTION -dnl Search the location for OpenSSL support -dnl -dnl --------------------------------------------------------------------------- -AC_DEFUN([MYSQL_FIND_OPENSSL], [ - location="$1" - - # - # Set include paths - # - openssl_include="$location/include" - openssl_includes="" - - # Don't set ssl_includes to /usr/include as this gives us a lot of - # compiler warnings when using gcc 3.x - if test "$openssl_include" != "/usr/include" - then - openssl_includes="-I$openssl_include" - fi - - # - # Try to link with openSSL libs in - # - openssl_libs="-L$location/lib/ -lssl -lcrypto" - MYSQL_CHECK_SSL_DIR([$openssl_includes], [$openssl_libs]) - - if test "$mysql_ssl_found" == "no" - then - # - # BUG 764: Compile failure with OpenSSL on Red Hat Linux (krb5.h missing) - # Try to link with include paths to kerberos set - # - openssl_includes="$openssl_includes -I/usr/kerberos/include" - MYSQL_CHECK_SSL_DIR([$openssl_includes], [$openssl_libs]) - fi - - if test "$mysql_ssl_found" == "no" - then - AC_MSG_ERROR([Could not link with SSL libs at $location]) - fi - - # openssl-devel-0.9.6 requires dlopen() and we can't link staticly - # on many platforms (We should actually test this here, but it's quite - # hard to do as we are doing libtool for linking.) - case "$CLIENT_EXTRA_LDFLAGS $MYSQLD_EXTRA_LDFLAGS" in - *-all-static*) - AC_MSG_ERROR([You can't use the --all-static link option when using openssl.]) - ;; - esac - - AC_SUBST(openssl_includes) - AC_SUBST(openssl_libs) - - NON_THREADED_CLIENT_LIBS="$NON_THREADED_CLIENT_LIBS $openssl_libs" - - AC_DEFINE([HAVE_OPENSSL], [1], [OpenSSL]) - AC_MSG_RESULT([using openSSL from $location]) -]) - - - -dnl ------------------------------------------------------------------------ -dnl Macro: MYSQL_CHECK_SSL -dnl -dnl SYNOPSIS -dnl MYSQL_CHECK_SSL -dnl -dnl Provides the following configure options: -dnl --with-ssl=DIR -dnl Possible DIR values are: -dnl - no - the macro will disable use of ssl -dnl - bundled, empty or not specified - means use ssl lib -dnl bundled along with MySQL sources -dnl - ssl location prefix - given location prefix, the macro expects -dnl to find the header files in $prefix/include/, and libraries in -dnl $prefix/lib. If headers or libraries weren't found at $prefix, the -dnl macro bails out with error. -dnl -dnl ------------------------------------------------------------------------ -AC_DEFUN([MYSQL_CHECK_SSL], [ - - AC_CONFIG_FILES(extra/yassl/Makefile dnl - extra/yassl/taocrypt/Makefile dnl - extra/yassl/taocrypt/benchmark/Makefile dnl - extra/yassl/taocrypt/src/Makefile dnl - extra/yassl/taocrypt/test/Makefile dnl - extra/yassl/src/Makefile dnl - extra/yassl/testsuite/Makefile) - -AC_MSG_CHECKING(for SSL) - AC_ARG_WITH([ssl], - [ --with-ssl[=DIR] Include SSL support], - [mysql_ssl_dir="$withval"], - [mysql_ssl_dir=no]) - - if test "$with_yassl" - then - AC_MSG_ERROR([The flag --with-yassl is deprecated, use --with-ssl]) - fi - - if test "$with_openssl" - then - AC_MSG_ERROR([The flag --with-openssl is deprecated, use --with-ssl]) - fi - - case "$mysql_ssl_dir" in - "no") - # - # Don't include SSL support - # - AC_MSG_RESULT([disabled]) - ;; - - "bundled"|"yes") - # - # Use the bundled SSL implementation (yaSSL) - # - MYSQL_USE_BUNDLED_YASSL - ;; - - *) - # - # A location where to search for OpenSSL was specified - # - MYSQL_FIND_OPENSSL([$mysql_ssl_dir]) - ;; - esac - AM_CONDITIONAL([HAVE_YASSL], [ test "$with_bundled_yassl" = "yes" ]) -]) diff --git a/config/ac-macros/zlib.m4 b/config/ac-macros/zlib.m4 deleted file mode 100644 index f62bb056249..00000000000 --- a/config/ac-macros/zlib.m4 +++ /dev/null @@ -1,132 +0,0 @@ -dnl Define zlib paths to point at bundled zlib - -AC_DEFUN([MYSQL_USE_BUNDLED_ZLIB], [ -ZLIB_INCLUDES="-I\$(top_srcdir)/zlib" -ZLIB_LIBS="\$(top_builddir)/zlib/libzlt.la" -dnl Omit -L$pkglibdir as it's always in the list of mysql_config deps. -ZLIB_DEPS="-lz" -zlib_dir="zlib" -AC_SUBST([zlib_dir]) -mysql_cv_compress="yes" -]) - -dnl Auxiliary macro to check for zlib at given path. -dnl We are strict with the server, as "archive" engine -dnl needs zlibCompileFlags(), but for client only we -dnl are less strict, and take the zlib we find. - -AC_DEFUN([MYSQL_CHECK_ZLIB_DIR], [ -save_CPPFLAGS="$CPPFLAGS" -save_LIBS="$LIBS" -CPPFLAGS="$ZLIB_INCLUDES $CPPFLAGS" -LIBS="$LIBS $ZLIB_LIBS" -if test X"$with_server" = Xno -then - zlibsym=zlibVersion -else - zlibsym=zlibCompileFlags -fi -AC_CACHE_VAL([mysql_cv_compress], - [AC_TRY_LINK([#include ], - [return $zlibsym();], - [mysql_cv_compress="yes" - AC_MSG_RESULT([ok])], - [mysql_cv_compress="no"]) - ]) -CPPFLAGS="$save_CPPFLAGS" -LIBS="$save_LIBS" -]) - -dnl MYSQL_CHECK_ZLIB_WITH_COMPRESS -dnl ------------------------------------------------------------------------ -dnl @synopsis MYSQL_CHECK_ZLIB_WITH_COMPRESS -dnl -dnl Provides the following configure options: -dnl --with-zlib-dir=DIR -dnl Possible DIR values are: -dnl - "no" - the macro will disable use of compression functions -dnl - "bundled" - means use zlib bundled along with MySQL sources -dnl - empty, or not specified - the macro will try default system -dnl library (if present), and in case of error will fall back to -dnl bundled zlib -dnl - zlib location prefix - given location prefix, the macro expects -dnl to find the library headers in $prefix/include, and binaries in -dnl $prefix/lib. If zlib headers or binaries weren't found at $prefix, the -dnl macro bails out with error. -dnl -dnl If the library was found, this function #defines HAVE_COMPRESS -dnl and configure variables ZLIB_INCLUDES (i.e. -I/path/to/zlib/include), -dnl ZLIB_LIBS (i. e. -L/path/to/zlib/lib -lz) and ZLIB_DEPS which is -dnl used in mysql_config and is always the same as ZLIB_LIBS except to -dnl when we use the bundled zlib. In the latter case ZLIB_LIBS points to the -dnl build dir ($top_builddir/zlib), while mysql_config must point to the -dnl installation dir ($pkglibdir), so ZLIB_DEPS is set to point to -dnl $pkglibdir. - -AC_DEFUN([MYSQL_CHECK_ZLIB_WITH_COMPRESS], [ - -AC_CONFIG_FILES(zlib/Makefile) - -AC_MSG_CHECKING([for zlib compression library]) -case $SYSTEM_TYPE in -*netware* | *modesto*) - AC_MSG_RESULT(ok) - AC_DEFINE([HAVE_COMPRESS], [1], [Define to enable compression support]) - ;; - *) - AC_ARG_WITH([zlib-dir], - AC_HELP_STRING([--with-zlib-dir=no|bundled|DIR], - [Provide MySQL with a custom location of - compression library. Given DIR, zlib binary is - assumed to be in $DIR/lib and header files - in $DIR/include.]), - [mysql_zlib_dir=${withval}], - [mysql_zlib_dir=""]) - case "$mysql_zlib_dir" in - "no") - mysql_cv_compress="no" - AC_MSG_RESULT([disabled]) - ;; - "bundled") - MYSQL_USE_BUNDLED_ZLIB - AC_MSG_RESULT([using bundled zlib]) - ;; - "") - ZLIB_INCLUDES="" - ZLIB_LIBS="-lz" - MYSQL_CHECK_ZLIB_DIR - if test "$mysql_cv_compress" = "no"; then - MYSQL_USE_BUNDLED_ZLIB - AC_MSG_RESULT([system-wide zlib not found, using one bundled with MySQL]) - fi - ;; - *) - # Test for libz using all known library file endings - if test \( -f "$mysql_zlib_dir/lib/libz.a" -o \ - -f "$mysql_zlib_dir/lib/libz.so" -o \ - -f "$mysql_zlib_dir/lib/libz.sl" -o \ - -f "$mysql_zlib_dir/lib/libz.dylib" \) \ - -a -f "$mysql_zlib_dir/include/zlib.h"; then - ZLIB_INCLUDES="-I$mysql_zlib_dir/include" - ZLIB_LIBS="-L$mysql_zlib_dir/lib -lz" - MYSQL_CHECK_ZLIB_DIR - fi - if test "x$mysql_cv_compress" != "xyes"; then - AC_MSG_ERROR([headers or binaries were not found in $mysql_zlib_dir/{include,lib}]) - fi - ;; - esac - if test "$mysql_cv_compress" = "yes"; then - if test "x$ZLIB_DEPS" = "x"; then - ZLIB_DEPS="$ZLIB_LIBS" - fi - AC_SUBST([ZLIB_LIBS]) - AC_SUBST([ZLIB_DEPS]) - AC_SUBST([ZLIB_INCLUDES]) - AC_DEFINE([HAVE_COMPRESS], [1], [Define to enable compression support]) - fi - ;; -esac -]) - -dnl ------------------------------------------------------------------------ diff --git a/configure.cmake b/configure.cmake index 91c39fc5b09..cba9e79ff23 100644 --- a/configure.cmake +++ b/configure.cmake @@ -299,7 +299,8 @@ CHECK_FUNCTION_EXISTS (dlopen HAVE_DLOPEN) CHECK_FUNCTION_EXISTS (fchmod HAVE_FCHMOD) CHECK_FUNCTION_EXISTS (fcntl HAVE_FCNTL) CHECK_FUNCTION_EXISTS (fconvert HAVE_FCONVERT) -CHECK_SYMBOL_EXISTS(fdatasync "unistd.h" HAVE_FDATASYNC) +CHECK_FUNCTION_EXISTS (fdatasync HAVE_FDATASYNC) +CHECK_SYMBOL_EXISTS(fdatasync "unistd.h" HAVE_DECL_FDATASYNC) CHECK_FUNCTION_EXISTS (fesetround HAVE_FESETROUND) CHECK_FUNCTION_EXISTS (fpsetmask HAVE_FPSETMASK) CHECK_FUNCTION_EXISTS (fseeko HAVE_FSEEKO) diff --git a/configure.in b/configure.in deleted file mode 100644 index c272efe9214..00000000000 --- a/configure.in +++ /dev/null @@ -1,3003 +0,0 @@ -dnl -*- ksh -*- -dnl Process this file with autoconf to produce a configure script. - -# 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 -# 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 - -# Minimum Autoconf version required. -AC_PREREQ(2.59) - -dnl Various people throughout the community may parse configure.in to -dnl get the MySQL version from the source branch. If the formatting -dnl of this line is going to be changed, please announce the change to -dnl internals@lists.mysql.com in advance of pushing the change. -dnl -dnl When changing the major version number please also check the switch -dnl statement in mysqlbinlog::check_master_version(). You may also need -dnl to update version.c in ndb. -AC_INIT([MySQL Server], [5.5.7-rc], [], [mysql]) - -AC_CONFIG_SRCDIR([sql/mysqld.cc]) -AC_CANONICAL_SYSTEM -# USTAR format gives us the possibility to store longer path names in -# TAR files, the path name is split into two parts, a 155 chacater -# first part and a 100 character second part. -AM_INIT_AUTOMAKE([1.9 tar-ustar]) -AC_PROG_LIBTOOL - -AM_CONFIG_HEADER([include/config.h]) - -# Request support for automake silent-rules if available. -# Default to verbose output. One can use the configure-time -# option --enable-silent-rules or make V=0 to activate -# silent rules. -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([no])]) - -PROTOCOL_VERSION=10 -DOT_FRM_VERSION=6 -# See the libtool docs for information on how to do shared lib versions. -SHARED_LIB_MAJOR_VERSION=16 -SHARED_LIB_VERSION=$SHARED_LIB_MAJOR_VERSION:0:0 -NDB_SHARED_LIB_MAJOR_VERSION=3 -NDB_SHARED_LIB_VERSION=$NDB_SHARED_LIB_MAJOR_VERSION:0:0 - -# Set all version vars based on $VERSION. How do we do this more elegant ? -# Remember that regexps needs to quote [ and ] since this is run through m4 -# We take some made up examples -# -# VERSION 5.1.40sp1-alpha 5.0.34a 5.5.1-m2 -# MYSQL_U_SCORE_VERSION 5.1.40sp1_alpha 5.0.34a 5.5.1_m2 -# MYSQL_NO_DASH_VERSION 5.1.40sp1 5.0.34a 5.5.1 -# MYSQL_NUMERIC_VERSION 5.1.40 5.0.34 5.5.1 -# MYSQL_BASE_VERSION 5.1 5.0 5.5 -# MYSQL_VERSION_ID 50140 50034 50501 -# -MYSQL_U_SCORE_VERSION=`echo $VERSION | sed -e "s|-|_|"` -MYSQL_NO_DASH_VERSION=`echo $VERSION | sed -e "s|-.*$||"` -MYSQL_NUMERIC_VERSION=`echo $MYSQL_NO_DASH_VERSION | sed -e "s|[[a-z]][[a-z0-9]]*$||"` -MYSQL_BASE_VERSION=`echo $MYSQL_NUMERIC_VERSION | sed -e "s|\.[[^.]]*$||"` -MYSQL_VERSION_ID=`echo $MYSQL_NUMERIC_VERSION | \ - awk -F. '{printf "%d%0.2d%0.2d", $1, $2, $3}'` -MYSQL_COPYRIGHT_YEAR=`date '+%Y'` - -# Add previous major version for debian package upgrade path -MYSQL_PREVIOUS_BASE_VERSION=5.0 - -# The port should be constant for a LONG time -MYSQL_TCP_PORT_DEFAULT=3306 -MYSQL_UNIX_ADDR_DEFAULT="/tmp/mysql.sock" - -dnl Include m4 -sinclude(config/ac-macros/maintainer.m4) -sinclude(config/ac-macros/alloca.m4) -sinclude(config/ac-macros/check_cpu.m4) -sinclude(config/ac-macros/character_sets.m4) -sinclude(config/ac-macros/compiler_flag.m4) -sinclude(config/ac-macros/plugins.m4) -sinclude(config/ac-macros/dtrace.m4) -sinclude(config/ac-macros/large_file.m4) -sinclude(config/ac-macros/misc.m4) -sinclude(config/ac-macros/readline.m4) -sinclude(config/ac-macros/ssl.m4) -sinclude(config/ac-macros/zlib.m4) - -# Remember to add a directory sql/share/LANGUAGE -AVAILABLE_LANGUAGES="\ -czech danish dutch english estonian french german greek hungarian \ -italian japanese korean norwegian norwegian-ny polish portuguese \ -romanian russian serbian slovak spanish swedish ukrainian" - -##### -##### - -AC_SUBST(MYSQL_U_SCORE_VERSION) -AC_SUBST(MYSQL_NO_DASH_VERSION) -AC_SUBST(MYSQL_BASE_VERSION) -AC_SUBST(MYSQL_VERSION_ID) -AC_SUBST(MYSQL_PREVIOUS_BASE_VERSION) -AC_SUBST(MYSQL_COPYRIGHT_YEAR) -AC_SUBST(PROTOCOL_VERSION) -AC_DEFINE_UNQUOTED([PROTOCOL_VERSION], [$PROTOCOL_VERSION], - [mysql client protocol version]) -AC_SUBST(DOT_FRM_VERSION) -AC_DEFINE_UNQUOTED([DOT_FRM_VERSION], [$DOT_FRM_VERSION], - [Version of .frm files]) -AC_SUBST(SHARED_LIB_MAJOR_VERSION) -AC_SUBST(SHARED_LIB_VERSION) -AC_SUBST(AVAILABLE_LANGUAGES) - -# Whether the maintainer mode should be enabled. -MY_MAINTAINER_MODE - -# Canonicalize the configuration name. - -# Check whether --with-system-type or --without-system-type was given. -AC_ARG_WITH(system-type, - [ --with-system-type Set the system type, like "sun-solaris10"], - [SYSTEM_TYPE="$withval"], - [SYSTEM_TYPE="$host_vendor-$host_os"]) -AC_ARG_WITH(machine-type, - [ --with-machine-type Set the machine type, like "powerpc"], - [MACHINE_TYPE="$withval"], - [MACHINE_TYPE="$host_cpu"]) -AC_SUBST(SYSTEM_TYPE) -AC_DEFINE_UNQUOTED([SYSTEM_TYPE], ["$SYSTEM_TYPE"], - [Name of system, eg sun-solaris]) -AC_SUBST(MACHINE_TYPE) -AC_DEFINE_UNQUOTED([MACHINE_TYPE], ["$MACHINE_TYPE"], - [Machine type name, eg sparc]) - -# Detect intel x86 like processor -BASE_MACHINE_TYPE=$MACHINE_TYPE -case $MACHINE_TYPE in - i?86) BASE_MACHINE_TYPE=i386 ;; -esac - -# Save some variables and the command line options for mysqlbug -SAVE_CC="$CC" -SAVE_CXX="$CXX" -SAVE_ASFLAGS="$ASFLAGS" -SAVE_CFLAGS="$CFLAGS" -SAVE_CXXFLAGS="$CXXFLAGS" -SAVE_LDFLAGS="$LDFLAGS" -SAVE_CXXLDFLAGS="$CXXLDFLAGS" -CONF_COMMAND="$0 $ac_configure_args" -AC_SUBST(CONF_COMMAND) -AC_SUBST(SAVE_CC) -AC_SUBST(SAVE_CXX) -AC_SUBST(SAVE_ASFLAGS) -AC_SUBST(SAVE_CFLAGS) -AC_SUBST(SAVE_CXXFLAGS) -AC_SUBST(SAVE_LDFLAGS) -AC_SUBST(SAVE_CXXLDFLAGS) -AC_SUBST(CXXLDFLAGS) - -#AC_ARG_PROGRAM # Automaticly invoked by AM_INIT_AUTOMAKE - -AM_SANITY_CHECK -# This is needed is SUBDIRS is set -AC_PROG_MAKE_SET - -############################################################################## -# The below section needs to be done before AC_PROG_CC -############################################################################## - -# Hack for OS X/Darwin and Metrowerks CodeWarrior -AC_ARG_WITH(darwin-mwcc, -[ --with-darwin-mwcc Use Metrowerks CodeWarrior wrappers on OS X/Darwin],[ - if [ "with_darwin_mwcc" = yes ] ; then - builddir=`pwd` - ccwrapper="$builddir/support-files/MacOSX/mwcc-wrapper" - arwrapper="$builddir/support-files/MacOSX/mwar-wrapper" - CC="$ccwrapper" - CXX="$ccwrapper" - LD="$ccwrapper" - AR="$arwrapper" - RANLIB=: - export CC CXX LD AR RANLIB - AC_SUBST(AR) - AC_SUBST(RANLIB) - fi -]) - -AM_CONDITIONAL(DARWIN_MWCC, test x$with_darwin_mwcc = xyes) - -if test "x${CFLAGS-}" = x ; then - cflags_is_set=no -else - cflags_is_set=yes -fi - -if test "x${CPPFLAGS-}" = x ; then - cppflags_is_set=no -else - cppflags_is_set=yes -fi - -if test "x${LDFLAGS-}" = x ; then - ldflags_is_set=no -else - ldflags_is_set=yes -fi - -################ End of section to be done before AC_PROG_CC ################# - -# The following hack should ensure that configure doesn't add optimizing -# or debugging flags to CFLAGS or CXXFLAGS -# C_EXTRA_FLAGS are flags that are automaticly added to both -# CFLAGS and CXXFLAGS -CFLAGS="$CFLAGS $C_EXTRA_FLAGS " -CXXFLAGS="$CXXFLAGS $C_EXTRA_FLAGS " - -dnl Checks for programs. -AC_PROG_AWK -AC_PROG_CC -AC_PROG_CXX -AC_PROG_CPP - -# Print version of CC and CXX compiler (if they support --version) -CC_VERSION=`$CC --version | sed 1q` -if test $? -eq "0" -then - AC_MSG_CHECKING("C Compiler version") - AC_MSG_RESULT("$CC $CC_VERSION") -else -CC_VERSION="" -fi -AC_SUBST(CC_VERSION) -MYSQL_CHECK_CXX_VERSION - -# Fix for sgi gcc / sgiCC which tries to emulate gcc -if test "$CC" = "sgicc" -then - ac_cv_prog_gcc="no" -fi -if test "$CXX" = "sgi++" -then - GXX="no" -fi - -if test "$ac_cv_prog_gcc" = "yes" -then - AS="$CC -c" - AC_SUBST(AS) -else - AC_PATH_PROG(AS, as, as) -fi - -# Still need ranlib for readline; local static use only so no libtool. -AC_PROG_RANLIB -# We use libtool -#AC_LIBTOOL_WIN32_DLL -AC_PROG_LIBTOOL - -# Ensure that we have --preserve-dup-deps defines, otherwise we get link -# problems of 'mysql' with CXX=g++ -LIBTOOL="$LIBTOOL --preserve-dup-deps" -AC_SUBST(LIBTOOL)dnl - -AC_SUBST(NM)dnl - -# NM= "$NM -X64" -#archive_expsym_cmds= `echo "$archive_expsym_cmds" | sed -e '/"$(CC)"//'` -#archive_expsym_cmds= "$CC -q64 $archive_expsym_cmds" -# CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-ansi//; s/-pedantic//; s/-Wcheck//'` - -#AC_LIBTOOL_DLOPEN AC_LIBTOOL_WIN32_DLL AC_DISABLE_FAST_INSTALL AC_DISABLE_SHARED AC_DISABLE_STATIC - -# AC_PROG_INSTALL -AC_PROG_INSTALL -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' - -# Not critical since the generated file is distributed -AC_CHECK_PROGS(YACC, ['bison -y -p MYSQL']) -AC_CHECK_PROG(PDFMANUAL, pdftex, manual.pdf) -AC_CHECK_PROG(DVIS, tex, manual.dvi) - -AC_PATH_PROG(uname_prog, uname, no) - -# We should go through this and put all the explictly system dependent -# stuff in one place -AC_MSG_CHECKING(operating system) -AC_CACHE_VAL(mysql_cv_sys_os, -[ -if test "$uname_prog" != "no"; then - mysql_cv_sys_os="`uname`" -else - mysql_cv_sys_os="Not Solaris" -fi -]) -AC_MSG_RESULT($mysql_cv_sys_os) - -# This should be rewritten to use $target_os -case "$target_os" in - sco3.2v5*) - CFLAGS="$CFLAGS -DSCO" - CXXFLAGS="$CXXFLAGS -DSCO" - LD='$(CC) $(CFLAGS)' - case "$CFLAGS" in - *-belf*) - AC_SYS_COMPILER_FLAG(-belf,sco_belf_option,CFLAGS,[],[ - case "$LDFLAGS" in - *-belf*) ;; - *) AC_MSG_WARN([Adding -belf option to ldflags.]) - LDFLAGS="$LDFLAGS -belf" - ;; - esac - ]) - ;; - *) - AC_SYS_COMPILER_FLAG(-belf,sco_belf_option,CFLAGS,[],[ - case "$LDFLAGS" in - *-belf*) ;; - *) - AC_MSG_WARN([Adding -belf option to ldflags.]) - LDFLAGS="$LDFLAGS -belf" - ;; - esac - ]) - ;; - esac - ;; - sysv5UnixWare* | sysv5OpenUNIX8*) - if test "$GCC" != "yes"; then - # Use the built-in alloca() - CFLAGS="$CFLAGS -Kalloca" - fi - CXXFLAGS="$CXXFLAGS -DNO_CPLUSPLUS_ALLOCA" - ;; - sysv5SCO_SV6.0.0*) - if test "$GCC" != "yes"; then - # Use the built-in alloca() - CFLAGS="$CFLAGS -Kalloca" - CXXFLAGS="$CFLAGS -Kalloca" - # Use no_implicit for templates - CXXFLAGS="$CXXFLAGS -Tno_implicit" - AC_DEFINE([HAVE_EXPLICIT_TEMPLATE_INSTANTIATION], - [1], [Defined by configure. Use explicit template instantiation.]) - fi - ;; -esac - -# The following is required for portable results of floating point calculations -# on PowerPC. The same must also be done for IA-64, but this options is missing -# in the IA-64 gcc backend. - -if test "$GCC" = "yes" -then - case "$host_cpu" in - *ppc* | *powerpc*) - CFLAGS="$CFLAGS -mno-fused-madd" - CXXFLAGS="$CXXFLAGS -mno-fused-madd" - ;; - esac -fi - -AC_SUBST(CC) -AC_SUBST(CFLAGS) -AC_SUBST(CXX) -AC_SUBST(CXXFLAGS) -AC_SUBST(ASFLAGS) -AC_SUBST(LD) -AC_SUBST(INSTALL_SCRIPT) - -export CC CXX CFLAGS LD LDFLAGS AR ARFLAGS - -if test "$GCC" = "yes" -then - # mysqld requires -fno-implicit-templates. - # Disable exceptions as they seams to create problems with gcc and threads. - # mysqld doesn't use run-time-type-checking, so we disable it. - # We should use -Wno-invalid-offsetof flag to disable some warnings from gcc - # regarding offset() usage in C++ which are done in a safe manner in the - # server - CXXFLAGS="$CXXFLAGS -fno-implicit-templates -fno-exceptions -fno-rtti" - AC_DEFINE([HAVE_EXPLICIT_TEMPLATE_INSTANTIATION], - [1], [Defined by configure. Use explicit template instantiation.]) -fi - -MYSQL_PROG_AR - -# libmysqlclient versioning when linked with GNU ld. -if $LD --version 2>/dev/null| grep GNU >/dev/null 2>&1; then - LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_builddir)/libmysql/libmysql.ver" - AC_CONFIG_FILES(libmysql/libmysql.ver) -fi -AC_SUBST(LD_VERSION_SCRIPT) - - -# Avoid bug in fcntl on some versions of linux -AC_MSG_CHECKING([if we should use 'skip-external-locking' as default for $target_os]) -# Any variation of Linux -if expr "$target_os" : "[[Ll]]inux.*" > /dev/null -then - MYSQLD_DEFAULT_SWITCHES="--skip-external-locking" - TARGET_LINUX="true" - AC_MSG_RESULT([yes]) - AC_DEFINE([TARGET_OS_LINUX], [1], [Whether we build for Linux]) -else - MYSQLD_DEFAULT_SWITCHES="" - TARGET_LINUX="false" - AC_MSG_RESULT([no]) -fi -AC_SUBST(MYSQLD_DEFAULT_SWITCHES) -AC_SUBST(TARGET_LINUX) - -dnl Find paths to some shell programs -AC_PATH_PROG(LN, ln, ln) -# This must be able to take a -f flag like normal unix ln. -AC_PATH_PROG(LN_CP_F, ln, ln) -# If ln -f does not exists use -s (AFS systems) -if test -n "$LN_CP_F"; then - LN_CP_F="$LN_CP_F -s" -fi - -AC_PATH_PROG(MV, mv, mv) -AC_PATH_PROG(RM, rm, rm) -AC_PATH_PROG(CP, cp, cp) -AC_PATH_PROG(SED, sed, sed) -AC_PATH_PROG(CMP, cmp, cmp) -AC_PATH_PROG(CHMOD, chmod, chmod) -AC_PATH_PROG(HOSTNAME, hostname, hostname) -AC_PATH_PROG(DIFF, diff, diff) -# Check for a GNU tar named 'gtar', or 'gnutar' (MacOS X) and -# fall back to 'tar' otherwise and hope that it's a GNU tar as well -AC_CHECK_PROGS(TAR, gnutar gtar tar) - -dnl We use a path for perl so the script startup works -dnl We make sure to use perl, not perl5, in hopes that the RPMs will -dnl not depend on the perl5 binary being installed (probably a bug in RPM) -AC_PATH_PROG(PERL, perl, no) -if test "$PERL" != "no" && $PERL -e 'require 5' > /dev/null 2>&1 -then - PERL5=$PERL -else - AC_PATH_PROG(PERL5, perl5, no) - if test "$PERL5" != no - then - PERL=$PERL5 - ac_cv_path_PERL=$ac_cv_path_PERL5 - fi -fi - -AC_SUBST(HOSTNAME) -AC_SUBST(PERL) -AC_SUBST(PERL5) - -# Enable the abi_check rule only if gcc is available - -if test "$GCC" != "yes" || expr "$CC" : ".*icc.*" -then - ABI_CHECK="" -else - ABI_CHECK="abi_check" -fi - -AC_SUBST(ABI_CHECK) - -# Look for PS usage. We use double dollar-signs in FIND_PROC because this -# value is written to a makefile, which interprets away one level of -# dollar-signs. So, interpretation stages are m4 and then shell in autoconf, -# then Make, then shell. The autoconf substitution uses single quotes, so -# no unprotected single quotes should appear in the expression. -AC_PATH_PROG(PS, ps, ps) -AC_MSG_CHECKING("how to check if pid exists") -PS=$ac_cv_path_PS -# Linux style -if $PS wwwp $$ 2> /dev/null | grep -- "$0" > /dev/null -then - FIND_PROC="$PS wwwp \$\$PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" > /dev/null" -# Solaris -elif $PS -fp $$ 2> /dev/null | grep -- $0 > /dev/null -then - FIND_PROC="$PS -p \$\$PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" > /dev/null" -# BSD style -elif $PS -uaxww 2> /dev/null | grep -- $0 > /dev/null -then - FIND_PROC="$PS -uaxww | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" | grep \" \$\$PID \" > /dev/null" -# SysV style -elif $PS -ef 2> /dev/null | grep -- $0 > /dev/null -then - FIND_PROC="$PS -ef | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" | grep \" \$\$PID \" > /dev/null" -# Do anybody use this? -elif $PS $$ 2> /dev/null | grep -- $0 > /dev/null -then - FIND_PROC="$PS \$\$PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" > /dev/null" -else - case $SYSTEM_TYPE in - *freebsd*|*dragonfly*) - FIND_PROC="$PS p \$\$PID | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" > /dev/null" - ;; - *darwin*) - FIND_PROC="$PS -uaxww | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" | grep \" \$\$PID \" > /dev/null" - ;; - *cygwin*) - FIND_PROC="$PS -e | grep -v \" grep\" | grep -v mysqld_safe | grep -- \"\$\$MYSQLD\" | grep \" \$\$PID \" > /dev/null" - ;; - *) - AC_MSG_ERROR([Could not find the right ps and/or grep switches. Which OS is this? See the Installation chapter in the Reference Manual.]) - esac -fi -AC_SUBST(FIND_PROC) -AC_MSG_RESULT("$FIND_PROC") - -# Check if a pid is valid -AC_PATH_PROG(KILL, kill, kill) -AC_MSG_CHECKING("for kill switches") -if $ac_cv_path_KILL -0 $$ -then - CHECK_PID="$ac_cv_path_KILL -0 \$\$PID > /dev/null 2> /dev/null" -elif kill -s 0 $$ -then - CHECK_PID="$ac_cv_path_KILL -s 0 \$\$PID > /dev/null 2> /dev/null" -else - AC_MSG_WARN([kill -0 to check for pid seems to fail]) - CHECK_PID="$ac_cv_path_KILL -s SIGCONT \$\$PID > /dev/null 2> /dev/null" -fi -AC_SUBST(CHECK_PID) -AC_MSG_RESULT("$CHECK_PID") - -# We need an ANSI C compiler -AM_PROG_CC_STDC - -# We need an assembler, too -AM_PROG_AS -CCASFLAGS="$CCASFLAGS $ASFLAGS" - -# Check if we need noexec stack for assembler -AC_CHECK_NOEXECSTACK - -if test "$am_cv_prog_cc_stdc" = "no" -then - AC_MSG_ERROR([MySQL requires an ANSI C compiler (and a C++ compiler). Try gcc. See the Installation chapter in the Reference Manual.]) -fi - -NOINST_LDFLAGS="-static" - -static_nss="" -STATIC_NSS_FLAGS="" -OTHER_LIBC_LIB="" -AC_ARG_WITH(other-libc, - [ --with-other-libc=DIR Link against libc and other standard libraries - installed in the specified non-standard location - overriding default. Originally added to be able to - link against glibc 2.2 without making the user - upgrade the standard libc installation.], - [ - other_libc_include="$withval/include" - other_libc_lib="$withval/lib" - with_other_libc="yes" - enable_shared="no" - all_is_static="yes" - CFLAGS="$CFLAGS -I$other_libc_include" - # There seems to be a feature in gcc that treats system and libc headers - # silently when they violatate ANSI C++ standard, but it is strict otherwise - # since gcc cannot now recognize that our headers are libc, we work around - # by telling it to be permissive. Note that this option only works with - # new versions of gcc (2.95.x and above) - CXXFLAGS="$CXXFLAGS -fpermissive -I$other_libc_include" - if test -f "$other_libc_lib/libnss_files.a" - then - # libc has been compiled with --enable-static-nss - # we need special flags, but we will have to add those later - STATIC_NSS_FLAGS="-lc -lnss_files -lnss_dns -lresolv" - STATIC_NSS_FLAGS="$STATIC_NSS_FLAGS $STATIC_NSS_FLAGS" - OTHER_LIBC_LIB="-static -L$other_libc_lib" - static_nss=1 - else - # this is a dirty hack. We if we detect static nss glibc in the special - # location, we do not re-direct the linker to get libraries from there - # during check. The reason is that if we did, we would have to find a - # way to append the special static nss flags to LIBS every time we do - # any check - this is definitely feasible, but not worthwhile the risk - # of breaking other things. So for our purposes it would be sufficient - # to assume that whoever is using static NSS knows what he is doing and - # has sensible libraries in the regular location - LDFLAGS="$LDFLAGS -static -L$other_libc_lib " - fi - - # When linking against custom libc installed separately, we want to force - # all binary builds to be static, including the build done by configure - # itself to test for system features. - with_mysqld_ldflags="-all-static" - with_client_ldflags="-all-static" - NOINST_LDFLAGS="-all-static" - ], - [ - other_libc_include= - other_libc_lib= - with_other_libc="no" - ] -) -AC_SUBST(NOINST_LDFLAGS) - -# -# Check if we are using Linux and a glibc compiled with static nss -# (this is true on the MySQL build machines to avoid NSS problems) -# -AC_CHECK_TOOL([NM], [nm]) - -if test "$TARGET_LINUX" = "true" -a "$static_nss" = "" -then - tmp=`$NM ${other_libc_lib:-/usr/lib*}/libc.a | grep _nss_files_getaliasent_r1` - if test -n "$tmp" - then - STATIC_NSS_FLAGS="-lc -lnss_files -lnss_dns -lresolv" - STATIC_NSS_FLAGS="$STATIC_NSS_FLAGS $STATIC_NSS_FLAGS" - static_nss=1 - fi -fi - -AC_ARG_WITH(server-suffix, - [ --with-server-suffix Append value to the version string.], - [ MYSQL_SERVER_SUFFIX=`echo "$withval" | sed -e 's/^\(...................................\)..*$/\1/'` ], - [ MYSQL_SERVER_SUFFIX= ] - ) -AC_SUBST(MYSQL_SERVER_SUFFIX) - -# Set flags if we want to force to use pthreads -AC_ARG_WITH(pthread, - [ --with-pthread Force use of pthread library.], - [ with_pthread=$withval ], - [ with_pthread=no ] - ) - -# Force use of thread libs LIBS -AC_ARG_WITH(named-thread-libs, - [ --with-named-thread-libs=ARG - Use specified thread libraries instead of - those automatically found by configure.], - [ with_named_thread=$withval ], - [ with_named_thread=no ] - ) - -# Force use of a curses libs -AC_ARG_WITH(named-curses-libs, - [ --with-named-curses-libs=ARG - Use specified curses libraries instead of - those automatically found by configure.], - [ with_named_curses=$withval ], - [ with_named_curses=no ] - ) - -# Make thread safe client -AC_ARG_ENABLE(thread-safe-client, - [ --disable-thread-safe-client - Compile the client without threads.], - [ THREAD_SAFE_CLIENT=$enableval ], - [ THREAD_SAFE_CLIENT=yes ] - ) - -# compile with strings functions in assembler -AC_ARG_ENABLE(assembler, - [ --enable-assembler Use assembler versions of some string - functions if available.], - [ ENABLE_ASSEMBLER=$enableval ], - [ ENABLE_ASSEMBLER=no ] - ) - -AC_MSG_CHECKING(if we should use assembler functions) -# For now we only support assembler on i386 and sparc systems -AM_CONDITIONAL(ASSEMBLER_x86, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "i386" && $AS strings/strings-x86.s -o checkassembler >/dev/null 2>&1 && test -f checkassembler && (rm -f checkassembler; exit 0;)) -AM_CONDITIONAL(ASSEMBLER_sparc64, test "$ENABLE_ASSEMBLER" = "yes" -a "$BASE_MACHINE_TYPE" = "sparcv9") -AM_CONDITIONAL(ASSEMBLER, test "$ASSEMBLER_x86_TRUE" = "") - -if test "$ASSEMBLER_TRUE" = "" -then - AC_MSG_RESULT([yes]) -else - AC_MSG_RESULT([no]) -fi - -# Add query profiler -AC_MSG_CHECKING(if SHOW PROFILE should be enabled.) -AC_ARG_ENABLE(profiling, - AS_HELP_STRING([--enable-profiling], [Enable profiling of query lifetime.]), - [ ENABLED_PROFILING=$enableval ], - [ ENABLED_PROFILING=no ]) - -AC_DEFINE([ENABLED_PROFILING], [1], [If SHOW PROFILE should be enabled]) -if test "$ENABLED_PROFILING" = "yes" -then - AC_MSG_RESULT([yes]) -else - AC_MSG_RESULT([no]) -fi - -# Use this to set the place used for unix socket used to local communication. -AC_ARG_WITH(unix-socket-path, - [ --with-unix-socket-path=SOCKET - Where to put the unix-domain socket. SOCKET must be - an absolute file name.], - [ MYSQL_UNIX_ADDR=$withval ], - [ MYSQL_UNIX_ADDR=$MYSQL_UNIX_ADDR_DEFAULT ] - ) -AC_SUBST(MYSQL_UNIX_ADDR) - -AC_ARG_WITH(tcp-port, - [ --with-tcp-port=port-number - Which port to use for MySQL services (default 3306)], - [ MYSQL_TCP_PORT=$withval ], - [ MYSQL_TCP_PORT=$MYSQL_TCP_PORT_DEFAULT - # if we actually defaulted (as opposed to the pathological case of - # --with-tcp-port= which might in theory - # happen if whole batch of servers was built from a script), set - # the default to zero to indicate that; we don't lose information - # that way, because 0 obviously indicates that we can get the - # default value from MYSQL_TCP_PORT. this seems really evil, but - # testing for MYSQL_TCP_PORT==MYSQL_TCP_PORT_DEFAULT would make a - # a port of MYSQL_TCP_PORT_DEFAULT magic even if the builder did not - # intend it to mean "use the default, in fact, look up a good default - # from /etc/services if you can", but really, really meant 3306 when - # they passed in 3306. When they pass in a specific value, let them - # have it; don't second guess user and think we know better, this will - # just make people cross. this makes the the logic work like this - # (which is complicated enough): - # - # - if a port was set during build, use that as a default. - # - # - otherwise, try to look up a port in /etc/services; if that fails, - # use MYSQL_TCP_PORT_DEFAULT (at the time of this writing 3306) - # - # - allow the MYSQL_TCP_PORT environment variable to override that. - # - # - allow command-line parameters to override all of the above. - # - # the top-most MYSQL_TCP_PORT_DEFAULT is read from win/configure.js, - # so don't mess with that. - MYSQL_TCP_PORT_DEFAULT=0 ] - ) -AC_SUBST(MYSQL_TCP_PORT) -# We might want to document the assigned port in the manual. -AC_SUBST(MYSQL_TCP_PORT_DEFAULT) - -# Use this to set the place used for unix socket used to local communication. -AC_ARG_WITH(mysqld-user, - [ --with-mysqld-user=username - What user the mysqld daemon shall be run as.], - [ MYSQLD_USER=$withval ], - [ MYSQLD_USER=mysql ] - ) -AC_SUBST(MYSQLD_USER) - -# If we should allow LOAD DATA LOCAL -AC_MSG_CHECKING(If we should should enable LOAD DATA LOCAL by default) -AC_ARG_ENABLE(local-infile, - [ --enable-local-infile Enable LOAD DATA LOCAL INFILE (default: disabled)], - [ ENABLED_LOCAL_INFILE=$enableval ], - [ ENABLED_LOCAL_INFILE=no ] - ) -if test "$ENABLED_LOCAL_INFILE" = "yes" -then - AC_MSG_RESULT([yes]) - AC_DEFINE([ENABLED_LOCAL_INFILE], [1], - [If LOAD DATA LOCAL INFILE should be enabled by default]) -else - AC_MSG_RESULT([no]) -fi - -# If we should allow init-file, skip-grant-table and bootstrap options -AC_MSG_CHECKING(If we should should enable init-file, skip-grant-table options and bootstrap) -AC_ARG_ENABLE(grant-options, - [ --disable-grant-options Disables the use of --init-file, --skip-grant-tables and --bootstrap options], - [ mysql_grant_options_enabled=$enableval ], - [ mysql_grant_options_enabled=yes ] - ) -if test "$mysql_grant_options_enabled" = "yes" -then - AC_MSG_RESULT([yes]) -else - AC_DEFINE([DISABLE_GRANT_OPTIONS], [1], - [Disables the use of --init-file, --skip-grant-tables and --bootstrap options]) - AC_MSG_RESULT([no]) -fi - -MYSQL_SYS_LARGEFILE - -# Types that must be checked AFTER large file support is checked -AC_TYPE_SIZE_T - -#-------------------------------------------------------------------- -# Check for system header files -#-------------------------------------------------------------------- - -AC_HEADER_DIRENT -AC_HEADER_STDC -AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS(fcntl.h fenv.h float.h floatingpoint.h fpu_control.h \ - ieeefp.h limits.h memory.h pwd.h select.h poll.h \ - stdlib.h stddef.h \ - strings.h string.h synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h \ - sys/timeb.h sys/types.h sys/un.h sys/vadvise.h sys/wait.h term.h \ - unistd.h utime.h sys/utime.h termio.h termios.h sched.h crypt.h alloca.h \ - sys/ioctl.h malloc.h sys/malloc.h sys/ipc.h sys/shm.h linux/config.h \ - sys/prctl.h sys/resource.h sys/param.h port.h ieeefp.h \ - execinfo.h) - -AC_CHECK_HEADERS([xfs/xfs.h]) - -#-------------------------------------------------------------------- -# Check for system libraries. Adds the library to $LIBS -# and defines HAVE_LIBM etc -#-------------------------------------------------------------------- - -AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity)) - -AC_CHECK_LIB(nsl_r, gethostbyname_r, [], - AC_CHECK_LIB(nsl, gethostbyname_r)) -AC_CHECK_FUNC(gethostbyname_r) - -AC_SEARCH_LIBS(setsockopt, socket) -# This may get things to compile even if bind-8 is installed -AC_SEARCH_LIBS(bind, bind) -# Check if crypt() exists in libc or libcrypt, sets LIBS if needed -AC_SEARCH_LIBS(crypt, crypt, AC_DEFINE(HAVE_CRYPT, 1, [crypt])) -# See if we need a library for address lookup. -AC_SEARCH_LIBS(inet_aton, [socket nsl resolv]) - -# For the sched_yield() function on Solaris -AC_SEARCH_LIBS(sched_yield, posix4, - AC_DEFINE(HAVE_SCHED_YIELD, 1, [sched_yield])) - -MYSQL_CHECK_ZLIB_WITH_COMPRESS - -# For large pages support -if test "$TARGET_LINUX" = "true" -then - # For SHM_HUGETLB on Linux - AC_CHECK_DECLS(SHM_HUGETLB, - AC_DEFINE([HAVE_LARGE_PAGES], [1], - [Define if you have large pages support]) - AC_DEFINE([HAVE_LARGE_PAGE_OPTION], [1], - [Define if you have large page option]) - AC_DEFINE([HUGETLB_USE_PROC_MEMINFO], [1], - [Define if /proc/meminfo shows the huge page size (Linux only)]) - , , - [ -#include - ] - ) -else -# For large pages support on Solaris -AC_CHECK_DECLS(MHA_MAPSIZE_VA, - AC_DEFINE([HAVE_SOLARIS_LARGE_PAGES], [1], - [Define to 1 if you have large pages support]) - AC_DEFINE([HAVE_LARGE_PAGE_OPTION], [1], - [Define if you have large page option]) - , , - [ -#include - ] -) -fi - -dnl Use of ALARMs to wakeup on timeout on sockets -dnl -dnl This feature makes use of a mutex and is a scalability hog we -dnl try to avoid using. However we need support for SO_SNDTIMEO and -dnl SO_RCVTIMEO socket options for this to work. So we will check -dnl if this feature is supported by a simple AC_RUN_IFELSE macro. However -dnl on some OS's there is support for setting those variables but -dnl they are silently ignored. For those OS's we will not attempt -dnl o use SO_SNDTIMEO and SO_RCVTIMEO even if it is said to work. -dnl See Bug#29093 for the problem with SO_SND/RCVTIMEO on HP/UX. -dnl To use alarm is simple, simply avoid setting anything. - - -AC_CACHE_CHECK([whether SO_SNDTIMEO and SO_RCVTIMEO work], - [mysql_cv_socket_timeout], - [AC_RUN_IFELSE( - [AC_LANG_PROGRAM([[ - #include - #include - #include - ]],[[ - int fd = socket(AF_INET, SOCK_STREAM, 0); - struct timeval tv; - int ret= 0; - tv.tv_sec= 2; - tv.tv_usec= 0; - ret|= setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv)); - ret|= setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv)); - return !!ret; - ]])], - [mysql_cv_socket_timeout=yes], - [mysql_cv_socket_timeout=no], - [mysql_cv_socket_timeout=no - AC_MSG_WARN([Socket timeout options disabled due to cross-compiling])]) - ]) - -use_alarm=yes - -if test "$mysql_cv_socket_timeout" = yes; then - case $SYSTEM_TYPE in - dnl We trust the result from the following systems - *solaris*) use_alarm=no ;; - *freebsd*) use_alarm=no ;; - *darwin*) use_alarm=no ;; - *) - dnl We trust the result from Linux also - if test "$TARGET_LINUX" = "true"; then - use_alarm=no - fi - dnl We trust no one else for the moment - dnl (Windows is hardcoded to not use alarms) - ;; - esac -fi - -AC_ARG_WITH(alarm, - AS_HELP_STRING([--with-alarm], [Use alarm to implement socket timeout.]), - [use_alarm=$withval], []) - -AC_MSG_CHECKING(whether to use alarms to implement socket timeout) -if test "$use_alarm" = no ; then - AC_DEFINE([NO_ALARM], [1], [No need to use alarm for socket timeout]) - AC_DEFINE([SIGNAL_WITH_VIO_CLOSE], [1], [Need to use vio close for kill connection]) -fi -AC_MSG_RESULT($use_alarm) - -#-------------------------------------------------------------------- -# Check for IPv6 support -#-------------------------------------------------------------------- - -AC_CHECK_HEADERS(netinet/in6.h) - -AC_CHECK_TYPES([struct sockaddr_in6, struct in6_addr], - [have_in6_types=yes], - [have_in6_types=no], - [[ - #ifdef WIN32 - #include - #else - #include - #include - #include - #endif - - #ifdef HAVE_NETINET_IN6_H - #include - #endif - ]]) - -AC_MSG_CHECKING([for IPv6 support]) - -AC_ARG_ENABLE(ipv6, - AS_HELP_STRING([--disable-ipv6], [Disable support for IPv6 networking]), - [disable_ipv6=yes], [disable_ipv6=no]) - -if test x"$disable_ipv6" = xyes -o x"$have_in6_types" = xno; then - AC_MSG_RESULT([no]) -else - AC_DEFINE([HAVE_IPV6], [1], [Define if IPv6 networking support is present]) - AC_MSG_RESULT([yes]) -fi - -#-------------------------------------------------------------------------- -# Check if struct sockaddr_in::sin_len is available -#-------------------------------------------------------------------------- - -AC_CACHE_CHECK( - [if sockaddr_in::sin_len is available], - mysql_cv_have_sockaddr_in_sin_len, - AC_TRY_COMPILE( - [ - #ifdef WIN32 - #include - #else - #include - #include - #include - #endif - ], - [unsigned int i = sizeof(((struct sockaddr_in *) 0)->sin_len)], - mysql_cv_have_sockaddr_in_sin_len=yes, - mysql_cv_have_sockaddr_in_sin_len=no)) - -if test "$mysql_cv_have_sockaddr_in_sin_len" = "yes"; then - AC_DEFINE( - [HAVE_SOCKADDR_IN_SIN_LEN], - [1], - [If sockaddr_in::sin_len is available]) -fi - -#-------------------------------------------------------------------------- -# Check if struct sockaddr_in6::sin6_len is available -#-------------------------------------------------------------------------- - -AC_CACHE_CHECK( - [if sockaddr_in6::sin6_len is available], - mysql_cv_have_sockaddr_in6_sin6_len, - AC_TRY_COMPILE( - [ - #ifdef WIN32 - #include - #else - #include - #include - #include - #endif - - #ifdef HAVE_NETINET_IN6_H - #include - #endif - ], - [unsigned int i = sizeof(((struct sockaddr_in6 *) 0)->sin6_len)], - mysql_cv_have_sockaddr_in6_sin6_len=yes, - mysql_cv_have_sockaddr_in6_sin6_len=no)) - -if test "$mysql_cv_have_sockaddr_in_sin6_len" = "yes"; then - AC_DEFINE( - [HAVE_SOCKADDR_IN6_SIN6_LEN], - [1], - [If sockaddr_in6::sin6_len is available]) -fi - -#-------------------------------------------------------------------- -# Check for TCP wrapper support -#-------------------------------------------------------------------- - -AC_ARG_WITH(libwrap, -[ --with-libwrap[=DIR] Compile in libwrap (tcp_wrappers) support],[ - case "$with_libwrap" in - no) : ;; - yes|*) - _cppflags=${CPPFLAGS} - _ldflags=${LDFLAGS} - - if test "$with_libwrap" != "yes"; then - CPPFLAGS="${CPPFLAGS} -I$with_libwrap/include" - LDFLAGS="${LDFLAGS} -L$with_libwrap/lib" - fi - - _libs=${LIBS} - AC_CHECK_HEADER(tcpd.h, - LIBS="-lwrap $LIBS" - AC_MSG_CHECKING(for TCP wrappers library -lwrap) - AC_TRY_LINK([#include -int allow_severity = 0; -int deny_severity = 0; - -struct request_info *req; -],[hosts_access (req)], - AC_MSG_RESULT(yes) - AC_DEFINE([LIBWRAP], [1], [Define if you have -lwrap]) - AC_DEFINE([HAVE_LIBWRAP], [1], [Define if have -lwrap]) - if test "$with_libwrap" != "yes"; then - WRAPLIBS="-L${with_libwrap}/lib" - fi - WRAPLIBS="${WRAPLIBS} -lwrap", - AC_MSG_RESULT(no) - CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}), - CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}) - LDFLAGS=${_ldflags} LIBS=${_libs} - ;; - esac -]) -AC_SUBST(WRAPLIBS) - -# Check for gtty if termio.h doesn't exists -if test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no" -then - AC_SEARCH_LIBS(gtty, compat) -fi - -# We make a special variable for non-threaded version of LIBS to avoid -# including thread libs into non-threaded version of MySQL client library. -# Later in this script LIBS will be augmented with a threads library. -NON_THREADED_LIBS="$LIBS" - -AC_CHECK_TYPES([int8, uint8, int16, uint16, int32, uint32, int64, uint64, - uchar, uint, ulong],[],[], [ -#include -]) -AC_CHECK_TYPES([fp_except], [], [], [ -#include -#include -]) - -# -# Some system specific hacks -# - -MAX_C_OPTIMIZE="-O3" -MAX_CXX_OPTIMIZE="-O3" - -case $SYSTEM_TYPE in - *solaris2.7*) - # Solaris 2.7 has a broken /usr/include/widec.h - # Make a fixed copy in ./include - AC_MSG_WARN([Fixing broken include files for $SYSTEM_TYPE]) - echo " - Creating local copy of widec.h" - if test ! -d include - then - mkdir ./include - fi - builddir=`pwd` - sed -e "s|^#if[ ]*!defined(lint) && !defined(__lint)|#if !defined\(lint\) \&\& !defined\(__lint\) \&\& !defined\(getwc\)|" < /usr/include/widec.h > include/widec.h - CFLAGS="$CFLAGS -DHAVE_CURSES_H -I$builddir/include -DHAVE_RWLOCK_T" - CXXFLAGS="$CXXFLAGS -DHAVE_CURSES_H -I$builddir/include -DHAVE_RWLOCK_T" - ;; - *solaris2.8*) - # Solaris 2.8 has a broken /usr/include/widec.h - # Make a fixed copy in ./include - AC_MSG_WARN([Fixing broken include files for $SYSTEM_TYPE]) - echo " - Creating local copy of widec.h" - if test ! -d include - then - mkdir ./include - fi - builddir=`pwd` - sed -e "s|^#if[ ]*!defined(__lint)|#if !defined\(__lint\) \&\& !defined\(getwc\)|" < /usr/include/widec.h > include/widec.h - CFLAGS="$CFLAGS -DHAVE_CURSES_H -I$builddir/include -DHAVE_RWLOCK_T" - CXXFLAGS="$CXXFLAGS -DHAVE_CURSES_H -I$builddir/include -DHAVE_RWLOCK_T" - ;; - *solaris2.5.1*) - AC_MSG_WARN([Enabling getpass() workaround for Solaris 2.5.1]) - CFLAGS="$CFLAGS -DHAVE_BROKEN_GETPASS -DSOLARIS -DHAVE_RWLOCK_T"; - CXXFLAGS="$CXXFLAGS -DHAVE_RWLOCK_T -DSOLARIS" - ;; - *solaris*) - CFLAGS="$CFLAGS -DHAVE_RWLOCK_T" - CXXFLAGS="$CXXFLAGS -DHAVE_RWLOCK_T" - ;; - *SunOS*) - AC_MSG_WARN([Enabling getpass() workaround for SunOS]) - CFLAGS="$CFLAGS -DHAVE_BROKEN_GETPASS -DSOLARIS"; - ;; - *hpux10.20*) - AC_MSG_WARN([Enabling workarounds for hpux 10.20]) - CFLAGS="$CFLAGS -DHAVE_BROKEN_SNPRINTF -DSIGNALS_DONT_BREAK_READ -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHPUX10 -DSIGNAL_WITH_VIO_CLOSE -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT -DHAVE_POSIX1003_4a_MUTEX" - CXXFLAGS="$CXXFLAGS -DHAVE_BROKEN_SNPRINTF -D_INCLUDE_LONGLONG -DSIGNALS_DONT_BREAK_READ -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHPUX10 -DSIGNAL_WITH_VIO_CLOSE -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT -DHAVE_POSIX1003_4a_MUTEX" - if test "$with_named_thread" = "no" - then - AC_MSG_WARN([Using --with-named-thread=-lpthread]) - with_named_thread="-lcma" - fi - ;; - *hpux11.*) - AC_MSG_WARN([Enabling workarounds for hpux 11]) - CFLAGS="$CFLAGS -DHPUX11 -DSNPRINTF_RETURN_TRUNC -DHAVE_BROKEN_PREAD -DHAVE_BROKEN_GETPASS -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT" - CXXFLAGS="$CXXFLAGS -DHPUX11 -DSNPRINTF_RETURN_TRUNC -DHAVE_BROKEN_PREAD -D_INCLUDE_LONGLONG -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT" - if test "$with_named_thread" = "no" - then - AC_MSG_WARN([Using --with-named-thread=-lpthread]) - with_named_thread="-lpthread" - fi - # Fixes for HPUX 11.0 compiler - if test "$ac_cv_prog_gcc" = "no" - then -# set working flags first in line, letting override it (i. e. for debug): - CXXFLAGS="+O2 $CXXFLAGS" - MAX_C_OPTIMIZE="" - MAX_CXX_OPTIMIZE="" - ndb_cxxflags_fix="$ndb_cxxflags_fix -Aa" - fi - ;; - *rhapsody*) - if test "$ac_cv_prog_gcc" = "yes" - then - CPPFLAGS="$CPPFLAGS -traditional-cpp " - CFLAGS="-DHAVE_CTHREADS_WRAPPER -DDO_NOT_REMOVE_THREAD_WRAPPERS" - CXXFLAGS="-DHAVE_CTHREADS_WRAPPER" - if test $with_named_curses = "no" - then - with_named_curses="" - fi - fi - ;; - *darwin5*) - if test "$ac_cv_prog_gcc" = "yes" - then - FLAGS="-traditional-cpp -DHAVE_DARWIN5_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DHAVE_BROKEN_REALPATH" - CFLAGS="$CFLAGS $FLAGS" - CXXFLAGS="$CXXFLAGS $FLAGS" - MAX_C_OPTIMIZE="-O" - with_named_curses="" - fi - ;; - *darwin6*) - if test "$ac_cv_prog_gcc" = "yes" - then - FLAGS="-D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DHAVE_BROKEN_REALPATH -DDONT_DECLARE_CXA_PURE_VIRTUAL " - CFLAGS="$CFLAGS $FLAGS" - CXXFLAGS="$CXXFLAGS $FLAGS" - MAX_C_OPTIMIZE="-O" - fi - ;; - *darwin*) - if test "$ac_cv_prog_gcc" = "yes" - then - FLAGS="-D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL" - CFLAGS="$CFLAGS $FLAGS" - CXXFLAGS="$CXXFLAGS $FLAGS" - MAX_C_OPTIMIZE="-O" - fi - ;; - *freebsd*|*dragonfly*) - dnl These dependencies have not really been checked for some time - OSVERSION=`sysctl -a | grep osreldate | awk '{ print $2 }'` - if test "$OSVERSION" -gt "600000" - then - # Post user-level threads, MYSQLD_NET_RETRY_COUNT is not needed any more - : - elif test "$OSVERSION" -gt "480100" && \ - test "$OSVERSION" -lt "500000" || \ - test "$OSVERSION" -gt "500109" - then - AC_MSG_WARN([Adding fix for interrupted reads]) - CXXFLAGS="$CXXFLAGS -DMYSQLD_NET_RETRY_COUNT=1000000" - else - AC_MSG_WARN([Adding fix for interrupted reads and broken realpath]) - CFLAGS="$CFLAGS -DHAVE_BROKEN_REALPATH" - CXXFLAGS="$CXXFLAGS -DMYSQLD_NET_RETRY_COUNT=1000000 -DHAVE_BROKEN_REALPATH" - fi - ;; - *netbsd*) - AC_MSG_WARN([Adding flag -Dunix]) - CFLAGS="$CFLAGS -Dunix" - CXXFLAGS="$CXXFLAGS -Dunix" - OVERRIDE_MT_LD_ADD="\$(top_srcdir)/mit-pthreads/obj/libpthread.a" - ;; - *bsdi*) - AC_MSG_WARN([Adding fix for BSDI]) - CFLAGS="$CFLAGS -D__BSD__ -DHAVE_BROKEN_REALPATH" - AC_DEFINE_UNQUOTED([SOCKOPT_OPTLEN_TYPE], [size_t], - [Last argument to get/setsockopt]) - ;; - *sgi-irix6*) - if test "$with_named_thread" = "no" - then - AC_MSG_WARN([Using --with-named-thread=-lpthread]) - with_named_thread="-lpthread" - fi - CXXFLAGS="$CXXFLAGS -D_BOOL" - ;; - *aix4.3*) - AC_MSG_WARN([Adding defines for AIX]) - CFLAGS="$CFLAGS -Wa,-many -DUNDEF_HAVE_INITGROUPS -DSIGNALS_DONT_BREAK_READ" - CXXFLAGS="$CXXFLAGS -Wa,-many -DUNDEF_HAVE_INITGROUPS -DSIGNALS_DONT_BREAK_READ" - ;; -dnl Is this the right match for DEC OSF on alpha? - *dec-osf*) - if test "$ac_cv_prog_gcc" = "yes" && test "$host_cpu" = "alpha" - then - AC_MSG_WARN([Adding defines for DEC OSF on alpha]) - CFLAGS="$CFLAGS -mieee" - CXXFLAGS="$CXXFLAGS -mieee" - fi - AC_MSG_WARN([Adding defines for OSF1]) - # gethostbyname_r is deprecated and doesn't work ok on OSF1 - CFLAGS="$CFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R -DSNPRINTF_RETURN_TRUNC" - CXXFLAGS="$CXXFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R -DSNPRINTF_RETURN_TRUNC" - # fix to handle include of correctly on OSF1 with cxx compiler - CXXFLAGS="$CXXFLAGS -I/usr/include/cxx -I/usr/include/cxx_cname -I/usr/include -I/usr/include.dtk" - ;; -esac - - -#---START: Used in for client configure -# Check if we threads are in libc or if we should use -# -lpthread, -lpthreads or mit-pthreads -# We have to check libc last because else it fails on Solaris 2.6 - -with_posix_threads="no" -# Search thread lib on Linux -if test "$with_named_thread" = "no" -then - AC_MSG_CHECKING("Linux threads") - if test "$TARGET_LINUX" = "true" - then - AC_MSG_RESULT("starting") - # use getconf to check glibc contents - AC_MSG_CHECKING("getconf GNU_LIBPTHREAD_VERSION") - case `getconf GNU_LIBPTHREAD_VERSION | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` in - NPTL* ) - AC_MSG_RESULT("NPTL") - AC_DEFINE([HAVE_NPTL], [1], [NPTL threads implementation]) - with_named_thread="-lpthread" - ;; - LINUXTHREADS* ) - AC_MSG_RESULT("Linuxthreads") - AC_DEFINE([HAVE_LINUXTHREADS], [1], - [Whether we are using Xavier Leroy's LinuxThreads]) - with_named_thread="-lpthread" - ;; - * ) - AC_MSG_RESULT("unknown") - ;; - esac - if test "$with_named_thread" = "no" - then - # old method, check headers - # Look for LinuxThreads. - AC_MSG_CHECKING("LinuxThreads in header file comment") - res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l` - if test "$res" -gt 0 - then - AC_MSG_RESULT("Found") - AC_DEFINE([HAVE_LINUXTHREADS], [1], - [Whether we are using Xavier Leroy's LinuxThreads]) - # Linux 2.0 sanity check - AC_TRY_COMPILE([#include ], [int a = sched_get_priority_min(1);], , - AC_MSG_ERROR([Syntax error in sched.h. Change _P to __P in the /usr/include/sched.h file. See the Installation chapter in the Reference Manual])) - # RedHat 5.0 does not work with dynamic linking of this. -static also - # gives a speed increase in linux so it does not hurt on other systems. - with_named_thread="-lpthread" - else - AC_MSG_RESULT("Not found") - # If this is a linux machine we should barf - AC_MSG_ERROR([This is a Linux system without a working getconf, -and Linuxthreads was not found. Please install it (or a new glibc) and try again. -See the Installation chapter in the Reference Manual for more information.]) - fi - else - AC_MSG_RESULT("no need to check headers") - fi - - AC_MSG_CHECKING("for pthread_create in -lpthread") - ac_save_LIBS="$LIBS" - LIBS="$LIBS -lpthread" - AC_TRY_LINK( [#include ], - [ (void) pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ], - AC_MSG_RESULT("yes"), - [ AC_MSG_RESULT("no") - AC_MSG_ERROR([ -This is a Linux system claiming to support threads, either Linuxthreads or NPTL, but linking a test program failed. -Please install one of these (or a new glibc) and try again. -See the Installation chapter in the Reference Manual for more information.]) ] - ) - LIBS="$ac_save_LIBS" - else - AC_MSG_RESULT("no") - fi # "$TARGET_LINUX" -fi # "$with_named_thread" = "no" -a "$with_mit_threads" = "no" - - -# Hack for DEC-UNIX (OSF1 -> Tru64) -if test "$with_named_thread" = "no" -a "$with_mit_threads" = "no" -then - AC_MSG_CHECKING("DEC threads post OSF/1 3.2") - if test -f /usr/shlib/libpthread.so -a -f /usr/lib/libmach.a -a -f /usr/ccs/lib/cmplrs/cc/libexc.a - then - with_named_thread="-lpthread -lmach -lexc" - CFLAGS="$CFLAGS -D_REENTRANT" - CXXFLAGS="$CXXFLAGS -D_REENTRANT" - AC_DEFINE(HAVE_DEC_THREADS, [1], [Whether we are using DEC threads]) - AC_MSG_RESULT("yes") - else - AC_MSG_RESULT("no") - fi # DEC threads -fi # "$with_named_thread" = "no" -a "$with_mit_threads" = "no" - - -dnl This is needed because -lsocket has to come after the thread -dnl library on SCO. -AC_DEFUN([MYSQL_REMOVE_SOCKET_FROM_LIBS_HACK], [ - LIBS=`echo " $LIBS " | sed -e 's/ -lsocket / /g'` -]) -# Hack for SCO UNIX -if test "$with_named_thread" = "no" -then - AC_MSG_CHECKING("SCO threads") - if expr "$SYSTEM_TYPE" : ".*sco.*" > /dev/null - then - if test -f /usr/lib/libgthreads.a -o -f /usr/lib/libgthreads.so - then - MYSQL_REMOVE_SOCKET_FROM_LIBS_HACK - with_named_thread="-lgthreads -lsocket -lgthreads" - # sched.h conflicts with fsu-threads - touch ./include/sched.h - touch ./include/semaphore.h - - # We must have gcc - if expr "$CC" : ".*gcc.*" - then - AC_MSG_RESULT("yes") - else - AC_MSG_ERROR([On SCO UNIX MySQL must be compiled with gcc. See the Installation chapter in the Reference Manual.]) - fi - AC_MSG_RESULT("yes") - elif test -f /usr/local/lib/libpthread.a -o -f /usr/local/lib/libpthread.so - then - MYSQL_REMOVE_SOCKET_FROM_LIBS_HACK - with_named_thread="-lpthread -lsocket" - # sched.h conflicts with fsu-threads - # touch ./include/sched.h - - AC_MSG_CHECKING("for gcc") - # We must have gcc - if expr "$CC" : ".*gcc.*" - then - AC_MSG_RESULT("yes") - else - AC_MSG_ERROR([On SCO UNIX MySQL must be compiled with gcc. See the Installation chapter in the Reference Manual.]) - fi - AC_MSG_RESULT("yes") - # Hack for SCO UnixWare 7.1.x - # - elif test "$with_named_thread" = "no" - then - AC_MSG_RESULT("no") - AC_MSG_CHECKING("SCO UnixWare 7.1.x native threads") - if expr "$SYSTEM_TYPE" : ".*sco.*" > /dev/null - then - if test -f /usr/lib/libthread.so -o -f /usr/lib/libthreadT.so - then - MYSQL_REMOVE_SOCKET_FROM_LIBS_HACK - if expr "$CC" : ".*gcc.*" - then - with_named_thread="-pthread -lsocket -lnsl" - else - with_named_thread="-Kthread -lsocket -lnsl" - fi - if expr "$SYSTEM_TYPE" : ".*unixware7.0.0" > /dev/null - then - AC_DEFINE(HAVE_UNIXWARE7_THREADS, [1]) - fi - AC_MSG_RESULT("yes") - # We must have cc - AC_MSG_CHECKING("for gcc") - if expr "$CC" : ".*gcc.*" - then - CC="$CC -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK" - CXX="$CXX -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK" - else - CC="$CC -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK" - CXX="$CXX -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK" - fi - else - AC_MSG_ERROR([configure: error: Can't find thread libs on SCO UnixWare7. See the Installation chapter in the Reference Manual.]) - fi - else - AC_MSG_RESULT("no") - fi - else - AC_MSG_ERROR([On SCO UNIX MySQL requires that the FSUThreads package is installed. See the Installation chapter in the Reference Manual.]) - fi - else - AC_MSG_RESULT("no") - fi -fi - -# -# Check for SCO threading libraries -# -if test "$with_named_thread" = "no" -then - AC_MSG_CHECKING([SCO OpenServer 6, UnixWare 7 or OpenUNIX 8 native threads]) - if expr "$SYSTEM_TYPE" : ".*UnixWare.*" > /dev/null || \ - expr "$SYSTEM_TYPE" : ".*SCO_SV6.*" > /dev/null || \ - expr "$SYSTEM_TYPE" : ".*OpenUNIX.*" > /dev/null - then - if test -f /usr/lib/libthread.so -o -f /usr/lib/libthreadT.so - then - MYSQL_REMOVE_SOCKET_FROM_LIBS_HACK - if expr "$CC" : ".*gcc.*" > /dev/null - then - with_named_thread="-pthread -lsocket -lnsl" - CC="$CC -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"; - CXX="$CXX -pthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"; - else - with_named_thread="-Kthread -lsocket -lnsl" - CC="$CC -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"; - CXX="$CXX -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK"; - fi - if expr "$SYSTEM_TYPE" : ".*unixware7.0.0" > /dev/null - then - AC_DEFINE(HAVE_UNIXWARE7_THREADS, [1], [Have UnixWare 7 (or similar) almost-POSIX threading library]) - fi - AC_MSG_RESULT(yes) - else - AC_MSG_ERROR([configure: error: Can't find thread library on SCO/Caldera system. See the Installation chapter in the Reference Manual.]) - fi - else - AC_MSG_RESULT(no) - fi -fi - -# Hack for Siemens UNIX -if test "$with_named_thread" = "no" -then - AC_MSG_CHECKING("Siemens threads") - if test -f /usr/lib/libxnet.so -a "$SYSTEM_TYPE" = "sni-sysv4" - then - LIBS="-lxnet $LIBS" - NON_THREADED_LIBS="-lxnet $NON_THREADED_LIBS" - with_named_thread="-Kthread $LDFLAGS -lxnet" - LD_FLAGS="" - CFLAGS="-Kthread $CFLAGS" - CXXFLAGS="-Kthread $CXXFLAGS" - AC_MSG_RESULT("yes") - else - AC_MSG_RESULT("no") - fi -fi - -# Use library named -lpthread -if test "$with_named_thread" = "no" -a "$with_pthread" = "yes" -then - with_named_thread="-lpthread" -fi - -#---END: - -# Hack for Solaris >= 2.5 -# We want both the new and the old interface - -if test "$with_named_thread" = "no" -then - AC_MSG_CHECKING("Solaris threads") - if test -f /usr/lib/libpthread.so -a -f /usr/lib/libthread.so - then - with_named_thread="-lpthread -lthread" - AC_MSG_RESULT("yes") - else - AC_MSG_RESULT("no") - fi -fi - -# Should we use named pthread library ? -AC_MSG_CHECKING("named thread libs:") -if test "$with_named_thread" != "no" -then - LIBS="$with_named_thread $LIBS $with_named_thread" - CLIENT_THREAD_LIBS="$with_named_thread" - with_posix_threads="yes" - AC_MSG_RESULT("$with_named_thread") -else - AC_MSG_RESULT("no") - # pthread_create is in standard libraries (As in BSDI 3.0) - AC_MSG_CHECKING("for pthread_create in -libc"); - AC_TRY_LINK( - [#include ], - [ (void) pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ], - with_posix_threads=yes, with_posix_threads=no) - AC_MSG_RESULT("$with_posix_threads") - if test "$with_posix_threads" = "no" - then - AC_MSG_CHECKING("for pthread_create in -lpthread") - ac_save_LIBS="$LIBS" - LIBS="$LIBS -lpthread" - CLIENT_THREAD_LIBS="-lpthread" - AC_TRY_LINK( - [#include ], - [ (void) pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ], - with_posix_threads=yes, with_posix_threads=no) - AC_MSG_RESULT("$with_posix_threads") - if test "$with_posix_threads" = "no" - then - LIBS=" $ac_save_LIBS -lpthreads" - CLIENT_THREAD_LIBS="-lpthreads" - AC_MSG_CHECKING("for pthread_create in -lpthreads") - AC_TRY_LINK( - [#include ], - [ pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ], - with_posix_threads=yes, with_posix_threads=no) - AC_MSG_RESULT("$with_posix_threads") - if test "$with_posix_threads" = "no" - then - # This is for FreeBSD - LIBS="$ac_save_LIBS -pthread" - CLIENT_THREAD_LIBS="-pthread" - AC_MSG_CHECKING("for pthread_create in -pthread") - AC_TRY_LINK( - [#include ], - [ pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ], - with_posix_threads=yes, with_posix_threads=no) - AC_MSG_RESULT("$with_posix_threads") - fi - fi - fi -fi - -#---START: Used in for client configure -# Must be checked after, because strtok_r may be in -lpthread -# On AIX strtok_r is in libc_r - -my_save_LIBS="$LIBS" -AC_CHECK_LIB(pthread,strtok_r) -LIBS="$my_save_LIBS" -if test "$ac_cv_lib_pthread_strtok_r" = "no" -then - AC_CHECK_LIB(c_r,strtok_r) - case "$with_osf32_threads---$target_os" in - # Don't keep -lc_r in LIBS; -pthread handles it magically - yes---* | *---freebsd* | *---hpux*) LIBS="$my_save_LIBS" ;; - - esac - AC_CHECK_FUNCS(strtok_r pthread_init) -else - AC_CHECK_FUNCS(strtok_r) -fi -#---END: - -# dlopen, dlerror -case "$with_mysqld_ldflags " in - - *"-all-static "*) - # No need to check for dlopen when mysqld is linked with - # -all-static as it won't be able to load any functions. - # NOTE! It would be better if it was possible to test if dlopen - # can be used, but a good way to test it couldn't be found - - ;; - - *) - # Check for dlopen, needed for user definable functions and plugins - # This must be checked after threads on AIX - - my_save_LIBS="$LIBS" - LIBS="" - AC_CHECK_LIB(dl,dlopen) - LIBDL=$LIBS - LIBS="$my_save_LIBS" - AC_SUBST(LIBDL) - - my_save_LIBS="$LIBS" - LIBS="$LIBS $LIBDL" - AC_CHECK_FUNCS(dlopen dlerror) - LIBS="$my_save_LIBS" - - ;; -esac - - -# System characteristics -AC_SYS_RESTARTABLE_SYSCALLS - -# Build optimized or debug version ? -# First check for gcc and g++ -if test "$GCC" = "yes" -then - DEBUG_CFLAGS="-g" - DEBUG_OPTIMIZE_CC="-O" - OPTIMIZE_CFLAGS="$MAX_C_OPTIMIZE" -else - DEBUG_CFLAGS="-g" - DEBUG_OPTIMIZE_CC="" - case $SYSTEM_TYPE in - *solaris*) - OPTIMIZE_CFLAGS="-O1" - ;; - *) - OPTIMIZE_CFLAGS="-O" - ;; - esac -fi -if test "$GXX" = "yes" -then - DEBUG_CXXFLAGS="-g" - DEBUG_OPTIMIZE_CXX="-O" - OPTIMIZE_CXXFLAGS="$MAX_CXX_OPTIMIZE" -else - DEBUG_OPTIMIZE_CXX="" - case $SYSTEM_TYPE in - *solaris*) - DEBUG_CXXFLAGS="-g0" - OPTIMIZE_CXXFLAGS="-O1" - ;; - *) - DEBUG_CXXFLAGS="-g" - OPTIMIZE_CXXFLAGS="-O" - ;; - esac -fi - -# If the user specified CFLAGS, we won't add any optimizations -if test -n "$SAVE_CFLAGS" -then - OPTIMIZE_CFLAGS="" - DEBUG_OPTIMIZE_CC="" -fi -# Ditto for CXXFLAGS -if test -n "$SAVE_CXXFLAGS" -then - OPTIMIZE_CXXFLAGS="" - DEBUG_OPTIMIZE_CXX="" -fi - -AC_ARG_WITH(debug, - [AS_HELP_STRING([--with-debug], [Add debug code @<:@default=no@:>@])], - [with_debug=$withval], - [with_debug=no]) -if test "$with_debug" = "yes" -then - AC_DEFINE([DBUG_ON], [1], [Use libdbug]) - CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC -DSAFE_MUTEX $CFLAGS" - CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX -DSAFE_MUTEX $CXXFLAGS" -else - # Optimized version. No debug - AC_DEFINE([DBUG_OFF], [1], [Don't use libdbug]) - CFLAGS="$OPTIMIZE_CFLAGS $CFLAGS" - CXXFLAGS="$OPTIMIZE_CXXFLAGS $CXXFLAGS" -fi - -AC_ARG_WITH([valgrind], - [AS_HELP_STRING([--with-valgrind], - [Valgrind instrumentation @<:@default=no@:>@])], - [], [with_valgrind=no]) - -if test "$with_valgrind" != "no" -then - AC_CHECK_HEADERS([valgrind/valgrind.h valgrind/memcheck.h], - [AC_DEFINE([HAVE_VALGRIND], [1], [Define for Valgrind support])]) -fi - -# Debug Sync Facility. NOTE: depends on 'with_debug'. Must be behind it. -AC_MSG_CHECKING(if Debug Sync Facility should be enabled.) -AC_ARG_ENABLE(debug_sync, - AS_HELP_STRING([--enable-debug-sync], - [Build a version with Debug Sync Facility]), - [ enable_debug_sync=$enableval ], - [ enable_debug_sync=$with_debug ]) - -if test "$enable_debug_sync" != "no" -then - AC_DEFINE([ENABLED_DEBUG_SYNC], [1], - [If Debug Sync Facility should be enabled]) - AC_MSG_RESULT([yes]) -else - AC_MSG_RESULT([no]) -fi - -AC_ARG_WITH([fast-mutexes], - AC_HELP_STRING([--with-fast-mutexes], - [Compile with fast mutexes (default is disabled)]), - [with_fast_mutexes=$withval], [with_fast_mutexes=no]) - -if test "$with_fast_mutexes" != "no" -then - if test "$with_debug" != "no" - then - AC_MSG_WARN(['--with-fast-mutexes' ignored when '--with-debug' is given]) - else - AC_DEFINE([MY_PTHREAD_FASTMUTEX], [1], - [Define to 1 if you want to use fast mutexes]) - fi -fi - -AC_ARG_WITH([atomic-ops], - AS_HELP_STRING([--with-atomic-ops=rwlocks|smp|up], - [Implement atomic operations using pthread rwlocks or atomic CPU - instructions for multi-processor or uniprocessor - configuration. By default gcc built-in sync functions are used, - if available and 'smp' configuration otherwise.])) -case "$with_atomic_ops" in - "up") AC_DEFINE([MY_ATOMIC_MODE_DUMMY], [1], - [Assume single-CPU mode, no concurrency]) ;; - "rwlocks") AC_DEFINE([MY_ATOMIC_MODE_RWLOCKS], [1], - [Use pthread rwlocks for atomic ops]) ;; - "smp") ;; - "") - ;; - *) AC_MSG_ERROR(["$with_atomic_ops" is not a valid value for --with-atomic-ops]) ;; -esac - -AC_CACHE_CHECK([whether the compiler provides atomic builtins], - [mysql_cv_gcc_atomic_builtins], - [AC_RUN_IFELSE( - [AC_LANG_PROGRAM( - [ - ], - [[ - int foo= -10; int bar= 10; - long long int foo64= -10; long long int bar64= 10; - if (!__sync_fetch_and_add(&foo, bar) || foo) - return -1; - bar= __sync_lock_test_and_set(&foo, bar); - if (bar || foo != 10) - return -1; - bar= __sync_val_compare_and_swap(&bar, foo, 15); - if (bar) - return -1; - if (!__sync_fetch_and_add(&foo64, bar64) || foo64) - return -1; - bar64= __sync_lock_test_and_set(&foo64, bar64); - if (bar64 || foo64 != 10) - return -1; - bar64= __sync_val_compare_and_swap(&bar64, foo, 15); - if (bar64) - return -1; - return 0; - ]] - )], - [mysql_cv_gcc_atomic_builtins=yes], - [mysql_cv_gcc_atomic_builtins=no], - [mysql_cv_gcc_atomic_builtins=no] -)]) -if test "x$mysql_cv_gcc_atomic_builtins" = xyes; then - AC_DEFINE(HAVE_GCC_ATOMIC_BUILTINS, 1, - [Define to 1 if compiler provides atomic builtins.]) -fi - -AC_CACHE_CHECK([whether the OS provides atomic_* functions like Solaris], - [mysql_cv_solaris_atomic], - [AC_RUN_IFELSE( - [AC_LANG_PROGRAM( - [[ - #include - ]], - [[ - int foo = -10; int bar = 10; - int64_t foo64 = -10; int64_t bar64 = 10; - if (atomic_add_int_nv((uint_t *)&foo, bar) || foo) - return -1; - bar = atomic_swap_uint((uint_t *)&foo, (uint_t)bar); - if (bar || foo != 10) - return -1; - bar = atomic_cas_uint((uint_t *)&bar, (uint_t)foo, 15); - if (bar) - return -1; - if (atomic_add_64_nv((volatile uint64_t *)&foo64, bar64) || foo64) - return -1; - bar64 = atomic_swap_64((volatile uint64_t *)&foo64, (uint64_t)bar64); - if (bar64 || foo64 != 10) - return -1; - bar64 = atomic_cas_64((volatile uint64_t *)&bar64, (uint_t)foo64, 15); - if (bar64) - return -1; - atomic_or_64((volatile uint64_t *)&bar64, 0); - return 0; - ]] - )], - [mysql_cv_solaris_atomic=yes], - [mysql_cv_solaris_atomic=no], - [mysql_cv_solaris_atomic=no] -)]) -if test "x$mysql_cv_solaris_atomic" = xyes; then - AC_DEFINE(HAVE_SOLARIS_ATOMIC, 1, - [Define to 1 if OS provides atomic_* functions like Solaris.]) -fi - -# Force static compilation to avoid linking problems/get more speed -AC_ARG_WITH(mysqld-ldflags, - [ --with-mysqld-ldflags Extra linking arguments for mysqld], - [MYSQLD_EXTRA_LDFLAGS=$withval], - [MYSQLD_EXTRA_LDFLAGS=]) -AC_SUBST(MYSQLD_EXTRA_LDFLAGS) - -AC_ARG_WITH(client-ldflags, - [ --with-client-ldflags Extra linking arguments for clients], - [CLIENT_EXTRA_LDFLAGS=$withval], - [CLIENT_EXTRA_LDFLAGS=]) -AC_SUBST(CLIENT_EXTRA_LDFLAGS) - -AC_ARG_WITH(mysqld-libs, - [ --with-mysqld-libs Extra libraries to link with for mysqld], - [MYSQLD_EXTRA_LIBS=$withval], - [MYSQLD_EXTRA_LIBS=]) -AC_SUBST(MYSQLD_EXTRA_LIBS) - -AC_ARG_WITH(lib-ccflags, - [ --with-lib-ccflags Extra CC options for libraries], - [LIB_EXTRA_CCFLAGS=$withval], - [LIB_EXTRA_CCFLAGS=]) -AC_SUBST(LIB_EXTRA_CCFLAGS) - -# Avoid stupid bug on some OS -AC_ARG_WITH(low-memory, - [ --with-low-memory Try to use less memory to compile to avoid - memory limitations.], - [with_lowmem=$withval], - [with_lowmem=no]) -if test "$with_lowmem" = "yes" -then - if test "$ac_cv_prog_gcc" = "yes" - then - LM_CFLAGS="-fno-inline" - else - LM_CFLAGS="-O0" - fi -else - LM_CFLAGS="" -fi -AC_SUBST(LM_CFLAGS) - -AC_ARG_WITH(comment, - [ --with-comment Comment about compilation environment.], - [with_comment=$withval], - [with_comment=no]) -if test "$with_comment" != "no" -then - COMPILATION_COMMENT=$with_comment -else - COMPILATION_COMMENT="Source distribution" -fi -AC_SUBST(COMPILATION_COMMENT) - -AC_MSG_CHECKING("need of special linking flags") -if test "$TARGET_LINUX" = "true" -a "$ac_cv_prog_gcc" = "yes" -a "$all_is_static" != "yes" -then - LDFLAGS="$LDFLAGS -rdynamic" - AC_MSG_RESULT("-rdynamic") -else - case "$SYSTEM_TYPE$with_mysqld_ldflags " in - *freebsd*"-all-static "*|*dragonfly*"-all-static "*) - AC_MSG_RESULT("none") - ;; - *freebsd*|*dragonfly*) - MYSQLD_EXTRA_LDFLAGS="$MYSQLD_EXTRA_LDFLAGS -export-dynamic" - AC_MSG_RESULT("-export-dynamic") - ;; - *) - AC_MSG_RESULT("none") - ;; - esac -fi - -dnl Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST -AC_C_INLINE -AS_IF([test "x$ac_cv_c_inline" = "xno"], - [AC_MSG_WARN([The C compiler does not support inline. Beware that unused - functions might not be eliminated the object files.])]) -AC_TYPE_OFF_T -AC_STRUCT_ST_RDEV -AC_HEADER_TIME -AC_STRUCT_TM -MYSQL_NEEDS_MYSYS_NEW -# AC_CHECK_SIZEOF return 0 when it does not find the size of a -# type. We want a error instead. -AC_CHECK_SIZEOF(char, 1) -if test "$ac_cv_sizeof_char" -eq 0 -then - AC_MSG_ERROR([No size for char type. -A likely cause for this could be that there isn't any -static libraries installed. You can verify this by checking if you have libm.a -in /lib, /usr/lib or some other standard place. If this is the problem, -install the static libraries and try again. If this isn't the problem, -examine config.log for possible errors. If you want to report this, use -'scripts/mysqlbug' and include at least the last 20 rows from config.log!]) -fi -AC_CHECK_SIZEOF(char*, 4) -AC_CHECK_SIZEOF(short, 2) -AC_CHECK_SIZEOF(int, 4) -if test "$ac_cv_sizeof_int" -eq 0 -then - AC_MSG_ERROR("No size for int type.") -fi -AC_CHECK_SIZEOF(long, 4) -if test "$ac_cv_sizeof_long" -eq 0 -then - AC_MSG_ERROR("No size for long type.") -fi -AC_CHECK_SIZEOF(long long, 8) -if test "$ac_cv_sizeof_long_long" -eq 0 -then - AC_MSG_ERROR("MySQL needs a long long type.") -fi -# off_t is not a builtin type -AC_CHECK_SIZEOF(off_t, 4) -if test "$ac_cv_sizeof_off_t" -eq 0 -then - AC_MSG_ERROR("MySQL needs a off_t type.") -fi - -dnl -dnl check if time_t is unsigned -dnl - -MYSQL_CHECK_TIME_T - - -# do we need #pragma interface/#pragma implementation ? -# yes if it's gcc 2.x, and not icc pretending to be gcc, and not cygwin -AC_MSG_CHECKING(the need for @%:@pragma interface/implementation) -# instead of trying to match SYSTEM_TYPE and CC_VERSION (that doesn't -# follow any standard), we'll use well-defined preprocessor macros: -AC_TRY_CPP([ -#if !defined(__CYGWIN__) && !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ < 3) -#error USE_PRAGMA_IMPLEMENTATION -#endif -],AC_MSG_RESULT(no) ,AC_MSG_RESULT(yes) ; CXXFLAGS="$CXXFLAGS -DUSE_PRAGMA_IMPLEMENTATION") - -# This always gives a warning. Ignore it unless you are cross compiling -AC_C_BIGENDIAN -#---START: Used in for client configure -# Check base type of last arg to accept -MYSQL_TYPE_ACCEPT -#---END: -# Figure out what type of struct rlimit to use with setrlimit -MYSQL_TYPE_STRUCT_RLIMIT -# Find where the stack goes -MYSQL_STACK_DIRECTION -# We want to skip alloca on irix unconditionally. It may work on some version.. -MYSQL_FUNC_ALLOCA -# Do struct timespec have members tv_sec or ts_sec -MYSQL_TIMESPEC_TS -# Do we have the tzname variable -MYSQL_TZNAME -# Do the c++ compiler have a bool type -MYSQL_CXX_BOOL -# Check some common bugs with gcc 2.8.# on sparc -MYSQL_CHECK_LONGLONG_TO_FLOAT -if test "$ac_cv_conv_longlong_to_float" != "yes" -then - AC_MSG_ERROR([Your compiler cannot convert a longlong value to a float! - If you are using gcc 2.8.# you should upgrade to egcs 1.0.3 - or newer and try again]) -fi -AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include ]) -AC_CHECK_TYPES([size_t], [], [], [#include ]) -AC_CHECK_TYPES([u_int32_t]) - -MYSQL_PTHREAD_YIELD - -###################################################################### -# For readline/libedit (We simply move the mimimum amount of stuff from -# the readline/libedit configure.in here) - -dnl Checks for header files. -AC_CHECK_HEADERS(malloc.h sys/cdefs.h) - -dnl Checks for library functions. -AC_FUNC_ALLOCA -AC_PROG_GCC_TRADITIONAL -AC_TYPE_SIGNAL -AC_CHECK_FUNCS(re_comp regcomp strdup) - -dnl Sun compilers have their own vis.h that is about something -dnl totally different. So, not to change the libedit source, we -dnl do some additional checks before we define HAVE_VIS_H. -AC_CHECK_HEADER(vis.h, - [AC_CHECK_FUNC(strvis, - [AC_DEFINE([HAVE_VIS_H], [1],[Found vis.h and the strvis() function])])]) - -AC_CHECK_FUNCS(strlcat strlcpy) -AC_CHECK_FUNCS(issetugid) -AC_CHECK_FUNCS(fgetln) -AC_CHECK_FUNCS(getline flockfile) - -# from old readline settting: - -MAKE_SHELL=/bin/sh -AC_SUBST(MAKE_SHELL) - -# Already-done: stdlib.h string.h unistd.h termios.h -AC_CHECK_HEADERS(varargs.h stdarg.h dirent.h locale.h ndir.h sys/dir.h \ - sys/file.h sys/ndir.h sys/ptem.h sys/pte.h sys/select.h sys/stream.h \ - sys/mman.h curses.h termcap.h termio.h termbits.h asm/termbits.h grp.h \ -paths.h semaphore.h langinfo.h) - -# Already-done: strcasecmp -AC_CHECK_FUNCS(lstat putenv select setenv setlocale strcoll tcgetattr) -AC_CHECK_FUNCS(nl_langinfo) - -AC_STAT_MACROS_BROKEN -MYSQL_SIGNAL_CHECK -MYSQL_CHECK_GETPW_FUNCS -MYSQL_HAVE_TIOCGWINSZ -MYSQL_HAVE_FIONREAD -MYSQL_HAVE_TIOCSTAT -MYSQL_STRUCT_DIRENT_D_INO -MYSQL_STRUCT_DIRENT_D_NAMLEN -MYSQL_TYPE_SIGHANDLER -MYSQL_CHECK_MULTIBYTE -if test "$with_named_curses" = "no" -then - MYSQL_CHECK_LIB_TERMCAP -else - TERMCAP_LIB="$with_named_curses" -fi -AC_SUBST(TERMCAP_LIB) - -# Check if the termcap function 'tgoto' is already declared in -# system header files or if it need to be declared locally -AC_CHECK_DECLS(tgoto,,,[ -#ifdef HAVE_CURSES_H -# include -#elif HAVE_NCURSES_H -# include -#endif -#ifdef HAVE_TERM_H -# include -#endif -]) - -LIBEDIT_LOBJECTS="" -AC_CHECK_FUNC(strunvis, ,[LIBEDIT_LOBJECTS="$LIBEDIT_LOBJECTS unvis.o"]) -AC_CHECK_FUNC(strvis, ,[LIBEDIT_LOBJECTS="$LIBEDIT_LOBJECTS vis.o"]) -AC_CHECK_FUNC(strlcpy, ,[LIBEDIT_LOBJECTS="$LIBEDIT_LOBJECTS strlcpy.o"]) -AC_CHECK_FUNC(strlcat, ,[LIBEDIT_LOBJECTS="$LIBEDIT_LOBJECTS strlcat.o"]) -AC_CHECK_FUNC(fgetln, ,[LIBEDIT_LOBJECTS="$LIBEDIT_LOBJECTS fgetln.o"]) -AC_SUBST(LIBEDIT_LOBJECTS) -enable_readline="yes" - -# End of readline/libedit stuff -######################################################################### - -dnl Checks for library functions. - -# -# The following code disables intrinsic function support while we test for -# library functions. This is to avoid configure problems with Intel ecc -# compiler - -ORG_CFLAGS="$CFLAGS" -if test "$GCC" != "yes"; then - AC_SYS_COMPILER_FLAG(-nolib_inline,nolib_inline,CFLAGS,[],[]) -fi - -#AC_FUNC_MMAP -AC_TYPE_SIGNAL -MYSQL_TYPE_QSORT -AC_FUNC_UTIME_NULL -AC_FUNC_VPRINTF - -AC_CHECK_FUNCS(alarm bfill bmove bsearch bzero \ - chsize cuserid fchmod fcntl \ - fdatasync fesetround finite fpresetsticky fpsetmask fsync ftruncate \ - getcwd gethostbyaddr_r gethostbyname_r getpass getpassphrase getpwnam \ - getpwuid getrlimit getrusage getwd index initgroups isnan \ - localtime_r gethrtime gmtime_r \ - locking longjmp lrand48 madvise mallinfo memcpy memmove \ - mkstemp mlockall perror poll pread pthread_attr_create mmap mmap64 getpagesize \ - pthread_attr_getstacksize pthread_attr_setstacksize pthread_condattr_create \ - pthread_getsequence_np pthread_key_delete pthread_rwlock_rdlock \ - pthread_sigmask \ - readlink realpath rename rint rwlock_init setupterm \ - shmget shmat shmdt shmctl sigaction sigemptyset sigaddset \ - sighold sigset sigthreadmask port_create sleep thr_yield \ - snprintf socket stpcpy strcasecmp strerror strsignal strnlen strpbrk strstr \ - strtol strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr \ - posix_fallocate backtrace backtrace_symbols backtrace_symbols_fd printstack) - -# -# -# -case "$target" in - *-*-aix4* | *-*-sco*) - # (grr) aix 4.3 has a stub for clock_gettime, (returning ENOSYS) - # and using AC_TRY_RUN is hard when cross-compiling - # We also disable for SCO for the time being, the headers for the - # thread library we use conflicts with other headers. - ;; - *) AC_CHECK_FUNCS(clock_gettime) - ;; -esac - -case "$mysql_cv_sys_os" in - OS400) # i5/OS (OS/400) emits a SIGILL (Function not implemented) when - # unsupported priority values are passed to pthread_setschedprio. - # Since the only supported value is 1, treat it as inexistent. - ;; - SunOS) # Bug#42599 error: `pthread_setschedprio' was not declared in this scope - # In some installations, the pthread.h header used by GCC does not - # declare the pthread_setscheprio prototype, but the function is - # implemented. Since the function is used in C++ code, ensure that - # the function prototype is present. - AC_MSG_CHECKING([whether pthread_setschedprio is declared]) - AC_LANG_PUSH([C++]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([#include ], - [(void)(pthread_setschedprio);])], - [ac_cv_func_pthread_setschedprio=yes], - [ac_cv_func_pthread_setschedprio=no]) - AC_LANG_POP([C++]) - AC_MSG_RESULT([$ac_cv_func_pthread_setschedprio]) - if test "$ac_cv_func_pthread_setschedprio" = yes; then - AC_DEFINE(HAVE_PTHREAD_SETSCHEDPRIO, 1, - [Define to 1 if you have the `pthread_setschedprio' function.]) - fi - ;; - *) AC_CHECK_FUNCS(pthread_setschedprio) - ;; -esac - -# Check that isinf() is available in math.h and can be used in both C and C++ -# code -AC_MSG_CHECKING(for isinf in ) -AC_TRY_LINK([#include ], [float f = 0.0; int r = isinf(f); return r], - AC_MSG_RESULT(yes) - AC_MSG_CHECKING(whether isinf() is safe to use in C code) - AC_TRY_RUN([ -#include -int main() -{ - double a= 10.0; - double b= 1e308; - - return !isinf(a * b); -} -], - [AC_MSG_RESULT(yes)], - [AC_MSG_RESULT(no) - AC_DEFINE([HAVE_BROKEN_ISINF], [1], - [Define to 1 if isinf() uses 80-bit register for intermediate values]) - ], - [ -# Let's be optimistic when cross-compiling, since the only compiler known -# to be affected by this isinf() bug is GCC 4.3 on 32-bit x86. - AC_MSG_RESULT([[cross-compiling, assuming 'yes']]) - ]) - AC_MSG_CHECKING(whether isinf() can be used in C++ code) - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - AC_TRY_LINK([#include ], [float f = 0.0; int r = isinf(f); return r], - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_ISINF, [1], [isinf() macro or function]), - AC_MSG_RESULT(no)) - AC_LANG_RESTORE, - AC_MSG_RESULT(no)) - -CFLAGS="$ORG_CFLAGS" - -# Sanity check: We chould not have any fseeko symbol unless -# large_file_support=yes -AC_CHECK_FUNC(fseeko, -[if test "$large_file_support" = no -a "$TARGET_LINUX" = "true"; -then - AC_MSG_ERROR("Found fseeko symbol but large_file_support is not enabled!") -fi] -) - -# Check definition of gethostbyaddr_r (glibc2 defines this with 8 arguments) -ac_save_CXXFLAGS="$CXXFLAGS" -AC_CACHE_CHECK([style of gethost* routines], mysql_cv_gethost_style, -AC_LANG_SAVE -AC_LANG_CPLUSPLUS - -# Test whether madvise() is declared in C++ code -- it is not on some -# systems, such as Solaris -AC_CHECK_DECLS(madvise, [], [], [#if HAVE_SYS_MMAN_H -#include -#include -#endif]) - -# Do not treat warnings as errors if we are linking against other libc -# this is to work around gcc not being permissive on non-system includes -# with respect to ANSI C++ -# We also remove the -fbranch-probabilities option as this will give warnings -# about not profiled code, which confuses configure -# We also must remove -W and -Wcheck which on icc produces warnings that -# we don't want to catch with -Werror - -if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no" -then - CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-ansi//; s/-pedantic//; s/-Wcheck//'` -fi - -AC_TRY_COMPILE( -[#undef inline -#if !defined(SCO) && !defined(__osf__) && !defined(_REENTRANT) -#define _REENTRANT -#endif -#include -#include -#include -#include -#include -#include ], -[int skr; - struct hostent *foo = gethostbyaddr_r((const char *) 0, - 0, 0, (struct hostent *) 0, (char *) NULL, 0, &skr); return (foo == 0);], -mysql_cv_gethost_style=solaris, mysql_cv_gethost_style=other)) -AC_LANG_RESTORE -CXXFLAGS="$ac_save_CXXFLAGS" -if test "$mysql_cv_gethost_style" = "solaris" -then - AC_DEFINE([HAVE_SOLARIS_STYLE_GETHOST], [1], - [Solaris define gethostbyaddr_r with 7 arguments. glibc2 defines this with 8 arguments]) -fi - -#---START: Used in for client configure - -# Check definition of gethostbyname_r (glibc2.0.100 is different from Solaris) -ac_save_CXXFLAGS="$CXXFLAGS" -AC_CACHE_CHECK([style of gethostbyname_r routines], mysql_cv_gethostbyname_style, -AC_LANG_SAVE -AC_LANG_CPLUSPLUS -if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no" -then - CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-ansi//; s/-pedantic//; s/-Wcheck//'` -fi -AC_TRY_COMPILE( -[#undef inline -#if !defined(SCO) && !defined(__osf__) && !defined(_REENTRANT) -#define _REENTRANT -#endif -#include -#include -#include -#include -#include -#include ], -[int skr; - - skr = gethostbyname_r((const char *) 0, - (struct hostent*) 0, (char*) 0, 0, (struct hostent **) 0, &skr);], -mysql_cv_gethostbyname_style=glibc2, mysql_cv_gethostbyname_style=other)) -AC_LANG_RESTORE -CXXFLAGS="$ac_save_CXXFLAGS" -if test "$mysql_cv_gethostbyname_style" = "glibc2" -then - AC_DEFINE([HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE], [1], - [Solaris define gethostbyname_r with 5 arguments. glibc2 defines this with 6 arguments]) -fi - -# Check 3rd argument of getthostbyname_r -ac_save_CXXFLAGS="$CXXFLAGS" -AC_CACHE_CHECK([3 argument to gethostbyname_r routines], mysql_cv_gethostbyname_arg, -AC_LANG_SAVE -AC_LANG_CPLUSPLUS -if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no" -then - CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-ansi//; s/-pedantic//; s/-Wcheck//'` -fi -AC_TRY_COMPILE( -[#undef inline -#if !defined(SCO) && !defined(__osf__) && !defined(_REENTRANT) -#define _REENTRANT -#endif -#include -#include -#include -#include -#include -#include ], -[int skr; - - skr = gethostbyname_r((const char *) 0, (struct hostent*) 0, (struct hostent_data*) 0);], -mysql_cv_gethostbyname_arg=hostent_data, mysql_cv_gethostbyname_arg=char)) -AC_LANG_RESTORE -CXXFLAGS="$ac_save_CXXFLAGS" -if test "$mysql_cv_gethostbyname_arg" = "hostent_data" -then - AC_DEFINE([HAVE_GETHOSTBYNAME_R_RETURN_INT], [1], - [In OSF 4.0f the 3'd argument to gethostbyname_r is hostent_data *]) -fi - - -# Check definition of pthread_getspecific -AC_CACHE_CHECK("args to pthread_getspecific", mysql_cv_getspecific_args, -AC_TRY_COMPILE( -[#if !defined(SCO) && !defined(__osf__) && !defined(_REENTRANT) -#define _REENTRANT -#endif -#define _POSIX_PTHREAD_SEMANTICS -#include ], -[ void *pthread_getspecific(pthread_key_t key); -pthread_getspecific((pthread_key_t) NULL); ], -mysql_cv_getspecific_args=POSIX, mysql_cv_getspecific_args=other)) - if test "$mysql_cv_getspecific_args" = "other" - then - AC_DEFINE([HAVE_NONPOSIX_PTHREAD_GETSPECIFIC], [1], - [For some non posix threads]) - fi - - # Check definition of pthread_mutex_init - AC_CACHE_CHECK("args to pthread_mutex_init", mysql_cv_mutex_init_args, - AC_TRY_COMPILE( -[#if !defined(SCO) && !defined(__osf__) -#define _REENTRANT -#endif -#define _POSIX_PTHREAD_SEMANTICS -#include ], -[ - pthread_mutexattr_t attr; - pthread_mutex_t mp; - pthread_mutex_init(&mp,&attr); ], -mysql_cv_mutex_init_args=POSIX, mysql_cv_mutex_init_args=other)) - if test "$mysql_cv_mutex_init_args" = "other" - then - AC_DEFINE([HAVE_NONPOSIX_PTHREAD_MUTEX_INIT], [1], - [For some non posix threads]) - fi -#---END: - -#---START: Used in for client configure -# Check definition of readdir_r -AC_CACHE_CHECK("args to readdir_r", mysql_cv_readdir_r, -AC_TRY_LINK( -[#if !defined(SCO) && !defined(__osf__) -#define _REENTRANT -#endif -#define _POSIX_PTHREAD_SEMANTICS -#include -#include ], -[ int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result); -readdir_r((DIR *) NULL, (struct dirent *) NULL, (struct dirent **) NULL); ], -mysql_cv_readdir_r=POSIX, mysql_cv_readdir_r=other)) -if test "$mysql_cv_readdir_r" = "POSIX" -then - AC_DEFINE([HAVE_READDIR_R], [1], [POSIX readdir_r]) -fi - -# Check definition of posix sigwait() -AC_CACHE_CHECK("style of sigwait", mysql_cv_sigwait, -AC_TRY_LINK( -[#if !defined(SCO) && !defined(__osf__) -#define _REENTRANT -#endif -#define _POSIX_PTHREAD_SEMANTICS -#include -#include ], -[#ifndef _AIX -sigset_t set; -int sig; -sigwait(&set,&sig); -#endif], -mysql_cv_sigwait=POSIX, mysql_cv_sigwait=other)) -if test "$mysql_cv_sigwait" = "POSIX" -then - AC_DEFINE([HAVE_SIGWAIT], [1], [POSIX sigwait]) -fi - -if test "$mysql_cv_sigwait" != "POSIX" -then -unset mysql_cv_sigwait -# Check definition of posix sigwait() -AC_CACHE_CHECK("style of sigwait", mysql_cv_sigwait, -AC_TRY_LINK( -[#if !defined(SCO) && !defined(__osf__) -#define _REENTRANT -#endif -#define _POSIX_PTHREAD_SEMANTICS -#include -#include ], -[sigset_t set; -int sig; -sigwait(&set);], -mysql_cv_sigwait=NONPOSIX, mysql_cv_sigwait=other)) -if test "$mysql_cv_sigwait" = "NONPOSIX" -then - AC_DEFINE([HAVE_NONPOSIX_SIGWAIT], [1], [sigwait with one argument]) -fi -fi -#---END: - -#Check for x86 PAUSE instruction -AC_MSG_CHECKING("for x86 PAUSE instruction") -# We have to actually try running the test program, because of a bug -# in Solaris on x86_64, where it wrongly reports that PAUSE is not -# supported when trying to run an application. See -# http://bugs.opensolaris.org/bugdatabase/printableBug.do?bug_id=6478684 -AC_TRY_RUN([ - int main() { - __asm__ __volatile__ ("pause"); - return 0; - } - ], - [x86_pause_exists=yes], - [x86_pause_exists=no], - [x86_pause_exists=no] # Cross-compile, assume no PAUSE instruction -) -AC_TRY_RUN([ - int main() { - __asm__ __volatile__ ("rep; nop"); - return 0; - } - ], - [x86_fake_pause_exists=yes], - [x86_fake_pause_exists=no], - [x86_fake_pause_exists=no] # Cross-compile, assume no x86 NOP instruction -) -if test "$x86_pause_exists" = "yes" -then - AC_DEFINE([HAVE_PAUSE_INSTRUCTION], [1], [Does x86 PAUSE instruction exist]) -else - if test "$x86_fake_pause_exists" = "yes" - then - AC_DEFINE([HAVE_FAKE_PAUSE_INSTRUCTION], [1], [Does x86 NOP instruction exist]) - fi -fi - -# Check if pthread_attr_setscope() exists -AC_CACHE_CHECK("for pthread_attr_setscope", mysql_cv_pthread_attr_setscope, -AC_TRY_LINK( -[#if !defined(SCO) && !defined(__osf__) -#define _REENTRANT -#endif -#define _POSIX_PTHREAD_SEMANTICS -#include ], -[pthread_attr_t thr_attr; -pthread_attr_setscope(&thr_attr,0);], -mysql_cv_pthread_attr_setscope=yes, mysql_cv_pthread_attr_setscope=no)) -if test "$mysql_cv_pthread_attr_setscope" = "yes" -then - AC_DEFINE([HAVE_PTHREAD_ATTR_SETSCOPE], [1], [pthread_attr_setscope]) -fi - -# Check for bad includes -AC_MSG_CHECKING("can netinet files be included") -AC_TRY_COMPILE( -[#include -#include -#include -#include -#include -#include ], -[ printf("1\n"); ], -netinet_inc=yes, netinet_inc=no) -if test "$netinet_inc" = "no" -then - AC_DEFINE([HAVE_BROKEN_NETINET_INCLUDES], [1], [Can netinet be included]) -fi -AC_MSG_RESULT("$netinet_inc") - -AC_CACHE_CHECK([support for weak symbols], mysql_cv_weak_symbol, -[AC_TRY_LINK([],[ - extern void __attribute__((weak)) foo(void); -], [mysql_cv_weak_symbol=yes], [mysql_cv_weak_symbol=no])]) - -if test "x$mysql_cv_weak_symbol" = xyes; then - AC_DEFINE(HAVE_WEAK_SYMBOL, 1, - [Define to 1 if compiler supports weak symbol attribute.]) -fi - -AC_CACHE_CHECK([whether __bss_start is defined], mysql_cv_bss_start, -[AC_TRY_LINK([],[ - extern char *__bss_start; - return __bss_start ? 1 : 0; -], [mysql_cv_bss_start=yes], [mysql_cv_bss_start=no])]) - -if test "x$mysql_cv_bss_start" = xyes; then - AC_DEFINE(HAVE_BSS_START, 1, - [Define to 1 if compiler defines __bss_start.]) -fi - -AC_LANG_SAVE -AC_LANG_CPLUSPLUS -AC_CHECK_HEADERS(cxxabi.h) -AC_CACHE_CHECK([for abi::__cxa_demangle], mysql_cv_cxa_demangle, -[AC_TRY_LINK([#include ], [ - char *foo= 0; int bar= 0; - foo= abi::__cxa_demangle(foo, foo, 0, &bar); -], [mysql_cv_cxa_demangle=yes], [mysql_cv_cxa_demangle=no])]) -AC_LANG_RESTORE - -if test "x$mysql_cv_cxa_demangle" = xyes; then - AC_DEFINE(HAVE_ABI_CXA_DEMANGLE, 1, - [Define to 1 if you have the `abi::__cxa_demangle' function.]) -fi - -#-------------------------------------------------------------------- -# Check for requested features -#-------------------------------------------------------------------- - -MYSQL_CHECK_BIG_TABLES -MYSQL_CHECK_MAX_INDEXES -MYSQL_CHECK_VIO -MYSQL_CHECK_SSL - -#-------------------------------------------------------------------- -# Declare our plugin modules -# Has to be done late, as the plugin may need to check for existence of -# functions tested above -#-------------------------------------------------------------------- - -MYSQL_STORAGE_ENGINE(partition, partition, [Partition Support], - [MySQL Partitioning Support], [max,max-no-ndb]) - -dnl -- ndbcluster requires partition to be enabled - -MYSQL_CONFIGURE_PLUGINS([default]) - -# Only build client code? -AC_ARG_WITH(server, - [ --without-server Only build the client.], - [with_server=$withval], - [with_server=yes] -) - -AC_ARG_WITH(embedded-server, - [ --with-embedded-server Build the embedded server (libmysqld).], - [with_embedded_server=$withval], - [with_embedded_server=no] -) - -AC_ARG_WITH(query_cache, - [ --without-query-cache Do not build query cache.], - [with_query_cache=$withval], - [with_query_cache=yes] -) - -if test "$with_query_cache" = "yes" -then - AC_DEFINE([HAVE_QUERY_CACHE], [1], [If we want to have query cache]) -fi - -AC_ARG_WITH(geometry, - [ --without-geometry Do not build geometry-related parts.], - [with_geometry=$withval], - [with_geometry=yes] -) - -if test "$with_geometry" = "yes" -then - AC_DEFINE([HAVE_SPATIAL], [1], [Spatial extentions]) - AC_DEFINE([HAVE_RTREE_KEYS], [1], [RTree keys]) -fi - -AC_ARG_WITH(embedded_privilege_control, - [ --with-embedded-privilege-control - Build parts to check user's privileges. - Only affects embedded library.], - [with_embedded_privilege_control=$withval], - [with_embedded_privilege_control=no] -) - -if test "$with_embedded_privilege_control" = "yes" -then - AC_DEFINE([HAVE_EMBEDDED_PRIVILEGE_CONTROL], [1], - [Access checks in embedded library]) -fi - -#MYSQL_CHECK_CPU - -libmysqld_dirs= -if test "$with_embedded_server" = "yes" -then - libmysqld_dirs=libmysqld - - # We can't build embedded library without building the server, because - # we depend on libmysys, libmystrings, libmyisam, etc. - with_server=yes -fi -# XXX: We need to add @libmysqld_extra_libs@ (or whatever) so that -# mysql_config --libmysqld-libs will print out something like -# -L/path/to/lib/mysql -lmysqld -lmyisam -lmysys -lmystrings -ldbug ... -AC_SUBST([libmysqld_dirs]) - -# Shall we build the docs? -AC_ARG_WITH(docs, - [ --without-docs Skip building of the documentation.], - [with_docs=$withval], - [with_docs=yes] -) - -if test "$with_docs" = "yes" -then - docs_dirs="Docs" - if test -f "$srcdir/Docs/manual.chm" ; then - extra_docs="manual.chm" - fi -else - docs_dirs="" - extra_docs="" -fi -AC_SUBST(docs_dirs) -AC_SUBST(extra_docs) - -# Shall we build the man pages? -AC_ARG_WITH(man, - [ --without-man Skip building of the man pages.], - [with_man=$withval], - [with_man=yes] -) - -# Don't build readline, i have it already -AC_ARG_WITH(readline, - [ --without-readline Use system readline instead of bundled copy.], - [ with_readline=$withval ], - [ with_readline=undefined ] - ) - -AC_ARG_WITH(libedit, - [ --without-libedit Use system libedit instead of bundled copy.], - [ with_libedit=$withval ], - [ with_libedit=undefined ] - ) - -if test "$with_readline/$with_libedit" = "undefined/undefined" -a ! -e "$srcdir/cmd-line-utils" -then - with_readline=no - with_libedit=no -fi - -# -# We support next variants of compilation: -# --with-readline -# | yes | no | undefined -# --with-libedit | | | -# ---------------+----------------+------+---------------------------------- -# yes | ERROR! | use libedit from mysql sources -# ---------------+----------------+------+---------------------------------- -# no | use readline | use system readline or external libedit -# | from mysql | according to results of m4 tests -# ---------------+ sources (if it + +---------------------------------- -# undefined | is presented) | | use libedit from mysql sources - - -compile_readline="no" -compile_libedit="no" - -if [test "$with_libedit" = "yes"] && [test "$with_readline" = "yes"] -then - AC_MSG_ERROR([You can not use --with-readline and --with-libedit at the same time, please choose one of it]) -fi - -readline_topdir="" -readline_basedir="" -readline_dir="" -readline_h_ln_cmd="" -readline_link="" -want_to_use_readline="no" - -if [test "$with_libedit" = "yes"] || [test "$with_libedit" = "undefined"] && [test "$with_readline" = "undefined"] -then - readline_topdir="cmd-line-utils" - readline_basedir="libedit" - readline_dir="$readline_topdir/$readline_basedir" - readline_link="\$(top_builddir)/cmd-line-utils/libedit/libedit.a" - readline_h_ln_cmd="\$(LN) -s \$(top_srcdir)/cmd-line-utils/libedit/readline readline" - compile_libedit=yes - AC_DEFINE_UNQUOTED(HAVE_HIST_ENTRY, 1) - AC_DEFINE_UNQUOTED(USE_LIBEDIT_INTERFACE, 1) -elif test "$with_readline" = "yes" -then - readline_topdir="cmd-line-utils" - readline_basedir="readline" - readline_dir="$readline_topdir/$readline_basedir" - readline_link="\$(top_builddir)/cmd-line-utils/readline/libreadline.a" - readline_h_ln_cmd="\$(LN) -s \$(top_srcdir)/cmd-line-utils/readline readline" - compile_readline=yes - want_to_use_readline="yes" - AC_DEFINE_UNQUOTED(USE_NEW_READLINE_INTERFACE, 1) -else - # Use system readline library - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - MYSQL_CHECK_LIBEDIT_INTERFACE - MYSQL_CHECK_NEW_RL_INTERFACE - MYSQL_CHECK_READLINE_DECLARES_HIST_ENTRY - AC_LANG_RESTORE - if [test "$mysql_cv_new_rl_interface" = "yes"] && [test -d "$srcdir/cmd-line-utils/readline"] - then - # Use the new readline interface, but only if the package includes a bundled libreadline - # this way we avoid linking commercial source with GPL readline - readline_link="-lreadline" - want_to_use_readline="yes" - elif [test "$mysql_cv_libedit_interface" = "yes"] - then - # Use libedit - readline_link="-ledit" - else - AC_MSG_ERROR([Could not find system readline or libedit libraries - Use --with-readline or --with-libedit to use the bundled - versions of libedit or readline]) - fi -fi - -# if there is no readline, but we want to build with readline, we fail -if [test "$want_to_use_readline" = "yes"] && [test ! -d "$srcdir/cmd-line-utils/readline"] -then - AC_MSG_ERROR([This commercially licensed MySQL source package can't - be built with libreadline. Please use --with-libedit to use - the bundled version of libedit instead.]) -fi - -AC_SUBST(readline_dir) -AC_SUBST(readline_topdir) -AC_SUBST(readline_basedir) -AC_SUBST(readline_link) -AC_SUBST(readline_h_ln_cmd) - - - -# Include man pages, if desired, adapted to the configured parts. -if test X"$with_man" = Xyes -then - # First, create the list of all man pages present. - MANLISTFIL=manlist.$$ - TMPLISTFIL=`echo $MANLISTFIL | sed -e 's/manlist/tmplist/'` - if test -f $MANLISTFIL -o -f $TMPLISTFIL - then - echo "Temp file '$MANLISTFIL' or '$TMPLISTFIL' already exists in '`pwd`' - aborting" - exit 1 - fi - touch $MANLISTFIL $TMPLISTFIL - - ls $srcdir/man/*.[[18]] > $MANLISTFIL - - # Then, remove all those pages from the list which are specific to parts - # (table handlers, features, ...) which are not configured in this run. - AC_MSG_CHECKING("for man pages to remove") - MAN_DROP="dropping" - if test X"$with_plugin_ndbcluster" != Xyes - then - MAN_DROP="$MAN_DROP ndbcluster" - grep -v '/ndb' $MANLISTFIL > $TMPLISTFIL ; mv -f $TMPLISTFIL $MANLISTFIL - fi - if test X"$with_embedded_server" != Xyes - then - MAN_DROP="$MAN_DROP embedded" - grep -v 'embedded' $MANLISTFIL > $TMPLISTFIL ; mv -f $TMPLISTFIL $MANLISTFIL - fi - if test X"$with_plugin_innobase" != Xyes - then - MAN_DROP="$MAN_DROP innodb" - grep -v 'inno' $MANLISTFIL > $TMPLISTFIL ; mv -f $TMPLISTFIL $MANLISTFIL - fi - AC_MSG_RESULT([$MAN_DROP]) - - # Finally, split the man pages into sections 1 and 8. - # Get rid of line breaks. - man1_files=`sed -n -e '/\.1$/s/^.*man\///p' <$MANLISTFIL` - man8_files=`sed -n -e '/\.8$/s/^.*man\///p' <$MANLISTFIL` - - man_dirs="man" - man1_files=`echo $man1_files` - man8_files=`echo $man8_files` - rm -f $MANLISTFIL $TMPLISTFIL -else - man_dirs="" - man1_files="" - man8_files="" -fi -AC_SUBST(man_dirs) -AC_SUBST(man1_files) -AC_SUBST(man8_files) - -# If we have threads generate some library functions and test programs -sql_server_dirs= -sql_server= -server_scripts= - -dnl This probably should be cleaned up more - for now the threaded -dnl client is just using plain-old libs. -sql_client_dirs="strings mysys dbug extra regex libmysql" - -AM_CONDITIONAL(THREAD_SAFE_CLIENT, test "$THREAD_SAFE_CLIENT" != "no") - -if test "$THREAD_SAFE_CLIENT" != "no" -then - sql_client_dirs="$sql_client_dirs libmysql_r" - AC_DEFINE([THREAD_SAFE_CLIENT], [1], [Should the client be thread safe]) -fi -sql_client_dirs="$sql_client_dirs client" - -CLIENT_LIBS="$NON_THREADED_LIBS $openssl_libs $ZLIB_LIBS $STATIC_NSS_FLAGS" - -AC_SUBST(CLIENT_LIBS) -AC_SUBST(CLIENT_THREAD_LIBS) -AC_SUBST(NON_THREADED_LIBS) -AC_SUBST(STATIC_NSS_FLAGS) -AC_SUBST(sql_client_dirs) - -if test "$with_server" != "no" -o "$THREAD_SAFE_CLIENT" != "no" -then - AC_DEFINE([THREAD], [1], - [Define if you want to have threaded code. This may be undef on client code]) - # Avoid _PROGRAMS names - THREAD_LOBJECTS="thr_alarm.o thr_lock.o thr_mutex.o thr_rwlock.o my_pthread.o my_thr_init.o mf_keycache.o" - AC_SUBST(THREAD_LOBJECTS) -fi -AM_CONDITIONAL(NEED_THREAD, test "$with_server" != "no" -o "$THREAD_SAFE_CLIENT" != "no") - -if test "$with_server" != "no" -then - server_scripts="mysqld_safe mysql_install_db" - sql_server_dirs="strings mysys dbug extra regex storage plugin" - - sql_server="vio sql" -fi - -# "innochecksum" is not in the "innobase/" subdirectory, but should be switched -AM_CONDITIONAL([BUILD_INNODB_TOOLS], [test X"$with_plugin_innobase" = Xyes]) - -# IMPORTANT - do not modify LIBS past this line - this hack is the only way -# I know to add the static NSS magic if we have static NSS libraries with -# glibc - Sasha - -LDFLAGS="$LDFLAGS $OTHER_LIBC_LIB" -LIBS="$LIBS $STATIC_NSS_FLAGS" - -AC_SUBST(sql_server_dirs) -AC_SUBST(sql_server) -AC_SUBST(server_scripts) - -AC_SUBST(mysql_plugin_dirs) -AC_SUBST(mysql_plugin_libs) -AC_SUBST(mysql_optional_plugins) -AC_SUBST(mysql_mandatory_plugins) - -# Now that sql_client_dirs and sql_server_dirs are stable, determine the union. -# We support client-only builds by "--without-server", but not vice versa, -# so we start with the client list, then add each server item not yet present. -sql_union_dirs=" $sql_client_dirs " -for DIR in $sql_server_dirs -do - if echo " $sql_union_dirs " | grep " $DIR " >/dev/null - then - : # already present, skip - else - sql_union_dirs="$sql_union_dirs $DIR " - fi -done -AC_SUBST(sql_union_dirs) - -# -# Setup maintainer mode options by the end to not disturb -# system and other checks. -# -MY_MAINTAINER_MODE_SETUP - -# Some usefull subst -AC_SUBST(CC) -AC_SUBST(GXX) - -# Set configuration options for make_binary_distribution -AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS) - -#-------------------------------------------------------------------- -# Support for WL#2373 (Use cycle counter for timing) -#-------------------------------------------------------------------- - -AC_CHECK_HEADERS(time.h) -AC_CHECK_HEADERS(sys/time.h) -AC_CHECK_HEADERS(sys/times.h) -AC_CHECK_HEADERS(asm/msr.h) -#msr.h has rdtscll() - -AC_CHECK_HEADERS(ia64intrin.h) - -AC_CHECK_FUNCS(times) -AC_CHECK_FUNCS(gettimeofday) -AC_CHECK_FUNCS(read_real_time) -# This should work on AIX. - -AC_CHECK_FUNCS(ftime) -# This is still a normal call for milliseconds. - -AC_CHECK_FUNCS(time) -# We can use time() on Macintosh if there is no ftime(). - -AC_CHECK_FUNCS(rdtscll) -# I doubt that we'll ever reach the check for this. - -# When compiling with Sun Studio C / C++ we need to include -# my_timer_cycles.il, an "inline templates" separate file, -# on the command line. It has assembly code, "rd %tick" for -# SPARC or "rdtsc" for x86. -RDTSC_SPARC_ASSEMBLY="" -case $CC_VERSION in - *Sun*C*) - RDTSC_SPARC_ASSEMBLY="my_timer_cycles.il" - ;; -esac -case $CXX_VERSION in - *Sun*C++*) - RDTSC_SPARC_ASSEMBLY="my_timer_cycles.il" - ;; -esac - -AC_SUBST([RDTSC_SPARC_ASSEMBLY]) - - -#-------------------------------------------------------------------- -# Output results -#-------------------------------------------------------------------- - -if test -d "$srcdir/cmd-line-utils/readline" ; then - AC_CONFIG_FILES(cmd-line-utils/readline/Makefile) -fi - -AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl - unittest/Makefile unittest/mytap/Makefile unittest/mytap/t/Makefile dnl - unittest/mysys/Makefile unittest/strings/Makefile dnl - unittest/examples/Makefile dnl - strings/Makefile regex/Makefile storage/Makefile dnl - man/Makefile BUILD/Makefile vio/Makefile dnl - libmysql/Makefile libmysql_r/Makefile client/Makefile dnl - sql/Makefile sql/share/Makefile dnl - sql/sql_builtin.cc sql-common/Makefile libservices/Makefile dnl - dbug/Makefile scripts/Makefile include/Makefile dnl - tests/Makefile Docs/Makefile support-files/Makefile dnl - support-files/MacOSX/Makefile support-files/RHEL4-SElinux/Makefile dnl - cmd-line-utils/Makefile cmd-line-utils/libedit/Makefile dnl - libmysqld/Makefile libmysqld/examples/Makefile dnl - mysql-test/Makefile mysql-test/lib/My/SafeProcess/Makefile dnl - sql-bench/Makefile include/mysql_version.h plugin/Makefile win/Makefile dnl - cmake/Makefile packaging/Makefile - ) - -AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h) - -# Ensure that table handlers gets all modifications to CFLAGS/CXXFLAGS -AC_CONFIG_COMMANDS_POST(ac_configure_args="$ac_configure_args CFLAGS='$CFLAGS' CXXFLAGS='$CXXFLAGS'") - -AC_OUTPUT - -# The first line "Thank you ..." is checked in ./Do-compile to verify that configure -# ended sucessfully - don't remove it. -echo -echo "Thank you for choosing MySQL!" -echo -echo "Remember to check the platform specific part of the reference manual" -echo "for hints about installing MySQL on your platform." -echo "Also have a look at the files in the Docs directory." -echo diff --git a/dbug/Makefile.am b/dbug/Makefile.am deleted file mode 100644 index 3581b3597ee..00000000000 --- a/dbug/Makefile.am +++ /dev/null @@ -1,68 +0,0 @@ -# Copyright (C) 2000, 2002, 2004-2006 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 - -INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -LDADD = libdbug.a ../mysys/libmysys.a ../strings/libmystrings.a -pkglib_LIBRARIES = libdbug.a -noinst_HEADERS = dbug_long.h -libdbug_a_SOURCES = dbug.c -EXTRA_DIST = CMakeLists.txt example1.c example2.c example3.c \ - user.r monty.doc dbug_add_tags.pl \ - my_main.c main.c factorial.c dbug_analyze.c \ - CMakeLists.txt tests.c tests-t.pl -NROFF_INC = example1.r example2.r example3.r main.r \ - factorial.r output1.r output2.r output3.r \ - output4.r output5.r -CLEANFILES = $(NROFF_INC) user.t user.ps tests-t - - -# Must be linked with libs that are not compiled yet -noinst_PROGRAMS = factorial dbug_analyze tests -factorial_SOURCES = my_main.c factorial.c -tests_SOURCES = tests.c -dbug_analyze_SOURCES = dbug_analyze.c - -all: user.t user.ps tests-t - -user.t: user.r $(NROFF_INC) - -nroff -mm user.r > $@ - -user.ps: user.r $(NROFF_INC) - -groff -mm user.r > $@ - -output1.r: factorial - ./factorial 1 2 3 4 5 | cat > $@ - -output2.r: factorial - ./factorial -\#t:o 2 3 | cat >$@ - -output3.r: factorial - ./factorial -\#d:t:o 3 | cat >$@ - -output4.r: factorial - ./factorial -\#d,result:o 4 | cat >$@ - -output5.r: factorial - ./factorial -\#d:f,factorial:F:L:o 3 | cat >$@ -.c.r: - @RM@ -f $@ - @SED@ -e 's!\\!\\\\!g' $< > $@ - -# a hack to have executable in builddir, not in srcdir -tests-t: tests-t.pl - cp -f $(srcdir)/tests-t.pl ./tests-t - diff --git a/dbug/dbug.c b/dbug/dbug.c index 040ee9356c1..df26e2ee8ef 100644 --- a/dbug/dbug.c +++ b/dbug/dbug.c @@ -905,6 +905,7 @@ void _db_set_init_(const char *control) CODE_STATE tmp_cs; bzero((uchar*) &tmp_cs, sizeof(tmp_cs)); tmp_cs.stack= &init_settings; + tmp_cs.process= db_process ? db_process : "dbug"; DbugParse(&tmp_cs, control); } @@ -2370,7 +2371,7 @@ static void DbugFlush(CODE_STATE *cs) void _db_flush_() { - CODE_STATE *cs; + CODE_STATE *cs= NULL; get_code_state_or_return; (void) fflush(cs->stack->out_file); } diff --git a/extra/Makefile.am b/extra/Makefile.am deleted file mode 100644 index ff62749ac4c..00000000000 --- a/extra/Makefile.am +++ /dev/null @@ -1,57 +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 - -INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \ - -I$(top_srcdir)/sql -LDADD = @CLIENT_EXTRA_LDFLAGS@ ../mysys/libmysys.a \ - ../dbug/libdbug.a ../strings/libmystrings.a \ - $(ZLIB_LIBS) -BUILT_SOURCES= $(top_builddir)/include/mysqld_error.h \ - $(top_builddir)/include/sql_state.h \ - $(top_builddir)/include/mysqld_ername.h -pkginclude_HEADERS= $(BUILT_SOURCES) -DISTCLEANFILES = $(BUILT_SOURCES) -SUBDIRS = @yassl_dir@ -DIST_SUBDIRS = yassl - -# This will build mysqld_error.h, mysqld_ername.h and sql_state.h -# NOTE Built files should depend on their sources to avoid -# the built files being rebuilt in source dist -$(top_builddir)/include/mysqld_error.h: comp_err.c \ - $(top_srcdir)/sql/share/errmsg-utf8.txt - $(MAKE) $(AM_MAKEFLAGS) comp_err$(EXEEXT) - $(top_builddir)/extra/comp_err$(EXEEXT) \ - --charset=$(top_srcdir)/sql/share/charsets \ - --out-dir=$(top_builddir)/sql/share/ \ - --header_file=$(top_builddir)/include/mysqld_error.h \ - --name_file=$(top_builddir)/include/mysqld_ername.h \ - --state_file=$(top_builddir)/include/sql_state.h \ - --in_file=$(top_srcdir)/sql/share/errmsg-utf8.txt -$(top_builddir)/include/mysqld_ername.h: $(top_builddir)/include/mysqld_error.h -$(top_builddir)/include/sql_state.h: $(top_builddir)/include/mysqld_error.h - -bin_PROGRAMS = replace perror resolveip my_print_defaults \ - resolve_stack_dump mysql_waitpid -# "innochecksum" should be switched -if BUILD_INNODB_TOOLS -bin_PROGRAMS += innochecksum -endif - -noinst_PROGRAMS = charset2html -EXTRA_PROGRAMS = comp_err -EXTRA_DIST = CMakeLists.txt - -perror.o: perror.c - $(COMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $< diff --git a/extra/yassl/Makefile.am b/extra/yassl/Makefile.am deleted file mode 100644 index 43cae0514f9..00000000000 --- a/extra/yassl/Makefile.am +++ /dev/null @@ -1,2 +0,0 @@ -SUBDIRS = taocrypt src testsuite -EXTRA_DIST = CMakeLists.txt diff --git a/extra/yassl/src/Makefile.am b/extra/yassl/src/Makefile.am deleted file mode 100644 index 300cdcd096f..00000000000 --- a/extra/yassl/src/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -INCLUDES = -I$(srcdir)/../include -I$(srcdir)/../taocrypt/include -I$(srcdir)/../taocrypt/mySTL - -noinst_LTLIBRARIES = libyassl.la -libyassl_la_SOURCES = buffer.cpp cert_wrapper.cpp crypto_wrapper.cpp \ - handshake.cpp lock.cpp log.cpp socket_wrapper.cpp ssl.cpp \ - template_instnt.cpp timer.cpp yassl_imp.cpp yassl_error.cpp yassl_int.cpp -EXTRA_DIST = $(wildcard ../include/*.hpp) $(wildcard ../include/openssl/*.h) -AM_CXXFLAGS = -DYASSL_PURE_C -DYASSL_PREFIX @yassl_thread_cxxflags@ diff --git a/extra/yassl/taocrypt/Makefile.am b/extra/yassl/taocrypt/Makefile.am deleted file mode 100644 index deab5227f7f..00000000000 --- a/extra/yassl/taocrypt/Makefile.am +++ /dev/null @@ -1,2 +0,0 @@ -SUBDIRS = src test benchmark -EXTRA_DIST = CMakeLists.txt $(wildcard mySTL/*.hpp) diff --git a/extra/yassl/taocrypt/benchmark/Makefile.am b/extra/yassl/taocrypt/benchmark/Makefile.am deleted file mode 100644 index 0171c7366bb..00000000000 --- a/extra/yassl/taocrypt/benchmark/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -INCLUDES = -I$(srcdir)/../include -I$(srcdir)/../mySTL -noinst_PROGRAMS = benchmark -benchmark_SOURCES = benchmark.cpp -benchmark_LDADD = $(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.la -benchmark_CXXFLAGS = -DYASSL_PURE_C @yassl_thread_cxxflags@ -EXTRA_DIST = benchmark.dsp rsa1024.der dh1024.der dsa1024.der make.bat diff --git a/extra/yassl/taocrypt/src/Makefile.am b/extra/yassl/taocrypt/src/Makefile.am deleted file mode 100644 index a8d08b6e9d5..00000000000 --- a/extra/yassl/taocrypt/src/Makefile.am +++ /dev/null @@ -1,14 +0,0 @@ -INCLUDES = -I$(srcdir)/../include -I$(srcdir)/../mySTL - -noinst_LTLIBRARIES = libtaocrypt.la - -libtaocrypt_la_SOURCES = aes.cpp aestables.cpp algebra.cpp arc4.cpp \ - asn.cpp bftables.cpp blowfish.cpp coding.cpp des.cpp dh.cpp \ - dsa.cpp file.cpp hash.cpp integer.cpp md2.cpp md4.cpp md5.cpp misc.cpp \ - random.cpp ripemd.cpp rsa.cpp sha.cpp template_instnt.cpp \ - tftables.cpp twofish.cpp - -libtaocrypt_la_CXXFLAGS = @yassl_taocrypt_extra_cxxflags@ -DYASSL_PURE_C \ - @yassl_thread_cxxflags@ - -EXTRA_DIST = $(wildcard ../include/*.hpp) diff --git a/extra/yassl/taocrypt/test/Makefile.am b/extra/yassl/taocrypt/test/Makefile.am deleted file mode 100644 index 38f04f1387f..00000000000 --- a/extra/yassl/taocrypt/test/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -INCLUDES = -I$(srcdir)/../include -I$(srcdir)/../mySTL -noinst_PROGRAMS = test -test_SOURCES = test.cpp -test_LDADD = $(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.la -test_CXXFLAGS = -DYASSL_PURE_C @yassl_thread_cxxflags@ -EXTRA_DIST = make.bat diff --git a/extra/yassl/testsuite/Makefile.am b/extra/yassl/testsuite/Makefile.am deleted file mode 100644 index d74c972a084..00000000000 --- a/extra/yassl/testsuite/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -INCLUDES = -I$(srcdir)/../include -I$(srcdir)/../taocrypt/include -I$(srcdir)/../taocrypt/mySTL -noinst_PROGRAMS = testsuite -testsuite_SOURCES = testsuite.cpp ../taocrypt/test/test.cpp \ - ../examples/client/client.cpp ../examples/server/server.cpp \ - ../examples/echoclient/echoclient.cpp \ - ../examples/echoserver/echoserver.cpp -testsuite_CXXFLAGS = -DYASSL_PURE_C -DYASSL_PREFIX -DNO_MAIN_DRIVER @yassl_thread_cxxflags@ -testsuite_LDADD = $(top_builddir)/extra/yassl/src/libyassl.la \ - $(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.la -EXTRA_DIST = testsuite.dsp test.hpp input quit make.bat diff --git a/include/Makefile.am b/include/Makefile.am deleted file mode 100644 index 415e2ef8c8c..00000000000 --- a/include/Makefile.am +++ /dev/null @@ -1,107 +0,0 @@ -# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. -# -# 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 - -pkgpsiincludedir = $(pkgincludedir)/psi - -BUILT_SOURCES = $(HEADERS_GEN_MAKE) link_sources probes_mysql_nodtrace.h -HEADERS_GEN_CONFIGURE = mysql_version.h -HEADERS_GEN_MAKE = my_config.h -HEADERS_ABI = mysql.h mysql_com.h mysql_time.h \ - my_list.h my_alloc.h typelib.h mysql/plugin.h \ - mysql/plugin_audit.h mysql/plugin_ftparser.h -pkginclude_HEADERS = $(HEADERS_ABI) my_dbug.h m_string.h my_sys.h \ - my_xml.h mysql_embed.h mysql/plugin_auth.h \ - mysql/client_plugin.h mysql/plugin_auth_common.h \ - mysql/services.h \ - mysql/service_my_snprintf.h mysql/service_thd_alloc.h \ - mysql/service_thread_scheduler.h \ - mysql/service_thd_wait.h \ - my_pthread.h my_no_pthread.h \ - decimal.h errmsg.h my_global.h my_net.h \ - my_getopt.h sslopt-longopts.h my_dir.h \ - sslopt-vars.h sslopt-case.h sql_common.h keycache.h \ - m_ctype.h my_attribute.h my_compiler.h \ - $(HEADERS_GEN_CONFIGURE) $(HEADERS_GEN_MAKE) \ - probes_mysql.h probes_mysql_nodtrace.h - -noinst_HEADERS = lf.h my_bit.h \ - heap.h my_bitmap.h my_uctype.h password.h \ - myisam.h myisampack.h myisammrg.h ft_global.h\ - mysys_err.h my_base.h \ - my_nosys.h my_alarm.h queues.h rijndael.h sha1.h sha2.h \ - my_aes.h my_tree.h hash.h thr_alarm.h \ - thr_lock.h t_ctype.h violite.h my_md5.h base64.h \ - my_handler.h my_time.h service_versions.h \ - my_rdtsc.h mysql/psi/psi_abi_v1.h mysql/psi/psi_abi_v2.h \ - my_user.h my_atomic.h atomic/nolock.h \ - atomic/rwlock.h atomic/x86-gcc.h atomic/generic-msvc.h \ - atomic/gcc_builtins.h my_libwrap.h my_stacktrace.h \ - atomic/solaris.h mysql/innodb_priv.h - -pkgpsiinclude_HEADERS = mysql/psi/psi.h mysql/psi/mysql_thread.h \ - mysql/psi/mysql_file.h - -EXTRA_DIST = mysql.h.pp mysql/plugin.h.pp probes_mysql.d.base \ - CMakeLists.txt \ - mysql/psi/psi_abi_v1.h.pp \ - mysql/psi/psi_abi_v2.h.pp \ - mysql/plugin_auth.h.pp mysql/client_plugin.h.pp - -# Remove built files and the symlinked directories -CLEANFILES = $(BUILT_SOURCES) readline openssl probes_mysql.d probes_mysql_nodtrace.h - - -# Some include files that may be moved and patched by configure -DISTCLEANFILES = sched.h $(CLEANFILES) $(HEADERS_GEN_CONFIGURE) - -link_sources: - -$(RM) -f readline openssl - @readline_h_ln_cmd@ - @yassl_h_ln_cmd@ - echo timestamp > link_sources - -# We want both "my_config.h" and "config.h" that are identical, as -# MySQL sources assumes the name "my_config.h", and 3rd party sources -# assumes the name "config.h". -my_config.h: config.h - $(CP) config.h my_config.h - -# These files should not be included in distributions since they are -# generated by configure from the .h.in files -dist-hook: - $(RM) -f $(distdir)/mysql_version.h $(distdir)/my_config.h - -probes_mysql.d: - if ! test -f probes_mysql.d ; then \ - $(CP) -f $(top_srcdir)/include/probes_mysql.d.base probes_mysql.d; \ - fi - -DTRACEPROVIDER = probes_mysql.d -if HAVE_DTRACE -BUILT_SOURCES += probes_mysql_dtrace.h -CLEANFILES += $(DTRACEPROVIDER) - -# Fake for creating the probes file. If we are building a separate directory -# then we copy the probes from the source location and use that -# If we are building in the same directory as the source, we do not copy - -probes_mysql_dtrace.h: $(DTRACEPROVIDER) - $(DTRACE) $(DTRACEFLAGS) -h -s $(DTRACEPROVIDER) -o $@ -endif - -probes_mysql_nodtrace.h: $(DTRACEPROVIDER) - @PERL@ $(top_srcdir)/scripts/dheadgen.pl -f $(DTRACEPROVIDER) > $@ diff --git a/include/m_string.h b/include/m_string.h index 2ec4eb64c8e..d2194858589 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -52,8 +52,6 @@ # define memmove(d, s, n) bmove ((d), (s), (n)) #elif defined(HAVE_MEMMOVE) # define bmove(d, s, n) memmove((d), (s), (n)) -#else -# define memmove(d, s, n) bmove((d), (s), (n)) /* our bmove */ #endif /* Unixware 7 */ @@ -76,7 +74,9 @@ extern "C" { extern void *(*my_str_malloc)(size_t); extern void (*my_str_free)(void *); -#if defined(HAVE_STPCPY) +#if defined(HAVE_STPCPY) && MY_GNUC_PREREQ(3, 4) && !defined(__INTEL_COMPILER) +#define strmov(A,B) __builtin_stpcpy((A),(B)) +#elif defined(HAVE_STPCPY) #define strmov(A,B) stpcpy((A),(B)) #ifndef stpcpy extern char *stpcpy(char *, const char *); /* For AIX with gcc 2.95.3 */ @@ -94,14 +94,6 @@ extern char _dig_vec_lower[]; /* Prototypes for string functions */ -#if !defined(bfill) && !defined(HAVE_BFILL) -extern void bfill(uchar *dst,size_t len,pchar fill); -#endif - -#if !defined(HAVE_BMOVE) && !defined(bmove) -extern void bmove(uuchar *dst, const uchar *src,size_t len); -#endif - extern void bmove_upp(uchar *dst,const uchar *src,size_t len); extern void bchange(uchar *dst,size_t old_len,const uchar *src, size_t new_len,size_t tot_len); @@ -126,11 +118,6 @@ extern char *strxnmov(char *dst, size_t len, const char *src, ...); extern size_t strnlen(const char *s, size_t n); #endif -#if !defined(__cplusplus) -#ifndef HAVE_STRSTR -extern char *strstr(const char *, const char *); -#endif -#endif extern int is_prefix(const char *, const char *); /* Conversion routines */ diff --git a/include/my_compiler.h b/include/my_compiler.h index 1cd46ff4260..5f898621159 100644 --- a/include/my_compiler.h +++ b/include/my_compiler.h @@ -32,8 +32,15 @@ /* GNU C/C++ */ #if defined __GNUC__ +/* Convenience macro to test the minimum required GCC version. */ +# define MY_GNUC_PREREQ(maj, min) \ + ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) /* Any after 2.95... */ # define MY_ALIGN_EXT +/* Comunicate to the compiler the unreachability of the code. */ +# if MY_GNUC_PREREQ(4,5) +# define MY_ASSERT_UNREACHABLE() __builtin_unreachable() +# endif /* Microsoft Visual C++ */ #elif defined _MSC_VER @@ -67,8 +74,13 @@ #endif /** - Generic compiler-dependent features. + Generic (compiler-independent) features. */ + +#ifndef MY_GNUC_PREREQ +# define MY_GNUC_PREREQ(maj, min) (0) +#endif + #ifndef MY_ALIGNOF # ifdef __cplusplus template struct my_alignof_helper { char m1; type m2; }; @@ -79,6 +91,10 @@ # endif #endif +#ifndef MY_ASSERT_UNREACHABLE +# define MY_ASSERT_UNREACHABLE() do { assert(0); } while (0) +#endif + /** C++ Type Traits */ diff --git a/include/my_dbug.h b/include/my_dbug.h index 19570ac2a67..e1cb3252601 100644 --- a/include/my_dbug.h +++ b/include/my_dbug.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* 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 @@ -13,8 +13,18 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _dbug_h -#define _dbug_h +#ifndef MY_DBUG_INCLUDED +#define MY_DBUG_INCLUDED + +#ifndef __WIN__ +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#include +#endif /* not __WIN__ */ #ifdef __cplusplus extern "C" { @@ -111,6 +121,20 @@ extern const char* _db_get_func_(void); #define DBUG_CRASH_VOID_RETURN \ DBUG_CHECK_CRASH (_db_get_func_(), "_crash_return") +/* + Make the program fail, without creating a core file. + abort() will send SIGABRT which (most likely) generates core. + Use SIGKILL instead, which cannot be caught. + We also pause the current thread, until the signal is actually delivered. + An alternative would be to use _exit(EXIT_FAILURE), + but then valgrind would report lots of memory leaks. + */ +#ifdef __WIN__ +#define DBUG_SUICIDE() DBUG_ABORT() +#else +#define DBUG_SUICIDE() (_db_flush_(), kill(getpid(), SIGKILL), pause()) +#endif + #else /* No debugger */ #define DBUG_ENTER(a1) @@ -139,10 +163,11 @@ extern const char* _db_get_func_(void); #define DBUG_EXPLAIN_INITIAL(buf,len) #define DEBUGGER_OFF do { } while(0) #define DEBUGGER_ON do { } while(0) -#define DBUG_ABORT() abort() +#define DBUG_ABORT() do { } while(0) #define DBUG_CRASH_ENTER(func) #define DBUG_CRASH_RETURN(val) do { return(val); } while(0) #define DBUG_CRASH_VOID_RETURN do { return; } while(0) +#define DBUG_SUICIDE() do { } while(0) #endif @@ -164,4 +189,5 @@ void debug_sync_point(const char* lock_name, uint lock_timeout); #ifdef __cplusplus } #endif -#endif + +#endif /* MY_DBUG_INCLUDED */ diff --git a/include/my_getopt.h b/include/my_getopt.h index 5eb0004e9c3..47feb21d85e 100644 --- a/include/my_getopt.h +++ b/include/my_getopt.h @@ -39,6 +39,13 @@ C_MODE_START #define GET_ASK_ADDR 128 #define GET_TYPE_MASK 127 +/** + Enumeration of the my_option::arg_type attributes. + It should be noted that for historical reasons variables with the combination + arg_type=NO_ARG, my_option::var_type=GET_BOOL still accepts + arguments. This is someone counter intuitive and care should be taken + if the code is refactored. +*/ enum get_opt_arg_type { NO_ARG, OPT_ARG, REQUIRED_ARG }; struct st_typelib; diff --git a/include/my_pthread.h b/include/my_pthread.h index d3053b4861a..bec88a716fe 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -501,7 +501,8 @@ int safe_mutex_destroy(safe_mutex_t *mp,const char *file, uint line); int safe_cond_wait(pthread_cond_t *cond, safe_mutex_t *mp,const char *file, uint line); int safe_cond_timedwait(pthread_cond_t *cond, safe_mutex_t *mp, - struct timespec *abstime, const char *file, uint line); + const struct timespec *abstime, + const char *file, uint line); void safe_mutex_global_init(void); void safe_mutex_end(FILE *file); diff --git a/include/my_sys.h b/include/my_sys.h index 23c9b2da55f..7b437e2a745 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -256,7 +256,7 @@ extern my_bool my_disable_locking, my_disable_async_io, extern char wild_many,wild_one,wild_prefix; extern const char *charsets_dir; /* from default.c */ -extern char *my_defaults_extra_file; +extern const char *my_defaults_extra_file; extern const char *my_defaults_group_suffix; extern const char *my_defaults_file; diff --git a/include/mysql.h b/include/mysql.h index b52235b484e..d3b24f0198a 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -17,11 +17,10 @@ This file defines the client API to MySQL and also the ABI of the dynamically linked libmysqlclient. - The ABI should never be changed in a released product of MySQL + The ABI should never be changed in a released product of MySQL, thus you need to take great care when changing the file. In case - the file is changed so the ABI is broken, you must also - update the SHAREDLIB_MAJOR_VERSION in configure.in . - + the file is changed so the ABI is broken, you must also update + the SHARED_LIB_MAJOR_VERSION in cmake/mysql_version.cmake */ #ifndef _mysql_h diff --git a/include/mysql/client_plugin.h b/include/mysql/client_plugin.h index ddd3b64ca56..cc3f468040f 100644 --- a/include/mysql/client_plugin.h +++ b/include/mysql/client_plugin.h @@ -23,8 +23,10 @@ */ #define MYSQL_CLIENT_PLUGIN_INCLUDED +#ifndef MYSQL_ABI_CHECK #include #include +#endif /* known plugin types */ #define MYSQL_CLIENT_reserved1 0 @@ -77,8 +79,7 @@ struct st_mysql_client_plugin_AUTHENTICATION /** loads a plugin and initializes it - @param mysql MYSQL structure. only MYSQL_PLUGIN_DIR option value is used, - and last_errno/last_error, for error reporting + @param mysql MYSQL structure. @param name a name of the plugin to load @param type type of plugin that should be loaded, -1 to disable type check @param argc number of arguments to pass to the plugin initialization @@ -98,8 +99,7 @@ mysql_load_plugin(struct st_mysql *mysql, const char *name, int type, This is the same as mysql_load_plugin, but take va_list instead of a list of arguments. - @param mysql MYSQL structure. only MYSQL_PLUGIN_DIR option value is used, - and last_errno/last_error, for error reporting + @param mysql MYSQL structure. @param name a name of the plugin to load @param type type of plugin that should be loaded, -1 to disable type check @param argc number of arguments to pass to the plugin initialization @@ -116,8 +116,7 @@ mysql_load_plugin_v(struct st_mysql *mysql, const char *name, int type, /** finds an already loaded plugin by name, or loads it, if necessary - @param mysql MYSQL structure. only MYSQL_PLUGIN_DIR option value is used, - and last_errno/last_error, for error reporting + @param mysql MYSQL structure. @param name a name of the plugin to load @param type type of plugin that should be loaded diff --git a/include/mysql/client_plugin.h.pp b/include/mysql/client_plugin.h.pp index 58627e06f09..e508f821aad 100644 --- a/include/mysql/client_plugin.h.pp +++ b/include/mysql/client_plugin.h.pp @@ -1,5 +1,3 @@ -#include -#include struct st_mysql_client_plugin { int type; unsigned int interface_version; const char *name; const char *author; const char *desc; unsigned int version[3]; const char *license; void *mysql_api; int (*init)(char *, size_t, int, va_list); int (*deinit)(); int (*options)(const char *option, const void *); diff --git a/include/mysql/plugin_auth.h b/include/mysql/plugin_auth.h index 5622e9cdebe..420eb3bb80f 100644 --- a/include/mysql/plugin_auth.h +++ b/include/mysql/plugin_auth.h @@ -90,8 +90,8 @@ typedef struct st_mysql_server_auth_info int password_used; /** - Set to the name of the connected client if it can be resolved, or to - the address otherwise + Set to the name of the connected client host, if it can be resolved, + or to its IP address otherwise. */ const char *host_or_ip; @@ -107,7 +107,7 @@ typedef struct st_mysql_server_auth_info */ struct st_mysql_auth { - int interface_version; /**< version plugin uses */ + int interface_version; /** version plugin uses */ /** A plugin that a client must use for authentication with this server plugin. Can be NULL to mean "any plugin". diff --git a/include/mysql_com.h b/include/mysql_com.h index d4223211710..bc9296a6d02 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -255,7 +255,11 @@ enum enum_server_command #define SERVER_STATUS_CLEAR_SET (SERVER_QUERY_NO_GOOD_INDEX_USED| \ SERVER_QUERY_NO_INDEX_USED|\ SERVER_MORE_RESULTS_EXISTS|\ - SERVER_STATUS_METADATA_CHANGED) + SERVER_STATUS_METADATA_CHANGED |\ + SERVER_QUERY_WAS_SLOW |\ + SERVER_STATUS_DB_DROPPED |\ + SERVER_STATUS_CURSOR_EXISTS|\ + SERVER_STATUS_LAST_ROW_SENT) #define MYSQL_ERRMSG_SIZE 512 #define NET_READ_TIMEOUT 30 /* Timeout on read */ diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt index 7441423743e..d7426c465d8 100644 --- a/libmysql/CMakeLists.txt +++ b/libmysql/CMakeLists.txt @@ -172,7 +172,7 @@ IF(UNIX) SET(${OUTNAME} ${LIBNAME}${EXTENSION}${DOT_VERSION}) ENDIF() ENDMACRO() - INSTALL_SYMLINK(${CMAKE_STATIC_LIBRARY_PREFIX}mysqlclient_r.a mysqlclient ${INSTALL_LIBDIR} COMPONENT SharedLibraries) + INSTALL_SYMLINK(${CMAKE_STATIC_LIBRARY_PREFIX}mysqlclient_r.a mysqlclient ${INSTALL_LIBDIR} Development) ENDIF() IF(NOT DISABLE_SHARED) @@ -210,7 +210,7 @@ IF(NOT DISABLE_SHARED) "${CMAKE_SHARED_LIBRARY_SUFFIX}" "" linkname) - INSTALL_SYMLINK(${linkname} libmysql ${INSTALL_LIBDIR} COMPONENT SharedLibraries) + INSTALL_SYMLINK(${linkname} libmysql ${INSTALL_LIBDIR} SharedLibraries) SET(OS_SHARED_LIB_SYMLINKS "${SHARED_LIB_MAJOR_VERSION}" "${OS_SHARED_LIB_VERSION}") LIST(REMOVE_DUPLICATES OS_SHARED_LIB_SYMLINKS) FOREACH(ver ${OS_SHARED_LIB_SYMLINKS}) @@ -219,7 +219,7 @@ IF(NOT DISABLE_SHARED) "${CMAKE_SHARED_LIBRARY_SUFFIX}" "${ver}" linkname) - INSTALL_SYMLINK(${linkname} libmysql ${INSTALL_LIBDIR} COMPONENT SharedLibraries) + INSTALL_SYMLINK(${linkname} libmysql ${INSTALL_LIBDIR} SharedLibraries) ENDFOREACH() ENDIF() ENDIF() diff --git a/libmysql/Makefile.am b/libmysql/Makefile.am deleted file mode 100644 index 07f66c28ddb..00000000000 --- a/libmysql/Makefile.am +++ /dev/null @@ -1,115 +0,0 @@ -# Copyright (C) 2000-2004 MySQL AB, 2008-2009 Sun Microsystems, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of version 2 GNU General Public License as -# published by the Free Software Foundation. -# -# There are special exceptions to the terms and conditions of the GPL as it -# is applied to this software. View the full text of the exception in file -# EXCEPTIONS-CLIENT in the directory of this software distribution. -# -# 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 -# -# This file is public domain and comes with NO WARRANTY of any kind - -target = libmysqlclient.la -target_defs = -DMYSQL_CLIENT_NO_THREADS -DDISABLE_MYSQL_THREAD_H \ - @LIB_EXTRA_CCFLAGS@ - -LIBS = @CLIENT_LIBS@ -INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \ - $(openssl_includes) @ZLIB_INCLUDES@ - -include $(srcdir)/Makefile.shared - -libmysqlclient_la_SOURCES = $(target_sources) -libmysqlclient_la_LIBADD = $(target_libadd) $(yassl_las) -libmysqlclient_la_LDFLAGS = $(target_ldflags) -EXTRA_DIST = Makefile.shared libmysql.def CMakeLists.txt -noinst_HEADERS = client_settings.h - -link_sources: - set -x; \ - ss=`echo $(mystringsobjects) | sed "s;\.lo;.c;g"`; \ - ds=`echo $(dbugobjects) | sed "s;\.lo;.c;g"`; \ - ms=`echo $(mysysobjects) | sed "s;\.lo;.c;g"`; \ - vs=`echo $(vio_objects) | sed "s;\.lo;.c;g"`; \ - scs=`echo $(sql_cmn_objects) | sed "s;\.lo;.c;g"`; \ - for f in $$ss; do \ - rm -f $$f; \ - @LN_CP_F@ $(top_srcdir)/strings/$$f $$f; \ - done; \ - for f in $$vs $(vioheaders); do \ - rm -f $$f; \ - @LN_CP_F@ $(top_srcdir)/vio/$$f $$f; \ - done; \ - for f in $$scs; do \ - rm -f $$f; \ - @LN_CP_F@ $(top_srcdir)/sql-common/$$f $$f; \ - done; \ - for f in $(mystringsextra); do \ - rm -f $$f; \ - @LN_CP_F@ $(top_srcdir)/strings/$$f $$f; \ - done; \ - for f in $$ds; do \ - rm -f $$f; \ - @LN_CP_F@ $(top_srcdir)/dbug/$$f $$f; \ - done; \ - for f in $$ms $(mysysheaders); do \ - rm -f $$f; \ - @LN_CP_F@ $(top_srcdir)/mysys/$$f $$f; \ - done; \ - rm -f net.c; \ - @LN_CP_F@ $(top_srcdir)/sql/net_serv.cc net.c ; \ - rm -f password.c; \ - @LN_CP_F@ $(top_srcdir)/sql/password.c password.c - echo timestamp > link_sources - -# This part requires GNUmake -# -# This makes a distribution file with only the files needed to compile -# a minimal MySQL client library -# -# For a really minimal distribution (without debugging code) we could -# keep only the stubs for debug.c -# -# A list of needed headers collected from the deps information 000213 -nh = my_global.h dbug.h errmsg.h \ - m_ctype.h m_string.h password.h \ - my_alarm.h my_config.h my_dir.h my_list.h my_net.h my_sys.h \ - mysql.h mysql_com.h mysql_version.h mysqld_error.h \ - mysys_err.h my_pthread.h thr_alarm.h violite.h hash.h \ - sql_common.h ../libmysql/client_settings.h -# Get a list of the needed objects -lobjs = $(mysysobjects1) $(dbugobjects) $(mystringsobjects) $(sqlobjects) - -do-lib-dist: - dir=libmysql-$(MYSQL_NO_DASH_VERSION); \ - srcs1=`echo $(lobjs) | sed "s;\.lo;.c;g"`; \ - srcs2=$(target_sources); \ - srcs="$$srcs1 $$srcs2"; \ - objs1=`echo $(lobjs) | sed "s;\.lo;.o;g"`; \ - objs2=`echo $(target_sources) | sed "s;\.c;.o;g"`; \ - objs="$$objs1 $$objs2"; \ - rm -rf $$dir; \ - mkdir $$dir; \ - $(INSTALL_DATA) $$srcs $(mysysheaders) $$dir; \ - for i in $(nh); do $(INSTALL_DATA) ../include/$$i $$dir; done; \ - echo "# A very minimal Makefile to compile" > $$dir/Makefile; \ - echo "# the minimized libmysql library" >> $$dir/Makefile; \ - echo "# This file is autogenerated from Makefile.am" >> $$dir/Makefile; \ - echo 'CFLAGS= -I. -DMYSQL_CLIENT_NO_THREADS' >>$$dir/Makefile; \ - echo "obj=$$objs" >>$$dir/Makefile; \ - echo 'all: libmysql.a' >>$$dir/Makefile; \ - echo 'libmysql.a: $$(obj)' >>$$dir/Makefile; \ - echo ' $$(AR) r $$@ $$?' >>$$dir/Makefile; \ - gtar cvzf $$dir.tar.gz $$dir; \ - cd $$dir; gmake diff --git a/libmysql/Makefile.shared b/libmysql/Makefile.shared deleted file mode 100644 index 5a7236f1e6d..00000000000 --- a/libmysql/Makefile.shared +++ /dev/null @@ -1,119 +0,0 @@ -# Copyright (C) 2000-2004 MySQL AB, 2008-2009 Sun Microsystems, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of version 2 GNU General Public License as -# published by the Free Software Foundation. -# -# There are special exceptions to the terms and conditions of the GPL as it -# is applied to this software. View the full text of the exception in file -# EXCEPTIONS-CLIENT in the directory of this software distribution. -# -# 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 -# -# This file is public domain and comes with NO WARRANTY of any kind - -MYSQLDATAdir = $(localstatedir) -MYSQLSHAREdir = $(pkgdatadir) -MYSQLBASEdir= $(prefix) -pkgplugindir = $(pkglibdir)/plugin -## We'll use CLIENT_EXTRA_LDFLAGS for threaded and non-threaded -## until someone complains that they need separate options. -LDADD = @CLIENT_EXTRA_LDFLAGS@ $(target) -pkglib_LTLIBRARIES = $(target) - -noinst_PROGRAMS = conf_to_src - - -target_sources = libmysql.c password.c \ - get_password.c errmsg.c - -mystringsobjects = strmov.lo strxmov.lo strxnmov.lo strnmov.lo \ - strmake.lo strend.lo \ - strnlen.lo strfill.lo is_prefix.lo \ - int2str.lo str2int.lo strcont.lo \ - strcend.lo ctype-latin1.lo \ - bchange.lo bmove.lo bmove_upp.lo longlong2str.lo \ - strtoull.lo strtoll.lo llstr.lo my_vsnprintf.lo \ - ctype.lo ctype-simple.lo ctype-bin.lo ctype-mb.lo \ - ctype-big5.lo ctype-czech.lo ctype-cp932.lo ctype-eucjpms.lo ctype-euc_kr.lo \ - ctype-win1250ch.lo ctype-utf8.lo ctype-extra.lo \ - ctype-ucs2.lo ctype-gb2312.lo ctype-gbk.lo \ - ctype-sjis.lo ctype-tis620.lo ctype-ujis.lo \ - ctype-uca.lo xml.lo my_strtoll10.lo str_alloc.lo dtoa.lo - -mystringsextra= strto.c -dbugobjects = dbug.lo -mysysheaders = mysys_priv.h my_static.h -vioheaders = vio_priv.h -mysysobjects1 = my_init.lo my_static.lo my_malloc.lo \ - my_create.lo my_delete.lo mf_tempfile.lo my_open.lo \ - my_file.lo my_read.lo my_write.lo errors.lo \ - my_error.lo my_getwd.lo my_div.lo \ - mf_pack.lo my_mess.lo mf_dirname.lo mf_fn_ext.lo\ - mf_wcomp.lo typelib.lo my_alloc.lo \ - mf_format.lo mf_path.lo mf_unixpath.lo my_fopen.lo \ - my_symlink.lo my_fstream.lo mf_arr_appstr.lo \ - mf_loadpath.lo my_pthread.lo my_thr_init.lo \ - thr_mutex.lo mulalloc.lo string.lo default.lo \ - my_compress.lo array.lo my_once.lo list.lo \ - charset.lo charset-def.lo hash.lo mf_iocache.lo \ - mf_iocache2.lo my_seek.lo my_sleep.lo \ - my_pread.lo mf_cache.lo md5.lo sha1.lo \ - my_getopt.lo my_gethostbyname.lo my_port.lo \ - my_rename.lo my_chsize.lo my_sync.lo \ - my_getsystime.lo my_symlink2.lo mf_same.lo -sqlobjects = net.lo -sql_cmn_objects = pack.lo client.lo my_time.lo client_plugin.lo - -# Not needed in the minimum library -mysysobjects2 = my_lib.lo mf_qsort.lo -mysysobjects = $(mysysobjects1) $(mysysobjects2) -target_libadd = $(mysysobjects) $(mystringsobjects) $(dbugobjects) \ - $(sql_cmn_objects) $(vio_objects) $(sqlobjects) -target_ldflags = -version-info @SHARED_LIB_VERSION@ @LD_VERSION_SCRIPT@ @LIBDL@ -vio_objects= vio.lo viosocket.lo viossl.lo viosslfactories.lo - -BUILT_SOURCES = link_sources - -CLEANFILES = $(target_libadd) $(SHLIBOBJS) \ - $(target) $(BUILT_SOURCES) -DEFS = -DDEFAULT_CHARSET_HOME='"$(MYSQLBASEdir)"' \ - -DMYSQL_DATADIR='"$(MYSQLDATAdir)"' \ - -DDEFAULT_HOME_ENV=MYSQL_HOME \ - -DPLUGINDIR='"$(pkgplugindir)"' \ - -DDEFAULT_GROUP_SUFFIX_ENV=MYSQL_GROUP_SUFFIX \ - -DDEFAULT_SYSCONFDIR='"$(sysconfdir)"' \ - -DSHAREDIR='"$(MYSQLSHAREdir)"' -DDISABLE_DTRACE \ - $(target_defs) - -if HAVE_YASSL -yassl_las = $(top_builddir)/extra/yassl/src/libyassl.la \ - $(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.la -endif - -# The automatic dependencies miss this -#bmove_upp.lo: $(LTCHARSET_OBJS) - -clean-local: - rm -f `echo $(mystringsobjects) | sed "s;\.lo;.c;g"` \ - `echo $(dbugobjects) | sed "s;\.lo;.c;g"` \ - `echo $(mysysobjects) | sed "s;\.lo;.c;g"` \ - `echo $(vio_objects) | sed "s;\.lo;.c;g"` \ - `echo $(sql_cmn_objects) | sed "s;\.lo;.c;g"` \ - $(CHARSET_SRCS) $(CHARSET_OBJS) \ - $(mystringsextra) $(mysysheaders) $(vioheaders) \ - net.c - -conf_to_src_SOURCES = conf_to_src.c -conf_to_src_LDADD= -#force static linking of conf_to_src - essential when linking against -#custom installation of libc -conf_to_src_LDFLAGS=@NOINST_LDFLAGS@ diff --git a/libmysql/acinclude.m4 b/libmysql/acinclude.m4 deleted file mode 100644 index c0211f3759f..00000000000 --- a/libmysql/acinclude.m4 +++ /dev/null @@ -1,91 +0,0 @@ -# Local macros for automake & autoconf - -AC_DEFUN(MYSQL_TYPE_ACCEPT, -[ac_save_CXXFLAGS="$CXXFLAGS" -AC_CACHE_CHECK([base type of last arg to accept], mysql_cv_btype_last_arg_accept, -AC_LANG_SAVE -AC_LANG_CPLUSPLUS -if test "$ac_cv_prog_gxx" = "yes" -then - CXXFLAGS="$CXXFLAGS -Werror" -fi -mysql_cv_btype_last_arg_accept=none -[AC_TRY_COMPILE([#include -#include -#include -], -[int a = accept(1, (struct sockaddr *) 0, (socklen_t *) 0);], -mysql_cv_btype_last_arg_accept=socklen_t)] -if test $mysql_cv_btype_last_arg_accept = none; then -[AC_TRY_COMPILE([#include -#include -#include -], -[int a = accept(1, (struct sockaddr *) 0, (size_t *) 0);], -mysql_cv_btype_last_arg_accept=size_t)] -fi -if test $mysql_cv_btype_last_arg_accept = none; then -mysql_cv_btype_last_arg_accept=int -fi) -AC_LANG_RESTORE -AC_DEFINE_UNQUOTED(SOCKET_SIZE_TYPE, $mysql_cv_btype_last_arg_accept) -CXXFLAGS="$ac_save_CXXFLAGS" -]) - - -#---START: Used in for client configure -AC_DEFUN(MYSQL_CHECK_ULONG, -[AC_MSG_CHECKING(for type ulong) -AC_CACHE_VAL(ac_cv_ulong, -[AC_TRY_RUN([#include -#include -main() -{ - ulong foo; - foo++; - exit(0); -}], ac_cv_ulong=yes, ac_cv_ulong=no, ac_cv_ulong=no)]) -AC_MSG_RESULT($ac_cv_ulong) -if test "$ac_cv_ulong" = "yes" -then - AC_DEFINE(HAVE_ULONG) -fi -]) - -AC_DEFUN(MYSQL_CHECK_UCHAR, -[AC_MSG_CHECKING(for type uchar) -AC_CACHE_VAL(ac_cv_uchar, -[AC_TRY_RUN([#include -#include -main() -{ - uchar foo; - foo++; - exit(0); -}], ac_cv_uchar=yes, ac_cv_uchar=no, ac_cv_uchar=no)]) -AC_MSG_RESULT($ac_cv_uchar) -if test "$ac_cv_uchar" = "yes" -then - AC_DEFINE(HAVE_UCHAR) -fi -]) - -AC_DEFUN(MYSQL_CHECK_UINT, -[AC_MSG_CHECKING(for type uint) -AC_CACHE_VAL(ac_cv_uint, -[AC_TRY_RUN([#include -#include -main() -{ - uint foo; - foo++; - exit(0); -}], ac_cv_uint=yes, ac_cv_uint=no, ac_cv_uint=no)]) -AC_MSG_RESULT($ac_cv_uint) -if test "$ac_cv_uint" = "yes" -then - AC_DEFINE(HAVE_UINT) -fi -]) - -#---END: diff --git a/libmysql/conf_to_src.c b/libmysql/conf_to_src.c index 785e3cad4c1..f39a2e1856f 100644 --- a/libmysql/conf_to_src.c +++ b/libmysql/conf_to_src.c @@ -5,8 +5,7 @@ the Free Software Foundation. There are special exceptions to the terms and conditions of the GPL as it - is applied to this software. View the full text of the exception in file - EXCEPTIONS-CLIENT in the directory of this software distribution. + is applied to this software. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/libmysql/errmsg.c b/libmysql/errmsg.c index 823f83026c9..b99b3f2de30 100644 --- a/libmysql/errmsg.c +++ b/libmysql/errmsg.c @@ -5,8 +5,7 @@ the Free Software Foundation. There are special exceptions to the terms and conditions of the GPL as it - is applied to this software. View the full text of the exception in file - EXCEPTIONS-CLIENT in the directory of this software distribution. + is applied to this software. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/libmysql/get_password.c b/libmysql/get_password.c index 56514a8d864..455b4b3c8f1 100644 --- a/libmysql/get_password.c +++ b/libmysql/get_password.c @@ -5,8 +5,7 @@ the Free Software Foundation. There are special exceptions to the terms and conditions of the GPL as it - is applied to this software. View the full text of the exception in file - EXCEPTIONS-CLIENT in the directory of this software distribution. + is applied to this software. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index e9327d770fb..c498ed0f089 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -5,8 +5,7 @@ the Free Software Foundation. There are special exceptions to the terms and conditions of the GPL as it - is applied to this software. View the full text of the exception in file - EXCEPTIONS-CLIENT in the directory of this software distribution. + is applied to this software. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/libmysql_r/Makefile.am b/libmysql_r/Makefile.am deleted file mode 100644 index 30aa2467dab..00000000000 --- a/libmysql_r/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (C) 2000-2004 MySQL AB -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of version 2 GNU General Public License as -# published by the Free Software Foundation. -# -# There are special exceptions to the terms and conditions of the GPL as it -# is applied to this software. View the full text of the exception in file -# EXCEPTIONS-CLIENT in the directory of this software distribution. -# -# 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 -# -# This file is public domain and comes with NO WARRANTY of any kind - -target = libmysqlclient_r.la -target_defs = -DDISABLE_MYSQL_PRLOCK_H -DMYSQL_CLIENT @LIB_EXTRA_CCFLAGS@ - -LIBS = @LIBS@ @ZLIB_LIBS@ @openssl_libs@ - -INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \ - $(openssl_includes) @ZLIB_INCLUDES@ -## automake barfs if you don't use $(srcdir) or $(top_srcdir) in include -include $(top_srcdir)/libmysql/Makefile.shared - -nodist_libmysqlclient_r_la_SOURCES = $(target_sources) -libmysqlclient_r_la_LIBADD = $(target_libadd) $(yassl_las) -libmysqlclient_r_la_LDFLAGS = $(target_ldflags) - -link_sources: - set -x; \ - for d in $(top_srcdir)/libmysql $(top_builddir)/libmysql; do \ - for f in `cd $$d && echo *.[ch]`; do \ - rm -f $$f; \ - @LN_CP_F@ $$d/$$f $$f; \ - done; \ - done - echo timestamp > link_sources diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am deleted file mode 100644 index 279f1007243..00000000000 --- a/libmysqld/Makefile.am +++ /dev/null @@ -1,229 +0,0 @@ -# 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 -# 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 - -MYSQLDATAdir = $(localstatedir) -MYSQLSHAREdir = $(pkgdatadir) -MYSQLBASEdir= $(prefix) -MYSQLLIBdir= $(libdir) -pkgplugindir = $(pkglibdir)/plugin - -EXTRA_DIST = libmysqld.def CMakeLists.txt -DEFS = -DEMBEDDED_LIBRARY -DMYSQL_SERVER \ - -DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \ - -DMYSQL_DATADIR="\"$(MYSQLDATAdir)\"" \ - -DSHAREDIR="\"$(MYSQLSHAREdir)\"" \ - -DPLUGINDIR="\"$(pkgplugindir)\"" \ - -DDISABLE_DTRACE \ - @DEFS@ -INCLUDES= -I$(top_builddir)/include -I$(top_srcdir)/include \ - -I$(top_builddir)/sql -I$(top_srcdir)/sql \ - -I$(top_srcdir)/sql/examples \ - -I$(top_srcdir)/regex \ - $(openssl_includes) @ZLIB_INCLUDES@ \ - @condition_dependent_plugin_includes@ - -noinst_LIBRARIES = libmysqld_int.a -pkglib_LIBRARIES = libmysqld.a -SUBDIRS = . examples -libmysqld_sources= libmysqld.c lib_sql.cc emb_qcache.cc -libmysqlsources = errmsg.c get_password.c libmysql.c client.c pack.c \ - my_time.c client_plugin.c - -noinst_HEADERS = embedded_priv.h emb_qcache.h - -sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \ - ha_ndbcluster.cc ha_ndbcluster_cond.cc \ - ha_ndbcluster_binlog.cc ha_partition.cc \ - handler.cc sql_handler.cc \ - hostname.cc init.cc password.c \ - item.cc item_buff.cc item_cmpfunc.cc item_create.cc \ - item_func.cc item_strfunc.cc item_sum.cc item_timefunc.cc \ - item_geofunc.cc item_subselect.cc item_row.cc\ - item_xmlfunc.cc \ - sha2.cc des_key_file.cc \ - key.cc lock.cc log.cc sql_state.c \ - log_event.cc rpl_record.cc rpl_utility.cc \ - log_event_old.cc rpl_record_old.cc \ - protocol.cc net_serv.cc opt_range.cc \ - opt_sum.cc procedure.cc records.cc sql_acl.cc \ - sql_load.cc discover.cc sql_locale.cc \ - sql_profile.cc sql_admin.cc sql_truncate.cc datadict.cc \ - sql_reload.cc \ - sql_analyse.cc sql_base.cc sql_cache.cc sql_class.cc \ - sql_crypt.cc sql_db.cc sql_delete.cc sql_error.cc sql_insert.cc \ - sql_lex.cc sql_list.cc sql_manager.cc \ - scheduler.cc sql_connect.cc sql_parse.cc \ - sql_prepare.cc sql_derived.cc sql_rename.cc \ - sql_select.cc sql_do.cc sql_show.cc set_var.cc sys_vars.cc \ - sql_string.cc sql_table.cc sql_test.cc sql_udf.cc \ - sql_update.cc sql_yacc.cc table.cc thr_malloc.cc sql_time.cc \ - unireg.cc uniques.cc sql_union.cc hash_filo.cc \ - spatial.cc gstream.cc sql_help.cc tztime.cc sql_cursor.cc \ - sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc sp_rcontext.cc \ - parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \ - rpl_filter.cc sql_partition.cc sql_builtin.cc sql_plugin.cc \ - debug_sync.cc sql_tablespace.cc transaction.cc \ - rpl_injector.cc my_user.c partition_info.cc sql_alter.cc \ - sql_servers.cc event_parse_data.cc sql_signal.cc \ - rpl_handler.cc mdl.cc keycaches.cc sql_audit.cc \ - sql_partition_admin.cc - -libmysqld_int_a_SOURCES= $(libmysqld_sources) -nodist_libmysqld_int_a_SOURCES= $(libmysqlsources) $(sqlsources) -libmysqld_a_SOURCES= - -sqlstoragesources = $(EXTRA_libmysqld_a_SOURCES) -storagesources = @condition_dependent_plugin_modules@ -storageobjects = @condition_dependent_plugin_objects@ -storagesourceslinks = @condition_dependent_plugin_links@ - -# automake misses these -sql_yacc.cc sql_yacc.h: $(top_srcdir)/sql/sql_yacc.yy - -# The following libraries should be included in libmysqld.a -INC_LIB= $(top_builddir)/regex/libregex.a \ - $(top_builddir)/mysys/libmysys.a \ - $(top_builddir)/strings/libmystrings.a \ - $(top_builddir)/dbug/libdbug.a \ - $(top_builddir)/vio/libvio.a \ - @NDB_SCI_LIBS@ \ - @mysql_plugin_libs@ \ - $(yassl_inc_libs) - -if HAVE_YASSL -yassl_inc_libs= $(top_builddir)/extra/yassl/src/.libs/libyassl.a \ - $(top_builddir)/extra/yassl/taocrypt/src/.libs/libtaocrypt.a -endif - -# Storage engine specific compilation options -ha_ndbcluster.o:ha_ndbcluster.cc - $(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $< - -ha_ndbcluster_cond.o:ha_ndbcluster_cond.cc - $(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $< - -ha_ndbcluster_binlog.o: ha_ndbcluster_binlog.cc - $(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $< - -# Until we can remove dependency on ha_ndbcluster.h -handler.o: handler.cc - $(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $< - -# We need rules to compile these as no good way -# found to append fileslists that collected by configure -# to the sources list - -ha_federated.o:ha_federated.cc - $(CXXCOMPILE) $(LM_CFLAGS) -c $< - -ha_heap.o:ha_heap.cc - $(CXXCOMPILE) $(LM_CFLAGS) -c $< - -ha_innodb.o:ha_innodb.cc - $(CXXCOMPILE) $(LM_CFLAGS) -c $< - -ha_myisam.o:ha_myisam.cc - $(CXXCOMPILE) $(LM_CFLAGS) -c $< - -ha_myisammrg.o:ha_myisammrg.cc - $(CXXCOMPILE) $(LM_CFLAGS) -c $< - -# -# To make it easy for the end user to use the embedded library we -# generate a total libmysqld.a from all library files, - -# note - InnoDB libraries have circular dependencies, so in INC_LIB -# few libraries are present two times. Metrowerks linker doesn't like -# it at all. Traditional ar has no problems with it, but still there's no -# need to add the same file twice to the library, so 'sort -u' save us -# some time and spares unnecessary work. - -libmysqld.a: libmysqld_int.a $(INC_LIB) $(libmysqld_a_DEPENDENCIES) $(storageobjects) -if DARWIN_MWCC - mwld -lib -o $@ libmysqld_int.a `echo $(INC_LIB) | sort -u` $(storageobjects) -else - -rm -f libmysqld.a - current_dir=`pwd`; \ - rm -rf tmp; mkdir tmp; \ - (for arc in $(INC_LIB) ./libmysqld_int.a; do \ - arpath=`echo $$arc|sed 's|[^/]*$$||'|sed 's|\.libs/$$||'`; \ - artmp=`echo $$arc|sed 's|^.*/|tmp/lib-|'`; \ - for F in `$(AR) t $$arc | grep -v SYMDEF`; do \ - if test -e "$$arpath/$$F" ; then echo "$$arpath/$$F"; else \ - mkdir $$artmp; cd $$artmp > /dev/null; \ - $(AR) x ../../$$arc; \ - cd $$current_dir > /dev/null; \ - ls $$artmp/* | grep -v SYMDEF; \ - continue 2; fi; done; \ - done; echo $(libmysqld_a_DEPENDENCIES) ) | sort -u | xargs $(AR) cq libmysqld.a; \ - $(AR) r libmysqld.a $(storageobjects); \ - $(RANLIB) libmysqld.a ; \ - rm -rf tmp -endif - -## XXX: any time the client interface changes, we'll need to bump -## the version info for libmysqld; however, it's possible for the -## libmysqld interface to change without affecting the standard -## libmysqlclient interface. Should we make a separate version -## string for the two? -#libmysqld_la_LDFLAGS = -version-info @SHARED_LIB_VERSION@ -#CLEANFILES = $(libmysqld_la_LIBADD) libmysqld.la - -BUILT_SOURCES = link_sources - -CLEANFILES = $(BUILT_SOURCES) - -link_sources: - for f in $(sqlsources); do \ - rm -f $$f; \ - if test -e $(top_srcdir)/sql/$$f ; \ - then \ - @LN_CP_F@ $(top_srcdir)/sql/$$f $$f; \ - else \ - @LN_CP_F@ $(top_builddir)/sql/$$f $$f; \ - fi ; \ - done; \ - for f in $(libmysqlsources); do \ - rm -f $$f; \ - if test -e $(top_srcdir)/libmysql/$$f ; \ - then \ - @LN_CP_F@ $(top_srcdir)/libmysql/$$f $$f; \ - else \ - @LN_CP_F@ $(top_builddir)/libmysql/$$f $$f; \ - fi ; \ - done; \ - if test -n "$(sqlstoragesources)" ; \ - then \ - for f in "$(sqlstoragesources)"; do \ - rm -f "$$f"; \ - @LN_CP_F@ `find $(srcdir)/../sql -name "$$f"` "$$f"; \ - done; \ - fi; \ - if test -n "$(storagesources)" ; \ - then \ - rm -f $(storagesources); \ - for f in $(storagesourceslinks); do \ - @LN_CP_F@ $(top_srcdir)/$$f . ; \ - done; \ - fi; \ - rm -f client_settings.h; \ - @LN_CP_F@ $(top_srcdir)/libmysql/client_settings.h \ - client_settings.h; \ - echo timestamp > link_sources - - -clean-local: - rm -f `echo $(sqlsources) $(libmysqlsources) $(sqlstoragesources) $(storagesources) | sed "s;\.lo;.c;g"`; \ - rm -f client_settings.h diff --git a/libmysqld/examples/Makefile.am b/libmysqld/examples/Makefile.am deleted file mode 100644 index 66c40d88e29..00000000000 --- a/libmysqld/examples/Makefile.am +++ /dev/null @@ -1,53 +0,0 @@ -# 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 - -noinst_PROGRAMS = mysql -bin_PROGRAMS = mysqltest_embedded mysql_client_test_embedded -client_sources = $(nodist_mysqltest_embedded_SOURCES) $(nodist_mysql_SOURCES) -tests_sources = $(nodist_mysql_client_test_embedded_SOURCES) -BUILT_SOURCES = link_sources -CLEANFILES = $(client_sources) $(tests_sources) $(BUILT_SOURCES) -EXTRA_DIST = CMakeLists.txt - -link_sources: - for f in $(client_sources); do \ - rm -f $$f; \ - @LN_CP_F@ $(top_srcdir)/client/$$f $$f; \ - done; \ - for f in $(tests_sources); do \ - rm -f $$f; \ - @LN_CP_F@ $(top_srcdir)/tests/$$f $$f; \ - done - echo timestamp > link_sources - -DEFS = -DEMBEDDED_LIBRARY @DEFS@ -INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir) \ - -I$(top_srcdir) -I$(top_srcdir)/client -I$(top_srcdir)/regex \ - $(openssl_includes) -LIBS = @LIBS@ @WRAPLIBS@ @CLIENT_LIBS@ $(yassl_libs) -LDADD = @CLIENT_EXTRA_LDFLAGS@ ../libmysqld.a @LIBDL@ $(CXXLDFLAGS) \ - @NDB_SCI_LIBS@ - -mysqltest_embedded_LINK = $(CXXLINK) -nodist_mysqltest_embedded_SOURCES = mysqltest.cc -mysqltest_embedded_LDADD = $(LDADD) $(top_builddir)/regex/libregex.a \ - @MYSQLD_EXTRA_LDFLAGS@ - -nodist_mysql_SOURCES = mysql.cc readline.cc completion_hash.cc \ - my_readline.h sql_string.h completion_hash.h -mysql_LDADD = @readline_link@ @TERMCAP_LIB@ $(LDADD) - -mysql_client_test_embedded_LINK = $(CXXLINK) -nodist_mysql_client_test_embedded_SOURCES = mysql_client_test.c diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 1c9b773de15..b07ae1de96b 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -506,7 +506,8 @@ int init_embedded_server(int argc, char **argv, char **groups) orig_argc= *argcp; orig_argv= *argvp; - load_defaults("my", (const char **)groups, argcp, argvp); + if (load_defaults("my", (const char **)groups, argcp, argvp)) + return 1; defaults_argc= *argcp; defaults_argv= *argvp; remaining_argc= argc; diff --git a/libservices/CMakeLists.txt b/libservices/CMakeLists.txt index 396430fba12..300e0ce32a3 100644 --- a/libservices/CMakeLists.txt +++ b/libservices/CMakeLists.txt @@ -22,4 +22,4 @@ SET(MYSQLSERVICES_SOURCES my_thread_scheduler_service.c) ADD_LIBRARY(mysqlservices ${MYSQLSERVICES_SOURCES}) -INSTALL(TARGETS mysqlservices DESTINATION ${INSTALL_LIBDIR}) +INSTALL(TARGETS mysqlservices DESTINATION ${INSTALL_LIBDIR} COMPONENT Development) diff --git a/libservices/Makefile.am b/libservices/Makefile.am deleted file mode 100644 index d25c5c9680c..00000000000 --- a/libservices/Makefile.am +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 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 - -AM_CPPFLAGS = -I$(top_srcdir)/include -pkglib_LIBRARIES = libmysqlservices.a -libmysqlservices_a_SOURCES = my_snprintf_service.c thd_alloc_service.c \ - thd_wait_service.c \ - my_thread_scheduler_service.c -EXTRA_DIST = CMakeLists.txt diff --git a/man/CMakeLists.txt b/man/CMakeLists.txt index 7c96deada08..135d66634e4 100644 --- a/man/CMakeLists.txt +++ b/man/CMakeLists.txt @@ -21,8 +21,10 @@ IF(MAN1_FILES) IF(MAN1_EXCLUDE) LIST(REMOVE_ITEM MAN1_FILES ${MAN1_EXCLUDE}) ENDIF() - INSTALL(FILES ${MAN1_FILES} DESTINATION ${INSTALL_MANDIR}/man1) + INSTALL(FILES ${MAN1_FILES} DESTINATION ${INSTALL_MANDIR}/man1 + COMPONENT ManPages) ENDIF() IF(MAN8_FILES) - INSTALL(FILES ${MAN8_FILES} DESTINATION ${INSTALL_MANDIR}/man8) + INSTALL(FILES ${MAN8_FILES} DESTINATION ${INSTALL_MANDIR}/man8 + COMPONENT ManPages) ENDIF() diff --git a/man/Makefile.am b/man/Makefile.am deleted file mode 100644 index 027edccc249..00000000000 --- a/man/Makefile.am +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (C) 2000-2001, 2003-2006 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 - -man1_MANS = @man1_files@ -man8_MANS = @man8_files@ -EXTRA_DIST = $(man1_MANS) $(man8_MANS) CMakeLists.txt - -# "make_win_*" are not needed in Unix binary packages, -install-data-hook: - rm -f $(DESTDIR)$(mandir)/man1/make_win_* diff --git a/mysql-test/CMakeLists.txt b/mysql-test/CMakeLists.txt index 3c38e5772d0..f18b2ae341c 100644 --- a/mysql-test/CMakeLists.txt +++ b/mysql-test/CMakeLists.txt @@ -53,7 +53,8 @@ IF(UNIX) IF(INSTALL_MYSQLTESTDIR) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mtr ${CMAKE_CURRENT_BINARY_DIR}/mysql-test-run - DESTINATION ${INSTALL_MYSQLTESTDIR}) + DESTINATION ${INSTALL_MYSQLTESTDIR} + COMPONENT Test) ENDIF() ENDIF() diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am deleted file mode 100644 index 030a4823b36..00000000000 --- a/mysql-test/Makefile.am +++ /dev/null @@ -1,150 +0,0 @@ -# Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc. -# -# 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 - -testroot = $(prefix) -testdir = $(testroot)/mysql-test - -test_SCRIPTS = mtr \ - mysql-test-run \ - mysql-test-run.pl \ - mysql-stress-test.pl - -nobase_test_DATA = \ - valgrind.supp \ - lib/v1/mysql-test-run.pl \ - lib/v1/mtr_cases.pl \ - lib/v1/mtr_io.pl \ - lib/v1/mtr_report.pl \ - lib/v1/My/Config.pm \ - lib/v1/mtr_gcov.pl \ - lib/v1/mtr_match.pl \ - lib/v1/mtr_stress.pl \ - lib/v1/ndb_config_1_node.ini \ - lib/v1/ndb_config_2_node.ini \ - lib/v1/mtr_gprof.pl \ - lib/v1/mtr_misc.pl \ - lib/v1/mtr_timer.pl \ - lib/v1/mtr_im.pl \ - lib/v1/mtr_process.pl \ - lib/v1/mtr_unique.pl \ - lib/mtr_cases.pm \ - lib/mtr_gcov.pl \ - lib/mtr_gprof.pl \ - lib/mtr_io.pl \ - lib/mtr_match.pm \ - lib/mtr_misc.pl \ - lib/mtr_process.pl \ - lib/mtr_report.pm \ - lib/mtr_stress.pl \ - lib/mtr_unique.pm \ - lib/My/ConfigFactory.pm \ - lib/My/Config.pm \ - lib/My/Find.pm \ - lib/My/Handles.pm \ - lib/My/Options.pm \ - lib/My/Test.pm \ - lib/My/Platform.pm \ - lib/My/SafeProcess.pm \ - lib/My/File/Path.pm \ - lib/My/SysInfo.pm \ - lib/My/CoreDump.pm \ - lib/My/SafeProcess/Base.pm \ - lib/My/SafeProcess/safe_process.pl - -SUBDIRS = lib/My/SafeProcess - -EXTRA_DIST = README \ - $(test_SCRIPTS) \ - $(nobase_test_DATA) \ - CMakeLists.txt \ - mtr.out-of-source - - -# List of directories containing test + result files and the -# related test data files that should be copied -# If you want to add a new suite, please check DEFAULT_SUITES in -# mysql-test-run.pl. -TEST_DIRS = t r include std_data std_data/parts collections \ - std_data/ndb_backup50 std_data/ndb_backup51 \ - std_data/ndb_backup51_data_be std_data/ndb_backup51_data_le \ - std_data/funcs_1 \ - extra/binlog_tests/ extra/rpl_tests \ - suite/binlog suite/binlog/t suite/binlog/r suite/binlog/std_data \ - suite/bugs suite/bugs/data suite/bugs/t suite/bugs/r \ - suite/federated \ - suite/funcs_1 suite/funcs_1/bitdata \ - suite/funcs_1/include suite/funcs_1/lib suite/funcs_1/r \ - suite/funcs_1/t suite/funcs_1/views suite/funcs_1/cursors \ - suite/funcs_1/datadict suite/funcs_1/storedproc suite/funcs_1/triggers \ - suite/funcs_2 suite/funcs_2/charset suite/funcs_2/data \ - suite/funcs_2/include suite/funcs_2/lib suite/funcs_2/r \ - suite/funcs_2/t \ - suite/jp suite/jp/t suite/jp/r suite/jp/std_data suite/jp/include \ - suite/manual/t suite/manual/r \ - suite/ndb_team suite/ndb_team/t suite/ndb_team/r \ - suite/rpl suite/rpl/include suite/rpl/r \ - suite/rpl/t \ - suite/stress/include suite/stress/t suite/stress/r \ - suite/ndb suite/ndb/t suite/ndb/r \ - suite/rpl_ndb suite/rpl_ndb/t suite/rpl_ndb/r \ - suite/parts suite/parts/t suite/parts/r suite/parts/inc \ - suite/innodb suite/innodb/t suite/innodb/r suite/innodb/include \ - suite/engines suite/engines/funcs suite/engines/iuds suite/engines/rr_trx \ - suite/engines/funcs/r suite/engines/funcs/t suite/engines/iuds/r \ - suite/engines/iuds/t suite/engines/rr_trx/include suite/engines/rr_trx/r \ - suite/engines/rr_trx/t \ - suite/sys_vars suite/sys_vars/t suite/sys_vars/inc suite/sys_vars/r \ - suite/perfschema suite/perfschema/t suite/perfschema/r \ - suite/perfschema/include - -# Used by dist-hook and install-data-local to copy all -# test files into either dist or install directory -install_test_files: - @if test -z "$(INSTALL_TO_DIR)"; then \ - echo "Set INSTALL_TO_DIR!" && exit 1; \ - fi - @for dir in $(TEST_DIRS); do \ - from_dir="$(srcdir)/$$dir"; \ - to_dir="$(INSTALL_TO_DIR)/$$dir"; \ - $(mkinstalldirs) "$$to_dir"; \ - for f in `(cd $$from_dir && ls)`; do \ - if test -f "$$from_dir/$$f"; then \ - $(INSTALL_DATA) "$$from_dir/$$f" "$$to_dir/$$f" ; \ - fi; \ - done \ - done - -dist-hook: - $(MAKE) INSTALL_TO_DIR="$(distdir)" install_test_files - -install-data-local: - $(MAKE) INSTALL_TO_DIR="$(DESTDIR)$(testdir)" install_test_files - -uninstall-local: - @RM@ -f -r $(DESTDIR)$(testdir) - -# mtr - a shortcut for executing mysql-test-run.pl -mtr: - $(RM) -f mtr - $(LN_S) mysql-test-run.pl mtr - -# mysql-test-run - a shortcut for executing mysql-test-run.pl -mysql-test-run: - $(RM) -f mysql-test-run - $(LN_S) mysql-test-run.pl mysql-test-run diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental index 29046e9b8bc..818691e2e73 100644 --- a/mysql-test/collections/default.experimental +++ b/mysql-test/collections/default.experimental @@ -9,6 +9,7 @@ funcs_1.myisam_views @solaris # Bug#50595 2010-03-05 alik funcs_1.myi innodb.innodb_information_schema # Bug#48883 2010-05-11 alik Test "innodb_information_schema" takes fewer locks than expected main.func_math @freebsd # Bug#43020 2010-05-04 alik main.func_math fails on FreeBSD in PB2 +main.gis # Bug#52208 2010-11-24 alik gis fails on some platforms (Solaris, HP-UX, Linux) main.gis-rtree @freebsd # Bug#38965 2010-05-04 alik test cases gis-rtree, type_float, type_newdecimal fail in embedded server main.information_schema # Bug#47449 2009-09-19 alik main.information_schema and innodb.innodb_information_schema fail sporadically main.lock_multi_bug38499 # Bug#47448 2009-09-19 alik main.lock_multi_bug38499 times out sporadically @@ -16,6 +17,7 @@ main.lock_multi_bug38691 @solaris # Bug#47792 2009-10-02 alik main.lock_m main.log_tables # Bug#47924 2009-10-08 alik main.log_tables times out sporadically main.lowercase_table2 @darwin # Bug#55509 2010-07-26 alik main.lowercase_table2 fails on Mac OSX (again) main.outfile_loaddata @solaris # Bug#46895 2010-01-20 alik Test "outfile_loaddata" fails (reproducible) +main.show_check # Bug#58414 2010-11-24 alik Race condition in show_check.test main.signal_demo3 @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun main.sp @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun main.type_float @freebsd # Bug#38965 2010-05-04 alik test cases gis-rtree, type_float, type_newdecimal fail in embedded server @@ -24,10 +26,9 @@ main.wait_timeout @solaris # Bug#51244 2010-04-26 alik wait_timeou rpl.rpl_heartbeat_basic # BUG#54820 2010-06-26 alik rpl.rpl_heartbeat_basic fails sporadically again rpl.rpl_heartbeat_2slaves # BUG#43828 2009-10-22 luis fails sporadically rpl.rpl_innodb_bug28430* # Bug#46029 -rpl.rpl_innodb_bug30888* @solaris # Bug#47646 2009-09-25 alik rpl.rpl_innodb_bug30888 fails sporadically on Solaris -rpl.rpl_killed_ddl @windows # Bug#47638 2010-01-20 alik The rpl_killed_ddl test fails on Windows sys_vars.max_sp_recursion_depth_func @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun +sys_vars.plugin_dir_basic # Bug#52223 2010-11-24 alik Test "plugin_dir_basic" does not support RPM build (test) directory structure sys_vars.slow_query_log_func @solaris # Bug#54819 2010-06-26 alik sys_vars.slow_query_log_func fails sporadically on Solaris 10 sys_vars.wait_timeout_func # Bug#41255 2010-04-26 alik wait_timeout_func fails diff --git a/mysql-test/collections/default.weekly b/mysql-test/collections/default.weekly index d874c2f4519..33d13d8edfd 100644 --- a/mysql-test/collections/default.weekly +++ b/mysql-test/collections/default.weekly @@ -1,2 +1,2 @@ perl mysql-test-run.pl --timer --force --comment=1st --experimental=collections/default.experimental 1st -perl mysql-test-run.pl --timer --force --comment=big-tests --experimental=collections/default.experimental --vardir=var-big-tests --big-test --testcase-timeout=60 --suite-timeout=600 parts.part_supported_sql_func_innodb parts.partition_alter1_1_2_innodb parts.partition_alter1_1_2_ndb parts.partition_alter1_1_ndb parts.partition_alter1_2_innodb parts.partition_alter1_2_ndb parts.partition_alter2_1_1_innodb parts.partition_alter2_1_2_innodb parts.partition_alter2_2_2_innodb parts.partition_alter4_innodb main.variables-big rpl_ndb.rpl_truncate_7ndb_2 +perl mysql-test-run.pl --timer --force --comment=big-tests --experimental=collections/default.experimental --vardir=var-big-tests --big-test --testcase-timeout=60 --suite-timeout=600 large_tests.alter_table main.alter_table-big main.archive-big main.count_distinct3 main.create-big main.events_stress main.events_time_zone main.information_schema-big main.log_tables-big main.merge-big main.mysqlbinlog_row_big main.read_many_rows_innodb main.ssl-big main.sum_distinct-big main.type_newdecimal-big main.variables-big parts.part_supported_sql_func_innodb parts.partition_alter1_1_2_innodb parts.partition_alter1_1_2_ndb parts.partition_alter1_1_ndb parts.partition_alter1_2_innodb parts.partition_alter1_2_ndb parts.partition_alter2_1_1_innodb parts.partition_alter2_1_2_innodb parts.partition_alter2_2_2_innodb parts.partition_alter4_innodb rpl_ndb.rpl_truncate_7ndb_2 diff --git a/mysql-test/collections/mysql-5.5-bugteam.daily b/mysql-test/collections/mysql-5.5-bugteam.daily new file mode 100644 index 00000000000..81dffff91ce --- /dev/null +++ b/mysql-test/collections/mysql-5.5-bugteam.daily @@ -0,0 +1,5 @@ +perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed +perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=ps_row --vardir=var-ps_row --ps-protocol --mysqld=--binlog-format=row +perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=embedded --vardir=var-emebbed --embedded +perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1 +perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=rpl_binlog_row --vardir=var-rpl_binlog_row --mysqld=--binlog-format=row --suite=rpl,binlog --skip-ndb diff --git a/mysql-test/collections/mysql-5.5-bugteam.push b/mysql-test/collections/mysql-5.5-bugteam.push new file mode 100644 index 00000000000..06118ed9e1e --- /dev/null +++ b/mysql-test/collections/mysql-5.5-bugteam.push @@ -0,0 +1,4 @@ +perl mysql-test-run.pl --timer --force --parallel=auto --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --experimental=collections/default.experimental --skip-ndb --skip-test-list=collections/disabled-per-push.list +perl mysql-test-run.pl --timer --force --parallel=auto --comment=main_ps_row --vardir=var-main-ps_row --suite=main --ps-protocol --mysqld=--binlog-format=row --experimental=collections/default.experimental --skip-ndb --skip-test-list=collections/disabled-per-push.list +perl mysql-test-run.pl --timer --force --parallel=auto --comment=main_embedded --vardir=var-main_emebbed --suite=main --embedded --experimental=collections/default.experimental --skip-ndb +perl mysql-test-run.pl --timer --force --parallel=auto --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1 --experimental=collections/default.experimental --skip-ndb diff --git a/mysql-test/extra/binlog_tests/binlog_truncate.test b/mysql-test/extra/binlog_tests/binlog_truncate.test index 24cf363f780..d434f792db0 100644 --- a/mysql-test/extra/binlog_tests/binlog_truncate.test +++ b/mysql-test/extra/binlog_tests/binlog_truncate.test @@ -12,13 +12,13 @@ eval CREATE TABLE t1 (a INT) ENGINE=$engine; eval CREATE TABLE t2 (a INT) ENGINE=$engine; INSERT INTO t2 VALUES (1),(2),(3); let $binlog_start = query_get_value("SHOW MASTER STATUS", Position, 1); -if (`select length('$before_truncate') > 0`) { +if ($before_truncate) { eval $before_truncate; } --echo **** Truncate of empty table shall be logged TRUNCATE TABLE t1; -if (`select length('$before_truncate') > 0`) { +if ($before_truncate) { eval $before_truncate; } TRUNCATE TABLE t2; @@ -35,7 +35,7 @@ eval CREATE TABLE t2 (a INT) ENGINE=$engine; INSERT INTO t1 VALUES (1),(2); let $binlog_start = query_get_value("SHOW MASTER STATUS", Position, 1); -if (`select length('$before_truncate') > 0`) { +if ($before_truncate) { eval $before_truncate; } diff --git a/mysql-test/extra/binlog_tests/blackhole.test b/mysql-test/extra/binlog_tests/blackhole.test index c694c34622f..90146d41471 100644 --- a/mysql-test/extra/binlog_tests/blackhole.test +++ b/mysql-test/extra/binlog_tests/blackhole.test @@ -173,7 +173,7 @@ insert into t1 values(2); rollback; let $master_log_pos_2= query_get_value(SHOW MASTER STATUS, Position, 1); -if (`SELECT $master_log_pos_2 <> $master_log_pos_1`) +if ($master_log_pos_2 != $master_log_pos_1) { echo $master_log_pos_1 $master_log_pos_2; die Rollbacked transaction has been binlogged; diff --git a/mysql-test/extra/binlog_tests/implicit.test b/mysql-test/extra/binlog_tests/implicit.test index 84d80288d36..de906fc0605 100644 --- a/mysql-test/extra/binlog_tests/implicit.test +++ b/mysql-test/extra/binlog_tests/implicit.test @@ -6,7 +6,7 @@ INSERT INTO t1 VALUES (1); source include/show_binlog_events.inc; eval $statement; source include/show_binlog_events.inc; -if (`select '$cleanup' != ''`) { +if ($cleanup) { eval $cleanup; } @@ -22,7 +22,7 @@ INSERT INTO t1 VALUES (3); source include/show_binlog_events.inc; COMMIT; source include/show_binlog_events.inc; -if (`select '$cleanup' != ''`) { +if ($cleanup) { eval $cleanup; } diff --git a/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test b/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test index 6bf9a27afaf..040da1959dc 100644 --- a/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test +++ b/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test @@ -319,7 +319,7 @@ if (`select @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`) { --let $binlog_rollback= query_get_value(SHOW BINLOG EVENTS, Pos, 7) --let $binlog_query= query_get_value(SHOW BINLOG EVENTS, Info, 7) - if (`SELECT 'ROLLBACK' != '$binlog_query'`) { + if ($binlog_query != ROLLBACK) { --echo Wrong query from SHOW BINLOG EVENTS. Expected ROLLBACK, got '$binlog_query' --source include/show_rpl_debug_info.inc --die Wrong value for slave parameter diff --git a/mysql-test/extra/rpl_tests/create_recursive_construct.inc b/mysql-test/extra/rpl_tests/create_recursive_construct.inc index ac10ab8ddb2..6e130a8154f 100644 --- a/mysql-test/extra/rpl_tests/create_recursive_construct.inc +++ b/mysql-test/extra/rpl_tests/create_recursive_construct.inc @@ -167,7 +167,9 @@ --let $CRC_create= ######## func_retval ######## -if (`SELECT $CRC_ARG_type = 0 AND '$CRC_ARG_value' != ''`) { +# if inside if in lieu of AND operand +if ($CRC_ARG_type == 0) { + if ($CRC_ARG_value) { # It will be safe to call this function and discard the return # value, but it will be unsafe to use return value (e.g., in # INSERT...SELECT). @@ -180,10 +182,11 @@ if (`SELECT $CRC_ARG_type = 0 AND '$CRC_ARG_value' != ''`) { --let $CRC_RET_drop= DROP FUNCTION $CRC_name --let $CRC_RET_is_toplevel= 0 --let $CRC_RET_desc= function $CRC_name returning value from $CRC_ARG_desc + } } ######## func_sidef ######## -if (`SELECT $CRC_ARG_type = 1`) { +if ($CRC_ARG_type == 1) { # It will be unsafe to call func even if you discard return value. --let $CRC_name= func_sidef_$CRC_ARG_level --let $CRC_create= CREATE FUNCTION $CRC_name() RETURNS VARCHAR(100) BEGIN INSERT INTO ta$CRC_ARG_level VALUES (47); $CRC_ARG_stmt_sidef; RETURN 0; END @@ -197,7 +200,7 @@ if (`SELECT $CRC_ARG_type = 1`) { } ######## proc ######## -if (`SELECT $CRC_ARG_type = 2`) { +if ($CRC_ARG_type == 2) { # It will be unsafe to call this procedure. --let $CRC_name= proc_$CRC_ARG_level --let $CRC_create= CREATE PROCEDURE $CRC_name() BEGIN $CRC_ARG_stmt_sidef; INSERT INTO ta$CRC_ARG_level VALUES (47); END @@ -211,7 +214,7 @@ if (`SELECT $CRC_ARG_type = 2`) { } ######## trig ######## -if (`SELECT $CRC_ARG_type = 3`) { +if ($CRC_ARG_type == 3) { # It will be unsafe to invoke this trigger. --let $CRC_name= trig_$CRC_ARG_level --let $CRC_create= CREATE TRIGGER $CRC_name BEFORE INSERT ON trigger_table_$CRC_ARG_level FOR EACH ROW BEGIN INSERT INTO ta$CRC_ARG_level VALUES (47); $CRC_ARG_stmt_sidef; END @@ -225,7 +228,8 @@ if (`SELECT $CRC_ARG_type = 3`) { } ######## view_retval ######## -if (`SELECT $CRC_ARG_type = 4 AND '$CRC_ARG_sel_retval' != ''`) { +if ($CRC_ARG_type == 4) { + if ($CRC_ARG_sel_retval) { # It will be safe to select from this view if you discard the result # set, but unsafe to use result set (e.g., in INSERT..SELECT). --let $CRC_name= view_retval_$CRC_ARG_level @@ -237,10 +241,12 @@ if (`SELECT $CRC_ARG_type = 4 AND '$CRC_ARG_sel_retval' != ''`) { --let $CRC_RET_drop= DROP VIEW $CRC_name --let $CRC_RET_is_toplevel= 0 --let $CRC_RET_desc= view $CRC_name returning value from $CRC_ARG_desc + } } ######## view_sidef ######## -if (`SELECT $CRC_ARG_type = 5 AND '$CRC_ARG_sel_sidef' != ''`) { +if ($CRC_ARG_type == 5) { + if ($CRC_ARG_sel_sidef) { # It will be unsafe to select from this view, even if you discard # the return value. --let $CRC_name= view_sidef_$CRC_ARG_level @@ -252,10 +258,11 @@ if (`SELECT $CRC_ARG_type = 5 AND '$CRC_ARG_sel_sidef' != ''`) { --let $CRC_RET_drop= DROP VIEW $CRC_name --let $CRC_RET_is_toplevel= 0 --let $CRC_RET_desc= view $CRC_name invoking $CRC_ARG_desc + } } ######## prep ######## -if (`SELECT $CRC_ARG_type = 6`) { +if ($CRC_ARG_type == 6) { # It will be unsafe to execute this prepared statement --let $CRC_name= prep_$CRC_ARG_level --let $CRC_create= PREPARE $CRC_name FROM "$CRC_ARG_stmt_sidef" @@ -269,7 +276,7 @@ if (`SELECT $CRC_ARG_type = 6`) { } ######## no recursive construct: just return the given statement ######## -if (`SELECT $CRC_ARG_type = 7`) { +if ($CRC_ARG_type == 7) { # CRC_ARG_type=7 is a special case. We just set $CRC_RET_x = # $CRC_ARG_x. This way, the $CRC_ARG_stmt gets executed directly # (below). In binlog_unsafe.test, it is used to invoke the unsafe @@ -285,17 +292,17 @@ if (`SELECT $CRC_ARG_type = 7`) { } ######## execute! ######## -if (`SELECT '$CRC_RET_stmt_sidef' != ''`) { +if ($CRC_RET_stmt_sidef) { --echo --echo Invoking $CRC_RET_desc. - if (`SELECT '$CRC_create' != ''`) { + if ($CRC_create) { --eval $CRC_create } --echo * binlog_format = STATEMENT: expect $CRC_ARG_expected_number_of_warnings warnings. --eval $CRC_RET_stmt_sidef --let $n_warnings= `SHOW COUNT(*) WARNINGS` - if (`SELECT '$n_warnings' != '$CRC_ARG_expected_number_of_warnings'`) { + if ($n_warnings != $CRC_ARG_expected_number_of_warnings) { --echo ******** Failure! Expected $CRC_ARG_expected_number_of_warnings warnings, got $n_warnings warnings. ******** SHOW WARNINGS; SHOW BINLOG EVENTS; @@ -312,14 +319,14 @@ if (`SELECT '$CRC_RET_stmt_sidef' != ''`) { RESET MASTER; --eval $CRC_RET_stmt_sidef --let $n_warnings= `SHOW COUNT(*) WARNINGS` - if (`SELECT '$n_warnings' != '0'`) { + if ($n_warnings) { --echo ******** Failure! Expected 0 warnings, got $n_warnings warnings. ******** SHOW WARNINGS; SHOW BINLOG EVENTS; --die Wrong number of warnings. } --let $binlog_event= query_get_value(SHOW BINLOG EVENTS, Event_type, 2) - if (`SELECT '$binlog_event' != 'No such row'`) { + if ($binlog_event != No such row) { --enable_query_log --echo ******** Failure! Something was written to the binlog despite SQL_LOG_BIN=0 ******** SHOW BINLOG EVENTS; @@ -332,7 +339,7 @@ if (`SELECT '$CRC_RET_stmt_sidef' != ''`) { RESET MASTER; --eval $CRC_RET_stmt_sidef --let $n_warnings= `SHOW COUNT(*) WARNINGS` - if (`SELECT '$n_warnings' != '0'`) { + if ($n_warnings) { --echo ******** Failure! Expected 0 warnings, got $n_warnings warnings. ******** SHOW WARNINGS; SHOW BINLOG EVENTS; @@ -365,7 +372,7 @@ if (`SELECT '$CRC_RET_stmt_sidef' != ''`) { # Invoke created object, discarding the return value. This should not # give any warning. -if (`SELECT '$CRC_RET_sel_retval' != ''`) { +if ($CRC_RET_sel_retval) { --echo * Invoke statement so that return value is dicarded: expect no warning. --disable_result_log --eval $CRC_RET_sel_retval @@ -375,7 +382,7 @@ if (`SELECT '$CRC_RET_sel_retval' != ''`) { # fail. When the bug is fixed, we should execute the following. #--let $n_warnings= `SHOW COUNT(*) WARNINGS` - #if (`SELECT '$n_warnings' != '0'`) { + #if ($n_warnings) { # --enable_query_log # --echo Failure! Expected 0 warnings, got $n_warnings warnings. # SHOW WARNINGS; diff --git a/mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.inc b/mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.inc index 8e89cde004d..094e84537db 100644 --- a/mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.inc +++ b/mysql-test/extra/rpl_tests/rpl_drop_create_temp_table.inc @@ -35,7 +35,7 @@ if (`SELECT HEX(@commands) = HEX('configure')`) # when a command ends. # --let $n= $tot_table - while (`SELECT $n != 0`) + while ($n) { --eval DROP TEMPORARY TABLE IF EXISTS nt_tmp_$n --eval CREATE TEMPORARY TABLE nt_tmp_$n ( id INT ) ENGINE = MyIsam @@ -62,7 +62,7 @@ if (`SELECT HEX(@commands) = HEX('configure')`) # when a command ends. # --let $n= $tot_table - while (`SELECT $n != 0`) + while ($n) { --eval DROP TEMPORARY TABLE IF EXISTS tt_tmp_$n --eval CREATE TEMPORARY TABLE tt_tmp_$n ( id INT ) ENGINE = Innodb @@ -89,7 +89,7 @@ if (`SELECT HEX(@commands) = HEX('configure')`) # when a command ends. # --let $n= $tot_table - while (`SELECT $n != 0`) + while ($n) { --eval DROP TABLE IF EXISTS nt_$n --eval CREATE TABLE nt_$n ( id INT ) ENGINE = MyIsam @@ -116,7 +116,7 @@ if (`SELECT HEX(@commands) = HEX('configure')`) # when a command ends. # --let $n= $tot_table - while (`SELECT $n != 0`) + while ($n) { --eval DROP TABLE IF EXISTS tt_$n --eval CREATE TABLE tt_$n ( id INT ) ENGINE = Innodb @@ -163,14 +163,14 @@ if (`SELECT HEX(@commands) = HEX('clean')`) DROP TABLE IF EXISTS nt_xx_1; --let $n= $tot_table - while (`SELECT $n != 0`) + while ($n) { --eval DROP TABLE IF EXISTS nt_$n --dec $n } --let $n= $tot_table - while (`SELECT $n != 0`) + while ($n) { --eval DROP TABLE IF EXISTS tt_$n --dec $n @@ -634,11 +634,11 @@ while (`SELECT HEX(@commands) != HEX('')`) { --let $dropped_temp= $table } - if (`SELECT $n = 1`) + if ($n == 1) { --let $table_1= $table } - if (`SELECT $n = 2`) + if ($n == 2) { --let $table_2= $table } @@ -886,7 +886,7 @@ while (`SELECT HEX(@commands) != HEX('')`) --let $available_n_temp= --let $dropped_n_temp= --let $n= $tot_table - while (`SELECT $n != 0`) + while ($n) { --eval DROP TEMPORARY TABLE IF EXISTS nt_tmp_$n --eval CREATE TEMPORARY TABLE nt_tmp_$n ( id INT ) ENGINE = MyIsam @@ -905,7 +905,7 @@ while (`SELECT HEX(@commands) != HEX('')`) --let $available_t_temp= --let $dropped_t_temp= --let $n= $tot_table - while (`SELECT $n != 0`) + while ($n) { --eval DROP TEMPORARY TABLE IF EXISTS tt_tmp_$n --eval CREATE TEMPORARY TABLE tt_tmp_$n ( id INT ) ENGINE = Innodb @@ -924,7 +924,7 @@ while (`SELECT HEX(@commands) != HEX('')`) --let $available_t= --let $dropped_t= --let $n= $tot_table - while (`SELECT $n != 0`) + while ($n) { --eval DROP TABLE IF EXISTS tt_$n --eval CREATE TABLE tt_$n ( id INT ) ENGINE = Innodb @@ -943,7 +943,7 @@ while (`SELECT HEX(@commands) != HEX('')`) --let $available_n= --let $dropped_n= --let $n= $tot_table - while (`SELECT $n != 0`) + while ($n) { --eval DROP TABLE IF EXISTS nt_$n --eval CREATE TABLE nt_$n ( id INT ) ENGINE = MyIsam diff --git a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test b/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test index 568cf802763..77b7e9a57ea 100644 --- a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test +++ b/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test @@ -406,7 +406,7 @@ sync_slave_with_master; # Error reaction is up to sql_mode of the slave sql (bug#38173) #--echo *** Create t9 on slave *** # Please, check BUG#47741 to see why you are not testing NDB. -if (`SELECT $engine_type != 'NDB'`) +if ($engine_type != NDB) { STOP SLAVE; RESET SLAVE; diff --git a/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test b/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test index 66bd61a8ea9..40e155bc314 100644 --- a/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test +++ b/mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test @@ -34,7 +34,7 @@ # connection slave; -if (`SELECT $debug_sync_action = ''`) +if (!$debug_sync_action) { --die Cannot continue. Please set value for debug_sync_action. } diff --git a/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test b/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test index 14368ba4321..bbd4969ef40 100644 --- a/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test +++ b/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test @@ -33,7 +33,7 @@ INSERT INTO tt_2(ddl_case) VALUES(0); --echo ######################################################################### SET AUTOCOMMIT= 0; let $ddl_cases= 41; -while (`SELECT $ddl_cases >= 1`) +while ($ddl_cases >= 1) { --echo -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- let $in_temporary= "no"; @@ -76,7 +76,7 @@ while (`SELECT $ddl_cases >= 1`) # 6: ROW EVENT # 7: COMMIT # - if (`select '$engine' = 'NDB'`) + if ($engine == NDB) { let $commit_event_row_number= 7; } @@ -84,10 +84,10 @@ while (`SELECT $ddl_cases >= 1`) let $first_binlog_position= query_get_value("SHOW MASTER STATUS", Position, 1); --enable_query_log eval INSERT INTO tt_1(ddl_case) VALUES ($ddl_cases); - if (`SELECT $ddl_cases = 41`) + if ($ddl_cases == 41) { let $cmd= LOAD INDEX INTO CACHE nt_1 IGNORE LEAVES; - if (`SELECT '$engine' = 'NDB'`) + if ($engine == NDB) { # This seems to be related to epochs. # We need to check this against an updated version or avoid it. @@ -95,7 +95,7 @@ while (`SELECT $ddl_cases >= 1`) let $commit_event_row_number= 6; } } - if (`SELECT $ddl_cases = 40`) + if ($ddl_cases == 40) { let $cmd= LOAD INDEX INTO CACHE tt_1, tt_2 IGNORE LEAVES; # @@ -109,16 +109,16 @@ while (`SELECT $ddl_cases >= 1`) # 5: ROW EVENT # 6: COMMIT # - if (`SELECT '$engine' = 'NDB'`) + if ($engine == NDB) { let $commit_event_row_number= 6; } } - if (`SELECT $ddl_cases = 39`) + if ($ddl_cases == 39) { let $cmd= ANALYZE TABLE nt_1; } - if (`SELECT $ddl_cases = 38`) + if ($ddl_cases == 38) { let $cmd= CHECK TABLE nt_1; # @@ -132,20 +132,20 @@ while (`SELECT $ddl_cases >= 1`) # 5: ROW EVENT # 6: COMMIT # - if (`SELECT '$engine' = 'NDB'`) + if ($engine == NDB) { let $commit_event_row_number= 6; } } - if (`SELECT $ddl_cases = 37`) + if ($ddl_cases == 37) { let $cmd= OPTIMIZE TABLE nt_1; } - if (`SELECT $ddl_cases = 36`) + if ($ddl_cases == 36) { let $cmd= REPAIR TABLE nt_1; } - if (`SELECT $ddl_cases = 35`) + if ($ddl_cases == 35) { let $cmd= LOCK TABLES tt_1 WRITE; # @@ -159,12 +159,12 @@ while (`SELECT $ddl_cases >= 1`) # 5: ROW EVENT # 6: COMMIT # - if (`SELECT '$engine' = 'NDB'`) + if ($engine == NDB) { let $commit_event_row_number= 6; } } - if (`SELECT $ddl_cases = 34`) + if ($ddl_cases == 34) { let $cmd= UNLOCK TABLES; # @@ -178,20 +178,20 @@ while (`SELECT $ddl_cases >= 1`) # 5: ROW EVENT # 6: COMMIT # - if (`SELECT '$engine' = 'NDB'`) + if ($engine == NDB) { let $commit_event_row_number= 6; } } - if (`SELECT $ddl_cases = 33`) + if ($ddl_cases == 33) { let $cmd= CREATE USER 'user'@'localhost'; } - if (`SELECT $ddl_cases = 32`) + if ($ddl_cases == 32) { let $cmd= GRANT ALL ON *.* TO 'user'@'localhost'; } - if (`SELECT $ddl_cases = 31`) + if ($ddl_cases == 31) { let $cmd= SET PASSWORD FOR 'user'@'localhost' = PASSWORD('newpass'); # @@ -231,35 +231,35 @@ while (`SELECT $ddl_cases >= 1`) let $commit_event_row_number= 7; } } - if (`SELECT $ddl_cases = 30`) + if ($ddl_cases == 30) { let $cmd= REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user'@'localhost'; } - if (`SELECT $ddl_cases = 29`) + if ($ddl_cases == 29) { let $cmd= RENAME USER 'user'@'localhost' TO 'user_new'@'localhost'; } - if (`SELECT $ddl_cases = 28`) + if ($ddl_cases == 28) { let $cmd= DROP USER 'user_new'@'localhost'; } - if (`SELECT $ddl_cases = 27`) + if ($ddl_cases == 27) { let $cmd= CREATE EVENT evt ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT * FROM tt_1; } - if (`SELECT $ddl_cases = 26`) + if ($ddl_cases == 26) { let $cmd= ALTER EVENT evt COMMENT 'evt'; } - if (`SELECT $ddl_cases = 25`) + if ($ddl_cases == 25) { let $cmd= DROP EVENT evt; } - if (`SELECT $ddl_cases = 24`) + if ($ddl_cases == 24) { let $cmd= CREATE TRIGGER tr AFTER INSERT ON tt_1 FOR EACH ROW UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case; } - if (`SELECT $ddl_cases = 23`) + if ($ddl_cases == 23) { let $cmd= DROP TRIGGER tr; # @@ -277,43 +277,43 @@ while (`SELECT $ddl_cases >= 1`) let $commit_event_row_number= 5; } } - if (`SELECT $ddl_cases = 22`) + if ($ddl_cases == 22) { let $cmd= CREATE FUNCTION fc () RETURNS VARCHAR(64) RETURN "fc"; } - if (`SELECT $ddl_cases = 21`) + if ($ddl_cases == 21) { let $cmd= ALTER FUNCTION fc COMMENT 'fc'; } - if (`SELECT $ddl_cases = 20`) + if ($ddl_cases == 20) { let $cmd= DROP FUNCTION fc; } - if (`SELECT $ddl_cases = 19`) + if ($ddl_cases == 19) { let $cmd= CREATE PROCEDURE pc () UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case; } - if (`SELECT $ddl_cases = 18`) + if ($ddl_cases == 18) { let $cmd= ALTER PROCEDURE pc COMMENT 'pc'; } - if (`SELECT $ddl_cases = 17`) + if ($ddl_cases == 17) { let $cmd= DROP PROCEDURE pc; } - if (`SELECT $ddl_cases = 16`) + if ($ddl_cases == 16) { let $cmd= CREATE VIEW v AS SELECT * FROM tt_1; } - if (`SELECT $ddl_cases = 15`) + if ($ddl_cases == 15) { let $cmd= ALTER VIEW v AS SELECT * FROM tt_1; } - if (`SELECT $ddl_cases = 14`) + if ($ddl_cases == 14) { let $cmd= DROP VIEW v; } - if (`SELECT $ddl_cases = 13`) + if ($ddl_cases == 13) { let $cmd= CREATE INDEX ix ON tt_1(ddl_case); # @@ -328,12 +328,12 @@ while (`SELECT $ddl_cases >= 1`) # 6: COMMIT # 7: DDL EVENT which triggered the previous commmit. # - if (`SELECT '$engine' = 'NDB'`) + if ($engine == NDB) { let $commit_event_row_number= 6; } } - if (`SELECT $ddl_cases = 12`) + if ($ddl_cases == 12) { let $cmd= DROP INDEX ix ON tt_1; # @@ -348,12 +348,12 @@ while (`SELECT $ddl_cases >= 1`) # 6: COMMIT # 7: DDL EVENT which triggered the previous commmit. # - if (`SELECT '$engine' = 'NDB'`) + if ($engine == NDB) { let $commit_event_row_number= 6; } } - if (`SELECT $ddl_cases = 11`) + if ($ddl_cases == 11) { let $cmd= CREATE TEMPORARY TABLE tt_xx (a int); let $in_temporary= "yes"; @@ -411,7 +411,7 @@ while (`SELECT $ddl_cases >= 1`) let $commit_event_row_number= 9; } } - if (`SELECT $ddl_cases = 10`) + if ($ddl_cases == 10) { let $cmd= ALTER TABLE tt_xx ADD COLUMN (b int); # @@ -438,12 +438,12 @@ while (`SELECT $ddl_cases >= 1`) # 5: ROW EVENT # 6: COMMIT # - if (`SELECT '$engine' = 'NDB'`) + if ($engine == NDB) { let $commit_event_row_number= 6; } } - if (`SELECT $ddl_cases = 9`) + if ($ddl_cases == 9) { let $cmd= ALTER TABLE tt_xx RENAME new_tt_xx; # @@ -470,12 +470,12 @@ while (`SELECT $ddl_cases >= 1`) # 5: ROW EVENT # 6: COMMIT # - if (`SELECT '$engine' = 'NDB'`) + if ($engine == NDB) { let $commit_event_row_number= 6; } } - if (`SELECT $ddl_cases = 8`) + if ($ddl_cases == 8) { let $cmd= DROP TEMPORARY TABLE IF EXISTS new_tt_xx; let $in_temporary= "yes"; @@ -528,7 +528,7 @@ while (`SELECT $ddl_cases >= 1`) # 8: ROW EVENT # 9: COMMIT # - if (`SELECT '$engine' = 'NDB'`) + if ($engine == NDB) { let $commit_event_row_number= 9; } @@ -551,27 +551,27 @@ while (`SELECT $ddl_cases >= 1`) let $commit_event_row_number= 9; } } - if (`SELECT $ddl_cases = 7`) + if ($ddl_cases == 7) { let $cmd= CREATE TABLE tt_xx (a int); } - if (`SELECT $ddl_cases = 6`) + if ($ddl_cases == 6) { let $cmd= ALTER TABLE tt_xx ADD COLUMN (b int); } - if (`SELECT $ddl_cases = 5`) + if ($ddl_cases == 5) { let $cmd= RENAME TABLE tt_xx TO new_tt_xx; } - if (`SELECT $ddl_cases = 4`) + if ($ddl_cases == 4) { let $cmd= TRUNCATE TABLE new_tt_xx; } - if (`SELECT $ddl_cases = 3`) + if ($ddl_cases == 3) { let $cmd= DROP TABLE IF EXISTS tt_xx, new_tt_xx; } - if (`SELECT $ddl_cases = 2`) + if ($ddl_cases == 2) { let $cmd= CREATE DATABASE db; # @@ -586,12 +586,12 @@ while (`SELECT $ddl_cases >= 1`) # 6: COMMIT # 7: DDL EVENT which triggered the previous commmit. # - if (`SELECT '$engine' = 'NDB'`) + if ($engine == NDB) { let $commit_event_row_number= 6; } } - if (`SELECT $ddl_cases = 1`) + if ($ddl_cases == 1) { let $cmd= DROP DATABASE IF EXISTS db; # @@ -606,7 +606,7 @@ while (`SELECT $ddl_cases >= 1`) # 6: COMMIT # 7: DDL EVENT which triggered the previous commmit. # - if (`SELECT '$engine' = 'NDB'`) + if ($engine == NDB) { let $commit_event_row_number= 6; } @@ -618,14 +618,14 @@ while (`SELECT $ddl_cases >= 1`) # commit. The flag in_temporary is used to avoid aborting the test in such # cases. Thus we force the commit. # - if (`SELECT $in_temporary = "yes"`) + if ($in_temporary == "yes") { --eval COMMIT } let $event_commit= query_get_value("SHOW BINLOG EVENTS FROM $first_binlog_position", Info, $commit_event_row_number); if (`SELECT SUBSTRING("$event_commit",1,6) != "COMMIT"`) { - if (`SELECT $ok = "yes"`) + if ($ok == "yes") { --echo it *does not* commit the current transaction. --echo $cmd diff --git a/mysql-test/extra/rpl_tests/rpl_insert_delayed.test b/mysql-test/extra/rpl_tests/rpl_insert_delayed.test index 7fd3451184a..d158b6595ba 100644 --- a/mysql-test/extra/rpl_tests/rpl_insert_delayed.test +++ b/mysql-test/extra/rpl_tests/rpl_insert_delayed.test @@ -121,7 +121,7 @@ if (`SELECT @@global.binlog_format = 'STATEMENT'`) # The second INSERT DELAYED statement is the 5 item if two INSERT DELAYED are # handled separately - if (`SELECT '$stmt' = 'COMMIT'`) + if ($stmt == COMMIT) { --let $stmt= query_get_value(SHOW BINLOG EVENTS IN '$binlog_file' FROM $_start, Info, 5) } diff --git a/mysql-test/extra/rpl_tests/rpl_insert_id_pk.test b/mysql-test/extra/rpl_tests/rpl_insert_id_pk.test index 844f93d0906..4a20fc48ac4 100644 --- a/mysql-test/extra/rpl_tests/rpl_insert_id_pk.test +++ b/mysql-test/extra/rpl_tests/rpl_insert_id_pk.test @@ -85,4 +85,5 @@ INSERT INTO t1 VALUES (1),(1); sync_slave_with_master; connection master; drop table t1; +sync_slave_with_master; # End of 4.1 tests diff --git a/mysql-test/extra/rpl_tests/rpl_loaddata.test b/mysql-test/extra/rpl_tests/rpl_loaddata.test index ed89bd66531..ea2cc7b10ad 100644 --- a/mysql-test/extra/rpl_tests/rpl_loaddata.test +++ b/mysql-test/extra/rpl_tests/rpl_loaddata.test @@ -25,7 +25,7 @@ CALL mtr.add_suppression("Unsafe statement written to the binary log using state # MTR is not case-sensitive. let $lower_stmt_head= load data; let $UPPER_STMT_HEAD= LOAD DATA; -if (`SELECT '$lock_option' <> ''`) +if ($lock_option) { #if $lock_option is null, an extra blank is added into the statement, #this will change the result of rpl_loaddata test case. so $lock_option diff --git a/mysql-test/extra/rpl_tests/rpl_not_null.test b/mysql-test/extra/rpl_tests/rpl_not_null.test index 58dbd9ce29f..290a0a0173f 100644 --- a/mysql-test/extra/rpl_tests/rpl_not_null.test +++ b/mysql-test/extra/rpl_tests/rpl_not_null.test @@ -177,7 +177,7 @@ sync_slave_with_master; #--source include/wait_for_slave_to_start.inc # #let $y=0; -#while (`select $y < 6`) +#while ($y < 6) #{ # connection master; # @@ -202,21 +202,21 @@ sync_slave_with_master; # `c` INT DEFAULT 500, # PRIMARY KEY(`a`)) ENGINE=$engine DEFAULT CHARSET=LATIN1; # -# if (`select $y=0`) +# if ($y==0) # { # --echo ************* EXECUTION WITH INSERTS ************* # connection master; # INSERT INTO t1(a) VALUES (1); # } # -# if (`select $y=1`) +# if ($y==1) # { # --echo ************* EXECUTION WITH INSERTS ************* # connection master; # INSERT INTO t1(a, b) VALUES (1, NULL); # } # -# if (`select $y=2`) +# if ($y==2) # { # --echo ************* EXECUTION WITH UPDATES ************* # connection master; @@ -225,14 +225,14 @@ sync_slave_with_master; # UPDATE t3 SET b = NULL where a= 1; # } # -# if (`select $y=3`) +# if ($y==3) # { # --echo ************* EXECUTION WITH INSERTS/REPLACES ************* # connection master; # REPLACE INTO t3(a, b) VALUES (1, null); # } # -# if (`select $y=4`) +# if ($y==4) # { # --echo ************* EXECUTION WITH UPDATES/REPLACES ************* # connection master; @@ -240,7 +240,7 @@ sync_slave_with_master; # REPLACE INTO t3(a, b) VALUES (1, null); # } # -# if (`select $y=5`) +# if ($y==5) # { # --echo ************* EXECUTION WITH MULTI-ROW INSERTS ************* # connection master; diff --git a/mysql-test/extra/rpl_tests/rpl_row_sp003.test b/mysql-test/extra/rpl_tests/rpl_row_sp003.test index 7bc326a3791..d2c2ea0caf3 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_sp003.test +++ b/mysql-test/extra/rpl_tests/rpl_row_sp003.test @@ -35,10 +35,23 @@ connection master1; send CALL test.p1(); connection master; -# To make sure tha the call on master1 arrived at the get_lock -sleep 1; +# Make sure that the call on master1 arrived at the get_lock. +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where state = 'User lock' and + info = 'SELECT get_lock("test", 100)'; +--source include/wait_condition.inc CALL test.p2(); SELECT release_lock("test"); + +connection master1; +# Reap CALL test.p1() to ensure that it has fully completed +# before doing any selects on test.t1. +--reap +# Release lock acquired by it. +SELECT release_lock("test"); + +connection master; SELECT * FROM test.t1; #show binlog events; --source include/wait_for_ndb_to_binlog.inc @@ -51,6 +64,7 @@ DROP TABLE IF EXISTS test.t1; eval CREATE TABLE test.t1(a INT,PRIMARY KEY(a))ENGINE=$engine_type; CALL test.p2(); CALL test.p1(); +SELECT release_lock("test"); SELECT * FROM test.t1; sync_slave_with_master; diff --git a/mysql-test/extra/rpl_tests/rpl_start_stop_slave.test b/mysql-test/extra/rpl_tests/rpl_start_stop_slave.test index 05836737717..5c99fa1bc74 100644 --- a/mysql-test/extra/rpl_tests/rpl_start_stop_slave.test +++ b/mysql-test/extra/rpl_tests/rpl_start_stop_slave.test @@ -122,4 +122,60 @@ drop table t1i, t2m; sync_slave_with_master; +--echo # +--echo # Bug#56096 STOP SLAVE hangs if executed in parallel with user sleep +--echo # + +--connection master + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +CREATE TABLE t1 (a INT ); + +sync_slave_with_master; + +--connection slave1 +--echo # Slave1: lock table for synchronization +LOCK TABLES t1 WRITE; + +--connection master +--echo # Master: insert into the table +INSERT INTO t1 SELECT SLEEP(4); + +--connection slave +--echo # Slave: wait for the insert +let $wait_condition= + SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST + WHERE STATE = "Waiting for table metadata lock" + AND INFO = "INSERT INTO t1 SELECT SLEEP(4)"; +--source include/wait_condition.inc + +--echo # Slave: send slave stop +--send STOP SLAVE + +--connection slave1 +--echo # Slave1: wait for stop slave +let $wait_condition= + SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST + WHERE INFO = "STOP SLAVE"; +--source include/wait_condition.inc + +--echo # Slave1: unlock the table +UNLOCK TABLES; + +--connection slave +--echo # Slave: wait for the slave to stop +--reap +--source include/wait_for_slave_to_stop.inc + +--echo # Start slave again +--source include/start_slave.inc + +--echo # Clean up +--connection master +DROP TABLE t1; +sync_slave_with_master; + # End of tests diff --git a/mysql-test/extra/rpl_tests/rpl_stop_slave.test b/mysql-test/extra/rpl_tests/rpl_stop_slave.test new file mode 100644 index 00000000000..7c88afe3532 --- /dev/null +++ b/mysql-test/extra/rpl_tests/rpl_stop_slave.test @@ -0,0 +1,61 @@ +# +# Auxiliary file which is used to test BUG#56118 +# +# Slave should apply all statements in the transaction before stop if any +# temporary table is created or dropped. +# +# USEAGE: +# --let $tmp_table_stm= a SQL statement +# --source extra/rpl_tests/rpl_stop_slave.test +# + +if (`SELECT "$tmp_table_stm" = ''`) +{ + --echo \$tmp_table_stm is NULL + --die $tmp_table_stm is NULL +} + +--echo +--echo [ On Master ] +connection master; +BEGIN; +DELETE FROM t1; +eval $tmp_table_stm; +INSERT INTO t1 VALUES (1); +DROP TEMPORARY TABLE tt1; +COMMIT; + +--echo +--echo [ On Slave ] +connection slave; + +# To check if slave SQL thread is applying INSERT statement +let $show_statement= SHOW PROCESSLIST; +let $field= Info; +let $condition= LIKE 'INSERT%'; +source include/wait_show_condition.inc; + +send STOP SLAVE SQL_THREAD; + +--echo +--echo [ On Slave1 ] +connection slave1; +--echo # To resume slave SQL thread +SET DEBUG_SYNC= 'now SIGNAL signal.continue'; +SET DEBUG_SYNC= 'RESET'; + +--echo +--echo [ On Slave ] +connection slave; +reap; +source include/wait_for_slave_sql_to_stop.inc; + +--echo # Slave should stop after the transaction has committed. +--echo # So t1 on master is same to t1 on slave. +let diff_table_1=master:test.t1; +let diff_table_2=slave:test.t1; +source include/diff_tables.inc; + +connection slave; +START SLAVE SQL_THREAD; +source include/wait_for_slave_sql_to_start.inc; diff --git a/mysql-test/include/check_concurrent_insert.inc b/mysql-test/include/check_concurrent_insert.inc index f4bec3c9cdb..62de485d8f1 100644 --- a/mysql-test/include/check_concurrent_insert.inc +++ b/mysql-test/include/check_concurrent_insert.inc @@ -23,7 +23,7 @@ # Reset DEBUG_SYNC facility for safety. set debug_sync= "RESET"; -if (`SELECT '$restore_table' <> ''`) +if ($restore_table) { --eval create temporary table t_backup select * from $restore_table; } @@ -82,7 +82,7 @@ connection default; --eval delete from $table where i = 0; -if (`SELECT '$restore_table' <> ''`) +if ($restore_table) { --eval truncate table $restore_table; --eval insert into $restore_table select * from t_backup; diff --git a/mysql-test/include/check_ftwrl_compatible.inc b/mysql-test/include/check_ftwrl_compatible.inc new file mode 100644 index 00000000000..76c1915957c --- /dev/null +++ b/mysql-test/include/check_ftwrl_compatible.inc @@ -0,0 +1,158 @@ +# +# SUMMARY +# Check that a statement is compatible with FLUSH TABLES WITH READ LOCK. +# +# PARAMETERS +# $con_aux1 Name of the 1st aux connection to be used by this script. +# $con_aux2 Name of the 2nd aux connection to be used by this script. +# $statement The statement to be checked. +# $cleanup_stmt The statement to be run in order to revert effects of +# the statement to be checked. +# $skip_3rd_chk Skip the 3rd stage of checking. The purpose of the third +# stage is to check that metadata locks taken by this +# statement are compatible with metadata locks taken +# by FTWRL. +# +# EXAMPLE +# flush_read_lock.test +# +--disable_result_log +--disable_query_log + +# Reset DEBUG_SYNC facility for safety. +set debug_sync= "RESET"; + +# +# First, check that the statement can be run under FTWRL. +# +flush tables with read lock; +--disable_abort_on_error +--eval $statement +--enable_abort_on_error +let $err= $mysql_errno; +if (!$err) +{ +--echo Success: Was able to run '$statement' under FTWRL. +unlock tables; +if (`SELECT "$cleanup_stmt" <> ""`) +{ +--eval $cleanup_stmt; +} +} +if ($err) +{ +--echo Error: Wasn't able to run '$statement' under FTWRL! +unlock tables; +} + +# +# Then check that this statement won't be blocked by FTWRL +# that is active in another connection. +# +connection $con_aux1; +flush tables with read lock; + +connection default; +--send_eval $statement; + +connection $con_aux1; + +--enable_result_log +--enable_query_log +let $wait_condition= + select count(*) = 0 from information_schema.processlist + where info = "$statement"; +--source include/wait_condition.inc +--disable_result_log +--disable_query_log + +if ($success) +{ +--echo Success: Was able to run '$statement' with FTWRL active in another connection. + +connection default; +# Apparently statement was successfully executed and so +# was not blocked by FTWRL. +# To be safe against wait_condition.inc succeeding due to +# races let us first reap the statement being checked to +# ensure that it has been successfully executed. +--reap + +connection $con_aux1; +unlock tables; + +connection default; +} +if (!$success) +{ +--echo Error: Wasn't able to run '$statement' with FTWRL active in another connection! +unlock tables; +connection default; +--reap +} + +if (`SELECT "$cleanup_stmt" <> ""`) +{ +--eval $cleanup_stmt; +} + +if (`SELECT "$skip_3rd_check" = ""`) +{ +# +# Finally, let us check that FTWRL will succeed if this statement +# is active but has already closed its tables. +# +connection default; +set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go'; +--send_eval $statement; + +connection $con_aux1; +set debug_sync="now WAIT_FOR parked"; +--send flush tables with read lock + +connection $con_aux2; +--enable_result_log +--enable_query_log +let $wait_condition= + select count(*) = 0 from information_schema.processlist + where info = "flush tables with read lock"; +--source include/wait_condition.inc +--disable_result_log +--disable_query_log + +if ($success) +{ +--echo Success: Was able to run FTWRL while '$statement' was active in another connection. +connection $con_aux1; +# Apparently FTWRL was successfully executed and so was not blocked by +# the statement being checked. To be safe against wait_condition.inc +# succeeding due to races let us first reap the FTWRL to ensure that it +# has been successfully executed. +--reap +unlock tables; +set debug_sync="now SIGNAL go"; +connection default; +--reap +} +if (!$success) +{ +--echo Error: Wasn't able to run FTWRL while '$statement' was active in another connection! +set debug_sync="now SIGNAL go"; +connection default; +--reap +connection $con_aux1; +--reap +unlock tables; +connection default; +} + +set debug_sync= "RESET"; +if (`SELECT "$cleanup_stmt" <> ""`) +{ +--eval $cleanup_stmt; +} + +} + +--enable_result_log +--enable_query_log diff --git a/mysql-test/include/check_ftwrl_incompatible.inc b/mysql-test/include/check_ftwrl_incompatible.inc new file mode 100644 index 00000000000..56deef8e92f --- /dev/null +++ b/mysql-test/include/check_ftwrl_incompatible.inc @@ -0,0 +1,155 @@ +# +# SUMMARY +# Check that a statement is incompatible with FLUSH TABLES WITH READ LOCK. +# +# PARAMETERS +# $con_aux1 Name of the 1st aux connection to be used by this script. +# $con_aux2 Name of the 2nd aux connection to be used by this script. +# $statement The statement to be checked. +# $cleanup_stmt1 The 1st statement to be run in order to revert effects +# of statement to be checked. +# $cleanup_stmt2 The 2nd statement to be run in order to revert effects +# of statement to be checked. +# $skip_3rd_chk Skip the 3rd stage of checking. The purpose of the third +# stage is to check that metadata locks taken by this +# statement are incompatible with metadata locks taken +# by FTWRL. +# +# EXAMPLE +# flush_read_lock.test +# +--disable_result_log +--disable_query_log + +# Reset DEBUG_SYNC facility for safety. +set debug_sync= "RESET"; + +# +# First, check that the statement cannot be run under FTWRL. +# +flush tables with read lock; +--disable_abort_on_error +--eval $statement +--enable_abort_on_error +let $err= $mysql_errno; +if ($err) +{ +--echo Success: Was not able to run '$statement' under FTWRL. +unlock tables; +} +if (!$err) +{ +--echo Error: Was able to run '$statement' under FTWRL! +unlock tables; +if (`SELECT "$cleanup_stmt1" <> ""`) +{ +--eval $cleanup_stmt1; +} +if (`SELECT "$cleanup_stmt2" <> ""`) +{ +--eval $cleanup_stmt2; +} +} + + +# +# Then check that this statement is blocked by FTWRL +# that is active in another connection. +# +connection $con_aux1; +flush tables with read lock; + +connection default; +--send_eval $statement; + +connection $con_aux1; + +--enable_result_log +--enable_query_log +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where (state = "Waiting for global read lock" or + state = "Waiting for commit lock") and + info = "$statement"; +--source include/wait_condition.inc +--disable_result_log +--disable_query_log + +if ($success) +{ +--echo Success: '$statement' is blocked by FTWRL active in another connection. +} +if (!$success) +{ +--echo Error: '$statement' wasn't blocked by FTWRL active in another connection! +} +unlock tables; + +connection default; +--reap + +if (`SELECT "$cleanup_stmt1" <> ""`) +{ +--eval $cleanup_stmt1; +} +if (`SELECT "$cleanup_stmt2" <> ""`) +{ +--eval $cleanup_stmt2; +} + +if (`SELECT "$skip_3rd_check" = ""`) +{ +# +# Finally, let us check that FTWRL will not succeed if this +# statement is active but has already closed its tables. +# +connection default; +--eval set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go'; +--send_eval $statement; + +connection $con_aux1; +set debug_sync="now WAIT_FOR parked"; +--send flush tables with read lock + +connection $con_aux2; +--enable_result_log +--enable_query_log +let $wait_condition= + select count(*) = 1 from information_schema.processlist + where (state = "Waiting for global read lock" or + state = "Waiting for commit lock") and + info = "flush tables with read lock"; +--source include/wait_condition.inc +--disable_result_log +--disable_query_log + +if ($success) +{ +--echo Success: FTWRL is blocked when '$statement' is active in another connection. +} +if (!$success) +{ +--echo Error: FTWRL isn't blocked when '$statement' is active in another connection! +} +set debug_sync="now SIGNAL go"; +connection default; +--reap +connection $con_aux1; +--reap +unlock tables; +connection default; + +set debug_sync= "RESET"; + +if (`SELECT "$cleanup_stmt1" <> ""`) +{ +--eval $cleanup_stmt1; +} +if (`SELECT "$cleanup_stmt2" <> ""`) +{ +--eval $cleanup_stmt2; +} +} + +--enable_result_log +--enable_query_log diff --git a/mysql-test/include/check_no_concurrent_insert.inc b/mysql-test/include/check_no_concurrent_insert.inc index c615ebd02cd..ea3187d9b41 100644 --- a/mysql-test/include/check_no_concurrent_insert.inc +++ b/mysql-test/include/check_no_concurrent_insert.inc @@ -23,7 +23,7 @@ # Reset DEBUG_SYNC facility for safety. set debug_sync= "RESET"; -if (`SELECT '$restore_table' <> ''`) +if ($restore_table) { --eval create temporary table t_backup select * from $restore_table; } @@ -68,7 +68,7 @@ if (!$success) --eval delete from $table where i = 0; -if (`SELECT '$restore_table' <> ''`) +if ($restore_table) { --eval truncate table $restore_table; --eval insert into $restore_table select * from t_backup; diff --git a/mysql-test/include/check_slave_is_running.inc b/mysql-test/include/check_slave_is_running.inc index 5fbbe0d684c..51c418e6c64 100644 --- a/mysql-test/include/check_slave_is_running.inc +++ b/mysql-test/include/check_slave_is_running.inc @@ -8,10 +8,18 @@ --echo Checking that both slave threads are running. +--let $running= 1 --let $slave_sql_running = query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running, 1) --let $slave_io_running = query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1) -if (`SELECT '$slave_sql_running' != 'Yes' OR '$slave_io_running' != 'Yes'`) { +if ($slave_sql_running != Yes) { + --let $running= 0 +} +if ($slave_io_running != Yes) { + --let $running= 0 +} + +if (!$running) { --echo Slave not running: Slave_SQL_Running = $slave_sql_running Slave_IO_Running = $slave_io_running --source include/show_rpl_debug_info.inc --die Expected slave to be running, but it was not running. diff --git a/mysql-test/include/check_slave_param.inc b/mysql-test/include/check_slave_param.inc index d82c26851ea..b27825eee6c 100644 --- a/mysql-test/include/check_slave_param.inc +++ b/mysql-test/include/check_slave_param.inc @@ -9,7 +9,7 @@ # --source include/check_slave_param.inc --let $_param_value= query_get_value(SHOW SLAVE STATUS, $slave_param, 1) -if (`SELECT '$_param_value' != '$slave_param_value'`) { +if ($_param_value != $slave_param_value) { --echo Wrong value for $slave_param. Expected '$slave_param_value', got '$_param_value' --source include/show_rpl_debug_info.inc --die Wrong value for slave parameter diff --git a/mysql-test/include/ctype_numconv.inc b/mysql-test/include/ctype_numconv.inc index c4a39879947..83d69cfa40d 100644 --- a/mysql-test/include/ctype_numconv.inc +++ b/mysql-test/include/ctype_numconv.inc @@ -1722,6 +1722,21 @@ DROP TABLE t1; --echo # +--echo # +--echo # Bug#58190 BETWEEN no longer uses indexes for date or datetime fields +--echo # +SELECT @@collation_connection; +CREATE TABLE t1 ( + id INT(11) DEFAULT NULL, + date_column DATE DEFAULT NULL, + KEY(date_column)); +INSERT INTO t1 VALUES (1,'2010-09-01'),(2,'2010-10-01'); +EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01'; +ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL; +EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01'; +DROP TABLE t1; + + --echo # --echo # Bug#52159 returning time type from function and empty left join causes debug assertion --echo # diff --git a/mysql-test/include/diff_tables.inc b/mysql-test/include/diff_tables.inc index d6216f3fe1e..bdd929f39a4 100644 --- a/mysql-test/include/diff_tables.inc +++ b/mysql-test/include/diff_tables.inc @@ -69,7 +69,7 @@ while ($_diff_i) { # and connect the appropriate server. let $_pos= `SELECT LOCATE(':', '$_diff_table')`; let $_diff_conn=`SELECT SUBSTR('$_diff_table', 1, $_pos-1)`; - if (`SELECT 'XX$_diff_conn' <> 'XX'`) { + if ($_diff_conn) { let $_diff_table=`SELECT SUBSTR('$_diff_table', $_pos+1)`; connection $_diff_conn; } diff --git a/mysql-test/include/get_relay_log_pos.inc b/mysql-test/include/get_relay_log_pos.inc index 7ce36fd3c50..61ee07fc655 100644 --- a/mysql-test/include/get_relay_log_pos.inc +++ b/mysql-test/include/get_relay_log_pos.inc @@ -10,12 +10,12 @@ # # at this point, get_relay_log_pos.inc sets $relay_log_pos. echo position # # in $relay_log_file: $relay_log_pos. -if (`SELECT '$relay_log_file' = ''`) +if (!$relay_log_file) { --die 'variable $relay_log_file is null' } -if (`SELECT '$master_log_pos' = ''`) +if (!$master_log_pos) { --die 'variable $master_log_pos is null' } diff --git a/mysql-test/include/handler.inc b/mysql-test/include/handler.inc index b86d5d9287f..57d368960bf 100644 --- a/mysql-test/include/handler.inc +++ b/mysql-test/include/handler.inc @@ -1545,8 +1545,6 @@ lock table not_exists_write read; --echo # We still have the read lock. --error ER_CANT_UPDATE_WITH_READLOCK drop table t1; -handler t1 read next; -handler t1 close; handler t1 open; select a from t2; handler t1 read next; diff --git a/mysql-test/include/have_example_plugin.inc b/mysql-test/include/have_example_plugin.inc index 3a667d2e21a..8920399555d 100644 --- a/mysql-test/include/have_example_plugin.inc +++ b/mysql-test/include/have_example_plugin.inc @@ -8,7 +8,7 @@ if (`SELECT @@have_dynamic_loading != 'YES'`) { # # Check if the variable EXAMPLE_PLUGIN is set # -if (`SELECT LENGTH('$EXAMPLE_PLUGIN') = 0`) { +if (!$EXAMPLE_PLUGIN) { --skip Example plugin requires the environment variable \$EXAMPLE_PLUGIN to be set (normally done by mtr) } diff --git a/mysql-test/include/have_plugin_interface.inc b/mysql-test/include/have_plugin_interface.inc new file mode 100644 index 00000000000..afe8ffad40d --- /dev/null +++ b/mysql-test/include/have_plugin_interface.inc @@ -0,0 +1,5 @@ +--disable_query_log +--require r/true.require +select (PLUGIN_LIBRARY LIKE 'qa_auth_interface%') as `TRUE` FROM INFORMATION_SCHEMA.PLUGINS + WHERE PLUGIN_NAME='qa_auth_interface'; +--enable_query_log diff --git a/mysql-test/include/have_plugin_server.inc b/mysql-test/include/have_plugin_server.inc new file mode 100644 index 00000000000..aad1f026b44 --- /dev/null +++ b/mysql-test/include/have_plugin_server.inc @@ -0,0 +1,5 @@ +--disable_query_log +--require r/true.require +select (PLUGIN_LIBRARY LIKE 'qa_auth_server%') as `TRUE` FROM INFORMATION_SCHEMA.PLUGINS + WHERE PLUGIN_NAME='qa_auth_server'; +--enable_query_log diff --git a/mysql-test/include/have_semisync_plugin.inc b/mysql-test/include/have_semisync_plugin.inc index d3b42dbf5fb..95899f559aa 100644 --- a/mysql-test/include/have_semisync_plugin.inc +++ b/mysql-test/include/have_semisync_plugin.inc @@ -8,7 +8,7 @@ if (`SELECT @@have_dynamic_loading != 'YES'`) { # # Check if the variable SEMISYNC_MASTER_PLUGIN is set # -if (`select LENGTH('$SEMISYNC_MASTER_PLUGIN') = 0`) +if (!$SEMISYNC_MASTER_PLUGIN) { skip Need semisync plugins; } diff --git a/mysql-test/include/have_simple_parser.inc b/mysql-test/include/have_simple_parser.inc index 745f68603fe..d077916c5e7 100644 --- a/mysql-test/include/have_simple_parser.inc +++ b/mysql-test/include/have_simple_parser.inc @@ -8,7 +8,7 @@ if (`SELECT @@have_dynamic_loading != 'YES'`) { # # Check if the variable SIMPLE_PARSER is set # -if (`SELECT LENGTH('$SIMPLE_PARSER') = 0`) { +if (!$SIMPLE_PARSER) { --skip simple parser requires the environment variable \$SIMPLE_PARSER to be set (normally done by mtr) } diff --git a/mysql-test/include/have_udf.inc b/mysql-test/include/have_udf.inc index d9ca1450043..5c404b03729 100644 --- a/mysql-test/include/have_udf.inc +++ b/mysql-test/include/have_udf.inc @@ -8,7 +8,7 @@ if (`SELECT @@have_dynamic_loading != 'YES'`) { # # Check if the variable UDF_EXAMPLE_LIB is set # -if (`SELECT LENGTH('$UDF_EXAMPLE_LIB') = 0`) { +if (!$UDF_EXAMPLE_LIB) { --skip UDF requires the environment variable \$UDF_EXAMPLE_LIB to be set (normally done by mtr) } diff --git a/mysql-test/include/kill_query.inc b/mysql-test/include/kill_query.inc index b303ed0ec39..1c949d3cbad 100644 --- a/mysql-test/include/kill_query.inc +++ b/mysql-test/include/kill_query.inc @@ -44,7 +44,7 @@ connection master; # kill the query that is waiting eval kill query $connection_id; -if (`SELECT '$debug_lock' != ''`) +if ($debug_lock) { # release the lock to allow binlog continue eval SELECT RELEASE_LOCK($debug_lock); @@ -57,7 +57,7 @@ reap; connection master; -if (`SELECT '$debug_lock' != ''`) +if ($debug_lock) { # get lock again to make the next query wait eval SELECT GET_LOCK($debug_lock, 10); diff --git a/mysql-test/include/kill_query_and_diff_master_slave.inc b/mysql-test/include/kill_query_and_diff_master_slave.inc index 611d6929c99..b3846d12df1 100644 --- a/mysql-test/include/kill_query_and_diff_master_slave.inc +++ b/mysql-test/include/kill_query_and_diff_master_slave.inc @@ -25,7 +25,7 @@ source include/kill_query.inc; connection master; disable_query_log; disable_result_log; -if (`SELECT '$debug_lock' != ''`) +if ($debug_lock) { eval SELECT RELEASE_LOCK($debug_lock); } @@ -36,8 +36,8 @@ source include/diff_master_slave.inc; # Acquire the debug lock again if used connection master; -disable_query_log; disable_result_log; if (`SELECT '$debug_lock' != -''`) { eval SELECT GET_LOCK($debug_lock, 10); } enable_result_log; -enable_query_log; +disable_query_log; disable_result_log; +if ($debug_lock) { eval SELECT GET_LOCK($debug_lock, 10); } +enable_result_log; enable_query_log; connection $connection_name; diff --git a/mysql-test/include/mtr_warnings.sql b/mysql-test/include/mtr_warnings.sql index bf0a58788d6..f793ff54e86 100644 --- a/mysql-test/include/mtr_warnings.sql +++ b/mysql-test/include/mtr_warnings.sql @@ -16,6 +16,12 @@ CREATE TABLE test_suppressions ( -- no invalid patterns can be inserted -- into test_suppressions -- +SET @character_set_client_saved = @@character_set_client|| +SET @character_set_results_saved = @@character_set_results|| +SET @collation_connection_saved = @@collation_connection|| +SET @@character_set_client = latin1|| +SET @@character_set_results = latin1|| +SET @@collation_connection = latin1_swedish_ci|| /*!50002 CREATE DEFINER=root@localhost TRIGGER ts_insert BEFORE INSERT ON test_suppressions @@ -24,6 +30,9 @@ FOR EACH ROW BEGIN SELECT "" REGEXP NEW.pattern INTO dummy; END */|| +SET @@character_set_client = @character_set_client_saved|| +SET @@character_set_results = @character_set_results_saved|| +SET @@collation_connection = @collation_connection_saved|| -- @@ -38,6 +47,12 @@ CREATE TABLE global_suppressions ( -- no invalid patterns can be inserted -- into global_suppressions -- +SET @character_set_client_saved = @@character_set_client|| +SET @character_set_results_saved = @@character_set_results|| +SET @collation_connection_saved = @@collation_connection|| +SET @@character_set_client = latin1|| +SET @@character_set_results = latin1|| +SET @@collation_connection = latin1_swedish_ci|| /*!50002 CREATE DEFINER=root@localhost TRIGGER gs_insert BEFORE INSERT ON global_suppressions @@ -46,6 +61,9 @@ FOR EACH ROW BEGIN SELECT "" REGEXP NEW.pattern INTO dummy; END */|| +SET @@character_set_client = @character_set_client_saved|| +SET @@character_set_results = @character_set_results_saved|| +SET @@collation_connection = @collation_connection_saved|| diff --git a/mysql-test/include/mysql_upgrade_preparation.inc b/mysql-test/include/mysql_upgrade_preparation.inc index 5de8a79d6e0..a3c81c4c1e7 100644 --- a/mysql-test/include/mysql_upgrade_preparation.inc +++ b/mysql-test/include/mysql_upgrade_preparation.inc @@ -17,7 +17,7 @@ select LENGTH("$MYSQL_UPGRADE")>0 as have_mysql_upgrade; # Therefore, truncate the log table in advance and issue a statement # that should be logged. # -if (`SELECT $VALGRIND_TEST`) +if ($VALGRIND_TEST) { --disable_query_log --disable_result_log diff --git a/mysql-test/include/no_valgrind_without_big.inc b/mysql-test/include/no_valgrind_without_big.inc index 743e974daec..ea1f2ac91ab 100644 --- a/mysql-test/include/no_valgrind_without_big.inc +++ b/mysql-test/include/no_valgrind_without_big.inc @@ -5,8 +5,9 @@ # Therefore we require that the option "--big-test" is also set. # -if (`SELECT $VALGRIND_TEST <> 0 AND '$BIG_TEST' = ''`) -{ - --skip Need "--big-test" when running with Valgrind +if ($VALGRIND_TEST) { + if (!$BIG_TEST) + { + --skip Need "--big-test" when running with Valgrind + } } - diff --git a/mysql-test/include/not_parallel.inc b/mysql-test/include/not_parallel.inc index 39432c59813..615bdf68453 100644 --- a/mysql-test/include/not_parallel.inc +++ b/mysql-test/include/not_parallel.inc @@ -1,3 +1,3 @@ -if (`SELECT '$MTR_PARALLEL' > 1`) { +if ($MTR_PARALLEL > 1) { --skip test requires --parallel=1 } diff --git a/mysql-test/include/rpl_diff_tables.inc b/mysql-test/include/rpl_diff_tables.inc index c3a45578a79..a82e094a209 100644 --- a/mysql-test/include/rpl_diff_tables.inc +++ b/mysql-test/include/rpl_diff_tables.inc @@ -8,13 +8,13 @@ # --source include/rpl_diff_tables.inc # ############################################################################# -if (`SELECT "XX$diff_table" = "XX"`) +if (!$diff_table) { --die diff_table is null. } --let $_servers= master, slave -if (`SELECT "XX$diff_server_list" <> "XX"`) +if ($diff_server_list) { --let $_servers= $diff_server_list } @@ -22,7 +22,7 @@ if (`SELECT "XX$diff_server_list" <> "XX"`) --let $_master= `SELECT SUBSTRING_INDEX('$_servers', ',', 1)` --let $_servers= `SELECT LTRIM(SUBSTRING('$_servers', LENGTH('$_master') + 2))` connection $_master; -while (`SELECT "XX$_servers" <> "XX"`) +while ($_servers) { --let $_slave= `SELECT SUBSTRING_INDEX('$_servers', ',', 1)` --let $_servers= `SELECT LTRIM(SUBSTRING('$_servers', LENGTH('$_slave') + 2))` diff --git a/mysql-test/include/setup_fake_relay_log.inc b/mysql-test/include/setup_fake_relay_log.inc index 86a5da328af..1b517862235 100644 --- a/mysql-test/include/setup_fake_relay_log.inc +++ b/mysql-test/include/setup_fake_relay_log.inc @@ -40,9 +40,16 @@ let $_fake_relay_log_printable= `SELECT REPLACE('$fake_relay_log', '$MYSQL_TEST_ --echo Setting up fake replication from $_fake_relay_log_printable # Sanity check. +let $running= 0; let $_sql_running= query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running, 1); let $_io_running= query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1); -if (`SELECT "$_sql_running" = "Yes" OR "$_io_running" = "Yes"`) { +if ($_sql_running == Yes) { + let $running= 1; +} +if ($_io_running == Yes) { + let $running= 1; +} +if ($running) { --echo Error: Slave was running when test case sourced --echo include/setup_fake_replication.inc --echo Slave_IO_Running = $_io_running; Slave_SQL_Running = $_sql_running @@ -56,7 +63,7 @@ if (`SELECT "$_sql_running" = "Yes" OR "$_io_running" = "Yes"`) { # Read server variables. let $MYSQLD_DATADIR= `SELECT @@datadir`; let $_fake_filename= query_get_value(SHOW VARIABLES LIKE 'relay_log', Value, 1); -if (`SELECT '$_fake_filename' = ''`) { +if (!$_fake_filename) { --echo Badly written test case: relay_log variable is empty. Please use the --echo server option --relay-log=FILE. } diff --git a/mysql-test/include/show_events.inc b/mysql-test/include/show_events.inc index 2fd0bc6dbd8..ff5a7105c24 100644 --- a/mysql-test/include/show_events.inc +++ b/mysql-test/include/show_events.inc @@ -18,13 +18,15 @@ if ($is_relay_log) --let $_statement=show relaylog events } -if (`SELECT '$binlog_file' <> ''`) +if ($binlog_file) { --let $_statement= $_statement in '$binlog_file' } --let $_statement= $_statement from $binlog_start +# Cannot use if($binlog_limit) since the variable may begin with a 0 + if (`SELECT '$binlog_limit' <> ''`) { --let $_statement= $_statement limit $binlog_limit diff --git a/mysql-test/include/show_rpl_debug_info.inc b/mysql-test/include/show_rpl_debug_info.inc index 148d11f3b02..dedf689cd19 100644 --- a/mysql-test/include/show_rpl_debug_info.inc +++ b/mysql-test/include/show_rpl_debug_info.inc @@ -48,13 +48,13 @@ let $binlog_name= query_get_value("SHOW MASTER STATUS", File, 1); eval SHOW BINLOG EVENTS IN '$binlog_name'; let $_master_con= $master_connection; -if (`SELECT '$_master_con' = ''`) +if (!$_master_con) { - if (`SELECT '$_con' = 'slave'`) + if ($_con == slave) { let $_master_con= master; } - if (`SELECT '$_master_con' = ''`) + if (!$_master_con) { --echo Unable to determine master connection. No debug info printed for master. --echo Please fix the test case by setting $master_connection before sourcing @@ -62,7 +62,7 @@ if (`SELECT '$_master_con' = ''`) } } -if (`SELECT '$_master_con' != ''`) +if ($_master_con) { let $master_binlog_name_io= query_get_value("SHOW SLAVE STATUS", Master_Log_File, 1); @@ -80,7 +80,7 @@ if (`SELECT '$_master_con' != ''`) --echo --echo **** SHOW BINLOG EVENTS on $_master_con **** eval SHOW BINLOG EVENTS IN '$master_binlog_name_sql'; - if (`SELECT '$master_binlog_name_io' != '$master_binlog_name_sql'`) + if ($master_binlog_name_io != $master_binlog_name_sql) { eval SHOW BINLOG EVENTS IN '$master_binlog_name_io'; } diff --git a/mysql-test/include/truncate_file.inc b/mysql-test/include/truncate_file.inc index c82108681bd..2326d6c0b94 100644 --- a/mysql-test/include/truncate_file.inc +++ b/mysql-test/include/truncate_file.inc @@ -1,6 +1,6 @@ # truncate a giving file, all contents of the file are be cleared -if (`SELECT 'x$file' = 'x'`) +if (!$file) { --echo Please assign a file name to $file!! exit; diff --git a/mysql-test/include/wait_for_slave_io_error.inc b/mysql-test/include/wait_for_slave_io_error.inc index 34cbf20a73b..ffdcf752873 100644 --- a/mysql-test/include/wait_for_slave_io_error.inc +++ b/mysql-test/include/wait_for_slave_io_error.inc @@ -31,7 +31,7 @@ # $master_connection # See wait_for_slave_param.inc for description. -if (`SELECT '$slave_io_errno' = ''`) { +if (!$slave_io_errno) { --die !!!ERROR IN TEST: you must set \$slave_io_errno before sourcing wait_for_slave_io_error.inc } diff --git a/mysql-test/include/wait_for_slave_io_to_stop.inc b/mysql-test/include/wait_for_slave_io_to_stop.inc index f61b0db1ed7..512bb6b7243 100644 --- a/mysql-test/include/wait_for_slave_io_to_stop.inc +++ b/mysql-test/include/wait_for_slave_io_to_stop.inc @@ -14,7 +14,7 @@ # if server has not used CHANGE MASTER to initiate slave, SHOW SLAVE # STATUS will return an empty set. let $_slave_io_running= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, 1); -if (`SELECT '$_slave_io_running' != 'No such row'`) +if ($_slave_io_running != No such row) { let $slave_param= Slave_IO_Running; let $slave_param_value= No; diff --git a/mysql-test/include/wait_for_slave_param.inc b/mysql-test/include/wait_for_slave_param.inc index b0989c3264e..db07692672f 100644 --- a/mysql-test/include/wait_for_slave_param.inc +++ b/mysql-test/include/wait_for_slave_param.inc @@ -53,7 +53,7 @@ if (!$_slave_timeout_counter) let $slave_tcnt= $_slave_timeout_counter; let $_slave_param_comparison= $slave_param_comparison; -if (`SELECT '$_slave_param_comparison' = ''`) +if (!$_slave_param_comparison) { let $_slave_param_comparison= =; } @@ -73,7 +73,7 @@ while (`SELECT NOT('$_show_slave_status_value' $_slave_param_comparison '$slave_ if (!$_slave_timeout_counter) { --echo **** ERROR: timeout after $slave_tcnt deci-seconds while waiting for slave parameter $slave_param $_slave_param_comparison $slave_param_value **** - if (`SELECT '$slave_error_message' != ''`) + if ($slave_error_message) { --echo Message: $slave_error_message } diff --git a/mysql-test/include/wait_for_slave_sql_error.inc b/mysql-test/include/wait_for_slave_sql_error.inc index aab04036eea..3ae34b1fb9e 100644 --- a/mysql-test/include/wait_for_slave_sql_error.inc +++ b/mysql-test/include/wait_for_slave_sql_error.inc @@ -24,7 +24,7 @@ # $master_connection # See wait_for_slave_param.inc for description. -if (`SELECT '$slave_sql_errno' = ''`) { +if (!$slave_sql_errno) { --die !!!ERROR IN TEST: you must set \$slave_sql_errno before sourcing wait_for_slave_sql_error.inc } @@ -34,7 +34,7 @@ let $slave_error_message= Failed while waiting for slave to stop the SQL thread source include/wait_for_slave_param.inc; let $_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1); -if (`SELECT '$_error' != '$slave_sql_errno'`) { +if ($_error != $slave_sql_errno) { --echo **** Slave stopped with wrong error code: $_error (expected $slave_sql_errno) **** source include/show_rpl_debug_info.inc; --echo **** Slave stopped with wrong error code: $_error (expected $slave_sql_errno) **** diff --git a/mysql-test/include/wait_for_slave_sql_to_stop.inc b/mysql-test/include/wait_for_slave_sql_to_stop.inc index 6992613b646..50bf53e421d 100644 --- a/mysql-test/include/wait_for_slave_sql_to_stop.inc +++ b/mysql-test/include/wait_for_slave_sql_to_stop.inc @@ -14,7 +14,7 @@ # if server has not used CHANGE MASTER to initiate slave, SHOW SLAVE # STATUS will return an empty set. let $_slave_io_running= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, 1); -if (`SELECT '$_slave_io_running' != 'No such row'`) +if ($_slave_io_running != No such row) { let $slave_param= Slave_SQL_Running; let $slave_param_value= No; diff --git a/mysql-test/include/wait_for_slave_to_stop.inc b/mysql-test/include/wait_for_slave_to_stop.inc index 56d0e7b0c91..618c5397cb7 100644 --- a/mysql-test/include/wait_for_slave_to_stop.inc +++ b/mysql-test/include/wait_for_slave_to_stop.inc @@ -14,7 +14,7 @@ # if server has not used CHANGE MASTER to initiate slave, SHOW SLAVE # STATUS will return an empty set. let $_slave_io_running= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, 1); -if (`SELECT '$_slave_io_running' != 'No such row'`) +if ($_slave_io_running != No such row) { let $slave_error_message= Failed while waiting for slave to stop; diff --git a/mysql-test/include/wait_for_status_var.inc b/mysql-test/include/wait_for_status_var.inc index 8b644c2c3c5..9f4962aeaed 100644 --- a/mysql-test/include/wait_for_status_var.inc +++ b/mysql-test/include/wait_for_status_var.inc @@ -45,7 +45,7 @@ if (!$_status_timeout_counter) } let $_status_var_comparsion= $status_var_comparsion; -if (`SELECT '$_status_var_comparsion' = ''`) +if (!$_status_var_comparsion) { let $_status_var_comparsion= =; } diff --git a/mysql-test/include/wait_show_condition.inc b/mysql-test/include/wait_show_condition.inc index f683ca7b47b..68e05ce4644 100644 --- a/mysql-test/include/wait_show_condition.inc +++ b/mysql-test/include/wait_show_condition.inc @@ -50,7 +50,7 @@ inc $max_run_time; let $found= 0; let $max_end_time= `SELECT UNIX_TIMESTAMP() + $max_run_time`; -if (`SELECT '$wait_for_all' != '1'`) +if ($wait_for_all != 1) { while (`SELECT UNIX_TIMESTAMP() <= $max_end_time AND $found = 0`) { @@ -58,24 +58,27 @@ if (`SELECT '$wait_for_all' != '1'`) real_sleep 0.2; let $rowno= 1; let $process_result= 1; - while (`SELECT $process_result = 1 AND $found = 0`) + let $do_loop= 1; + while ($do_loop) { let $field_value= query_get_value($show_statement, $field, $rowno); if (`SELECT '$field_value' $condition`) { let $found= 1; + let $do_loop= 0; } - if (`SELECT '$field_value' = 'No such row'`) + if ($field_value == No such row) { # We are behind the last row of the result set. let $process_result= 0; + let $do_loop= 0; } inc $rowno; } } } -if (`SELECT '$wait_for_all' = '1'`) +if ($wait_for_all == 1) { while (`SELECT UNIX_TIMESTAMP() <= $max_end_time AND $found = 0`) { @@ -83,16 +86,19 @@ if (`SELECT '$wait_for_all' = '1'`) real_sleep 0.2; let $rowno= 1; let $process_result= 1; - while (`SELECT $process_result = 1 AND $found = 0`) + let $do_loop= 1; + while ($do_loop) { let $field_value= query_get_value($show_statement, $field, $rowno); - if (`SELECT '$field_value' = 'No such row'`) + if ($field_value == No such row) { let $found= 1; + let $do_loop= 0; } if (`SELECT $found = 0 AND NOT '$field_value' $condition`) { let process_result= 0; + let $do_loop= 0; } inc $rowno; } @@ -101,7 +107,7 @@ if (`SELECT '$wait_for_all' = '1'`) if (!$found) { - echo # Timeout in include/wait_show_condition.inc for $wait_condition; + echo # Timeout in include/wait_show_condition.inc for $condition; echo # show_statement : $show_statement; echo # field : $field; echo # condition : $condition; diff --git a/mysql-test/lib/My/SafeProcess/Makefile.am b/mysql-test/lib/My/SafeProcess/Makefile.am deleted file mode 100644 index 33cab066611..00000000000 --- a/mysql-test/lib/My/SafeProcess/Makefile.am +++ /dev/null @@ -1,25 +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 - -testroot = $(prefix) -safedir = $(testroot)/mysql-test/lib/My/SafeProcess -#nobase_bin_PROGRAMS = ... -safe_PROGRAMS = my_safe_process - -my_safe_process_SOURCES = safe_process.cc - -EXTRA_DIST = safe_kill_win.cc \ - safe_process_win.cc \ - CMakeLists.txt diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm index 87f96496c73..a7d7a8aefa4 100644 --- a/mysql-test/lib/mtr_cases.pm +++ b/mysql-test/lib/mtr_cases.pm @@ -177,8 +177,6 @@ sub collect_test_cases ($$$$) { if ( $opt_reorder && !$quick_collect) { # Reorder the test cases in an order that will make them faster to run - my %sort_criteria; - # Make a mapping of test name to a string that represents how that test # should be sorted among the other tests. Put the most important criterion # first, then a sub-criterion, then sub-sub-criterion, etc. @@ -190,24 +188,31 @@ sub collect_test_cases ($$$$) { # Append the criteria for sorting, in order of importance. # push(@criteria, "ndb=" . ($tinfo->{'ndb_test'} ? "A" : "B")); + push(@criteria, $tinfo->{template_path}); # Group test with equal options together. # Ending with "~" makes empty sort later than filled my $opts= $tinfo->{'master_opt'} ? $tinfo->{'master_opt'} : []; push(@criteria, join("!", sort @{$opts}) . "~"); + # Add slave opts if any + if ($tinfo->{'slave_opt'}) + { + push(@criteria, join("!", sort @{$tinfo->{'slave_opt'}})); + } + # This sorts tests with force-restart *before* identical tests + push(@criteria, $tinfo->{force_restart} ? "force-restart" : "no-restart"); - $sort_criteria{$tinfo->{name}} = join(" ", @criteria); + $tinfo->{criteria}= join(" ", @criteria); } - @$cases = sort { - $sort_criteria{$a->{'name'}} . $a->{'name'} cmp - $sort_criteria{$b->{'name'}} . $b->{'name'}; } @$cases; + @$cases = sort {$a->{criteria} cmp $b->{criteria}; } @$cases; # For debugging the sort-order # foreach my $tinfo (@$cases) # { - # print("$sort_criteria{$tinfo->{'name'}} -> \t$tinfo->{'name'}\n"); + # my $tname= $tinfo->{name} . ' ' . $tinfo->{combination}; + # my $crit= $tinfo->{criteria}; + # print("$tname\n\t$crit\n"); # } - } if (defined $print_testcases){ diff --git a/mysql-test/lib/mtr_misc.pl b/mysql-test/lib/mtr_misc.pl index 32960d866ce..dc9928d37c5 100644 --- a/mysql-test/lib/mtr_misc.pl +++ b/mysql-test/lib/mtr_misc.pl @@ -33,6 +33,13 @@ sub mtr_exe_maybe_exists(@); sub mtr_milli_sleep($); sub start_timer($); sub has_expired($); +sub init_timers(); +sub mark_time_used($); +sub add_total_times($); +sub print_times_used($$); +sub print_total_times($); + +our $opt_report_times; ############################################################################## # @@ -205,4 +212,81 @@ sub start_timer ($) { return time + $_[0]; } sub has_expired ($) { return $_[0] && time gt $_[0]; } +# Below code is for time usage reporting + +use Time::HiRes qw(gettimeofday); + +my %time_used= ( + 'collect' => 0, + 'restart' => 0, + 'check' => 0, + 'ch-warn' => 0, + 'test' => 0, + 'init' => 0, +); + +my %time_text= ( + 'collect' => "Collecting test cases", + 'restart' => "Server stop/start", + 'check' => "Check-testcase", + 'ch-warn' => "Check for warnings", + 'test' => "Test execution", + 'init' => "Initialization etc.", +); + +# Counts number of reports from workers + +my $time_totals= 0; + +my $last_timer_set; + +sub init_timers() { + $last_timer_set= gettimeofday(); +} + +sub mark_time_used($) { + my ($name)= @_; + return unless $opt_report_times; + die "Unknown timer $name" unless exists $time_used{$name}; + + my $curr_time= gettimeofday(); + $time_used{$name}+= int (($curr_time - $last_timer_set) * 1000 + .5); + $last_timer_set= $curr_time; +} + +sub add_total_times($) { + my ($dummy, $num, @line)= split (" ", $_[0]); + + $time_totals++; + foreach my $elem (@line) { + my ($name, $spent)= split (":", $elem); + $time_used{$name}+= $spent; + } +} + +sub print_times_used($$) { + my ($server, $num)= @_; + return unless $opt_report_times; + + my $output= "SPENT $num"; + foreach my $name (keys %time_used) { + my $spent= $time_used{$name}; + $output.= " $name:$spent"; + } + print $server $output . "\n"; +} + +sub print_total_times($) { + # Don't print if we haven't received all worker data + return if $time_totals != $_[0]; + + foreach my $name (keys %time_used) + { + my $spent= $time_used{$name}/1000; + my $text= $time_text{$name}; + print ("Spent $spent seconds on $text\n"); + } +} + + 1; diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl index a42627c93cd..26a95fa13ab 100644 --- a/mysql-test/lib/mtr_process.pl +++ b/mysql-test/lib/mtr_process.pl @@ -116,18 +116,20 @@ sub sleep_until_file_created ($$$) { return 1; } + my $seconds= ($loop * $sleeptime) / 1000; + # Check if it died after the fork() was successful if ( defined $proc and ! $proc->wait_one(0) ) { - mtr_warning("Process $proc died"); + mtr_warning("Process $proc died after mysql-test-run waited $seconds " . + "seconds for $pidfile to be created."); return 0; } mtr_debug("Sleep $sleeptime milliseconds waiting for $pidfile"); # Print extra message every 60 seconds - my $seconds= ($loop * $sleeptime) / 1000; - if ( $seconds > 1 and int($seconds * 10) % 600 == 0 ) + if ( $seconds > 1 && int($seconds * 10) % 600 == 0 && $seconds < $timeout ) { my $left= $timeout - $seconds; mtr_warning("Waited $seconds seconds for $pidfile to be created, " . @@ -138,6 +140,8 @@ sub sleep_until_file_created ($$$) { } + mtr_warning("Timeout after mysql-test-run waited $timeout seconds " . + "for the process $proc to create a pid file."); return 0; } diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 88719ff5bb2..89e2ed5d441 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -131,6 +131,9 @@ my $opt_start_dirty; my $opt_start_exit; my $start_only; +my $auth_interface_fn; # the name of qa_auth_interface plugin +my $auth_server_fn; # the name of qa_auth_server plugin +my $auth_client_fn; # the name of qa_auth_client plugin my $auth_filename; # the name of the authentication test plugin my $auth_plugin; # the path to the authentication test plugin @@ -198,6 +201,7 @@ sub using_extern { return (keys %opts_extern > 0);}; our $opt_fast= 0; our $opt_force; our $opt_mem= $ENV{'MTR_MEM'}; +our $opt_clean_vardir= $ENV{'MTR_CLEAN_VARDIR'}; our $opt_gcov; our $opt_gcov_exe= "gcov"; @@ -238,6 +242,7 @@ my $opt_skip_core; our $opt_check_testcases= 1; my $opt_mark_progress; my $opt_max_connections; +our $opt_report_times= 0; my $opt_sleep; @@ -351,8 +356,11 @@ sub main { } } + init_timers(); + mtr_report("Collecting tests..."); my $tests= collect_test_cases($opt_reorder, $opt_suites, \@opt_cases, \@opt_skip_test_list); + mark_time_used('collect'); if ( $opt_report_features ) { # Put "report features" as the first test to run @@ -421,6 +429,7 @@ sub main { $opt_tmpdir= "$opt_tmpdir/$child_num"; } + init_timers(); run_worker($server_port, $child_num); exit(1); } @@ -433,6 +442,8 @@ sub main { mtr_print_thick_line(); mtr_print_header(); + mark_time_used('init'); + my $completed= run_test_server($server, $tests, $opt_parallel); exit(0) if $opt_start_exit; @@ -478,8 +489,12 @@ sub main { $opt_gcov_msg, $opt_gcov_err); } + print_total_times($opt_parallel) if $opt_report_times; + mtr_report_stats("Completed", $completed); + remove_vardir_subs() if $opt_clean_vardir; + exit(0); } @@ -610,13 +625,15 @@ sub run_test_server ($$$) { if ($test_has_failed and $retries <= $opt_retry){ # Test should be run one more time unless it has failed # too many times already + my $tname= $result->{name}; my $failures= $result->{failures}; if ($opt_retry > 1 and $failures >= $opt_retry_failure){ - mtr_report("\nTest has failed $failures times,", + mtr_report("\nTest $tname has failed $failures times,", "no more retries!\n"); } else { - mtr_report("\nRetrying test, attempt($retries/$opt_retry)...\n"); + mtr_report("\nRetrying test $tname, ". + "attempt($retries/$opt_retry)...\n"); delete($result->{result}); $result->{retries}= $retries+1; $result->write_test($sock, 'TESTCASE'); @@ -652,6 +669,9 @@ sub run_test_server ($$$) { elsif ($line eq 'START'){ ; # Send first test } + elsif ($line =~ /^SPENT/) { + add_total_times($line); + } else { mtr_error("Unknown response: '$line' from client"); } @@ -684,22 +704,40 @@ sub run_test_server ($$$) { next; } - # Prefer same configuration, or just use next if --noreorder - if (!$opt_reorder or (defined $result and - $result->{template_path} eq $t->{template_path})) - { - #mtr_report("Test uses same config => good match"); - # Test uses same config => good match - $next= splice(@$tests, $i, 1); - last; - } - # Second best choice is the first that does not fulfill # any of the above conditions if (!defined $second_best){ #mtr_report("Setting second_best to $i"); $second_best= $i; } + + # Smart allocation of next test within this thread. + + if ($opt_reorder and $opt_parallel > 1 and defined $result) + { + my $wid= $result->{worker}; + # Reserved for other thread, try next + next if (defined $t->{reserved} and $t->{reserved} != $wid); + if (! defined $t->{reserved}) + { + # Force-restart not relevant when comparing *next* test + $t->{criteria} =~ s/force-restart$/no-restart/; + my $criteria= $t->{criteria}; + # Reserve similar tests for this worker, but not too many + my $maxres= (@$tests - $i) / $opt_parallel + 1; + for (my $j= $i+1; $j <= $i + $maxres; $j++) + { + my $tt= $tests->[$j]; + last unless defined $tt; + last if $tt->{criteria} ne $criteria; + $tt->{reserved}= $wid; + } + } + } + + # At this point we have found next suitable test + $next= splice(@$tests, $i, 1); + last; } # Use second best choice if no other test has been found @@ -708,10 +746,12 @@ sub run_test_server ($$$) { mtr_error("Internal error, second best too large($second_best)") if $second_best > $#$tests; $next= splice(@$tests, $second_best, 1); + delete $next->{reserved}; } if ($next) { - #$next->print_test(); + # We don't need this any more + delete $next->{criteria}; $next->write_test($sock, 'TESTCASE'); $running{$next->key()}= $next; $num_ndb_tests++ if ($next->{ndb_test}); @@ -783,7 +823,9 @@ sub run_worker ($) { # Ask server for first test print $server "START\n"; - while(my $line= <$server>){ + mark_time_used('init'); + + while (my $line= <$server>){ chomp($line); if ($line eq 'TESTCASE'){ my $test= My::Test::read_test($server); @@ -794,6 +836,11 @@ sub run_worker ($) { delete($test->{'comment'}); delete($test->{'logfile'}); + # A sanity check. Should this happen often we need to look at it. + if (defined $test->{reserved} && $test->{reserved} != $thread_num) { + my $tres= $test->{reserved}; + mtr_warning("Test reserved for w$tres picked up by w$thread_num"); + } $test->{worker} = $thread_num if $opt_parallel > 1; run_testcase($test); @@ -801,16 +848,20 @@ sub run_worker ($) { # Send it back, now with results set #$test->print_test(); $test->write_test($server, 'TESTRESULT'); + mark_time_used('restart'); } elsif ($line eq 'BYE'){ mtr_report("Server said BYE"); stop_all_servers($opt_shutdown_timeout); + mark_time_used('restart'); if ($opt_valgrind_mysqld) { valgrind_exit_reports(); } if ( $opt_gprof ) { gprof_collect (find_mysqld($basedir), keys %gprof_dirs); } + mark_time_used('init'); + print_times_used($server, $thread_num); exit(0); } else { @@ -868,7 +919,7 @@ sub command_line_setup { 'ssl|with-openssl' => \$opt_ssl, 'skip-ssl' => \$opt_skip_ssl, 'compress' => \$opt_compress, - 'vs-config' => \$opt_vs_config, + 'vs-config=s' => \$opt_vs_config, # Max number of parallel threads to use 'parallel=s' => \$opt_parallel, @@ -951,6 +1002,7 @@ sub command_line_setup { 'tmpdir=s' => \$opt_tmpdir, 'vardir=s' => \$opt_vardir, 'mem' => \$opt_mem, + 'clean-vardir' => \$opt_clean_vardir, 'client-bindir=s' => \$path_client_bindir, 'client-libdir=s' => \$path_client_libdir, @@ -983,6 +1035,7 @@ sub command_line_setup { 'timediff' => \&report_option, 'max-connections=i' => \$opt_max_connections, 'default-myisam!' => \&collect_option, + 'report-times' => \$opt_report_times, 'help|h' => \$opt_usage, 'list-options' => \$opt_list_options, @@ -1062,14 +1115,20 @@ sub command_line_setup { "$basedir/sql/share/charsets", "$basedir/share/charsets"); - # Look for client test plugin + # Look for auth test plugins if (IS_WINDOWS) { $auth_filename = "auth_test_plugin.dll"; + $auth_interface_fn = "qa_auth_interface.dll"; + $auth_server_fn = "qa_auth_server.dll"; + $auth_client_fn = "qa_auth_client.dll"; } else { $auth_filename = "auth_test_plugin.so"; + $auth_interface_fn = "qa_auth_interface.so"; + $auth_server_fn = "qa_auth_server.so"; + $auth_client_fn = "qa_auth_client.so"; } $auth_plugin= mtr_file_exists(vs_config_dirs('plugin/auth/',$auth_filename), @@ -1316,7 +1375,7 @@ sub command_line_setup { # Add the location for libmysqld.dll to the path. my $separator= ";"; my $lib_mysqld= - mtr_path_exists(vs_config_dirs('libmysqld','')); + mtr_path_exists("$bindir/lib", vs_config_dirs('libmysqld','')); if ( IS_CYGWIN ) { $lib_mysqld= posix_path($lib_mysqld); @@ -1752,17 +1811,17 @@ sub executable_setup () { if ( ! $opt_skip_ndbcluster ) { $exe_ndbd= - my_find_bin($basedir, + my_find_bin($bindir, ["storage/ndb/src/kernel", "libexec", "sbin", "bin"], "ndbd"); $exe_ndb_mgmd= - my_find_bin($basedir, + my_find_bin($bindir, ["storage/ndb/src/mgmsrv", "libexec", "sbin", "bin"], "ndb_mgmd"); $exe_ndb_waiter= - my_find_bin($basedir, + my_find_bin($bindir, ["storage/ndb/tools/", "bin"], "ndb_waiter"); @@ -1973,12 +2032,18 @@ sub environment_setup { $ENV{'PLUGIN_AUTH_OPT'}= "--plugin-dir=".dirname($auth_plugin); $ENV{'PLUGIN_AUTH_LOAD'}="--plugin_load=test_plugin_server=".$auth_filename; + $ENV{'PLUGIN_AUTH_INTERFACE'}="--plugin_load=qa_auth_interface=".$auth_interface_fn; + $ENV{'PLUGIN_AUTH_SERVER'}="--plugin_load=qa_auth_server=".$auth_server_fn; + $ENV{'PLUGIN_AUTH_CLIENT'}="--plugin_load=qa_auth_client=".$auth_client_fn; } else { $ENV{'PLUGIN_AUTH'}= ""; $ENV{'PLUGIN_AUTH_OPT'}="--plugin-dir="; $ENV{'PLUGIN_AUTH_LOAD'}=""; + $ENV{'PLUGIN_AUTH_INTERFACE'}=""; + $ENV{'PLUGIN_AUTH_SERVER'}=""; + $ENV{'PLUGIN_AUTH_CLIENT'}=""; } @@ -2128,12 +2193,12 @@ sub environment_setup { if ( ! $opt_skip_ndbcluster ) { $ENV{'NDB_MGM'}= - my_find_bin($basedir, + my_find_bin($bindir, ["storage/ndb/src/mgmclient", "bin"], "ndb_mgm"); $ENV{'NDB_TOOLS_DIR'}= - my_find_dir($basedir, + my_find_dir($bindir, ["storage/ndb/tools", "bin"]); $ENV{'NDB_EXAMPLES_DIR'}= @@ -2141,7 +2206,7 @@ sub environment_setup { ["storage/ndb/ndbapi-examples", "bin"]); $ENV{'NDB_EXAMPLES_BINARY'}= - my_find_bin($basedir, + my_find_bin($bindir, ["storage/ndb/ndbapi-examples/ndbapi_simple", "bin"], "ndbapi_simple", NOT_REQUIRED); @@ -2241,6 +2306,12 @@ sub environment_setup { } +sub remove_vardir_subs() { + foreach my $sdir ( glob("$opt_vardir/*") ) { + mtr_verbose("Removing subdir $sdir"); + rmtree($sdir); + } +} # # Remove var and any directories in var/ created by previous @@ -2285,11 +2356,7 @@ sub remove_stale_vardir () { mtr_error("The destination for symlink $opt_vardir does not exist") if ! -d readlink($opt_vardir); - foreach my $bin ( glob("$opt_vardir/*") ) - { - mtr_verbose("Removing bin $bin"); - rmtree($bin); - } + remove_vardir_subs(); } } else @@ -3207,6 +3274,7 @@ sub check_testcase($$) if ( keys(%started) == 0){ # All checks completed + mark_time_used('check'); return 0; } # Wait for next process to exit @@ -3222,7 +3290,8 @@ sub check_testcase($$) "\nMTR's internal check of the test case '$tname' failed. This means that the test case does not preserve the state that existed before the test case was executed. Most likely the test case did not -do a proper clean-up. +do a proper clean-up. It could also be caused by the previous test run +by this thread, if the server wasn't restarted. This is the diff of the states of the servers before and after the test case was executed:\n"; $tinfo->{check}.= $report; @@ -3264,6 +3333,11 @@ test case was executed:\n"; # Kill any check processes still running map($_->kill(), values(%started)); + mtr_warning("Check-testcase failed, this could also be caused by the" . + " previous test run by this worker thread") + if $result > 1 && $mode eq "before"; + mark_time_used('check'); + return $result; } @@ -3573,6 +3647,7 @@ sub run_testcase ($) { return 1; } } + mark_time_used('restart'); # -------------------------------------------------------------------- # If --start or --start-dirty given, stop here to let user manually @@ -3625,6 +3700,8 @@ sub run_testcase ($) { do_before_run_mysqltest($tinfo); + mark_time_used('init'); + if ( $opt_check_testcases and check_testcase($tinfo, "before") ){ # Failed to record state of server or server crashed report_failure_and_restart($tinfo); @@ -3671,6 +3748,7 @@ sub run_testcase ($) { } mtr_verbose("Got $proc"); + mark_time_used('test'); # ---------------------------------------------------- # Was it the test program that exited # ---------------------------------------------------- @@ -3768,7 +3846,6 @@ sub run_testcase ($) { # ---------------------------------------------------- # Check if it was an expected crash # ---------------------------------------------------- - SRVDIED: my $check_crash = check_expected_crash_and_restart($proc); if ($check_crash) { @@ -3778,6 +3855,7 @@ sub run_testcase ($) { next; } + SRVDIED: # ---------------------------------------------------- # Stop the test case timer # ---------------------------------------------------- @@ -3897,7 +3975,9 @@ sub get_log_from_proc ($$) { foreach my $mysqld (mysqlds()) { if ($mysqld->{proc} eq $proc) { my @srv_lines= extract_server_log($mysqld->value('#log-error'), $name); - $srv_log= "\nServer log from this test:\n" . join ("", @srv_lines); + $srv_log= "\nServer log from this test:\n" . + "----------SERVER LOG START-----------\n". join ("", @srv_lines) . + "----------SERVER LOG END-------------\n"; last; } } @@ -4074,6 +4154,7 @@ sub check_warnings ($) { if ( keys(%started) == 0){ # All checks completed + mark_time_used('ch-warn'); return $result; } # Wait for next process to exit @@ -4106,6 +4187,7 @@ sub check_warnings ($) { # Kill any check processes still running map($_->kill(), values(%started)); + mark_time_used('ch-warn'); return $result; } @@ -4406,7 +4488,13 @@ sub mysqld_arguments ($$$) { my $mysqld= shift; my $extra_opts= shift; - mtr_add_arg($args, "--defaults-file=%s", $path_config_file); + my @defaults = grep(/^--defaults-file=/, @$extra_opts); + if (@defaults > 0) { + mtr_add_arg($args, pop(@defaults)) + } + else { + mtr_add_arg($args, "--defaults-file=%s", $path_config_file); + } # When mysqld is run by a root user(euid is 0), it will fail # to start unless we specify what user to run as, see BUG#30630 @@ -4442,6 +4530,9 @@ sub mysqld_arguments ($$$) { my $found_skip_core= 0; foreach my $arg ( @$extra_opts ) { + # Skip --defaults-file option since it's handled above. + next if $arg =~ /^--defaults-file/; + # Allow --skip-core-file to be set in -[master|slave].opt file if ($arg eq "--skip-core-file") { @@ -4675,17 +4766,6 @@ sub server_need_restart { } } - # Temporary re-enable the "always restart slave" hack - # this should be removed asap, but will require that each rpl - # testcase cleanup better after itself - ie. stop and reset - # replication - # Use the "#!use-slave-opt" marker to detect that this is a "slave" - # server - if ( $server->option("#!use-slave-opt") ){ - mtr_verbose_restart($server, "Always restart slave(s)"); - return 1; - } - my $is_mysqld= grep ($server eq $_, mysqlds()); if ($is_mysqld) { @@ -5069,6 +5149,8 @@ sub start_mysqltest ($) { my $exe= $exe_mysqltest; my $args; + mark_time_used('init'); + mtr_init_args(\$args); mtr_add_arg($args, "--defaults-file=%s", $path_config_file); @@ -5258,8 +5340,7 @@ sub gdb_arguments { "break mysql_parse\n" . "commands 1\n" . "disable 1\n" . - "end\n" . - "run"); + "end\n"); } if ( $opt_manual_gdb ) @@ -5550,6 +5631,8 @@ Options to control directories to use for tmpfs (/dev/shm) The option can also be set using environment variable MTR_MEM=[DIR] + clean-vardir Clean vardir if tests were successful and if + running in "memory". Otherwise this option is ignored client-bindir=PATH Path to the directory where client binaries are located client-libdir=PATH Path to the directory where client libraries are located @@ -5709,6 +5792,8 @@ Misc options default-myisam Set default storage engine to MyISAM for non-innodb tests. This is needed after switching default storage engine to InnoDB. + report-times Report how much time has been spent on different + phases of test execution. HERE exit(1); diff --git a/mysql-test/r/1st.result b/mysql-test/r/1st.result index e8562662bfd..792d9eaf2f1 100644 --- a/mysql-test/r/1st.result +++ b/mysql-test/r/1st.result @@ -21,7 +21,7 @@ ndb_binlog_index plugin proc procs_priv -proxy_priv +proxies_priv servers slow_log tables_priv diff --git a/mysql-test/r/bug58669.result b/mysql-test/r/bug58669.result new file mode 100644 index 00000000000..5504c5908be --- /dev/null +++ b/mysql-test/r/bug58669.result @@ -0,0 +1,17 @@ +# +# Bug#58669: read_only not enforced on 5.5.x +# +CREATE USER user1@localhost; +CREATE DATABASE db1; +GRANT ALL PRIVILEGES ON db1.* TO user1@localhost; +CREATE TABLE db1.t1(a INT); +SELECT CURRENT_USER(); +CURRENT_USER() +user1@localhost +SHOW VARIABLES LIKE "%read_only%"; +Variable_name Value +read_only ON +INSERT INTO db1.t1 VALUES (1); +ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement +DROP DATABASE db1; +DROP USER user1@localhost; diff --git a/mysql-test/r/connect.result b/mysql-test/r/connect.result index bbd0273c1c6..b21956252d2 100644 --- a/mysql-test/r/connect.result +++ b/mysql-test/r/connect.result @@ -15,7 +15,7 @@ ndb_binlog_index plugin proc procs_priv -proxy_priv +proxies_priv servers slow_log tables_priv @@ -49,7 +49,7 @@ ndb_binlog_index plugin proc procs_priv -proxy_priv +proxies_priv servers slow_log tables_priv @@ -91,7 +91,7 @@ ndb_binlog_index plugin proc procs_priv -proxy_priv +proxies_priv servers slow_log tables_priv diff --git a/mysql-test/r/ctype_binary.result b/mysql-test/r/ctype_binary.result index 0e8fe328589..4d526a86ade 100644 --- a/mysql-test/r/ctype_binary.result +++ b/mysql-test/r/ctype_binary.result @@ -1425,7 +1425,7 @@ create table t1 as select concat(time_to_sec('10:11:12')) as c1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` varbinary(10) NOT NULL DEFAULT '' + `c1` varbinary(10) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select hex(concat(extract(year from 20090702))); @@ -2748,6 +2748,25 @@ DROP TABLE t1; # End of Bug#54916 # # +# Bug#58190 BETWEEN no longer uses indexes for date or datetime fields +# +SELECT @@collation_connection; +@@collation_connection +binary +CREATE TABLE t1 ( +id INT(11) DEFAULT NULL, +date_column DATE DEFAULT NULL, +KEY(date_column)); +INSERT INTO t1 VALUES (1,'2010-09-01'),(2,'2010-10-01'); +EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range date_column date_column 4 NULL 1 Using where +ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL; +EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range date_column date_column 9 NULL 1 Using where +DROP TABLE t1; +# # Bug#52159 returning time type from function and empty left join causes debug assertion # CREATE FUNCTION f1() RETURNS TIME RETURN 1; diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result index b1e9ff38d26..d5ee7214cde 100644 --- a/mysql-test/r/ctype_cp1251.result +++ b/mysql-test/r/ctype_cp1251.result @@ -1507,7 +1507,7 @@ create table t1 as select concat(time_to_sec('10:11:12')) as c1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` varchar(10) CHARACTER SET cp1251 NOT NULL DEFAULT '' + `c1` varchar(10) CHARACTER SET cp1251 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select hex(concat(extract(year from 20090702))); @@ -2830,6 +2830,25 @@ DROP TABLE t1; # End of Bug#54916 # # +# Bug#58190 BETWEEN no longer uses indexes for date or datetime fields +# +SELECT @@collation_connection; +@@collation_connection +cp1251_general_ci +CREATE TABLE t1 ( +id INT(11) DEFAULT NULL, +date_column DATE DEFAULT NULL, +KEY(date_column)); +INSERT INTO t1 VALUES (1,'2010-09-01'),(2,'2010-10-01'); +EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range date_column date_column 4 NULL 1 Using where +ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL; +EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range date_column date_column 9 NULL 1 Using where +DROP TABLE t1; +# # Bug#52159 returning time type from function and empty left join causes debug assertion # CREATE FUNCTION f1() RETURNS TIME RETURN 1; diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result index 6216819d172..ac84b169ec3 100644 --- a/mysql-test/r/ctype_latin1.result +++ b/mysql-test/r/ctype_latin1.result @@ -410,6 +410,15 @@ hex(cast(_ascii 0x7f as char(1) character set latin1)) 7F End of 5.0 tests # +# Bug#58022 ... like ... escape export_set ( ... ) crashes when export_set returns warnings +# +SELECT '' LIKE '' ESCAPE EXPORT_SET(1, 1, 1, 1, ''); +'' LIKE '' ESCAPE EXPORT_SET(1, 1, 1, 1, '') +1 +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '' +End of 5.1 tests +# # Start of 5.5 tests # # @@ -1835,7 +1844,7 @@ create table t1 as select concat(time_to_sec('10:11:12')) as c1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` varchar(10) NOT NULL DEFAULT '' + `c1` varchar(10) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select hex(concat(extract(year from 20090702))); @@ -3158,6 +3167,25 @@ DROP TABLE t1; # End of Bug#54916 # # +# Bug#58190 BETWEEN no longer uses indexes for date or datetime fields +# +SELECT @@collation_connection; +@@collation_connection +latin1_swedish_ci +CREATE TABLE t1 ( +id INT(11) DEFAULT NULL, +date_column DATE DEFAULT NULL, +KEY(date_column)); +INSERT INTO t1 VALUES (1,'2010-09-01'),(2,'2010-10-01'); +EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range date_column date_column 4 NULL 1 Using where +ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL; +EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range date_column date_column 9 NULL 1 Using where +DROP TABLE t1; +# # Bug#52159 returning time type from function and empty left join causes debug assertion # CREATE FUNCTION f1() RETURNS TIME RETURN 1; diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index c2fb90ecfa6..11d5117bbe1 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -2667,7 +2667,7 @@ create table t1 as select concat(time_to_sec('10:11:12')) as c1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT '' + `c1` varchar(10) CHARACTER SET ucs2 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select hex(concat(extract(year from 20090702))); @@ -3990,6 +3990,25 @@ DROP TABLE t1; # End of Bug#54916 # # +# Bug#58190 BETWEEN no longer uses indexes for date or datetime fields +# +SELECT @@collation_connection; +@@collation_connection +ucs2_general_ci +CREATE TABLE t1 ( +id INT(11) DEFAULT NULL, +date_column DATE DEFAULT NULL, +KEY(date_column)); +INSERT INTO t1 VALUES (1,'2010-09-01'),(2,'2010-10-01'); +EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL; +EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +DROP TABLE t1; +# # Bug#52159 returning time type from function and empty left join causes debug assertion # CREATE FUNCTION f1() RETURNS TIME RETURN 1; diff --git a/mysql-test/r/ctype_ujis.result b/mysql-test/r/ctype_ujis.result index 946aa1c780e..b801a7f45a4 100644 --- a/mysql-test/r/ctype_ujis.result +++ b/mysql-test/r/ctype_ujis.result @@ -2374,6 +2374,16 @@ hex(convert(_latin1 0xA4A2 using ujis)) hex(c2) DROP PROCEDURE sp1; DROP TABLE t1; DROP TABLE t2; +# +# Bug#57257 Replace(ExtractValue(...)) causes MySQL crash +# +SET NAMES utf8; +SELECT CONVERT(REPLACE(EXPORT_SET('a','a','a','','a'),'00','') USING ujis); +CONVERT(REPLACE(EXPORT_SET('a','a','a','','a'),'00','') USING ujis) + +Warnings: +Warning 1292 Truncated incorrect INTEGER value: 'a' +Warning 1292 Truncated incorrect INTEGER value: 'a' set names default; set character_set_database=default; set character_set_server=default; diff --git a/mysql-test/r/ctype_utf16.result b/mysql-test/r/ctype_utf16.result index 7cee15aecef..beafbf80e1e 100644 --- a/mysql-test/r/ctype_utf16.result +++ b/mysql-test/r/ctype_utf16.result @@ -625,16 +625,16 @@ INSERT INTO t1 VALUES (_utf8mb4 0xCE85),(_utf8mb4 0xF4808080); SELECT HEX(a), HEX(CONVERT(a USING utf8mb4)) FROM t1 ORDER BY a; HEX(a) HEX(CONVERT(a USING utf8mb4)) 0385 CE85 +FF9D EFBE9D D800DF84 F0908E84 DBC0DC00 F4808080 -FF9D EFBE9D ALTER TABLE t1 ADD KEY(a); SELECT HEX(a), HEX(CONVERT(a USING utf8mb4)) FROM t1 ORDER BY a; HEX(a) HEX(CONVERT(a USING utf8mb4)) 0385 CE85 +FF9D EFBE9D D800DF84 F0908E84 DBC0DC00 F4808080 -FF9D EFBE9D DROP TABLE IF EXISTS t1; select @@collation_connection; @@collation_connection diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index e14b54b59a3..5763885d5f3 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -1898,6 +1898,37 @@ CONVERT(a, CHAR) CONVERT(b, CHAR) 70000 1092 DROP TABLE t1; End of 5.0 tests +SELECT LENGTH(RPAD(0.0115E88, 61297, _utf8'ÑÑÑŽÑ')); +LENGTH(RPAD(0.0115E88, 61297, _utf8'ÑÑÑŽÑ')) +122587 +SELECT LENGTH(RPAD(0.0115E88, 61297, _utf8'йцуÑ')); +LENGTH(RPAD(0.0115E88, 61297, _utf8'йцуÑ')) +122587 +SELECT HEX(RPAD(0x20, 2, _utf8 0xD18F)); +HEX(RPAD(0x20, 2, _utf8 0xD18F)) +20D1 +SELECT HEX(RPAD(0x20, 4, _utf8 0xD18F)); +HEX(RPAD(0x20, 4, _utf8 0xD18F)) +20D18FD1 +SELECT HEX(LPAD(0x20, 2, _utf8 0xD18F)); +HEX(LPAD(0x20, 2, _utf8 0xD18F)) +D120 +SELECT HEX(LPAD(0x20, 4, _utf8 0xD18F)); +HEX(LPAD(0x20, 4, _utf8 0xD18F)) +D18FD120 +SELECT HEX(RPAD(_utf8 0xD18F, 3, 0x20)); +HEX(RPAD(_utf8 0xD18F, 3, 0x20)) +D18F20 +SELECT HEX(LPAD(_utf8 0xD18F, 3, 0x20)); +HEX(LPAD(_utf8 0xD18F, 3, 0x20)) +20D18F +SELECT HEX(INSERT(_utf8 0xD18F, 2, 1, 0x20)); +HEX(INSERT(_utf8 0xD18F, 2, 1, 0x20)) +D120 +SELECT HEX(INSERT(_utf8 0xD18FD18E, 2, 1, 0x20)); +HEX(INSERT(_utf8 0xD18FD18E, 2, 1, 0x20)) +D120D18E +End of 5.1 tests Start of 5.4 tests SET NAMES utf8mb3; SHOW VARIABLES LIKE 'character_set_results%'; @@ -2040,6 +2071,20 @@ predicted_order hex(utf8_encoding) 100 E0B78AE2808DE0B6BA 101 E0B78AE2808DE0B6BB DROP TABLE t1; +SET NAMES utf8 COLLATE utf8_sinhala_ci; +CREATE TABLE t1 (s1 VARCHAR(10) COLLATE utf8_sinhala_ci); +INSERT INTO t1 VALUES ('a'),('ae'),('af'); +SELECT s1,hex(s1) FROM t1 ORDER BY s1; +s1 hex(s1) +a 61 +ae 6165 +af 6166 +SELECT * FROM t1 ORDER BY s1; +s1 +a +ae +af +DROP TABLE t1; End of 5.4 tests # # Start of 5.5 tests @@ -3511,7 +3556,7 @@ create table t1 as select concat(time_to_sec('10:11:12')) as c1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `c1` varchar(10) CHARACTER SET utf8 NOT NULL DEFAULT '' + `c1` varchar(10) CHARACTER SET utf8 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; select hex(concat(extract(year from 20090702))); @@ -4834,6 +4879,25 @@ DROP TABLE t1; # End of Bug#54916 # # +# Bug#58190 BETWEEN no longer uses indexes for date or datetime fields +# +SELECT @@collation_connection; +@@collation_connection +utf8_general_ci +CREATE TABLE t1 ( +id INT(11) DEFAULT NULL, +date_column DATE DEFAULT NULL, +KEY(date_column)); +INSERT INTO t1 VALUES (1,'2010-09-01'),(2,'2010-10-01'); +EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range date_column date_column 4 NULL 1 Using where +ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL; +EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range date_column date_column 9 NULL 1 Using where +DROP TABLE t1; +# # Bug#52159 returning time type from function and empty left join causes debug assertion # CREATE FUNCTION f1() RETURNS TIME RETURN 1; @@ -4854,5 +4918,16 @@ maketime(`a`,`a`,`a`) DROP TABLE t1; SET sql_mode=default; # +# Bug#57687 crash when reporting duplicate group_key error and utf8 +# Make sure to modify this when Bug#58081 is fixed. +# +SET NAMES utf8; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (0), (0), (1), (0), (0); +SELECT COUNT(*) FROM t1, t1 t2 +GROUP BY INSERT('', t2.a, t1.a, (@@global.max_binlog_size)); +ERROR 23000: Duplicate entry '107374182410737418241' for key 'group_key' +DROP TABLE t1; +# # End of 5.5 tests # diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result index 432b9b14a85..b6081d34f37 100644 --- a/mysql-test/r/date_formats.result +++ b/mysql-test/r/date_formats.result @@ -544,3 +544,17 @@ SELECT DATE_FORMAT("2009-01-01",'%W %d %M %Y') as valid_date; valid_date Thursday 01 January 2009 "End of 5.0 tests" +# +# Start of 5.1 tests +# +# +# Bug#58005 utf8 + get_format causes failed assertion: !str || str != Ptr' +# +SET NAMES utf8; +SELECT LEAST('%', GET_FORMAT(datetime, 'eur'), CAST(GET_FORMAT(datetime, 'eur') AS CHAR(65535))); +LEAST('%', GET_FORMAT(datetime, 'eur'), CAST(GET_FORMAT(datetime, 'eur') AS CHAR(65535))) +% +SET NAMES latin1; +# +# End of 5.1 tests +# diff --git a/mysql-test/r/delayed.result b/mysql-test/r/delayed.result index 77aa0d49407..d9082914d05 100644 --- a/mysql-test/r/delayed.result +++ b/mysql-test/r/delayed.result @@ -418,6 +418,18 @@ COMMIT; UNLOCK TABLES; # Connection con1 # Reaping: INSERT DELAYED INTO t1 VALUES (5) +# Connection default +# Test 5: LOCK TABLES + INSERT DELAYED in one connection. +# This test has triggered some asserts in metadata locking +# subsystem at some point in time.. +LOCK TABLE t1 WRITE; +INSERT DELAYED INTO t2 VALUES (7); +UNLOCK TABLES; +SET AUTOCOMMIT= 0; +LOCK TABLE t1 WRITE; +INSERT DELAYED INTO t2 VALUES (8); +UNLOCK TABLES; +SET AUTOCOMMIT= 1; # Connection con2 # Connection con1 # Connection default diff --git a/mysql-test/r/errors.result b/mysql-test/r/errors.result index 3d247a242a3..e6a1b492b39 100644 --- a/mysql-test/r/errors.result +++ b/mysql-test/r/errors.result @@ -134,3 +134,15 @@ INSERT INTO t1 VALUES ('abc\0\0'); INSERT INTO t1 VALUES ('abc\0\0'); ERROR 23000: Duplicate entry 'abc\x00\x00' for key 'PRIMARY' DROP TABLE t1; +# +# Bug#57882: Item_func_conv_charset::val_str(String*): +# Assertion `fixed == 1' failed +# +SELECT (CONVERT('0' USING latin1) IN (CHAR(COT('v') USING utf8),'')); +ERROR 22003: DOUBLE value is out of range in 'cot('v')' +SET NAMES utf8 COLLATE utf8_latvian_ci ; +SELECT UPDATEXML(-73 * -2465717823867977728,@@global.auto_increment_increment,null); +ERROR 22003: BIGINT value is out of range in '(-(73) * -(2465717823867977728))' +# +# End Bug#57882 +# diff --git a/mysql-test/r/events_2.result b/mysql-test/r/events_2.result index 530d8559f11..66ec00d7357 100644 --- a/mysql-test/r/events_2.result +++ b/mysql-test/r/events_2.result @@ -133,15 +133,15 @@ select event_name from information_schema.events; event_name e1 create event e2 on schedule every 10 hour do select 1; -ERROR HY000: Table 'event' was not locked with LOCK TABLES +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction alter event e2 disable; -ERROR HY000: Table 'event' was not locked with LOCK TABLES +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction alter event e2 rename to e3; -ERROR HY000: Table 'event' was not locked with LOCK TABLES +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction drop event e2; -ERROR HY000: Table 'event' was not locked with LOCK TABLES +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction drop event e1; -ERROR HY000: Table 'event' was not locked with LOCK TABLES +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction unlock tables; lock table t1 write; show create event e1; @@ -151,15 +151,15 @@ select event_name from information_schema.events; event_name e1 create event e2 on schedule every 10 hour do select 1; -ERROR HY000: Table 'event' was not locked with LOCK TABLES +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction alter event e2 disable; -ERROR HY000: Table 'event' was not locked with LOCK TABLES +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction alter event e2 rename to e3; -ERROR HY000: Table 'event' was not locked with LOCK TABLES +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction drop event e2; -ERROR HY000: Table 'event' was not locked with LOCK TABLES +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction drop event e1; -ERROR HY000: Table 'event' was not locked with LOCK TABLES +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction unlock tables; lock table t1 read, mysql.event read; show create event e1; @@ -169,15 +169,15 @@ select event_name from information_schema.events; event_name e1 create event e2 on schedule every 10 hour do select 1; -ERROR HY000: Table 'event' was locked with a READ lock and can't be updated +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction alter event e2 disable; -ERROR HY000: Table 'event' was locked with a READ lock and can't be updated +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction alter event e2 rename to e3; -ERROR HY000: Table 'event' was locked with a READ lock and can't be updated +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction drop event e2; -ERROR HY000: Table 'event' was locked with a READ lock and can't be updated +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction drop event e1; -ERROR HY000: Table 'event' was locked with a READ lock and can't be updated +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction unlock tables; lock table t1 write, mysql.event read; show create event e1; @@ -187,15 +187,15 @@ select event_name from information_schema.events; event_name e1 create event e2 on schedule every 10 hour do select 1; -ERROR HY000: Table 'event' was locked with a READ lock and can't be updated +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction alter event e2 disable; -ERROR HY000: Table 'event' was locked with a READ lock and can't be updated +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction alter event e2 rename to e3; -ERROR HY000: Table 'event' was locked with a READ lock and can't be updated +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction drop event e2; -ERROR HY000: Table 'event' was locked with a READ lock and can't be updated +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction drop event e1; -ERROR HY000: Table 'event' was locked with a READ lock and can't be updated +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction unlock tables; lock table t1 read, mysql.event write; ERROR HY000: You can't combine write-locking of system tables with other tables or lock types @@ -209,11 +209,17 @@ select event_name from information_schema.events; event_name e1 create event e2 on schedule every 10 hour do select 1; +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction alter event e2 disable; +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction alter event e2 rename to e3; +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction drop event e3; +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction drop event e1; +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction unlock tables; +drop event e1; Make sure we have left no events select event_name from information_schema.events; event_name diff --git a/mysql-test/r/explain.result b/mysql-test/r/explain.result index b8dbb54e5fb..b9ae362f6cd 100644 --- a/mysql-test/r/explain.result +++ b/mysql-test/r/explain.result @@ -271,4 +271,50 @@ EXPLAIN SELECT c1 FROM t1 WHERE c2 = 1 AND c4 = 1 AND c5 = 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref c2,c2_2 c2 10 const,const 3 Using where DROP TABLE t1; +# +# Bug#56814 Explain + subselect + fulltext crashes server +# +CREATE TABLE t1(f1 VARCHAR(6) NOT NULL, +FULLTEXT KEY(f1),UNIQUE(f1)); +INSERT INTO t1 VALUES ('test'); +EXPLAIN SELECT 1 FROM t1 +WHERE 1 > ALL((SELECT 1 FROM t1 JOIN t1 a ON (MATCH(t1.f1) AGAINST ("")) +WHERE t1.f1 GROUP BY t1.f1)); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 system NULL NULL NULL NULL 1 +2 SUBQUERY a system NULL NULL NULL NULL 1 Using filesort +2 SUBQUERY t1 fulltext f1 f1 0 1 Using where +PREPARE stmt FROM +'EXPLAIN SELECT 1 FROM t1 + WHERE 1 > ALL((SELECT 1 FROM t1 RIGHT OUTER JOIN t1 a + ON (MATCH(t1.f1) AGAINST ("")) + WHERE t1.f1 GROUP BY t1.f1))'; +EXECUTE stmt; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 system NULL NULL NULL NULL 1 +2 SUBQUERY a system NULL NULL NULL NULL 1 Using filesort +2 SUBQUERY t1 fulltext f1 f1 0 1 Using where +EXECUTE stmt; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 system NULL NULL NULL NULL 1 +2 SUBQUERY a system NULL NULL NULL NULL 1 Using filesort +2 SUBQUERY t1 fulltext f1 f1 0 1 Using where +DEALLOCATE PREPARE stmt; +PREPARE stmt FROM +'EXPLAIN SELECT 1 FROM t1 + WHERE 1 > ALL((SELECT 1 FROM t1 JOIN t1 a + ON (MATCH(t1.f1) AGAINST ("")) + WHERE t1.f1 GROUP BY t1.f1))'; +EXECUTE stmt; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 system NULL NULL NULL NULL 1 +2 SUBQUERY a system NULL NULL NULL NULL 1 Using filesort +2 SUBQUERY t1 fulltext f1 f1 0 1 Using where +EXECUTE stmt; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 system NULL NULL NULL NULL 1 +2 SUBQUERY a system NULL NULL NULL NULL 1 Using filesort +2 SUBQUERY t1 fulltext f1 f1 0 1 Using where +DEALLOCATE PREPARE stmt; +DROP TABLE t1; End of 5.1 tests. diff --git a/mysql-test/r/flush.result b/mysql-test/r/flush.result index ced8306c3ab..b1e2e48eca8 100644 --- a/mysql-test/r/flush.result +++ b/mysql-test/r/flush.result @@ -423,3 +423,31 @@ i 4 unlock tables; drop tables tm, t1, t2; +# +# Test for bug #57006 "Deadlock between HANDLER and +# FLUSH TABLES WITH READ LOCK". +# +drop table if exists t1, t2; +create table t1 (i int); +create table t2 (i int); +handler t1 open; +# Switching to connection 'con1'. +# Sending: +flush tables with read lock; +# Switching to connection 'con2'. +# Wait until FTWRL starts waiting for 't1' to be closed. +# Switching to connection 'default'. +# The below statement should not cause deadlock. +# Sending: +insert into t2 values (1); +# Switching to connection 'con2'. +# Wait until INSERT starts to wait for FTWRL to go away. +# Switching to connection 'con1'. +# FTWRL should be able to continue now. +# Reap FTWRL. +unlock tables; +# Switching to connection 'default'. +# Reap INSERT. +handler t1 close; +# Cleanup. +drop tables t1, t2; diff --git a/mysql-test/r/flush_read_lock.result b/mysql-test/r/flush_read_lock.result new file mode 100644 index 00000000000..2b1071a92b2 --- /dev/null +++ b/mysql-test/r/flush_read_lock.result @@ -0,0 +1,1683 @@ +# FTWRL takes two global metadata locks -- a global shared +# metadata lock and the commit blocker lock. +# The first lock prevents DDL from taking place. +# Let's say that all DDL statements that take metadata +# locks form class #1 -- incompatible with FTWRL because +# take incompatible MDL table locks. +# The first global lock doesn't, however, prevent standalone +# COMMITs (or implicit COMMITs) from taking place, since a +# COMMIT doesn't take table locks. It doesn't prevent +# DDL on temporary tables either, since they don't +# take any table locks either. +# Most DDL statements do not perform an implicit commit +# if operate on a temporary table. Examples are CREATE +# TEMPORARY TABLE and DROP TEMPORARY TABLE. +# Thus, these DDL statements can go through in presence +# of FTWRL. This is class #2 -- compatible because +# do not take incompatible MDL locks and do not issue +# implicit commit.. +# (Although these operations do not commit, their effects +# cannot be rolled back either.) +# ALTER TABLE, ANALYZE, OPTIMIZE and some others always +# issue an implicit commit, even if its argument is a +# temporary table. +# *Howewer* an implicit commit is a no-op if all engines +# used since the start of transactiona are non- +# transactional. Thus, for non-transactional engines, +# these operations are not blocked by FTWRL. +# This is class #3 -- compatible because do not take +# MDL table locks and are non-transactional. +# On the contrary, for transactional engines, there +# is always a commit, regardless of whether a table +# is temporary or not. Thus, for example, ALTER TABLE +# for a transactional engine will wait for FTWRL, +# even if the subject table is temporary. +# Thus ALTER TABLE is incompatible +# with FTWRL. This is class #4 -- incompatible +# becuase issue implicit COMMIT which is not a no-op. +# Finally, there are administrative statements (such as +# RESET SLAVE) that do not take any locks and do not +# issue COMMIT. +# This is class #5. +# The goal of this coverage is to test statements +# of all classes. +# @todo: documents the effects of @@autocommit, +# DML and temporary transactional tables. +# Use MyISAM engine for the most of the tables +# used in this test in order to be able to +# check that DDL statements on temporary tables +# are compatible with FTRWL. +drop tables if exists t1_base, t2_base, t3_trans; +drop tables if exists tm_base, tm_base_temp; +drop database if exists mysqltest1; +# We're going to test ALTER DATABASE UPGRADE +drop database if exists `#mysql50#mysqltest-2`; +drop procedure if exists p1; +drop function if exists f1; +drop view if exists v1; +drop procedure if exists p2; +drop function if exists f2_base; +drop function if exists f2_temp; +drop event if exists e1; +drop event if exists e2; +create table t1_base(i int) engine=myisam; +create table t2_base(j int) engine=myisam; +create table t3_trans(i int) engine=innodb; +create temporary table t1_temp(i int) engine=myisam; +create temporary table t2_temp(j int) engine=myisam; +create temporary table t3_temp_trans(i int) engine=innodb; +create database mysqltest1; +create database `#mysql50#mysqltest-2`; +create procedure p1() begin end; +create function f1() returns int return 0; +create view v1 as select 1 as i; +create procedure p2(i int) begin end; +create function f2_base() returns int +begin +insert into t1_base values (1); +return 0; +end| +create function f2_temp() returns int +begin +insert into t1_temp values (1); +return 0; +end| +create event e1 on schedule every 1 minute do begin end; +# +# Test compatibility of FLUSH TABLES WITH READ LOCK +# with various statements. +# +# These tests don't cover some classes of statements: +# - Replication-related - CHANGE MASTER TO, START/STOP SLAVE and etc +# (all compatible with FTWRL). +# - Plugin-related - INSTALL/UNINSTALL (incompatible with FTWRL, +# require plugin support). +# +# 1) ALTER variants. +# +# 1.1) ALTER TABLE +# +# 1.1.a) For base table should be incompatible with FTWRL. +# +Success: Was not able to run 'alter table t1_base add column c1 int' under FTWRL. +Success: 'alter table t1_base add column c1 int' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'alter table t1_base add column c1 int' is active in another connection. +# +# 1.1.b) For a temporary table should be compatible with FTWRL. +# +Success: Was able to run 'alter table t1_temp add column c1 int' under FTWRL. +Success: Was able to run 'alter table t1_temp add column c1 int' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'alter table t1_temp add column c1 int' was active in another connection. +# +# 1.2) ALTER DATABASE should be incompatible with FTWRL. +# +Success: Was not able to run 'alter database mysqltest1 default character set utf8' under FTWRL. +Success: 'alter database mysqltest1 default character set utf8' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'alter database mysqltest1 default character set utf8' is active in another connection. +# +# 1.3) ALTER DATABASE UPGRADE DATA DIRECTORY NAME should be +# incompatible with FTWRL. +# +Success: Was not able to run 'alter database `#mysql50#mysqltest-2` upgrade data directory name' under FTWRL. +Success: 'alter database `#mysql50#mysqltest-2` upgrade data directory name' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'alter database `#mysql50#mysqltest-2` upgrade data directory name' is active in another connection. +# +# 1.4) ALTER PROCEDURE should be incompatible with FTWRL. +# +Success: Was not able to run 'alter procedure p1 comment 'a'' under FTWRL. +Success: 'alter procedure p1 comment 'a'' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'alter procedure p1 comment 'a'' is active in another connection. +# +# 1.5) ALTER FUNCTION should be incompatible with FTWRL. +# +Success: Was not able to run 'alter function f1 comment 'a'' under FTWRL. +Success: 'alter function f1 comment 'a'' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'alter function f1 comment 'a'' is active in another connection. +# +# 1.6) ALTER VIEW should be incompatible with FTWRL. +# +Success: Was not able to run 'alter view v1 as select 2 as j' under FTWRL. +Success: 'alter view v1 as select 2 as j' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'alter view v1 as select 2 as j' is active in another connection. +# +# 1.7) ALTER EVENT should be incompatible with FTWRL. +# +Success: Was not able to run 'alter event e1 comment 'test'' under FTWRL. +Success: 'alter event e1 comment 'test'' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'alter event e1 comment 'test'' is active in another connection. +# +# 1.x) The rest of ALTER statements (ALTER TABLESPACE, +# ALTER LOGFILE GROUP and ALTER SERVER) are too +# special to be tested here. +# +# +# 2) ANALYZE TABLE statement is compatible with FTWRL. +# See Bug#43336 ANALYZE and OPTIMIZE do not honour +# --read-only for a discussion why. +# +Success: Was able to run 'analyze table t1_base' under FTWRL. +Success: Was able to run 'analyze table t1_base' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'analyze table t1_base' was active in another connection. +# +# 3) BEGIN, ROLLBACK and COMMIT statements. +# BEGIN and ROLLBACK are compatible with FTWRL. +# COMMIT is not. +# +# We need a special test for these statements as +# FTWRL commits a transaction and because COMMIT +# is handled in a special way. +flush tables with read lock; +begin; +# ROLLBACK is allowed under FTWRL although there +# no much sense in it. FTWRL commits any previous +# changes and doesn't allows any DML after it. +# So such a ROLLBACK is always a no-op. +rollback; +# Although COMMIT is incompatible with FTWRL in +# other senses it is still allowed under FTWRL. +# This fact relied upon by some versions of +# innobackup tool. +# Similarly to ROLLBACK it is a no-op in this situation. +commit; +unlock tables; +# Check that BEGIN/ROLLBACK are not blocked and +# COMMIT is blocked by active FTWRL in another +# connection. +# +# Switching to connection 'con1'. +flush tables with read lock; +# Switching to connection 'default'. +begin; +# Switching to connection 'con1'. +unlock tables; +# Switching to connection 'default'. +# Do some work so ROLLBACK is not a no-op. +insert into t3_trans values (1); +# Switching to connection 'con1'. +flush tables with read lock; +# Switching to connection 'default'. +rollback; +# Switching to connection 'con1'. +unlock tables; +# Switching to connection 'default'. +begin; +# Do some work so COMMIT is not a no-op. +insert into t3_trans values (1); +# Switching to connection 'con1'. +flush tables with read lock; +# Switching to connection 'default'. +# Send: +commit; +# Switching to connection 'con1'. +# Wait until COMMIT is blocked. +unlock tables; +# Switching to connection 'default'. +# Reap COMMIT. +delete from t3_trans; +# +# Check that COMMIT blocks FTWRL in another connection. +begin; +insert into t3_trans values (1); +set debug_sync='RESET'; +set debug_sync='ha_commit_trans_after_acquire_commit_lock SIGNAL parked WAIT_FOR go'; +commit; +# Switching to connection 'con1'. +set debug_sync='now WAIT_FOR parked'; +flush tables with read lock; +# Switching to connection 'con2'. +# Wait until FTWRL is blocked. +set debug_sync='now SIGNAL go'; +# Switching to connection 'default'. +# Reap COMMIT. +# Switching to connection 'con1'. +# Reap FTWRL. +unlock tables; +# Switching to connection 'default'. +delete from t3_trans; +set debug_sync= "RESET"; +# We don't run similar test for BEGIN and ROLLBACK as +# they release metadata locks in non-standard place. +# +# 4) BINLOG statement should be incompatible with FTWRL. +# +# +# Provide format description BINLOG statement first. +BINLOG ' +MfmqTA8BAAAAZwAAAGsAAAABAAQANS41LjctbTMtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAx+apMEzgNAAgAEgAEBAQEEgAAVAAEGggAAAAICAgCAA== +'; +# Now test compatibility for BINLOG statement which is +# equivalent to INSERT INTO t1_base VALUES (1). +# Skip last part of compatibility testing as this statement +# releases metadata locks in non-standard place. +Success: Was not able to run 'BINLOG ' +MfmqTBMBAAAALgAAAN0AAAAAACgAAAAAAAEABHRlc3QAB3QxX2Jhc2UAAQMAAQ== +MfmqTBcBAAAAIgAAAP8AAAAAACgAAAAAAAEAAf/+AQAAAA== +'' under FTWRL. +Success: 'BINLOG ' +MfmqTBMBAAAALgAAAN0AAAAAACgAAAAAAAEABHRlc3QAB3QxX2Jhc2UAAQMAAQ== +MfmqTBcBAAAAIgAAAP8AAAAAACgAAAAAAAEAAf/+AQAAAA== +'' is blocked by FTWRL active in another connection. +# +# 5) CALL statement. This statement uses resources in two +# ways: through expressions used as parameters and through +# sub-statements. This test covers only usage through +# parameters as sub-statements do locking individually. +# +# 5.a) In simple cases a parameter expression should be +# compatible with FTWRL. +# Skip last part of compatibility testing as this statement +# releases metadata locks in non-standard place. +Success: Was able to run 'call p2((select count(*) from t1_base))' under FTWRL. +Success: Was able to run 'call p2((select count(*) from t1_base))' with FTWRL active in another connection. +# +# 5.b) In case when an expression uses function which updates +# base tables CALL should be incompatible with FTWRL. +# +# Skip last part of compatibility testing as this statement +# releases metadata locks in non-standard place. +Success: Was not able to run 'call p2(f2_base())' under FTWRL. +Success: 'call p2(f2_base())' is blocked by FTWRL active in another connection. +# +# 5.c) If function used as argument updates temporary tables +# CALL statement should be compatible with FTWRL. +# +# Skip last part of compatibility testing as this statement +# releases metadata locks in non-standard place. +Success: Was able to run 'call p2(f2_temp())' under FTWRL. +Success: Was able to run 'call p2(f2_temp())' with FTWRL active in another connection. +# +# 6) CHECK TABLE statement is compatible with FTWRL. +# +Success: Was able to run 'check table t1_base' under FTWRL. +Success: Was able to run 'check table t1_base' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'check table t1_base' was active in another connection. +# +# 7) CHECKSUM TABLE statement is compatible with FTWRL. +# +Success: Was able to run 'checksum table t1_base' under FTWRL. +Success: Was able to run 'checksum table t1_base' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'checksum table t1_base' was active in another connection. +# +# 8) CREATE variants. +# +# 8.1) CREATE TABLE statement. +# +# 8.1.a) CREATE TABLE is incompatible with FTWRL when +# base table is created. +Success: Was not able to run 'create table t3_base(i int)' under FTWRL. +Success: 'create table t3_base(i int)' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'create table t3_base(i int)' is active in another connection. +# 8.1.b) CREATE TABLE is compatible with FTWRL when +# temporary table is created. +Success: Was able to run 'create temporary table t3_temp(i int)' under FTWRL. +Success: Was able to run 'create temporary table t3_temp(i int)' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'create temporary table t3_temp(i int)' was active in another connection. +# 8.1.c) CREATE TABLE LIKE is incompatible with FTWRL when +# base table is created. +Success: Was not able to run 'create table t3_base like t1_temp' under FTWRL. +Success: 'create table t3_base like t1_temp' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'create table t3_base like t1_temp' is active in another connection. +# 8.1.d) CREATE TABLE LIKE is compatible with FTWRL when +# temporary table is created. +Success: Was able to run 'create temporary table t3_temp like t1_base' under FTWRL. +Success: Was able to run 'create temporary table t3_temp like t1_base' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'create temporary table t3_temp like t1_base' was active in another connection. +# 8.1.e) CREATE TABLE SELECT is incompatible with FTWRL when +# base table is created. +Success: Was not able to run 'create table t3_base select 1 as i' under FTWRL. +Success: 'create table t3_base select 1 as i' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'create table t3_base select 1 as i' is active in another connection. +# 8.1.f) CREATE TABLE SELECT is compatible with FTWRL when +# temporary table is created. +Success: Was able to run 'create temporary table t3_temp select 1 as i' under FTWRL. +Success: Was able to run 'create temporary table t3_temp select 1 as i' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'create temporary table t3_temp select 1 as i' was active in another connection. +# 8.2) CREATE INDEX statement. +# +# 8.2.a) CREATE INDEX is incompatible with FTWRL when +# applied to base table. +Success: Was not able to run 'create index i on t1_base (i)' under FTWRL. +Success: 'create index i on t1_base (i)' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'create index i on t1_base (i)' is active in another connection. +# 8.2.b) CREATE INDEX is compatible with FTWRL when +# applied to temporary table. +Success: Was able to run 'create index i on t1_temp (i)' under FTWRL. +Success: Was able to run 'create index i on t1_temp (i)' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'create index i on t1_temp (i)' was active in another connection. +# +# 8.3) CREATE DATABASE is incompatible with FTWRL. +# +Success: Was not able to run 'create database mysqltest2' under FTWRL. +Success: 'create database mysqltest2' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'create database mysqltest2' is active in another connection. +# +# 8.4) CREATE VIEW is incompatible with FTWRL. +# +Success: Was not able to run 'create view v2 as select 1 as j' under FTWRL. +Success: 'create view v2 as select 1 as j' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'create view v2 as select 1 as j' is active in another connection. +# +# 8.5) CREATE TRIGGER is incompatible with FTWRL. +# +Success: Was not able to run 'create trigger t1_bi before insert on t1_base for each row begin end' under FTWRL. +Success: 'create trigger t1_bi before insert on t1_base for each row begin end' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'create trigger t1_bi before insert on t1_base for each row begin end' is active in another connection. +# +# 8.6) CREATE FUNCTION is incompatible with FTWRL. +# +Success: Was not able to run 'create function f2() returns int return 0' under FTWRL. +Success: 'create function f2() returns int return 0' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'create function f2() returns int return 0' is active in another connection. +# +# 8.7) CREATE PROCEDURE is incompatible with FTWRL. +# +Success: Was not able to run 'create procedure p3() begin end' under FTWRL. +Success: 'create procedure p3() begin end' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'create procedure p3() begin end' is active in another connection. +# +# 8.8) CREATE EVENT should be incompatible with FTWRL. +# +Success: Was not able to run 'create event e2 on schedule every 1 minute do begin end' under FTWRL. +Success: 'create event e2 on schedule every 1 minute do begin end' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'create event e2 on schedule every 1 minute do begin end' is active in another connection. +# +# 8.9) CREATE USER should be incompatible with FTWRL. +# +Success: Was not able to run 'create user mysqltest_u1' under FTWRL. +Success: 'create user mysqltest_u1' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'create user mysqltest_u1' is active in another connection. +# +# 8.x) The rest of CREATE variants (CREATE LOGFILE GROUP, +# CREATE TABLESPACE and CREATE SERVER) are too special +# to test here. +# +# +# 9) PREPARE, EXECUTE and DEALLOCATE PREPARE statements. +# +# 9.1) PREPARE statement is compatible with FTWRL as it +# doesn't change any data. +# +# 9.1.a) Prepare of simple INSERT statement. +# +# Skip last part of compatibility testing as this statement +# releases metadata locks in non-standard place. +Success: Was able to run 'prepare stmt1 from 'insert into t1_base values (1)'' under FTWRL. +Success: Was able to run 'prepare stmt1 from 'insert into t1_base values (1)'' with FTWRL active in another connection. +# +# 9.1.b) Prepare of multi-UPDATE. At some point such statements +# tried to acquire thr_lock.c locks during prepare phase. +# This no longer happens and thus it is compatible with +# FTWRL. +# Skip last part of compatibility testing as this statement +# releases metadata locks in non-standard place. +Success: Was able to run 'prepare stmt1 from 'update t1_base, t2_base set t1_base.i= 1 where t1_base.i = t2_base.j'' under FTWRL. +Success: Was able to run 'prepare stmt1 from 'update t1_base, t2_base set t1_base.i= 1 where t1_base.i = t2_base.j'' with FTWRL active in another connection. +# +# 9.1.c) Prepare of multi-DELETE. Again PREPARE of such +# statement should be compatible with FTWRL. +# Skip last part of compatibility testing as this statement +# releases metadata locks in non-standard place. +Success: Was able to run 'prepare stmt1 from 'delete t1_base from t1_base, t2_base where t1_base.i = t2_base.j'' under FTWRL. +Success: Was able to run 'prepare stmt1 from 'delete t1_base from t1_base, t2_base where t1_base.i = t2_base.j'' with FTWRL active in another connection. +# +# 9.2) Compatibility of EXECUTE statement depends on statement +# to be executed. +# +# 9.2.a) EXECUTE for statement which is itself compatible with +# FTWRL should be compatible. +prepare stmt1 from 'select * from t1_base'; +Success: Was able to run 'execute stmt1' under FTWRL. +Success: Was able to run 'execute stmt1' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'execute stmt1' was active in another connection. +deallocate prepare stmt1; +# +# 9.2.b) EXECUTE for statement which is incompatible with FTWRL +# should be also incompatible. +# +# Check that EXECUTE is not allowed under FTWRL. +prepare stmt1 from 'insert into t1_base values (1)'; +flush tables with read lock; +execute stmt1; +ERROR HY000: Can't execute the query because you have a conflicting read lock +unlock tables; +# Check that active FTWRL in another connection +# blocks EXECUTE which changes data. +# +# Switching to connection 'con1'. +flush tables with read lock; +# Switching to connection 'default'. +execute stmt1 ; +# Switching to connection 'con1'. +# Check that EXECUTE is blocked. +unlock tables; +# Switching to connection 'default'. +# Reap EXECUTE. +set debug_sync='RESET'; +set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go'; +execute stmt1; ; +# Switching to connection 'con1'. +set debug_sync='now WAIT_FOR parked'; +flush tables with read lock; +# Switching to connection 'con2'. +# Wait until FTWRL is blocked. +set debug_sync='now SIGNAL go'; +# Switching to connection 'default'. +# Reap EXECUTE. +# Switching to connection 'con1'. +# Reap FTWRL. +unlock tables; +# Switching to connection 'default'. +set debug_sync= "RESET"; +delete from t1_base; +deallocate prepare stmt1; +# +# 9.3) DEALLOCATE PREPARE is compatible with FTWRL. +# +prepare stmt1 from 'insert into t1_base values (1)'; +Success: Was able to run 'deallocate prepare stmt1' under FTWRL. +Success: Was able to run 'deallocate prepare stmt1' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'deallocate prepare stmt1' was active in another connection. +deallocate prepare stmt1; +# +# 10) DELETE variations. +# +# 10.1) Simple DELETE. +# +# 10.1.a) Simple DELETE on base table is incompatible with FTWRL. +Success: Was not able to run 'delete from t1_base' under FTWRL. +Success: 'delete from t1_base' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'delete from t1_base' is active in another connection. +# +# 10.1.b) Simple DELETE on temporary table is compatible with FTWRL. +Success: Was able to run 'delete from t1_temp' under FTWRL. +Success: Was able to run 'delete from t1_temp' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'delete from t1_temp' was active in another connection. +# +# 10.2) Multi DELETE. +# +# 10.2.a) Multi DELETE on base tables is incompatible with FTWRL. +Success: Was not able to run 'delete t1_base from t1_base, t2_base where t1_base.i = t2_base.j' under FTWRL. +Success: 'delete t1_base from t1_base, t2_base where t1_base.i = t2_base.j' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'delete t1_base from t1_base, t2_base where t1_base.i = t2_base.j' is active in another connection. +# +# 10.2.b) Multi DELETE on temporary tables is compatible with FTWRL. +Success: Was able to run 'delete t1_temp from t1_temp, t2_temp where t1_temp.i = t2_temp.j' under FTWRL. +Success: Was able to run 'delete t1_temp from t1_temp, t2_temp where t1_temp.i = t2_temp.j' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'delete t1_temp from t1_temp, t2_temp where t1_temp.i = t2_temp.j' was active in another connection. +# +# 11) DESCRIBE should be compatible with FTWRL. +# +Success: Was able to run 'describe t1_base' under FTWRL. +Success: Was able to run 'describe t1_base' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'describe t1_base' was active in another connection. +# +# 12) Compatibility of DO statement with FTWRL depends on its +# expression. +# +# 12.a) DO with expression which does not change base table +# should be compatible with FTWRL. +Success: Was able to run 'do (select count(*) from t1_base)' under FTWRL. +Success: Was able to run 'do (select count(*) from t1_base)' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'do (select count(*) from t1_base)' was active in another connection. +# +# 12.b) DO which calls SF updating base table should be +# incompatible with FTWRL. +Success: Was not able to run 'do f2_base()' under FTWRL. +Success: 'do f2_base()' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'do f2_base()' is active in another connection. +# +# 12.c) DO which calls SF updating temporary table should be +# compatible with FTWRL. +Success: Was able to run 'do f2_temp()' under FTWRL. +Success: Was able to run 'do f2_temp()' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'do f2_temp()' was active in another connection. +# +# 13) DROP variants. +# +# 13.1) DROP TABLES. +# +# 13.1.a) DROP TABLES which affects base tables is incompatible +# with FTWRL. +Success: Was not able to run 'drop table t2_base' under FTWRL. +Success: 'drop table t2_base' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'drop table t2_base' is active in another connection. +# 13.1.b) DROP TABLES which affects only temporary tables +# in theory can be compatible with FTWRL. +# In practice it is not yet. +Success: Was not able to run 'drop table t2_temp' under FTWRL. +Success: 'drop table t2_temp' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'drop table t2_temp' is active in another connection. +# +# 13.1.c) DROP TEMPORARY TABLES should be compatible with FTWRL. +Success: Was able to run 'drop temporary table t2_temp' under FTWRL. +Success: Was able to run 'drop temporary table t2_temp' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'drop temporary table t2_temp' was active in another connection. +# +# 13.2) DROP INDEX. +# +# 13.2.a) DROP INDEX on a base table is incompatible with FTWRL. +create index i on t1_base (i); +Success: Was not able to run 'drop index i on t1_base' under FTWRL. +Success: 'drop index i on t1_base' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'drop index i on t1_base' is active in another connection. +drop index i on t1_base; +# +# 13.2.b) DROP INDEX on a temporary table is compatible with FTWRL. +create index i on t1_temp (i); +Success: Was able to run 'drop index i on t1_temp' under FTWRL. +Success: Was able to run 'drop index i on t1_temp' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'drop index i on t1_temp' was active in another connection. +drop index i on t1_temp; +# +# 13.3) DROP DATABASE is incompatible with FTWRL +# +Success: Was not able to run 'drop database mysqltest1' under FTWRL. +Success: 'drop database mysqltest1' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'drop database mysqltest1' is active in another connection. +# +# 13.4) DROP FUNCTION is incompatible with FTWRL. +# +Success: Was not able to run 'drop function f1' under FTWRL. +Success: 'drop function f1' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'drop function f1' is active in another connection. +# +# 13.5) DROP PROCEDURE is incompatible with FTWRL. +# +Success: Was not able to run 'drop procedure p1' under FTWRL. +Success: 'drop procedure p1' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'drop procedure p1' is active in another connection. +# +# 13.6) DROP USER should be incompatible with FTWRL. +# +create user mysqltest_u1; +Success: Was not able to run 'drop user mysqltest_u1' under FTWRL. +Success: 'drop user mysqltest_u1' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'drop user mysqltest_u1' is active in another connection. +drop user mysqltest_u1; +# +# 13.7) DROP VIEW should be incompatible with FTWRL. +# +Success: Was not able to run 'drop view v1' under FTWRL. +Success: 'drop view v1' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'drop view v1' is active in another connection. +# +# 13.8) DROP EVENT should be incompatible with FTWRL. +# +Success: Was not able to run 'drop event e1' under FTWRL. +Success: 'drop event e1' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'drop event e1' is active in another connection. +# +# 13.9) DROP TRIGGER is incompatible with FTWRL. +# +create trigger t1_bi before insert on t1_base for each row begin end; +Success: Was not able to run 'drop trigger t1_bi' under FTWRL. +Success: 'drop trigger t1_bi' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'drop trigger t1_bi' is active in another connection. +drop trigger t1_bi; +# +# 13.x) The rest of DROP variants (DROP TABLESPACE, DROP LOGFILE +# GROUP and DROP SERVER) are too special to test here. +# +# +# 14) FLUSH variants. +# +# Test compatibility of _some_ important FLUSH variants with FTWRL. +# +# 14.1) FLUSH TABLES WITH READ LOCK is compatible with itself. +# +# Check that FTWRL statements can be run while FTWRL +# is active in another connection. +# +# Switching to connection 'con1'. +flush tables with read lock; +# The second FTWRL in a row is allowed at the moment. +# It does not make much sense as it does only flush. +flush tables with read lock; +unlock tables; +# Switching to connection 'con1'. +flush tables with read lock; +# Switching to connection 'default'. +flush tables with read lock; +unlock tables; +# Switching to connection 'con1'. +unlock tables; +# Switching to connection 'default'. +# +# 14.2) FLUSH TABLES WITH READ LOCK is not blocked by +# active FTWRL. But since the latter keeps tables open +# FTWRL is blocked by FLUSH TABLES WITH READ LOCK. +flush tables with read lock; +# FT WRL is allowed under FTWRL at the moment. +# It does not make much sense though. +flush tables t1_base, t2_base with read lock; +unlock tables; +# Switching to connection 'con1'. +flush tables with read lock; +# Switching to connection 'default'. +flush tables t1_base, t2_base with read lock; +unlock tables; +# Switching to connection 'con1'. +unlock tables; +# Switching to connection 'default'. +flush tables t1_base, t2_base with read lock; +# Switching to connection 'con1'. +flush tables with read lock; +# Switching to connection 'con2'. +# Wait until FTWRL is blocked. +# Switching to connection 'default'. +unlock tables; +# Switching to connection 'con1'. +# Reap FTWRL. +unlock tables; +# Switching to connection 'default'. +# +# 14.3) FLUSH TABLES is compatible with FTWRL. +Success: Was able to run 'flush tables' under FTWRL. +Success: Was able to run 'flush tables' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'flush tables' was active in another connection. +# +# 14.4) FLUSH TABLES is compatible with FTWRL. +Success: Was able to run 'flush table t1_base, t2_base' under FTWRL. +Success: Was able to run 'flush table t1_base, t2_base' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'flush table t1_base, t2_base' was active in another connection. +# +# 14.5) FLUSH PRIVILEGES is compatible with FTWRL. +Success: Was able to run 'flush privileges' under FTWRL. +Success: Was able to run 'flush privileges' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'flush privileges' was active in another connection. +# +# 15) GRANT statement should be incompatible with FTWRL. +# +Success: Was not able to run 'grant all privileges on t1_base to mysqltest_u1' under FTWRL. +Success: 'grant all privileges on t1_base to mysqltest_u1' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'grant all privileges on t1_base to mysqltest_u1' is active in another connection. +drop user mysqltest_u1; +# +# 16) All HANDLER variants are half-compatible with FTWRL. +# I.e. they are not blocked by active FTWRL. But since open +# HANDLER means open table instance FTWRL is blocked while +# HANDLER is not closed. +# +# Check that HANDLER statements succeed under FTWRL. +flush tables with read lock; +handler t1_base open; +handler t1_base read first; +i +handler t1_base close; +unlock tables; +# Check that HANDLER statements can be run while FTWRL +# is active in another connection. +# +# Switching to connection 'con1'. +flush tables with read lock; +# Switching to connection 'default'. +handler t1_base open; +handler t1_base read first; +i +handler t1_base close; +# Switching to connection 'con1'. +unlock tables; +# Switching to connection 'default'. +# +# 17) HELP statement is compatible with FTWRL. +# +Success: Was able to run 'help no_such_topic' under FTWRL. +Success: Was able to run 'help no_such_topic' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'help no_such_topic' was active in another connection. +# +# 18) INSERT statement. +# +# 18.a) Ordinary INSERT into base table is incompatible with FTWRL. +Success: Was not able to run 'insert into t1_base values (1)' under FTWRL. +Success: 'insert into t1_base values (1)' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'insert into t1_base values (1)' is active in another connection. +# +# 18.b) Ordinary INSERT into temp table is compatible with FTWRL. +Success: Was able to run 'insert into t1_temp values (1)' under FTWRL. +Success: Was able to run 'insert into t1_temp values (1)' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'insert into t1_temp values (1)' was active in another connection. +# +# 18.c) INSERT DELAYED is incompatible with FTWRL. +Success: Was not able to run 'insert delayed into t1_base values (1)' under FTWRL. +Success: 'insert delayed into t1_base values (1)' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'insert delayed into t1_base values (1)' is active in another connection. +delete from t1_base; +# +# 18.d) INSERT SELECT into base table is incompatible with FTWRL. +Success: Was not able to run 'insert into t1_base select * from t1_temp' under FTWRL. +Success: 'insert into t1_base select * from t1_temp' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'insert into t1_base select * from t1_temp' is active in another connection. +# +# 18.e) INSERT SELECT into temp table is compatible with FTWRL. +Success: Was able to run 'insert into t1_temp select * from t1_base' under FTWRL. +Success: Was able to run 'insert into t1_temp select * from t1_base' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'insert into t1_temp select * from t1_base' was active in another connection. +# +# 19) KILL statement is compatible with FTWRL. +# +# Check that KILL can be run under FTWRL. +flush tables with read lock; +set @id:= connection_id(); +kill query @id; +ERROR 70100: Query execution was interrupted +unlock tables; +# Check that KILL statements can be run while FTWRL +# is active in another connection. +# +# Switching to connection 'con1'. +flush tables with read lock; +# Switching to connection 'default'. +kill query @id; +ERROR 70100: Query execution was interrupted +# Switching to connection 'con1'. +unlock tables; +# Switching to connection 'default'. +# Finally check that KILL doesn't block FTWRL +set debug_sync='RESET'; +set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go'; +kill query @id; +# Switching to connection 'con1'. +set debug_sync='now WAIT_FOR parked'; +flush tables with read lock; +unlock tables; +set debug_sync='now SIGNAL go'; +# Switching to connection 'default'. +# Reap KILL. +ERROR 70100: Query execution was interrupted +set debug_sync='RESET'; +# +# 20) LOAD DATA statement. +# +# 20.a) LOAD DATA into base table is incompatible with FTWRL. +Success: Was not able to run 'load data infile '../../std_data/rpl_loaddata.dat' into table t1_base (@dummy, i)' under FTWRL. +Success: 'load data infile '../../std_data/rpl_loaddata.dat' into table t1_base (@dummy, i)' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'load data infile '../../std_data/rpl_loaddata.dat' into table t1_base (@dummy, i)' is active in another connection. +# +# 20.b) LOAD DATA into temporary table is compatible with FTWRL. +Success: Was able to run 'load data infile '../../std_data/rpl_loaddata.dat' into table t1_temp (@dummy, i)' under FTWRL. +Success: Was able to run 'load data infile '../../std_data/rpl_loaddata.dat' into table t1_temp (@dummy, i)' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'load data infile '../../std_data/rpl_loaddata.dat' into table t1_temp (@dummy, i)' was active in another connection. +# +# 21) LOCK/UNLOCK TABLES statements. +# +# LOCK TABLES statement always (almost) blocks FTWRL as it +# keeps tables open until UNLOCK TABLES. +# Active FTWRL on the other hand blocks only those +# LOCK TABLES which allow updating of base tables. +# +# 21.a) LOCK TABLES READ is allowed under FTWRL and +# is not blocked by active FTWRL. +flush tables with read lock; +lock tables t1_base read; +unlock tables; +# +# Switching to connection 'con1'. +flush tables with read lock; +# Switching to connection 'default'. +lock tables t1_base read; +unlock tables; +# Switching to connection 'con1'. +unlock tables; +# Switching to connection 'default'. +# +# 21.b) LOCK TABLES WRITE on a base table is disallowed +# under FTWRL and should be blocked by active FTWRL. +flush tables with read lock; +lock tables t1_base write; +ERROR HY000: Can't execute the query because you have a conflicting read lock +unlock tables; +# +# Switching to connection 'con1'. +flush tables with read lock; +# Switching to connection 'default'. +lock tables t1_base write ; +# Switching to connection 'con1'. +# Check that LOCK TABLES WRITE is blocked. +unlock tables; +# Switching to connection 'default'. +# Reap LOCK TABLES WRITE +unlock tables; +# +# 21.c) LOCK TABLES WRITE on temporary table doesn't +# make much sense but is allowed under FTWRL +# and should not be blocked by active FTWRL. +flush tables with read lock; +lock tables t1_temp write; +unlock tables; +# +# Switching to connection 'con1'. +flush tables with read lock; +# Switching to connection 'default'. +lock tables t1_temp write; +unlock tables; +# Switching to connection 'con1'. +unlock tables; +# Switching to connection 'default'. +# +# 22) OPTIMIZE TABLE statement. +# +# 22.a) OPTIMIZE TABLE of base table is incompatible with FTWRL. +flush tables with read lock; +# OPTIMIZE statement returns errors as part of result-set. +optimize table t1_base; +Table Op Msg_type Msg_text +test.t1_base optimize Error Can't execute the query because you have a conflicting read lock +test.t1_base optimize error Corrupt +unlock tables; +# +# Switching to connection 'con1'. +flush tables with read lock; +# Switching to connection 'default'. +optimize table t1_base; +# Switching to connection 'con1'. +# Check that OPTIMIZE TABLE is blocked. +unlock tables; +# Switching to connection 'default'. +# Reap OPTIMIZE TABLE +Table Op Msg_type Msg_text +test.t1_base optimize status OK +# We don't check that active OPTIMIZE TABLE blocks +# FTWRL as this one of statements releasing metadata +# locks in non-standard place. +# +# 22.b) OPTIMIZE TABLE of temporary table is compatible with FTWRL. +# Skip last part of compatibility testing as this statement +# releases metadata locks in non-standard place. +Success: Was able to run 'optimize table t1_temp' under FTWRL. +Success: Was able to run 'optimize table t1_temp' with FTWRL active in another connection. +# +# 23) CACHE statement is compatible with FTWRL. +# +# Skip last part of compatibility testing as this statement +# releases metadata locks in non-standard place. +Success: Was able to run 'cache index t1_base in default' under FTWRL. +Success: Was able to run 'cache index t1_base in default' with FTWRL active in another connection. +# +# 24) LOAD INDEX statement is compatible with FTWRL. +# +# Skip last part of compatibility testing as this statement +# releases metadata locks in non-standard place. +Success: Was able to run 'load index into cache t1_base' under FTWRL. +Success: Was able to run 'load index into cache t1_base' with FTWRL active in another connection. +# +# 25) SAVEPOINT/RELEASE SAVEPOINT/ROLLBACK TO SAVEPOINT are +# compatible with FTWRL. +# +# Since manipulations on savepoint have to be done +# inside transaction and FTWRL commits transaction we +# need a special test for these statements. +flush tables with read lock; +begin; +savepoint sv1; +rollback to savepoint sv1; +release savepoint sv1; +unlock tables; +commit; +# Check that these statements are not blocked by +# active FTWRL in another connection. +# +# Switching to connection 'con1'. +flush tables with read lock; +# Switching to connection 'default'. +begin; +# Switching to connection 'con1'. +unlock tables; +# Switching to connection 'default'. +# Do some changes to avoid SAVEPOINT and friends +# being almost no-ops. +insert into t3_trans values (1); +# Switching to connection 'con1'. +flush tables with read lock; +# Switching to connection 'default'. +savepoint sv1; +# Switching to connection 'con1'. +unlock tables; +# Switching to connection 'default'. +insert into t3_trans values (2); +# Switching to connection 'con1'. +flush tables with read lock; +# Switching to connection 'default'. +rollback to savepoint sv1; +release savepoint sv1; +# Switching to connection 'con1'. +unlock tables; +# Switching to connection 'default'. +rollback; +# Check that these statements don't block FTWRL in +# another connection. +begin; +# Do some changes to avoid SAVEPOINT and friends +# being almost no-ops. +insert into t3_trans values (1); +set debug_sync='RESET'; +set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go'; +savepoint sv1; +# Switching to connection 'con1'. +set debug_sync='now WAIT_FOR parked'; +flush tables with read lock; +unlock tables; +set debug_sync='now SIGNAL go'; +# Switching to connection 'default'. +# Reap SAVEPOINT +insert into t3_trans values (2); +set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go'; +rollback to savepoint sv1; +# Switching to connection 'con1'. +set debug_sync='now WAIT_FOR parked'; +flush tables with read lock; +unlock tables; +set debug_sync='now SIGNAL go'; +# Switching to connection 'default'. +# Reap ROLLBACK TO SAVEPOINT +set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go'; +release savepoint sv1; +# Switching to connection 'con1'. +set debug_sync='now WAIT_FOR parked'; +flush tables with read lock; +unlock tables; +set debug_sync='now SIGNAL go'; +# Switching to connection 'default'. +# Reap RELEASE SAVEPOINT +rollback; +set debug_sync= "RESET"; +# +# 26) RENAME variants. +# +# 26.1) RENAME TABLES is incompatible with FTWRL. +Success: Was not able to run 'rename table t1_base to t3_base' under FTWRL. +Success: 'rename table t1_base to t3_base' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'rename table t1_base to t3_base' is active in another connection. +# +# 26.2) RENAME USER is incompatible with FTWRL. +create user mysqltest_u1; +Success: Was not able to run 'rename user mysqltest_u1 to mysqltest_u2' under FTWRL. +Success: 'rename user mysqltest_u1 to mysqltest_u2' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'rename user mysqltest_u1 to mysqltest_u2' is active in another connection. +drop user mysqltest_u1; +# +# 27) REPAIR TABLE statement. +# +# 27.a) REPAIR TABLE of base table is incompatible with FTWRL. +flush tables with read lock; +# REPAIR statement returns errors as part of result-set. +repair table t1_base; +Table Op Msg_type Msg_text +test.t1_base repair Error Can't execute the query because you have a conflicting read lock +test.t1_base repair error Corrupt +unlock tables; +# +# Switching to connection 'con1'. +flush tables with read lock; +# Switching to connection 'default'. +repair table t1_base; +# Switching to connection 'con1'. +# Check that REPAIR TABLE is blocked. +unlock tables; +# Switching to connection 'default'. +# Reap REPAIR TABLE +Table Op Msg_type Msg_text +test.t1_base repair status OK +# We don't check that active REPAIR TABLE blocks +# FTWRL as this one of statements releasing metadata +# locks in non-standard place. +# +# 27.b) REPAIR TABLE of temporary table is compatible with FTWRL. +# Skip last part of compatibility testing as this statement +# releases metadata locks in non-standard place. +Success: Was able to run 'repair table t1_temp' under FTWRL. +Success: Was able to run 'repair table t1_temp' with FTWRL active in another connection. +# +# 28) REPLACE statement. +# +# 28.a) Ordinary REPLACE into base table is incompatible with FTWRL. +Success: Was not able to run 'replace into t1_base values (1)' under FTWRL. +Success: 'replace into t1_base values (1)' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'replace into t1_base values (1)' is active in another connection. +# +# 28.b) Ordinary REPLACE into temp table is compatible with FTWRL. +Success: Was able to run 'replace into t1_temp values (1)' under FTWRL. +Success: Was able to run 'replace into t1_temp values (1)' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'replace into t1_temp values (1)' was active in another connection. +# +# 28.c) REPLACE SELECT into base table is incompatible with FTWRL. +Success: Was not able to run 'replace into t1_base select * from t1_temp' under FTWRL. +Success: 'replace into t1_base select * from t1_temp' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'replace into t1_base select * from t1_temp' is active in another connection. +# +# 28.d) REPLACE SELECT into temp table is compatible with FTWRL. +Success: Was able to run 'replace into t1_temp select * from t1_base' under FTWRL. +Success: Was able to run 'replace into t1_temp select * from t1_base' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'replace into t1_temp select * from t1_base' was active in another connection. +# +# 29) REVOKE variants. +# +# 29.1) REVOKE privileges is incompatible with FTWRL. +grant all privileges on t1_base to mysqltest_u1; +Success: Was not able to run 'revoke all privileges on t1_base from mysqltest_u1' under FTWRL. +Success: 'revoke all privileges on t1_base from mysqltest_u1' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'revoke all privileges on t1_base from mysqltest_u1' is active in another connection. +# +# 29.2) REVOKE ALL PRIVILEGES, GRANT OPTION is incompatible with FTWRL. +Success: Was not able to run 'revoke all privileges, grant option from mysqltest_u1' under FTWRL. +Success: 'revoke all privileges, grant option from mysqltest_u1' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'revoke all privileges, grant option from mysqltest_u1' is active in another connection. +drop user mysqltest_u1; +# +# 30) Compatibility of SELECT statement with FTWRL depends on +# locking mode used and on functions being invoked by it. +# +# 30.a) Simple SELECT which does not change tables should be +# compatible with FTWRL. +Success: Was able to run 'select count(*) from t1_base' under FTWRL. +Success: Was able to run 'select count(*) from t1_base' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'select count(*) from t1_base' was active in another connection. +# 30.b) SELECT ... FOR UPDATE is incompatible with FTWRL. +Success: Was not able to run 'select count(*) from t1_base for update' under FTWRL. +Success: 'select count(*) from t1_base for update' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'select count(*) from t1_base for update' is active in another connection. +# 30.c) SELECT ... LOCK IN SHARE MODE is compatible with FTWRL. +Success: Was able to run 'select count(*) from t1_base lock in share mode' under FTWRL. +Success: Was able to run 'select count(*) from t1_base lock in share mode' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'select count(*) from t1_base lock in share mode' was active in another connection. +# +# 30.d) SELECT which calls SF updating base table should be +# incompatible with FTWRL. +Success: Was not able to run 'select f2_base()' under FTWRL. +Success: 'select f2_base()' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'select f2_base()' is active in another connection. +# +# 30.e) SELECT which calls SF updating temporary table should be +# compatible with FTWRL. +Success: Was able to run 'select f2_temp()' under FTWRL. +Success: Was able to run 'select f2_temp()' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'select f2_temp()' was active in another connection. +# +# 31) Compatibility of SET statement with FTWRL depends on its +# expression and on whether it is a special SET statement. +# +# 31.a) Ordinary SET with expression which does not +# changes base table should be compatible with FTWRL. +# Skip last part of compatibility testing as our helper debug +# sync-point doesn't work for SET statements. +Success: Was able to run 'set @a:= (select count(*) from t1_base)' under FTWRL. +Success: Was able to run 'set @a:= (select count(*) from t1_base)' with FTWRL active in another connection. +# +# 31.b) Ordinary SET which calls SF updating base table should +# be incompatible with FTWRL. +# Skip last part of compatibility testing as our helper debug +# sync-point doesn't work for SET statements. +Success: Was not able to run 'set @a:= f2_base()' under FTWRL. +Success: 'set @a:= f2_base()' is blocked by FTWRL active in another connection. +# +# 31.c) Ordinary SET which calls SF updating temporary table +# should be compatible with FTWRL. +# Skip last part of compatibility testing as our helper debug +# sync-point doesn't work for SET statements. +Success: Was able to run 'set @a:= f2_temp()' under FTWRL. +Success: Was able to run 'set @a:= f2_temp()' with FTWRL active in another connection. +# +# 31.d) Special SET variants have different compatibility with FTWRL. +# +# 31.d.I) SET PASSWORD is incompatible with FTWRL as it changes data. +create user mysqltest_u1; +# Skip last part of compatibility testing as our helper debug +# sync-point doesn't work for SET statements. +Success: Was not able to run 'set password for 'mysqltest_u1' = password('')' under FTWRL. +Success: 'set password for 'mysqltest_u1' = password('')' is blocked by FTWRL active in another connection. +drop user mysqltest_u1; +# +# 31.d.II) SET READ_ONLY is compatible with FTWRL (but has no +# effect when executed under it). +# Skip last part of compatibility testing as our helper debug +# sync-point doesn't work for SET statements. +Success: Was able to run 'set global read_only= 1' under FTWRL. +Success: Was able to run 'set global read_only= 1' with FTWRL active in another connection. +# +# 31.d.III) Situation with SET AUTOCOMMIT is complex. +# Turning auto-commit off is always compatible with FTWRL. +# Turning auto-commit on causes implicit commit and so +# is incompatible with FTWRL if there are changes to be +# committed. +flush tables with read lock; +set autocommit= 0; +# Turning auto-commit on causes implicit commit so can +# be incompatible with FTWRL if there is something to +# commit. But since even in this case we allow commits +# under active FTWRL such statement should always succeed. +insert into t3_temp_trans values (1); +set autocommit= 1; +unlock tables; +delete from t3_temp_trans; +# Check that SET AUTOCOMMIT=0 is not blocked and +# SET AUTOCOMMIT=1 is blocked by active FTWRL in +# another connection. +# +# Switching to connection 'con1'. +flush tables with read lock; +# Switching to connection 'default'. +set autocommit= 0; +# Switching to connection 'con1'. +unlock tables; +# Switching to connection 'default'. +# Do some work so implicit commit in SET AUTOCOMMIT=1 +# is not a no-op. +insert into t3_trans values (1); +# Switching to connection 'con1'. +flush tables with read lock; +# Switching to connection 'default'. +# Send: +set autocommit= 1; +# Switching to connection 'con1'. +# Wait until SET AUTOCOMMIT=1 is blocked. +unlock tables; +# Switching to connection 'default'. +# Reap SET AUTOCOMMIT=1. +delete from t3_trans; +# +# Check that SET AUTOCOMMIT=1 blocks FTWRL in another connection. +set autocommit= 0; +insert into t3_trans values (1); +set debug_sync='RESET'; +set debug_sync='ha_commit_trans_after_acquire_commit_lock SIGNAL parked WAIT_FOR go'; +set autocommit= 1; +# Switching to connection 'con1'. +set debug_sync='now WAIT_FOR parked'; +flush tables with read lock; +# Switching to connection 'con2'. +# Wait until FTWRL is blocked. +set debug_sync='now SIGNAL go'; +# Switching to connection 'default'. +# Reap SET AUTOCOMMIT=1. +# Switching to connection 'con1'. +# Reap FTWRL. +unlock tables; +# Switching to connection 'default'. +delete from t3_trans; +set debug_sync= "RESET"; +# +# 32) SHOW statements are compatible with FTWRL. +# Let us test _some_ of them. +# +# 32.1) SHOW TABLES. +Success: Was able to run 'show tables from test' under FTWRL. +Success: Was able to run 'show tables from test' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'show tables from test' was active in another connection. +# +# 32.1) SHOW TABLES. +Success: Was able to run 'show tables from test' under FTWRL. +Success: Was able to run 'show tables from test' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'show tables from test' was active in another connection. +# +# 32.2) SHOW EVENTS. +Success: Was able to run 'show events from test' under FTWRL. +Success: Was able to run 'show events from test' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'show events from test' was active in another connection. +# +# 32.3) SHOW GRANTS. +create user mysqltest_u1; +Success: Was able to run 'show grants for mysqltest_u1' under FTWRL. +Success: Was able to run 'show grants for mysqltest_u1' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'show grants for mysqltest_u1' was active in another connection. +drop user mysqltest_u1; +# +# 32.4) SHOW CREATE TABLE. +Success: Was able to run 'show create table t1_base' under FTWRL. +Success: Was able to run 'show create table t1_base' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'show create table t1_base' was active in another connection. +# +# 32.5) SHOW CREATE FUNCTION. +Success: Was able to run 'show create function f1' under FTWRL. +Success: Was able to run 'show create function f1' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'show create function f1' was active in another connection. +# +# 33) SIGNAL statement is compatible with FTWRL. +# +# Note that we don't cover RESIGNAL as it requires +# active handler context. +Success: Was able to run 'signal sqlstate '01000'' under FTWRL. +Success: Was able to run 'signal sqlstate '01000'' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'signal sqlstate '01000'' was active in another connection. +# +# 34) TRUNCATE TABLE statement. +# +# 34.a) TRUNCATE of base table is incompatible with FTWRL. +Success: Was not able to run 'truncate table t1_base' under FTWRL. +Success: 'truncate table t1_base' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'truncate table t1_base' is active in another connection. +# +# 34.b) TRUNCATE of temporary table is compatible with FTWRL. +Success: Was able to run 'truncate table t1_temp' under FTWRL. +Success: Was able to run 'truncate table t1_temp' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'truncate table t1_temp' was active in another connection. +# +# 35) UPDATE variants. +# +# 35.1) Simple UPDATE. +# +# 35.1.a) Simple UPDATE on base table is incompatible with FTWRL. +Success: Was not able to run 'update t1_base set i= 1 where i = 0' under FTWRL. +Success: 'update t1_base set i= 1 where i = 0' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'update t1_base set i= 1 where i = 0' is active in another connection. +# +# 35.1.b) Simple UPDATE on temporary table is compatible with FTWRL. +Success: Was able to run 'update t1_temp set i= 1 where i = 0' under FTWRL. +Success: Was able to run 'update t1_temp set i= 1 where i = 0' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'update t1_temp set i= 1 where i = 0' was active in another connection. +# +# 35.2) Multi UPDATE. +# +# 35.2.a) Multi UPDATE on base tables is incompatible with FTWRL. +Success: Was not able to run 'update t1_base, t2_base set t1_base.i= 1 where t1_base.i = t2_base.j' under FTWRL. +Success: 'update t1_base, t2_base set t1_base.i= 1 where t1_base.i = t2_base.j' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'update t1_base, t2_base set t1_base.i= 1 where t1_base.i = t2_base.j' is active in another connection. +# +# 35.2.b) Multi UPDATE on temporary tables is compatible with FTWRL. +Success: Was able to run 'update t1_temp, t2_temp set t1_temp.i= 1 where t1_temp.i = t2_temp.j' under FTWRL. +Success: Was able to run 'update t1_temp, t2_temp set t1_temp.i= 1 where t1_temp.i = t2_temp.j' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'update t1_temp, t2_temp set t1_temp.i= 1 where t1_temp.i = t2_temp.j' was active in another connection. +# +# 36) USE statement is compatible with FTWRL. +# +Success: Was able to run 'use mysqltest1' under FTWRL. +Success: Was able to run 'use mysqltest1' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'use mysqltest1' was active in another connection. +# +# 37) XA statements. +# +# XA statements are similar to BEGIN/COMMIT/ROLLBACK. +# +# XA BEGIN, END, PREPARE, ROLLBACK and RECOVER are compatible +# with FTWRL. XA COMMIT is not. +flush tables with read lock; +# Although all below statements are allowed under FTWRL they +# are almost no-ops as FTWRL does commit and does not allows +# any non-temporary DML under it. +xa start 'test1'; +xa end 'test1'; +xa prepare 'test1'; +xa rollback 'test1'; +xa start 'test1'; +xa end 'test1'; +xa prepare 'test1'; +xa commit 'test1'; +xa recover; +unlock tables; +# Check that XA non-COMMIT statements are not and COMMIT is +# blocked by active FTWRL in another connection +# +# Switching to connection 'con1'. +flush tables with read lock; +# Switching to connection 'default'. +xa start 'test1'; +# Switching to connection 'con1'. +unlock tables; +# Switching to connection 'default'. +insert into t3_trans values (1); +# Switching to connection 'con1'. +flush tables with read lock; +# Switching to connection 'default'. +xa end 'test1'; +xa prepare 'test1'; +xa rollback 'test1'; +# Switching to connection 'con1'. +unlock tables; +# Switching to connection 'default'. +xa start 'test1'; +insert into t3_trans values (1); +# Switching to connection 'con1'. +flush tables with read lock; +# Switching to connection 'default'. +xa end 'test1'; +xa prepare 'test1'; +# Send: +xa commit 'test1';; +# Switching to connection 'con1'. +# Wait until XA COMMIT is blocked. +unlock tables; +# Switching to connection 'default'. +# Reap XA COMMIT. +delete from t3_trans; +# +# Check that XA COMMIT blocks FTWRL in another connection. +xa start 'test1'; +insert into t3_trans values (1); +xa end 'test1'; +xa prepare 'test1'; +set debug_sync='RESET'; +set debug_sync='trans_xa_commit_after_acquire_commit_lock SIGNAL parked WAIT_FOR go'; +xa commit 'test1'; +# Switching to connection 'con1'. +set debug_sync='now WAIT_FOR parked'; +flush tables with read lock; +# Switching to connection 'con2'. +# Wait until FTWRL is blocked. +set debug_sync='now SIGNAL go'; +# Switching to connection 'default'. +# Reap XA COMMIT. +# Switching to connection 'con1'. +# Reap FTWRL. +unlock tables; +# Switching to connection 'default'. +delete from t3_trans; +set debug_sync= "RESET"; +# +# 38) Test effect of auto-commit mode for DML on transactional +# temporary tables. +# +# 38.1) When auto-commit is on each such a statement ends with commit +# of changes to temporary tables. But since transactions doing +# such changes are considered read only [sic!/QQ] this commit +# is compatible with FTWRL. +# +# Let us demostrate this fact for some common DML statements. +Success: Was able to run 'delete from t3_temp_trans' under FTWRL. +Success: Was able to run 'delete from t3_temp_trans' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'delete from t3_temp_trans' was active in another connection. +Success: Was able to run 'insert into t3_temp_trans values (1)' under FTWRL. +Success: Was able to run 'insert into t3_temp_trans values (1)' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'insert into t3_temp_trans values (1)' was active in another connection. +Success: Was able to run 'update t3_temp_trans, t2_temp set t3_temp_trans.i= 1 where t3_temp_trans.i = t2_temp.j' under FTWRL. +Success: Was able to run 'update t3_temp_trans, t2_temp set t3_temp_trans.i= 1 where t3_temp_trans.i = t2_temp.j' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'update t3_temp_trans, t2_temp set t3_temp_trans.i= 1 where t3_temp_trans.i = t2_temp.j' was active in another connection. +# +# 38.2) When auto-commit is off DML on transaction temporary tables +# is compatible with FTWRL. +# +set autocommit= 0; +Success: Was able to run 'delete from t3_temp_trans' under FTWRL. +Success: Was able to run 'delete from t3_temp_trans' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'delete from t3_temp_trans' was active in another connection. +Success: Was able to run 'insert into t3_temp_trans values (1)' under FTWRL. +Success: Was able to run 'insert into t3_temp_trans values (1)' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'insert into t3_temp_trans values (1)' was active in another connection. +Success: Was able to run 'update t3_temp_trans, t2_temp set t3_temp_trans.i= 1 where t3_temp_trans.i = t2_temp.j' under FTWRL. +Success: Was able to run 'update t3_temp_trans, t2_temp set t3_temp_trans.i= 1 where t3_temp_trans.i = t2_temp.j' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'update t3_temp_trans, t2_temp set t3_temp_trans.i= 1 where t3_temp_trans.i = t2_temp.j' was active in another connection. +set autocommit= 1; +# +# 39) Test effect of DDL on transactional tables. +# +# 39.1) Due to implicit commit at the end of statement some of DDL +# statements which are compatible with FTWRL in non-transactional +# case are not compatible in case of transactional tables. +# +# 39.1.a) ANALYZE TABLE for transactional table is incompatible with +# FTWRL. +flush tables with read lock; +# Implicit commits are allowed under FTWRL. +analyze table t3_trans; +Table Op Msg_type Msg_text +test.t3_trans analyze status OK +unlock tables; +# +# Switching to connection 'con1'. +flush tables with read lock; +# Switching to connection 'default'. +analyze table t3_trans; +# Switching to connection 'con1'. +# Check that ANALYZE TABLE is blocked. +unlock tables; +# Switching to connection 'default'. +# Reap ANALYZE TABLE +Table Op Msg_type Msg_text +test.t3_trans analyze status OK +# +# 39.1.b) CHECK TABLE for transactional table is compatible with FTWRL. +# Although it does implicit commit at the end of statement it +# is considered to be read-only operation. +# Skip last part of compatibility testing as this statement +# releases metadata locks in non-standard place. +Success: Was able to run 'check table t3_trans' under FTWRL. +Success: Was able to run 'check table t3_trans' with FTWRL active in another connection. +# +# 39.2) Situation with DDL on temporary transactional tables is +# complex. +# +# 39.2.a) Some statements compatible with FTWRL since they don't +# do implicit commit. +# +# For example, CREATE TEMPORARY TABLE: +Success: Was able to run 'create temporary table t4_temp_trans(i int) engine=innodb' under FTWRL. +Success: Was able to run 'create temporary table t4_temp_trans(i int) engine=innodb' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'create temporary table t4_temp_trans(i int) engine=innodb' was active in another connection. +# +# Or DROP TEMPORARY TABLE: +Success: Was able to run 'drop temporary tables t3_temp_trans' under FTWRL. +Success: Was able to run 'drop temporary tables t3_temp_trans' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'drop temporary tables t3_temp_trans' was active in another connection. +# +# 39.2.b) Some statements do implicit commit but are considered +# read-only and so are compatible with FTWRL. +# +# For example, REPAIR TABLE: +Success: Was able to run 'repair table t3_temp_trans' under FTWRL. +Success: Was able to run 'repair table t3_temp_trans' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'repair table t3_temp_trans' was active in another connection. +# +# And ANALYZE TABLE: +Success: Was able to run 'analyze table t3_temp_trans' under FTWRL. +Success: Was able to run 'analyze table t3_temp_trans' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'analyze table t3_temp_trans' was active in another connection. +# +# 39.2.c) Some statements do implicit commit and not +# considered read-only. As result they are +# not compatible with FTWRL. +# +flush tables with read lock; +# Implicit commits are allowed under FTWRL. +alter table t3_temp_trans add column c1 int; +unlock tables; +# +# Switching to connection 'con1'. +flush tables with read lock; +# Switching to connection 'default'. +alter table t3_temp_trans drop column c1; +# Switching to connection 'con1'. +# Check that ALTER TABLE is blocked. +unlock tables; +# Switching to connection 'default'. +# Reap ALTER TABLE +# +# 40) Test effect of implicit commit for DDL which is otherwise +# compatible with FTWRL. Implicit commit at the start of DDL +# statement can make it incompatible with FTWRL if there are +# some changes to be commited even in case when DDL statement +# itself is compatible with FTWRL. +# +# For example CHECK TABLE for base non-transactional tables and +# ALTER TABLE for temporary non-transactional tables are affected. +begin; +insert into t3_trans values (1); +# +# Switching to connection 'con1'. +flush tables with read lock; +# Switching to connection 'default'. +check table t1_base; +# Switching to connection 'con1'. +# Check that CHECK TABLE is blocked. +unlock tables; +# Switching to connection 'default'. +# Reap CHECK TABLE +Table Op Msg_type Msg_text +test.t1_base check status OK +begin; +delete from t3_trans; +# +# Switching to connection 'con1'. +flush tables with read lock; +# Switching to connection 'default'. +alter table t1_temp add column c1 int; +# Switching to connection 'con1'. +# Check that ALTER TABLE is blocked. +unlock tables; +# Switching to connection 'default'. +# Reap ALTER TABLE +alter table t1_temp drop column c1; +# +# Check that FLUSH TABLES WITH READ LOCK is blocked by individual +# statements and is not blocked in the presence of transaction which +# has done some changes earlier but is idle now (or does only reads). +# This allows to use this statement even on systems which has long +# running transactions. +# +begin; +insert into t1_base values (1); +insert into t3_trans values (1); +# Switching to connection 'con1'. +# The below FTWRL should not be blocked by transaction in 'default'. +flush tables with read lock; +# Switching to connection 'default'. +# Transaction still is able to read even with FTWRL active in another +# connection. +select * from t1_base; +i +1 +select * from t2_base; +j +select * from t3_trans; +i +1 +# Switching to connection 'con1'. +unlock tables; +# Switching to connection 'default'. +commit; +delete from t1_base; +delete from t3_trans; +# +# Check that impending FTWRL blocks new DML statements and +# so can't be starved by a constant flow of DML. +# (a.k.a. test for bug #54673 "It takes too long to get +# readlock for 'FLUSH TABLES WITH READ LOCK'"). +# +set debug_sync='RESET'; +set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go'; +insert into t1_base values (1); +# Switching to connection 'con1'. +set debug_sync='now WAIT_FOR parked'; +flush tables with read lock; +# Switching to connection 'con2'. +# Wait until FTWRL is blocked. +# Try to run another INSERT and see that it is blocked. +insert into t2_base values (1);; +# Switching to connection 'con3'. +# Wait until new INSERT is blocked. +# Unblock INSERT in the first connection. +set debug_sync='now SIGNAL go'; +# Switching to connection 'default'. +# Reap first INSERT. +# Switching to connection 'con1'. +# Reap FTWRL. +unlock tables; +# Switching to connection 'con2'. +# Reap second INSERT. +# Switching to connection 'default'. +set debug_sync= "RESET"; +delete from t1_base; +delete from t2_base; + +# Check that COMMIT thas is issued after +# FLUSH TABLES WITH READ LOCK is not blocked by +# FLUSH TABLES WITH READ LOCK from another connection. +# This scenario is used in innobackup.pl. The COMMIT goes +# through because the transaction started by FTWRL does +# not modify any tables, and the commit blocker lock is +# only taken when there were such modifications. + +flush tables with read lock; +# Switching to connection 'con1'. +# The below FTWRL should not be blocked by transaction in 'default'. +flush tables with read lock; +# Switching to connection 'default'. +select * from t1_base; +i +select * from t3_trans; +i +commit; +# Switching to connection 'con1'. +select * from t1_base; +i +select * from t3_trans; +i +commit; +unlock tables; +# Switching to connection 'default'. +unlock tables; +# +# Check how FLUSH TABLE WITH READ LOCK is handled for MERGE tables. +# As usual there are tricky cases related to this type of tables. +# +# +# 1) Most typical case - base MERGE table with base underlying tables. +# +# 1.a) DML statements which change data should be incompatible with FTWRL. +create table tm_base (i int) engine=merge union=(t1_base) insert_method=last; +Success: Was not able to run 'insert into tm_base values (1)' under FTWRL. +Success: 'insert into tm_base values (1)' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'insert into tm_base values (1)' is active in another connection. +# +# 1.b) DDL statement on such table should be incompatible with FTWRL as well. +Success: Was not able to run 'alter table tm_base insert_method=first' under FTWRL. +Success: 'alter table tm_base insert_method=first' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'alter table tm_base insert_method=first' is active in another connection. +drop table tm_base; +# +# 2) Temporary MERGE table with base underlying tables. +# +# 2.a) DML statements which change data should be incompatible with FTWRL +# as they affect base tables. +create temporary table tm_temp_base (i int) engine=merge union=(t1_base) insert_method=last; +Success: Was not able to run 'insert into tm_temp_base values (1)' under FTWRL. +Success: 'insert into tm_temp_base values (1)' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'insert into tm_temp_base values (1)' is active in another connection. +# +# 2.b) Some of DDL statements on such table can be compatible with FTWRL +# as they don't affect base tables. +Success: Was able to run 'drop temporary tables tm_temp_base' under FTWRL. +Success: Was able to run 'drop temporary tables tm_temp_base' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'drop temporary tables tm_temp_base' was active in another connection. +# +# 2.c) ALTER statement is incompatible with FTWRL. Even though it does +# not change data in base table it still acquires strong metadata +# locks on them. +Success: Was not able to run 'alter table tm_temp_base insert_method=first' under FTWRL. +Success: 'alter table tm_temp_base insert_method=first' is blocked by FTWRL active in another connection. +Success: FTWRL is blocked when 'alter table tm_temp_base insert_method=first' is active in another connection. +drop table tm_temp_base; +# +# 3) Temporary MERGE table with temporary underlying tables. +# +# 3.a) DML statements should be compatible with FTWRL as +# no base table is going to be affected. +create temporary table tm_temp_temp (i int) engine=merge union=(t1_temp) insert_method=last; +Success: Was able to run 'insert into tm_temp_temp values (1)' under FTWRL. +Success: Was able to run 'insert into tm_temp_temp values (1)' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'insert into tm_temp_temp values (1)' was active in another connection. +# +# 3.b) DDL statements should be compatible with FTWRL as well +# as no base table is going to be affected too. +Success: Was able to run 'alter table tm_temp_temp union=(t1_temp) insert_method=first' under FTWRL. +Success: Was able to run 'alter table tm_temp_temp union=(t1_temp) insert_method=first' with FTWRL active in another connection. +Success: Was able to run FTWRL while 'alter table tm_temp_temp union=(t1_temp) insert_method=first' was active in another connection. +drop table tm_temp_temp; +# +# 4) For the sake of completeness let us check that base MERGE tables +# with temporary underlying tables are not functional. +create table tm_base_temp (i int) engine=merge union=(t1_temp) insert_method=last; +select * from tm_base_temp; +ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist +drop table tm_base_temp; +# +# Clean-up. +# +drop event e1; +drop function f2_temp; +drop function f2_base; +drop procedure p2; +drop view v1; +drop function f1; +drop procedure p1; +drop database `#mysql50#mysqltest-2`; +drop database mysqltest1; +drop temporary tables t1_temp, t2_temp; +drop tables t1_base, t2_base, t3_trans; diff --git a/mysql-test/r/flush_read_lock_kill.result b/mysql-test/r/flush_read_lock_kill.result index b16a8b114b3..8453d26cbea 100644 --- a/mysql-test/r/flush_read_lock_kill.result +++ b/mysql-test/r/flush_read_lock_kill.result @@ -1,12 +1,38 @@ -SET @old_concurrent_insert= @@global.concurrent_insert; -SET @@global.concurrent_insert= 0; DROP TABLE IF EXISTS t1; -CREATE TABLE t1 (kill_id INT); +SET DEBUG_SYNC= 'RESET'; +CREATE TABLE t1 (kill_id INT) engine = InnoDB; INSERT INTO t1 VALUES(connection_id()); +# Switching to connection 'default'. +# Start transaction. +BEGIN; +INSERT INTO t1 VALUES(connection_id()); +# Ensure that COMMIT will pause once it acquires protection +# against its global read lock. +SET DEBUG_SYNC='ha_commit_trans_after_acquire_commit_lock SIGNAL acquired WAIT_FOR go'; +# Sending: +COMMIT; +# Switching to 'con1'. +# Wait till COMMIT acquires protection against global read +# lock and pauses. +SET DEBUG_SYNC='now WAIT_FOR acquired'; +# Sending: FLUSH TABLES WITH READ LOCK; -SELECT ((@id := kill_id) - kill_id) FROM t1; +# Switching to 'con2'. +SELECT ((@id := kill_id) - kill_id) FROM t1 LIMIT 1; ((@id := kill_id) - kill_id) 0 +# Wait till FLUSH TABLES WITH READ LOCK blocks due +# to active COMMIT +# Kill connection 'con1'. KILL CONNECTION @id; +# Switching to 'con1'. +# Try to reap FLUSH TABLES WITH READ LOCK, +# it fail due to killed statement and connection. +Got one of the listed errors +# Switching to 'con2'. +# Resume COMMIT. +SET DEBUG_SYNC='now SIGNAL go'; +# Switching to 'default'. +# Reaping COMMIT. DROP TABLE t1; -SET @@global.concurrent_insert= @old_concurrent_insert; +SET DEBUG_SYNC= 'RESET'; diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index a75f502c735..7788a32ac90 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -652,4 +652,40 @@ Table Op Msg_type Msg_text test.t1 repair status OK SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size; DROP TABLE t1; +# +# Bug#54484 explain + prepared statement: crash and Got error -1 from storage engine +# +CREATE TABLE t1(f1 VARCHAR(6) NOT NULL, FULLTEXT KEY(f1), UNIQUE(f1)); +INSERT INTO t1 VALUES ('test'); +SELECT 1 FROM t1 WHERE 1 > +ALL((SELECT 1 FROM t1 JOIN t1 a +ON (MATCH(t1.f1) against ("")) +WHERE t1.f1 GROUP BY t1.f1)) xor f1; +1 +1 +PREPARE stmt FROM +'SELECT 1 FROM t1 WHERE 1 > + ALL((SELECT 1 FROM t1 RIGHT OUTER JOIN t1 a + ON (MATCH(t1.f1) against ("")) + WHERE t1.f1 GROUP BY t1.f1)) xor f1'; +EXECUTE stmt; +1 +1 +EXECUTE stmt; +1 +1 +DEALLOCATE PREPARE stmt; +PREPARE stmt FROM +'SELECT 1 FROM t1 WHERE 1 > + ALL((SELECT 1 FROM t1 JOIN t1 a + ON (MATCH(t1.f1) against ("")) + WHERE t1.f1 GROUP BY t1.f1))'; +EXECUTE stmt; +1 +1 +EXECUTE stmt; +1 +1 +DEALLOCATE PREPARE stmt; +DROP TABLE t1; End of 5.1 tests diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index 302de9de9f7..69be0107b8f 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -1038,6 +1038,14 @@ GROUP_CONCAT(t1.a ORDER BY t1.a) 1,1,2,2 DEALLOCATE PREPARE stmt; DROP TABLE t1; +# +# Bug#57194 group_concat cause crash and/or invalid memory reads with type errors +# +CREATE TABLE t1(f1 int); +INSERT INTO t1 values (0),(0); +SELECT POLYGON((SELECT 1 FROM (SELECT 1 IN (GROUP_CONCAT(t1.f1)) FROM t1, t1 t GROUP BY t.f1 ) d)); +ERROR 22007: Illegal non geometric '(select 1 from (select (1 = group_concat(`test`.`t1`.`f1` separator ',')) AS `1 IN (GROUP_CONCAT(t1.f1))` from `test`.`t1` join `test`.`t1` `t` group by `t`.`f1`) `d`)' value found during parsing +DROP TABLE t1; End of 5.1 tests DROP TABLE IF EXISTS t1, t2; CREATE TABLE t1 (a VARCHAR(6), b INT); diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index bfb3af0afff..ac9a22a0b82 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -481,6 +481,18 @@ RAND(i) 0.15522042769493574 DROP TABLE t1; # +# Bug#57477 SIGFPE when dividing a huge number a negative number +# +SELECT -9999999999999999991 DIV -1; +ERROR 22003: BIGINT value is out of range in '(-(9999999999999999991) DIV -(1))' +SELECT -9223372036854775808 DIV -1; +ERROR 22003: BIGINT value is out of range in '(-(9223372036854775808) DIV -(1))' +SELECT -9223372036854775808 MOD -1; +-9223372036854775808 MOD -1 +0 +SELECT -9223372036854775808999 MOD -1; +-9223372036854775808999 MOD -1 +0 select 123456789012345678901234567890.123456789012345678901234567890 div 1 as x; ERROR 22003: BIGINT value is out of range in '(123456789012345678901234567890.123456789012345678901234567890 DIV 1)' select "123456789012345678901234567890.123456789012345678901234567890" div 1 as x; @@ -607,3 +619,12 @@ SELECT floor(log10(format(concat_ws(5445796E25, 5306463, 30837), -358821))) as foo; foo 2 +# +# Bug #58137 char(0) column cause: +# my_gcvt: Assertion `width > 0 && to != ((void *)0)' failed +# +CREATE TABLE t1(a char(0)); +INSERT INTO t1 (SELECT -pi()); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +DROP TABLE t1; diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result index 85448a258e4..068ab343c89 100644 --- a/mysql-test/r/func_misc.result +++ b/mysql-test/r/func_misc.result @@ -375,4 +375,25 @@ GREATEST(a, (SELECT b FROM t1 LIMIT 1)) 3 1 DROP TABLE t1; -End of 5.1 tests +SELECT INET_NTOA(0); +INET_NTOA(0) +0.0.0.0 +SELECT '1' IN ('1', INET_NTOA(0)); +'1' IN ('1', INET_NTOA(0)) +1 +# +# End of 5.1 tests +# +# +# Bug #58199: name_const in the having clause crashes +# +CREATE TABLE t1 (a INT); +SELECT 1 from t1 HAVING NAME_CONST('', a); +ERROR HY000: Incorrect arguments to NAME_CONST +DROP TABLE t1; +# +# End of 5.5 tests +# +# +# End of tests +# diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index f1b2196ebfa..34987530b5a 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -1315,6 +1315,20 @@ SELECT 1 FROM t1 ORDER BY @x:=makedate(a,a); 1 1 DROP TABLE t1; +# +# Bug #52160: crash and inconsistent results when grouping +# by a function and column +# +CREATE TABLE t1(a CHAR(10) NOT NULL); +INSERT INTO t1 VALUES (''),(''); +SELECT COUNT(*) FROM t1 GROUP BY TIME_TO_SEC(a); +COUNT(*) +2 +Warnings: +Warning 1292 Truncated incorrect time value: '' +Warning 1292 Truncated incorrect time value: '' +Warning 1292 Truncated incorrect time value: '' +DROP TABLE t1; End of 5.1 tests # # Bug#57039: constant subtime expression returns incorrect result. @@ -1327,3 +1341,12 @@ SELECT * FROM t1 WHERE date_date <= addtime(date_add("2000-1-1", INTERVAL "1:1:1 date_date DROP TABLE t1; # +# Bug#57512 str_to_date crash... +# +SELECT WEEK(STR_TO_DATE(NULL,0)); +WEEK(STR_TO_DATE(NULL,0)) +NULL +SELECT SUBDATE(STR_TO_DATE(NULL,0), INTERVAL 1 HOUR); +SUBDATE(STR_TO_DATE(NULL,0), INTERVAL 1 HOUR) +NULL +# diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 84cac386b57..60053b29125 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -1448,8 +1448,6 @@ CREATE USER 'userbug33464'@'localhost'; GRANT CREATE ROUTINE ON dbbug33464.* TO 'userbug33464'@'localhost'; userbug33464@localhost dbbug33464 -DROP PROCEDURE IF EXISTS sp3; -DROP FUNCTION IF EXISTS fn1; CREATE PROCEDURE sp3(v1 char(20)) BEGIN SELECT * from dbbug33464.t6 where t6.f2= 'xyz'; @@ -1577,6 +1575,17 @@ DROP USER 'testbug'@localhost; DROP TABLE db2.t1; DROP DATABASE db1; DROP DATABASE db2; +# +# Bug #36742 +# +grant usage on Foo.* to myuser@Localhost identified by 'foo'; +grant select on Foo.* to myuser@localhost; +select host,user from mysql.user where User='myuser'; +host user +localhost myuser +revoke select on Foo.* from myuser@localhost; +delete from mysql.user where User='myuser'; +flush privileges; ######################################################################### # # Bug#38347: ALTER ROUTINE privilege allows SHOW CREATE TABLE. diff --git a/mysql-test/r/grant3.result b/mysql-test/r/grant3.result index 59c64ee84ae..fd51a83d4b2 100644 --- a/mysql-test/r/grant3.result +++ b/mysql-test/r/grant3.result @@ -21,123 +21,108 @@ grant select on test.* to CUser@LOCALHOST; flush privileges; SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; user host -CUser LOCALHOST CUser localhost SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser' order by 1,2; user host db select_priv -CUser LOCALHOST test Y CUser localhost test Y REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'LOCALHOST'; flush privileges; SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; user host -CUser LOCALHOST CUser localhost SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser' order by 1,2; user host db select_priv -CUser localhost test Y REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'localhost'; flush privileges; SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; user host -CUser LOCALHOST CUser localhost SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser' order by 1,2; user host db select_priv DROP USER CUser@localhost; DROP USER CUser@LOCALHOST; +ERROR HY000: Operation DROP USER failed for 'CUser'@'localhost' create table t1 (a int); grant select on test.t1 to CUser@localhost; grant select on test.t1 to CUser@LOCALHOST; flush privileges; SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; user host -CUser LOCALHOST CUser localhost SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2; user host db Table_name Table_priv Column_priv -CUser LOCALHOST test t1 Select CUser localhost test t1 Select REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'LOCALHOST'; flush privileges; SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; user host -CUser LOCALHOST CUser localhost SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2; user host db Table_name Table_priv Column_priv -CUser localhost test t1 Select REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'localhost'; flush privileges; SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; user host -CUser LOCALHOST CUser localhost SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2; user host db Table_name Table_priv Column_priv DROP USER CUser@localhost; DROP USER CUser@LOCALHOST; +ERROR HY000: Operation DROP USER failed for 'CUser'@'localhost' grant select(a) on test.t1 to CUser@localhost; grant select(a) on test.t1 to CUser@LOCALHOST; flush privileges; SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; user host -CUser LOCALHOST CUser localhost SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2; user host db Table_name Table_priv Column_priv -CUser LOCALHOST test t1 Select CUser localhost test t1 Select REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'LOCALHOST'; flush privileges; SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; user host -CUser LOCALHOST CUser localhost SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2; user host db Table_name Table_priv Column_priv -CUser localhost test t1 Select REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'localhost'; flush privileges; SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2; user host -CUser LOCALHOST CUser localhost SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2; user host db Table_name Table_priv Column_priv DROP USER CUser@localhost; DROP USER CUser@LOCALHOST; +ERROR HY000: Operation DROP USER failed for 'CUser'@'localhost' drop table t1; grant select on test.* to CUser2@localhost; grant select on test.* to CUser2@LOCALHOST; flush privileges; SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2; user host -CUser2 LOCALHOST CUser2 localhost SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2; user host db select_priv -CUser2 LOCALHOST test Y CUser2 localhost test Y REVOKE SELECT ON test.* FROM 'CUser2'@'LOCALHOST'; flush privileges; SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2; user host -CUser2 LOCALHOST CUser2 localhost SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2; user host db select_priv -CUser2 localhost test Y REVOKE SELECT ON test.* FROM 'CUser2'@'localhost'; +ERROR 42000: There is no such grant defined for user 'CUser2' on host 'localhost' flush privileges; SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2; user host -CUser2 LOCALHOST CUser2 localhost SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2; user host db select_priv DROP USER CUser2@localhost; DROP USER CUser2@LOCALHOST; +ERROR HY000: Operation DROP USER failed for 'CUser2'@'localhost' CREATE DATABASE mysqltest_1; CREATE TABLE mysqltest_1.t1 (a INT); CREATE USER 'mysqltest1'@'%'; diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 2621f69da06..188485d366f 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -1846,6 +1846,16 @@ SELECT SUBSTRING(a,1,10), LENGTH(a) FROM t1 GROUP BY a; SUBSTRING(a,1,10) LENGTH(a) 1111111111 1300 DROP TABLE t1; +# +# Bug#57688 Assertion `!table || (!table->write_set || bitmap_is_set(table->write_set, field +# +CREATE TABLE t1(f1 INT NOT NULL); +INSERT INTO t1 VALUES (16777214),(0); +SELECT COUNT(*) FROM t1 LEFT JOIN t1 t2 +ON 1 WHERE t2.f1 > 1 GROUP BY t2.f1; +COUNT(*) +2 +DROP TABLE t1; # End of 5.1 tests # # Bug#49771: Incorrect MIN (date) when minimum value is 0000-00-00 diff --git a/mysql-test/r/handler_innodb.result b/mysql-test/r/handler_innodb.result index 66914285733..dd4cac669c8 100644 --- a/mysql-test/r/handler_innodb.result +++ b/mysql-test/r/handler_innodb.result @@ -1485,10 +1485,6 @@ ERROR 42S02: Table 'test.not_exists_write' doesn't exist # We still have the read lock. drop table t1; ERROR HY000: Can't execute the query because you have a conflicting read lock -handler t1 read next; -a b -1 1 -handler t1 close; handler t1 open; select a from t2; a diff --git a/mysql-test/r/handler_myisam.result b/mysql-test/r/handler_myisam.result index d5d43ca0717..69d791b8263 100644 --- a/mysql-test/r/handler_myisam.result +++ b/mysql-test/r/handler_myisam.result @@ -1481,10 +1481,6 @@ ERROR 42S02: Table 'test.not_exists_write' doesn't exist # We still have the read lock. drop table t1; ERROR HY000: Can't execute the query because you have a conflicting read lock -handler t1 read next; -a b -1 1 -handler t1 close; handler t1 open; select a from t2; a diff --git a/mysql-test/r/information_schema-big.result b/mysql-test/r/information_schema-big.result index 248b8d606dc..92408c439a5 100644 --- a/mysql-test/r/information_schema-big.result +++ b/mysql-test/r/information_schema-big.result @@ -30,6 +30,7 @@ FILES TABLE_SCHEMA GLOBAL_STATUS VARIABLE_NAME GLOBAL_VARIABLES VARIABLE_NAME KEY_COLUMN_USAGE CONSTRAINT_SCHEMA +PARAMETERS SPECIFIC_SCHEMA PARTITIONS TABLE_SCHEMA PLUGINS PLUGIN_NAME PROCESSLIST ID @@ -42,6 +43,7 @@ SESSION_STATUS VARIABLE_NAME SESSION_VARIABLES VARIABLE_NAME STATISTICS TABLE_SCHEMA TABLES TABLE_SCHEMA +TABLESPACES TABLESPACE_NAME TABLE_CONSTRAINTS CONSTRAINT_SCHEMA TABLE_PRIVILEGES TABLE_SCHEMA TRIGGERS TRIGGER_SCHEMA @@ -74,6 +76,7 @@ FILES TABLE_SCHEMA GLOBAL_STATUS VARIABLE_NAME GLOBAL_VARIABLES VARIABLE_NAME KEY_COLUMN_USAGE CONSTRAINT_SCHEMA +PARAMETERS SPECIFIC_SCHEMA PARTITIONS TABLE_SCHEMA PLUGINS PLUGIN_NAME PROCESSLIST ID @@ -86,6 +89,7 @@ SESSION_STATUS VARIABLE_NAME SESSION_VARIABLES VARIABLE_NAME STATISTICS TABLE_SCHEMA TABLES TABLE_SCHEMA +TABLESPACES TABLESPACE_NAME TABLE_CONSTRAINTS CONSTRAINT_SCHEMA TABLE_PRIVILEGES TABLE_SCHEMA TRIGGERS TRIGGER_SCHEMA diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index aa47b8c437e..1418af5b813 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -88,7 +88,7 @@ host plugin proc procs_priv -proxy_priv +proxies_priv servers slow_log tables_priv @@ -1807,3 +1807,47 @@ USING (TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME) WHERE COLUMNS.TABLE_SCHEMA = 'test' AND COLUMNS.TABLE_NAME = 't1'; TABLE_SCHEMA TABLE_NAME COLUMN_NAME CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME TABLE_CATALOG ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT +# +# A test case for Bug#56540 "Exception (crash) in sql_show.cc +# during rqg_info_schema test on Windows" +# Ensure that we never access memory of a closed table, +# in particular, never access table->field[] array. +# Before the fix, the below test case, produced +# valgrind errors. +# +drop table if exists t1; +drop view if exists v1; +create table t1 (a int, b int); +create view v1 as select t1.a, t1.b from t1; +alter table t1 change b c int; +lock table t1 read; +# --> connection con1 +flush tables; +# --> connection default +select * from information_schema.views; +TABLE_CATALOG def +TABLE_SCHEMA test +TABLE_NAME v1 +VIEW_DEFINITION select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` +CHECK_OPTION NONE +IS_UPDATABLE +DEFINER root@localhost +SECURITY_TYPE DEFINER +CHARACTER_SET_CLIENT latin1 +COLLATION_CONNECTION latin1_swedish_ci +Warnings: +Level Warning +Code 1356 +Message View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them +unlock tables; +# +# Cleanup. +# +# --> connection con1 +# Reaping 'flush tables' +# --> connection default +drop table t1; +drop view v1; +# +# End of 5.5 tests +# diff --git a/mysql-test/r/ipv4_as_ipv6.result b/mysql-test/r/ipv4_as_ipv6.result index 8523dc82f02..82bca393d71 100644 --- a/mysql-test/r/ipv4_as_ipv6.result +++ b/mysql-test/r/ipv4_as_ipv6.result @@ -32,9 +32,9 @@ mysqld is alive CREATE USER testuser@'0:0:0:0:0:FFFF:127.0.0.1' identified by '1234'; GRANT ALL ON test.* TO testuser@'0:0:0:0:0:FFFF:127.0.0.1'; SHOW GRANTS FOR testuser@'0:0:0:0:0:FFFF:127.0.0.1'; -Grants for testuser@0:0:0:0:0:FFFF:127.0.0.1 -GRANT USAGE ON *.* TO 'testuser'@'0:0:0:0:0:FFFF:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF' -GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0:0:0:0:0:FFFF:127.0.0.1' +Grants for testuser@0:0:0:0:0:ffff:127.0.0.1 +GRANT USAGE ON *.* TO 'testuser'@'0:0:0:0:0:ffff:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF' +GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0:0:0:0:0:ffff:127.0.0.1' SET @nip= inet_aton('0:0:0:0:0:FFFF:127.0.0.1'); SELECT @nip; @nip @@ -61,9 +61,9 @@ mysqld is alive CREATE USER testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1' identified by '1234'; GRANT ALL ON test.* TO testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1'; SHOW GRANTS FOR testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1'; -Grants for testuser@0000:0000:0000:0000:0000:FFFF:127.0.0.1 -GRANT USAGE ON *.* TO 'testuser'@'0000:0000:0000:0000:0000:FFFF:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF' -GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0000:0000:0000:0000:0000:FFFF:127.0.0.1' +Grants for testuser@0000:0000:0000:0000:0000:ffff:127.0.0.1 +GRANT USAGE ON *.* TO 'testuser'@'0000:0000:0000:0000:0000:ffff:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF' +GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0000:0000:0000:0000:0000:ffff:127.0.0.1' SET @nip= inet_aton('0000:0000:0000:0000:0000:FFFF:127.0.0.1'); SELECT @nip; @nip @@ -90,9 +90,9 @@ mysqld is alive CREATE USER testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1' identified by '1234'; GRANT ALL ON test.* TO testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1'; SHOW GRANTS FOR testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1'; -Grants for testuser@0:0000:0000:0:0000:FFFF:127.0.0.1 -GRANT USAGE ON *.* TO 'testuser'@'0:0000:0000:0:0000:FFFF:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF' -GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0:0000:0000:0:0000:FFFF:127.0.0.1' +Grants for testuser@0:0000:0000:0:0000:ffff:127.0.0.1 +GRANT USAGE ON *.* TO 'testuser'@'0:0000:0000:0:0000:ffff:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF' +GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0:0000:0000:0:0000:ffff:127.0.0.1' SET @nip= inet_aton('0:0000:0000:0:0000:FFFF:127.0.0.1'); SELECT @nip; @nip @@ -119,9 +119,9 @@ mysqld is alive CREATE USER testuser@'0::0000:FFFF:127.0.0.1' identified by '1234'; GRANT ALL ON test.* TO testuser@'0::0000:FFFF:127.0.0.1'; SHOW GRANTS FOR testuser@'0::0000:FFFF:127.0.0.1'; -Grants for testuser@0::0000:FFFF:127.0.0.1 -GRANT USAGE ON *.* TO 'testuser'@'0::0000:FFFF:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF' -GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0::0000:FFFF:127.0.0.1' +Grants for testuser@0::0000:ffff:127.0.0.1 +GRANT USAGE ON *.* TO 'testuser'@'0::0000:ffff:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF' +GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0::0000:ffff:127.0.0.1' SET @nip= inet_aton('0::0000:FFFF:127.0.0.1'); SELECT @nip; @nip @@ -149,9 +149,9 @@ mysqld is alive CREATE USER testuser@'::FFFF:127.0.0.1' identified by '1234'; GRANT ALL ON test.* TO testuser@'::FFFF:127.0.0.1'; SHOW GRANTS FOR testuser@'::FFFF:127.0.0.1'; -Grants for testuser@::FFFF:127.0.0.1 -GRANT USAGE ON *.* TO 'testuser'@'::FFFF:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF' -GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'::FFFF:127.0.0.1' +Grants for testuser@::ffff:127.0.0.1 +GRANT USAGE ON *.* TO 'testuser'@'::ffff:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF' +GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'::ffff:127.0.0.1' SET @nip= inet_aton('::FFFF:127.0.0.1'); SELECT @nip; @nip diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result index 0af32d8f749..99ca9f05535 100644 --- a/mysql-test/r/join_outer.result +++ b/mysql-test/r/join_outer.result @@ -1402,4 +1402,34 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1003 select straight_join `test`.`jt1`.`f1` AS `f1` from `test`.`t1` `jt6` left join (`test`.`t1` `jt3` join `test`.`t1` `jt4` left join `test`.`t1` `jt5` on(1) left join `test`.`t1` `jt2` on(1)) on((`test`.`jt6`.`f1` and 1)) left join `test`.`t1` `jt1` on(1) where 1 DROP TABLE t1; +# +# Bug#57688 Assertion `!table || (!table->write_set || bitmap_is_set(table->write_set, field +# +CREATE TABLE t1 (f1 INT NOT NULL, PRIMARY KEY (f1)); +CREATE TABLE t2 (f1 INT NOT NULL, f2 INT NOT NULL, PRIMARY KEY (f1, f2)); +INSERT INTO t1 VALUES (4); +INSERT INTO t2 VALUES (3, 3); +INSERT INTO t2 VALUES (7, 7); +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t2.f1 = t1.f1 +WHERE t1.f1 = 4 +GROUP BY t2.f1, t2.f2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 system PRIMARY NULL NULL NULL 1 Using temporary; Using filesort +1 SIMPLE t2 ref PRIMARY PRIMARY 4 const 1 Using index +SELECT * FROM t1 LEFT JOIN t2 ON t2.f1 = t1.f1 +WHERE t1.f1 = 4 +GROUP BY t2.f1, t2.f2; +f1 f1 f2 +4 NULL NULL +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t2.f1 = t1.f1 +WHERE t1.f1 = 4 AND t2.f1 IS NOT NULL AND t2.f2 IS NOT NULL +GROUP BY t2.f1, t2.f2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 system PRIMARY NULL NULL NULL 1 Using filesort +1 SIMPLE t2 ref PRIMARY PRIMARY 4 const 1 Using where; Using index +SELECT * FROM t1 LEFT JOIN t2 ON t2.f1 = t1.f1 +WHERE t1.f1 = 4 AND t2.f1 IS NOT NULL AND t2.f2 IS NOT NULL +GROUP BY t2.f1, t2.f2; +f1 f1 f2 +DROP TABLE t1,t2; End of 5.1 tests diff --git a/mysql-test/r/keywords.result b/mysql-test/r/keywords.result index 5f338ad6a62..58cb7430563 100644 --- a/mysql-test/r/keywords.result +++ b/mysql-test/r/keywords.result @@ -45,3 +45,227 @@ p1 max=1 drop procedure p1; drop table t1; +CREATE TABLE slow (slow INT, general INT, master_heartbeat_period INT, ignore_server_ids INT); +INSERT INTO slow(slow, general, master_heartbeat_period, ignore_server_ids) VALUES (1,2,3,4), (5,6,7,8); +INSERT INTO slow(slow, general, master_heartbeat_period) VALUES (1,2,3), (5,6,7); +INSERT INTO slow(slow, general) VALUES (1,2), (5,6); +INSERT INTO slow(slow) VALUES (1), (5); +SELECT slow, general, master_heartbeat_period, ignore_server_ids FROM slow ORDER BY slow; +slow general master_heartbeat_period ignore_server_ids +1 2 3 4 +1 2 3 NULL +1 2 NULL NULL +1 NULL NULL NULL +5 6 7 8 +5 6 7 NULL +5 6 NULL NULL +5 NULL NULL NULL +SELECT slow, general, master_heartbeat_period FROM slow ORDER BY slow; +slow general master_heartbeat_period +1 2 3 +1 2 3 +1 2 NULL +1 NULL NULL +5 6 7 +5 6 7 +5 6 NULL +5 NULL NULL +SELECT slow, master_heartbeat_period FROM slow ORDER BY slow; +slow master_heartbeat_period +1 3 +1 3 +1 NULL +1 NULL +5 7 +5 7 +5 NULL +5 NULL +SELECT slow FROM slow ORDER BY slow; +slow +1 +1 +1 +1 +5 +5 +5 +5 +DROP TABLE slow; +CREATE TABLE general (slow INT, general INT, master_heartbeat_period INT, ignore_server_ids INT); +INSERT INTO general(slow, general, master_heartbeat_period, ignore_server_ids) VALUES (1,2,3,4), (5,6,7,8); +INSERT INTO general(slow, general, master_heartbeat_period) VALUES (1,2,3), (5,6,7); +INSERT INTO general(slow, general) VALUES (1,2), (5,6); +INSERT INTO general(slow) VALUES (1), (5); +SELECT slow, general, master_heartbeat_period, ignore_server_ids FROM general ORDER BY slow; +slow general master_heartbeat_period ignore_server_ids +1 2 3 4 +1 2 3 NULL +1 2 NULL NULL +1 NULL NULL NULL +5 6 7 8 +5 6 7 NULL +5 6 NULL NULL +5 NULL NULL NULL +SELECT slow, general, master_heartbeat_period FROM general ORDER BY slow; +slow general master_heartbeat_period +1 2 3 +1 2 3 +1 2 NULL +1 NULL NULL +5 6 7 +5 6 7 +5 6 NULL +5 NULL NULL +SELECT slow, master_heartbeat_period FROM general ORDER BY slow; +slow master_heartbeat_period +1 3 +1 3 +1 NULL +1 NULL +5 7 +5 7 +5 NULL +5 NULL +SELECT slow FROM general ORDER BY slow; +slow +1 +1 +1 +1 +5 +5 +5 +5 +DROP TABLE general; +CREATE TABLE master_heartbeat_period (slow INT, general INT, master_heartbeat_period INT, ignore_server_ids INT); +INSERT INTO master_heartbeat_period(slow, general, master_heartbeat_period, ignore_server_ids) VALUES (1,2,3,4), (5,6,7,8); +INSERT INTO master_heartbeat_period(slow, general, master_heartbeat_period) VALUES (1,2,3), (5,6,7); +INSERT INTO master_heartbeat_period(slow, general) VALUES (1,2), (5,6); +INSERT INTO master_heartbeat_period(slow) VALUES (1), (5); +SELECT slow, general, master_heartbeat_period, ignore_server_ids FROM master_heartbeat_period ORDER BY slow; +slow general master_heartbeat_period ignore_server_ids +1 2 3 4 +1 2 3 NULL +1 2 NULL NULL +1 NULL NULL NULL +5 6 7 8 +5 6 7 NULL +5 6 NULL NULL +5 NULL NULL NULL +SELECT slow, general, master_heartbeat_period FROM master_heartbeat_period ORDER BY slow; +slow general master_heartbeat_period +1 2 3 +1 2 3 +1 2 NULL +1 NULL NULL +5 6 7 +5 6 7 +5 6 NULL +5 NULL NULL +SELECT slow, master_heartbeat_period FROM master_heartbeat_period ORDER BY slow; +slow master_heartbeat_period +1 3 +1 3 +1 NULL +1 NULL +5 7 +5 7 +5 NULL +5 NULL +SELECT slow FROM master_heartbeat_period ORDER BY slow; +slow +1 +1 +1 +1 +5 +5 +5 +5 +DROP TABLE master_heartbeat_period; +CREATE TABLE ignore_server_ids (slow INT, general INT, master_heartbeat_period INT, ignore_server_ids INT); +INSERT INTO ignore_server_ids(slow, general, master_heartbeat_period, ignore_server_ids) VALUES (1,2,3,4), (5,6,7,8); +INSERT INTO ignore_server_ids(slow, general, master_heartbeat_period) VALUES (1,2,3), (5,6,7); +INSERT INTO ignore_server_ids(slow, general) VALUES (1,2), (5,6); +INSERT INTO ignore_server_ids(slow) VALUES (1), (5); +SELECT slow, general, master_heartbeat_period, ignore_server_ids FROM ignore_server_ids ORDER BY slow; +slow general master_heartbeat_period ignore_server_ids +1 2 3 4 +1 2 3 NULL +1 2 NULL NULL +1 NULL NULL NULL +5 6 7 8 +5 6 7 NULL +5 6 NULL NULL +5 NULL NULL NULL +SELECT slow, general, master_heartbeat_period FROM ignore_server_ids ORDER BY slow; +slow general master_heartbeat_period +1 2 3 +1 2 3 +1 2 NULL +1 NULL NULL +5 6 7 +5 6 7 +5 6 NULL +5 NULL NULL +SELECT slow, master_heartbeat_period FROM ignore_server_ids ORDER BY slow; +slow master_heartbeat_period +1 3 +1 3 +1 NULL +1 NULL +5 7 +5 7 +5 NULL +5 NULL +SELECT slow FROM ignore_server_ids ORDER BY slow; +slow +1 +1 +1 +1 +5 +5 +5 +5 +DROP TABLE ignore_server_ids; +CREATE TABLE t1 (slow INT, general INT, ignore_server_ids INT, master_heartbeat_period INT); +INSERT INTO t1 VALUES (1,2,3,4); +CREATE PROCEDURE p1() +BEGIN +DECLARE slow INT; +DECLARE general INT; +DECLARE ignore_server_ids INT; +DECLARE master_heartbeat_period INT; +SELECT max(t1.slow) INTO slow FROM t1; +SELECT max(t1.general) INTO general FROM t1; +SELECT max(t1.ignore_server_ids) INTO ignore_server_ids FROM t1; +SELECT max(t1.master_heartbeat_period) INTO master_heartbeat_period FROM t1; +SELECT slow, general, ignore_server_ids, master_heartbeat_period; +END| +CREATE PROCEDURE p2() +BEGIN +DECLARE n INT DEFAULT 2; +general: WHILE n > 0 DO +SET n = n -1; +END WHILE general; +SET n = 2; +slow: WHILE n > 0 DO +SET n = n -1; +END WHILE slow; +SET n = 2; +ignore_server_ids: WHILE n > 0 DO +SET n = n -1; +END WHILE ignore_server_ids; +SET n = 2; +master_heartbeat_period: WHILE n > 0 DO +SET n = n -1; +END WHILE master_heartbeat_period; +END| +CALL p1(); +slow general ignore_server_ids master_heartbeat_period +1 2 3 4 +call p2(); +DROP PROCEDURE p1; +DROP PROCEDURE p2; +DROP TABLE t1; diff --git a/mysql-test/r/kill.result b/mysql-test/r/kill.result index 1f4f4bb32eb..964f2947f6a 100644 --- a/mysql-test/r/kill.result +++ b/mysql-test/r/kill.result @@ -1,143 +1,178 @@ -set @old_concurrent_insert= @@global.concurrent_insert; -set @@global.concurrent_insert= 0; -drop table if exists t1, t2, t3; -create table t1 (kill_id int); -insert into t1 values(connection_id()); -select ((@id := kill_id) - kill_id) from t1; -((@id := kill_id) - kill_id) -0 -kill @id; -select ((@id := kill_id) - kill_id) from t1; -((@id := kill_id) - kill_id) -0 -select @id != connection_id(); -@id != connection_id() -1 -select 4; -4 -4 -drop table t1; -kill (select count(*) from mysql.user); -ERROR 42000: This version of MySQL doesn't yet support 'Usage of subqueries or stored function calls as part of this statement' -create table t1 (id int primary key); -create table t2 (id int unsigned not null); -insert into t2 select id from t1; -create table t3 (kill_id int); -insert into t3 values(connection_id()); -select id from t1 where id in (select distinct a.id from t2 a, t2 b, t2 c, t2 d group by a.id, b.id, c.id, d.id having a.id between 10 and 20); -select ((@id := kill_id) - kill_id) from t3; -((@id := kill_id) - kill_id) -0 -kill @id; +SET DEBUG_SYNC = 'RESET'; +DROP TABLE IF EXISTS t1, t2, t3; +DROP FUNCTION IF EXISTS MY_KILL; +CREATE FUNCTION MY_KILL(tid INT) RETURNS INT +BEGIN +DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; +KILL tid; +RETURN (SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE ID = tid); +END| +SET DEBUG_SYNC= 'thread_end SIGNAL con1_end'; +SET DEBUG_SYNC= 'before_do_command_net_read SIGNAL con1_read'; +SET DEBUG_SYNC='now WAIT_FOR con1_read'; +SET DEBUG_SYNC= 'now WAIT_FOR con1_end'; +SET DEBUG_SYNC = 'RESET'; +SELECT 1; Got one of the listed errors -drop table t1, t2, t3; -select get_lock("a", 10); -get_lock("a", 10) -1 -select get_lock("a", 10); -get_lock("a", 10) -NULL -select 1; +SELECT 1; 1 1 -select RELEASE_LOCK("a"); -RELEASE_LOCK("a") +SELECT @id != CONNECTION_ID(); +@id != CONNECTION_ID() 1 -create table t1(f1 int); -create function bug27563() returns int(11) -deterministic -begin -declare continue handler for sqlstate '70100' set @a:= 'killed'; -declare continue handler for sqlexception set @a:= 'exception'; -set @a= get_lock("lock27563", 10); -return 1; -end| -select get_lock("lock27563",10); -get_lock("lock27563",10) +SELECT 4; +4 +4 +KILL (SELECT COUNT(*) FROM mysql.user); +ERROR 42000: This version of MySQL doesn't yet support 'Usage of subqueries or stored function calls as part of this statement' +SET DEBUG_SYNC= 'thread_end SIGNAL con1_end'; +SET DEBUG_SYNC= 'before_do_command_net_read SIGNAL con1_read WAIT_FOR kill'; +SET DEBUG_SYNC= 'now WAIT_FOR con1_read'; +SET DEBUG_SYNC= 'now WAIT_FOR con1_end'; +SET DEBUG_SYNC = 'RESET'; +SELECT 1; +Got one of the listed errors +SELECT 1; 1 -insert into t1 values (bug27563()); +1 +SELECT @id != CONNECTION_ID(); +@id != CONNECTION_ID() +1 +SELECT 4; +4 +4 +CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT); +CREATE TABLE t2 (id INT UNSIGNED NOT NULL); +INSERT INTO t1 VALUES +(0),(0),(0),(0),(0),(0),(0),(0), (0),(0),(0),(0),(0),(0),(0),(0), +(0),(0),(0),(0),(0),(0),(0),(0), (0),(0),(0),(0),(0),(0),(0),(0), +(0),(0),(0),(0),(0),(0),(0),(0), (0),(0),(0),(0),(0),(0),(0),(0), +(0),(0),(0),(0),(0),(0),(0),(0), (0),(0),(0),(0),(0),(0),(0),(0); +INSERT t1 SELECT 0 FROM t1 AS a1, t1 AS a2 LIMIT 4032; +INSERT INTO t2 SELECT id FROM t1; +SET DEBUG_SYNC= 'thread_end SIGNAL con1_end'; +SET DEBUG_SYNC= 'before_acos_function SIGNAL in_sync'; +SELECT id FROM t1 WHERE id IN +(SELECT DISTINCT a.id FROM t2 a, t2 b, t2 c, t2 d +GROUP BY ACOS(1/a.id), b.id, c.id, d.id +HAVING a.id BETWEEN 10 AND 20); +SET DEBUG_SYNC= 'now WAIT_FOR in_sync'; +KILL @id; +SET DEBUG_SYNC= 'now WAIT_FOR con1_end'; +Got one of the listed errors +SELECT 1; +1 +1 +SET DEBUG_SYNC = 'RESET'; +DROP TABLE t1, t2; +SET DEBUG_SYNC= 'before_acos_function SIGNAL in_sync WAIT_FOR kill'; +SELECT ACOS(0); +SET DEBUG_SYNC= 'now WAIT_FOR in_sync'; +KILL QUERY @id; +ACOS(0) +1.5707963267948966 +SELECT 1; +1 +1 +SELECT @id = CONNECTION_ID(); +@id = CONNECTION_ID() +1 +SET DEBUG_SYNC = 'RESET'; +CREATE TABLE t1 (f1 INT); +CREATE FUNCTION bug27563() RETURNS INT(11) +DETERMINISTIC +BEGIN +DECLARE CONTINUE HANDLER FOR SQLSTATE '70100' SET @a:= 'killed'; +DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET @a:= 'exception'; +SET DEBUG_SYNC= 'now SIGNAL in_sync WAIT_FOR kill'; +RETURN 1; +END| +INSERT INTO t1 VALUES (bug27563()); +SET DEBUG_SYNC= 'now WAIT_FOR in_sync'; +KILL QUERY @id; ERROR 70100: Query execution was interrupted -select @a; -@a -NULL -select * from t1; +SELECT * FROM t1; f1 -insert into t1 values(0); -update t1 set f1= bug27563(); +SET DEBUG_SYNC = 'RESET'; +INSERT INTO t1 VALUES(0); +UPDATE t1 SET f1= bug27563(); +SET DEBUG_SYNC= 'now WAIT_FOR in_sync'; +KILL QUERY @id; ERROR 70100: Query execution was interrupted -select @a; -@a -NULL -select * from t1; +SELECT * FROM t1; f1 0 -insert into t1 values(1); -delete from t1 where bug27563() is null; +SET DEBUG_SYNC = 'RESET'; +INSERT INTO t1 VALUES(1); +DELETE FROM t1 WHERE bug27563() IS NULL; +SET DEBUG_SYNC= 'now WAIT_FOR in_sync'; +KILL QUERY @id; ERROR 70100: Query execution was interrupted -select @a; -@a -NULL -select * from t1; +SELECT * FROM t1; f1 0 1 -select * from t1 where f1= bug27563(); +SET DEBUG_SYNC = 'RESET'; +SELECT * FROM t1 WHERE f1= bug27563(); +SET DEBUG_SYNC= 'now WAIT_FOR in_sync'; +KILL QUERY @id; ERROR 70100: Query execution was interrupted -select @a; -@a -NULL -create procedure proc27563() -begin -declare continue handler for sqlstate '70100' set @a:= 'killed'; -declare continue handler for sqlexception set @a:= 'exception'; -select get_lock("lock27563",10); -select "shouldn't be selected"; -end| -call proc27563(); -get_lock("lock27563",10) -NULL -ERROR 70100: Query execution was interrupted -select @a; -@a -NULL -create table t2 (f2 int); -create trigger trg27563 before insert on t1 for each row -begin -declare continue handler for sqlstate '70100' set @a:= 'killed'; -declare continue handler for sqlexception set @a:= 'exception'; -set @a:= get_lock("lock27563",10); -insert into t2 values(1); -end| -insert into t1 values(2),(3); -ERROR 70100: Query execution was interrupted -select @a; -@a -NULL -select * from t1; +SELECT * FROM t1; f1 0 1 -select * from t2; +SET DEBUG_SYNC = 'RESET'; +DROP FUNCTION bug27563; +CREATE TABLE t2 (f2 INT); +CREATE TRIGGER trg27563 BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +DECLARE CONTINUE HANDLER FOR SQLSTATE '70100' SET @a:= 'killed'; +DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET @a:= 'exception'; +INSERT INTO t2 VALUES(0); +SET DEBUG_SYNC= 'now SIGNAL in_sync WAIT_FOR kill'; +INSERT INTO t2 VALUES(1); +END| +INSERT INTO t1 VALUES(2),(3); +SET DEBUG_SYNC= 'now WAIT_FOR in_sync'; +KILL QUERY @id; +ERROR 70100: Query execution was interrupted +SELECT * FROM t1; +f1 +0 +1 +SELECT * FROM t2; f2 -select release_lock("lock27563"); -release_lock("lock27563") -1 -drop table t1, t2; -drop function bug27563; -drop procedure proc27563; +0 +SET DEBUG_SYNC = 'RESET'; +DROP TABLE t1, t2; +SET DEBUG_SYNC= 'before_join_optimize SIGNAL in_sync'; PREPARE stmt FROM 'EXPLAIN SELECT * FROM t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40 WHERE a1=a2 AND a2=a3 AND a3=a4 AND a4=a5 AND a5=a6 AND a6=a7 AND a7=a8 AND a8=a9 AND a9=a10 AND a10=a11 AND a11=a12 AND a12=a13 AND a13=a14 AND a14=a15 AND a15=a16 AND a16=a17 AND a17=a18 AND a18=a19 AND a19=a20 AND a20=a21 AND a21=a22 AND a22=a23 AND a23=a24 AND a24=a25 AND a25=a26 AND a26=a27 AND a27=a28 AND a28=a29 AND a29=a30 AND a30=a31 AND a31=a32 AND a32=a33 AND a33=a34 AND a34=a35 AND a35=a36 AND a36=a37 AND a37=a38 AND a38=a39 AND a39=a40 '; EXECUTE stmt; +SET DEBUG_SYNC= 'now WAIT_FOR in_sync'; +KILL QUERY @id; +ERROR 70100: Query execution was interrupted +SET DEBUG_SYNC = 'RESET'; # # Bug#19723: kill of active connection yields different error code # depending on platform. # -# Connection: con2. -KILL CONNECTION_ID(); -# CR_SERVER_LOST, CR_SERVER_GONE_ERROR, depending on the timing -# of close of the connection socket +# Connection: con1. +SET DEBUG_SYNC= 'thread_end SIGNAL con1_end'; +KILL @id; +ERROR 70100: Query execution was interrupted +SET DEBUG_SYNC= 'now WAIT_FOR con1_end'; +# ER_SERVER_SHUTDOWN, CR_SERVER_GONE_ERROR, CR_SERVER_LOST, +# depending on the timing of close of the connection socket SELECT 1; Got one of the listed errors +SELECT 1; +1 +1 +SELECT @id != CONNECTION_ID(); +@id != CONNECTION_ID() +1 +SET DEBUG_SYNC = 'RESET'; # # Additional test for WL#3726 "DDL locking for all metadata objects" # Check that DDL and DML statements waiting for metadata locks can @@ -208,13 +243,11 @@ ERROR 70100: Query execution was interrupted # Test for DML waiting for meta-data lock # Switching to connection 'blocker' unlock tables; -drop table t2; -create table t2 (k int); lock tables t1 read; # Switching to connection 'ddl' -rename tables t1 to t3, t2 to t1; +truncate table t1; # Switching to connection 'dml' -insert into t2 values (1); +insert into t1 values (1); # Switching to connection 'default' kill query ID2; # Switching to connection 'dml' @@ -239,6 +272,7 @@ unlock tables; # Switching to connection 'ddl' # Cleanup. # Switching to connection 'default' -drop table t3; drop table t1; -set @@global.concurrent_insert= @old_concurrent_insert; +drop table t2; +SET DEBUG_SYNC = 'RESET'; +DROP FUNCTION MY_KILL; diff --git a/mysql-test/r/lock_sync.result b/mysql-test/r/lock_sync.result index 3682f0df26a..8fe94679e70 100644 --- a/mysql-test/r/lock_sync.result +++ b/mysql-test/r/lock_sync.result @@ -704,3 +704,72 @@ SET DEBUG_SYNC="now SIGNAL query"; # Connection default DROP EVENT e2; SET DEBUG_SYNC="RESET"; +# +# Bug#55930 Assertion `thd->transaction.stmt.is_empty() || +# thd->in_sub_stmt || (thd->state.. +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(a INT) engine=InnoDB; +INSERT INTO t1 VALUES (1), (2); +# Connection con1 +SET SESSION lock_wait_timeout= 1; +SET DEBUG_SYNC= 'ha_admin_open_ltable SIGNAL opti_recreate WAIT_FOR opti_analyze'; +# Sending: +OPTIMIZE TABLE t1; +# Connection con2 +SET DEBUG_SYNC= 'now WAIT_FOR opti_recreate'; +SET DEBUG_SYNC= 'after_lock_tables_takes_lock SIGNAL thrlock WAIT_FOR release_thrlock'; +# Sending: +INSERT INTO t1 VALUES (3); +# Connection default +SET DEBUG_SYNC= 'now WAIT_FOR thrlock'; +SET DEBUG_SYNC= 'now SIGNAL opti_analyze'; +# Connection con1 +# Reaping: OPTIMIZE TABLE t1 +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize error Lock wait timeout exceeded; try restarting transaction +test.t1 optimize status Operation failed +Warnings: +Error 1205 Lock wait timeout exceeded; try restarting transaction +SET DEBUG_SYNC= 'now SIGNAL release_thrlock'; +# Connection con2 +# Reaping: INSERT INTO t1 VALUES (3) +# Connection default +DROP TABLE t1; +SET DEBUG_SYNC= 'RESET'; +# +# Bug#57130 crash in Item_field::print during SHOW CREATE TABLE or VIEW +# +DROP TABLE IF EXISTS t1; +DROP VIEW IF EXISTS v1; +DROP FUNCTION IF EXISTS f1; +CREATE TABLE t1(a INT); +CREATE FUNCTION f1() RETURNS INTEGER RETURN 1; +CREATE VIEW v1 AS SELECT * FROM t1 WHERE f1() = 1; +DROP FUNCTION f1; +# Connection con1 +SET DEBUG_SYNC= 'open_tables_after_open_and_process_table SIGNAL opened WAIT_FOR dropped EXECUTE 2'; +# Sending: +SHOW CREATE VIEW v1; +# Connection con2 +SET DEBUG_SYNC= 'now WAIT_FOR opened'; +SET DEBUG_SYNC= 'now SIGNAL dropped'; +SET DEBUG_SYNC= 'now WAIT_FOR opened'; +# Sending: +FLUSH TABLES; +# Connection default +# Waiting for FLUSH TABLES to be blocked. +SET DEBUG_SYNC= 'now SIGNAL dropped'; +# Connection con1 +# Reaping: SHOW CREATE VIEW v1 +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where (`f1`() = 1) latin1 latin1_swedish_ci +Warnings: +Warning 1356 View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them +# Connection con2 +# Reaping: FLUSH TABLES +# Connection default +SET DEBUG_SYNC= 'RESET'; +DROP VIEW v1; +DROP TABLE t1; diff --git a/mysql-test/r/log_tables.result b/mysql-test/r/log_tables.result index 1666d5e0297..f64894c9f10 100644 --- a/mysql-test/r/log_tables.result +++ b/mysql-test/r/log_tables.result @@ -896,6 +896,16 @@ TIMESTAMP 1 1 SELECT SQL_NO_CACHE 'Bug#31700 - KEY', f1,f2,f3,SLEEP(1.1) FROM t1 TIMESTAMP 1 1 SELECT SQL_NO_CACHE 'Bug#31700 - PK', f1,f2,f3,SLEEP(1.1) FROM t1 WHERE f1=2 DROP TABLE t1; TRUNCATE TABLE mysql.slow_log; +use mysql; +drop table if exists renamed_general_log; +drop table if exists renamed_slow_log; +RENAME TABLE general_log TO renamed_general_log; +ERROR HY000: Cannot rename 'general_log'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to 'general_log' +RENAME TABLE slow_log TO renamed_slow_log; +ERROR HY000: Cannot rename 'slow_log'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to 'slow_log' +use test; +flush tables with read lock; +unlock tables; SET @@session.long_query_time= @old_long_query_time; SET @@global.log_output= @old_log_output; SET @@global.slow_query_log= @old_slow_query_log; diff --git a/mysql-test/r/log_tables_upgrade.result b/mysql-test/r/log_tables_upgrade.result index 13b08c2e771..7d15005e143 100644 --- a/mysql-test/r/log_tables_upgrade.result +++ b/mysql-test/r/log_tables_upgrade.result @@ -27,7 +27,7 @@ mysql.ndb_binlog_index OK mysql.plugin OK mysql.proc OK mysql.procs_priv OK -mysql.proxy_priv OK +mysql.proxies_priv OK mysql.renamed_general_log OK mysql.servers OK mysql.slow_log OK diff --git a/mysql-test/r/lowercase_table4.result b/mysql-test/r/lowercase_table4.result new file mode 100755 index 00000000000..e3f861f8884 --- /dev/null +++ b/mysql-test/r/lowercase_table4.result @@ -0,0 +1,7 @@ +# +# Bug#46941 crash with lower_case_table_names=2 and +# foreign data dictionary confusion +# +CREATE DATABASE XY; +USE XY; +DROP DATABASE XY; diff --git a/mysql-test/r/mdl_sync.result b/mysql-test/r/mdl_sync.result index d2a32c25201..594cf433692 100644 --- a/mysql-test/r/mdl_sync.result +++ b/mysql-test/r/mdl_sync.result @@ -2471,7 +2471,7 @@ CREATE PROCEDURE p1() SELECT 1; SET DEBUG_SYNC= 'now WAIT_FOR table_opened'; # Check that FLUSH must wait to get the GRL # and let CREATE PROCEDURE continue -SET DEBUG_SYNC= 'wait_lock_global_read_lock SIGNAL grlwait'; +SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL grlwait'; FLUSH TABLES WITH READ LOCK; # Connection 1 # Connection 2 @@ -2486,10 +2486,17 @@ DROP PROCEDURE p1; SET DEBUG_SYNC= 'now WAIT_FOR table_opened'; # Check that FLUSH must wait to get the GRL # and let DROP PROCEDURE continue -SET DEBUG_SYNC= 'wait_lock_global_read_lock SIGNAL grlwait'; +SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL grlwait'; FLUSH TABLES WITH READ LOCK; # Connection 1 +# Once FLUSH TABLES WITH READ LOCK starts waiting +# DROP PROCEDURE will be waked up and will drop +# procedure. Global read lock will be granted after +# this statement ends. +# +# Reaping DROP PROCEDURE. # Connection 2 +# Reaping FTWRL. UNLOCK TABLES; # Connection 1 SET DEBUG_SYNC= 'RESET'; diff --git a/mysql-test/r/mysql_upgrade.result b/mysql-test/r/mysql_upgrade.result index f705db3e509..e36b4781ddf 100644 --- a/mysql-test/r/mysql_upgrade.result +++ b/mysql-test/r/mysql_upgrade.result @@ -15,7 +15,7 @@ mysql.ndb_binlog_index OK mysql.plugin OK mysql.proc OK mysql.procs_priv OK -mysql.proxy_priv OK +mysql.proxies_priv OK mysql.servers OK mysql.slow_log OK mysql.tables_priv OK @@ -44,7 +44,7 @@ mysql.ndb_binlog_index OK mysql.plugin OK mysql.proc OK mysql.procs_priv OK -mysql.proxy_priv OK +mysql.proxies_priv OK mysql.servers OK mysql.slow_log OK mysql.tables_priv OK @@ -73,7 +73,7 @@ mysql.ndb_binlog_index OK mysql.plugin OK mysql.proc OK mysql.procs_priv OK -mysql.proxy_priv OK +mysql.proxies_priv OK mysql.servers OK mysql.slow_log OK mysql.tables_priv OK @@ -104,7 +104,7 @@ mysql.ndb_binlog_index OK mysql.plugin OK mysql.proc OK mysql.procs_priv OK -mysql.proxy_priv OK +mysql.proxies_priv OK mysql.servers OK mysql.slow_log OK mysql.tables_priv OK @@ -139,7 +139,7 @@ mysql.ndb_binlog_index OK mysql.plugin OK mysql.proc OK mysql.procs_priv OK -mysql.proxy_priv OK +mysql.proxies_priv OK mysql.servers OK mysql.slow_log OK mysql.tables_priv OK @@ -177,7 +177,7 @@ mysql.ndb_binlog_index OK mysql.plugin OK mysql.proc OK mysql.procs_priv OK -mysql.proxy_priv OK +mysql.proxies_priv OK mysql.servers OK mysql.slow_log OK mysql.tables_priv OK diff --git a/mysql-test/r/mysql_upgrade_ssl.result b/mysql-test/r/mysql_upgrade_ssl.result index 694eb1e7d88..4cc8b6ab44b 100644 --- a/mysql-test/r/mysql_upgrade_ssl.result +++ b/mysql-test/r/mysql_upgrade_ssl.result @@ -17,7 +17,7 @@ mysql.ndb_binlog_index OK mysql.plugin OK mysql.proc OK mysql.procs_priv OK -mysql.proxy_priv OK +mysql.proxies_priv OK mysql.servers OK mysql.slow_log OK mysql.tables_priv OK diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result index 51fad679909..ce83fe5b79b 100644 --- a/mysql-test/r/mysqlbinlog.result +++ b/mysql-test/r/mysqlbinlog.result @@ -879,3 +879,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; End of 5.0 tests End of 5.1 tests +# Expect deprecation warning. +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. +# Expect deprecation warning again. +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. diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result index 241c92f0aa6..ef46eba5ccb 100644 --- a/mysql-test/r/mysqlcheck.result +++ b/mysql-test/r/mysqlcheck.result @@ -18,7 +18,7 @@ mysql.ndb_binlog_index OK mysql.plugin OK mysql.proc OK mysql.procs_priv OK -mysql.proxy_priv OK +mysql.proxies_priv OK mysql.servers OK mysql.slow_log note : The storage engine for the table doesn't support analyze @@ -46,7 +46,7 @@ mysql.ndb_binlog_index OK mysql.plugin OK mysql.proc OK mysql.procs_priv OK -mysql.proxy_priv OK +mysql.proxies_priv OK mysql.servers OK mysql.slow_log note : The storage engine for the table doesn't support optimize @@ -72,7 +72,7 @@ mysql.ndb_binlog_index OK mysql.plugin OK mysql.proc OK mysql.procs_priv OK -mysql.proxy_priv OK +mysql.proxies_priv OK mysql.servers OK mysql.slow_log note : The storage engine for the table doesn't support analyze @@ -98,7 +98,7 @@ mysql.ndb_binlog_index Table is already up to date mysql.plugin Table is already up to date mysql.proc Table is already up to date mysql.procs_priv Table is already up to date -mysql.proxy_priv Table is already up to date +mysql.proxies_priv Table is already up to date mysql.servers Table is already up to date mysql.slow_log note : The storage engine for the table doesn't support optimize diff --git a/mysql-test/r/mysqld--help-notwin.result b/mysql-test/r/mysqld--help-notwin.result index 63e17e1c188..fc269e1dd82 100644 --- a/mysql-test/r/mysqld--help-notwin.result +++ b/mysql-test/r/mysqld--help-notwin.result @@ -19,6 +19,7 @@ The following options may be given as the first argument: --auto-increment-offset[=#] Offset added to Auto-increment columns. Used when auto-increment-increment != 1 + --autocommit Set default value for autocommit (0 or 1) --automatic-sp-privileges Creating and dropping stored procedures alters ACLs (Defaults to on; use --skip-automatic-sp-privileges to disable.) diff --git a/mysql-test/r/mysqld--help-win.result b/mysql-test/r/mysqld--help-win.result index c5996981e92..c5d7bb458c3 100644 --- a/mysql-test/r/mysqld--help-win.result +++ b/mysql-test/r/mysqld--help-win.result @@ -19,6 +19,7 @@ The following options may be given as the first argument: --auto-increment-offset[=#] Offset added to Auto-increment columns. Used when auto-increment-increment != 1 + --autocommit Set default value for autocommit (0 or 1) --automatic-sp-privileges Creating and dropping stored procedures alters ACLs (Defaults to on; use --skip-automatic-sp-privileges to disable.) diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index cff845a2819..e24a6f07171 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -308,6 +308,10 @@ var3 two columns with same name var4 from query that returns NULL var5 from query that returns no row failing query in let +create table t1 (a varchar(100)); +insert into t1 values ('`select 42`'); +`select 42` +drop table t1; mysqltest: At line 1: Error running query 'failing query': 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'failing query' at line 1 mysqltest: At line 1: Missing required argument 'filename' to command 'source' mysqltest: At line 1: Could not open './non_existingFile' for reading, errno: 2 @@ -399,10 +403,40 @@ true-inner true-inner again true-outer Counter is greater than 0, (counter=10) +Counter should still be 10, is 10 Counter is not 0, (counter=0) +Not space var works Counter is true, (counter=alpha) -Beta is true while with string, only once +5<7 +5<7 again +5<7 still +5<6 +5>=5 +5>=5 again +5>3 +5==5 +5!=8 +5!=five +5==3+2 +5 == 5 +hello == hello +hello == hello +hello != goodbye +two words +two words are two words +right answer +anything goes +0 != string +mysqltest: At line 2: Only == and != are supported for string values +mysqltest: At line 2: Found junk '~= 6' after $variable in condition +mysqltest: At line 2: Expression in if/while must beging with $, ` or a number +counter is 2 +counter is 3 +counter is 4 +counter is 5 +counter is 6 +counter is 7 1 Testing while with not mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest_while.inc": At line 64: Nesting too deeply @@ -799,7 +833,7 @@ drop table t1; mysqltest: At line 1: change user failed: Unknown database 'inexistent' mysqltest: At line 1: change user failed: Access denied for user 'inexistent'@'localhost' (using password: NO) mysqltest: At line 1: change user failed: Access denied for user 'root'@'localhost' (using password: YES) -file1.txt +REPLACED_FILE1.txt file1.txt file2.txt file11.txt @@ -807,8 +841,6 @@ dir-list.txt SELECT 'c:\\a.txt' AS col; col z -hej -mysqltest: At line 1: Found junk ' != 143' after $variable in expression select 1; 1 1 diff --git a/mysql-test/r/not_embedded_server.result b/mysql-test/r/not_embedded_server.result index fac38624695..ce229bf3e2e 100644 --- a/mysql-test/r/not_embedded_server.result +++ b/mysql-test/r/not_embedded_server.result @@ -14,3 +14,32 @@ flush privileges; ERROR HY000: Table 'host' was not locked with LOCK TABLES unlock tables; drop table t1; +# +# Bug#54812: assert in Diagnostics_area::set_ok_status during EXPLAIN +# +CREATE USER nopriv_user@localhost; +connection: default +DROP TABLE IF EXISTS t1,t2,t3; +DROP FUNCTION IF EXISTS f; +CREATE TABLE t1 (key1 INT PRIMARY KEY); +CREATE TABLE t2 (key2 INT); +INSERT INTO t1 VALUES (1),(2); +CREATE FUNCTION f() RETURNS INT RETURN 1; +GRANT FILE ON *.* TO 'nopriv_user'@'localhost'; +FLUSH PRIVILEGES; +connection: con1 +SELECT MAX(key1) FROM t1 WHERE f() < 1 INTO OUTFILE 'mytest'; +ERROR 42000: execute command denied to user 'nopriv_user'@'localhost' for routine 'test.f' +INSERT INTO t2 SELECT MAX(key1) FROM t1 WHERE f() < 1; +ERROR 42000: execute command denied to user 'nopriv_user'@'localhost' for routine 'test.f' +SELECT MAX(key1) INTO @dummy FROM t1 WHERE f() < 1; +ERROR 42000: execute command denied to user 'nopriv_user'@'localhost' for routine 'test.f' +CREATE TABLE t3 (i INT) AS SELECT MAX(key1) FROM t1 WHERE f() < 1; +ERROR 42000: execute command denied to user 'nopriv_user'@'localhost' for routine 'test.f' +connection: default +DROP TABLE t1,t2; +DROP FUNCTION f; +DROP USER nopriv_user@localhost; +# +# End Bug#54812 +# diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index 80676c0d324..a639f9e6b3b 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -1,5 +1,38 @@ drop table if exists t1, t2; # +# Bug#57778: failed primary key add to partitioned innodb table +# inconsistent and crashes +# +CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL) +PARTITION BY KEY (a) PARTITIONS 2; +INSERT INTO t1 VALUES (0,1), (0,2); +ALTER TABLE t1 ADD PRIMARY KEY (a); +ERROR 23000: Duplicate entry '0' for key 'PRIMARY' +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL, + `b` int(11) NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY KEY (a) +PARTITIONS 2 */ +SELECT * FROM t1; +a b +0 1 +0 2 +UPDATE t1 SET a = 1, b = 1 WHERE a = 0 AND b = 2; +ALTER TABLE t1 ADD PRIMARY KEY (a); +SELECT * FROM t1; +a b +1 1 +0 1 +ALTER TABLE t1 DROP PRIMARY KEY; +SELECT * FROM t1; +a b +1 1 +0 1 +DROP TABLE t1; +# # Bug#57113: ha_partition::extra(ha_extra_function): # Assertion `m_extra_cache' failed CREATE TABLE t1 diff --git a/mysql-test/r/partition_debug_sync.result b/mysql-test/r/partition_debug_sync.result index 0e3241cf88e..6b8c8e48acc 100644 --- a/mysql-test/r/partition_debug_sync.result +++ b/mysql-test/r/partition_debug_sync.result @@ -25,7 +25,7 @@ ALTER TABLE t1 REMOVE PARTITIONING; # Con default SET DEBUG_SYNC= 'now WAIT_FOR removing_partitioning'; SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL waiting_for_alter'; -SET DEBUG_SYNC= 'rm_table_part2_before_delete_table WAIT_FOR partitioning_removed'; +SET DEBUG_SYNC= 'rm_table_no_locks_before_delete_table WAIT_FOR partitioning_removed'; DROP TABLE IF EXISTS t1; # Con 1 SET SESSION debug= "-d,sleep_before_create_table_no_lock"; @@ -51,12 +51,12 @@ SET DEBUG_SYNC= 'alter_table_before_open_tables SIGNAL removing_partitions WAIT_ SET DEBUG_SYNC= 'alter_table_before_rename_result_table WAIT_FOR delete_done'; ALTER TABLE t2 REMOVE PARTITIONING; # Con default -SET SESSION debug= "+d,sleep_before_part2_delete_table"; +SET SESSION debug= "+d,sleep_before_no_locks_delete_table"; SET DEBUG_SYNC= 'now WAIT_FOR removing_partitions'; -SET DEBUG_SYNC= 'rm_table_part2_before_delete_table SIGNAL waiting_for_alter'; -SET DEBUG_SYNC= 'rm_table_part2_before_binlog SIGNAL delete_done'; +SET DEBUG_SYNC= 'rm_table_no_locks_before_delete_table SIGNAL waiting_for_alter'; +SET DEBUG_SYNC= 'rm_table_no_locks_before_binlog SIGNAL delete_done'; DROP TABLE IF EXISTS t2; -SET SESSION debug= "-d,sleep_before_part2_delete_table"; +SET SESSION debug= "-d,sleep_before_no_locks_delete_table"; # Con 1 ERROR 42S02: Table 'test.t2' doesn't exist SET DEBUG_SYNC= 'RESET'; diff --git a/mysql-test/r/partition_innodb.result b/mysql-test/r/partition_innodb.result index 148504bcc8b..6515d2a4e0c 100644 --- a/mysql-test/r/partition_innodb.result +++ b/mysql-test/r/partition_innodb.result @@ -1,5 +1,31 @@ drop table if exists t1, t2; # +# Bug#56287: crash when using Partition datetime in sub in query +# +CREATE TABLE t1 +(c1 bigint(20) unsigned NOT NULL AUTO_INCREMENT, +c2 varchar(40) not null default '', +c3 datetime not NULL, +PRIMARY KEY (c1,c3), +KEY partidx(c3)) +ENGINE=InnoDB +PARTITION BY RANGE (TO_DAYS(c3)) +(PARTITION p200912 VALUES LESS THAN (to_days('2010-01-01')), +PARTITION p201103 VALUES LESS THAN (to_days('2011-04-01')), +PARTITION p201912 VALUES LESS THAN MAXVALUE); +insert into t1(c2,c3) values ("Test row",'2010-01-01 00:00:00'); +SELECT PARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test'; +PARTITION_NAME TABLE_ROWS +p200912 0 +p201103 1 +p201912 0 +SELECT count(*) FROM t1 p where c3 in +(select c3 from t1 t where t.c3 < date '2011-04-26 19:19:44' + and t.c3 > date '2011-04-26 19:18:44') ; +count(*) +0 +DROP TABLE t1; +# # Bug#54747: Deadlock between REORGANIZE PARTITION and # SELECT is not detected # @@ -489,3 +515,31 @@ Warning 1265 Data truncated for column 'b' at row 1 Error 1067 Invalid default value for 'b' SET SESSION sql_mode = @old_mode; DROP TABLE t1; +# +# Bug#57985 "ONLINE/FAST ALTER PARTITION can fail and leave the +# table unusable". +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a bigint not null, b int not null, PRIMARY KEY (a)) +ENGINE = InnoDB PARTITION BY KEY(a) PARTITIONS 2; +INSERT INTO t1 values (0,1), (1,2); +# The below ALTER should fail. It should leave the +# table in its original, non-corrupted, usable state. +ALTER TABLE t1 ADD UNIQUE KEY (b); +ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function +# The below statements should succeed, as ALTER should +# have left table intact. +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` bigint(20) NOT NULL, + `b` int(11) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY KEY (a) +PARTITIONS 2 */ +SELECT * FROM t1; +a b +1 2 +0 1 +DROP TABLE t1; diff --git a/mysql-test/r/partition_innodb_plugin.result b/mysql-test/r/partition_innodb_plugin.result index dd91eee316a..aa0944e96b5 100644 --- a/mysql-test/r/partition_innodb_plugin.result +++ b/mysql-test/r/partition_innodb_plugin.result @@ -1,3 +1,76 @@ +call mtr.add_suppression("nnoDB: Error: table `test`.`t1` .* Partition.* InnoDB internal"); +# +# Bug#55091: Server crashes on ADD PARTITION after a failed attempt +# +SET @old_innodb_file_format_max = @@global.innodb_file_format_max; +SET @old_innodb_file_format = @@global.innodb_file_format; +SET @old_innodb_file_per_table = @@global.innodb_file_per_table; +SET @old_innodb_strict_mode = @@global.innodb_strict_mode; +SET @@global.innodb_file_format = Barracuda, +@@global.innodb_file_per_table = ON, +@@global.innodb_strict_mode = ON; +# Connection con1 +CREATE TABLE t1 (id INT NOT NULL +PRIMARY KEY, +user_num CHAR(10) +) ENGINE = InnoDB +KEY_BLOCK_SIZE=4 +PARTITION BY HASH(id) PARTITIONS 1; +t1#P#p0.ibd +t1.frm +t1.par +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL, + `user_num` char(10) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=4 +/*!50100 PARTITION BY HASH (id) +PARTITIONS 1 */ +SET GLOBAL innodb_file_per_table = OFF; +# Connection con2 +LOCK TABLE t1 WRITE; +# ALTER fails because COMPRESSED/KEY_BLOCK_SIZE +# are incompatible with innodb_file_per_table = OFF; +ALTER TABLE t1 ADD PARTITION PARTITIONS 1; +ERROR HY000: Got error 1478 from storage engine +t1#P#p0.ibd +t1.frm +t1.par +# This SET is not needed to reproduce the bug, +# it is here just to make the test case more realistic +SET innodb_strict_mode = OFF; +ALTER TABLE t1 ADD PARTITION PARTITIONS 2; +Warnings: +Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table. +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4. +Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table. +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4. +Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table. +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4. +t1.frm +t1.par +ALTER TABLE t1 REBUILD PARTITION p0; +Warnings: +Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table. +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4. +UNLOCK TABLES; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL, + `user_num` char(10) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=4 +/*!50100 PARTITION BY HASH (id) +PARTITIONS 3 */ +DROP TABLE t1; +# Connection default +SET @@global.innodb_strict_mode = @old_innodb_strict_mode; +SET @@global.innodb_file_format = @old_innodb_file_format; +SET @@global.innodb_file_per_table = @old_innodb_file_per_table; +SET @@global.innodb_file_format_max = @old_innodb_file_format_max; SET NAMES utf8; CREATE TABLE `t``\""e` (a INT, PRIMARY KEY (a)) ENGINE=InnoDB diff --git a/mysql-test/r/plugin_auth.result b/mysql-test/r/plugin_auth.result index 54467b78f19..8a649f63598 100644 --- a/mysql-test/r/plugin_auth.result +++ b/mysql-test/r/plugin_auth.result @@ -11,6 +11,26 @@ test_plugin_server plug_dest ## test plugin auth ERROR 28000: Access denied for user 'plug'@'localhost' (using password: YES) GRANT PROXY ON plug_dest TO plug; +test proxies_priv columns +SELECT * FROM mysql.proxies_priv; +Host User Proxied_host Proxied_user With_grant Grantor Timestamp +xx root 1 xx +xx root 1 xx +xx plug % plug_dest 0 root@localhost xx +test mysql.proxies_priv; +SHOW CREATE TABLE mysql.proxies_priv; +Table Create Table +proxies_priv CREATE TABLE `proxies_priv` ( + `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', + `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '', + `Proxied_host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', + `Proxied_user` char(16) COLLATE utf8_bin NOT NULL DEFAULT '', + `With_grant` tinyint(1) NOT NULL DEFAULT '0', + `Grantor` char(77) COLLATE utf8_bin NOT NULL DEFAULT '', + `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`Host`,`User`,`Proxied_host`,`Proxied_user`), + KEY `Grantor` (`Grantor`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='User proxy privileges' select USER(),CURRENT_USER(); USER() CURRENT_USER() plug@localhost plug_dest@% @@ -146,8 +166,8 @@ Grants for test_drop@localhost GRANT USAGE ON *.* TO 'test_drop'@'localhost' GRANT PROXY ON 'future_user'@'%' TO 'test_drop'@'localhost' DROP USER test_drop@localhost; -SELECT * FROM mysql.proxy_priv WHERE Host = 'test_drop' AND User = 'localhost'; -Host User Proxied_Host Proxied_User With_Grant +SELECT * FROM mysql.proxies_priv WHERE Host = 'test_drop' AND User = 'localhost'; +Host User Proxied_host Proxied_user With_grant Grantor Timestamp DROP USER proxy_admin; DROP USER grant_plug,grant_plug_dest,grant_plug_dest2; ## END GRANT PROXY tests @@ -235,3 +255,67 @@ GRANT PROXY ON standard_user TO ''@''; DROP USER ''@''; DROP USER standard_user; DROP DATABASE shared; +# +# Bug #57551 : Live upgrade fails between 5.1.52 -> 5.5.7-rc +# +CALL mtr.add_suppression("Missing system table mysql.proxies_priv."); +DROP TABLE mysql.proxies_priv; +# Must come back with mysql.proxies_priv absent. +SELECT * FROM mysql.proxies_priv; +ERROR 42S02: Table 'mysql.proxies_priv' doesn't exist +CREATE USER u1@localhost; +GRANT ALL PRIVILEGES ON *.* TO u1@localhost; +REVOKE ALL PRIVILEGES ON *.* FROM u1@localhost; +GRANT ALL PRIVILEGES ON *.* TO u1@localhost; +CREATE USER u2@localhost; +GRANT ALL PRIVILEGES ON *.* TO u2@localhost; +# access denied because of no privileges to root +GRANT PROXY ON u2@localhost TO u1@localhost; +ERROR 28000: Access denied for user 'root'@'localhost' +# access denied because of no privileges to root +REVOKE PROXY ON u2@localhost FROM u1@localhost; +ERROR 28000: Access denied for user 'root'@'localhost' +# go try graning proxy on itself, so that it will need the table +GRANT PROXY ON u2@localhost TO u1@localhost; +ERROR 42S02: Table 'mysql.proxies_priv' doesn't exist +REVOKE PROXY ON u2@localhost FROM u1@localhost; +ERROR 42S02: Table 'mysql.proxies_priv' doesn't exist +# test if REVOKE works without the proxies_priv table +REVOKE ALL PRIVILEGES ON *.* FROM u1@localhost, u2@localhost; +# test if DROP USER work without the proxies_priv table +DROP USER u1@localhost,u2@localhost; +# test if FLUSH PRIVILEGES works without the proxies_priv table +FLUSH PRIVILEGES; +mtr.global_suppressions OK +mtr.test_suppressions OK +mysql.columns_priv OK +mysql.db OK +mysql.event OK +mysql.func OK +mysql.general_log OK +mysql.help_category OK +mysql.help_keyword OK +mysql.help_relation OK +mysql.help_topic OK +mysql.host OK +mysql.ndb_binlog_index OK +mysql.plugin OK +mysql.proc OK +mysql.procs_priv OK +mysql.servers OK +mysql.slow_log OK +mysql.tables_priv OK +mysql.time_zone OK +mysql.time_zone_leap_second OK +mysql.time_zone_name OK +mysql.time_zone_transition OK +mysql.time_zone_transition_type OK +mysql.user OK +SELECT Host,User,Proxied_host,Proxied_user,With_grant FROM mysql.proxies_priv; +Host localhost +User root +Proxied_host +Proxied_user +With_grant 1 +FLUSH PRIVILEGES; +End of 5.5 tests diff --git a/mysql-test/r/plugin_auth_qa.result b/mysql-test/r/plugin_auth_qa.result new file mode 100644 index 00000000000..d1ecf6a6470 --- /dev/null +++ b/mysql-test/r/plugin_auth_qa.result @@ -0,0 +1,327 @@ +CREATE DATABASE test_user_db; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +========== test 1.1 ====================================================== +CREATE USER plug IDENTIFIED WITH test_plugin_server; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +plug test_plugin_server +DROP USER plug; +GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +plug test_plugin_server +REVOKE ALL PRIVILEGES ON test_user_db.* FROM plug; +DROP USER plug; +CREATE USER plug IDENTIFIED WITH 'test_plugin_server'; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +plug test_plugin_server +DROP USER plug; +GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server'; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +plug test_plugin_server +REVOKE ALL PRIVILEGES ON test_user_db.* FROM plug; +DROP USER plug; +CREATE USER plug IDENTIFIED WITH test_plugin_server AS ''; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +plug test_plugin_server +DROP USER plug; +GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS ''; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +plug test_plugin_server +REVOKE ALL PRIVILEGES ON test_user_db.* FROM plug; +DROP USER plug; +CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 +GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 +CREATE USER plug IDENTIFIED WITH test_plugin_server AS plug_dest; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'plug_dest' at line 1 +GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS plug_dest; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'plug_dest' at line 1 +========== test 1.1 syntax errors ======================================== +CREATE USER plug IDENTIFIED WITH AS plug_dest; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS plug_dest' at line 1 +GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH AS plug_dest; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS plug_dest' at line 1 +CREATE USER plug IDENTIFIED WITH; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 +GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 +CREATE USER plug IDENTIFIED AS ''; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS ''' at line 1 +GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED AS ''; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS ''' at line 1 +CREATE USER plug IDENTIFIED WITH 'test_plugin_server' IDENTIFIED WITH 'test_plugin_server'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED WITH 'test_plugin_server'' at line 1 +GRANT ALL PRIVILEGES ON test_user_db.* TO plug +IDENTIFIED WITH 'test_plugin_server' IDENTIFIED WITH 'test_plugin_server'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED WITH 'test_plugin_server'' at line 2 +CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS '' AS 'plug_dest'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS 'plug_dest'' at line 1 +GRANT ALL PRIVILEGES ON test_user_db.* TO plug AS '' AS 'plug_dest'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS '' AS 'plug_dest'' at line 1 +CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS '' +IDENTIFIED WITH test_plugin_server AS 'plug_dest'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED WITH test_plugin_server AS 'plug_dest'' at line 2 +GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS '' + IDENTIFIED WITH test_plugin_server AS 'plug_dest'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED WITH test_plugin_server AS 'plug_dest'' at line 2 +CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd' +IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'' at line 2 +GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED BY 'plug_dest_passwd' + IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'' at line 2 +CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest' +USER plug_dest IDENTIFIED by 'plug_dest_pwd'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USER plug_dest IDENTIFIED by 'plug_dest_pwd'' at line 2 +GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest' + USER plug_dest IDENTIFIED by 'plug_dest_pwd'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'USER plug_dest IDENTIFIED by 'plug_dest_pwd'' at line 2 +CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest' +plug_dest IDENTIFIED by 'plug_dest_pwd'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'plug_dest IDENTIFIED by 'plug_dest_pwd'' at line 2 +GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest' + plug_dest IDENTIFIED by 'plug_dest_pwd'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'plug_dest IDENTIFIED by 'plug_dest_pwd'' at line 2 +CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest' +IDENTIFIED by 'plug_dest_pwd'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED by 'plug_dest_pwd'' at line 2 +GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest' + IDENTIFIED by 'plug_dest_pwd'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED by 'plug_dest_pwd'' at line 2 +========== test 1.1 combinations ========================== +CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; +========== test 1.1.1.6/1.1.2.5 ============================ +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +plug test_plugin_server plug_dest +CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +plug test_plugin_server plug_dest +plug_dest +DROP USER plug, plug_dest; +CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +plug test_plugin_server plug_dest +DROP USER plug; +CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +plug_dest +DROP USER plug_dest; +GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +plug test_plugin_server plug_dest +CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +plug test_plugin_server plug_dest +plug_dest +DROP USER plug, plug_dest; +GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS 'plug_dest'; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +plug test_plugin_server plug_dest +DROP USER plug; +CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +plug_dest +DROP USER plug_dest; +CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +plug test_plugin_server plug_dest +GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_passwd'; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +plug test_plugin_server plug_dest +plug_dest +DROP USER plug, plug_dest; +CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +plug test_plugin_server plug_dest +DROP USER plug; +GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_passwd'; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +plug_dest +DROP USER plug_dest; +CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; +GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; +ERROR HY000: GRANT with IDENTIFIED WITH is illegal because the user plug already exists +GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server'; +ERROR HY000: GRANT with IDENTIFIED WITH is illegal because the user plug already exists +DROP USER plug; +GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS 'plug_dest'; +CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; +ERROR HY000: Operation CREATE USER failed for 'plug'@'%' +CREATE USER plug IDENTIFIED WITH 'test_plugin_server'; +ERROR HY000: Operation CREATE USER failed for 'plug'@'%' +DROP USER plug; +CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; +SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; +user plugin authentication_string password +plug test_plugin_server plug_dest +GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED BY 'plug_dest_passwd'; +SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; +user plugin authentication_string password +plug test_plugin_server plug_dest *939AEE68989794C0F408277411C26055CDF41119 +DROP USER plug; +GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS 'plug_dest'; +CREATE USER plug IDENTIFIED BY 'plug_dest_passwd'; +ERROR HY000: Operation CREATE USER failed for 'plug'@'%' +DROP USER plug; +CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; +CREATE USER plug_dest IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; +SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; +user plugin authentication_string password +plug test_plugin_server plug_dest +plug_dest test_plugin_server plug_dest +DROP USER plug,plug_dest; +CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; +SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; +user plugin authentication_string password +plug test_plugin_server plug_dest +GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest +IDENTIFIED WITH test_plugin_server AS 'plug_dest'; +SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; +user plugin authentication_string password +plug test_plugin_server plug_dest +plug_dest test_plugin_server plug_dest +DROP USER plug,plug_dest; +========== test 1.1.1.1/1.1.2.1/1.1.1.5 ==================== +SET NAMES utf8; +CREATE USER plüg IDENTIFIED WITH 'test_plugin_server' AS 'plüg_dest'; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +plüg test_plugin_server plüg_dest +DROP USER plüg; +CREATE USER plüg_dest IDENTIFIED BY 'plug_dest_passwd'; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +plüg_dest +DROP USER plüg_dest; +SET NAMES ascii; +CREATE USER 'plüg' IDENTIFIED WITH 'test_plugin_server' AS 'plüg_dest'; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +pl??g test_plugin_server pl??g_dest +DROP USER 'plüg'; +CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd'; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +pl??g_dest +DROP USER 'plüg_dest'; +SET NAMES latin1; +========== test 1.1.1.5 ==================================== +CREATE USER 'plüg' IDENTIFIED WITH 'test_plügin_server' AS 'plüg_dest'; +ERROR HY000: Plugin 'test_plügin_server' is not loaded +CREATE USER 'plug' IDENTIFIED WITH 'test_plugin_server' AS 'plüg_dest'; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +plug test_plugin_server plüg_dest +DROP USER 'plug'; +CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd'; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +plüg_dest +DROP USER 'plüg_dest'; +SET NAMES utf8; +CREATE USER plüg IDENTIFIED WITH 'test_plügin_server' AS 'plüg_dest'; +ERROR HY000: Plugin 'test_plügin_server' is not loaded +CREATE USER 'plüg' IDENTIFIED WITH 'test_plugin_server' AS 'plüg_dest'; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +plüg test_plugin_server plüg_dest +DROP USER 'plüg'; +CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd'; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +plüg_dest +DROP USER 'plüg_dest'; +CREATE USER plüg IDENTIFIED WITH test_plugin_server AS 'plüg_dest'; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +plüg test_plugin_server plüg_dest +DROP USER plüg; +CREATE USER plüg_dest IDENTIFIED BY 'plug_dest_passwd'; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +plüg_dest +DROP USER plüg_dest; +========== test 1.1.1.2/1.1.2.2============================= +SET @auth_name= 'test_plugin_server'; +CREATE USER plug IDENTIFIED WITH @auth_name AS 'plug_dest'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@auth_name AS 'plug_dest'' at line 1 +SET @auth_string= 'plug_dest'; +CREATE USER plug IDENTIFIED WITH test_plugin_server AS @auth_string; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@auth_string' at line 1 +========== test 1.1.1.3/1.1.2.3============================= +CREATE USER plug IDENTIFIED WITH 'hh''s_test_plugin_server' AS 'plug_dest'; +ERROR HY000: Plugin 'hh's_test_plugin_server' is not loaded +CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'hh''s_plug_dest'; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +plug test_plugin_server hh's_plug_dest +DROP USER plug; +CREATE USER 'hh''s_plug_dest' IDENTIFIED BY 'plug_dest_passwd'; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +hh's_plug_dest +DROP USER 'hh''s_plug_dest'; +========== test 1.1.1.4 ==================================== +CREATE USER plug IDENTIFIED WITH hh''s_test_plugin_server AS 'plug_dest'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '''s_test_plugin_server AS 'plug_dest'' at line 1 +========== test 1.1.3.1 ==================================== +GRANT INSERT ON test_user_db.* TO grant_user IDENTIFIED WITH test_plugin_server AS 'plug_dest'; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +grant_user test_plugin_server plug_dest +CREATE USER plug_dest; +DROP USER plug_dest; +GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +grant_user test_plugin_server plug_dest +plug_dest +DROP USER grant_user,plug_dest; +set @save_sql_mode= @@sql_mode; +SET @@sql_mode=no_auto_create_user; +GRANT INSERT ON test_user_db.* TO grant_user IDENTIFIED WITH test_plugin_server AS 'plug_dest'; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +grant_user test_plugin_server plug_dest +CREATE USER plug_dest; +DROP USER plug_dest; +GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest; +ERROR 42000: Can't find any matching row in the user table +DROP USER grant_user; +GRANT INSERT ON test_user_db.* TO grant_user IDENTIFIED WITH test_plugin_server AS 'plug_dest'; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +grant_user test_plugin_server plug_dest +CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; +SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; +user plugin authentication_string password +grant_user test_plugin_server plug_dest +plug_dest *939AEE68989794C0F408277411C26055CDF41119 +DROP USER plug_dest; +GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_user_passwd'; +SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; +user plugin authentication_string password +grant_user test_plugin_server plug_dest +plug_dest *560881EB651416CEF77314D07D55EDCD5FC1BD6D +DROP USER grant_user,plug_dest; +set @@sql_mode= @save_sql_mode; +DROP DATABASE test_user_db; diff --git a/mysql-test/r/plugin_auth_qa_1.result b/mysql-test/r/plugin_auth_qa_1.result new file mode 100644 index 00000000000..00ee47b56b3 --- /dev/null +++ b/mysql-test/r/plugin_auth_qa_1.result @@ -0,0 +1,335 @@ +CREATE DATABASE test_user_db; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +========== test 1.1.3.2 ==================================== +CREATE USER plug_user IDENTIFIED WITH test_plugin_server AS 'plug_dest'; +CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; +GRANT PROXY ON plug_dest TO plug_user; +current_user() +plug_dest@% +user() +plug_user@localhost +Tables_in_test_user_db +t1 +REVOKE PROXY ON plug_dest FROM plug_user; +ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES) +DROP USER plug_user,plug_dest; +GRANT ALL PRIVILEGES ON test_user_db.* TO plug_user +IDENTIFIED WITH test_plugin_server AS 'plug_dest'; +GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_passwd'; +GRANT PROXY ON plug_dest TO plug_user; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +plug_dest +plug_user test_plugin_server plug_dest +1) +current_user() +plug_dest@% +user() +plug_user@localhost +Tables_in_test_user_db +t1 +REVOKE ALL PRIVILEGES ON test_user_db.* FROM 'plug_user' + IDENTIFIED WITH test_plugin_server AS 'plug_dest'; +2) +current_user() +plug_dest@% +user() +plug_user@localhost +Tables_in_test_user_db +t1 +REVOKE PROXY ON plug_dest FROM plug_user; +3) +ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES) +DROP USER plug_user,plug_dest; +GRANT ALL PRIVILEGES ON test_user_db.* TO plug_user +IDENTIFIED WITH test_plugin_server AS 'plug_dest'; +CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; +1) +ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES) +GRANT PROXY ON plug_dest TO plug_user; +2) +current_user() +plug_dest@% +user() +plug_user@localhost +Tables_in_test_user_db +t1 +REVOKE ALL PRIVILEGES ON test_user_db.* FROM 'plug_user' + IDENTIFIED WITH test_plugin_server AS 'plug_dest'; +DROP USER plug_user,plug_dest; +========== test 1.2 ======================================== +GRANT ALL PRIVILEGES ON test_user_db.* TO plug_user +IDENTIFIED WITH test_plugin_server AS 'plug_dest'; +CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; +GRANT PROXY ON plug_dest TO plug_user; +current_user() +plug_dest@% +user() +plug_user@localhost +RENAME USER plug_dest TO new_dest; +ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES) +GRANT PROXY ON new_dest TO plug_user; +ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES) +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +new_dest +plug_user test_plugin_server plug_dest +DROP USER plug_user,new_dest; +CREATE USER plug_user +IDENTIFIED WITH test_plugin_server AS 'plug_dest'; +CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; +ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES) +GRANT PROXY ON plug_dest TO plug_user; +current_user() +plug_dest@% +user() +plug_user@localhost +RENAME USER plug_dest TO new_dest; +ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES) +GRANT PROXY ON new_dest TO plug_user; +ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES) +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +new_dest +plug_user test_plugin_server plug_dest +DROP USER plug_user,new_dest; +CREATE USER plug_user +IDENTIFIED WITH test_plugin_server AS 'plug_dest'; +CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; +GRANT PROXY ON plug_dest TO plug_user; +connect(plug_user,localhost,plug_user,plug_dest); +select USER(),CURRENT_USER(); +USER() CURRENT_USER() +plug_user@localhost plug_dest@% +connection default; +disconnect plug_user; +RENAME USER plug_user TO new_user; +connect(plug_user,localhost,new_user,plug_dest); +select USER(),CURRENT_USER(); +USER() CURRENT_USER() +new_user@localhost plug_dest@% +connection default; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +new_user test_plugin_server plug_dest +plug_dest +disconnect plug_user; +UPDATE mysql.user SET user='plug_user' WHERE user='new_user'; +FLUSH PRIVILEGES; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +plug_dest +plug_user test_plugin_server plug_dest +DROP USER plug_dest,plug_user; +========== test 1.3 ======================================== +CREATE USER plug_user +IDENTIFIED WITH test_plugin_server AS 'plug_dest'; +CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; +GRANT PROXY ON plug_dest TO plug_user; +connect(plug_user,localhost,plug_user,plug_dest); +select USER(),CURRENT_USER(); +USER() CURRENT_USER() +plug_user@localhost plug_dest@% +connection default; +disconnect plug_user; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +plug_dest +plug_user test_plugin_server plug_dest +UPDATE mysql.user SET user='new_user' WHERE user='plug_user'; +FLUSH PRIVILEGES; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +new_user test_plugin_server plug_dest +plug_dest +UPDATE mysql.user SET authentication_string='new_dest' WHERE user='new_user'; +FLUSH PRIVILEGES; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +new_user test_plugin_server new_dest +plug_dest +UPDATE mysql.user SET plugin='new_plugin_server' WHERE user='new_user'; +FLUSH PRIVILEGES; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +new_user new_plugin_server new_dest +plug_dest +connect(plug_user,localhost,new_user,new_dest); +ERROR HY000: Plugin 'new_plugin_server' is not loaded +UPDATE mysql.user SET plugin='test_plugin_server' WHERE user='new_user'; +UPDATE mysql.user SET USER='new_dest' WHERE user='plug_dest'; +FLUSH PRIVILEGES; +GRANT PROXY ON new_dest TO new_user; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +new_dest +new_user test_plugin_server new_dest +connect(plug_user,localhost,new_user,new_dest); +select USER(),CURRENT_USER(); +USER() CURRENT_USER() +new_user@localhost new_dest@% +connection default; +disconnect plug_user; +UPDATE mysql.user SET USER='plug_dest' WHERE user='new_dest'; +FLUSH PRIVILEGES; +CREATE USER new_dest IDENTIFIED BY 'new_dest_passwd'; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +new_dest +new_user test_plugin_server new_dest +plug_dest +GRANT ALL PRIVILEGES ON test.* TO new_user; +connect(plug_user,localhost,new_dest,new_dest_passwd); +select USER(),CURRENT_USER(); +USER() CURRENT_USER() +new_dest@localhost new_dest@% +connection default; +disconnect plug_user; +DROP USER new_user,new_dest,plug_dest; +========== test 2, 2.1, 2.2 ================================ +CREATE USER ''@'' IDENTIFIED WITH test_plugin_server AS 'proxied_user'; +CREATE USER proxied_user IDENTIFIED BY 'proxied_user_passwd'; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string + test_plugin_server proxied_user +proxied_user +connect(proxy_con,localhost,proxied_user,proxied_user_passwd); +SELECT USER(),CURRENT_USER(); +USER() CURRENT_USER() +proxied_user@localhost proxied_user@% +========== test 2.2.1 ====================================== +SELECT @@proxy_user; +@@proxy_user +NULL +connection default; +disconnect proxy_con; +connect(proxy_con,localhost,proxy_user,proxied_user); +ERROR 28000: Access denied for user 'proxy_user'@'localhost' (using password: YES) +GRANT PROXY ON proxied_user TO ''@''; +connect(proxy_con,localhost,proxied_user,proxied_user_passwd); +SELECT USER(),CURRENT_USER(); +USER() CURRENT_USER() +proxied_user@localhost proxied_user@% +connection default; +disconnect proxy_con; +connect(proxy_con,localhost,proxy_user,proxied_user); +SELECT USER(),CURRENT_USER(); +USER() CURRENT_USER() +proxy_user@localhost proxied_user@% +========== test 2.2.1 ====================================== +SELECT @@proxy_user; +@@proxy_user +''@'' +connection default; +disconnect proxy_con; +DROP USER ''@'',proxied_user; +GRANT ALL PRIVILEGES ON test_user_db.* TO ''@'' +IDENTIFIED WITH test_plugin_server AS 'proxied_user'; +CREATE USER proxied_user IDENTIFIED BY 'proxied_user_passwd'; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string + test_plugin_server proxied_user +proxied_user +connect(proxy_con,localhost,proxied_user,proxied_user_passwd); +SELECT USER(),CURRENT_USER(); +USER() CURRENT_USER() +proxied_user@localhost proxied_user@% +SELECT @@proxy_user; +@@proxy_user +NULL +connection default; +disconnect proxy_con; +connect(proxy_con,localhost,proxy_user,proxied_user); +ERROR 28000: Access denied for user 'proxy_user'@'localhost' (using password: YES) +GRANT PROXY ON proxied_user TO ''@''; +connect(proxy_con,localhost,proxied_user,proxied_user_passwd); +SELECT USER(),CURRENT_USER(); +USER() CURRENT_USER() +proxied_user@localhost proxied_user@% +connection default; +disconnect proxy_con; +connect(proxy_con,localhost,proxy_user,proxied_user); +SELECT USER(),CURRENT_USER(); +USER() CURRENT_USER() +proxy_user@localhost proxied_user@% +SELECT @@proxy_user; +@@proxy_user +''@'' +connection default; +disconnect proxy_con; +DROP USER ''@'',proxied_user; +CREATE USER ''@'' IDENTIFIED WITH test_plugin_server AS 'proxied_user'; +CREATE USER proxied_user_1 IDENTIFIED BY 'proxied_user_1_pwd'; +CREATE USER proxied_user_2 IDENTIFIED BY 'proxied_user_2_pwd'; +CREATE USER proxied_user_3 IDENTIFIED BY 'proxied_user_3_pwd'; +CREATE USER proxied_user_4 IDENTIFIED BY 'proxied_user_4_pwd'; +CREATE USER proxied_user_5 IDENTIFIED BY 'proxied_user_5_pwd'; +GRANT PROXY ON proxied_user_1 TO ''@''; +GRANT PROXY ON proxied_user_2 TO ''@''; +GRANT PROXY ON proxied_user_3 TO ''@''; +GRANT PROXY ON proxied_user_4 TO ''@''; +GRANT PROXY ON proxied_user_5 TO ''@''; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string + test_plugin_server proxied_user +proxied_user_1 +proxied_user_2 +proxied_user_3 +proxied_user_4 +proxied_user_5 +connect(proxy_con_1,localhost,proxied_user_1,'proxied_user_1_pwd'); +connect(proxy_con_2,localhost,proxied_user_2,proxied_user_2_pwd); +connect(proxy_con_3,localhost,proxied_user_3,proxied_user_3_pwd); +connect(proxy_con_4,localhost,proxied_user_4,proxied_user_4_pwd); +connect(proxy_con_5,localhost,proxied_user_5,proxied_user_5_pwd); +connection proxy_con_1; +SELECT USER(),CURRENT_USER(); +USER() CURRENT_USER() +proxied_user_1@localhost proxied_user_1@% +SELECT @@proxy_user; +@@proxy_user +NULL +connection proxy_con_2; +SELECT USER(),CURRENT_USER(); +USER() CURRENT_USER() +proxied_user_2@localhost proxied_user_2@% +SELECT @@proxy_user; +@@proxy_user +NULL +connection proxy_con_3; +SELECT USER(),CURRENT_USER(); +USER() CURRENT_USER() +proxied_user_3@localhost proxied_user_3@% +SELECT @@proxy_user; +@@proxy_user +NULL +connection proxy_con_4; +SELECT USER(),CURRENT_USER(); +USER() CURRENT_USER() +proxied_user_4@localhost proxied_user_4@% +SELECT @@proxy_user; +@@proxy_user +NULL +connection proxy_con_5; +SELECT USER(),CURRENT_USER(); +USER() CURRENT_USER() +proxied_user_5@localhost proxied_user_5@% +SELECT @@proxy_user; +@@proxy_user +NULL +connection default; +disconnect proxy_con_1; +disconnect proxy_con_2; +disconnect proxy_con_3; +disconnect proxy_con_4; +disconnect proxy_con_5; +DROP USER ''@'',proxied_user_1,proxied_user_2,proxied_user_3,proxied_user_4,proxied_user_5; +========== test 3 ========================================== +GRANT ALL PRIVILEGES ON *.* TO plug_user +IDENTIFIED WITH test_plugin_server AS 'plug_dest'; +CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; +GRANT PROXY ON plug_dest TO plug_user; +FLUSH PRIVILEGES; +DROP USER plug_user, plug_dest; +DROP DATABASE test_user_db; diff --git a/mysql-test/r/plugin_auth_qa_2.result b/mysql-test/r/plugin_auth_qa_2.result new file mode 100644 index 00000000000..99fe9c6f5a9 --- /dev/null +++ b/mysql-test/r/plugin_auth_qa_2.result @@ -0,0 +1,150 @@ +CREATE DATABASE test_user_db; +========== test 1.1.3.2 ==================================== +=== check contens of components of info ==================== +CREATE USER qa_test_1_user IDENTIFIED WITH qa_auth_interface AS 'qa_test_1_dest'; +CREATE USER qa_test_1_dest IDENTIFIED BY 'dest_passwd'; +GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_1_dest identified by 'dest_passwd'; +GRANT PROXY ON qa_test_1_dest TO qa_test_1_user; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +qa_test_1_dest +qa_test_1_user qa_auth_interface qa_test_1_dest +SELECT @@proxy_user; +@@proxy_user +NULL +SELECT @@external_user; +@@external_user +NULL +exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT -u qa_test_1_user --password=qa_test_1_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +current_user() user() @@local.proxy_user @@local.external_user +qa_test_1_user@% qa_test_1_user@localhost NULL NULL +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +qa_test_1_dest +qa_test_1_user qa_auth_interface qa_test_1_dest +DROP USER qa_test_1_user; +DROP USER qa_test_1_dest; +=== Assign values to components of info ==================== +CREATE USER qa_test_2_user IDENTIFIED WITH qa_auth_interface AS 'qa_test_2_dest'; +CREATE USER qa_test_2_dest IDENTIFIED BY 'dest_passwd'; +CREATE USER authenticated_as IDENTIFIED BY 'dest_passwd'; +GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_2_dest identified by 'dest_passwd'; +GRANT PROXY ON qa_test_2_dest TO qa_test_2_user; +GRANT PROXY ON authenticated_as TO qa_test_2_user; +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +authenticated_as +qa_test_2_dest +qa_test_2_user qa_auth_interface qa_test_2_dest +SELECT @@proxy_user; +@@proxy_user +NULL +SELECT @@external_user; +@@external_user +NULL +exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT -u qa_test_2_user --password=qa_test_2_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +current_user() user() @@local.proxy_user @@local.external_user +authenticated_as@% user_name@localhost 'qa_test_2_user'@'%' 'qa_test_2_user'@'%' +SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; +user plugin authentication_string +authenticated_as +qa_test_2_dest +qa_test_2_user qa_auth_interface qa_test_2_dest +DROP USER qa_test_2_user; +DROP USER qa_test_2_dest; +DROP USER authenticated_as; +=== Assign too high values for *length, which should have no effect ==== +CREATE USER qa_test_3_user IDENTIFIED WITH qa_auth_interface AS 'qa_test_3_dest'; +CREATE USER qa_test_3_dest IDENTIFIED BY 'dest_passwd'; +GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_3_dest identified by 'dest_passwd'; +GRANT PROXY ON qa_test_3_dest TO qa_test_3_user; +exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT -u qa_test_3_user --password=qa_test_3_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +current_user() user() @@local.proxy_user @@local.external_user +qa_test_3_dest@% qa_test_3_user@localhost 'qa_test_3_user'@'%' 'qa_test_3_user'@'%' +DROP USER qa_test_3_user; +DROP USER qa_test_3_dest; +=== Assign too low values for *length, which should have no effect ==== +CREATE USER qa_test_4_user IDENTIFIED WITH qa_auth_interface AS 'qa_test_4_dest'; +CREATE USER qa_test_4_dest IDENTIFIED BY 'dest_passwd'; +GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_4_dest identified by 'dest_passwd'; +GRANT PROXY ON qa_test_4_dest TO qa_test_4_user; +exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT -u qa_test_4_user --password=qa_test_4_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +current_user() user() @@local.proxy_user @@local.external_user +qa_test_4_dest@% qa_test_4_user@localhost 'qa_test_4_user'@'%' 'qa_test_4_user'@'%' +DROP USER qa_test_4_user; +DROP USER qa_test_4_dest; +=== Assign empty string especially to authenticated_as (in plugin) ==== +CREATE USER qa_test_5_user IDENTIFIED WITH qa_auth_interface AS 'qa_test_5_dest'; +CREATE USER qa_test_5_dest IDENTIFIED BY 'dest_passwd'; +CREATE USER ''@'localhost' IDENTIFIED BY 'dest_passwd'; +GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_5_dest identified by 'dest_passwd'; +GRANT ALL PRIVILEGES ON test_user_db.* TO ''@'localhost' identified by 'dest_passwd'; +GRANT PROXY ON qa_test_5_dest TO qa_test_5_user; +GRANT PROXY ON qa_test_5_dest TO ''@'localhost'; +SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; +user plugin authentication_string password + *DFCACE76914AD7BD801FC1A1ECF6562272621A22 +qa_test_5_dest *DFCACE76914AD7BD801FC1A1ECF6562272621A22 +qa_test_5_user qa_auth_interface qa_test_5_dest +exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT --user=qa_test_5_user --password=qa_test_5_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +ERROR 1045 (28000): Access denied for user 'qa_test_5_user'@'localhost' (using password: YES) +DROP USER qa_test_5_user; +DROP USER qa_test_5_dest; +DROP USER ''@'localhost'; +=== Assign 'root' especially to authenticated_as (in plugin) ==== +CREATE USER qa_test_6_user IDENTIFIED WITH qa_auth_interface AS 'qa_test_6_dest'; +CREATE USER qa_test_6_dest IDENTIFIED BY 'dest_passwd'; +GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_6_dest identified by 'dest_passwd'; +GRANT PROXY ON qa_test_6_dest TO qa_test_6_user; +SELECT user,plugin,authentication_string,password FROM mysql.user; +user plugin authentication_string password +qa_test_6_dest *DFCACE76914AD7BD801FC1A1ECF6562272621A22 +qa_test_6_user qa_auth_interface qa_test_6_dest +root +root +root +root +exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT --user=qa_test_6_user --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +ERROR 1045 (28000): Access denied for user 'qa_test_6_user'@'localhost' (using password: YES) +GRANT PROXY ON qa_test_6_dest TO root IDENTIFIED WITH qa_auth_interface AS 'qa_test_6_dest'; +SELECT user,plugin,authentication_string,password FROM mysql.user; +user plugin authentication_string password +qa_test_6_dest *DFCACE76914AD7BD801FC1A1ECF6562272621A22 +qa_test_6_user qa_auth_interface qa_test_6_dest +root +root +root +root +root qa_auth_interface qa_test_6_dest +exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT --user=root --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) +REVOKE PROXY ON qa_test_6_dest FROM root; +SELECT user,plugin,authentication_string FROM mysql.user; +user plugin authentication_string +qa_test_6_dest +qa_test_6_user qa_auth_interface qa_test_6_dest +root +root +root +root +root qa_auth_interface qa_test_6_dest +exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT --user=root --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) +DROP USER qa_test_6_user; +DROP USER qa_test_6_dest; +DELETE FROM mysql.user WHERE user='root' AND plugin='qa_auth_interface'; +SELECT user,plugin,authentication_string,password FROM mysql.user; +user plugin authentication_string password +root +root +root +root +=== Test of the --default_auth option for clients ==== +CREATE USER qa_test_11_user IDENTIFIED WITH qa_auth_interface AS 'qa_test_11_dest'; +CREATE USER qa_test_11_dest IDENTIFIED BY 'dest_passwd'; +GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_11_dest identified by 'dest_passwd'; +GRANT PROXY ON qa_test_11_dest TO qa_test_11_user; +exec MYSQL PLUGIN_AUTH_OPT --default_auth=qa_auth_client -h localhost -P MASTER_MYPORT -u qa_test_11_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +ERROR 1045 (28000): Access denied for user 'qa_test_11_user'@'localhost' (using password: YES) +DROP USER qa_test_11_user, qa_test_11_dest; +DROP DATABASE test_user_db; diff --git a/mysql-test/r/plugin_auth_qa_3.result b/mysql-test/r/plugin_auth_qa_3.result new file mode 100644 index 00000000000..d94d8879e7d --- /dev/null +++ b/mysql-test/r/plugin_auth_qa_3.result @@ -0,0 +1,11 @@ +CREATE DATABASE test_user_db; +CREATE USER qa_test_11_user IDENTIFIED WITH qa_auth_server AS 'qa_test_11_dest'; +GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_11_dest identified by 'dest_passwd'; +GRANT PROXY ON qa_test_11_dest TO qa_test_11_user; +exec MYSQL PLUGIN_AUTH_OPT --default_auth=qa_auth_client -h localhost -P MASTER_MYPORT -u qa_test_11_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +current_user() user() @@local.proxy_user @@local.external_user +qa_test_11_dest@% qa_test_11_user@localhost 'qa_test_11_user'@'%' 'qa_test_11_user'@'%' +exec MYSQL PLUGIN_AUTH_OPT --default_auth=qa_auth_client -h localhost -P MASTER_MYPORT -u qa_test_2_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +ERROR 1045 (28000): Access denied for user 'qa_test_2_user'@'localhost' (using password: NO) +DROP USER qa_test_11_user, qa_test_11_dest; +DROP DATABASE test_user_db; diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 33282823931..17f639cdca3 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -3202,6 +3202,510 @@ test1 DROP PROCEDURE p1; DROP PROCEDURE p2; +TINYINT + +CREATE PROCEDURE p1(OUT v TINYINT) +SET v = 127; +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` bigint(20) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = 127; +@a @a = 127 +127 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +SMALLINT + +CREATE PROCEDURE p1(OUT v SMALLINT) +SET v = 32767; +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` bigint(20) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = 32767; +@a @a = 32767 +32767 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +MEDIUMINT + +CREATE PROCEDURE p1(OUT v MEDIUMINT) +SET v = 8388607; +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` bigint(20) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = 8388607; +@a @a = 8388607 +8388607 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +INT + +CREATE PROCEDURE p1(OUT v INT) +SET v = 2147483647; +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` bigint(20) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = 2147483647; +@a @a = 2147483647 +2147483647 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +BIGINT + +CREATE PROCEDURE p1(OUT v BIGINT) +SET v = 9223372036854775807; +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` bigint(20) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = 9223372036854775807; +@a @a = 9223372036854775807 +9223372036854775807 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +BIT(11) + +CREATE PROCEDURE p1(OUT v BIT(11)) +SET v = b'10100100101'; +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` bigint(20) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = b'10100100101'; +@a @a = b'10100100101' +1317 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +TIMESTAMP + +CREATE PROCEDURE p1(OUT v TIMESTAMP) +SET v = '2007-11-18 15:01:02'; +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = '2007-11-18 15:01:02'; +@a @a = '2007-11-18 15:01:02' +2007-11-18 15:01:02 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +DATETIME + +CREATE PROCEDURE p1(OUT v DATETIME) +SET v = '1234-11-12 12:34:59'; +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = '1234-11-12 12:34:59'; +@a @a = '1234-11-12 12:34:59' +1234-11-12 12:34:59 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +TIME + +CREATE PROCEDURE p1(OUT v TIME) +SET v = '123:45:01'; +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = '123:45:01'; +@a @a = '123:45:01' +123:45:01 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +DATE + +CREATE PROCEDURE p1(OUT v DATE) +SET v = '1234-11-12'; +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = '1234-11-12'; +@a @a = '1234-11-12' +1234-11-12 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +YEAR + +CREATE PROCEDURE p1(OUT v YEAR) +SET v = 2010; +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` bigint(20) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = 2010; +@a @a = 2010 +2010 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +FLOAT(7, 4) + +CREATE PROCEDURE p1(OUT v FLOAT(7, 4)) +SET v = 123.4567; +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` double DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a - 123.4567 < 0.00001; +@a @a - 123.4567 < 0.00001 +123.45670318603516 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +DOUBLE(8, 5) + +CREATE PROCEDURE p1(OUT v DOUBLE(8, 5)) +SET v = 123.45678; +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` double DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a - 123.45678 < 0.000001; +@a @a - 123.45678 < 0.000001 +123.45678 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +DECIMAL(9, 6) + +CREATE PROCEDURE p1(OUT v DECIMAL(9, 6)) +SET v = 123.456789; +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` decimal(65,30) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = 123.456789; +@a @a = 123.456789 +123.456789 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +CHAR(32) + +CREATE PROCEDURE p1(OUT v CHAR(32)) +SET v = REPEAT('a', 16); +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = REPEAT('a', 16); +@a @a = REPEAT('a', 16) +aaaaaaaaaaaaaaaa 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +VARCHAR(32) + +CREATE PROCEDURE p1(OUT v VARCHAR(32)) +SET v = REPEAT('b', 16); +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = REPEAT('b', 16); +@a @a = REPEAT('b', 16) +bbbbbbbbbbbbbbbb 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +TINYTEXT + +CREATE PROCEDURE p1(OUT v TINYTEXT) +SET v = REPEAT('c', 16); +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = REPEAT('c', 16); +@a @a = REPEAT('c', 16) +cccccccccccccccc 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +TEXT + +CREATE PROCEDURE p1(OUT v TEXT) +SET v = REPEAT('d', 16); +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = REPEAT('d', 16); +@a @a = REPEAT('d', 16) +dddddddddddddddd 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +MEDIUMTEXT + +CREATE PROCEDURE p1(OUT v MEDIUMTEXT) +SET v = REPEAT('e', 16); +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = REPEAT('e', 16); +@a @a = REPEAT('e', 16) +eeeeeeeeeeeeeeee 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +LONGTEXT + +CREATE PROCEDURE p1(OUT v LONGTEXT) +SET v = REPEAT('f', 16); +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = REPEAT('f', 16); +@a @a = REPEAT('f', 16) +ffffffffffffffff 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +BINARY(32) + +CREATE PROCEDURE p1(OUT v BINARY(32)) +SET v = REPEAT('g', 32); +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = REPEAT('g', 32); +@a @a = REPEAT('g', 32) +gggggggggggggggggggggggggggggggg 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +VARBINARY(32) + +CREATE PROCEDURE p1(OUT v VARBINARY(32)) +SET v = REPEAT('h', 16); +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = REPEAT('h', 16); +@a @a = REPEAT('h', 16) +hhhhhhhhhhhhhhhh 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +TINYBLOB + +CREATE PROCEDURE p1(OUT v TINYBLOB) +SET v = REPEAT('i', 16); +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = REPEAT('i', 16); +@a @a = REPEAT('i', 16) +iiiiiiiiiiiiiiii 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +BLOB + +CREATE PROCEDURE p1(OUT v BLOB) +SET v = REPEAT('j', 16); +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = REPEAT('j', 16); +@a @a = REPEAT('j', 16) +jjjjjjjjjjjjjjjj 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +MEDIUMBLOB + +CREATE PROCEDURE p1(OUT v MEDIUMBLOB) +SET v = REPEAT('k', 16); +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = REPEAT('k', 16); +@a @a = REPEAT('k', 16) +kkkkkkkkkkkkkkkk 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +LONGBLOB + +CREATE PROCEDURE p1(OUT v LONGBLOB) +SET v = REPEAT('l', 16); +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = REPEAT('l', 16); +@a @a = REPEAT('l', 16) +llllllllllllllll 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +SET('aaa', 'bbb') + +CREATE PROCEDURE p1(OUT v SET('aaa', 'bbb')) +SET v = 'aaa'; +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = 'aaa'; +@a @a = 'aaa' +aaa 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + +ENUM('aaa', 'bbb') + +CREATE PROCEDURE p1(OUT v ENUM('aaa', 'bbb')) +SET v = 'aaa'; +PREPARE stmt1 FROM 'CALL p1(?)'; +EXECUTE stmt1 USING @a; +CREATE TEMPORARY TABLE tmp1 AS SELECT @a AS c1; +SHOW CREATE TABLE tmp1; +Table Create Table +tmp1 CREATE TEMPORARY TABLE `tmp1` ( + `c1` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT @a, @a = 'aaa'; +@a @a = 'aaa' +aaa 1 +DROP TEMPORARY TABLE tmp1; +DROP PROCEDURE p1; + # End of WL#4435. # # WL#4284: Transactional DDL locking diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 96979d257f1..a345a2ae6aa 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -4887,3 +4887,22 @@ col_int_key DROP VIEW view_t1; DROP TABLE t1; # End of test BUG#54515 +# +# Bug #57203 Assertion `field_length <= 255' failed. +# +SELECT coalesce((avg(distinct (geomfromtext("point(25379 -22010)"))))) +UNION ALL +SELECT coalesce((avg(distinct (geomfromtext("point(25379 -22010)"))))) +AS foo +; +coalesce((avg(distinct (geomfromtext("point(25379 -22010)"))))) +0.0000 +0.0000 +CREATE table t1(a text); +INSERT INTO t1 VALUES (''), (''); +SELECT avg(distinct(t1.a)) FROM t1, t1 t2 +GROUP BY t2.a ORDER BY t1.a; +avg(distinct(t1.a)) +0 +DROP TABLE t1; +# End of test BUG#57203 diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index c1a75281e0e..5e41e6b29c6 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -1514,3 +1514,27 @@ ALTER TABLE t1 CHARACTER SET = utf8; COMMIT; DROP TRIGGER t1_bi; DROP TABLE t1; +# +# Bug#57306 SHOW PROCESSLIST does not display string literals well. +# +SET NAMES latin1; +SELECT GET_LOCK('t', 1000); +GET_LOCK('t', 1000) +1 +SET NAMES latin1; +SELECT GET_LOCK('t',1000) AS 'óóóó';; +SHOW PROCESSLIST; +Id User Host db Command Time State Info +### root ### test Query ### ### SHOW PROCESSLIST +### root ### test Query ### ### SELECT GET_LOCK('t',1000) AS 'óóóó' +SET NAMES utf8; +SHOW PROCESSLIST; +Id User Host db Command Time State Info +### root ### test Query ### ### SHOW PROCESSLIST +### root ### test Query ### ### SELECT GET_LOCK('t',1000) AS 'óóóó' +SELECT RELEASE_LOCK('t'); +RELEASE_LOCK('t') +1 +óóóó +1 +SET NAMES latin1; diff --git a/mysql-test/r/signal.result b/mysql-test/r/signal.result index 67bf9330451..cfa056d5d13 100644 --- a/mysql-test/r/signal.result +++ b/mysql-test/r/signal.result @@ -1379,9 +1379,6 @@ MESSAGE_TEXT = msg, MYSQL_ERRNO = 1012; end $$ insert into t1 values (1), (2) $$ -Warnings: -Warning 1012 This trigger SIGNAL a warning, a=1 -Warning 1012 This trigger SIGNAL a warning, a=2 drop trigger t1_ai $$ create trigger t1_ai after insert on t1 for each row begin @@ -1416,11 +1413,7 @@ MESSAGE_TEXT = NEW.msg, MYSQL_ERRNO = NEW.errno; end $$ insert into t1 set errno=1012, msg='Warning message 1 in trigger' $$ -Warnings: -Warning 1012 Warning message 1 in trigger insert into t1 set errno=1013, msg='Warning message 2 in trigger' $$ -Warnings: -Warning 1013 Warning message 2 in trigger drop table t1 $$ drop table if exists t1 $$ drop procedure if exists p1 $$ diff --git a/mysql-test/r/sp-bugs.result b/mysql-test/r/sp-bugs.result index a88c89537e2..2425f40d9c2 100644 --- a/mysql-test/r/sp-bugs.result +++ b/mysql-test/r/sp-bugs.result @@ -75,4 +75,40 @@ CALL p1 (); ERROR HY000: Trigger does not exist DROP TABLE t1; DROP PROCEDURE p1; +# +# Bug#54375: Error in stored procedure leaves connection +# in different default schema +# +SET @@SQL_MODE = 'STRICT_ALL_TABLES'; +DROP DATABASE IF EXISTS db1; +CREATE DATABASE db1; +USE db1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (c1 int NOT NULL PRIMARY KEY); +INSERT INTO t1 VALUES (1); +CREATE FUNCTION f1 ( +some_value int +) +RETURNS smallint +DETERMINISTIC +BEGIN +INSERT INTO t1 SET c1 = some_value; +RETURN(LAST_INSERT_ID()); +END$$ +DROP DATABASE IF EXISTS db2; +CREATE DATABASE db2; +USE db2; +SELECT DATABASE(); +DATABASE() +db2 +SELECT db1.f1(1); +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +SELECT DATABASE(); +DATABASE() +db2 +USE test; +DROP FUNCTION db1.f1; +DROP TABLE db1.t1; +DROP DATABASE db1; +DROP DATABASE db2; End of 5.1 tests diff --git a/mysql-test/r/sp-destruct.result b/mysql-test/r/sp-destruct.result index 32d0e39c5af..a3c8574d141 100644 --- a/mysql-test/r/sp-destruct.result +++ b/mysql-test/r/sp-destruct.result @@ -150,3 +150,21 @@ Warnings: Error 1547 Column count of mysql.proc is wrong. Expected 20, found 19. The table is probably corrupted # Restore mysql.proc. drop table mysql.proc; +# +# Bug#58414 mysql_upgrade fails on dump upgrade between 5.1.53 -> 5.5.8 +# +DROP TABLE IF EXISTS proc_backup; +DROP DATABASE IF EXISTS db1; +# Backup the proc table +RENAME TABLE mysql.proc TO proc_backup; +CREATE TABLE mysql.proc LIKE proc_backup; +CREATE DATABASE db1; +CREATE PROCEDURE db1.p1() SET @foo = 10; +# Modify a field of the table. +ALTER TABLE mysql.proc MODIFY comment CHAR (32); +DROP DATABASE db1; +Warnings: +Error 1548 Cannot load from mysql.proc. The table is probably corrupted +# Restore mysql.proc +DROP TABLE mysql.proc; +RENAME TABLE proc_backup TO mysql.proc; diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result index 7b8364379df..4e97429c48f 100644 --- a/mysql-test/r/sp-error.result +++ b/mysql-test/r/sp-error.result @@ -1877,9 +1877,6 @@ DROP PROCEDURE p1; # # Bug#5889: Exit handler for a warning doesn't hide the warning in trigger # - -# - Case 1 - CREATE TABLE t1(a INT, b INT); INSERT INTO t1 VALUES (1, 2); CREATE TRIGGER t1_bu BEFORE UPDATE ON t1 FOR EACH ROW @@ -1889,40 +1886,13 @@ SET NEW.a = 10; SET NEW.a = 99999999999; END| UPDATE t1 SET b = 20; -Warnings: -Warning 1264 Out of range value for column 'a' at row 1 SHOW WARNINGS; Level Code Message -Warning 1264 Out of range value for column 'a' at row 1 SELECT * FROM t1; a b 10 20 DROP TRIGGER t1_bu; DROP TABLE t1; - -# - Case 2 - -CREATE TABLE t1(a INT); -CREATE TABLE t2(b CHAR(1)); -CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW -BEGIN -INSERT INTO t2 VALUES('ab'); # Produces a warning. -INSERT INTO t2 VALUES('b'); # Does not produce a warning, -# previous warning should be cleared. -END| -INSERT INTO t1 VALUES(0); -SHOW WARNINGS; -Level Code Message -SELECT * FROM t1; -a -0 -SELECT * FROM t2; -b -a -b -DROP TRIGGER t1_bi; -DROP TABLE t1; -DROP TABLE t2; # # Bug#9857: Stored procedures: handler for sqlwarning ignored # @@ -1961,3 +1931,64 @@ Warning 1365 Division by 0 DROP PROCEDURE p1; DROP PROCEDURE p2; SET sql_mode = @sql_mode_saved; +# +# Bug#55850: Trigger warnings not cleared. +# +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +DROP PROCEDURE IF EXISTS p1; +CREATE TABLE t1(x SMALLINT, y SMALLINT, z SMALLINT); +CREATE TABLE t2(a SMALLINT, b SMALLINT, c SMALLINT, +d SMALLINT, e SMALLINT, f SMALLINT); +CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW +INSERT INTO t2(a, b, c) VALUES(99999, 99999, 99999); +CREATE TRIGGER t1_ai AFTER INSERT ON t1 FOR EACH ROW +INSERT INTO t2(d, e, f) VALUES(99999, 99999, 99999); +CREATE PROCEDURE p1() +INSERT INTO t1 VALUES(99999, 99999, 99999); + +CALL p1(); +Warnings: +Warning 1264 Out of range value for column 'x' at row 1 +Warning 1264 Out of range value for column 'y' at row 1 +Warning 1264 Out of range value for column 'z' at row 1 + +SHOW WARNINGS; +Level Code Message +Warning 1264 Out of range value for column 'x' at row 1 +Warning 1264 Out of range value for column 'y' at row 1 +Warning 1264 Out of range value for column 'z' at row 1 + +DROP TABLE t1; +DROP TABLE t2; +DROP PROCEDURE p1; +# ---------------------------------------------------------------------- +CREATE TABLE t1(x SMALLINT, y SMALLINT, z SMALLINT); +CREATE TABLE t2(a SMALLINT, b SMALLINT, c SMALLINT NOT NULL); +CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW +BEGIN +INSERT INTO t2 VALUES( +CAST('111111 ' AS SIGNED), +CAST('222222 ' AS SIGNED), +NULL); +END| +CREATE PROCEDURE p1() +INSERT INTO t1 VALUES(99999, 99999, 99999); + +CALL p1(); +ERROR 23000: Column 'c' cannot be null + +SHOW WARNINGS; +Level Code Message +Warning 1264 Out of range value for column 'x' at row 1 +Warning 1264 Out of range value for column 'y' at row 1 +Warning 1264 Out of range value for column 'z' at row 1 +Warning 1292 Truncated incorrect INTEGER value: '111111 ' +Warning 1264 Out of range value for column 'a' at row 1 +Warning 1292 Truncated incorrect INTEGER value: '222222 ' +Warning 1264 Out of range value for column 'b' at row 1 +Error 1048 Column 'c' cannot be null + +DROP TABLE t1; +DROP TABLE t2; +DROP PROCEDURE p1; diff --git a/mysql-test/r/sp-lock.result b/mysql-test/r/sp-lock.result index 0d3e87f17e2..860312dca3e 100644 --- a/mysql-test/r/sp-lock.result +++ b/mysql-test/r/sp-lock.result @@ -735,5 +735,96 @@ END latin1 latin1_swedish_ci latin1_swedish_ci # Connection default; DROP PROCEDURE p1; # +# Bug#57663 Concurrent statement using stored function and DROP DATABASE +# breaks SBR +# +DROP DATABASE IF EXISTS db1; +DROP FUNCTION IF EXISTS f1; +# Test 1: Check that DROP DATABASE block if a function is used +# by an active transaction. +# Connection default +CREATE DATABASE db1; +CREATE FUNCTION db1.f1() RETURNS INTEGER RETURN 1; +START TRANSACTION; +SELECT db1.f1(); +db1.f1() +1 +# Connection con1 +# Sending: +DROP DATABASE db1; +# Connection default +# Waiting for DROP DATABASE to be blocked by the lock on f1() +COMMIT; +# Connection con1 +# Reaping: DROP DATABASE db1 +# Test 2: Check that DROP DATABASE blocks if a procedure is +# used by an active transaction. +# Connection default +CREATE DATABASE db1; +CREATE PROCEDURE db1.p1() BEGIN END; +CREATE FUNCTION f1() RETURNS INTEGER +BEGIN +CALL db1.p1(); +RETURN 1; +END| +START TRANSACTION; +SELECT f1(); +f1() +1 +# Connection con1 +# Sending: +DROP DATABASE db1; +# Connection default +# Waiting for DROP DATABASE to be blocked by the lock on p1() +COMMIT; +# Connection con1 +# Reaping: DROP DATABASE db1 +# Test 3: Check that DROP DATABASE is not selected as a victim if a +# deadlock is discovered with DML statements. +# Connection default +CREATE DATABASE db1; +CREATE TABLE db1.t1 (a INT); +CREATE FUNCTION db1.f1() RETURNS INTEGER RETURN 1; +START TRANSACTION; +SELECT db1.f1(); +db1.f1() +1 +# Connection con1 +# Sending: +DROP DATABASE db1; +# Connection default +# Waiting for DROP DATABASE to be blocked by the lock on f1() +SELECT * FROM db1.t1; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +COMMIT; +# Connection con1 +# Reaping: DROP DATABASE db1 +# Test 4: Check that active DROP DATABASE blocks stored routine DDL. +# Connection default +CREATE DATABASE db1; +CREATE FUNCTION db1.f1() RETURNS INTEGER RETURN 1; +CREATE FUNCTION db1.f2() RETURNS INTEGER RETURN 2; +START TRANSACTION; +SELECT db1.f2(); +db1.f2() +2 +# Connection con1 +# Sending: +DROP DATABASE db1; +# Connection con2 +# Waiting for DROP DATABASE to be blocked by the lock on f2() +# Sending: +ALTER FUNCTION db1.f1 COMMENT "test"; +# Connection default +# Waiting for ALTER FUNCTION to be blocked by the schema lock on db1 +COMMIT; +# Connection con1 +# Reaping: DROP DATABASE db1 +# Connection con2 +# Reaping: ALTER FUNCTION f1 COMMENT 'test' +ERROR 42000: FUNCTION db1.f1 does not exist +# Connection default +DROP FUNCTION f1; +# # End of 5.5 tests # diff --git a/mysql-test/r/sp-security.result b/mysql-test/r/sp-security.result index 4ea26d1021a..c09579b13eb 100644 --- a/mysql-test/r/sp-security.result +++ b/mysql-test/r/sp-security.result @@ -44,7 +44,7 @@ ERROR 42000: SELECT command denied to user 'user1'@'localhost' for table 't1' create procedure db1_secret.dummy() begin end; ERROR 42000: Access denied for user 'user1'@'localhost' to database 'db1_secret' drop procedure db1_secret.dummy; -ERROR 42000: PROCEDURE db1_secret.dummy does not exist +ERROR 42000: alter routine command denied to user 'user1'@'localhost' for routine 'db1_secret.dummy' drop procedure db1_secret.stamp; ERROR 42000: alter routine command denied to user 'user1'@'localhost' for routine 'db1_secret.stamp' drop function db1_secret.db; @@ -58,7 +58,7 @@ ERROR 42000: SELECT command denied to user ''@'localhost' for table 't1' create procedure db1_secret.dummy() begin end; ERROR 42000: Access denied for user ''@'%' to database 'db1_secret' drop procedure db1_secret.dummy; -ERROR 42000: PROCEDURE db1_secret.dummy does not exist +ERROR 42000: alter routine command denied to user ''@'%' for routine 'db1_secret.dummy' drop procedure db1_secret.stamp; ERROR 42000: alter routine command denied to user ''@'%' for routine 'db1_secret.stamp' drop function db1_secret.db; @@ -567,3 +567,28 @@ DROP USER 'tester'; DROP USER 'Tester'; DROP DATABASE B48872; End of 5.0 tests. +# +# Test for bug#57061 "User without privilege on routine can discover +# its existence." +# +drop database if exists mysqltest_db; +create database mysqltest_db; +# Create user with no privileges on mysqltest_db database. +create user bug57061_user@localhost; +create function mysqltest_db.f1() returns int return 0; +create procedure mysqltest_db.p1() begin end; +# Connect as user 'bug57061_user@localhost' +# Attempt to drop routine on which user doesn't have privileges +# should result in the same 'access denied' type of error whether +# routine exists or not. +drop function if exists mysqltest_db.f_does_not_exist; +ERROR 42000: alter routine command denied to user 'bug57061_user'@'localhost' for routine 'mysqltest_db.f_does_not_exist' +drop procedure if exists mysqltest_db.p_does_not_exist; +ERROR 42000: alter routine command denied to user 'bug57061_user'@'localhost' for routine 'mysqltest_db.p_does_not_exist' +drop function if exists mysqltest_db.f1; +ERROR 42000: alter routine command denied to user 'bug57061_user'@'localhost' for routine 'mysqltest_db.f1' +drop procedure if exists mysqltest_db.p1; +ERROR 42000: alter routine command denied to user 'bug57061_user'@'localhost' for routine 'mysqltest_db.p1' +# Connection 'default'. +drop user bug57061_user@localhost; +drop database mysqltest_db; diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 13941b56040..3136b5dfcc0 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -5005,3 +5005,15 @@ SELECT * FROM t2 UNION SELECT * FROM t2 ORDER BY (SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE)); DROP TABLE t1,t2; End of 5.1 tests +# +# Bug #57704: Cleanup code dies with void TABLE::set_keyread(bool): +# Assertion `file' failed. +# +CREATE TABLE t1 (a INT); +SELECT 1 FROM +(SELECT ROW( +(SELECT 1 FROM t1 RIGHT JOIN +(SELECT 1 FROM t1, t1 t2) AS d ON 1), +1) FROM t1) AS e; +ERROR 21000: Operand should contain 1 column(s) +DROP TABLE t1; diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result index e82cf229912..0028f2ce5c1 100644 --- a/mysql-test/r/system_mysql_db.result +++ b/mysql-test/r/system_mysql_db.result @@ -14,7 +14,7 @@ ndb_binlog_index plugin proc procs_priv -proxy_priv +proxies_priv servers slow_log tables_priv diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result index b9b1c94ce1a..b24c5b87fa0 100644 --- a/mysql-test/r/trigger.result +++ b/mysql-test/r/trigger.result @@ -1072,8 +1072,6 @@ SELECT @x; NULL SET @x=2; UPDATE t1 SET i1 = @x; -Warnings: -Warning 1365 Division by 0 SELECT @x; @x NULL @@ -1085,9 +1083,6 @@ SELECT @x; NULL SET @x=4; UPDATE t1 SET i1 = @x; -Warnings: -Warning 1365 Division by 0 -Warning 1365 Division by 0 SELECT @x; @x NULL @@ -1198,8 +1193,6 @@ Warnings: Warning 1365 Division by 0 create trigger t1_bi before insert on t1 for each row set @a:=1/0| insert into t1 values(20, 20)| -Warnings: -Warning 1365 Division by 0 drop trigger t1_bi| create trigger t1_bi before insert on t1 for each row begin @@ -1218,8 +1211,6 @@ set @a:=1/0; end| set @check=0, @t4_bi_called=0, @t4_bu_called=0| insert into t1 values(30, 30)| -Warnings: -Warning 1365 Division by 0 select @check, @t4_bi_called, @t4_bu_called| @check @t4_bi_called @t4_bu_called 2 1 1 @@ -2090,12 +2081,8 @@ SELECT 1 FROM t1 c WHERE END// SET @bug51650 = 1; INSERT IGNORE INTO t2 VALUES(); -Warnings: -Warning 1329 No data - zero rows fetched, selected, or processed INSERT IGNORE INTO t1 SET b = '777'; INSERT IGNORE INTO t2 SET a = '111'; -Warnings: -Warning 1329 No data - zero rows fetched, selected, or processed SET @bug51650 = 1; INSERT IGNORE INTO t2 SET a = '777'; DROP TRIGGER trg1; @@ -2177,8 +2164,6 @@ SELECT 'ab' INTO a; SELECT 'a' INTO a; END| INSERT INTO t1 VALUES (1); -Warnings: -Warning 1265 Data truncated for column 'a' at row 1 DROP TRIGGER trg1; DROP TABLE t1; DROP TRIGGER IF EXISTS trg1; @@ -2196,20 +2181,12 @@ DECLARE trg2 CHAR; SELECT 'ab' INTO trg2; END| INSERT INTO t1 VALUES (0); -Warnings: -Warning 1265 Data truncated for column 'trg1' at row 1 -Warning 1265 Data truncated for column 'trg2' at row 1 SELECT * FROM t1; a 0 SHOW WARNINGS; Level Code Message INSERT INTO t1 VALUES (1),(2); -Warnings: -Warning 1265 Data truncated for column 'trg1' at row 1 -Warning 1265 Data truncated for column 'trg2' at row 1 -Warning 1265 Data truncated for column 'trg1' at row 1 -Warning 1265 Data truncated for column 'trg2' at row 1 DROP TRIGGER trg1; DROP TRIGGER trg2; DROP TABLE t1; diff --git a/mysql-test/r/truncate_coverage.result b/mysql-test/r/truncate_coverage.result index a7a4b9c70f4..728702f7ab5 100644 --- a/mysql-test/r/truncate_coverage.result +++ b/mysql-test/r/truncate_coverage.result @@ -78,3 +78,30 @@ COMMIT; UNLOCK TABLES; DROP TABLE t1; SET DEBUG_SYNC='RESET'; +# +# Bug#57659 Segfault in Query_cache::invalidate_data for TRUNCATE TABLE +# +# Note that this test case only reproduces the problem +# when it is run with valgrind. +DROP TABLE IF EXISTS t1, m1; +CREATE TABLE t1(a INT) engine=memory; +CREATE TABLE m1(a INT) engine=merge UNION(t1); +# Connection con1 +SET DEBUG_SYNC= 'open_tables_after_open_and_process_table SIGNAL opened WAIT_FOR dropped'; +# Sending: +TRUNCATE TABLE m1; +# Connection con2 +SET DEBUG_SYNC= 'now WAIT_FOR opened'; +# Sending: +FLUSH TABLES; +# Connection default +# Waiting for FLUSH TABLES to be blocked. +SET DEBUG_SYNC= 'now SIGNAL dropped'; +# Connection con1 +# Reaping: TRUNCATE TABLE m1 +ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist +# Connection con2 +# Reaping: FLUSH TABLES +# Connection default +SET DEBUG_SYNC= 'RESET'; +DROP TABLE m1, t1; diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result index 78f31286ea7..e3363fcabf9 100644 --- a/mysql-test/r/type_blob.result +++ b/mysql-test/r/type_blob.result @@ -975,4 +975,14 @@ SELECT LENGTH(c) FROM t2; LENGTH(c) 65535 DROP TABLE t1, t2; +# Bug #52160: crash and inconsistent results when grouping +# by a function and column +CREATE FUNCTION f1() RETURNS TINYBLOB RETURN 1; +CREATE TABLE t1(a CHAR(1)); +INSERT INTO t1 VALUES ('0'), ('0'); +SELECT COUNT(*) FROM t1 GROUP BY f1(), a; +COUNT(*) +2 +DROP FUNCTION f1; +DROP TABLE t1; End of 5.1 tests diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result index bb441099b98..41345be5b8d 100644 --- a/mysql-test/r/type_date.result +++ b/mysql-test/r/type_date.result @@ -318,4 +318,12 @@ f1 date YES NULL f2 date YES NULL DROP TABLE t1; # +# +# Bug#57278: Crash on min/max + with date out of range. +# +set @a=(select min(makedate('111','1'))) ; +select @a; +@a +0111-01-01 +# End of 6.0 tests diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result index a680e837cae..e41a9bc7637 100644 --- a/mysql-test/r/user_var.result +++ b/mysql-test/r/user_var.result @@ -445,6 +445,9 @@ IF( count(*), 1) 1 DROP TABLE t1; +select @v:=@v:=sum(1) from dual; +@v:=@v:=sum(1) +1 End of 5.1 tests DROP TABLE IF EXISTS t1; CREATE TABLE t1(f1 INT AUTO_INCREMENT, PRIMARY KEY(f1)); diff --git a/mysql-test/r/variables-big.result b/mysql-test/r/variables-big.result index 960fc6d22f4..71b32393d82 100644 --- a/mysql-test/r/variables-big.result +++ b/mysql-test/r/variables-big.result @@ -1,20 +1,20 @@ SET SESSION transaction_prealloc_size=1024*1024*1024*1; SHOW PROCESSLIST; Id User Host db Command Time State Info - root localhost test Query