From: Ivan Suzdal Date: Wed, 6 Jul 2016 11:53:58 +0000 (+0300) Subject: Security update: X-Git-Tag: mos-9.0^0 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=6e960091521d83e66c9fcc4acb0d2045110511b4;p=packages%2Ftrusty%2Fmysql-wsrep-5.6.git Security update: * Update to 5.6.30 to fix security issues (LP: #1572559) - http://www.oracle.com/technetwork/security-advisory/cpuapr2016v3-2985753.html - http://www.ubuntu.com/usn/usn-2953-1 - CVE-2016-0639 - CVE-2016-0640 - CVE-2016-0641 - CVE-2016-0642 - CVE-2016-0643 - CVE-2016-0644 - CVE-2016-0646 - CVE-2016-0647 - CVE-2016-0648 - CVE-2016-0649 - CVE-2016-0650 - CVE-2016-0655 - CVE-2016-0661 - CVE-2016-0665 - CVE-2016-0666 - CVE-2016-0668 - CVE-2016-2047 Sourced from https://github.com/codership/mysql-wsrep/tree/wsrep_5.6.30-25.15 Change-Id: I1923a2a227c3fee1e07924e84faa358be6ea608f Related-Bug: #1578370 --- diff --git a/debian/README.source b/debian/README.source deleted file mode 100644 index 2060aa5c..00000000 --- a/debian/README.source +++ /dev/null @@ -1,21 +0,0 @@ -MySQL source package -==================== -The question arises why we have the mysql-source-* packages and why -they are arch:any wasting so much space. This conversation covered the -issue although it should probably be looked at again. - -(26/05/12 16:24:18) SpamapS: periapt: hey, are you 100% sure that mysql-source-5.5 is arch: all ? -(16:24:37) SpamapS: periapt: It includes generated files.. some of which might be arch specific. I've never taken the time to make sure. -(16:35:56) periapt: SpamapS: Actually that's a fair point - cmake output. But then I think we ought to drop it. I view it as duplication which I think is against Debian policy. -(16:44:04) periapt: It seems to be some sort of hangover from when the licensing issues were much worse. It's popcorn rating is almost lower than the arches we support. -(16:49:27) SpamapS: Nope, its needed for plugins -(16:49:39) SpamapS: It is only useful as a build-dep -(16:49:57) SpamapS: Now, I have been made aware of the fact that source format 3.0 allows multiple upstreams.. -(16:50:24) SpamapS: periapt: I created the package, and I use it as a build-dep for handlersocket. -(16:50:54) SpamapS: periapt: perhaps we should add handlersocket as a second upstream source. That would eliminate the need for it. -(16:55:21) periapt: SpamapS: I would advise against multiple upstream sources. I actually tried to write some debhelper stuff to maange it. I never got the uscan wrapper working and it's horrible: pkg-components. -(16:56:23) SpamapS: periapt: then we cannot remove the mysql-source-* packages -(16:56:57) periapt: I'll put it back to arch:any for now and update the long description. I notice there are already bugs that cover the issue of how to manage plugins. I think it should be revisited. -(16:57:30) SpamapS: periapt: perhaps the clarity from this discussion belongs in README.source too :) -(16:57:40) periapt: okay -(16:58:15) periapt: Actually I would prefer the FAQ: http://wiki.debian.org/Teams/MySQL/FAQ diff --git a/debian/additions/my.cnf b/debian/additions/my.cnf new file mode 100644 index 00000000..4df5bd08 --- /dev/null +++ b/debian/additions/my.cnf @@ -0,0 +1,127 @@ +# +# The MySQL database server configuration file. +# +# You can copy this to one of: +# - "/etc/mysql/my.cnf" to set global options, +# - "~/.my.cnf" to set user-specific options. +# +# One can use all long options that the program supports. +# Run program with --help to get a list of available options and with +# --print-defaults to see which it would actually understand and use. +# +# For explanations see +# http://dev.mysql.com/doc/mysql/en/server-system-variables.html + +# This will be passed to all mysql clients +# It has been reported that passwords should be enclosed with ticks/quotes +# escpecially if they contain "#" chars... +# Remember to edit /etc/mysql/debian.cnf when changing the socket location. +[client] +port = 3306 +socket = /var/run/mysqld/mysqld.sock + +# Here is entries for some specific programs +# The following values assume you have at least 32M ram + +# This was formally known as [safe_mysqld]. Both versions are currently parsed. +[mysqld_safe] +socket = /var/run/mysqld/mysqld.sock +nice = 0 + +[mysqld] +# +# * Basic Settings +# +user = mysql +pid-file = /var/run/mysqld/mysqld.pid +socket = /var/run/mysqld/mysqld.sock +port = 3306 +basedir = /usr +datadir = /var/lib/mysql +tmpdir = /tmp +lc-messages-dir = /usr/share/mysql +skip-external-locking +# +# Instead of skip-networking the default is now to listen only on +# localhost which is more compatible and is not less secure. +bind-address = 127.0.0.1 +# +# * Fine Tuning +# +key_buffer = 16M +max_allowed_packet = 16M +thread_stack = 192K +thread_cache_size = 8 +# This replaces the startup script and checks MyISAM tables if needed +# the first time they are touched +myisam-recover = BACKUP +#max_connections = 100 +#table_cache = 64 +#thread_concurrency = 10 +# +# * Query Cache Configuration +# +query_cache_limit = 1M +query_cache_size = 16M +# +# * Logging and Replication +# +# Both location gets rotated by the cronjob. +# Be aware that this log type is a performance killer. +# As of 5.1 you can enable the log at runtime! +#general_log_file = /var/log/mysql/mysql.log +#general_log = 1 +# +# Error log - should be very few entries. +# +log_error = /var/log/mysql/error.log +# +# Here you can see queries with especially long duration +#log_slow_queries = /var/log/mysql/mysql-slow.log +#long_query_time = 2 +#log-queries-not-using-indexes +# +# The following can be used as easy to replay backup logs or for replication. +# note: if you are setting up a replication slave, see README.Debian about +# other settings you may need to change. +#server-id = 1 +#log_bin = /var/log/mysql/mysql-bin.log +expire_logs_days = 10 +max_binlog_size = 100M +#binlog_do_db = include_database_name +#binlog_ignore_db = include_database_name +# +# * InnoDB +# +# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/. +# Read the manual for more InnoDB related options. There are many! +# +# * Security Features +# +# Read the manual, too, if you want chroot! +# chroot = /var/lib/mysql/ +# +# For generating SSL certificates I recommend the OpenSSL GUI "tinyca". +# +# ssl-ca=/etc/mysql/cacert.pem +# ssl-cert=/etc/mysql/server-cert.pem +# ssl-key=/etc/mysql/server-key.pem + + + +[mysqldump] +quick +quote-names +max_allowed_packet = 16M + +[mysql] +#no-auto-rehash # faster start of mysql but no tab completition + +[isamchk] +key_buffer = 16M + +# +# * IMPORTANT: Additional settings that can override those from this file! +# The files must end with '.cnf', otherwise they'll be ignored. +# +!includedir /etc/mysql/conf.d/ diff --git a/debian/apparmor-profile b/debian/apparmor-profile index 3e1f1b05..04272ac1 100644 --- a/debian/apparmor-profile +++ b/debian/apparmor-profile @@ -1,45 +1 @@ -# vim:syntax=apparmor -# Last Modified: Tue Jun 19 17:37:30 2007 -#include - -/usr/sbin/mysqld { - #include - #include - #include - #include - #include - - capability dac_override, - capability sys_resource, - capability setgid, - capability setuid, - - network tcp, - - /etc/hosts.allow r, - /etc/hosts.deny r, - - /etc/mysql/*.pem r, - /etc/mysql/conf.d/ r, - /etc/mysql/conf.d/* r, - /etc/mysql/*.cnf r, - /usr/lib/mysql/plugin/ r, - /usr/lib/mysql/plugin/*.so* mr, - /usr/sbin/mysqld mr, - /usr/share/mysql/** r, - /var/log/mysql.log rw, - /var/log/mysql.err rw, - /var/lib/mysql/ r, - /var/lib/mysql/** rwk, - /var/log/mysql/ r, - /var/log/mysql/* rw, - /var/run/mysqld/mysqld.pid rw, - /var/run/mysqld/mysqld.sock w, - /run/mysqld/mysqld.pid rw, - /run/mysqld/mysqld.sock w, - - /sys/devices/system/cpu/ r, - - # Site-specific additions and overrides. See local/README for details. - #include -} +# This file is intensionally empty to disable apparmor by default diff --git a/debian/changelog b/debian/changelog index 53896f0e..e86798b7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,43 @@ +mysql-wsrep-5.6 (5.6.30-0~u14.04+mos1) mos; urgency=high + + * SECURITY UPDATE: Update to 5.6.30 to fix security issues (LP: #1572559) + * Closes: #1578370 + - http://www.oracle.com/technetwork/security-advisory/cpuapr2016v3-2985753.html + - http://www.ubuntu.com/usn/usn-2953-1 + - CVE-2016-0639 + - CVE-2016-0640 + - CVE-2016-0641 + - CVE-2016-0642 + - CVE-2016-0643 + - CVE-2016-0644 + - CVE-2016-0646 + - CVE-2016-0647 + - CVE-2016-0648 + - CVE-2016-0649 + - CVE-2016-0650 + - CVE-2016-0655 + - CVE-2016-0661 + - CVE-2016-0665 + - CVE-2016-0666 + - CVE-2016-0668 + - CVE-2016-2047 + + Sourced from https://github.com/codership/mysql-wsrep/tree/wsrep_5.6.30-25.15 + + -- Ivan Suzdal Thu, 09 Jun 2016 15:21:53 +0000 + +mysql-wsrep-5.6 (5.6.23-1~u14.04+mos3) mos9.0; urgency=medium + + * Reverting temporary fix for LP Bug 1541338 as it's not RC + + -- Sergii Golovatiuk Sat, 26 Mar 2016 13:19:00 +0100 + +mysql-wsrep-5.6 (5.6.23-1~u14.04+mos2) mos9.0; urgency=medium + + * Temporary fix for LP Bug 1541338 + + -- Dmitry Bilunov Wed, 23 Mar 2016 13:54:00 +0300 + mysql-wsrep-5.6 (5.6.23-1~u14.04+mos1) mos7.0; urgency=medium * Update to MySQL 5.6.23: diff --git a/debian/control b/debian/control index ad3d7b68..9272a803 100644 --- a/debian/control +++ b/debian/control @@ -1,7 +1,7 @@ Source: mysql-wsrep-5.6 Section: database Priority: optional -Maintainer: MOS Linux team +Maintainer: MOS Linux team XSBC-Orig-Maintainer: Debian MySQL Maintainers Build-Depends: bison, @@ -19,7 +19,9 @@ Build-Depends: perl, po-debconf, psmisc, - zlib1g-dev (>= 1:1.1.3-5) + zlib1g-dev (>= 1:1.1.3-5), + libssl-dev, + libedit-dev Standards-Version: 3.9.3 Homepage: http://dev.mysql.com/ Vcs-Git: git://git.debian.org/git/pkg-mysql/mysql-5.6.git diff --git a/debian/gbp.conf b/debian/gbp.conf new file mode 100644 index 00000000..7ade7b1a --- /dev/null +++ b/debian/gbp.conf @@ -0,0 +1,5 @@ +[DEFAULT] +debian-branch = 5.6-debian +upstream-branch = 5.6-debian +upstream-tree = branch +pristine-tar = False diff --git a/debian/mysql-server-5.6.py b/debian/mysql-server-5.6.py new file mode 100755 index 00000000..3888c05b --- /dev/null +++ b/debian/mysql-server-5.6.py @@ -0,0 +1,52 @@ +'''apport package hook for mysql-5.6 + +(c) 2009 Canonical Ltd. +Author: Mathias Gug +''' + +from __future__ import print_function, unicode_literals +import os, os.path + +from apport.hookutils import * + +def _add_my_conf_files(report, filename): + key = 'MySQLConf' + path_to_key(filename) + report[key] = "" + for line in read_file(filename).split('\n'): + try: + if 'password' in line.split('=')[0]: + line = "%s = @@APPORTREPLACED@@" % (line.split('=')[0]) + report[key] += line + '\n' + except IndexError: + continue + +def add_info(report): + attach_conffiles(report, 'mysql-server-5.6', conffiles=None) + key = 'Logs' + path_to_key('/var/log/daemon.log') + report[key] = "" + for line in read_file('/var/log/daemon.log').split('\n'): + try: + if 'mysqld' in line.split()[4]: + report[key] += line + '\n' + except IndexError: + continue + if os.path.exists('/var/log/mysql/error.log'): + key = 'Logs' + path_to_key('/var/log/mysql/error.log') + report[key] = "" + for line in read_file('/var/log/mysql/error.log').split('\n'): + report[key] += line + '\n' + attach_mac_events(report, '/usr/sbin/mysqld') + attach_file(report,'/etc/apparmor.d/usr.sbin.mysqld') + _add_my_conf_files(report, '/etc/mysql/my.cnf') + for f in os.listdir('/etc/mysql/conf.d'): + _add_my_conf_files(report, os.path.join('/etc/mysql/conf.d', f)) + try: + report['MySQLVarLibDirListing'] = str(os.listdir('/var/lib/mysql')) + except OSError: + report['MySQLVarLibDirListing'] = str(False) + +if __name__ == '__main__': + report = {} + add_info(report) + for key in report: + print('%s: %s' % (key, report[key].split('\n', 1)[0])) diff --git a/debian/mysql-server-wsrep-5.6.postinst b/debian/mysql-server-wsrep-5.6.postinst index 128268c0..6fca71c6 100644 --- a/debian/mysql-server-wsrep-5.6.postinst +++ b/debian/mysql-server-wsrep-5.6.postinst @@ -43,8 +43,11 @@ esac update-rc.d -f mysql remove >/dev/null || exit ldconfig -n /usr/lib/mysql #test -d /var/lib/mysql || (mysql_install_db --user=mysql --datadir=/var/lib/mysql) -# it seems that we can run mysql_install_db regardless of existing tables. -mysql_install_db --wsrep-on=0 --user=mysql --datadir=/var/lib/mysql --basedir=/usr +# Run mysql_install_db only if postinst was called during install, not upgrade +if [ -z "$2" ]; then + # it seems that we can run mysql_install_db regardless of existing tables. + mysql_install_db --wsrep-on=0 --user=mysql --datadir=/var/lib/mysql --basedir=/usr +fi # This is a fix/workaround for AppArmor profile provided with mysql-server deb [ ! -d /etc/apparmor.d/disable ] || \ ( cd /etc/apparmor.d/disable && ln -sf ../usr.sbin.mysqld ./ ) diff --git a/debian/patches/disable_tests.patch b/debian/patches/disable_tests.patch deleted file mode 100644 index 0626bc25..00000000 --- a/debian/patches/disable_tests.patch +++ /dev/null @@ -1,12 +0,0 @@ -Author: Clint Byrum -Subject: Convenient place to disable tests that are currently failing -Forwarded: not-needed -Last-Update: 2012-03-07 -Reviewed-by: Nicholas Bamber ---- a/mysql-test/t/disabled.def -+++ b/mysql-test/t/disabled.def -@@ -17,3 +17,4 @@ log_tables-big : Bug#11756699 - ds_mrr-big @solaris : Bug#14168107 2012-04-03 Hemant disabled new test added by Olav Sandstå,since this leads to timeout on Solaris on slow sparc servers - mysql_embedded_client_test : Bug#13964673 2012-04-16 amitbha since most of the test cases are failing - mysql_client_test_embedded : Bug#16084066 2013-01-08 Disabled since this test is failing -+file_contents : Fails without bzr revision id diff --git a/debian/patches/fix-mysqlhotcopy-test-failure.patch b/debian/patches/fix-mysqlhotcopy-test-failure.patch new file mode 100644 index 00000000..0209176d --- /dev/null +++ b/debian/patches/fix-mysqlhotcopy-test-failure.patch @@ -0,0 +1,18 @@ +Description: Include return code 255 in list of valid error codes + Perl 5.20 changed the behaviour of mysqlhotcopy to return 255 on error + . + Add this error code to the list of allowable return codes +Author: James Page +Forwarded: no + +--- a/mysql-test/include/mysqlhotcopy.inc ++++ b/mysql-test/include/mysqlhotcopy.inc +@@ -107,7 +107,7 @@ DROP DATABASE hotcopy_save; + --replace_result $MYSQLD_DATADIR MYSQLD_DATADIR + --list_files $MYSQLD_DATADIR/hotcopy_save + --replace_result $MASTER_MYSOCK MASTER_MYSOCK +---error 9,11,110,2304 ++--error 9,11,110,255,2304 + --exec $MYSQLHOTCOPY --quiet -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save + --replace_result $MASTER_MYSOCK MASTER_MYSOCK + --exec $MYSQLHOTCOPY --quiet --allowold -S $MASTER_MYSOCK -u root hotcopy_test hotcopy_save diff --git a/debian/patches/fix_standalone_tests.patch b/debian/patches/fix_standalone_tests.patch index 5a2f1370..faedcc42 100644 --- a/debian/patches/fix_standalone_tests.patch +++ b/debian/patches/fix_standalone_tests.patch @@ -3,11 +3,9 @@ Description: makes mtr look in the standard location from the mysql-testsuite-5.5 package. Forwarded: not-needed -Index: mysql-5.5/mysql-test/lib/mtr_cases.pm -=================================================================== ---- mysql-5.5.orig/mysql-test/lib/mtr_cases.pm 2011-11-14 15:35:04.238715000 -0800 -+++ mysql-5.5/mysql-test/lib/mtr_cases.pm 2011-11-25 14:41:00.433887578 -0800 -@@ -287,7 +287,8 @@ +--- a/mysql-test/lib/mtr_cases.pm ++++ b/mysql-test/lib/mtr_cases.pm +@@ -287,7 +287,8 @@ sub collect_one_suite($) else { $suitedir= my_find_dir($::basedir, diff --git a/debian/patches/hurd.patch b/debian/patches/hurd.patch index dbd44e79..b64feeba 100644 --- a/debian/patches/hurd.patch +++ b/debian/patches/hurd.patch @@ -29,7 +29,7 @@ Reviewed-by: Nicholas Bamber +SET(_FILE_OFFSET_BITS 64) --- a/mysql-test/lib/My/Platform.pm +++ b/mysql-test/lib/My/Platform.pm -@@ -110,6 +110,9 @@ +@@ -110,6 +110,9 @@ sub check_socket_path_length { # This may not be true, but we can't test for it on AIX due to Perl bug # See Bug #45771 return 0 if ($^O eq 'aix'); diff --git a/debian/patches/kfreebsd_tests.patch b/debian/patches/kfreebsd_tests.patch index 3aaa8ce5..981e0a9a 100644 --- a/debian/patches/kfreebsd_tests.patch +++ b/debian/patches/kfreebsd_tests.patch @@ -7,7 +7,7 @@ Forwarded: no Last-Update: 2012-04-28 --- a/mysql-test/lib/My/Platform.pm +++ b/mysql-test/lib/My/Platform.pm -@@ -113,6 +113,8 @@ +@@ -113,6 +113,8 @@ sub check_socket_path_length { # Similarly the path length is hidden. # See Debian bug #651002 return 0 if ($^O eq 'gnu'); diff --git a/debian/patches/mysql-5.6.23_wsrep_25.10.patch b/debian/patches/mysql-5.6.23_wsrep_25.10.patch deleted file mode 100644 index 39ff8b92..00000000 --- a/debian/patches/mysql-5.6.23_wsrep_25.10.patch +++ /dev/null @@ -1,43353 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 5be5e92..818313e 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -176,6 +176,7 @@ IF(WITH_DEFAULT_FEATURE_SET) - ENDIF() - - # Add macros -+INCLUDE(wsrep) - INCLUDE(character_sets) - INCLUDE(cpu_info) - INCLUDE(zlib) -@@ -324,6 +325,12 @@ OPTION(OPTIMIZER_TRACE "Support tracing of Optimizer" ON) - OPTION(INNODB_COMPILER_HINTS "Compile InnoDB with compiler hints" ON) - MARK_AS_ADVANCED(INNODB_COMPILER_HINTS) - -+OPTION(WITH_INNODB_DISALLOW_WRITES "InnoDB freeze writes patch from Google" ${WITH_WSREP}) -+IF (WITH_INNODB_DISALLOW_WRITES) -+ MESSAGE(STATUS "INNODB_DISALLOW_WRITES") -+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWITH_INNODB_DISALLOW_WRITES") -+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWITH_INNODB_DISALLOW_WRITES") -+ENDIF() - OPTION(INNODB_PAGE_ATOMIC_REF_COUNT "Use atomics for the page reference count" - ON) - MARK_AS_ADVANCED(INNODB_PAGE_ATOMIC_REF_COUNT) -@@ -444,6 +451,9 @@ ADD_SUBDIRECTORY(regex) - ADD_SUBDIRECTORY(mysys) - ADD_SUBDIRECTORY(mysys_ssl) - ADD_SUBDIRECTORY(libmysql) -+IF(WITH_WSREP) -+ADD_SUBDIRECTORY(wsrep) -+ENDIF() - - IF(WITH_UNIT_TESTS) - ADD_SUBDIRECTORY(unittest) -@@ -539,7 +549,7 @@ ADD_SUBDIRECTORY(packaging/solaris) - # (see http://public.kitware.com/Bug/view.php?id=11452) - SET(CPACK_MONOLITHIC_INSTALL 1 CACHE INTERNAL "") - --IF(UNIX) -+IF(UNIX AND NOT WITH_WSREP) - INSTALL(FILES Docs/mysql.info DESTINATION ${INSTALL_INFODIR} OPTIONAL COMPONENT Info) - ENDIF() - # -@@ -554,7 +564,7 @@ IF(NOT INSTALL_LAYOUT MATCHES "RPM") - INSTALL(FILES README DESTINATION ${INSTALL_DOCREADMEDIR} COMPONENT Readme) - INSTALL(FILES ${CMAKE_BINARY_DIR}/Docs/INFO_SRC ${CMAKE_BINARY_DIR}/Docs/INFO_BIN DESTINATION ${INSTALL_DOCDIR}) - IF(UNIX) -- INSTALL(FILES Docs/INSTALL-BINARY DESTINATION ${INSTALL_DOCREADMEDIR} COMPONENT Readme) -+ INSTALL(FILES Docs/INSTALL-BINARY Docs/README-wsrep 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") -@@ -562,6 +572,7 @@ IF(NOT INSTALL_LAYOUT MATCHES "RPM") - INSTALL(DIRECTORY Docs/ DESTINATION ${INSTALL_DOCDIR} - COMPONENT Documentation - PATTERN "INSTALL-BINARY" EXCLUDE -+ PATTERN "README-wsrep" EXCLUDE - PATTERN "Makefile.*" EXCLUDE - PATTERN "glibc*" EXCLUDE - PATTERN "linuxthreads.txt" EXCLUDE -diff --git a/Docs/ChangeLog b/Docs/ChangeLog -index 9988db3..e1775d5 100644 ---- a/Docs/ChangeLog -+++ b/Docs/ChangeLog -@@ -1 +1,2 @@ --This is a first release, this file is supposed to be empty -+Placeholder -+ -diff --git a/Docs/INFO_SRC b/Docs/INFO_SRC -deleted file mode 100644 -index fbc1a6c..0000000 ---- a/Docs/INFO_SRC -+++ /dev/null -@@ -1,7 +0,0 @@ --commit: 19ff9770da1307a8b44be40beaa456c4d1149c2a --date: 2015-01-19 14:26:20 +0100 --build-date: 2015-01-19 14:38:00 +0100 --short: 19ff977 --branch: mysql-5.6.23-release -- --MySQL source 5.6.23 -diff --git a/WSREP_REVISION b/WSREP_REVISION -new file mode 100644 -index 0000000..72dd598 ---- /dev/null -+++ b/WSREP_REVISION -@@ -0,0 +1 @@ -+6b378be -diff --git a/client/mysqltest.cc b/client/mysqltest.cc -index 2def9bd..1421309 100644 ---- a/client/mysqltest.cc -+++ b/client/mysqltest.cc -@@ -496,7 +496,7 @@ struct st_match_err - - struct st_expected_errors - { -- struct st_match_err err[10]; -+ struct st_match_err err[20]; - uint count; - }; - static struct st_expected_errors saved_expected_errors; -diff --git a/cmake/configure.pl b/cmake/configure.pl -index 22c1329..0a6a3cf 100644 ---- a/cmake/configure.pl -+++ b/cmake/configure.pl -@@ -223,6 +223,16 @@ foreach my $option (@ARGV) - $cmakeargs = $cmakeargs." \"-DWITH_COMMENT=".substr($option,13)."\""; - next; - } -+ if ($option =~ /layout=/) -+ { -+ $cmakeargs = $cmakeargs." -DINSTALL_LAYOUT=".substr($option,7); -+ next; -+ } -+ if ($option =~ /with-unix-socket-path=/) -+ { -+ $cmakeargs = $cmakeargs." -DMYSQL_UNIX_ADDR=".substr($option,22); -+ next; -+ } - if ($option =~ /mysql-maintainer-mode/) - { - $cmakeargs = $cmakeargs." -DMYSQL_MAINTAINER_MODE=" . -diff --git a/cmake/install_layout.cmake b/cmake/install_layout.cmake -index 4adda0b..5cd47af 100644 ---- a/cmake/install_layout.cmake -+++ b/cmake/install_layout.cmake -@@ -146,7 +146,10 @@ SET(INSTALL_BINDIR_RPM "bin") - SET(INSTALL_SBINDIR_RPM "sbin") - SET(INSTALL_SCRIPTDIR_RPM "bin") - # --IF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") -+# Deciding via system processor may give wrong answer in -+# virtual environments that see host CPU directly. -+# IF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") -+IF(64BIT) - SET(INSTALL_LIBDIR_RPM "lib64") - SET(INSTALL_PLUGINDIR_RPM "lib64/mysql/plugin") - ELSE() -diff --git a/cmake/install_macros.cmake b/cmake/install_macros.cmake -index 83bd6bd..4f66008 100644 ---- a/cmake/install_macros.cmake -+++ b/cmake/install_macros.cmake -@@ -13,8 +13,34 @@ - # along with this program; if not, write to the Free Software - # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -+if(APPLE) -+ LIST(APPEND CMAKE_CXX_LINK_EXECUTABLE "dsymutil ") -+ LIST(APPEND CMAKE_C_LINK_EXECUTABLE "dsymutil ") -+ LIST(APPEND CMAKE_CXX_CREATE_SHARED_LIBRARY "dsymutil ") -+ LIST(APPEND CMAKE_C_CREATE_SHARED_LIBRARY "dsymutil ") -+ LIST(APPEND CMAKE_CXX_CREATE_SHARED_MODULE "dsymutil ") -+ LIST(APPEND CMAKE_C_CREATE_SHARED_MODULE "dsymutil ") -+ENDIF() -+ - GET_FILENAME_COMPONENT(MYSQL_CMAKE_SCRIPT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) - INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake) -+MACRO (INSTALL_DSYM_DIRECTORIES targets) -+ IF(APPLE) -+ FOREACH(target ${targets}) -+ GET_TARGET_PROPERTY(location ${target} LOCATION) -+ GET_TARGET_PROPERTY(type ${target} TYPE) -+ # It's a dirty hack, but cmake too stupid and mysql cmake files too buggy */ -+ STRING(REGEX REPLACE "/liblibmysql.dylib$" "/libmysqlclient.${SHARED_LIB_MAJOR_VERSION}.dylib" location ${location}) -+ IF(DEBUG_EXTNAME) -+ STRING(REGEX REPLACE "/mysqld$" "/mysqld-debug" location ${location}) -+ ENDIF() -+ IF(type MATCHES "EXECUTABLE" OR type MATCHES "MODULE" OR type MATCHES "SHARED_LIBRARY") -+ INSTALL(DIRECTORY "${location}.dSYM" DESTINATION ${INSTALL_LOCATION} COMPONENT Debuginfo) -+ ENDIF() -+ ENDFOREACH() -+ ENDIF() -+ENDMACRO() -+ - MACRO (INSTALL_DEBUG_SYMBOLS targets) - IF(MSVC) - FOREACH(target ${targets}) -@@ -241,6 +267,7 @@ FUNCTION(MYSQL_INSTALL_TARGETS) - INSTALL(TARGETS ${TARGETS} DESTINATION ${ARG_DESTINATION} ${COMP}) - SET(INSTALL_LOCATION ${ARG_DESTINATION} ) - INSTALL_DEBUG_SYMBOLS("${TARGETS}") -+ INSTALL_DSYM_DIRECTORIES("${TARGETS}") - SET(INSTALL_LOCATION) - ENDFUNCTION() - -diff --git a/cmake/os/FreeBSD.cmake b/cmake/os/FreeBSD.cmake -index e095929..bd72a58 100644 ---- a/cmake/os/FreeBSD.cmake -+++ b/cmake/os/FreeBSD.cmake -@@ -22,3 +22,5 @@ - - # The below was used for really old versions of FreeBSD, roughly: before 5.1.9 - # ADD_DEFINITIONS(-DHAVE_BROKEN_REALPATH) -+ -+SET(HAVE_SYS_TIMEB_H CACHE INTERNAL "") -diff --git a/cmake/os/WindowsCache.cmake b/cmake/os/WindowsCache.cmake -index a1764ad..891c4e4 100644 ---- a/cmake/os/WindowsCache.cmake -+++ b/cmake/os/WindowsCache.cmake -@@ -74,6 +74,7 @@ SET(HAVE_FSYNC CACHE INTERNAL "") - SET(HAVE_FTIME 1 CACHE INTERNAL "") - SET(HAVE_FTRUNCATE CACHE INTERNAL "") - SET(HAVE_GETADDRINFO 1 CACHE INTERNAL "") -+SET(HAVE_GETIFADDRS CACHE INTERNAL "") - SET(HAVE_GETCWD 1 CACHE INTERNAL "") - SET(HAVE_GETHOSTBYADDR_R CACHE INTERNAL "") - SET(HAVE_GETHRTIME CACHE INTERNAL "") -diff --git a/cmake/package_name.cmake b/cmake/package_name.cmake -index 4cb5c95..882259c 100644 ---- a/cmake/package_name.cmake -+++ b/cmake/package_name.cmake -@@ -27,6 +27,8 @@ IF(NOT VERSION) - SET(DEFAULT_MACHINE ${CMAKE_SYSTEM_PROCESSOR}) - IF(SIZEOF_VOIDP EQUAL 8) - SET(64BIT 1) -+ ELSE() -+ SET(64BIT 0) - ENDIF() - - IF(CMAKE_SYSTEM_NAME MATCHES "Windows") -@@ -127,7 +129,14 @@ IF(NOT VERSION) - STRING(REGEX REPLACE "^.*-ndb-" "" NDBVERSION "${VERSION}") - SET(package_name "mysql-cluster${PRODUCT_TAG}-${NDBVERSION}-${SYSTEM_NAME_AND_PROCESSOR}") - ELSE() -- SET(package_name "mysql${PRODUCT_TAG}-${VERSION}-${SYSTEM_NAME_AND_PROCESSOR}") -+ IF(WITH_WSREP) -+ IF(NOT WSREP_VERSION) -+ MESSAGE(FATAL_ERROR "Variable WSREP_VERSION must be set") -+ ENDIF() -+ SET(package_name "mysql-wsrep${PRODUCT_TAG}-${VERSION}-${WSREP_VERSION}-${SYSTEM_NAME_AND_PROCESSOR}") -+ ELSE() -+ SET(package_name "mysql${PRODUCT_TAG}-${VERSION}-${SYSTEM_NAME_AND_PROCESSOR}") -+ ENDIF() - ENDIF() - - MESSAGE(STATUS "Packaging as: ${package_name}") -diff --git a/cmake/wsrep.cmake b/cmake/wsrep.cmake -new file mode 100644 -index 0000000..2c7d799 ---- /dev/null -+++ b/cmake/wsrep.cmake -@@ -0,0 +1,52 @@ -+# Copyright (c) 2011, Codership Oy . -+# -+# 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 -+ -+# We need to generate a proper spec file even without --with-wsrep flag, -+# so WSREP_VERSION is produced regardless -+ -+# Set the patch version -+SET(WSREP_PATCH_VERSION "10") -+ -+# Obtain patch revision number -+SET(WSREP_REVISION $ENV{WSREP_REV}) -+IF(NOT WSREP_REVISION) -+ SET(WSREP_REVISION "XXXX" CACHE STRING "WSREP revision") -+ENDIF() -+ -+ -+# Obtain wsrep API version -+EXECUTE_PROCESS( -+ COMMAND sh -c "grep WSREP_INTERFACE_VERSION ${MySQL_SOURCE_DIR}/wsrep/wsrep_api.h | cut -d '\"' -f 2" -+ OUTPUT_VARIABLE WSREP_API_VERSION -+ RESULT_VARIABLE RESULT -+) -+#FILE(WRITE "wsrep_config" "Debug: WSREP_API_VERSION result: ${RESULT}\n") -+STRING(REGEX REPLACE "(\r?\n)+$" "" WSREP_API_VERSION "${WSREP_API_VERSION}") -+ -+SET(WSREP_VERSION "${WSREP_API_VERSION}.${WSREP_PATCH_VERSION}" -+ CACHE STRING "WSREP version") -+ -+OPTION(WITH_WSREP "WSREP replication API (to use, e.g. Galera Replication library)" OFF) -+IF (WITH_WSREP) -+ SET(WSREP_C_FLAGS "-DWITH_WSREP -DWSREP_PROC_INFO -DMYSQL_MAX_VARIABLE_VALUE_LEN=2048") -+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WSREP_C_FLAGS}") -+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WSREP_C_FLAGS}") -+ SET(COMPILATION_COMMENT "${COMPILATION_COMMENT}, wsrep_${WSREP_VERSION}") -+ SET(WITH_EMBEDDED_SERVER OFF) -+ SET(WITH_INNODB_DISALLOW_WRITES ON) -+ SET(WITH_INNODB_MEMCACHED ON) -+ENDIF() -+ -+# -diff --git a/config.h.cmake b/config.h.cmake -index 987be27..a216b18 100644 ---- a/config.h.cmake -+++ b/config.h.cmake -@@ -155,6 +155,7 @@ - #cmakedefine HAVE_FSYNC 1 - #cmakedefine HAVE_FTIME 1 - #cmakedefine HAVE_GETADDRINFO 1 -+#cmakedefine HAVE_GETIFADDRS 1 - #cmakedefine HAVE_GETCWD 1 - #cmakedefine HAVE_GETHOSTBYADDR_R 1 - #cmakedefine HAVE_GETHRTIME 1 -diff --git a/configure.cmake b/configure.cmake -index e1c1793..a4d4809 100644 ---- a/configure.cmake -+++ b/configure.cmake -@@ -433,6 +433,7 @@ CHECK_FUNCTION_EXISTS (getpassphrase HAVE_GETPASSPHRASE) - CHECK_FUNCTION_EXISTS (getpwnam HAVE_GETPWNAM) - CHECK_FUNCTION_EXISTS (getpwuid HAVE_GETPWUID) - CHECK_FUNCTION_EXISTS (getrlimit HAVE_GETRLIMIT) -+CHECK_FUNCTION_EXISTS (getifaddrs HAVE_GETIFADDRS) - CHECK_FUNCTION_EXISTS (getrusage HAVE_GETRUSAGE) - CHECK_FUNCTION_EXISTS (getwd HAVE_GETWD) - CHECK_FUNCTION_EXISTS (gmtime_r HAVE_GMTIME_R) -diff --git a/include/my_md5.h b/include/my_md5.h -index 452676e..4f89105 100644 ---- a/include/my_md5.h -+++ b/include/my_md5.h -@@ -43,7 +43,11 @@ static inline void array_to_hex(char *to, const unsigned char *str, uint len) - *to++= _dig_vec_lower[((uchar) *str) & 0x0F]; - } - } -- -+#ifdef WITH_WSREP -+void *wsrep_md5_init(); -+void wsrep_md5_update(void *ctx, char* buf, int len); -+ void wsrep_compute_md5_hash(char *digest, void *ctx); -+#endif - #ifdef __cplusplus - } - #endif -diff --git a/include/thr_lock.h b/include/thr_lock.h -index c5638ec..6b0741f 100644 ---- a/include/thr_lock.h -+++ b/include/thr_lock.h -@@ -20,6 +20,15 @@ - #ifdef __cplusplus - extern "C" { - #endif -+#ifdef WITH_WSREP -+#include -+ typedef my_bool (* wsrep_thd_is_brute_force_fun)(void *, my_bool); -+ typedef int (* wsrep_abort_thd_fun)(void *, void *, my_bool); -+ typedef int (* wsrep_on_fun)(void *); -+ void wsrep_thr_lock_init( -+ wsrep_thd_is_brute_force_fun bf_fun, wsrep_abort_thd_fun abort_fun, -+ my_bool debug, my_bool convert_LOCK_to_trx, wsrep_on_fun on_fun); -+#endif - - #include - #include -@@ -89,6 +98,10 @@ typedef struct st_thr_lock_info - { - pthread_t thread; - my_thread_id thread_id; -+#ifdef WITH_WSREP -+ void *mysql_thd; // THD pointer -+ my_bool in_lock_tables; // true, if inside locking session -+#endif - } THR_LOCK_INFO; - - -diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental -index 2519428..1cfa4c5 100644 ---- a/mysql-test/collections/default.experimental -+++ b/mysql-test/collections/default.experimental -@@ -21,9 +21,3 @@ rpl.rpl_gtid_logs_without_rotate_or_stop_event @windows # Bug#16207800 2013-0 - perfschema.socket_summary_by_instance_func # bug#16274580 - innodb.innodb_bug14676111 # bug#17026780 2013-07-08 anitha Originally made experimental due to bug#16371942 which is now fixed. Now fails with mismatch in CLUST_INDEX_SIZE - --# This file is for marking internal tests as experimental. --# Use the same way as the "normal" default.experimental --# The contents of this file will be appended to it in PB2 but not for --# normal developer builds. --# Internal tests should *not* be listed in the public default.experimental! -- -diff --git a/mysql-test/collections/default.release b/mysql-test/collections/default.release -deleted file mode 100644 -index 9ac7af5..0000000 ---- a/mysql-test/collections/default.release -+++ /dev/null -@@ -1,16 +0,0 @@ --# This file contains the old default.release, the plan is to replace that --# with something like the below (remove space after #): --# include default.daily --# include default.weekly --perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=debug --vardir=var-debug --skip-rpl --report-features --debug-server --perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=normal --vardir=var-normal --report-features --unit-tests --perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=ps --vardir=var-ps --ps-protocol --perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=funcs1+ps --vardir=var-funcs_1_ps --suite=funcs_1 --ps-protocol --perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=funcs2 --vardir=var-funcs2 --suite=funcs_2 --perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=partitions --vardir=var-parts --suite=parts --perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=stress --vardir=var-stress --suite=stress --perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=jp --vardir=var-jp --suite=jp --perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=embedded --vardir=var-embedded --embedded-server --skip-rpl --perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=nist --vardir=var-nist --suite=nist --perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=nist+ps --vardir=var-nist_ps --suite=nist --ps-protocol --perl mysql-test-run.pl --timer --force --comment=memcached --vardir=var-memcached --experimental=collections/default.experimental --parallel=auto --retry=0 --suite=memcached -diff --git a/mysql-test/collections/default.release.done b/mysql-test/collections/default.release.done -deleted file mode 100644 -index 3d1016b..0000000 ---- a/mysql-test/collections/default.release.done -+++ /dev/null -@@ -1 +0,0 @@ --/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/mysql-test/collections/default.release.in -diff --git a/mysql-test/extra/binlog_tests/binlog.test b/mysql-test/extra/binlog_tests/binlog.test -index 8a36566..c332c01 100644 ---- a/mysql-test/extra/binlog_tests/binlog.test -+++ b/mysql-test/extra/binlog_tests/binlog.test -@@ -337,7 +337,8 @@ dfLtTBcBAAAAIgAAAPkAAAAAABcAAAAAAAcAAf/+AQAAAA== - - SELECT * FROM t1; - --echo # Their values should be ON --SHOW SESSION VARIABLES LIKE "%_checks"; -+SHOW SESSION VARIABLES LIKE "foreign_key_checks"; -+SHOW SESSION VARIABLES LIKE "unique_checks"; - - --echo - SET @@SESSION.foreign_key_checks= OFF; -@@ -352,7 +353,8 @@ dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA== - - SELECT * FROM t1; - --echo # Their values should be OFF --SHOW SESSION VARIABLES LIKE "%_checks"; -+SHOW SESSION VARIABLES LIKE "foreign_key_checks"; -+SHOW SESSION VARIABLES LIKE "unique_checks"; - - --echo # INSERT INTO t1 VALUES(2) - --echo # foreign_key_checks=1 and unique_checks=1 -@@ -366,7 +368,8 @@ dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA== - - SELECT * FROM t1; - --echo # Their values should be OFF --SHOW SESSION VARIABLES LIKE "%_checks"; -+SHOW SESSION VARIABLES LIKE "foreign_key_checks"; -+SHOW SESSION VARIABLES LIKE "unique_checks"; - - DROP TABLE t1; - -diff --git a/mysql-test/include/check-testcase.test b/mysql-test/include/check-testcase.test -index fe5c756..6ef3aec 100644 ---- a/mysql-test/include/check-testcase.test -+++ b/mysql-test/include/check-testcase.test -@@ -6,6 +6,7 @@ - # tescase. In that way, it is possible to check that a testcase does - # not have any unwanted side affects. - -+--source include/wait_until_connected_again.inc - --disable_query_log - - # We want to ensure all slave configuration is restored. But SHOW -diff --git a/mysql-test/include/default_mysqld.cnf b/mysql-test/include/default_mysqld.cnf -index cecd4a6..1c98245 100644 ---- a/mysql-test/include/default_mysqld.cnf -+++ b/mysql-test/include/default_mysqld.cnf -@@ -34,7 +34,7 @@ loose-innodb_lru_scan_depth= 100 - loose-innodb_write_io_threads= 2 - loose-innodb_read_io_threads= 2 - loose-innodb_log_buffer_size= 1M --loose-innodb_log_file_size= 5M -+innodb_log_file_size= 5M - loose-innodb_additional_mem_pool_size= 1M - loose-innodb_log_files_in_group= 2 - -diff --git a/mysql-test/include/galera_cluster.inc b/mysql-test/include/galera_cluster.inc -new file mode 100644 -index 0000000..bc65222 ---- /dev/null -+++ b/mysql-test/include/galera_cluster.inc -@@ -0,0 +1,10 @@ -+# galera_cluster.inc -+# ================== -+# -+# Description -+# ----------- -+# Configure galera cluster with 2 nodes. -+# -+ -+--let $galera_cluster_size = 2 -+--source include/galera_init.inc -diff --git a/mysql-test/include/galera_connect.inc b/mysql-test/include/galera_connect.inc -new file mode 100644 -index 0000000..bfd9b18 ---- /dev/null -+++ b/mysql-test/include/galera_connect.inc -@@ -0,0 +1,45 @@ -+# galera_connect.inc -+# ================== -+# -+# Description -+# ----------- -+# Open a connection to the specified server number ($galera_server_number). -+# The connection itself would be identified by $galera_connection_name. -+# -+# Parameters -+# ---------- -+# $galera_connection_name -+# Name of the resulting connection. -+# -+# $galera_server_number -+# Sequence number of the node in the galera cluster. -+# -+# $galera_debug -+# Print debug information. -+# -+ -+if (!$galera_connection_name) -+{ -+ --die ERROR IN TEST: $galera_connection_name must be set before sourcing include/galera_connect.inc -+} -+ -+if (!$galera_server_number) -+{ -+ --die ERROR IN TEST: $galera_server_number must be set before sourcing include/galera_connect.inc -+} -+ -+--let $_galera_port= \$NODE_MYPORT_$galera_server_number -+if (!$_galera_port) -+{ -+ --echo Bug in test case: '\$NODE_MYPORT_$galera_server_number' not initialized. Check the test's .cfg file. -+ --die Not all NODE_MYPORT_* environment variables are setup correctly. -+} -+ -+if ($galera_debug) -+{ -+ --echo connect($galera_connection_name,127.0.0.1,root,,test,$_galera_port,) -+} -+ -+# Open a connection -+--connect($galera_connection_name,127.0.0.1,root,,test,$_galera_port,) -+ -diff --git a/mysql-test/include/galera_diff.inc b/mysql-test/include/galera_diff.inc -new file mode 100644 -index 0000000..6043b58 ---- /dev/null -+++ b/mysql-test/include/galera_diff.inc -@@ -0,0 +1,100 @@ -+# galera_diff.inc -+# =============== -+# -+# Description -+# ----------- -+# Compare the output of the given statement on all the nodes of the cluster. -+# -+# Parameters -+# ---------- -+# $galera_diff_statement -+# Statement for which the output would be compared. -+# -+# $galera_diff_database -+# Database against which the above statement would be executed. -+# (Default : test) -+# -+# $galera_diff_servers -+# Comma separated list of servers to executed the diff statement on. If not -+# set, a list of servers will be generated based on $galera_cluster_size. -+# -+# $galerra_debug -+# Print debug information. -+# -+ -+if (!$galera_diff_statement) -+{ -+ --die ERROR IN TEST: $galera_diff_statement must be set before sourcing include/galera_diff.inc -+} -+ -+--let $_galera_diff_database = $galera_diff_database -+if (!$_galera_diff_database) -+{ -+ --let $_galera_diff_database = test -+} -+ -+--let $_galera_diff_servers= $galera_diff_servers -+if (!$_galera_diff_servers) -+{ -+ --let $_i= $galera_cluster_size -+ --let $_galera_diff_servers= -+ while ($_i) -+ { -+ --let $_galera_diff_servers= $_i,$_galera_diff_servers -+ --dec $_i -+ } -+} -+if ($galera_debug) -+{ -+ --echo \$galera_diff_servers= '$_galera_diff_servers' -+} -+ -+if (!$galera_debug) -+{ -+ --disable_query_log -+} -+ -+# Generate file containing $galera_diff_statement. We don't pass the -+# statement on the command line, because it would be subject to shell -+# substitutions. -+--let $write_to_file= GENERATE -+--let $write_var= $galera_diff_statement -+--source include/write_var_to_file.inc -+--let $_galera_diff_statement_file= $write_to_file -+ -+if (!$galera_debug) -+{ -+ --enable_query_log -+} -+ -+# Compare all servers. -+--let $_galera_diff_first= 1 -+while ($_galera_diff_servers) -+{ -+ # Set $_galera_diff_server_i to the first number in the list -+ --let $_galera_diff_server_i= `SELECT SUBSTRING_INDEX('$_galera_diff_servers', ',', 1)` -+ # Remove $_galera_diff_server_i from the list -+ --let $_galera_diff_servers= `SELECT SUBSTRING('$_galera_diff_servers', LENGTH('$_galera_diff_server_i') + 2)` -+ -+ # Execute statement -+ --let $_galera_diff_file= $MYSQLTEST_VARDIR/tmp/_galera_diff_server-$_galera_diff_server_i.tmp -+ --exec $MYSQL --defaults-group-suffix=.$_galera_diff_server_i $_galera_diff_database < $_galera_diff_statement_file > $_galera_diff_file -+ -+ # Compare -+ if (!$_galera_diff_first) -+ { -+ if ($galera_debug) -+ { -+ --echo diffing $_galera_diff_file and $_galera_diff_prev_file -+ } -+ --diff_files $_galera_diff_file $_galera_diff_prev_file -+ --remove_file $_galera_diff_prev_file -+ } -+ --let $_galera_diff_prev_file= $_galera_diff_file -+ --let $_galera_diff_first= 0 -+} -+ -+# Cleanup -+--remove_file $_galera_diff_prev_file -+--remove_file $_galera_diff_statement_file -+ -diff --git a/mysql-test/include/galera_end.inc b/mysql-test/include/galera_end.inc -new file mode 100644 -index 0000000..0fb5479 ---- /dev/null -+++ b/mysql-test/include/galera_end.inc -@@ -0,0 +1,25 @@ -+# galera_end.inc -+# ============== -+# -+# Description -+# ----------- -+# Closes the connections opened via include/galera_init.inc -+# -+# Parameters -+# ---------- -+# $galera_cluster_size -+# Number of nodes in the cluster. -+# -+ -+--let $_galera_node= $galera_cluster_size -+ -+while ($_galera_node) -+{ -+ if ($galera_debug) -+ { -+ --echo Disconnecting node_$_galera_node -+ } -+ --disconnect node_$_galera_node -+ --dec $_galera_node -+} -+ -diff --git a/mysql-test/include/galera_init.inc b/mysql-test/include/galera_init.inc -new file mode 100644 -index 0000000..7c79d6f ---- /dev/null -+++ b/mysql-test/include/galera_init.inc -@@ -0,0 +1,27 @@ -+# galera_init.inc -+# =============== -+# -+# Description -+# ----------- -+# Set up a Galera cluster with $wsrep_cluster_size nodes. -+# -+# Parameters -+# ---------- -+# $galera_cluster_size -+# Number of nodes in the cluster. -+# -+ -+--source include/have_wsrep_provider.inc -+--source include/have_wsrep_enabled.inc -+ -+--let $_galera_node= $galera_cluster_size -+ -+while ($_galera_node) -+{ -+ --let $galera_connection_name= node_$_galera_node -+ --let $galera_server_number= $_galera_node -+ --source include/galera_connect.inc -+ -+ --dec $_galera_node -+} -+ -diff --git a/mysql-test/include/galera_resume.inc b/mysql-test/include/galera_resume.inc -new file mode 100644 -index 0000000..232cb46 ---- /dev/null -+++ b/mysql-test/include/galera_resume.inc -@@ -0,0 +1,9 @@ -+--echo Resuming node ... -+--perl -+ my $pid_filename = $ENV{'_SUSPEND_NODE_PIDFILE'}; -+ my $mysqld_pid = `cat $pid_filename`; -+ chomp($mysqld_pid); -+ system("kill -18 $mysqld_pid"); -+ exit(0); -+EOF -+ -diff --git a/mysql-test/include/galera_suspend.inc b/mysql-test/include/galera_suspend.inc -new file mode 100644 -index 0000000..3495ad2 ---- /dev/null -+++ b/mysql-test/include/galera_suspend.inc -@@ -0,0 +1,14 @@ -+# -+# This macro suspends the current node -+# -+ -+--let _SUSPEND_NODE_PIDFILE = `SELECT @@pid_file` -+--echo Suspending node ... -+ -+--perl -+ my $pid_filename = $ENV{'_SUSPEND_NODE_PIDFILE'}; -+ my $mysqld_pid = `cat $pid_filename`; -+ chomp($mysqld_pid); -+ system("kill -19 $mysqld_pid"); -+ exit(0); -+EOF -diff --git a/mysql-test/include/galera_wait_ready.inc b/mysql-test/include/galera_wait_ready.inc -new file mode 100644 -index 0000000..5652538 ---- /dev/null -+++ b/mysql-test/include/galera_wait_ready.inc -@@ -0,0 +1,3 @@ -+let $wait_timeout = 10; -+let $wait_condition = SELECT 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready' AND VARIABLE_VALUE = 'ON'; -+--source include/wait_condition.inc -diff --git a/mysql-test/include/have_wsrep.inc b/mysql-test/include/have_wsrep.inc -new file mode 100644 -index 0000000..52220ed ---- /dev/null -+++ b/mysql-test/include/have_wsrep.inc -@@ -0,0 +1,8 @@ -+# To be used in a test which requires server to be compiled with wsrep support -+# (-DWITH_WSREP=ON) and wsrep plugin is ACTIVE. -+ -+if (`SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = 'wsrep' AND PLUGIN_STATUS='ACTIVE'`) -+{ -+ --skip Test requires wsrep plugin. -+} -+ -diff --git a/mysql-test/include/have_wsrep_enabled.inc b/mysql-test/include/have_wsrep_enabled.inc -new file mode 100644 -index 0000000..1b5948f ---- /dev/null -+++ b/mysql-test/include/have_wsrep_enabled.inc -@@ -0,0 +1,10 @@ -+ -+# To be used in a test which requires wsrep plugin to be ACTIVE and enabled -+# (i.e. wsrep_on=ON). It includes have_wsrep.inc. -+ -+--source include/have_wsrep.inc -+ -+--require r/have_wsrep.require -+--disable_query_log -+SHOW VARIABLES LIKE 'wsrep_on'; -+--enable_query_log -diff --git a/mysql-test/include/have_wsrep_provider.inc b/mysql-test/include/have_wsrep_provider.inc -new file mode 100644 -index 0000000..bb5cbc0 ---- /dev/null -+++ b/mysql-test/include/have_wsrep_provider.inc -@@ -0,0 +1,6 @@ -+if (`SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE -+ VARIABLE_NAME LIKE 'wsrep_provider' AND VARIABLE_VALUE NOT LIKE 'none'`) -+{ -+ --skip Test requires wsrep provider library (libgalera_smm.so). Did you set $WSREP_PROVIDER? -+} -+ -diff --git a/mysql-test/include/kill_galera.inc b/mysql-test/include/kill_galera.inc -new file mode 100644 -index 0000000..d7f665d ---- /dev/null -+++ b/mysql-test/include/kill_galera.inc -@@ -0,0 +1,20 @@ -+--echo Killing server ... -+ -+# Write file to make mysql-test-run.pl expect the crash, but don't start it -+--let $_server_id= `SELECT @@server_id` -+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect -+--exec echo "wait" > $_expect_file_name -+ -+# Kill the connected server -+--disable_reconnect -+--let KILL_NODE_PIDFILE = `SELECT @@pid_file` -+ -+--perl -+ my $pid_filename = $ENV{'KILL_NODE_PIDFILE'}; -+ my $mysqld_pid = `cat $pid_filename`; -+ chomp($mysqld_pid); -+ system("kill -9 $mysqld_pid"); -+ exit(0); -+EOF -+ -+--source include/wait_until_disconnected.inc -diff --git a/mysql-test/include/mtr_check.sql b/mysql-test/include/mtr_check.sql -index 3bd2583..560dd96 100644 ---- a/mysql-test/include/mtr_check.sql -+++ b/mysql-test/include/mtr_check.sql -@@ -60,15 +60,23 @@ BEGIN - - -- Dump all global variables except those that may change. - -- timestamp changes if time passes. server_uuid changes if server restarts. -+ -- wsrep_start_position can change on mysqldump SST -+ -- auto_increment_offset can change on cluster reconfigurations - SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES - WHERE variable_name NOT IN ('timestamp', 'server_uuid', - 'innodb_file_format_max', -- 'gtid_executed', 'gtid_purged') -+ 'gtid_executed', 'gtid_purged', -+ 'wsrep_start_position', -+ 'auto_increment_offset', -+ 'auto_increment_increment', -+ 'wsrep_data_home_dir') - ORDER BY VARIABLE_NAME; - - -- Dump all databases, there should be none - -- except those that was created during bootstrap -- SELECT * FROM INFORMATION_SCHEMA.SCHEMATA; -+ -- and the mtr_wsrep_notify schema which is populated by the std_data/wsrep_notify.sh script -+ -- and the suite/galera/t/galera_var_notify_cmd.test -+ SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME != 'mtr_wsrep_notify'; - - -- The test database should not contain any tables - SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES -diff --git a/mysql-test/include/mtr_warnings.sql b/mysql-test/include/mtr_warnings.sql -index 9de3058..3b7f559 100644 ---- a/mysql-test/include/mtr_warnings.sql -+++ b/mysql-test/include/mtr_warnings.sql -@@ -246,6 +246,40 @@ INSERT INTO global_suppressions VALUES - ("Changed limits: table_cache: *"), - ("Could not increase number of max_open_files to more than *"), - -+ /* -+ Galera suppressions -+ */ -+ ("WSREP:*down context*"), -+ ("WSREP: Failed to send state UUID:*"), -+ ("WSREP: wsrep_sst_receive_address is set to '127.0.0.1"), -+ ("WSREP: option --wsrep-casual-reads is deprecated"), -+ ("WSREP: --wsrep-casual-reads=ON takes precedence over --wsrep-sync-wait=0"), -+ ("WSREP: Could not open saved state file for reading: "), -+ ("WSREP: access file\\(.*gvwstate\\.dat\\) failed\\(No such file or directory\\)"), -+ ("WSREP: Gap in state sequence\\. Need state transfer\\."), -+ ("WSREP: Failed to prepare for incremental state transfer: Local state UUID \\(00000000-0000-0000-0000-000000000000\\) does not match group state UUID"), -+ ("WSREP: No existing UUID has been found, so we assume that this is the first time that this server has been started\\. Generating a new UUID: "), -+ ("WSREP: last inactive check more than"), -+ ("WSREP: binlog cache not empty \\(0 bytes\\) at connection close"), -+ ("WSREP: SQL statement was ineffective"), -+ ("WSREP: Refusing exit for the last slave thread"), -+ ("WSREP: Quorum: No node with complete state"), -+ ("WSREP: Failed to report last committed"), -+ ("Slave SQL: Error 'Duplicate entry"), -+ ("Query apply warning:"), -+ ("WSREP: Ignoring error for TO isolated action:"), -+ ("WSREP: Initial position was provided by configuration or SST, avoiding override"), -+ ("Warning: Using a password on the command line interface can be insecure"), -+ ("InnoDB: Error: Table \"mysql\"\\.\"innodb_table_stats\" not found"), -+ ("but it is impossible to select State Transfer donor: Resource temporarily unavailable"), -+ ("WSREP: Could not find peer"), -+ ("WSREP: discarding established \\(time wait\\)"), -+ ("sending install message failed: Resource temporarily unavailable"), -+ ("WSREP: Ignoring possible split-brain \\(allowed by configuration\\) from view"), -+ ("WSREP: no nodes coming from prim view, prim not possible"), -+ ("WSREP: Failed to prepare for incremental state transfer: Local state seqno is undefined:"), -+ ("WSREP: gcs_caused\\(\\) returned -107 \\(Transport endpoint is not connected\\)"), -+ - ("THE_LAST_SUPPRESSION")|| - - -@@ -292,7 +326,17 @@ BEGIN - END IF; - - -- Cleanup for next test -- TRUNCATE test_suppressions; -+ IF @@wsrep_on = 1 THEN -+ -- The TRUNCATE should not be replicated under Galera -+ -- as it causes the custom suppressions on the other -+ -- nodes to be deleted as well -+ SET wsrep_on = 0; -+ TRUNCATE test_suppressions; -+ SET wsrep_on = 1; -+ ELSE -+ TRUNCATE test_suppressions; -+ END IF; -+ - DROP TABLE error_log; - - END|| -diff --git a/mysql-test/include/mysqld--help.inc b/mysql-test/include/mysqld--help.inc -index e156cfd..8b3b387 100644 ---- a/mysql-test/include/mysqld--help.inc -+++ b/mysql-test/include/mysqld--help.inc -@@ -18,7 +18,7 @@ perl; - # their paths may vary: - @skipvars=qw/basedir open-files-limit general-log-file plugin-dir - pid-file slow-query-log-file -- datadir slave-load-tmpdir tmpdir socket table-definition-cache table-open-cache/; -+ datadir slave-load-tmpdir tmpdir socket table-definition-cache table-open-cache wsrep-node-name/; - - # Plugins which may or may not be there: - @plugins=qw/innodb ndb ndbinfo archive blackhole federated partition ndbcluster debug temp-pool ssl des-key-file -diff --git a/mysql-test/include/not_wsrep.inc b/mysql-test/include/not_wsrep.inc -new file mode 100644 -index 0000000..3314b5c ---- /dev/null -+++ b/mysql-test/include/not_wsrep.inc -@@ -0,0 +1,7 @@ -+# To be used in a test which should be skipped if server is compiled with wsrep -+# support (-DWITH_WSREP=ON) and wsrep plugin is ACTIVE. -+ -+-- require r/not_wsrep.require -+disable_query_log; -+SELECT VERSION() LIKE '%wsrep%' AS 'HAVE_WSREP'; -+enable_query_log; -diff --git a/mysql-test/include/start_mysqld.inc b/mysql-test/include/start_mysqld.inc -index 983c566..4ee3d17 100644 ---- a/mysql-test/include/start_mysqld.inc -+++ b/mysql-test/include/start_mysqld.inc -@@ -1,7 +1,16 @@ - # Include this script only after using shutdown_mysqld.inc - # where $_expect_file_name was initialized. - # Write file to make mysql-test-run.pl start up the server again ----exec echo "restart" > $_expect_file_name -+ -+if ($galera_wsrep_start_position != '') { -+ --echo Using --wsrep-start-position when starting mysqld ... -+ --exec echo "restart:$start_mysqld_params --wsrep-start-position=$galera_wsrep_start_position" > $_expect_file_name -+ --let $galera_wsrep_start_position = 0 -+} -+ -+if ($galera_wsrep_start_position == '') { -+ --exec echo "restart:$start_mysqld_params" > $_expect_file_name -+} - - # Turn on reconnect - --enable_reconnect -@@ -11,4 +20,3 @@ - - # Turn off reconnect again - --disable_reconnect -- -diff --git a/mysql-test/include/wait_until_connected_again.inc b/mysql-test/include/wait_until_connected_again.inc -index c7bb774..005d518 100644 ---- a/mysql-test/include/wait_until_connected_again.inc -+++ b/mysql-test/include/wait_until_connected_again.inc -@@ -1,23 +1,34 @@ - # - # Include this script to wait until the connection to the - # server has been restored or timeout occurs -+ -+# -+# We require two consequtive connection successes in order to -+# work around a race condition on Galera startup where the server -+# can temporarily accept queries before starting to reject them again -+# -+ - --disable_result_log - --disable_query_log - let $counter= 500; - let $mysql_errno= 9999; --while ($mysql_errno) --{ -- # Strangely enough, the server might return "Too many connections" -- # while being shutdown, thus 1040 is an "allowed" error -- # See BUG#36228 -- --error 0,1040,1053,2002,2003,2006,2013 -- show status; -+let $successes= 2; -+ -+while ($successes) { -+ while ($mysql_errno) { -+ # Strangely enough, the server might return "Too many connections" -+ # while being shutdown, thus 1040 is an "allowed" error -+ # See BUG#36228 -+ --error 0,1040,1047,1053,1205,2002,2003,2006,2013,1205 -+ show status; - -- dec $counter; -- if (!$counter) -- { -- --die Server failed to restart -+ --dec $counter -+ if (!$counter) { -+ --die Server failed to restart -+ } -+ --sleep 0.1 - } -+ --dec $successes - --sleep 0.1 - } - --enable_query_log -diff --git a/mysql-test/include/wait_until_disconnected.inc b/mysql-test/include/wait_until_disconnected.inc -index 8a989be..56889d1 100644 ---- a/mysql-test/include/wait_until_disconnected.inc -+++ b/mysql-test/include/wait_until_disconnected.inc -@@ -7,7 +7,7 @@ let $counter= 500; - let $mysql_errno= 0; - while (!$mysql_errno) - { -- --error 0,1040,1053,2002,2003,2006,2013 -+ --error 0,1040,1047,1053,2002,2003,2006,2013 - show status; - - dec $counter; -diff --git a/mysql-test/include/write_var_to_file.inc b/mysql-test/include/write_var_to_file.inc -index 8bb9e72..6ee04c7 100644 ---- a/mysql-test/include/write_var_to_file.inc -+++ b/mysql-test/include/write_var_to_file.inc -@@ -54,7 +54,7 @@ if (`SELECT LENGTH(@@secure_file_priv) > 0`) - --copy_file $_wvtf_tmp_file $write_to_file - --remove_file $_wvtf_tmp_file - } --if (`SELECT LENGTH(@@secure_file_priv) = 0`) -+if (`SELECT LENGTH(@@secure_file_priv) = 0 OR LENGTH(@@secure_file_priv) IS NULL`) - { - --eval SELECT '$write_var' INTO DUMPFILE '$write_to_file' - } -diff --git a/mysql-test/lib/My/Config.pm b/mysql-test/lib/My/Config.pm -index 535df07..642ee0a 100644 ---- a/mysql-test/lib/My/Config.pm -+++ b/mysql-test/lib/My/Config.pm -@@ -178,6 +178,36 @@ sub if_exist { - return $option->value(); - } - -+package My::Config::Group::ENV; -+our @ISA=qw(My::Config::Group); -+ -+use strict; -+use warnings; -+use Carp; -+ -+sub new { -+ my ($class, $group_name)= @_; -+ bless My::Config::Group->new($group_name), $class; -+} -+ -+# -+# Return value for an option in the group, fail if it does not exist -+# -+sub value { -+ my ($self, $option_name)= @_; -+ my $option= $self->option($option_name); -+ -+ if (! defined($option) and defined $ENV{$option_name}) { -+ my $value= $ENV{$option_name}; -+ $option= My::Config::Option->new($option_name, $value); -+ } -+ -+ croak "No option named '$option_name' in group '$self->{name}'" -+ if ! defined($option); -+ -+ return $option->value(); -+} -+ - - package My::Config; - -@@ -197,7 +227,9 @@ sub new { - my ($class, $path)= @_; - my $group_name= undef; - -- my $self= bless { groups => [] }, $class; -+ my $self= bless { groups => [ -+ My::Config::Group::ENV->new('ENV') -+ ] }, $class; - my $F= IO::File->new($path, "<") - or croak "Could not open '$path': $!"; - -diff --git a/mysql-test/lib/My/ConfigFactory.pm b/mysql-test/lib/My/ConfigFactory.pm -index bf2a8fa..fca7f9d 100644 ---- a/mysql-test/lib/My/ConfigFactory.pm -+++ b/mysql-test/lib/My/ConfigFactory.pm -@@ -1,5 +1,5 @@ - # -*- cperl -*- --# Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. -+# Copyright (c) 2007, 2011, Oracle and/or its affiliates - # - # This program is free software; you can redistribute it and/or - # modify it under the terms of the GNU Library General Public -@@ -31,12 +31,22 @@ use File::Basename; - # - # Rules to run first of all - # -+ -+sub add_opt_values { -+ my ($self, $config)= @_; -+ -+ # add auto-options -+ $config->insert('OPT', 'port' => sub { fix_port($self, $config) }); -+ $config->insert('mysqld', "loose-skip-plugin-$_" => undef) for (@::optional_plugins); -+} -+ - my @pre_rules= - ( -+ \&add_opt_values, - ); - - --my @share_locations= ("share/mysql", "sql/share", "share"); -+my @share_locations= ("share/mariadb", "share/mysql", "sql/share", "share"); - - - sub get_basedir { -@@ -89,16 +99,12 @@ sub fix_pidfile { - - sub fix_port { - my ($self, $config, $group_name, $group)= @_; -- my $hostname= $group->value('#host'); -- return $self->{HOSTS}->{$hostname}++; -+ return $self->{PORT}++; - } - - sub fix_host { - my ($self)= @_; -- # Get next host from HOSTS array -- my @hosts= keys(%{$self->{HOSTS}});; -- my $host_no= $self->{NEXT_HOST}++ % @hosts; -- return $hosts[$host_no]; -+ 'localhost' - } - - sub is_unique { -@@ -169,13 +175,6 @@ sub fix_log_slow_queries { - return "$dir/mysqld-slow.log"; - } - --sub fix_secure_file_priv { -- my ($self)= @_; -- my $vardir= $self->{ARGS}->{vardir}; -- # By default, prevent the started mysqld to access files outside of vardir -- return $vardir; --} -- - sub fix_std_data { - my ($self, $config, $group_name, $group)= @_; - my $testdir= $self->get_testdir($group); -@@ -239,12 +238,18 @@ my @mysqld_rules= - { 'pid-file' => \&fix_pidfile }, - { '#host' => \&fix_host }, - { 'port' => \&fix_port }, -+ # galera base_port and port used during SST -+ { '#galera_port' => \&fix_port }, -+ # Galera uses base_port + 1 for IST, so we do not use it for things such as SST -+ { '#ist_port' => \&fix_port }, -+ { '#sst_port' => \&fix_port }, - { 'socket' => \&fix_socket }, - { '#log-error' => \&fix_log_error }, -- { 'general_log' => 1 }, -- { 'general_log_file' => \&fix_log }, -- { 'slow_query_log' => 1 }, -- { 'slow_query_log_file' => \&fix_log_slow_queries }, -+ { 'general-log' => 1 }, -+ { 'plugin-dir' => sub { $::plugindir } }, -+ { 'general-log-file' => \&fix_log }, -+ { 'slow-query-log' => 1 }, -+ { 'slow-query-log-file' => \&fix_log_slow_queries }, - { '#user' => sub { return shift->{ARGS}->{user} || ""; } }, - { '#password' => sub { return shift->{ARGS}->{password} || ""; } }, - { 'server-id' => \&fix_server_id, }, -@@ -265,7 +270,7 @@ if (IS_WINDOWS) - sub fix_ndb_mgmd_port { - my ($self, $config, $group_name, $group)= @_; - my $hostname= $group->value('HostName'); -- return $self->{HOSTS}->{$hostname}++; -+ return $self->{PORT}++; - } - - -@@ -307,8 +312,6 @@ my @ndbd_rules= - { 'BackupDataDir' => \&fix_cluster_backup_dir }, - ); - -- --# - # Rules to run for each memcached in the config - # - will be run in order listed here - # -@@ -396,7 +399,7 @@ sub post_check_client_group { - - if (! defined $option){ - #print $config; -- croak "Could not get value for '$name_from'"; -+ croak "Could not get value for '$name_from' for test $self->{testname}"; - } - $config->insert($client_group_name, $name_to, $option->value()) - } -@@ -419,7 +422,7 @@ sub post_check_client_group { - sub post_check_client_groups { - my ($self, $config)= @_; - -- my $first_mysqld= $config->first_like('mysqld.'); -+ my $first_mysqld= $config->first_like('mysqld\.'); - - return unless $first_mysqld; - -@@ -455,7 +458,7 @@ sub post_check_embedded_group { - my $first_mysqld= $config->first_like('mysqld.') or - croak "Can't run with embedded, config has no mysqld"; - -- my @no_copy = -+ my %no_copy = map { $_ => 1 } - ( - '#log-error', # Embedded server writes stderr to mysqltest's log file - 'slave-net-timeout', # Embedded server are not build with replication -@@ -464,7 +467,7 @@ sub post_check_embedded_group { - - foreach my $option ( $mysqld->options(), $first_mysqld->options() ) { - # Don't copy options whose name is in "no_copy" list -- next if grep ( $option->name() eq $_, @no_copy); -+ next if $no_copy{$option->name()}; - - $config->insert('embedded', $option->name(), $option->value()) - } -@@ -474,20 +477,24 @@ sub post_check_embedded_group { - - sub resolve_at_variable { - my ($self, $config, $group, $option)= @_; -+ local $_ = $option->value(); -+ my ($res, $after); - -- # Split the options value on last . -- my @parts= split(/\./, $option->value()); -- my $option_name= pop(@parts); -- my $group_name= join('.', @parts); -- -- $group_name =~ s/^\@//; # Remove at -+ while (m/(.*?)\@((?:\w+\.)+)(#?[-\w]+)/g) { -+ my ($before, $group_name, $option_name)= ($1, $2, $3); -+ $after = $'; -+ chop($group_name); - - my $from_group= $config->group($group_name) - or croak "There is no group named '$group_name' that ", -- "can be used to resolve '$option_name'"; -+ "can be used to resolve '$option_name' for test '$self->{testname}'"; - -- my $from= $from_group->value($option_name); -- $config->insert($group->name(), $option->name(), $from) -+ my $value= $from_group->value($option_name); -+ $res .= $before.$value; -+ } -+ $res .= $after; -+ -+ $config->insert($group->name(), $option->name(), $res) - } - - -@@ -499,7 +506,7 @@ sub post_fix_resolve_at_variables { - next unless defined $option->value(); - - $self->resolve_at_variable($config, $group, $option) -- if ($option->value() =~ /^\@/); -+ if ($option->value() =~ /\@/); - } - } - } -@@ -641,37 +648,21 @@ sub new_config { - croak "you must pass '$required'" unless defined $args->{$required}; - } - -- # Fill in hosts/port hash -- my $hosts= {}; -- my $baseport= $args->{baseport}; -- $args->{hosts}= [ 'localhost' ] unless exists($args->{hosts}); -- foreach my $host ( @{$args->{hosts}} ) { -- $hosts->{$host}= $baseport; -- } -- - # Open the config template - my $config= My::Config->new($args->{'template_path'}); -- my $extra_template_path= $args->{'extra_template_path'}; -- if ($extra_template_path){ -- $config->append(My::Config->new($extra_template_path)); -- } - my $self= bless { - CONFIG => $config, - ARGS => $args, -- HOSTS => $hosts, -- NEXT_HOST => 0, -+ PORT => $args->{baseport}, - SERVER_ID => 1, -+ testname => $args->{testname}, - }, $class; - -- -- { -- # Run pre rules -- foreach my $rule ( @pre_rules ) { -- &$rule($self, $config); -- } -+ # Run pre rules -+ foreach my $rule ( @pre_rules ) { -+ &$rule($self, $config); - } - -- - $self->run_section_rules($config, - 'cluster_config\.\w*$', - @cluster_config_rules); -@@ -689,9 +680,9 @@ sub new_config { - @mysqld_rules); - - $self->run_section_rules($config, -- 'memcached.', -- @memcached_rules); -- -+ 'memcached.', -+ @memcached_rules); -+ - # [mysqlbinlog] need additional settings - $self->run_rules_for_group($config, - $config->insert('mysqlbinlog'), -diff --git a/mysql-test/lib/My/ConfigFactory.pm.memcached b/mysql-test/lib/My/ConfigFactory.pm.memcached -new file mode 100644 -index 0000000..0b0e468 ---- /dev/null -+++ b/mysql-test/lib/My/ConfigFactory.pm.memcached -@@ -0,0 +1,718 @@ -+# -*- cperl -*- -+# Copyright (c) 2007, 2011, Oracle and/or its affiliates -+# -+# This program is free software; you can redistribute it and/or -+# modify it under the terms of the GNU Library General Public -+# License as published by the Free Software Foundation; version 2 -+# of the License. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+# Library General Public License for more details. -+# -+# You should have received a copy of the GNU 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 -+ -+package My::ConfigFactory; -+ -+use strict; -+use warnings; -+use Carp; -+ -+use My::Config; -+use My::Find; -+use My::Platform; -+ -+use File::Basename; -+ -+ -+# -+# Rules to run first of all -+# -+ -+sub add_opt_values { -+ my ($self, $config)= @_; -+ -+ # add auto-options -+ $config->insert('OPT', 'port' => sub { fix_port($self, $config) }); -+ $config->insert('mysqld', "loose-skip-plugin-$_" => undef) for (@::optional_plugins); -+} -+ -+my @pre_rules= -+( -+ \&add_opt_values, -+); -+ -+ -+my @share_locations= ("share/mariadb", "share/mysql", "sql/share", "share"); -+ -+ -+sub get_basedir { -+ my ($self, $group)= @_; -+ my $basedir= $group->if_exist('basedir') || -+ $self->{ARGS}->{basedir}; -+ return $basedir; -+} -+ -+sub get_testdir { -+ my ($self, $group)= @_; -+ my $testdir= $group->if_exist('testdir') || -+ $self->{ARGS}->{testdir}; -+ return $testdir; -+} -+ -+# Retrive build directory (which is different from basedir in out-of-source build) -+sub get_bindir { -+ if (defined $ENV{MTR_BINDIR}) -+ { -+ return $ENV{MTR_BINDIR}; -+ } -+ my ($self, $group)= @_; -+ return $self->get_basedir($group); -+} -+ -+sub fix_charset_dir { -+ my ($self, $config, $group_name, $group)= @_; -+ return my_find_dir($self->get_basedir($group), -+ \@share_locations, "charsets"); -+} -+ -+sub fix_language { -+ my ($self, $config, $group_name, $group)= @_; -+ return my_find_dir($self->get_bindir($group), -+ \@share_locations); -+} -+ -+sub fix_datadir { -+ my ($self, $config, $group_name)= @_; -+ my $vardir= $self->{ARGS}->{vardir}; -+ return "$vardir/$group_name/data"; -+} -+ -+sub fix_pidfile { -+ my ($self, $config, $group_name, $group)= @_; -+ my $vardir= $self->{ARGS}->{vardir}; -+ return "$vardir/run/$group_name.pid"; -+} -+ -+sub fix_port { -+ my ($self, $config, $group_name, $group)= @_; -+ return $self->{PORT}++; -+} -+ -+sub fix_host { -+ my ($self)= @_; -+ 'localhost' -+} -+ -+sub is_unique { -+ my ($config, $name, $value)= @_; -+ -+ foreach my $group ( $config->groups() ) { -+ if ($group->option($name)) { -+ if ($group->value($name) eq $value){ -+ return 0; -+ } -+ } -+ } -+ return 1; -+} -+ -+sub fix_server_id { -+ my ($self, $config, $group_name, $group)= @_; -+#define in the order that mysqlds are listed in my.cnf -+ -+ my $server_id= $group->if_exist('server-id'); -+ if (defined $server_id){ -+ if (!is_unique($config, 'server-id', $server_id)) { -+ croak "The server-id($server_id) for '$group_name' is not unique"; -+ } -+ return $server_id; -+ } -+ -+ do { -+ $server_id= $self->{SERVER_ID}++; -+ } while(!is_unique($config, 'server-id', $server_id)); -+ -+ #print "$group_name: server_id: $server_id\n"; -+ return $server_id; -+} -+ -+sub fix_socket { -+ my ($self, $config, $group_name, $group)= @_; -+ # Put socket file in tmpdir -+ my $dir= $self->{ARGS}->{tmpdir}; -+ return "$dir/$group_name.sock"; -+} -+ -+sub fix_tmpdir { -+ my ($self, $config, $group_name, $group)= @_; -+ my $dir= $self->{ARGS}->{tmpdir}; -+ return "$dir/$group_name"; -+} -+ -+sub fix_log_error { -+ my ($self, $config, $group_name, $group)= @_; -+ my $dir= $self->{ARGS}->{vardir}; -+ if ( $::opt_valgrind and $::opt_debug ) { -+ return "$dir/log/$group_name.trace"; -+ } else { -+ return "$dir/log/$group_name.err"; -+ } -+} -+ -+sub fix_log { -+ my ($self, $config, $group_name, $group)= @_; -+ my $dir= dirname($group->value('datadir')); -+ return "$dir/mysqld.log"; -+} -+ -+sub fix_log_slow_queries { -+ my ($self, $config, $group_name, $group)= @_; -+ my $dir= dirname($group->value('datadir')); -+ return "$dir/mysqld-slow.log"; -+} -+ -+sub fix_std_data { -+ my ($self, $config, $group_name, $group)= @_; -+ my $testdir= $self->get_testdir($group); -+ return "$testdir/std_data"; -+} -+ -+sub ssl_supported { -+ my ($self)= @_; -+ return $self->{ARGS}->{ssl}; -+} -+ -+sub fix_skip_ssl { -+ return if !ssl_supported(@_); -+ # Add skip-ssl if ssl is supported to avoid -+ # that mysqltest connects with SSL by default -+ return 1; -+} -+ -+sub fix_ssl_ca { -+ return if !ssl_supported(@_); -+ my $std_data= fix_std_data(@_); -+ return "$std_data/cacert.pem" -+} -+ -+sub fix_ssl_server_cert { -+ return if !ssl_supported(@_); -+ my $std_data= fix_std_data(@_); -+ return "$std_data/server-cert.pem" -+} -+ -+sub fix_ssl_client_cert { -+ return if !ssl_supported(@_); -+ my $std_data= fix_std_data(@_); -+ return "$std_data/client-cert.pem" -+} -+ -+sub fix_ssl_server_key { -+ return if !ssl_supported(@_); -+ my $std_data= fix_std_data(@_); -+ return "$std_data/server-key.pem" -+} -+ -+sub fix_ssl_client_key { -+ return if !ssl_supported(@_); -+ my $std_data= fix_std_data(@_); -+ return "$std_data/client-key.pem" -+} -+ -+ -+# -+# Rules to run for each mysqld in the config -+# - will be run in order listed here -+# -+my @mysqld_rules= -+ ( -+ { 'basedir' => sub { return shift->{ARGS}->{basedir}; } }, -+ { 'tmpdir' => \&fix_tmpdir }, -+ { 'character-sets-dir' => \&fix_charset_dir }, -+ { 'lc-messages-dir' => \&fix_language }, -+ { 'datadir' => \&fix_datadir }, -+ { 'pid-file' => \&fix_pidfile }, -+ { '#host' => \&fix_host }, -+ { 'port' => \&fix_port }, -+ # galera base_port and port used during SST -+ { '#galera_port' => \&fix_port }, -+ { '#sst_port' => \&fix_port }, -+ { '#memcached_port' => \&fix_port }, -+ { 'socket' => \&fix_socket }, -+ { '#log-error' => \&fix_log_error }, -+ { 'general-log' => 1 }, -+ { 'plugin-dir' => sub { $::plugindir } }, -+ { 'general-log-file' => \&fix_log }, -+ { 'slow-query-log' => 1 }, -+ { 'slow-query-log-file' => \&fix_log_slow_queries }, -+ { '#user' => sub { return shift->{ARGS}->{user} || ""; } }, -+ { '#password' => sub { return shift->{ARGS}->{password} || ""; } }, -+ { 'server-id' => \&fix_server_id, }, -+ # By default, prevent the started mysqld to access files outside of vardir -+ { 'secure-file-priv' => sub { return shift->{ARGS}->{vardir}; } }, -+ { 'ssl-ca' => \&fix_ssl_ca }, -+ { 'ssl-cert' => \&fix_ssl_server_cert }, -+ { 'ssl-key' => \&fix_ssl_server_key }, -+ ); -+ -+if (IS_WINDOWS) -+{ -+ # For simplicity, we use the same names for shared memory and -+ # named pipes. -+ push(@mysqld_rules, {'shared-memory-base-name' => \&fix_socket}); -+} -+ -+sub fix_ndb_mgmd_port { -+ my ($self, $config, $group_name, $group)= @_; -+ my $hostname= $group->value('HostName'); -+ return $self->{PORT}++; -+} -+ -+ -+sub fix_cluster_dir { -+ my ($self, $config, $group_name, $group)= @_; -+ my $vardir= $self->{ARGS}->{vardir}; -+ my (undef, $process_type, $idx, $suffix)= split(/\./, $group_name); -+ return "$vardir/mysql_cluster.$suffix/$process_type.$idx"; -+} -+ -+ -+sub fix_cluster_backup_dir { -+ my ($self, $config, $group_name, $group)= @_; -+ my $vardir= $self->{ARGS}->{vardir}; -+ my (undef, $process_type, $idx, $suffix)= split(/\./, $group_name); -+ return "$vardir/mysql_cluster.$suffix/"; -+} -+ -+ -+# -+# Rules to run for each ndb_mgmd in the config -+# - will be run in order listed here -+# -+my @ndb_mgmd_rules= -+( -+ { 'PortNumber' => \&fix_ndb_mgmd_port }, -+ { 'DataDir' => \&fix_cluster_dir }, -+); -+ -+ -+# -+# Rules to run for each ndbd in the config -+# - will be run in order listed here -+# -+my @ndbd_rules= -+( -+ { 'HostName' => \&fix_host }, -+ { 'DataDir' => \&fix_cluster_dir }, -+ { 'BackupDataDir' => \&fix_cluster_backup_dir }, -+); -+ -+# Rules to run for each memcached in the config -+# - will be run in order listed here -+# -+my @memcached_rules= -+( -+ { '#host' => \&fix_host }, -+ { 'port' => \&fix_port }, -+); -+ -+# -+# Rules to run for each cluster_config section -+# - will be run in order listed here -+# -+my @cluster_config_rules= -+( -+ { 'ndb_mgmd' => \&fix_host }, -+ { 'ndbd' => \&fix_host }, -+ { 'mysqld' => \&fix_host }, -+ { 'ndbapi' => \&fix_host }, -+); -+ -+ -+# -+# Rules to run for [client] section -+# - will be run in order listed here -+# -+my @client_rules= -+( -+); -+ -+ -+# -+# Rules to run for [mysqltest] section -+# - will be run in order listed here -+# -+my @mysqltest_rules= -+( -+ { 'ssl-ca' => \&fix_ssl_ca }, -+ { 'ssl-cert' => \&fix_ssl_client_cert }, -+ { 'ssl-key' => \&fix_ssl_client_key }, -+ { 'skip-ssl' => \&fix_skip_ssl }, -+); -+ -+ -+# -+# Rules to run for [mysqlbinlog] section -+# - will be run in order listed here -+# -+my @mysqlbinlog_rules= -+( -+ { 'character-sets-dir' => \&fix_charset_dir }, -+); -+ -+ -+# -+# Rules to run for [mysql_upgrade] section -+# - will be run in order listed here -+# -+my @mysql_upgrade_rules= -+( -+ { 'tmpdir' => sub { return shift->{ARGS}->{tmpdir}; } }, -+); -+ -+ -+# -+# Generate a [client.] group to be -+# used for connecting to [mysqld.] -+# -+sub post_check_client_group { -+ my ($self, $config, $client_group_name, $mysqld_group_name)= @_; -+ -+ -+ # Settings needed for client, copied from its "mysqld" -+ my %client_needs= -+ ( -+ port => 'port', -+ socket => 'socket', -+ host => '#host', -+ user => '#user', -+ password => '#password', -+ ); -+ my $group_to_copy_from= $config->group($mysqld_group_name); -+ while (my ($name_to, $name_from)= each( %client_needs )) { -+ my $option= $group_to_copy_from->option($name_from); -+ -+ if (! defined $option){ -+ #print $config; -+ croak "Could not get value for '$name_from' for test $self->{testname}"; -+ } -+ $config->insert($client_group_name, $name_to, $option->value()) -+ } -+ -+ if (IS_WINDOWS) -+ { -+ if (! $self->{ARGS}->{embedded}) -+ { -+ # Shared memory base may or may not be defined (e.g not defined in embedded) -+ my $shm = $group_to_copy_from->option("shared-memory-base-name"); -+ if (defined $shm) -+ { -+ $config->insert($client_group_name,"shared-memory-base-name", $shm->value()); -+ } -+ } -+ } -+} -+ -+ -+sub post_check_client_groups { -+ my ($self, $config)= @_; -+ -+ my $first_mysqld= $config->first_like('mysqld\.'); -+ -+ return unless $first_mysqld; -+ -+ # Always generate [client] pointing to the first -+ # [mysqld.] -+ $self->post_check_client_group($config, -+ 'client', -+ $first_mysqld->name()); -+ -+ # Then generate [client.] for each [mysqld.] -+ foreach my $mysqld ( $config->like('mysqld.') ) { -+ $self->post_check_client_group($config, -+ 'client'.$mysqld->after('mysqld'), -+ $mysqld->name()) -+ } -+ -+} -+ -+ -+# -+# Generate [embedded] by copying the values -+# needed from the default [mysqld] section -+# and from first [mysqld.] -+# -+sub post_check_embedded_group { -+ my ($self, $config)= @_; -+ -+ return unless $self->{ARGS}->{embedded}; -+ -+ my $mysqld= $config->group('mysqld') or -+ croak "Can't run with embedded, config has no default mysqld section"; -+ -+ my $first_mysqld= $config->first_like('mysqld.') or -+ croak "Can't run with embedded, config has no mysqld"; -+ -+ my %no_copy = map { $_ => 1 } -+ ( -+ '#log-error', # Embedded server writes stderr to mysqltest's log file -+ 'slave-net-timeout', # Embedded server are not build with replication -+ 'shared-memory-base-name', # No shared memory for embedded -+ ); -+ -+ foreach my $option ( $mysqld->options(), $first_mysqld->options() ) { -+ # Don't copy options whose name is in "no_copy" list -+ next if $no_copy{$option->name()}; -+ -+ $config->insert('embedded', $option->name(), $option->value()) -+ } -+ -+} -+ -+ -+sub resolve_at_variable { -+ my ($self, $config, $group, $option)= @_; -+ local $_ = $option->value(); -+ my ($res, $after); -+ -+ while (m/(.*?)\@((?:\w+\.)+)(#?[-\w]+)/g) { -+ my ($before, $group_name, $option_name)= ($1, $2, $3); -+ $after = $'; -+ chop($group_name); -+ -+ my $from_group= $config->group($group_name) -+ or croak "There is no group named '$group_name' that ", -+ "can be used to resolve '$option_name' for test '$self->{testname}'"; -+ -+ my $value= $from_group->value($option_name); -+ $res .= $before.$value; -+ } -+ $res .= $after; -+ -+ $config->insert($group->name(), $option->name(), $res) -+} -+ -+ -+sub post_fix_resolve_at_variables { -+ my ($self, $config)= @_; -+ -+ foreach my $group ( $config->groups() ) { -+ foreach my $option ( $group->options()) { -+ next unless defined $option->value(); -+ -+ $self->resolve_at_variable($config, $group, $option) -+ if ($option->value() =~ /\@/); -+ } -+ } -+} -+ -+sub post_fix_mysql_cluster_section { -+ my ($self, $config)= @_; -+ -+ # Add a [mysl_cluster.] section for each -+ # defined [cluster_config.] section -+ foreach my $group ( $config->like('cluster_config\.\w*$') ) -+ { -+ my @urls; -+ # Generate ndb_connectstring for this cluster -+ foreach my $ndb_mgmd ( $config->like('cluster_config.ndb_mgmd.')) { -+ if ($ndb_mgmd->suffix() eq $group->suffix()) { -+ my $host= $ndb_mgmd->value('HostName'); -+ my $port= $ndb_mgmd->value('PortNumber'); -+ push(@urls, "$host:$port"); -+ } -+ } -+ croak "Could not generate valid ndb_connectstring for '$group'" -+ unless @urls > 0; -+ my $ndb_connectstring= join(";", @urls); -+ -+ # Add ndb_connectstring to [mysql_cluster.] -+ $config->insert('mysql_cluster'.$group->suffix(), -+ 'ndb_connectstring', $ndb_connectstring); -+ -+ # Add ndb_connectstring to each mysqld connected to this -+ # cluster -+ foreach my $mysqld ( $config->like('cluster_config.mysqld.')) { -+ if ($mysqld->suffix() eq $group->suffix()) { -+ my $after= $mysqld->after('cluster_config.mysqld'); -+ $config->insert("mysqld$after", -+ 'ndb_connectstring', $ndb_connectstring); -+ } -+ } -+ } -+} -+ -+# -+# Rules to run last of all -+# -+my @post_rules= -+( -+ \&post_check_client_groups, -+ \&post_fix_mysql_cluster_section, -+ \&post_fix_resolve_at_variables, -+ \&post_check_embedded_group, -+); -+ -+ -+sub run_rules_for_group { -+ my ($self, $config, $group, @rules)= @_; -+ foreach my $hash ( @rules ) { -+ while (my ($option, $rule)= each( %{$hash} )) { -+ # Only run this rule if the value is not already defined -+ if (!$config->exists($group->name(), $option)) { -+ my $value; -+ if (ref $rule eq "CODE") { -+ # Call the rule function -+ $value= &$rule($self, $config, $group->name(), -+ $config->group($group->name())); -+ } else { -+ $value= $rule; -+ } -+ if (defined $value) { -+ $config->insert($group->name(), $option, $value, 1); -+ } -+ } -+ } -+ } -+} -+ -+ -+sub run_section_rules { -+ my ($self, $config, $name, @rules)= @_; -+ -+ foreach my $group ( $config->like($name) ) { -+ $self->run_rules_for_group($config, $group, @rules); -+ } -+} -+ -+ -+sub run_generate_sections_from_cluster_config { -+ my ($self, $config)= @_; -+ -+ my @options= ('ndb_mgmd', 'ndbd', -+ 'mysqld', 'ndbapi'); -+ -+ foreach my $group ( $config->like('cluster_config\.\w*$') ) { -+ -+ # Keep track of current index per process type -+ my %idxes; -+ map { $idxes{$_}= 1; } @options; -+ -+ foreach my $option_name ( @options ) { -+ my $value= $group->value($option_name); -+ my @hosts= split(/,/, $value, -1); # -1 => return also empty strings -+ -+ # Add at least one host -+ push(@hosts, undef) unless scalar(@hosts); -+ -+ # Assign hosts unless already fixed -+ @hosts= map { $self->fix_host() unless $_; } @hosts; -+ -+ # Write the hosts value back -+ $group->insert($option_name, join(",", @hosts)); -+ -+ # Generate sections for each host -+ foreach my $host ( @hosts ){ -+ my $idx= $idxes{$option_name}++; -+ -+ my $suffix= $group->suffix(); -+ # Generate a section for ndb_mgmd to read -+ $config->insert("cluster_config.$option_name.$idx$suffix", -+ "HostName", $host); -+ -+ if ($option_name eq 'mysqld'){ -+ my $datadir= -+ $self->fix_cluster_dir($config, -+ "cluster_config.mysqld.$idx$suffix", -+ $group); -+ $config->insert("mysqld.$idx$suffix", -+ 'datadir', "$datadir/data"); -+ } -+ } -+ } -+ } -+} -+ -+ -+sub new_config { -+ my ($class, $args)= @_; -+ -+ my @required_args= ('basedir', 'baseport', 'vardir', 'template_path'); -+ -+ foreach my $required ( @required_args ) { -+ croak "you must pass '$required'" unless defined $args->{$required}; -+ } -+ -+ # Open the config template -+ my $config= My::Config->new($args->{'template_path'}); -+ my $self= bless { -+ CONFIG => $config, -+ ARGS => $args, -+ PORT => $args->{baseport}, -+ SERVER_ID => 1, -+ testname => $args->{testname}, -+ }, $class; -+ -+ # Run pre rules -+ foreach my $rule ( @pre_rules ) { -+ &$rule($self, $config); -+ } -+ -+ $self->run_section_rules($config, -+ 'cluster_config\.\w*$', -+ @cluster_config_rules); -+ $self->run_generate_sections_from_cluster_config($config); -+ -+ $self->run_section_rules($config, -+ 'cluster_config.ndb_mgmd.', -+ @ndb_mgmd_rules); -+ $self->run_section_rules($config, -+ 'cluster_config.ndbd', -+ @ndbd_rules); -+ -+ $self->run_section_rules($config, -+ 'mysqld.', -+ @mysqld_rules); -+ -+ $self->run_section_rules($config, -+ 'memcached.', -+ @memcached_rules); -+ -+ # [mysqlbinlog] need additional settings -+ $self->run_rules_for_group($config, -+ $config->insert('mysqlbinlog'), -+ @mysqlbinlog_rules); -+ -+ # [mysql_upgrade] need additional settings -+ $self->run_rules_for_group($config, -+ $config->insert('mysql_upgrade'), -+ @mysql_upgrade_rules); -+ -+ # Additional rules required for [client] -+ $self->run_rules_for_group($config, -+ $config->insert('client'), -+ @client_rules); -+ -+ -+ # Additional rules required for [mysqltest] -+ $self->run_rules_for_group($config, -+ $config->insert('mysqltest'), -+ @mysqltest_rules); -+ -+ { -+ # Run post rules -+ foreach my $rule ( @post_rules ) { -+ &$rule($self, $config); -+ } -+ } -+ -+ return $config; -+} -+ -+ -+1; -+ -diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm -index eed3100..d3a36e8 100644 ---- a/mysql-test/lib/mtr_cases.pm -+++ b/mysql-test/lib/mtr_cases.pm -@@ -509,6 +509,9 @@ sub collect_one_suite($) - my @new_cases; - foreach my $comb (@combinations) - { -+ # ENV is used in My::Config::ENV to store the environment so is not a true combination -+ next if ( $comb->{'name'} eq 'ENV' ); -+ - foreach my $test (@cases) - { - -diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl -index 82b5d1c..da9876a 100755 ---- a/mysql-test/mysql-test-run.pl -+++ b/mysql-test/mysql-test-run.pl -@@ -360,6 +360,8 @@ sub main { - gcov_prepare($basedir); - } - -+ check_wsrep_support(); -+ - if (!$opt_suites) { - $opt_suites= $DEFAULT_SUITES; - } -@@ -2895,7 +2897,6 @@ sub check_ndbcluster_support ($) { - # which is the default case - return; - } -- - if ($opt_skip_ndbcluster) - { - # Compiled with ndbcluster but ndbcluster skipped -@@ -3311,6 +3312,49 @@ sub ndbcluster_start ($) { - } - - -+sub have_wsrep() { -+ my $wsrep_on= $mysqld_variables{'wsrep-on'}; -+ return defined $wsrep_on -+} -+ -+ -+sub check_wsrep_support() { -+ if (have_wsrep()) -+ { -+ mtr_report(" - binaries built with wsrep patch"); -+ -+ # ADD scripts to $PATH to that wsrep_sst_* can be found -+ my ($path) = grep { -f "$_/wsrep_sst_rsync"; } "$::bindir/scripts", $::path_client_bindir; -+ mtr_error("No SST scripts") unless $path; -+ $ENV{PATH}="$path:$ENV{PATH}"; -+ -+ # Check whether WSREP_PROVIDER environment variable is set. -+ if (defined $ENV{'WSREP_PROVIDER'}) { -+ if ((mtr_file_exists($ENV{'WSREP_PROVIDER'}) eq "") && -+ ($ENV{'WSREP_PROVIDER'} ne "none")) { -+ mtr_error("WSREP_PROVIDER env set to an invalid path"); -+ } -+ # WSREP_PROVIDER is valid; set to a valid path or "none"). -+ mtr_verbose("WSREP_PROVIDER env set to $ENV{'WSREP_PROVIDER'}"); -+ } else { -+ # WSREP_PROVIDER env not defined. Lets try to locate the wsrep provider -+ # library. -+ my $file_wsrep_provider= -+ mtr_file_exists("/usr/lib/galera/libgalera_smm.so", -+ "/usr/lib64/galera/libgalera_smm.so"); -+ -+ if ($file_wsrep_provider ne "") { -+ # wsrep provider library found ! -+ mtr_verbose("wsrep provider library found : $file_wsrep_provider"); -+ $ENV{'WSREP_PROVIDER'}= $file_wsrep_provider; -+ } else { -+ mtr_verbose("Could not find wsrep provider library, setting it to 'none'"); -+ $ENV{'WSREP_PROVIDER'}= "none"; -+ } -+ } -+ } -+} -+ - sub create_config_file_for_extern { - my %opts= - ( -@@ -3737,6 +3781,24 @@ sub run_query { - } - - -+sub sleep_until_returns_true($$$) { -+ my ($tinfo, $mysqld, $query)= @_; -+ -+ my $timeout = $opt_start_timeout; -+ my $sleeptime= 100; # Milliseconds -+ my $loops= ($timeout * 1000) / $sleeptime; -+ -+ for ( my $loop= 1; $loop <= $loops; $loop++ ) { -+ my $query_result = run_query($tinfo, $mysqld, $query); -+ if (run_query($tinfo, $mysqld, $query) == 1) { -+ return 0; -+ } -+ } -+ -+ return 1; -+} -+ -+ - sub do_before_run_mysqltest($) - { - my $tinfo= shift; -@@ -5785,6 +5847,13 @@ sub start_servers($) { - } - return 1; - } -+ -+ if (have_wsrep()) { -+ if(sleep_until_returns_true($tinfo, $mysqld, 'SELECT @@wsrep_ready')) { -+ $tinfo->{logfile}= "WSREP did not transition to state READY"; -+ return 1; -+ } -+ } - } - - # Start memcached(s) for each cluster -diff --git a/mysql-test/r/galera_sst_mode.result b/mysql-test/r/galera_sst_mode.result -new file mode 100644 -index 0000000..ea25b32 ---- /dev/null -+++ b/mysql-test/r/galera_sst_mode.result -@@ -0,0 +1,24 @@ -+# -+# Test for mysqldump's galera-sst-mode option -+# -+# -+# MDEV-6490: mysqldump unknown option --galera-sst-mode -+# -+CREATE DATABASE bug6490; -+USE bug6490; -+CREATE TABLE t1(c1 INT); -+INSERT INTO t1 values (1); -+INSERT INTO t1 values (2); -+# Save the current gtid_binlog_state. -+# Take a dump of bug6490 database -+DROP TABLE t1; -+# Load the dump -+RESET MASTER; -+SELECT * from t1; -+c1 -+1 -+2 -+# Compare the two gtid_binlog_state's -+# Cleanup -+DROP DATABASE bug6490; -+# End of test -diff --git a/mysql-test/r/have_wsrep.require b/mysql-test/r/have_wsrep.require -new file mode 100644 -index 0000000..af32ac7 ---- /dev/null -+++ b/mysql-test/r/have_wsrep.require -@@ -0,0 +1,2 @@ -+Variable_name Value -+wsrep_on ON -diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result -index fce2f40..149babc 100644 ---- a/mysql-test/r/information_schema.result -+++ b/mysql-test/r/information_schema.result -@@ -1664,9 +1664,7 @@ drop table if exists t1;drop table if exists t1; - drop table if exists t1;drop table if exists t1; - drop table if exists t1;drop table if exists t1; - drop table if exists t1;drop table if exists t1; --drop table if exists t1;drop table if exists --Warnings: --Warning 1265 Data truncated for column 'VARIABLE_VALUE' at row 1 -+drop table if exists t1;drop table if exists t1; - set global init_connect=""; - create table t0 select * from information_schema.global_status where VARIABLE_NAME='COM_SELECT'; - SELECT 1; -diff --git a/mysql-test/r/mysqld--help-notwin.result b/mysql-test/r/mysqld--help-notwin.result -index 18b21ff..d31ef0f 100644 ---- a/mysql-test/r/mysqld--help-notwin.result -+++ b/mysql-test/r/mysqld--help-notwin.result -@@ -1010,6 +1010,94 @@ The following options may be given as the first argument: - -V, --version Output version information and exit. - --wait-timeout=# The number of seconds the server waits for activity on a - connection before closing it -+ --wsrep-OSU-method[=name] -+ Method for Online Schema Upgrade -+ --wsrep-auto-increment-control -+ To automatically control the assignment of autoincrement -+ variables -+ (Defaults to on; use --skip-wsrep-auto-increment-control to disable.) -+ --wsrep-causal-reads -+ (DEPRECATED) setting this variable is equivalent to -+ setting wsrep_sync_wait READ flag -+ --wsrep-certify-nonPK -+ Certify tables with no primary key -+ (Defaults to on; use --skip-wsrep-certify-nonPK to disable.) -+ --wsrep-cluster-address=name -+ Address to initially connect to cluster -+ --wsrep-cluster-name=name -+ Name for the cluster -+ --wsrep-convert-LOCK-to-trx -+ To convert locking sessions into transactions -+ --wsrep-data-home-dir=name -+ home directory for wsrep provider -+ --wsrep-dbug-option=name -+ DBUG options to provider library -+ --wsrep-debug To enable debug level logging -+ --wsrep-desync To desynchronize the node from the cluster -+ --wsrep-drupal-282555-workaround -+ To use a workaround forbad autoincrement value -+ --wsrep-forced-binlog-format=name -+ binlog format to take effect over user's choice -+ --wsrep-load-data-splitting -+ To commit LOAD DATA transaction after every 10K rows -+ inserted -+ (Defaults to on; use --skip-wsrep-load-data-splitting to disable.) -+ --wsrep-log-conflicts -+ To log multi-master conflicts -+ --wsrep-max-ws-rows=# -+ Max number of rows in write set -+ --wsrep-max-ws-size=# -+ Max write set size (bytes) -+ --wsrep-mysql-replication-bundle=# -+ mysql replication group commit -+ --wsrep-node-address=name -+ Node address -+ --wsrep-node-incoming-address=name -+ Client connection address -+ --wsrep-node-name=name -+ Node name -+ --wsrep-notify-cmd=name -+ --wsrep-on To enable wsrep replication -+ (Defaults to on; use --skip-wsrep-on to disable.) -+ --wsrep-preordered To enable preordered write set processing -+ --wsrep-provider=name -+ Path to replication provider library -+ --wsrep-provider-options=name -+ provider specific options -+ --wsrep-recover Recover database state after crash and exit -+ --wsrep-replicate-myisam -+ To enable myisam replication -+ --wsrep-restart-slave -+ Should MySQL slave be restarted automatically, when node -+ joins back to cluster -+ --wsrep-retry-autocommit=# -+ Max number of times to retry a failed autocommit -+ statement -+ --wsrep-slave-FK-checks -+ Should slave thread do foreign key constraint checks -+ (Defaults to on; use --skip-wsrep-slave-FK-checks to disable.) -+ --wsrep-slave-UK-checks -+ Should slave thread do secondary index uniqueness chesks -+ --wsrep-slave-threads=# -+ Number of slave appliers to launch -+ --wsrep-sst-auth=name -+ Authentication for SST connection -+ --wsrep-sst-donor=name -+ preferred donor node for the SST -+ --wsrep-sst-donor-rejects-queries -+ Reject client queries when donating state snapshot -+ transfer -+ --wsrep-sst-method=name -+ State snapshot transfer method -+ --wsrep-sst-receive-address=name -+ Address where node is waiting for SST contact -+ --wsrep-start-position=name -+ global transaction position to start from -+ --wsrep-sync-wait[=#] -+ Ensure "synchronous" read view before executing an -+ operation of the type specified by bitmask: 1 - -+ READ(includes SELECT, SHOW and BEGIN/START TRANSACTION); -+ 2 - UPDATE and DELETE; 4 - INSERT and REPLACE - - Variables (--variable-name=value) - abort-slave-event-count 0 -@@ -1299,6 +1387,45 @@ updatable-views-with-limit YES - validate-user-plugins TRUE - verbose TRUE - wait-timeout 28800 -+wsrep-OSU-method TOI -+wsrep-auto-increment-control TRUE -+wsrep-causal-reads FALSE -+wsrep-certify-nonPK TRUE -+wsrep-cluster-address -+wsrep-cluster-name my_wsrep_cluster -+wsrep-convert-LOCK-to-trx FALSE -+wsrep-data-home-dir -+wsrep-dbug-option -+wsrep-debug FALSE -+wsrep-desync FALSE -+wsrep-drupal-282555-workaround FALSE -+wsrep-forced-binlog-format NONE -+wsrep-load-data-splitting TRUE -+wsrep-log-conflicts FALSE -+wsrep-max-ws-rows 131072 -+wsrep-max-ws-size 1073741824 -+wsrep-mysql-replication-bundle 0 -+wsrep-node-address -+wsrep-node-incoming-address AUTO -+wsrep-notify-cmd -+wsrep-on FALSE -+wsrep-preordered FALSE -+wsrep-provider none -+wsrep-provider-options -+wsrep-recover FALSE -+wsrep-replicate-myisam FALSE -+wsrep-restart-slave FALSE -+wsrep-retry-autocommit 1 -+wsrep-slave-FK-checks TRUE -+wsrep-slave-UK-checks FALSE -+wsrep-slave-threads 1 -+wsrep-sst-auth (No default value) -+wsrep-sst-donor -+wsrep-sst-donor-rejects-queries FALSE -+wsrep-sst-method rsync -+wsrep-sst-receive-address AUTO -+wsrep-start-position 00000000-0000-0000-0000-000000000000:-1 -+wsrep-sync-wait 0 - - To see what values a running MySQL server is using, type - 'mysqladmin variables' instead of 'mysqld --verbose --help'. -diff --git a/mysql-test/r/not_wsrep.require b/mysql-test/r/not_wsrep.require -new file mode 100644 -index 0000000..7c8e74a ---- /dev/null -+++ b/mysql-test/r/not_wsrep.require -@@ -0,0 +1,2 @@ -+HAVE_WSREP -+0 -diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result -index 92d3147..8bc7b0e 100644 ---- a/mysql-test/r/show_check.result -+++ b/mysql-test/r/show_check.result -@@ -101,19 +101,19 @@ drop table t1; - show variables like "wait_timeout%"; - Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr - def information_schema VARIABLES VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8 --def information_schema VARIABLES VARIABLES VARIABLE_VALUE Value 253 1024 5 Y 0 0 8 -+def information_schema VARIABLES VARIABLES VARIABLE_VALUE Value 253 2048 5 Y 0 0 8 - Variable_name Value - wait_timeout 28800 - show variables like "WAIT_timeout%"; - Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr - def information_schema VARIABLES VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8 --def information_schema VARIABLES VARIABLES VARIABLE_VALUE Value 253 1024 5 Y 0 0 8 -+def information_schema VARIABLES VARIABLES VARIABLE_VALUE Value 253 2048 5 Y 0 0 8 - Variable_name Value - wait_timeout 28800 - show variables like "this_doesn't_exists%"; - Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr - def information_schema VARIABLES VARIABLES VARIABLE_NAME Variable_name 253 64 0 N 1 0 8 --def information_schema VARIABLES VARIABLES VARIABLE_VALUE Value 253 1024 0 Y 0 0 8 -+def information_schema VARIABLES VARIABLES VARIABLE_VALUE Value 253 2048 0 Y 0 0 8 - Variable_name Value - show table status from test like "this_doesn't_exists%"; - Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr -diff --git a/mysql-test/std_data/wsrep_notify.sh b/mysql-test/std_data/wsrep_notify.sh -new file mode 100644 -index 0000000..7036f60 ---- /dev/null -+++ b/mysql-test/std_data/wsrep_notify.sh -@@ -0,0 +1,99 @@ -+#!/bin/sh -eu -+ -+# This is a simple example of wsrep notification script (wsrep_notify_cmd). -+# It will create 'wsrep' schema and two tables in it: 'membeship' and 'status' -+# and fill them on every membership or node status change. -+# -+# Edit parameters below to specify the address and login to server. -+ -+USER=root -+HOST=127.0.0.1 -+PORT=$NODE_MYPORT_1 -+ -+SCHEMA="mtr_wsrep_notify" -+MEMB_TABLE="$SCHEMA.membership" -+STATUS_TABLE="$SCHEMA.status" -+ -+BEGIN=" -+SET wsrep_on=0; -+CREATE SCHEMA IF NOT EXISTS $SCHEMA; -+CREATE TABLE IF NOT EXISTS $MEMB_TABLE ( -+ idx INT, -+ uuid CHAR(40), /* node UUID */ -+ name VARCHAR(32), /* node name */ -+ addr VARCHAR(256) /* node address */ -+) ENGINE=MEMORY; -+CREATE TABLE IF NOT EXISTS $STATUS_TABLE ( -+ size INT, /* component size */ -+ idx INT, /* this node index */ -+ status CHAR(16), /* this node status */ -+ uuid CHAR(40), /* cluster UUID */ -+ prim BOOLEAN /* if component is primary */ -+) ENGINE=MEMORY; -+BEGIN; -+" -+END="COMMIT;" -+ -+configuration_change() -+{ -+ echo "$BEGIN;" -+ -+ local idx=0 -+ -+ for NODE in $(echo $MEMBERS | sed s/,/\ /g) -+ do -+ echo "INSERT INTO $MEMB_TABLE VALUES ( $idx, " -+ # Don't forget to properly quote string values -+ echo "'$NODE'" | sed s/\\//\',\'/g -+ echo ");" -+ idx=$(( $idx + 1 )) -+ done -+ -+ echo "INSERT INTO $STATUS_TABLE VALUES($idx, $INDEX, '$STATUS', '$CLUSTER_UUID', $PRIMARY);" -+ -+ echo "$END" -+} -+ -+status_update() -+{ -+ echo "SET wsrep_on=0; BEGIN; UPDATE $STATUS_TABLE SET status='$STATUS'; COMMIT;" -+} -+ -+COM=status_update # not a configuration change by default -+ -+while [ $# -gt 0 ] -+do -+ case $1 in -+ --status) -+ STATUS=$2 -+ shift -+ ;; -+ --uuid) -+ CLUSTER_UUID=$2 -+ shift -+ ;; -+ --primary) -+ [ "$2" = "yes" ] && PRIMARY="1" || PRIMARY="0" -+ COM=configuration_change -+ shift -+ ;; -+ --index) -+ INDEX=$2 -+ shift -+ ;; -+ --members) -+ MEMBERS=$2 -+ shift -+ ;; -+ esac -+ shift -+done -+ -+# Undefined means node is shutting down -+if [ "$STATUS" != "Undefined" ] -+then -+ $COM | mysql -B -u$USER -h$HOST -P$PORT -+fi -+ -+exit 0 -+# -diff --git a/mysql-test/suite/binlog/r/binlog_row_binlog.result b/mysql-test/suite/binlog/r/binlog_row_binlog.result -index f60f80c..142a522 100644 ---- a/mysql-test/suite/binlog/r/binlog_row_binlog.result -+++ b/mysql-test/suite/binlog/r/binlog_row_binlog.result -@@ -788,9 +788,11 @@ SELECT * FROM t1; - c1 - 1 - # Their values should be ON --SHOW SESSION VARIABLES LIKE "%_checks"; -+SHOW SESSION VARIABLES LIKE "foreign_key_checks"; - Variable_name Value - foreign_key_checks ON -+SHOW SESSION VARIABLES LIKE "unique_checks"; -+Variable_name Value - unique_checks ON - - SET @@SESSION.foreign_key_checks= OFF; -@@ -806,9 +808,11 @@ c1 - 1 - 2 - # Their values should be OFF --SHOW SESSION VARIABLES LIKE "%_checks"; -+SHOW SESSION VARIABLES LIKE "foreign_key_checks"; - Variable_name Value - foreign_key_checks OFF -+SHOW SESSION VARIABLES LIKE "unique_checks"; -+Variable_name Value - unique_checks OFF - # INSERT INTO t1 VALUES(2) - # foreign_key_checks=1 and unique_checks=1 -@@ -824,8 +828,10 @@ c1 - 1 - 2 - # Their values should be OFF --SHOW SESSION VARIABLES LIKE "%_checks"; -+SHOW SESSION VARIABLES LIKE "foreign_key_checks"; - Variable_name Value - foreign_key_checks OFF -+SHOW SESSION VARIABLES LIKE "unique_checks"; -+Variable_name Value - unique_checks OFF - DROP TABLE t1; -diff --git a/mysql-test/suite/binlog/r/binlog_simplified_binlog_gtid_recovery.result b/mysql-test/suite/binlog/r/binlog_simplified_binlog_gtid_recovery.result -new file mode 100644 -index 0000000..40b50b8 ---- /dev/null -+++ b/mysql-test/suite/binlog/r/binlog_simplified_binlog_gtid_recovery.result -@@ -0,0 +1,47 @@ -+include/rpl_init.inc [topology=none] -+include/rpl_default_connections.inc -+CREATE TABLE t1 ( -+c1 INT NOT NULL PRIMARY KEY -+); -+# Generate master-bin.000002 -+FLUSH LOGS; -+INSERT INTO t1 VALUES (1); -+# Generate master-bin.000003 -+FLUSH LOGS; -+INSERT INTO t1 VALUES (2); -+# Generate master-bin.000004 -+FLUSH LOGS; -+INSERT INTO t1 VALUES (3); -+# Move master-bin.000002 to master-bin.000002.bkp and -+# master-bin.000003 to master-bin.000003.bkp -+# -+# Only master-bin.000001 and master-bin.000004 remain, others are moved -+# , restart the server with enabled simplified-binlog-gtid-recovery -+# and gtid_mode on. If the server scans more than one binary log in -+# every iteration, it will cause read error on the 2nd and 3rd files. -+# -+include/rpl_restart_server.inc [server_number=1 parameters: --simplified-binlog-gtid-recovery=on --gtid-mode=on --enforce-gtid-consistency --log-slave-updates] -+# -+# Verify that GLOBAL.GTID_EXECUTED and GLOBAL.GTID_PURGED are empty -+# after server restarts. -+# -+include/assert.inc [GLOBAL.GTID_EXECUTED must be empty.] -+include/assert.inc [GLOBAL.GTID_PURGED must be empty.] -+DROP TABLE t1; -+# Move master-bin.000004 to master-bin.000004.bkp -+# -+# Only master-bin.000001 and master-bin.000005 remain, others are moved -+# , restart the server with enabled simplified-binlog-gtid-recovery -+# and gtid_mode on again. If the server scans more than one binary -+# log in every iteration, it will cause read error on the 2nd and -+# 4th files. -+# -+include/rpl_restart_server.inc [server_number=1 parameters: --simplified-binlog-gtid-recovery=on --gtid-mode=on --enforce-gtid-consistency --log-slave-updates] -+# -+# Verify that GLOBAL.GTID_EXECUTED contains committed gtid MASTER_UUID:1 -+# and GLOBAL.GTID_PURGED is empty after server restarts again. -+# -+include/assert.inc [committed gtid MASTER_UUID:1] -+include/assert.inc [GLOBAL.GTID_PURGED is empty] -+# Move binary logs back. -+include/rpl_end.inc -diff --git a/mysql-test/suite/binlog/r/binlog_stm_binlog.result b/mysql-test/suite/binlog/r/binlog_stm_binlog.result -index e0cc9ca..8842ace 100644 ---- a/mysql-test/suite/binlog/r/binlog_stm_binlog.result -+++ b/mysql-test/suite/binlog/r/binlog_stm_binlog.result -@@ -557,9 +557,11 @@ SELECT * FROM t1; - c1 - 1 - # Their values should be ON --SHOW SESSION VARIABLES LIKE "%_checks"; -+SHOW SESSION VARIABLES LIKE "foreign_key_checks"; - Variable_name Value - foreign_key_checks ON -+SHOW SESSION VARIABLES LIKE "unique_checks"; -+Variable_name Value - unique_checks ON - - SET @@SESSION.foreign_key_checks= OFF; -@@ -575,9 +577,11 @@ c1 - 1 - 2 - # Their values should be OFF --SHOW SESSION VARIABLES LIKE "%_checks"; -+SHOW SESSION VARIABLES LIKE "foreign_key_checks"; - Variable_name Value - foreign_key_checks OFF -+SHOW SESSION VARIABLES LIKE "unique_checks"; -+Variable_name Value - unique_checks OFF - # INSERT INTO t1 VALUES(2) - # foreign_key_checks=1 and unique_checks=1 -@@ -593,8 +597,10 @@ c1 - 1 - 2 - # Their values should be OFF --SHOW SESSION VARIABLES LIKE "%_checks"; -+SHOW SESSION VARIABLES LIKE "foreign_key_checks"; - Variable_name Value - foreign_key_checks OFF -+SHOW SESSION VARIABLES LIKE "unique_checks"; -+Variable_name Value - unique_checks OFF - DROP TABLE t1; -diff --git a/mysql-test/suite/binlog/t/binlog_simplified_binlog_gtid_recovery.test b/mysql-test/suite/binlog/t/binlog_simplified_binlog_gtid_recovery.test -new file mode 100644 -index 0000000..5337e7b ---- /dev/null -+++ b/mysql-test/suite/binlog/t/binlog_simplified_binlog_gtid_recovery.test -@@ -0,0 +1,120 @@ -+# ==== Purpose ==== -+# -+# BUG#16741603: MYSQLD SCANS ALL BINARY LOGS ON CRASH RECOVERY -+# -+# Verify that the server does not scan more than one binary log -+# in every iteration when initializing GTID sets on server start -+# if simplified-binlog-gtid-recovery is enabled. -+# -+# -+# ==== Implementation ==== -+# -+# 1) Start server and generate four binary logs with gtid_mode off. -+# 2) Move master-bin.000002 to master-bin.000002.bkp and -+# master-bin.000003 to master-bin.000003.bkp -+# 3) Only master-bin.000001 and master-bin.000004 remain, others are moved -+# , restart the server with enabled simplified-binlog-gtid-recovery -+# and gtid_mode on. If the server scans more than one binary log in -+# every iteration, it will cause read error on the 2nd and 3rd files. -+# 4) Verify that GLOBAL.GTID_EXECUTED and GLOBAL.GTID_PURGED are empty -+# after server restarts. -+# 5) Move master-bin.000004 to master-bin.000004.bkp -+# 6) Only master-bin.000001 and master-bin.000005 remain, others are moved -+# , restart the server with enabled simplified-binlog-gtid-recovery -+# and gtid_mode on again. If the server scans more than one binary -+# log in every iteration, it will cause read error on the 2nd and -+# 4th files. -+# 7) Verify that GLOBAL.GTID_EXECUTED contains committed gtid MASTER_UUID:1 -+# and GLOBAL.GTID_PURGED is empty after server restarts again. -+# 8) Move binary logs back. -+# -+ -+--source include/not_gtid_enabled.inc -+ -+# Invoke rpl_init.inc in order to set up the connections needed by -+# rpl_restart_server.inc -+--let $rpl_server_count= 1 -+--let $rpl_topology= none -+--source include/rpl_init.inc -+--source include/rpl_default_connections.inc -+ -+--let $MYSQLD_DATADIR= `select @@datadir` -+--let $master_uuid= `SELECT @@GLOBAL.SERVER_UUID` -+CREATE TABLE t1 ( -+ c1 INT NOT NULL PRIMARY KEY -+); -+ -+--echo # Generate master-bin.000002 -+FLUSH LOGS; -+INSERT INTO t1 VALUES (1); -+--let $binlog_file2= query_get_value(SHOW MASTER STATUS, File, 1) -+ -+--echo # Generate master-bin.000003 -+FLUSH LOGS; -+INSERT INTO t1 VALUES (2); -+--let $binlog_file3= query_get_value(SHOW MASTER STATUS, File, 1) -+ -+--echo # Generate master-bin.000004 -+FLUSH LOGS; -+INSERT INTO t1 VALUES (3); -+--let $binlog_file4= query_get_value(SHOW MASTER STATUS, File, 1) -+ -+--echo # Move master-bin.000002 to master-bin.000002.bkp and -+--echo # master-bin.000003 to master-bin.000003.bkp -+--move_file $MYSQLD_DATADIR/$binlog_file2 $MYSQLD_DATADIR/$binlog_file2.bkp -+--move_file $MYSQLD_DATADIR/$binlog_file3 $MYSQLD_DATADIR/$binlog_file3.bkp -+ -+--echo # -+--echo # Only master-bin.000001 and master-bin.000004 remain, others are moved -+--echo # , restart the server with enabled simplified-binlog-gtid-recovery -+--echo # and gtid_mode on. If the server scans more than one binary log in -+--echo # every iteration, it will cause read error on the 2nd and 3rd files. -+--echo # -+--let $rpl_server_number= 1 -+--let $rpl_server_parameters= --simplified-binlog-gtid-recovery=on --gtid-mode=on --enforce-gtid-consistency --log-slave-updates -+--source include/rpl_restart_server.inc -+ -+--echo # -+--echo # Verify that GLOBAL.GTID_EXECUTED and GLOBAL.GTID_PURGED are empty -+--echo # after server restarts. -+--echo # -+--let $assert_text= GLOBAL.GTID_EXECUTED must be empty. -+--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "" -+--source include/assert.inc -+--let $assert_text= GLOBAL.GTID_PURGED must be empty. -+--let $assert_cond= "[SELECT @@GLOBAL.GTID_PURGED]" = "" -+--source include/assert.inc -+ -+DROP TABLE t1; -+--echo # Move master-bin.000004 to master-bin.000004.bkp -+--move_file $MYSQLD_DATADIR/$binlog_file4 $MYSQLD_DATADIR/$binlog_file4.bkp -+ -+--echo # -+--echo # Only master-bin.000001 and master-bin.000005 remain, others are moved -+--echo # , restart the server with enabled simplified-binlog-gtid-recovery -+--echo # and gtid_mode on again. If the server scans more than one binary -+--echo # log in every iteration, it will cause read error on the 2nd and -+--echo # 4th files. -+--echo # -+--let $rpl_server_number= 1 -+--let $rpl_server_parameters= --simplified-binlog-gtid-recovery=on --gtid-mode=on --enforce-gtid-consistency --log-slave-updates -+--source include/rpl_restart_server.inc -+ -+--echo # -+--echo # Verify that GLOBAL.GTID_EXECUTED contains committed gtid MASTER_UUID:1 -+--echo # and GLOBAL.GTID_PURGED is empty after server restarts again. -+--echo # -+--let $assert_text= committed gtid MASTER_UUID:1 -+--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$master_uuid:1" -+--source include/assert.inc -+--let $assert_text= GLOBAL.GTID_PURGED is empty -+--let $assert_cond= "[SELECT @@GLOBAL.GTID_PURGED]" = "" -+--source include/assert.inc -+ -+--echo # Move binary logs back. -+--move_file $MYSQLD_DATADIR/$binlog_file2.bkp $MYSQLD_DATADIR/$binlog_file2 -+--move_file $MYSQLD_DATADIR/$binlog_file3.bkp $MYSQLD_DATADIR/$binlog_file3 -+--move_file $MYSQLD_DATADIR/$binlog_file4.bkp $MYSQLD_DATADIR/$binlog_file4 -+ -+--source include/rpl_end.inc -+ -diff --git a/mysql-test/suite/funcs_1/r/is_columns_is.result b/mysql-test/suite/funcs_1/r/is_columns_is.result -index f0ab3a7..ec485d4 100644 ---- a/mysql-test/suite/funcs_1/r/is_columns_is.result -+++ b/mysql-test/suite/funcs_1/r/is_columns_is.result -@@ -111,9 +111,9 @@ def information_schema FILES UPDATE_COUNT 13 NULL YES bigint NULL NULL 19 0 NULL - def information_schema FILES UPDATE_TIME 34 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select - def information_schema FILES VERSION 25 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select - def information_schema GLOBAL_STATUS VARIABLE_NAME 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select --def information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL NULL utf8 utf8_general_ci varchar(1024) select -+def information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL YES varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) select - def information_schema GLOBAL_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select --def information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL NULL utf8 utf8_general_ci varchar(1024) select -+def information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) select - def information_schema KEY_COLUMN_USAGE COLUMN_NAME 7 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select - def information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select - def information_schema KEY_COLUMN_USAGE CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select -@@ -243,9 +243,9 @@ def information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE 4 NO varchar 64 192 NUL - def information_schema SCHEMA_PRIVILEGES TABLE_CATALOG 2 NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select - def information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select - def information_schema SESSION_STATUS VARIABLE_NAME 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select --def information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL NULL utf8 utf8_general_ci varchar(1024) select -+def information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL YES varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) select - def information_schema SESSION_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select --def information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL NULL utf8 utf8_general_ci varchar(1024) select -+def information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 2048 6144 NULL NULL NULL utf8 utf8_general_ci varchar(2048) select - def information_schema STATISTICS CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select - def information_schema STATISTICS COLLATION 9 NULL YES varchar 1 3 NULL NULL NULL utf8 utf8_general_ci varchar(1) select - def information_schema STATISTICS COLUMN_NAME 8 NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select -@@ -507,9 +507,9 @@ NULL information_schema FILES CHECKSUM bigint NULL NULL NULL NULL bigint(21) uns - 3.0000 information_schema FILES STATUS varchar 20 60 utf8 utf8_general_ci varchar(20) - 3.0000 information_schema FILES EXTRA varchar 255 765 utf8 utf8_general_ci varchar(255) - 3.0000 information_schema GLOBAL_STATUS VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) --3.0000 information_schema GLOBAL_STATUS VARIABLE_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024) -+3.0000 information_schema GLOBAL_STATUS VARIABLE_VALUE varchar 2048 6144 utf8 utf8_general_ci varchar(2048) - 3.0000 information_schema GLOBAL_VARIABLES VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) --3.0000 information_schema GLOBAL_VARIABLES VARIABLE_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024) -+3.0000 information_schema GLOBAL_VARIABLES VARIABLE_VALUE varchar 2048 6144 utf8 utf8_general_ci varchar(2048) - 3.0000 information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512) - 3.0000 information_schema KEY_COLUMN_USAGE CONSTRAINT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64) - 3.0000 information_schema KEY_COLUMN_USAGE CONSTRAINT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) -@@ -639,9 +639,9 @@ NULL information_schema ROUTINES LAST_ALTERED datetime NULL NULL NULL NULL datet - 3.0000 information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64) - 3.0000 information_schema SCHEMA_PRIVILEGES IS_GRANTABLE varchar 3 9 utf8 utf8_general_ci varchar(3) - 3.0000 information_schema SESSION_STATUS VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) --3.0000 information_schema SESSION_STATUS VARIABLE_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024) -+3.0000 information_schema SESSION_STATUS VARIABLE_VALUE varchar 2048 6144 utf8 utf8_general_ci varchar(2048) - 3.0000 information_schema SESSION_VARIABLES VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) --3.0000 information_schema SESSION_VARIABLES VARIABLE_VALUE varchar 1024 3072 utf8 utf8_general_ci varchar(1024) -+3.0000 information_schema SESSION_VARIABLES VARIABLE_VALUE varchar 2048 6144 utf8 utf8_general_ci varchar(2048) - 3.0000 information_schema STATISTICS TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512) - 3.0000 information_schema STATISTICS TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64) - 3.0000 information_schema STATISTICS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64) -diff --git a/mysql-test/suite/galera/galera_2nodes.cnf b/mysql-test/suite/galera/galera_2nodes.cnf -new file mode 100644 -index 0000000..8adae4c ---- /dev/null -+++ b/mysql-test/suite/galera/galera_2nodes.cnf -@@ -0,0 +1,55 @@ -+# Use default setting for mysqld processes -+!include include/default_mysqld.cnf -+ -+[mysqld.1] -+binlog-format=row -+ -+wsrep_provider=@ENV.WSREP_PROVIDER -+wsrep_cluster_address='gcomm://' -+wsrep_provider_options='base_port=@mysqld.1.#galera_port' -+ -+# enforce read-committed characteristics across the cluster -+wsrep_causal_reads=ON -+wsrep_sync_wait = 7 -+ -+wsrep_node_address=127.0.0.1 -+wsrep_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port -+wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port -+ -+# Required for Galera -+innodb_autoinc_lock_mode=2 -+ -+innodb_flush_log_at_trx_commit=2 -+ -+[mysqld.2] -+binlog-format=row -+ -+wsrep_provider=@ENV.WSREP_PROVIDER -+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port' -+wsrep_provider_options='base_port=@mysqld.2.#galera_port' -+ -+# enforce read-committed characteristics across the cluster -+wsrep_causal_reads=ON -+wsrep_sync_wait = 7 -+ -+wsrep_node_address=127.0.0.1 -+wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port -+wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port -+ -+# Required for Galera -+innodb_autoinc_lock_mode=2 -+ -+innodb_flush_log_at_trx_commit=2 -+ -+[ENV] -+NODE_MYPORT_1= @mysqld.1.port -+NODE_MYSOCK_1= @mysqld.1.socket -+ -+NODE_MYPORT_2= @mysqld.2.port -+NODE_MYSOCK_2= @mysqld.2.socket -+ -+NODE_GALERAPORT_1= @mysqld.1.#galera_port -+NODE_GALERAPORT_2= @mysqld.2.#galera_port -+ -+NODE_SSTPORT_1= @mysqld.1.#sst_port -+NODE_SSTPORT_2= @mysqld.2.#sst_port -diff --git a/mysql-test/suite/galera/galera_2nodes_as_master.cnf b/mysql-test/suite/galera/galera_2nodes_as_master.cnf -new file mode 100644 -index 0000000..614ece9 ---- /dev/null -+++ b/mysql-test/suite/galera/galera_2nodes_as_master.cnf -@@ -0,0 +1,71 @@ -+# -+# This .cnf file creates a setup with a 2-node Galera cluster and one stand-alone MySQL server, to be used as a slave -+# -+ -+# Use default setting for mysqld processes -+!include include/default_mysqld.cnf -+ -+[mysqld.1] -+server-id=1 -+binlog-format=row -+log-bin=mysqld-bin -+log_slave_updates -+ -+wsrep_provider=@ENV.WSREP_PROVIDER -+wsrep_cluster_address='gcomm://' -+wsrep_provider_options='base_port=@mysqld.1.#galera_port' -+ -+# enforce read-committed characteristics across the cluster -+wsrep_causal_reads=ON -+wsrep_sync_wait = 7 -+ -+wsrep_node_address=127.0.0.1 -+wsrep_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port -+wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port -+ -+# Required for Galera -+innodb_autoinc_lock_mode=2 -+ -+innodb_flush_log_at_trx_commit=2 -+ -+[mysqld.2] -+server-id=2 -+binlog-format=row -+log-bin=mysqld-bin -+log_slave_updates -+ -+wsrep_provider=@ENV.WSREP_PROVIDER -+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port' -+wsrep_provider_options='base_port=@mysqld.2.#galera_port' -+ -+# enforce read-committed characteristics across the cluster -+wsrep_causal_reads=ON -+wsrep_sync_wait = 7 -+ -+wsrep_node_address=127.0.0.1 -+wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port -+wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port -+ -+# Required for Galera -+innodb_autoinc_lock_mode=2 -+ -+innodb_flush_log_at_trx_commit=2 -+ -+[mysqld.3] -+server-id=3 -+ -+[ENV] -+NODE_MYPORT_1= @mysqld.1.port -+NODE_MYSOCK_1= @mysqld.1.socket -+ -+NODE_MYPORT_2= @mysqld.2.port -+NODE_MYSOCK_2= @mysqld.2.socket -+ -+NODE_MYPORT_3= @mysqld.3.port -+NODE_MYSOCK_3= @mysqld.3.socket -+ -+NODE_GALERAPORT_1= @mysqld.1.#galera_port -+NODE_GALERAPORT_2= @mysqld.2.#galera_port -+ -+NODE_SSTPORT_1= @mysqld.1.#sst_port -+NODE_SSTPORT_2= @mysqld.2.#sst_port -diff --git a/mysql-test/suite/galera/galera_2nodes_as_slave.cnf b/mysql-test/suite/galera/galera_2nodes_as_slave.cnf -new file mode 100644 -index 0000000..5d14109 ---- /dev/null -+++ b/mysql-test/suite/galera/galera_2nodes_as_slave.cnf -@@ -0,0 +1,68 @@ -+# -+# This .cnf file creates a setup with 1 standard MySQL server, followed by a 2-node Galera cluster -+# -+ -+# Use default setting for mysqld processes -+!include include/default_mysqld.cnf -+ -+[mysqld.1] -+log-bin=mysqld-bin -+binlog-format=row -+server-id=1 -+ -+[mysqld.2] -+binlog-format=row -+server-id=2 -+ -+wsrep_provider=@ENV.WSREP_PROVIDER -+wsrep_cluster_address='gcomm://' -+wsrep_provider_options='base_port=@mysqld.2.#galera_port' -+ -+# enforce read-committed characteristics across the cluster -+wsrep_causal_reads=ON -+wsrep_sync_wait = 7 -+ -+wsrep_node_address=127.0.0.1 -+wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port -+wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port -+ -+# Required for Galera -+innodb_autoinc_lock_mode=2 -+ -+innodb_flush_log_at_trx_commit=2 -+ -+[mysqld.3] -+binlog-format=row -+ -+wsrep_provider=@ENV.WSREP_PROVIDER -+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.2.#galera_port' -+wsrep_provider_options='base_port=@mysqld.3.#galera_port' -+ -+# enforce read-committed characteristics across the cluster -+wsrep_causal_reads=ON -+wsrep_sync_wait = 7 -+ -+wsrep_node_address=127.0.0.1 -+wsrep_sst_receive_address=127.0.0.2:@mysqld.3.#sst_port -+wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port -+ -+# Required for Galera -+innodb_autoinc_lock_mode=2 -+ -+innodb_flush_log_at_trx_commit=2 -+ -+[ENV] -+NODE_MYPORT_1= @mysqld.1.port -+NODE_MYSOCK_1= @mysqld.1.socket -+ -+NODE_MYPORT_2= @mysqld.2.port -+NODE_MYSOCK_2= @mysqld.2.socket -+ -+NODE_MYPORT_3= @mysqld.2.port -+NODE_MYSOCK_3= @mysqld.2.socket -+ -+NODE_GALERAPORT_2= @mysqld.2.#galera_port -+NODE_GALERAPORT_3= @mysqld.3.#galera_port -+ -+NODE_SSTPORT_2= @mysqld.2.#sst_port -+NODE_SSTPORT_3= @mysqld.3.#sst_port -diff --git a/mysql-test/suite/galera/galera_4nodes.cnf b/mysql-test/suite/galera/galera_4nodes.cnf -new file mode 100644 -index 0000000..068c734 ---- /dev/null -+++ b/mysql-test/suite/galera/galera_4nodes.cnf -@@ -0,0 +1,97 @@ -+# Use default setting for mysqld processes -+!include include/default_mysqld.cnf -+ -+[mysqld.1] -+binlog-format=row -+ -+wsrep_provider=@ENV.WSREP_PROVIDER -+wsrep_cluster_address='gcomm://' -+wsrep_provider_options='base_port=@mysqld.1.#galera_port' -+ -+# enforce read-committed characteristics across the cluster -+wsrep_causal_reads=ON -+wsrep_sync_wait = 7 -+ -+wsrep_node_address=127.0.0.1 -+wsrep_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port -+wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port -+ -+# Required for Galera -+innodb_autoinc_lock_mode=2 -+ -+[mysqld.2] -+binlog-format=row -+ -+wsrep_provider=@ENV.WSREP_PROVIDER -+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port' -+wsrep_provider_options='base_port=@mysqld.2.#galera_port' -+ -+# enforce read-committed characteristics across the cluster -+wsrep_causal_reads=ON -+wsrep_sync_wait = 7 -+ -+wsrep_node_address=127.0.0.1 -+wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port -+wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port -+ -+# Required for Galera -+innodb_autoinc_lock_mode=2 -+ -+[mysqld.3] -+binlog-format=row -+ -+wsrep_provider=@ENV.WSREP_PROVIDER -+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port' -+wsrep_provider_options='base_port=@mysqld.3.#galera_port' -+ -+# enforce read-committed characteristics across the cluster -+wsrep_causal_reads=ON -+wsrep_sync_wait = 7 -+ -+wsrep_node_address=127.0.0.1 -+wsrep_sst_receive_address=127.0.0.2:@mysqld.3.#sst_port -+wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port -+ -+# Required for Galera -+innodb_autoinc_lock_mode=2 -+ -+[mysqld.4] -+binlog-format=row -+ -+wsrep_provider=@ENV.WSREP_PROVIDER -+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port' -+wsrep_provider_options='base_port=@mysqld.4.#galera_port' -+ -+# enforce read-committed characteristics across the cluster -+wsrep_causal_reads=ON -+wsrep_sync_wait = 7 -+ -+wsrep_node_address=127.0.0.1 -+wsrep_sst_receive_address=127.0.0.2:@mysqld.4.#sst_port -+wsrep_node_incoming_address=127.0.0.1:@mysqld.4.port -+ -+# Required for Galera -+innodb_autoinc_lock_mode=2 -+ -+[ENV] -+NODE_MYPORT_1= @mysqld.1.port -+NODE_MYSOCK_1= @mysqld.1.socket -+ -+NODE_MYPORT_2= @mysqld.2.port -+NODE_MYSOCK_2= @mysqld.2.socket -+ -+NODE_MYPORT_3= @mysqld.3.port -+NODE_MYSOCK_3= @mysqld.3.socket -+ -+NODE_MYPORT_4= @mysqld.4.port -+NODE_MYSOCK_4= @mysqld.4.socket -+ -+NODE_GALERAPORT_1= @mysqld.1.#galera_port -+NODE_GALERAPORT_2= @mysqld.2.#galera_port -+NODE_GALERAPORT_3= @mysqld.3.#galera_port -+NODE_GALERAPORT_4= @mysqld.4.#galera_port -+ -+NODE_SSTPORT_1= @mysqld.1.#sst_port -+NODE_SSTPORT_2= @mysqld.2.#sst_port -+NODE_SSTPORT_3= @mysqld.3.#sst_port -+NODE_SSTPORT_4= @mysqld.4.#sst_port -diff --git a/mysql-test/suite/galera/include/galera_have_debug_sync.inc b/mysql-test/suite/galera/include/galera_have_debug_sync.inc -new file mode 100644 -index 0000000..7c01560 ---- /dev/null -+++ b/mysql-test/suite/galera/include/galera_have_debug_sync.inc -@@ -0,0 +1,9 @@ -+--disable_query_log -+ -+--let $galera_have_debug_sync = `SELECT 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters'` -+ -+--if (!$galera_have_debug_sync) { -+ --skip "Test requires Galera debug library with debug_sync functionality" -+} -+ -+--enable_query_log -diff --git a/mysql-test/suite/galera/include/galera_load_provider.inc b/mysql-test/suite/galera/include/galera_load_provider.inc -new file mode 100644 -index 0000000..0ecf43e ---- /dev/null -+++ b/mysql-test/suite/galera/include/galera_load_provider.inc -@@ -0,0 +1,10 @@ -+--echo Loading wsrep provider ... -+ -+--disable_query_log -+--eval SET GLOBAL wsrep_provider = '$wsrep_provider_orig'; -+--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig'; -+--enable_query_log -+ -+--enable_reconnect -+--source include/wait_until_connected_again.inc -+--source include/galera_wait_ready.inc -diff --git a/mysql-test/suite/galera/include/galera_reset_cluster_address.inc b/mysql-test/suite/galera/include/galera_reset_cluster_address.inc -new file mode 100644 -index 0000000..02937ec ---- /dev/null -+++ b/mysql-test/suite/galera/include/galera_reset_cluster_address.inc -@@ -0,0 +1,12 @@ -+--echo Resetting wsrep_cluster_address -+ -+--let $wsrep_cluster_size_orig = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'` -+ -+SET GLOBAL wsrep_cluster_address = @@wsrep_cluster_address; -+ -+--source include/wait_until_connected_again.inc -+ -+# Wait for wsrep_cluster_size to go back to its original value -+ -+--let $wait_condition = SELECT VARIABLE_VALUE = $wsrep_cluster_size_orig FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' -+--source include/wait_condition.inc -diff --git a/mysql-test/suite/galera/include/galera_sst_restore.inc b/mysql-test/suite/galera/include/galera_sst_restore.inc -new file mode 100644 -index 0000000..a08b148 ---- /dev/null -+++ b/mysql-test/suite/galera/include/galera_sst_restore.inc -@@ -0,0 +1,29 @@ -+# -+# Restore the various options used for SST to their original values -+# so that MTR's end-of-test checks are happy. -+# -+ -+--connection node_1 -+CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query"); -+ -+--disable_query_log -+--eval SET GLOBAL wsrep_sst_auth = '$wsrep_sst_auth_orig'; -+--enable_query_log -+ -+--error 0,ER_CANNOT_USER -+DROP USER sst; -+ -+--connection node_2 -+CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query"); -+CALL mtr.add_suppression("InnoDB: Error: Table \"mysql\"\\.\"innodb_index_stats\" not found"); -+CALL mtr.add_suppression("InnoDB: New log files created"); -+CALL mtr.add_suppression("InnoDB: Creating foreign key constraint system tables"); -+CALL mtr.add_suppression("Can't open and lock time zone table"); -+CALL mtr.add_suppression("Can't open and lock privilege tables"); -+CALL mtr.add_suppression("Info table is not ready to be used"); -+CALL mtr.add_suppression("Native table .* has the wrong structure"); -+ -+--disable_query_log -+--eval SET GLOBAL wsrep_sst_method = '$wsrep_sst_method_orig'; -+--eval SET GLOBAL wsrep_sst_receive_address = '$wsrep_sst_receive_address_orig'; -+--enable_query_log -diff --git a/mysql-test/suite/galera/include/galera_sst_set_mysqldump.inc b/mysql-test/suite/galera/include/galera_sst_set_mysqldump.inc -new file mode 100644 -index 0000000..405c16c ---- /dev/null -+++ b/mysql-test/suite/galera/include/galera_sst_set_mysqldump.inc -@@ -0,0 +1,22 @@ -+# -+# Set all the variables required for the SST to be performed via mysqldump -+# -+ -+--echo Setting SST method to mysqldump ... -+ -+--connection node_1 -+# We need a user with a password to perform SST, otherwise we hit LP #1378253 -+GRANT ALL PRIVILEGES ON *.* TO 'sst' IDENTIFIED BY 'sst'; -+ -+--let $wsrep_sst_auth_orig = `SELECT @@wsrep_sst_auth` -+SET GLOBAL wsrep_sst_auth = 'sst:sst'; -+ -+--connection node_2 -+--let $wsrep_sst_method_orig = `SELECT @@wsrep_sst_method` -+--let $wsrep_sst_receive_address_orig = `SELECT @@wsrep_sst_receive_address` -+ -+--disable_query_log -+# Set wsrep_sst_receive_address to the SQL port -+--eval SET GLOBAL wsrep_sst_receive_address = '127.0.0.2:$NODE_MYPORT_2'; -+--enable_query_log -+SET GLOBAL wsrep_sst_method = 'mysqldump'; -diff --git a/mysql-test/suite/galera/include/galera_st_clean_slave.inc b/mysql-test/suite/galera/include/galera_st_clean_slave.inc -new file mode 100644 -index 0000000..3a49f4f ---- /dev/null -+++ b/mysql-test/suite/galera/include/galera_st_clean_slave.inc -@@ -0,0 +1,115 @@ -+--echo Performing State Transfer on a server that starts from a clean var directory -+--echo This is accomplished by shutting down node #2 and removing its var directory before restarting it -+ -+--connection node_1 -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+COMMIT; -+ -+--connection node_2 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+COMMIT; -+ -+--echo Shutting down server ... -+--source include/shutdown_mysqld.inc -+ -+--connection node_1 -+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' -+--source include/wait_condition.inc -+ -+--echo Cleaning var directory ... -+--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/mtr -+--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/performance_schema -+--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/test -+--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data/mysql -+--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.2/data -+ -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+COMMIT; -+ -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+ -+--connect node_1a_galera_st_clean_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+ -+--connection node_2 -+--echo Starting server ... -+--source include/start_mysqld.inc -+ -+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' -+--source include/wait_condition.inc -+ -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+COMMIT; -+ -+--connection node_1 -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+COMMIT; -+ -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+COMMIT; -+ -+--connection node_1a_galera_st_clean_slave -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+ROLLBACK; -+ -+SELECT COUNT(*) = 35 FROM t1; -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COMMIT; -+SET AUTOCOMMIT=ON; -+ -+--connection node_1 -+SELECT COUNT(*) = 35 FROM t1; -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+DROP TABLE t1; -+COMMIT; -+SET AUTOCOMMIT=ON; -diff --git a/mysql-test/suite/galera/include/galera_st_disconnect_slave.inc b/mysql-test/suite/galera/include/galera_st_disconnect_slave.inc -new file mode 100644 -index 0000000..c886974 ---- /dev/null -+++ b/mysql-test/suite/galera/include/galera_st_disconnect_slave.inc -@@ -0,0 +1,105 @@ -+--echo Performing State Transfer on a server that has been temporarily disconnected -+ -+--connection node_1 -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+COMMIT; -+ -+--connection node_2 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+COMMIT; -+ -+--source suite/galera/include/galera_unload_provider.inc -+ -+--connection node_1 -+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' -+--source include/wait_condition.inc -+ -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+COMMIT; -+ -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+ -+--connect node_1a_galera_st_disconnect_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+ -+--connection node_2 -+--source suite/galera/include/galera_load_provider.inc -+ -+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' -+--source include/wait_condition.inc -+ -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+COMMIT; -+ -+--connection node_1 -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+COMMIT; -+ -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+COMMIT; -+ -+--connection node_1a_galera_st_disconnect_slave -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+ROLLBACK; -+ -+SELECT COUNT(*) = 35 FROM t1; -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COMMIT; -+SET AUTOCOMMIT=ON; -+ -+--connection node_1 -+SELECT COUNT(*) = 35 FROM t1; -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+DROP TABLE t1; -+COMMIT; -+SET AUTOCOMMIT=ON; -diff --git a/mysql-test/suite/galera/include/galera_st_kill_slave.inc b/mysql-test/suite/galera/include/galera_st_kill_slave.inc -new file mode 100644 -index 0000000..534d7b6 ---- /dev/null -+++ b/mysql-test/suite/galera/include/galera_st_kill_slave.inc -@@ -0,0 +1,110 @@ -+--echo Performing State Transfer on a server that has been killed and restarted -+ -+--connection node_1 -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+COMMIT; -+ -+--connection node_2 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+COMMIT; -+ -+--source include/kill_galera.inc -+ -+--connection node_1 -+--source include/wait_until_connected_again.inc -+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' -+--source include/wait_condition.inc -+ -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+COMMIT; -+ -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+ -+--connect node_1a_galera_st_kill_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+ -+--connection node_2 -+--let $galera_wsrep_recover_server_id=2 -+--source suite/galera/include/galera_wsrep_recover.inc -+ -+--echo Starting server ... -+--source include/start_mysqld.inc -+ -+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' -+--source include/wait_condition.inc -+ -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+COMMIT; -+ -+--connection node_1 -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+COMMIT; -+ -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+COMMIT; -+ -+--connection node_1a_galera_st_kill_slave -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+ROLLBACK; -+ -+SELECT COUNT(*) = 35 FROM t1; -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COMMIT; -+SET AUTOCOMMIT=ON; -+ -+--connection node_1 -+SELECT COUNT(*) = 35 FROM t1; -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+DROP TABLE t1; -+COMMIT; -+SET AUTOCOMMIT=ON; -diff --git a/mysql-test/suite/galera/include/galera_st_kill_slave_ddl.inc b/mysql-test/suite/galera/include/galera_st_kill_slave_ddl.inc -new file mode 100644 -index 0000000..8b99b1e ---- /dev/null -+++ b/mysql-test/suite/galera/include/galera_st_kill_slave_ddl.inc -@@ -0,0 +1,123 @@ -+--echo Performing State Transfer on a server that has been killed and restarted -+--echo while a DDL was in progress on it -+ -+--connection node_1 -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+ -+--connection node_2 -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+COMMIT; -+ -+# Suspend the applier as it applies the ALTER TABLE -+--let $debug_orig = `SELECT @@debug` -+SET GLOBAL debug = 'd,sync.alter_opened_table'; -+ -+--connection node_1 -+ALTER TABLE t1 ADD COLUMN f2 INTEGER; -+ -+--connection node_2 -+SET wsrep_sync_wait = 0; -+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'debug sync point: now' -+--source include/wait_condition.inc -+ -+--source include/kill_galera.inc -+ -+--connection node_1 -+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' -+--source include/wait_condition.inc -+ -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+COMMIT; -+ -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+ -+--connect node_1a_galera_st_kill_slave_ddl, 127.0.0.1, root, , test, $NODE_MYPORT_1 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+ -+--connection node_2 -+--let $galera_wsrep_recover_server_id=2 -+--source suite/galera/include/galera_wsrep_recover.inc -+ -+--connection node_2 -+--echo Starting server ... -+--source include/start_mysqld.inc -+ -+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' -+--source include/wait_condition.inc -+ -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+COMMIT; -+ -+--connection node_1 -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+COMMIT; -+ -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+COMMIT; -+ -+--connection node_1a_galera_st_kill_slave_ddl -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+ROLLBACK; -+ -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+SELECT COUNT(*) = 35 FROM t1; -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COMMIT; -+SET AUTOCOMMIT=ON; -+ -+--connection node_1 -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+SELECT COUNT(*) = 35 FROM t1; -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+DROP TABLE t1; -+COMMIT; -+SET AUTOCOMMIT=ON; -diff --git a/mysql-test/suite/galera/include/galera_st_shutdown_slave.inc b/mysql-test/suite/galera/include/galera_st_shutdown_slave.inc -new file mode 100644 -index 0000000..6c09b0c ---- /dev/null -+++ b/mysql-test/suite/galera/include/galera_st_shutdown_slave.inc -@@ -0,0 +1,107 @@ -+--echo Performing State Transfer on a server that has been shut down cleanly and restarted -+ -+--connection node_1 -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+COMMIT; -+ -+--connection node_2 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+COMMIT; -+ -+--echo Shutting down server ... -+--source include/shutdown_mysqld.inc -+ -+--connection node_1 -+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' -+--source include/wait_condition.inc -+ -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+COMMIT; -+ -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+ -+--connect node_1a_galera_st_shutdown_slave, 127.0.0.1, root, , test, $NODE_MYPORT_1 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+ -+--connection node_2 -+--echo Starting server ... -+--source include/start_mysqld.inc -+ -+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' -+--source include/wait_condition.inc -+ -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+COMMIT; -+ -+--connection node_1 -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+COMMIT; -+ -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+COMMIT; -+ -+--connection node_1a_galera_st_shutdown_slave -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+ROLLBACK; -+ -+SELECT COUNT(*) = 35 FROM t1; -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COMMIT; -+SET AUTOCOMMIT=ON; -+ -+--connection node_1 -+SELECT COUNT(*) = 35 FROM t1; -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+DROP TABLE t1; -+COMMIT; -+SET AUTOCOMMIT=ON; -diff --git a/mysql-test/suite/galera/include/galera_unload_provider.inc b/mysql-test/suite/galera/include/galera_unload_provider.inc -new file mode 100644 -index 0000000..edc7eb3 ---- /dev/null -+++ b/mysql-test/suite/galera/include/galera_unload_provider.inc -@@ -0,0 +1,7 @@ -+--echo Unloading wsrep provider ... -+ -+--let $wsrep_cluster_address_orig = `SELECT @@wsrep_cluster_address` -+--let $wsrep_provider_orig = `SELECT @@wsrep_provider` -+--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options` -+ -+SET GLOBAL wsrep_provider = 'none'; -diff --git a/mysql-test/suite/galera/include/galera_wsrep_recover.inc b/mysql-test/suite/galera/include/galera_wsrep_recover.inc -new file mode 100644 -index 0000000..3126955 ---- /dev/null -+++ b/mysql-test/suite/galera/include/galera_wsrep_recover.inc -@@ -0,0 +1,23 @@ -+--echo Performing --wsrep-recover ... -+--exec $MYSQLD --defaults-group-suffix=.$galera_wsrep_recover_server_id --defaults-file=$MYSQLTEST_VARDIR/my.cnf --wsrep-recover > $MYSQL_TMP_DIR/galera_wsrep_recover.log 2>&1 -+ -+--perl -+ use strict; -+ my $wsrep_start_position_str = "grep 'WSREP: Recovered position:' $ENV{MYSQL_TMP_DIR}/galera_wsrep_recover.log | sed 's/.*WSREP\:\ Recovered\ position://' | sed 's/^[ \t]*//'"; -+ my $wsrep_start_position = `grep 'WSREP: Recovered position:' $ENV{MYSQL_TMP_DIR}/galera_wsrep_recover.log | sed 's/.*WSREP\:\ Recovered\ position://' | sed 's/^[ \t]*//'`; -+ chomp($wsrep_start_position); -+ -+ die if $wsrep_start_position eq ''; -+ -+ open(FILE, ">", "$ENV{MYSQL_TMP_DIR}/galera_wsrep_start_position.inc") or die; -+ print FILE "--let \$galera_wsrep_start_position = $wsrep_start_position\n"; -+ close FILE; -+EOF -+ -+--source $MYSQL_TMP_DIR/galera_wsrep_start_position.inc -+ -+if ($galera_wsrep_start_position == '') { -+ --die "Could not obtain wsrep_start_position." -+} -+ -+--remove_file $MYSQL_TMP_DIR/galera_wsrep_start_position.inc -diff --git a/mysql-test/suite/galera/my.cnf b/mysql-test/suite/galera/my.cnf -new file mode 100644 -index 0000000..ca163a5 ---- /dev/null -+++ b/mysql-test/suite/galera/my.cnf -@@ -0,0 +1 @@ -+!include galera_2nodes.cnf -diff --git a/mysql-test/suite/galera/r/galera_account_management.result b/mysql-test/suite/galera/r/galera_account_management.result -new file mode 100644 -index 0000000..9b3ae9b ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_account_management.result -@@ -0,0 +1,40 @@ -+CREATE USER user1, user2 IDENTIFIED BY 'password'; -+SELECT COUNT(*) = 2 FROM mysql.user WHERE user IN ('user1', 'user2'); -+COUNT(*) = 2 -+1 -+RENAME USER user2 TO user3; -+SELECT COUNT(*) = 0 FROM mysql.user WHERE user = 'user2'; -+COUNT(*) = 0 -+1 -+SELECT COUNT(*) = 1 FROM mysql.user WHERE user = 'user3'; -+COUNT(*) = 1 -+1 -+SET PASSWORD FOR user3 = PASSWORD('foo'); -+SELECT password != '' FROM mysql.user WHERE user = 'user3'; -+password != '' -+1 -+DROP USER user1, user3; -+SELECT COUNT(*) = 0 FROM mysql.user WHERE user IN ('user1', 'user2'); -+COUNT(*) = 0 -+1 -+GRANT ALL ON *.* TO user4 IDENTIFIED BY 'password'; -+SELECT COUNT(*) = 1 FROM mysql.user WHERE user = 'user4'; -+COUNT(*) = 1 -+1 -+SELECT Select_priv = 'Y' FROM mysql.user WHERE user = 'user4'; -+Select_priv = 'Y' -+1 -+CREATE USER user5; -+GRANT PROXY ON user4 TO user5; -+SELECT COUNT(*) = 1 FROM mysql.proxies_priv WHERE user = 'user5'; -+COUNT(*) = 1 -+1 -+REVOKE ALL PRIVILEGES ON *.* FROM user4; -+SELECT Select_priv = 'N' FROM mysql.user WHERE user = 'user4'; -+Select_priv = 'N' -+1 -+REVOKE PROXY ON user4 FROM user5; -+SELECT COUNT(*) = 0 FROM mysql.proxies_priv WHERE user = 'user5'; -+COUNT(*) = 0 -+1 -+DROP USER user4, user5; -diff --git a/mysql-test/suite/galera/r/galera_alter_engine_innodb.result b/mysql-test/suite/galera/r/galera_alter_engine_innodb.result -new file mode 100644 -index 0000000..2b30ac5 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_alter_engine_innodb.result -@@ -0,0 +1,10 @@ -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+ALTER TABLE t1 ENGINE=InnoDB; -+SELECT ENGINE = 'InnoDB' FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; -+ENGINE = 'InnoDB' -+1 -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_alter_engine_myisam.result b/mysql-test/suite/galera/r/galera_alter_engine_myisam.result -new file mode 100644 -index 0000000..280cb58 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_alter_engine_myisam.result -@@ -0,0 +1,11 @@ -+SET GLOBAL wsrep_replicate_myisam = TRUE; -+CREATE TABLE t1 (f1 INTEGER) ENGINE=MyISAM; -+INSERT INTO t1 VALUES (1); -+ALTER TABLE t1 ENGINE=InnoDB; -+SELECT ENGINE = 'InnoDB' FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; -+ENGINE = 'InnoDB' -+1 -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_alter_table_force.result b/mysql-test/suite/galera/r/galera_alter_table_force.result -new file mode 100644 -index 0000000..401ab46 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_alter_table_force.result -@@ -0,0 +1,10 @@ -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+ALTER TABLE t1 FORCE; -+SELECT ENGINE = 'InnoDB' FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; -+ENGINE = 'InnoDB' -+1 -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_as_master.result b/mysql-test/suite/galera/r/galera_as_master.result -new file mode 100644 -index 0000000..cca5535 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_as_master.result -@@ -0,0 +1,9 @@ -+START SLAVE USER='root'; -+Warnings: -+Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure. -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES(1); -+INSERT INTO t1 VALUES(2); -+DROP TABLE t1; -+STOP SLAVE; -+RESET SLAVE ALL; -diff --git a/mysql-test/suite/galera/r/galera_as_master_gtid.result b/mysql-test/suite/galera/r/galera_as_master_gtid.result -new file mode 100644 -index 0000000..8dfe462 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_as_master_gtid.result -@@ -0,0 +1,59 @@ -+START SLAVE USER='root'; -+Warnings: -+Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure. -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES(1); -+uuids_do_not_match -+1 -+SHOW BINLOG EVENTS IN 'mysqld-bin.000002' FROM 120; -+Log_name Pos Event_type Server_id End_log_pos Info -+mysqld-bin.000002 120 Previous_gtids 1 151 -+mysqld-bin.000002 151 Gtid 1 199 SET @@SESSION.GTID_NEXT= ':1' -+mysqld-bin.000002 199 Query 1 327 use `test`; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB -+mysqld-bin.000002 327 Gtid 1 375 SET @@SESSION.GTID_NEXT= ':2' -+mysqld-bin.000002 375 Query 1 452 BEGIN -+mysqld-bin.000002 452 Table_map 1 497 table_id: # (test.t1) -+mysqld-bin.000002 497 Write_rows 1 537 table_id: # flags: STMT_END_F -+mysqld-bin.000002 537 Xid 1 568 COMMIT /* xid=# */ -+INSERT INTO t1 VALUES(2); -+uuids_do_not_match -+1 -+uuids_match -+1 -+SHOW BINLOG EVENTS IN 'mysqld-bin.000003' FROM 120; -+Log_name Pos Event_type Server_id End_log_pos Info -+mysqld-bin.000003 120 Previous_gtids 2 151 -+mysqld-bin.000003 151 Gtid 1 199 SET @@SESSION.GTID_NEXT= ':1' -+mysqld-bin.000003 199 Query 1 327 use `test`; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB -+mysqld-bin.000003 327 Gtid 1 375 SET @@SESSION.GTID_NEXT= ':2' -+mysqld-bin.000003 375 Query 1 443 BEGIN -+mysqld-bin.000003 443 Table_map 1 488 table_id: # (test.t1) -+mysqld-bin.000003 488 Write_rows 1 528 table_id: # flags: STMT_END_F -+mysqld-bin.000003 528 Xid 1 559 COMMIT /* xid=# */ -+mysqld-bin.000003 559 Gtid 2 607 SET @@SESSION.GTID_NEXT= ':3' -+mysqld-bin.000003 607 Query 2 684 BEGIN -+mysqld-bin.000003 684 Table_map 2 729 table_id: # (test.t1) -+mysqld-bin.000003 729 Write_rows 2 769 table_id: # flags: STMT_END_F -+mysqld-bin.000003 769 Xid 2 800 COMMIT /* xid=# */ -+uuids_do_not_match -+1 -+uuids_match -+1 -+SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 120; -+Log_name Pos Event_type Server_id End_log_pos Info -+mysqld-bin.000001 120 Previous_gtids 3 151 -+mysqld-bin.000001 151 Gtid 1 199 SET @@SESSION.GTID_NEXT= ':1' -+mysqld-bin.000001 199 Query 1 327 use `test`; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB -+mysqld-bin.000001 327 Gtid 1 375 SET @@SESSION.GTID_NEXT= ':2' -+mysqld-bin.000001 375 Query 1 443 BEGIN -+mysqld-bin.000001 443 Table_map 1 488 table_id: # (test.t1) -+mysqld-bin.000001 488 Write_rows 1 528 table_id: # flags: STMT_END_F -+mysqld-bin.000001 528 Xid 1 559 COMMIT /* xid=# */ -+mysqld-bin.000001 559 Gtid 2 607 SET @@SESSION.GTID_NEXT= ':3' -+mysqld-bin.000001 607 Query 2 675 BEGIN -+mysqld-bin.000001 675 Table_map 2 720 table_id: # (test.t1) -+mysqld-bin.000001 720 Write_rows 2 760 table_id: # flags: STMT_END_F -+mysqld-bin.000001 760 Xid 2 791 COMMIT /* xid=# */ -+DROP TABLE t1; -+STOP SLAVE; -+RESET SLAVE ALL; -diff --git a/mysql-test/suite/galera/r/galera_as_master_gtid_change_master.result b/mysql-test/suite/galera/r/galera_as_master_gtid_change_master.result -new file mode 100644 -index 0000000..80fbccf ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_as_master_gtid_change_master.result -@@ -0,0 +1,15 @@ -+START SLAVE USER='root'; -+Warnings: -+Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure. -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES(1); -+INSERT INTO t1 VALUES(2); -+STOP SLAVE; -+START SLAVE USER='root'; -+Warnings: -+Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure. -+INSERT INTO t1 VALUES(3); -+INSERT INTO t1 VALUES(4); -+DROP TABLE t1; -+STOP SLAVE; -+RESET SLAVE ALL; -diff --git a/mysql-test/suite/galera/r/galera_as_slave.result b/mysql-test/suite/galera/r/galera_as_slave.result -new file mode 100644 -index 0000000..f03c813 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_as_slave.result -@@ -0,0 +1,16 @@ -+START SLAVE USER='root'; -+Warnings: -+Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure. -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES(1); -+INSERT INTO t1 VALUES (2); -+SELECT COUNT(*) = 2 FROM t1; -+COUNT(*) = 2 -+1 -+INSERT INTO t1 VALUES (3); -+SELECT COUNT(*) = 3 FROM t1; -+COUNT(*) = 3 -+1 -+DROP TABLE t1; -+STOP SLAVE; -+RESET SLAVE ALL; -diff --git a/mysql-test/suite/galera/r/galera_as_slave_gtid.result b/mysql-test/suite/galera/r/galera_as_slave_gtid.result -new file mode 100644 -index 0000000..f7ee666 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_as_slave_gtid.result -@@ -0,0 +1,18 @@ -+START SLAVE USER='root'; -+Warnings: -+Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure. -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES(1); -+SELECT LENGTH(@@global.gtid_executed) > 1; -+LENGTH(@@global.gtid_executed) > 1 -+1 -+gtid_executed_equal -+1 -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+gtid_executed_equal -+1 -+DROP TABLE t1; -+STOP SLAVE; -+RESET SLAVE ALL; -diff --git a/mysql-test/suite/galera/r/galera_bf_abort.result b/mysql-test/suite/galera/r/galera_bf_abort.result -new file mode 100644 -index 0000000..c55f1a4 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_bf_abort.result -@@ -0,0 +1,10 @@ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES (1); -+INSERT INTO t1 VALUES (1); -+INSERT INTO t1 VALUES (2); -+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -+wsrep_local_aborts_increment -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_bf_abort_for_update.result b/mysql-test/suite/galera/r/galera_bf_abort_for_update.result -new file mode 100644 -index 0000000..3978a3d ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_bf_abort_for_update.result -@@ -0,0 +1,10 @@ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES (1); -+INSERT INTO t1 VALUES (1); -+SELECT * FROM t1 FOR UPDATE; -+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -+wsrep_local_aborts_increment -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_bf_abort_ftwrl.result b/mysql-test/suite/galera/r/galera_bf_abort_ftwrl.result -new file mode 100644 -index 0000000..e381917 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_bf_abort_ftwrl.result -@@ -0,0 +1,8 @@ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+FLUSH TABLES WITH READ LOCK;; -+INSERT INTO t1 VALUES (1); -+UNLOCK TABLES; -+wsrep_local_aborts_increment -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_bf_abort_get_lock.result b/mysql-test/suite/galera/r/galera_bf_abort_get_lock.result -new file mode 100644 -index 0000000..2e44a77 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_bf_abort_get_lock.result -@@ -0,0 +1,12 @@ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+SELECT GET_LOCK("foo", 1000); -+GET_LOCK("foo", 1000) -+1 -+SET AUTOCOMMIT=OFF; -+INSERT INTO t1 VALUES (1); -+SELECT GET_LOCK("foo", 1000);; -+INSERT INTO t1 VALUES (1); -+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -+wsrep_local_aborts_increment -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_bf_abort_lock_table.result b/mysql-test/suite/galera/r/galera_bf_abort_lock_table.result -new file mode 100644 -index 0000000..e657e72 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_bf_abort_lock_table.result -@@ -0,0 +1,8 @@ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+LOCK TABLE t1 WRITE; -+INSERT INTO t1 VALUES (1);; -+INSERT INTO t1 VALUES (2); -+wsrep_local_aborts_increment -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_bf_abort_sleep.result b/mysql-test/suite/galera/r/galera_bf_abort_sleep.result -new file mode 100644 -index 0000000..8e85a5f ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_bf_abort_sleep.result -@@ -0,0 +1,9 @@ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+INSERT INTO t1 VALUES (1); -+SELECT SLEEP(1000);; -+INSERT INTO t1 VALUES (1); -+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -+wsrep_local_aborts_increment -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_binlog_cache_size.result b/mysql-test/suite/galera/r/galera_binlog_cache_size.result -new file mode 100644 -index 0000000..9726cf2 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_binlog_cache_size.result -@@ -0,0 +1,12 @@ -+CREATE TABLE t1 (f1 VARCHAR(767)) ENGINE=InnoDB; -+CREATE TABLE ten (f1 INTEGER); -+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); -+SET GLOBAL binlog_cache_size=4096; -+SET GLOBAL max_binlog_cache_size=4096; -+SET AUTOCOMMIT=ON; -+START TRANSACTION; -+INSERT INTO t1 SELECT REPEAT('a', 767) FROM ten; -+INSERT INTO t1 SELECT REPEAT('a', 767) FROM ten; -+ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again -+DROP TABLE t1; -+DROP TABLE ten; -diff --git a/mysql-test/suite/galera/r/galera_binlog_checksum.result b/mysql-test/suite/galera/r/galera_binlog_checksum.result -new file mode 100644 -index 0000000..a6ab623 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_binlog_checksum.result -@@ -0,0 +1,10 @@ -+CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+UPDATE t1 SET f1 = 2 WHERE f1 = 1; -+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; -+COUNT(*) = 1 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_binlog_event_max_size_max.result b/mysql-test/suite/galera/r/galera_binlog_event_max_size_max.result -new file mode 100644 -index 0000000..4156c0c ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_binlog_event_max_size_max.result -@@ -0,0 +1,9 @@ -+CREATE TABLE ten (f1 INTEGER); -+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); -+CREATE TABLE t1 (f1 VARCHAR(1000)); -+INSERT INTO t1 SELECT REPEAT('x', 1000) FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4; -+SELECT COUNT(*) = 10000 FROM t1; -+COUNT(*) = 10000 -+1 -+DROP TABLE t1; -+DROP TABLE ten; -diff --git a/mysql-test/suite/galera/r/galera_binlog_event_max_size_min.result b/mysql-test/suite/galera/r/galera_binlog_event_max_size_min.result -new file mode 100644 -index 0000000..984a943 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_binlog_event_max_size_min.result -@@ -0,0 +1,6 @@ -+CREATE TABLE t1 (f1 VARCHAR(1000)); -+INSERT INTO t1 VALUES (REPEAT('x', 1000)); -+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = REPEAT('x', 1000); -+COUNT(*) = 1 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_binlog_row_image.result b/mysql-test/suite/galera/r/galera_binlog_row_image.result -new file mode 100644 -index 0000000..a1f0fb4 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_binlog_row_image.result -@@ -0,0 +1,79 @@ -+SET SESSION binlog_row_image=minimal; -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+CREATE TABLE t2 (f1 INTEGER NOT NULL UNIQUE) ENGINE=InnoDB; -+CREATE TABLE t3 (f1 VARCHAR(1)) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+INSERT INTO t2 VALUES (1); -+INSERT INTO t3 VALUES (1); -+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 1 FROM t2 WHERE f1 = 1; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 1 FROM t3 WHERE f1 = 1; -+COUNT(*) = 1 -+1 -+UPDATE t1 SET f1 = 2 WHERE f1 = 1; -+UPDATE t2 SET f1 = 2 WHERE f1 = 1; -+UPDATE t3 SET f1 = 2 WHERE f1 = 1; -+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 1 FROM t2 WHERE f1 = 2; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 1 FROM t3 WHERE f1 = 2; -+COUNT(*) = 1 -+1 -+DELETE FROM t1; -+DELETE FROM t2; -+DELETE FROM t3; -+SELECT COUNT(*) = 0 FROM t1; -+COUNT(*) = 0 -+1 -+SELECT COUNT(*) = 0 FROM t2; -+COUNT(*) = 0 -+1 -+SELECT COUNT(*) = 0 FROM t3; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -+DROP TABLE t2; -+DROP TABLE t3; -+SET SESSION binlog_row_image=noblob; -+CREATE TABLE t1 (f1 BLOB, f2 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+CREATE TABLE t2 (f1 BLOB) ENGINE=InnoDB; -+INSERT INTO t1 VALUES ('abc', 1); -+INSERT INTO t2 VALUES ('abc'); -+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 'abc'; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 1 FROM t2 WHERE f1 = 'abc'; -+COUNT(*) = 1 -+1 -+UPDATE t1 SET f1 = 'xyz'; -+UPDATE t2 SET f1 = 'xyz'; -+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 'xyz'; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 1 FROM t2 WHERE f1 = 'xyz'; -+COUNT(*) = 1 -+1 -+UPDATE t1 SET f2 = 2 WHERE f2 = 1; -+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 2; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 'xyz'; -+COUNT(*) = 1 -+1 -+DELETE FROM t1; -+DELETE FROM t2; -+SELECT COUNT(*) = 0 FROM t1; -+COUNT(*) = 0 -+1 -+SELECT COUNT(*) = 0 FROM t2; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -+DROP TABLE t2; -diff --git a/mysql-test/suite/galera/r/galera_binlog_rows_query_log_events.result b/mysql-test/suite/galera/r/galera_binlog_rows_query_log_events.result -new file mode 100644 -index 0000000..80ae3d0 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_binlog_rows_query_log_events.result -@@ -0,0 +1,12 @@ -+SET GLOBAL binlog_rows_query_log_events=TRUE; -+CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+UPDATE t1 SET f1 = 2 WHERE f1 = 1; -+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; -+COUNT(*) = 1 -+1 -+SET GLOBAL binlog_rows_query_log_events = 0; -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_create_function.result b/mysql-test/suite/galera/r/galera_create_function.result -new file mode 100644 -index 0000000..4d19faf ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_create_function.result -@@ -0,0 +1,55 @@ -+CREATE USER 'user1'; -+CREATE -+DEFINER = 'user1' -+FUNCTION f1 (param INTEGER) -+RETURNS VARCHAR(200) -+COMMENT 'f1_comment' -+LANGUAGE SQL -+NOT DETERMINISTIC -+MODIFIES SQL DATA -+SQL SECURITY DEFINER -+RETURN 'abc'; -+GRANT EXECUTE ON FUNCTION f1 TO user1; -+CREATE -+DEFINER = CURRENT_USER -+FUNCTION f2 (param VARCHAR(100)) -+RETURNS INTEGER -+DETERMINISTIC -+NO SQL -+SQL SECURITY INVOKER -+RETURN 123; -+SHOW CREATE FUNCTION f1; -+Function sql_mode Create Function character_set_client collation_connection Database Collation -+f1 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`user1`@`%` FUNCTION `f1`(param INTEGER) RETURNS varchar(200) CHARSET latin1 -+ MODIFIES SQL DATA -+ COMMENT 'f1_comment' -+RETURN 'abc' latin1 latin1_swedish_ci latin1_swedish_ci -+SHOW CREATE FUNCTION f1; -+Function sql_mode Create Function character_set_client collation_connection Database Collation -+f1 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`user1`@`%` FUNCTION `f1`(param INTEGER) RETURNS varchar(200) CHARSET latin1 -+ MODIFIES SQL DATA -+ COMMENT 'f1_comment' -+RETURN 'abc' latin1 latin1_swedish_ci latin1_swedish_ci -+SHOW CREATE FUNCTION f2; -+Function sql_mode Create Function character_set_client collation_connection Database Collation -+f2 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f2`(param VARCHAR(100)) RETURNS int(11) -+ NO SQL -+ DETERMINISTIC -+ SQL SECURITY INVOKER -+RETURN 123 latin1 latin1_swedish_ci latin1_swedish_ci -+SHOW CREATE FUNCTION f2; -+Function sql_mode Create Function character_set_client collation_connection Database Collation -+f2 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f2`(param VARCHAR(100)) RETURNS int(11) -+ NO SQL -+ DETERMINISTIC -+ SQL SECURITY INVOKER -+RETURN 123 latin1 latin1_swedish_ci latin1_swedish_ci -+SELECT f1(1) = 'abc'; -+f1(1) = 'abc' -+1 -+SELECT f2('abc') = 123; -+f2('abc') = 123 -+1 -+DROP FUNCTION f1; -+DROP FUNCTION f2; -+DROP USER 'user1'; -diff --git a/mysql-test/suite/galera/r/galera_create_procedure.result b/mysql-test/suite/galera/r/galera_create_procedure.result -new file mode 100644 -index 0000000..997bbba ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_create_procedure.result -@@ -0,0 +1,53 @@ -+CREATE USER 'user1'; -+CREATE TABLE t1 (f1 INTEGER); -+CREATE -+DEFINER = 'user1' -+PROCEDURE p1 (IN param1 INTEGER, OUT param2 INTEGER, INOUT param3 INTEGER) -+COMMENT 'p1_comment' -+LANGUAGE SQL -+NOT DETERMINISTIC -+MODIFIES SQL DATA -+SQL SECURITY DEFINER -+INSERT INTO t1 VALUES (1); -+GRANT EXECUTE ON PROCEDURE p1 TO user1; -+CREATE -+DEFINER = CURRENT_USER -+PROCEDURE p2 (param VARCHAR(100)) -+DETERMINISTIC -+NO SQL -+SQL SECURITY INVOKER BEGIN END ; -+SHOW CREATE PROCEDURE p1; -+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -+p1 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`user1`@`%` PROCEDURE `p1`(IN param1 INTEGER, OUT param2 INTEGER, INOUT param3 INTEGER) -+ MODIFIES SQL DATA -+ COMMENT 'p1_comment' -+INSERT INTO t1 VALUES (1) latin1 latin1_swedish_ci latin1_swedish_ci -+SELECT 1 FROM DUAL; -+1 -+1 -+SHOW CREATE PROCEDURE p1; -+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -+p1 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`user1`@`%` PROCEDURE `p1`(IN param1 INTEGER, OUT param2 INTEGER, INOUT param3 INTEGER) -+ MODIFIES SQL DATA -+ COMMENT 'p1_comment' -+INSERT INTO t1 VALUES (1) latin1 latin1_swedish_ci latin1_swedish_ci -+SHOW CREATE PROCEDURE p2; -+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -+p2 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`(param VARCHAR(100)) -+ NO SQL -+ DETERMINISTIC -+ SQL SECURITY INVOKER -+BEGIN END latin1 latin1_swedish_ci latin1_swedish_ci -+SHOW CREATE PROCEDURE p2; -+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation -+p2 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`(param VARCHAR(100)) -+ NO SQL -+ DETERMINISTIC -+ SQL SECURITY INVOKER -+BEGIN END latin1 latin1_swedish_ci latin1_swedish_ci -+CALL p1(@a, @b, @c); -+CALL p2('abc'); -+DROP PROCEDURE p1; -+DROP PROCEDURE p2; -+DROP USER 'user1'; -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_create_table_like.result b/mysql-test/suite/galera/r/galera_create_table_like.result -new file mode 100644 -index 0000000..b335101 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_create_table_like.result -@@ -0,0 +1,47 @@ -+CREATE SCHEMA schema1; -+CREATE SCHEMA schema2; -+USE schema1; -+CREATE TABLE real_table (f1 INTEGER) ENGINE=InnoDB; -+CREATE TEMPORARY TABLE temp_table (f1 INTEGER) ENGINE=InnoDB; -+CREATE TABLE myisam_table (f1 INTEGER) ENGINE=MyISAM; -+USE schema2; -+CREATE TABLE real_table1 LIKE schema1.real_table; -+CREATE TABLE real_table2 LIKE schema1.temp_table; -+CREATE TABLE real_table3 LIKE schema1.myisam_table; -+CREATE TEMPORARY TABLE temp_table1 LIKE schema1.real_table; -+CREATE TEMPORARY TABLE temp_table2 LIKE schema1.temp_table; -+CREATE TEMPORARY TABLE temp_table3 LIKE schema1.myisam_table; -+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'real_table' AND TABLE_SCHEMA = 'schema1'; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'myisam_table' AND TABLE_SCHEMA = 'schema1'; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'temp_table' AND TABLE_SCHEMA = 'schema1'; -+COUNT(*) = 0 -+1 -+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'real_table1' AND TABLE_SCHEMA = 'schema2'; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'real_table2' AND TABLE_SCHEMA = 'schema2'; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'real_table3' AND TABLE_SCHEMA = 'schema2'; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'temp_table1' AND TABLE_SCHEMA = 'schema2'; -+COUNT(*) = 0 -+1 -+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'temp_table2' AND TABLE_SCHEMA = 'schema2'; -+COUNT(*) = 0 -+1 -+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'temp_table3' AND TABLE_SCHEMA = 'schema2'; -+COUNT(*) = 0 -+1 -+DROP TABLE schema1.real_table; -+DROP TABLE schema1.myisam_table; -+DROP TABLE schema2.real_table1; -+DROP TABLE schema2.real_table2; -+DROP TABLE schema2.real_table3; -+DROP SCHEMA schema1; -+DROP SCHEMA schema2; -diff --git a/mysql-test/suite/galera/r/galera_create_trigger.result b/mysql-test/suite/galera/r/galera_create_trigger.result -new file mode 100644 -index 0000000..7e65608 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_create_trigger.result -@@ -0,0 +1,42 @@ -+CREATE TABLE definer_root (f1 INTEGER, trigger_user VARCHAR(100)) ENGINE=InnoDB; -+CREATE TABLE definer_user (f1 INTEGER, trigger_user VARCHAR(100)) ENGINE=InnoDB; -+CREATE TABLE definer_current_user (f1 INTEGER, trigger_user VARCHAR(100)) ENGINE=InnoDB; -+CREATE TABLE definer_default (f1 INTEGER, trigger_user VARCHAR(100)) ENGINE=InnoDB; -+CREATE USER 'user1'; -+CREATE DEFINER=root@localhost TRIGGER definer_root BEFORE INSERT ON definer_root FOR EACH ROW SET NEW.trigger_user = CURRENT_USER(); -+CREATE DEFINER=user1 TRIGGER definer_user BEFORE INSERT ON definer_user FOR EACH ROW SET NEW.trigger_user = CURRENT_USER(); -+CREATE DEFINER=current_user TRIGGER definer_current_user BEFORE INSERT ON definer_current_user FOR EACH ROW SET NEW.trigger_user = CURRENT_USER(); -+CREATE TRIGGER definer_default BEFORE INSERT ON definer_default FOR EACH ROW SET NEW.trigger_user = CURRENT_USER(); -+INSERT INTO definer_root (f1) VALUES (1); -+SELECT DEFINER = 'root@localhost' FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME = 'definer_root'; -+DEFINER = 'root@localhost' -+1 -+SELECT trigger_user = 'root@localhost' FROM definer_root; -+trigger_user = 'root@localhost' -+1 -+INSERT INTO definer_user (f1) VALUES (1); -+SELECT DEFINER = 'user1@%' FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME = 'definer_user'; -+DEFINER = 'user1@%' -+1 -+SELECT trigger_user = 'user1@%' FROM definer_user; -+trigger_user = 'user1@%' -+1 -+INSERT INTO definer_current_user (f1) VALUES (1); -+SELECT DEFINER = 'root@localhost' FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME = 'definer_current_user'; -+DEFINER = 'root@localhost' -+1 -+SELECT trigger_user = 'root@localhost' FROM definer_current_user; -+trigger_user = 'root@localhost' -+1 -+INSERT INTO definer_default (f1) VALUES (1); -+SELECT DEFINER = 'root@localhost' FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME = 'definer_default'; -+DEFINER = 'root@localhost' -+1 -+SELECT trigger_user = 'root@localhost' FROM definer_default; -+trigger_user = 'root@localhost' -+1 -+DROP TABLE definer_current_user; -+DROP TABLE definer_user; -+DROP TABLE definer_root; -+DROP TABLE definer_default; -+DROP USER 'user1'; -diff --git a/mysql-test/suite/galera/r/galera_defaults.result b/mysql-test/suite/galera/r/galera_defaults.result -new file mode 100644 -index 0000000..8bd2221 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_defaults.result -@@ -0,0 +1,117 @@ -+SELECT COUNT(*) = 40 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_%'; -+COUNT(*) = 40 -+1 -+SELECT VARIABLE_NAME, VARIABLE_VALUE -+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -+WHERE VARIABLE_NAME LIKE 'wsrep_%' -+AND VARIABLE_NAME NOT IN ( -+'WSREP_PROVIDER_OPTIONS', -+'WSREP_SST_RECEIVE_ADDRESS', -+'WSREP_NODE_ADDRESS', -+'WSREP_NODE_NAME', -+'WSREP_PROVIDER', -+'WSREP_DATA_HOME_DIR', -+'WSREP_NODE_INCOMING_ADDRESS', -+'WSREP_START_POSITION' -+) -+ORDER BY VARIABLE_NAME; -+VARIABLE_NAME VARIABLE_VALUE -+WSREP_AUTO_INCREMENT_CONTROL ON -+WSREP_CAUSAL_READS ON -+WSREP_CERTIFY_NONPK ON -+WSREP_CLUSTER_ADDRESS gcomm:// -+WSREP_CLUSTER_NAME my_wsrep_cluster -+WSREP_CONVERT_LOCK_TO_TRX OFF -+WSREP_DBUG_OPTION -+WSREP_DEBUG OFF -+WSREP_DESYNC OFF -+WSREP_DRUPAL_282555_WORKAROUND OFF -+WSREP_FORCED_BINLOG_FORMAT NONE -+WSREP_LOAD_DATA_SPLITTING ON -+WSREP_LOG_CONFLICTS OFF -+WSREP_MAX_WS_ROWS 131072 -+WSREP_MAX_WS_SIZE 1073741824 -+WSREP_MYSQL_REPLICATION_BUNDLE 0 -+WSREP_NOTIFY_CMD -+WSREP_ON ON -+WSREP_OSU_METHOD TOI -+WSREP_PREORDERED OFF -+WSREP_RECOVER OFF -+WSREP_REPLICATE_MYISAM OFF -+WSREP_RESTART_SLAVE OFF -+WSREP_RETRY_AUTOCOMMIT 1 -+WSREP_SLAVE_FK_CHECKS ON -+WSREP_SLAVE_THREADS 1 -+WSREP_SLAVE_UK_CHECKS OFF -+WSREP_SST_AUTH -+WSREP_SST_DONOR -+WSREP_SST_DONOR_REJECTS_QUERIES OFF -+WSREP_SST_METHOD rsync -+WSREP_SYNC_WAIT 7 -+; ; ; cert.log_conflicts = no; debug = no; evs.auto_evict = 0; evs.causal_keepalive_period = PT1S; evs.debug_log_mask = 0x1; evs.delay_margin = PT1S; evs.delayed_keep_period = PT30S; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT15S; evs.info_log_mask = 0; evs.install_timeout = PT7.5S; evs.join_retrans_period = PT1S; evs.keepalive_period = PT1S; evs.max_install_timeouts = 3; evs.send_window = 4; evs.stats_report_period = PT1M; evs.suspect_timeout = PT5S; evs.use_aggregate = true; evs.user_send_window = 2; evs.version = 0; evs.view_forget_timeout = P1D; ; gcache.keep_pages_size = 0; gcache.mem_size = 0; ; gcache.page_size = 128M; gcache.size = 128M; gcs.fc_debug = 0; gcs.fc_factor = 1.0; gcs.fc_limit = 16; gcs.fc_master_slave = no; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; gcs.recv_q_hard_limit = 9223372036854775807; gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; ; gmcast.mcast_addr = ; gmcast.mcast_ttl = 1; gmcast.peer_timeout = PT3S; gmcast.segment = 0; gmcast.time_wait = PT5S; gmcast.version = 0; ; pc.announce_timeout = PT3S; pc.checksum = false; pc.ignore_quorum = false; pc.ignore_sb = false; pc.linger = PT20S; pc.npvo = false; pc.recovery = true; pc.version = 0; pc.wait_prim = true; pc.wait_prim_timeout = P30S; pc.weight = 1; protonet.backend = asio; protonet.version = 0; repl.causal_read_timeout = PT30S; repl.commit_order = 3; repl.key_format = FLAT8; repl.max_ws_size = 2147483647; repl.proto_max = 7; socket.checksum = 2; -+SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS -+WHERE VARIABLE_NAME LIKE 'wsrep_%' -+AND VARIABLE_NAME != 'wsrep_debug_sync_waiters'; -+COUNT(*) -+56 -+SELECT VARIABLE_NAME FROM INFORMATION_SCHEMA.GLOBAL_STATUS -+WHERE VARIABLE_NAME LIKE 'wsrep_%' -+AND VARIABLE_NAME != 'wsrep_debug_sync_waiters' -+ORDER BY VARIABLE_NAME; -+VARIABLE_NAME -+WSREP_APPLY_OOOE -+WSREP_APPLY_OOOL -+WSREP_APPLY_WINDOW -+WSREP_CAUSAL_READS -+WSREP_CERT_DEPS_DISTANCE -+WSREP_CERT_INDEX_SIZE -+WSREP_CERT_INTERVAL -+WSREP_CLUSTER_CONF_ID -+WSREP_CLUSTER_SIZE -+WSREP_CLUSTER_STATE_UUID -+WSREP_CLUSTER_STATUS -+WSREP_COMMIT_OOOE -+WSREP_COMMIT_OOOL -+WSREP_COMMIT_WINDOW -+WSREP_CONNECTED -+WSREP_EVS_DELAYED -+WSREP_EVS_EVICT_LIST -+WSREP_EVS_REPL_LATENCY -+WSREP_EVS_STATE -+WSREP_FLOW_CONTROL_PAUSED -+WSREP_FLOW_CONTROL_PAUSED_NS -+WSREP_FLOW_CONTROL_RECV -+WSREP_FLOW_CONTROL_SENT -+WSREP_GCOMM_UUID -+WSREP_INCOMING_ADDRESSES -+WSREP_LAST_COMMITTED -+WSREP_LOCAL_BF_ABORTS -+WSREP_LOCAL_CACHED_DOWNTO -+WSREP_LOCAL_CERT_FAILURES -+WSREP_LOCAL_COMMITS -+WSREP_LOCAL_INDEX -+WSREP_LOCAL_RECV_QUEUE -+WSREP_LOCAL_RECV_QUEUE_AVG -+WSREP_LOCAL_RECV_QUEUE_MAX -+WSREP_LOCAL_RECV_QUEUE_MIN -+WSREP_LOCAL_REPLAYS -+WSREP_LOCAL_SEND_QUEUE -+WSREP_LOCAL_SEND_QUEUE_AVG -+WSREP_LOCAL_SEND_QUEUE_MAX -+WSREP_LOCAL_SEND_QUEUE_MIN -+WSREP_LOCAL_STATE -+WSREP_LOCAL_STATE_COMMENT -+WSREP_LOCAL_STATE_UUID -+WSREP_PROTOCOL_VERSION -+WSREP_PROVIDER_NAME -+WSREP_PROVIDER_VENDOR -+WSREP_PROVIDER_VERSION -+WSREP_READY -+WSREP_RECEIVED -+WSREP_RECEIVED_BYTES -+WSREP_REPLICATED -+WSREP_REPLICATED_BYTES -+WSREP_REPL_DATA_BYTES -+WSREP_REPL_KEYS -+WSREP_REPL_KEYS_BYTES -+WSREP_REPL_OTHER_BYTES -diff --git a/mysql-test/suite/galera/r/galera_delete_limit.result b/mysql-test/suite/galera/r/galera_delete_limit.result -new file mode 100644 -index 0000000..72bee18 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_delete_limit.result -@@ -0,0 +1,19 @@ -+CREATE TABLE ten (f1 INTEGER) Engine=InnoDB; -+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB; -+INSERT INTO t1 SELECT f1 FROM ten ORDER BY RAND(); -+DELETE FROM t1 ORDER BY RAND() LIMIT 5; -+sum_matches -+1 -+max_matches -+1 -+DROP TABLE t1; -+CREATE TABLE t2 (f1 INTEGER) Engine=InnoDB; -+INSERT INTO t2 SELECT f1 FROM ten ORDER BY RAND(); -+DELETE FROM t2 ORDER BY RAND() LIMIT 5; -+sum_matches -+1 -+max_matches -+1 -+DROP TABLE t2; -+DROP TABLE ten; -diff --git a/mysql-test/suite/galera/r/galera_enum.result b/mysql-test/suite/galera/r/galera_enum.result -new file mode 100644 -index 0000000..e853c5c ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_enum.result -@@ -0,0 +1,37 @@ -+CREATE TABLE t1 (f1 ENUM('', 'one', 'two'), KEY (f1)) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (''); -+INSERT INTO t1 VALUES ('one'), ('two'); -+INSERT INTO t1 VALUES (0), (1), (2); -+Warnings: -+Warning 1265 Data truncated for column 'f1' at row 1 -+SELECT COUNT(*) = 6 FROM t1; -+COUNT(*) = 6 -+1 -+SELECT COUNT(*) = 2 FROM t1 where f1 = ''; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 2 FROM t1 where f1 = 'one'; -+COUNT(*) = 2 -+1 -+DROP TABLE t1; -+CREATE TABLE t1 (f1 ENUM('', 'one', 'two', 'three', 'four') PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (''), ('one'), ('two'); -+SELECT COUNT(*) = 3 FROM t1; -+COUNT(*) = 3 -+1 -+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = ''; -+COUNT(*) = 1 -+1 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t1 SET f1 = 'three' where f1 = ''; -+SET AUTOCOMMIt=OFF; -+START TRANSACTION; -+UPDATE t1 SET f1 = 'four' where f1 = ''; -+COMMIT; -+COMMIT; -+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 'three'; -+COUNT(*) = 1 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_events.result b/mysql-test/suite/galera/r/galera_events.result -new file mode 100644 -index 0000000..09d8406 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_events.result -@@ -0,0 +1,18 @@ -+CREATE EVENT event1 ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT 1; -+SELECT DEFINER= 'root@localhost', ORIGINATOR = 1, STATUS = 'SLAVESIDE_DISABLED', EVENT_TYPE = 'ONE TIME', ON_COMPLETION = 'NOT PRESERVE' FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME = 'event1'; -+DEFINER= 'root@localhost' ORIGINATOR = 1 STATUS = 'SLAVESIDE_DISABLED' EVENT_TYPE = 'ONE TIME' ON_COMPLETION = 'NOT PRESERVE' -+1 1 1 1 1 -+ALTER EVENT event1 DISABLE; -+SELECT DEFINER= 'root@localhost', ORIGINATOR = 1, STATUS = 'SLAVESIDE_DISABLED', EVENT_TYPE = 'ONE TIME', ON_COMPLETION = 'NOT PRESERVE' FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME = 'event1'; -+DEFINER= 'root@localhost' ORIGINATOR = 1 STATUS = 'SLAVESIDE_DISABLED' EVENT_TYPE = 'ONE TIME' ON_COMPLETION = 'NOT PRESERVE' -+1 1 1 1 1 -+SET GLOBAL event_scheduler = ON; -+CREATE EVENT event2 ON SCHEDULE AT CURRENT_TIMESTAMP ON COMPLETION NOT PRESERVE DO SELECT 1; -+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME = 'event2'; -+COUNT(*) = 0 -+1 -+DROP EVENT event1; -+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME = 'event1'; -+COUNT(*) = 0 -+1 -+SET GLOBAL event_scheduler = OFF;; -diff --git a/mysql-test/suite/galera/r/galera_fk_cascade_delete.result b/mysql-test/suite/galera/r/galera_fk_cascade_delete.result -new file mode 100644 -index 0000000..89f4301 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_fk_cascade_delete.result -@@ -0,0 +1,30 @@ -+CREATE TABLE grandparent ( -+id INT NOT NULL PRIMARY KEY -+) ENGINE=InnoDB; -+CREATE TABLE parent ( -+id INT NOT NULL PRIMARY KEY, -+grandparent_id INT, -+FOREIGN KEY (grandparent_id) -+REFERENCES grandparent(id) -+ON DELETE CASCADE -+) ENGINE=InnoDB; -+CREATE TABLE child ( -+id INT NOT NULL PRIMARY KEY, -+parent_id INT, -+FOREIGN KEY (parent_id) -+REFERENCES parent(id) -+ON DELETE CASCADE -+) ENGINE=InnoDB; -+INSERT INTO grandparent VALUES (1),(2); -+INSERT INTO parent VALUES (1,1), (2,2); -+INSERT INTO child VALUES (1,1), (2,2); -+DELETE FROM grandparent WHERE id = 1; -+SELECT COUNT(*) = 0 FROM parent WHERE grandparent_id = 1; -+COUNT(*) = 0 -+1 -+SELECT COUNT(*) = 0 FROM child WHERE parent_id = 1; -+COUNT(*) = 0 -+1 -+DROP TABLE child; -+DROP TABLE parent; -+DROP TABLE grandparent; -diff --git a/mysql-test/suite/galera/r/galera_fk_cascade_update.result b/mysql-test/suite/galera/r/galera_fk_cascade_update.result -new file mode 100644 -index 0000000..2ab2ad3 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_fk_cascade_update.result -@@ -0,0 +1,30 @@ -+CREATE TABLE grandparent ( -+id INT NOT NULL PRIMARY KEY -+) ENGINE=InnoDB; -+CREATE TABLE parent ( -+id INT NOT NULL PRIMARY KEY, -+grandparent_id INT, -+FOREIGN KEY (grandparent_id) -+REFERENCES grandparent(id) -+ON UPDATE CASCADE -+) ENGINE=InnoDB; -+CREATE TABLE child ( -+id INT NOT NULL PRIMARY KEY, -+grandparent_id INT, -+FOREIGN KEY (grandparent_id) -+REFERENCES parent(grandparent_id) -+ON UPDATE CASCADE -+) ENGINE=InnoDB; -+INSERT INTO grandparent VALUES (1),(2); -+INSERT INTO parent VALUES (1,1), (2,2); -+INSERT INTO child VALUES (1,1), (2,2); -+UPDATE grandparent SET id = 3 WHERE id = 1; -+SELECT COUNT(*) = 1 FROM parent WHERE grandparent_id = 3; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 1 FROM child WHERE grandparent_id = 3; -+COUNT(*) = 1 -+1 -+DROP TABLE child; -+DROP TABLE parent; -+DROP TABLE grandparent; -diff --git a/mysql-test/suite/galera/r/galera_fk_conflict.result b/mysql-test/suite/galera/r/galera_fk_conflict.result -new file mode 100644 -index 0000000..ae6c482 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_fk_conflict.result -@@ -0,0 +1,23 @@ -+CREATE TABLE parent ( -+id INT PRIMARY KEY, -+KEY (id) -+) ENGINE=InnoDB; -+CREATE TABLE child ( -+id INT PRIMARY KEY, -+parent_id INT, -+FOREIGN KEY (parent_id) -+REFERENCES parent(id) -+) ENGINE=InnoDB; -+INSERT INTO parent VALUES (1), (2); -+INSERT INTO child VALUES (1,1); -+SET AUTOCOMMIT = OFF; -+START TRANSACTION; -+DELETE FROM parent WHERE id = 2; -+SET AUTOCOMMIT = OFF; -+START TRANSACTION; -+INSERT INTO child VALUES (2, 2); -+COMMIT; -+COMMIT; -+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -+DROP TABLE child; -+DROP TABLE parent; -diff --git a/mysql-test/suite/galera/r/galera_fk_mismatch.result b/mysql-test/suite/galera/r/galera_fk_mismatch.result -new file mode 100644 -index 0000000..07cdb1b ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_fk_mismatch.result -@@ -0,0 +1,25 @@ -+CREATE TABLE parent ( -+id1 INT, -+id2 INT, -+PRIMARY KEY (id1, id2) /* Multipart PK */ -+) ENGINE=InnoDB; -+CREATE TABLE child ( -+id INT PRIMARY KEY, -+parent_id1 INT, -+FOREIGN KEY (parent_id1) -+REFERENCES parent(id1) /* FK is subset of PK above */ -+ON UPDATE CASCADE -+ON DELETE CASCADE -+) ENGINE=InnoDB; -+INSERT INTO parent VALUES (1, 2); -+INSERT INTO child VALUES (1, 1); -+UPDATE parent SET id1 = 3 WHERE id1 = 1; -+SELECT COUNT(*) = 1 FROM child WHERE parent_id1 = 3; -+COUNT(*) = 1 -+1 -+DELETE FROM parent WHERE id1 = 3; -+SELECT COUNT(*) = 0 FROM child WHERE parent_id1 = 3; -+COUNT(*) = 0 -+1 -+DROP TABLE child; -+DROP TABLE parent; -diff --git a/mysql-test/suite/galera/r/galera_fk_multicolumn.result b/mysql-test/suite/galera/r/galera_fk_multicolumn.result -new file mode 100644 -index 0000000..a86b87a ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_fk_multicolumn.result -@@ -0,0 +1,35 @@ -+CREATE TABLE t0 ( -+f1 INT PRIMARY KEY, -+f2 INT UNIQUE -+); -+CREATE TABLE t1 ( -+f1 INT PRIMARY KEY, -+FOREIGN KEY (f1) -+REFERENCES t0(f1) -+ON UPDATE CASCADE -+); -+CREATE TABLE t2 ( -+f2 INT PRIMARY KEY, -+FOREIGN KEY (f2) -+REFERENCES t0(f2) -+ON UPDATE CASCADE -+); -+INSERT INTO t0 VALUES (0, 0); -+INSERT INTO t1 VALUES (0); -+INSERT INTO t2 VALUES (0); -+UPDATE t0 SET f1 = 1, f2 = 2; -+SELECT f1 = 1 FROM t1 WHERE f1 = 1; -+f1 = 1 -+1 -+SELECT f2 = 2 FROM t2 WHERE f2 = 2; -+f2 = 2 -+1 -+SELECT f1 = 1 FROM t1; -+f1 = 1 -+1 -+SELECT f2 = 2 FROM t2; -+f2 = 2 -+1 -+DROP TABLE t2; -+DROP TABLE t1; -+DROP TABLE t0; -diff --git a/mysql-test/suite/galera/r/galera_fk_multitable.result b/mysql-test/suite/galera/r/galera_fk_multitable.result -new file mode 100644 -index 0000000..e77128d ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_fk_multitable.result -@@ -0,0 +1,22 @@ -+CREATE TABLE t0 ( -+f0 INT PRIMARY KEY -+); -+CREATE TABLE t1 ( -+f1 INT PRIMARY KEY, -+f0 INTEGER, -+FOREIGN KEY (f0) -+REFERENCES t0(f0) -+ON DELETE CASCADE -+); -+INSERT INTO t0 VALUES (0), (1); -+INSERT INTO t1 VALUES (0, 0); -+INSERT INTO t1 VALUES (1, 0); -+DELETE t0.*, t1.* FROM t0, t1 WHERE t0.f0 = 0 AND t1.f1 = 0; -+SELECT COUNT(*) = 1 FROM t0; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 0 FROM t1; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -+DROP TABLE t0; -diff --git a/mysql-test/suite/galera/r/galera_fk_no_pk.result b/mysql-test/suite/galera/r/galera_fk_no_pk.result -new file mode 100644 -index 0000000..e4f9286 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_fk_no_pk.result -@@ -0,0 +1,28 @@ -+CREATE TABLE parent ( -+id INT, -+KEY (id) -+) ENGINE=InnoDB; -+CREATE TABLE child ( -+id INT, -+parent_id INT, -+FOREIGN KEY (parent_id) -+REFERENCES parent(id) -+ON UPDATE CASCADE -+ON DELETE CASCADE -+) ENGINE=InnoDB; -+INSERT INTO parent VALUES (1), (1), (2), (2); -+INSERT INTO child VALUES (1,1), (2,2), (1,1), (2,2); -+DELETE FROM parent WHERE id = 1; -+SELECT COUNT(*) = 0 FROM child WHERE id = 1; -+COUNT(*) = 0 -+1 -+UPDATE parent SET id = 3 WHERE id = 2; -+SELECT COUNT(*) = 0 FROM child WHERE parent_id = 1; -+COUNT(*) = 0 -+1 -+SELECT parent_id = 3 FROM child WHERE id = 2; -+parent_id = 3 -+1 -+1 -+DROP TABLE child; -+DROP TABLE parent; -diff --git a/mysql-test/suite/galera/r/galera_fk_selfreferential.result b/mysql-test/suite/galera/r/galera_fk_selfreferential.result -new file mode 100644 -index 0000000..25c3704 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_fk_selfreferential.result -@@ -0,0 +1,13 @@ -+CREATE TABLE t1 ( -+f1 INT NOT NULL PRIMARY KEY, -+f2 INT, -+FOREIGN KEY (f2) -+REFERENCES t1(f1) -+ON DELETE CASCADE -+) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1, 1), (2, 1); -+DELETE FROM t1 WHERE f1 = 1; -+SELECT COUNT(*) = 0 FROM t1; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_fk_setnull.result b/mysql-test/suite/galera/r/galera_fk_setnull.result -new file mode 100644 -index 0000000..f7fb9d0 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_fk_setnull.result -@@ -0,0 +1,30 @@ -+CREATE TABLE parent ( -+id INT NOT NULL, -+PRIMARY KEY (id) -+) ENGINE=InnoDB; -+CREATE TABLE child ( -+id INT, -+parent_id INT, -+FOREIGN KEY (parent_id) -+REFERENCES parent(id) -+ON UPDATE SET NULL -+ON DELETE SET NULL -+) ENGINE=InnoDB; -+INSERT INTO parent VALUES (1),(2); -+INSERT INTO child VALUES (1,1),(2,2); -+DELETE FROM parent WHERE id = 1; -+SELECT parent_id IS NULL FROM child WHERE id = 1; -+parent_id IS NULL -+1 -+SELECT parent_id IS NULL FROM child WHERE id = 1; -+parent_id IS NULL -+1 -+UPDATE parent SET id = 3 WHERE id = 2; -+SELECT parent_id IS NULL FROM child WHERE id = 2; -+parent_id IS NULL -+1 -+SELECT parent_id IS NULL FROM child WHERE id = 2; -+parent_id IS NULL -+1 -+DROP TABLE child; -+DROP TABLE parent; -diff --git a/mysql-test/suite/galera/r/galera_ftwrl.result b/mysql-test/suite/galera/r/galera_ftwrl.result -new file mode 100644 -index 0000000..c216b52 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_ftwrl.result -@@ -0,0 +1,16 @@ -+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; -+SET GLOBAL wsrep_provider_options = "repl.causal_read_timeout=PT1S"; -+FLUSH TABLES WITH READ LOCK; -+INSERT INTO t1 VALUES (1); -+SHOW TABLES; -+ERROR HY000: Lock wait timeout exceeded; try restarting transaction -+SELECT * FROM t1; -+ERROR HY000: Lock wait timeout exceeded; try restarting transaction -+UNLOCK TABLES; -+SHOW TABLES; -+Tables_in_test -+t1 -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_fulltext.result b/mysql-test/suite/galera/r/galera_fulltext.result -new file mode 100644 -index 0000000..7257769 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_fulltext.result -@@ -0,0 +1,26 @@ -+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); -+CREATE TABLE t1 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 VARCHAR(100), FULLTEXT (f2)) ENGINE=InnoDB; -+SELECT COUNT(*) = 13 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE name LIKE 'test/%'; -+COUNT(*) = 13 -+1 -+INSERT INTO t1 (f2) SELECT 'foobarbaz' FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4; -+SELECT COUNT(f2) = 10000 FROM t1 WHERE MATCH(f2) AGAINST ('foobarbaz'); -+COUNT(f2) = 10000 -+1 -+UPDATE t1 SET f2 = 'abcdefjhk'; -+SELECT COUNT(f2) = 10000 FROM t1 WHERE MATCH(f2) AGAINST ('abcdefjhk'); -+COUNT(f2) = 10000 -+1 -+DROP TABLE t1; -+CREATE TABLE t1 (f1 VARCHAR(100), FULLTEXT (f1)) ENGINE=InnoDB; -+INSERT INTO t1 (f1) SELECT 'foobarbaz' FROM ten AS a1, ten AS a2, ten AS a3; -+SELECT COUNT(f1) = 1000 FROM t1 WHERE MATCH(f1) AGAINST ('foobarbaz'); -+COUNT(f1) = 1000 -+1 -+UPDATE t1 SET f1 = 'abcdefjhk'; -+SELECT COUNT(f1) = 1000 FROM t1 WHERE MATCH(f1) AGAINST ('abcdefjhk'); -+COUNT(f1) = 1000 -+1 -+DROP TABLE t1; -+DROP TABLE ten; -diff --git a/mysql-test/suite/galera/r/galera_gcs_fc_limit.result b/mysql-test/suite/galera/r/galera_gcs_fc_limit.result -new file mode 100644 -index 0000000..99c710f ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_gcs_fc_limit.result -@@ -0,0 +1,17 @@ -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+SET GLOBAL wsrep_provider_options = 'gcs.fc_limit=1'; -+FLUSH TABLES WITH READ LOCK; -+INSERT INTO t1 VALUES (2); -+INSERT INTO t1 VALUES (3); -+INSERT INTO t1 VALUES (4); -+INSERT INTO t1 VALUES (5); -+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'query end' AND INFO = 'INSERT INTO t1 VALUES (5)'; -+COUNT(*) = 1 -+1 -+UNLOCK TABLES; -+INSERT INTO t1 VALUES (6); -+SELECT COUNT(*) = 6 FROM t1; -+COUNT(*) = 6 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_gcs_max_packet_size.result b/mysql-test/suite/galera/r/galera_gcs_max_packet_size.result -new file mode 100644 -index 0000000..606cb54 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_gcs_max_packet_size.result -@@ -0,0 +1,15 @@ -+CREATE TABLE ten (f1 INTEGER); -+INSERT INTO ten VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); -+CREATE TABLE t1 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=InnoDB; -+CREATE TABLE t2 (f1 VARCHAR(512) UNIQUE) ENGINE=InnoDB; -+INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4; -+INSERT INTO t2 VALUES (REPEAT('x', 512)); -+SELECT COUNT(*) = 10000 FROM t1; -+COUNT(*) = 10000 -+1 -+SELECT LENGTH(f1) = 512 FROM t2 WHERE f1 = REPEAT('x', 512); -+LENGTH(f1) = 512 -+1 -+DROP TABLE t1; -+DROP TABLE t2; -+DROP TABLE ten; -diff --git a/mysql-test/suite/galera/r/galera_gtid.result b/mysql-test/suite/galera/r/galera_gtid.result -new file mode 100644 -index 0000000..50d561d ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_gtid.result -@@ -0,0 +1,12 @@ -+CREATE TABLE t1 (f1 INT PRIMARY KEY); -+INSERT INTO t1 VALUES (1); -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+UPDATE t1 SET f1 = 2; -+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; -+COUNT(*) = 1 -+1 -+gtid_executed_equal -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_insert_ignore.result b/mysql-test/suite/galera/r/galera_insert_ignore.result -new file mode 100644 -index 0000000..2d6e38e ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_insert_ignore.result -@@ -0,0 +1,48 @@ -+SET GLOBAL wsrep_sync_wait = 7; -+SET GLOBAL wsrep_sync_wait = 7; -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+INSERT IGNORE INTO t1 VALUES (1), (2); -+SELECT * FROM t1; -+f1 -+1 -+2 -+SELECT * FROM t1; -+f1 -+1 -+2 -+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO t2 VALUES (0), (2), (3); -+INSERT IGNORE INTO t1 SELECT f1 FROM t2; -+SELECT * FROM t1; -+f1 -+0 -+1 -+2 -+3 -+SELECT * FROM t1; -+f1 -+0 -+1 -+2 -+3 -+CREATE TABLE t3 (f1 INTEGER UNIQUE) Engine=InnoDB; -+INSERT INTO t3 VALUES (NULL); -+INSERT IGNORE INTO t3 VALUES (1), (NULL), (2); -+SELECT * FROM t3; -+f1 -+NULL -+NULL -+1 -+2 -+SELECT * FROM t3; -+f1 -+NULL -+NULL -+1 -+2 -+SET GLOBAL wsrep_sync_wait = (SELECT @@wsrep_sync_wait); -+DROP TABLE t1; -+DROP TABLE t2; -+DROP TABLE t3; -+SET GLOBAL wsrep_sync_wait = (SELECT @@wsrep_sync_wait); -diff --git a/mysql-test/suite/galera/r/galera_insert_multi.result b/mysql-test/suite/galera/r/galera_insert_multi.result -new file mode 100644 -index 0000000..3371778 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_insert_multi.result -@@ -0,0 +1,58 @@ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1),(2); -+INSERT INTO t1 VALUES (3),(4); -+SELECT COUNT(*) = 4 FROM t1; -+COUNT(*) = 4 -+1 -+SELECT COUNT(*) = 4 FROM t1; -+COUNT(*) = 4 -+1 -+DROP TABLE t1; -+CREATE TABLE t1 (f1 INTEGER, KEY (f1)) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1),(1); -+INSERT INTO t1 VALUES (2),(2); -+SELECT COUNT(*) = 4 FROM t1; -+COUNT(*) = 4 -+1 -+SELECT COUNT(*) = 4 FROM t1; -+COUNT(*) = 4 -+1 -+DROP TABLE t1; -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (1); -+ERROR 23000: Duplicate entry '1' for key 'PRIMARY' -+SELECT COUNT(*) = 0 FROM t1; -+COUNT(*) = 0 -+1 -+SELECT COUNT(*) = 0 FROM t1; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+SET AUTOCOMMIT = OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES (1), (2); -+SET AUTOCOMMIT = OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES (2), (1); -+COMMIT; -+COMMIT; -+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -+ROLLBACK; -+INSERT INTO t1 VALUES (1), (2); -+ERROR 23000: Duplicate entry '1' for key 'PRIMARY' -+DROP TABLE t1; -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+START TRANSACTION; -+INSERT INTO t1 VALUES (1), (2); -+START TRANSACTION; -+INSERT INTO t1 VALUES (2), (1); -+ROLLBACK; -+COMMIT; -+SELECT COUNT(*) = 2 FROM t1; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 2 FROM t1; -+COUNT(*) = 2 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_ist_innodb_flush_logs.result b/mysql-test/suite/galera/r/galera_ist_innodb_flush_logs.result -new file mode 100644 -index 0000000..5421b23 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_ist_innodb_flush_logs.result -@@ -0,0 +1,184 @@ -+Performing State Transfer on a server that has been killed and restarted -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+COMMIT; -+Killing server ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+COMMIT; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+Performing --wsrep-recover ... -+Starting server ... -+Using --wsrep-start-position when starting mysqld ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+ROLLBACK; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+COMMIT; -+SET AUTOCOMMIT=ON; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -+COMMIT; -+SET AUTOCOMMIT=ON; -+Performing State Transfer on a server that has been killed and restarted -+while a DDL was in progress on it -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+COMMIT; -+SET GLOBAL debug = 'd,sync.alter_opened_table'; -+ALTER TABLE t1 ADD COLUMN f2 INTEGER; -+SET wsrep_sync_wait = 0; -+Killing server ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+COMMIT; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+Performing --wsrep-recover ... -+Starting server ... -+Using --wsrep-start-position when starting mysqld ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+COMMIT; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+COMMIT; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+ROLLBACK; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+COMMIT; -+SET AUTOCOMMIT=ON; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -+COMMIT; -+SET AUTOCOMMIT=ON; -diff --git a/mysql-test/suite/galera/r/galera_ist_mysqldump.result b/mysql-test/suite/galera/r/galera_ist_mysqldump.result -new file mode 100644 -index 0000000..4b5a8fe ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_ist_mysqldump.result -@@ -0,0 +1,284 @@ -+Setting SST method to mysqldump ... -+GRANT ALL PRIVILEGES ON *.* TO 'sst' IDENTIFIED BY 'sst'; -+SET GLOBAL wsrep_sst_auth = 'sst:sst'; -+SET GLOBAL wsrep_sst_method = 'mysqldump'; -+Performing State Transfer on a server that has been shut down cleanly and restarted -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+COMMIT; -+Shutting down server ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+COMMIT; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+Starting server ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+ROLLBACK; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+COMMIT; -+SET AUTOCOMMIT=ON; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -+COMMIT; -+SET AUTOCOMMIT=ON; -+Performing State Transfer on a server that has been killed and restarted -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+COMMIT; -+Killing server ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+COMMIT; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+Performing --wsrep-recover ... -+Starting server ... -+Using --wsrep-start-position when starting mysqld ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+ROLLBACK; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+COMMIT; -+SET AUTOCOMMIT=ON; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -+COMMIT; -+SET AUTOCOMMIT=ON; -+Performing State Transfer on a server that has been killed and restarted -+while a DDL was in progress on it -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+COMMIT; -+SET GLOBAL debug = 'd,sync.alter_opened_table'; -+ALTER TABLE t1 ADD COLUMN f2 INTEGER; -+SET wsrep_sync_wait = 0; -+Killing server ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+COMMIT; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+Performing --wsrep-recover ... -+Starting server ... -+Using --wsrep-start-position when starting mysqld ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+COMMIT; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+COMMIT; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+ROLLBACK; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+COMMIT; -+SET AUTOCOMMIT=ON; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -+COMMIT; -+SET AUTOCOMMIT=ON; -+CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query"); -+DROP USER sst; -+CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query"); -+CALL mtr.add_suppression("InnoDB: Error: Table \"mysql\"\\.\"innodb_index_stats\" not found"); -+CALL mtr.add_suppression("InnoDB: New log files created"); -+CALL mtr.add_suppression("InnoDB: Creating foreign key constraint system tables"); -+CALL mtr.add_suppression("Can't open and lock time zone table"); -+CALL mtr.add_suppression("Can't open and lock privilege tables"); -+CALL mtr.add_suppression("Info table is not ready to be used"); -+CALL mtr.add_suppression("Native table .* has the wrong structure"); -diff --git a/mysql-test/suite/galera/r/galera_ist_restart_joiner.result b/mysql-test/suite/galera/r/galera_ist_restart_joiner.result -new file mode 100644 -index 0000000..f7a1386 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_ist_restart_joiner.result -@@ -0,0 +1,43 @@ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)); -+INSERT INTO t1 VALUES (1, 'a'), (2, 'a'), (3, 'a'), (4, 'a'), (5, 'a'),(6, 'a'); -+Unloading wsrep provider ... -+SET GLOBAL wsrep_provider = 'none'; -+UPDATE t1 SET f2 = 'b' WHERE f1 > 1; -+UPDATE t1 SET f2 = 'c' WHERE f1 > 2; -+SET GLOBAL wsrep_provider_options = 'dbug=d,recv_IST_after_apply_trx'; -+SET SESSION wsrep_sync_wait = 0; -+Loading wsrep_provider ... -+SHOW STATUS LIKE 'wsrep_debug_sync_waiters'; -+Variable_name Value -+wsrep_debug_sync_waiters recv_IST_after_apply_trx -+UPDATE t1 SET f2 = 'd' WHERE f1 > 3; -+CREATE TABLE t2 (f1 INTEGER); -+UPDATE t1 SET f2 = 'e' WHERE f1 > 4; -+CREATE TABLE t3 (f1 INTEGER); -+Performing --wsrep-recover ... -+Starting server ... -+Using --wsrep-start-position when starting mysqld ... -+UPDATE t1 SET f2 = 'f' WHERE f1 > 5; -+SELECT * FROM t1; -+f1 f2 -+1 a -+2 b -+3 c -+4 d -+5 e -+6 f -+SELECT * FROM t1; -+f1 f2 -+1 a -+2 b -+3 c -+4 d -+5 e -+6 f -+SELECT COUNT(*) = 0 FROM t2; -+COUNT(*) = 0 -+1 -+SELECT COUNT(*) = 0 FROM t3; -+COUNT(*) = 0 -+1 -+DROP TABLE t1, t2, t3; -diff --git a/mysql-test/suite/galera/r/galera_ist_rsync.result b/mysql-test/suite/galera/r/galera_ist_rsync.result -new file mode 100644 -index 0000000..175e744 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_ist_rsync.result -@@ -0,0 +1,357 @@ -+Performing State Transfer on a server that has been temporarily disconnected -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+COMMIT; -+Unloading wsrep provider ... -+SET GLOBAL wsrep_provider = 'none'; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+COMMIT; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+Loading wsrep provider ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+ROLLBACK; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+COMMIT; -+SET AUTOCOMMIT=ON; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -+COMMIT; -+SET AUTOCOMMIT=ON; -+Performing State Transfer on a server that has been shut down cleanly and restarted -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+COMMIT; -+Shutting down server ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+COMMIT; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+Starting server ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+ROLLBACK; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+COMMIT; -+SET AUTOCOMMIT=ON; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -+COMMIT; -+SET AUTOCOMMIT=ON; -+Performing State Transfer on a server that has been killed and restarted -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+COMMIT; -+Killing server ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+COMMIT; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+Performing --wsrep-recover ... -+Starting server ... -+Using --wsrep-start-position when starting mysqld ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+ROLLBACK; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+COMMIT; -+SET AUTOCOMMIT=ON; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -+COMMIT; -+SET AUTOCOMMIT=ON; -+Performing State Transfer on a server that has been killed and restarted -+while a DDL was in progress on it -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+COMMIT; -+SET GLOBAL debug = 'd,sync.alter_opened_table'; -+ALTER TABLE t1 ADD COLUMN f2 INTEGER; -+SET wsrep_sync_wait = 0; -+Killing server ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+COMMIT; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+Performing --wsrep-recover ... -+Starting server ... -+Using --wsrep-start-position when starting mysqld ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+COMMIT; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+COMMIT; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+ROLLBACK; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+COMMIT; -+SET AUTOCOMMIT=ON; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -+COMMIT; -+SET AUTOCOMMIT=ON; -diff --git a/mysql-test/suite/galera/r/galera_ist_xtrabackup-v2.result b/mysql-test/suite/galera/r/galera_ist_xtrabackup-v2.result -new file mode 100644 -index 0000000..175e744 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_ist_xtrabackup-v2.result -@@ -0,0 +1,357 @@ -+Performing State Transfer on a server that has been temporarily disconnected -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+COMMIT; -+Unloading wsrep provider ... -+SET GLOBAL wsrep_provider = 'none'; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+COMMIT; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+Loading wsrep provider ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+ROLLBACK; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+COMMIT; -+SET AUTOCOMMIT=ON; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -+COMMIT; -+SET AUTOCOMMIT=ON; -+Performing State Transfer on a server that has been shut down cleanly and restarted -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+COMMIT; -+Shutting down server ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+COMMIT; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+Starting server ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+ROLLBACK; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+COMMIT; -+SET AUTOCOMMIT=ON; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -+COMMIT; -+SET AUTOCOMMIT=ON; -+Performing State Transfer on a server that has been killed and restarted -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+COMMIT; -+Killing server ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+COMMIT; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+Performing --wsrep-recover ... -+Starting server ... -+Using --wsrep-start-position when starting mysqld ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+ROLLBACK; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+COMMIT; -+SET AUTOCOMMIT=ON; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -+COMMIT; -+SET AUTOCOMMIT=ON; -+Performing State Transfer on a server that has been killed and restarted -+while a DDL was in progress on it -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+COMMIT; -+SET GLOBAL debug = 'd,sync.alter_opened_table'; -+ALTER TABLE t1 ADD COLUMN f2 INTEGER; -+SET wsrep_sync_wait = 0; -+Killing server ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+COMMIT; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+Performing --wsrep-recover ... -+Starting server ... -+Using --wsrep-start-position when starting mysqld ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+COMMIT; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+COMMIT; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+ROLLBACK; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+COMMIT; -+SET AUTOCOMMIT=ON; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -+COMMIT; -+SET AUTOCOMMIT=ON; -diff --git a/mysql-test/suite/galera/r/galera_kill_ddl.result b/mysql-test/suite/galera/r/galera_kill_ddl.result -new file mode 100644 -index 0000000..8dd3649 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_kill_ddl.result -@@ -0,0 +1,11 @@ -+SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true'; -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+Killing server ... -+ALTER TABLE t1 ADD COLUMN f2 INTEGER; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='t1'; -+COUNT(*) = 2 -+1 -+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+VARIABLE_VALUE = 2 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_kill_largechanges.result b/mysql-test/suite/galera/r/galera_kill_largechanges.result -new file mode 100644 -index 0000000..a37056a ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_kill_largechanges.result -@@ -0,0 +1,14 @@ -+SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true'; -+CREATE TABLE ten (f1 INTEGER); -+INSERT INTO ten VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); -+CREATE TABLE t1 (f1 VARCHAR(128)) ENGINE=InnoDB; -+Killing server ... -+INSERT INTO t1 SELECT REPEAT('a', 128) FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6; -+SELECT COUNT(*) = 1000000 FROM t1; -+COUNT(*) = 1000000 -+1 -+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+VARIABLE_VALUE = 2 -+1 -+DROP TABLE t1; -+DROP TABLE ten; -diff --git a/mysql-test/suite/galera/r/galera_kill_nochanges.result b/mysql-test/suite/galera/r/galera_kill_nochanges.result -new file mode 100644 -index 0000000..accace9 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_kill_nochanges.result -@@ -0,0 +1,9 @@ -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+VARIABLE_VALUE = 2 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_kill_smallchanges.result b/mysql-test/suite/galera/r/galera_kill_smallchanges.result -new file mode 100644 -index 0000000..8409740 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_kill_smallchanges.result -@@ -0,0 +1,11 @@ -+SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true'; -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+Killing server ... -+INSERT INTO t1 VALUES (1); -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+VARIABLE_VALUE = 2 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_lock_table.result b/mysql-test/suite/galera/r/galera_lock_table.result -new file mode 100644 -index 0000000..16e9037 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_lock_table.result -@@ -0,0 +1,21 @@ -+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; -+CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=InnoDB; -+LOCK TABLE t1 READ; -+INSERT INTO t1 VALUES (1); -+INSERT INTO t2 VALUES (1); -+SET SESSION wsrep_sync_wait=0; -+SELECT COUNT(*) = 0 FROM t1; -+COUNT(*) = 0 -+1 -+SELECT COUNT(*) = 0 FROM t2; -+COUNT(*) = 0 -+1 -+UNLOCK TABLES; -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 1 FROM t2; -+COUNT(*) = 1 -+1 -+DROP TABLE t1; -+DROP TABLE t2; -diff --git a/mysql-test/suite/galera/r/galera_log_bin.result b/mysql-test/suite/galera/r/galera_log_bin.result -new file mode 100644 -index 0000000..9a8513d ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_log_bin.result -@@ -0,0 +1,53 @@ -+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+CREATE TABLE t2 (id INT) ENGINE=InnoDB; -+INSERT INTO t2 VALUES (1); -+INSERT INTO t2 VALUES (1); -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 2 FROM t2; -+COUNT(*) = 2 -+1 -+ALTER TABLE t1 ADD COLUMN f2 INTEGER; -+FLUSH LOGS; -+SHOW BINLOG EVENTS IN '0.000002' FROM 120; -+Log_name Pos Event_type Server_id End_log_pos Info -+0.000002 120 Query 1 244 use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB -+0.000002 244 Query 1 321 BEGIN -+0.000002 321 Table_map 1 366 table_id: 103 (test.t1) -+0.000002 366 Write_rows 1 406 table_id: 103 flags: STMT_END_F -+0.000002 406 Xid 1 437 COMMIT /* xid=2 */ -+0.000002 437 Query 1 549 use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB -+0.000002 549 Query 1 626 BEGIN -+0.000002 626 Table_map 1 671 table_id: 104 (test.t2) -+0.000002 671 Write_rows 1 711 table_id: 104 flags: STMT_END_F -+0.000002 711 Xid 1 742 COMMIT /* xid=4 */ -+0.000002 742 Query 1 819 BEGIN -+0.000002 819 Table_map 1 864 table_id: 104 (test.t2) -+0.000002 864 Write_rows 1 904 table_id: 104 flags: STMT_END_F -+0.000002 904 Xid 1 935 COMMIT /* xid=5 */ -+0.000002 935 Query 1 1045 use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER -+0.000002 1045 Rotate 1 1084 0.000003;pos=4 -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SHOW BINLOG EVENTS IN '0.000001' FROM 120; -+Log_name Pos Event_type Server_id End_log_pos Info -+0.000001 120 Query 1 244 use `test`; CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB -+0.000001 244 Query 1 312 BEGIN -+0.000001 312 Table_map 1 357 table_id: 81 (test.t1) -+0.000001 357 Write_rows 1 397 table_id: 81 flags: STMT_END_F -+0.000001 397 Xid 1 428 COMMIT /* xid=2 */ -+0.000001 428 Query 1 540 use `test`; CREATE TABLE t2 (id INT) ENGINE=InnoDB -+0.000001 540 Query 1 608 BEGIN -+0.000001 608 Table_map 1 653 table_id: 82 (test.t2) -+0.000001 653 Write_rows 1 693 table_id: 82 flags: STMT_END_F -+0.000001 693 Xid 1 724 COMMIT /* xid=4 */ -+0.000001 724 Query 1 792 BEGIN -+0.000001 792 Table_map 1 837 table_id: 82 (test.t2) -+0.000001 837 Write_rows 1 877 table_id: 82 flags: STMT_END_F -+0.000001 877 Xid 1 908 COMMIT /* xid=5 */ -+0.000001 908 Query 1 1018 use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER -+DROP TABLE t1; -+DROP TABLE t2; -diff --git a/mysql-test/suite/galera/r/galera_log_output_csv.result b/mysql-test/suite/galera/r/galera_log_output_csv.result -new file mode 100644 -index 0000000..07a7846 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_log_output_csv.result -@@ -0,0 +1,21 @@ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+SELECT COUNT(*) > 0 FROM mysql.general_log; -+COUNT(*) > 0 -+1 -+SELECT 1 = 1 FROM t1; -+1 = 1 -+1 -+SELECT COUNT(*) = 1 FROM mysql.slow_log WHERE sql_text = 'SELECT 1 = 1 FROM t1'; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) > 0 FROM mysql.general_log WHERE argument = 'CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB'; -+COUNT(*) > 0 -+1 -+SELECT 2 = 2 FROM t1; -+2 = 2 -+1 -+SELECT COUNT(*) = 1 FROM mysql.slow_log WHERE sql_text = 'SELECT 2 = 2 FROM t1'; -+COUNT(*) = 1 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_many_columns.result b/mysql-test/suite/galera/r/galera_many_columns.result -new file mode 100644 -index 0000000..6fa574e ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_many_columns.result -@@ -0,0 +1,32 @@ -+INSERT INTO t1 (f1) VALUES (DEFAULT); -+SELECT f1 = 'ABC', f1017 = 'ABC' FROM t1; -+f1 = 'ABC' f1017 = 'ABC' -+1 1 -+UPDATE t1 SET f1 = 'XYZ', f1017 = 'XYZ' ; -+SELECT f1 = 'XYZ', f1017 = 'XYZ' FROM t1 WHERE f1 = 'XYZ' AND f1017 = 'XYZ'; -+f1 = 'XYZ' f1017 = 'XYZ' -+1 1 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t1 SET f2 = 'KLM' WHERE f1 = 'XYZ' AND f1017 = 'XYZ'; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t1 SET f2 = 'CDE' WHERE f1 = 'XYZ' AND f1017 = 'XYZ'; -+COMMIT; -+COMMIT; -+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -+ROLLBACK; -+ROLLBACK; -+START TRANSACTION; -+INSERT INTO t1 (f1, f1017) VALUES ('BCE','BCE'); -+INSERT INTO t1 (f1, f1017) VALUES ('CED','CED'); -+INSERT INTO t1 (f1, f1017) VALUES ('EDF','EDF'); -+INSERT INTO t1 (f1, f1017) VALUES ('FED','FED'); -+ROLLBACK; -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_many_indexes.result b/mysql-test/suite/galera/r/galera_many_indexes.result -new file mode 100644 -index 0000000..ab6eec5 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_many_indexes.result -@@ -0,0 +1,123 @@ -+CREATE TABLE t1 (f1 VARCHAR(767) PRIMARY KEY) ENGINE=InnoDB; -+CREATE UNIQUE INDEX i63 ON t1(f1); -+CREATE UNIQUE INDEX i62 ON t1(f1); -+CREATE UNIQUE INDEX i61 ON t1(f1); -+CREATE UNIQUE INDEX i60 ON t1(f1); -+CREATE UNIQUE INDEX i59 ON t1(f1); -+CREATE UNIQUE INDEX i58 ON t1(f1); -+CREATE UNIQUE INDEX i57 ON t1(f1); -+CREATE UNIQUE INDEX i56 ON t1(f1); -+CREATE UNIQUE INDEX i55 ON t1(f1); -+CREATE UNIQUE INDEX i54 ON t1(f1); -+CREATE UNIQUE INDEX i53 ON t1(f1); -+CREATE UNIQUE INDEX i52 ON t1(f1); -+CREATE UNIQUE INDEX i51 ON t1(f1); -+CREATE UNIQUE INDEX i50 ON t1(f1); -+CREATE UNIQUE INDEX i49 ON t1(f1); -+CREATE UNIQUE INDEX i48 ON t1(f1); -+CREATE UNIQUE INDEX i47 ON t1(f1); -+CREATE UNIQUE INDEX i46 ON t1(f1); -+CREATE UNIQUE INDEX i45 ON t1(f1); -+CREATE UNIQUE INDEX i44 ON t1(f1); -+CREATE UNIQUE INDEX i43 ON t1(f1); -+CREATE UNIQUE INDEX i42 ON t1(f1); -+CREATE UNIQUE INDEX i41 ON t1(f1); -+CREATE UNIQUE INDEX i40 ON t1(f1); -+CREATE UNIQUE INDEX i39 ON t1(f1); -+CREATE UNIQUE INDEX i38 ON t1(f1); -+CREATE UNIQUE INDEX i37 ON t1(f1); -+CREATE UNIQUE INDEX i36 ON t1(f1); -+CREATE UNIQUE INDEX i35 ON t1(f1); -+CREATE UNIQUE INDEX i34 ON t1(f1); -+CREATE UNIQUE INDEX i33 ON t1(f1); -+CREATE UNIQUE INDEX i32 ON t1(f1); -+CREATE UNIQUE INDEX i31 ON t1(f1); -+CREATE UNIQUE INDEX i30 ON t1(f1); -+CREATE UNIQUE INDEX i29 ON t1(f1); -+CREATE UNIQUE INDEX i28 ON t1(f1); -+CREATE UNIQUE INDEX i27 ON t1(f1); -+CREATE UNIQUE INDEX i26 ON t1(f1); -+CREATE UNIQUE INDEX i25 ON t1(f1); -+CREATE UNIQUE INDEX i24 ON t1(f1); -+CREATE UNIQUE INDEX i23 ON t1(f1); -+CREATE UNIQUE INDEX i22 ON t1(f1); -+CREATE UNIQUE INDEX i21 ON t1(f1); -+CREATE UNIQUE INDEX i20 ON t1(f1); -+CREATE UNIQUE INDEX i19 ON t1(f1); -+CREATE UNIQUE INDEX i18 ON t1(f1); -+CREATE UNIQUE INDEX i17 ON t1(f1); -+CREATE UNIQUE INDEX i16 ON t1(f1); -+CREATE UNIQUE INDEX i15 ON t1(f1); -+CREATE UNIQUE INDEX i14 ON t1(f1); -+CREATE UNIQUE INDEX i13 ON t1(f1); -+CREATE UNIQUE INDEX i12 ON t1(f1); -+CREATE UNIQUE INDEX i11 ON t1(f1); -+CREATE UNIQUE INDEX i10 ON t1(f1); -+CREATE UNIQUE INDEX i9 ON t1(f1); -+CREATE UNIQUE INDEX i8 ON t1(f1); -+CREATE UNIQUE INDEX i7 ON t1(f1); -+CREATE UNIQUE INDEX i6 ON t1(f1); -+CREATE UNIQUE INDEX i5 ON t1(f1); -+CREATE UNIQUE INDEX i4 ON t1(f1); -+CREATE UNIQUE INDEX i3 ON t1(f1); -+CREATE UNIQUE INDEX i2 ON t1(f1); -+CREATE UNIQUE INDEX i1 ON t1(f1); -+INSERT INTO t1 VALUES (REPEAT('a', 767)); -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+SELECT LENGTH(f1) = 767 FROM t1; -+LENGTH(f1) = 767 -+1 -+EXPLAIN SELECT COUNT(*) = 1 FROM t1 FORCE KEY (PRIMARY) WHERE f1 = REPEAT('a', 767); -+id select_type table type possible_keys key key_len ref rows Extra -+1 SIMPLE t1 const PRIMARY PRIMARY 769 const 1 Using index -+SELECT COUNT(*) = 1 FROM t1 FORCE KEY (PRIMARY) WHERE f1 = REPEAT('a', 767); -+COUNT(*) = 1 -+1 -+EXPLAIN SELECT COUNT(*) = 1 FROM t1 FORCE KEY (i1) WHERE f1 = REPEAT('a', 767); -+id select_type table type possible_keys key key_len ref rows Extra -+1 SIMPLE t1 const i1 i1 769 const 1 Using index -+SELECT COUNT(*) = 1 FROM t1 FORCE KEY (i1) WHERE f1 = REPEAT('a', 767); -+COUNT(*) = 1 -+1 -+EXPLAIN SELECT COUNT(*) = 1 FROM t1 FORCE KEY (i63) WHERE f1 = REPEAT('a', 767); -+id select_type table type possible_keys key key_len ref rows Extra -+1 SIMPLE t1 const i63 i63 769 const 1 Using index -+SELECT COUNT(*) = 1 FROM t1 FORCE KEY (i63) WHERE f1 = REPEAT('a', 767); -+COUNT(*) = 1 -+1 -+INSERT INTO t1 VALUES (REPEAT('b', 767)); -+ANALYZE TABLE t1; -+Table Op Msg_type Msg_text -+test.t1 analyze status OK -+SELECT COUNT(*) = 2 FROM t1; -+COUNT(*) = 2 -+1 -+ANALYZE TABLE t1; -+Table Op Msg_type Msg_text -+test.t1 analyze status OK -+DELETE FROM t1 WHERE f1 = REPEAT('b', 767); -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+INSERT INTO t1 (f1) VALUES (REPEAT('c', 767)); -+ROLLBACK; -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+START TRANSACTION; -+SET AUTOCOMMIT=OFF; -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+START TRANSACTION; -+START TRANSACTION; -+UPDATE t1 SET f1 = REPEAT('e', 767); -+UPDATE t1 SET f1 = REPEAT('f', 767); -+COMMIT; -+COMMIT; -+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_many_rows.result b/mysql-test/suite/galera/r/galera_many_rows.result -new file mode 100644 -index 0000000..6ec0add ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_many_rows.result -@@ -0,0 +1,41 @@ -+CREATE TABLE ten (f1 INTEGER); -+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); -+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) Engine=InnoDB; -+INSERT INTO t1 (f2) SELECT a1.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; -+SELECT COUNT(*) = 100000 FROM t1; -+COUNT(*) = 100000 -+1 -+INSERT INTO t1 (f2) SELECT a1.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; -+SELECT COUNT(*) = 200000 FROM t1; -+COUNT(*) = 200000 -+1 -+UPDATE t1 SET f2 = 1; -+SELECT COUNT(*) = 200000 FROM t1 WHERE f2 = 1; -+COUNT(*) = 200000 -+1 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (f2) SELECT a1.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; -+ROLLBACK; -+SELECT COUNT(*) = 200000 FROM t1; -+COUNT(*) = 200000 -+1 -+SELECT COUNT(*) = 200000 FROM t1; -+COUNT(*) = 200000 -+1 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t1 SET f2 = 2; -+ROLLBACK; -+START TRANSACTION; -+SELECT COUNT(*) = 200000 FROM t1; -+COUNT(*) = 200000 -+1 -+UPDATE t1 SET f2 = 3; -+START TRANSACTION; -+UPDATE t1 SET f2 = 4; -+COMMIT; -+COMMIT; -+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -+DROP TABLE t1; -+DROP TABLE ten; -diff --git a/mysql-test/suite/galera/r/galera_many_tables_nopk.result b/mysql-test/suite/galera/r/galera_many_tables_nopk.result -new file mode 100644 -index 0000000..7a4f364 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_many_tables_nopk.result -@@ -0,0 +1,17 @@ -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+COMMIT; -+CREATE TABLE sum_table (f1 INTEGER); -+SELECT SUM(f1) = 1000 FROM sum_table; -+SUM(f1) = 1000 -+1 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t1000 SET f1 = 3; -+COMMIT; -+COMMIT; -+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -+DROP SCHEMA test; -+CREATE SCHEMA test; -diff --git a/mysql-test/suite/galera/r/galera_many_tables_pk.result b/mysql-test/suite/galera/r/galera_many_tables_pk.result -new file mode 100644 -index 0000000..6b6899d ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_many_tables_pk.result -@@ -0,0 +1,20 @@ -+SELECT COUNT(*) = 1000 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME LIKE 't%'; -+COUNT(*) = 1000 -+1 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+COMMIT; -+CREATE TABLE sum_table (f1 INTEGER); -+SELECT SUM(f1) = 1000 FROM sum_table; -+SUM(f1) = 1000 -+1 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t1000 SET f1 = 3; -+COMMIT; -+COMMIT; -+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -+DROP SCHEMA test; -+CREATE SCHEMA test; -diff --git a/mysql-test/suite/galera/r/galera_migrate.result b/mysql-test/suite/galera/r/galera_migrate.result -new file mode 100644 -index 0000000..7c92d66 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_migrate.result -@@ -0,0 +1,79 @@ -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+START SLAVE USER='root'; -+Warnings: -+Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure. -+INSERT INTO t1 VALUES (2); -+START SLAVE USER='root'; -+Warnings: -+Note 1759 Sending passwords in plain text without SSL/TLS is extremely insecure. -+INSERT INTO t1 VALUES (3); -+INSERT INTO t1 VALUES (4); -+SET GLOBAL wsrep_cluster_address='gcomm://'; -+INSERT INTO t1 VALUES (5); -+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; -+VARIABLE_VALUE = 'Synced' -+1 -+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -+VARIABLE_VALUE = 'Primary' -+1 -+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+VARIABLE_VALUE = 1 -+1 -+INSERT INTO t1 VALUES (6); -+GRANT ALL PRIVILEGES ON *.* TO 'sst' IDENTIFIED BY 'sst'; -+SET GLOBAL wsrep_sst_auth = 'sst:sst'; -+GRANT ALL PRIVILEGES ON *.* TO 'sst' IDENTIFIED BY 'sst'; -+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; -+VARIABLE_VALUE = 'Synced' -+1 -+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -+VARIABLE_VALUE = 'Primary' -+1 -+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+VARIABLE_VALUE = 2 -+1 -+STOP SLAVE; -+RESET SLAVE ALL; -+STOP SLAVE; -+RESET SLAVE ALL; -+INSERT INTO t1 VALUES (7); -+INSERT INTO t1 VALUES (8); -+SELECT COUNT(*) = 8 FROM t1; -+COUNT(*) = 8 -+1 -+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; -+VARIABLE_VALUE = 'Synced' -+1 -+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -+VARIABLE_VALUE = 'Primary' -+1 -+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+VARIABLE_VALUE = 2 -+1 -+SELECT COUNT(*) = 8 FROM t1; -+COUNT(*) = 8 -+1 -+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; -+VARIABLE_VALUE = 'Synced' -+1 -+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -+VARIABLE_VALUE = 'Primary' -+1 -+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+VARIABLE_VALUE = 2 -+1 -+DROP TABLE t1; -+DROP TABLE t1; -+SET GLOBAL wsrep_provider = 'none'; -+SET GLOBAL wsrep_sst_auth = ''; -+SET GLOBAL wsrep_provider_options = ''; -+DROP TABLE t1; -+DROP USER sst; -+SET GLOBAL wsrep_provider = 'none'; -+SET GLOBAL wsrep_sst_method = 'rsync'; -+SET GLOBAL wsrep_provider_options = ''; -+SET GLOBAL wsrep_sst_receive_address = 'AUTO'; -+DROP TABLE t1; -+DROP USER sst; -+CALL mtr.add_suppression("InnoDB: Error: Table \"mysql\"\\.\"innodb_index_stats\" not found"); -diff --git a/mysql-test/suite/galera/r/galera_multi_database.result b/mysql-test/suite/galera/r/galera_multi_database.result -new file mode 100644 -index 0000000..a04eb48 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_multi_database.result -@@ -0,0 +1,28 @@ -+CREATE DATABASE d1; -+CREATE TABLE d1.t1(f1 INTEGER) ENGINE=InnoDB; -+CREATE DATABASE d2; -+CREATE TABLE d2.t1(f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO d1.t1 VALUES (1); -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO d2.t1 VALUES (1); -+COMMIT; -+COMMIT; -+SELECT COUNT(*) = 1 FROM d1.t1; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 1 FROM d2.t1; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 1 FROM d1.t1; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 1 FROM d2.t1; -+COUNT(*) = 1 -+1 -+DROP TABLE d1.t1; -+DROP TABLE d2.t1; -+DROP DATABASE d1; -+DROP DATABASE d2; -diff --git a/mysql-test/suite/galera/r/galera_myisam_autocommit.result b/mysql-test/suite/galera/r/galera_myisam_autocommit.result -new file mode 100644 -index 0000000..3f8d93b ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_myisam_autocommit.result -@@ -0,0 +1,24 @@ -+CREATE TABLE t1 (f1 INTEGER) ENGINE=MyISAM; -+INSERT INTO t1 VALUES (1); -+INSERT INTO t1 VALUES (2), (3); -+INSERT INTO t1 SELECT 4 FROM DUAL UNION ALL SELECT 5 FROM DUAL; -+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) ENGINE=MyISAM; -+INSERT INTO t2 VALUES (1); -+INSERT INTO t2 VALUES (2), (3); -+INSERT INTO t2 SELECT 4 FROM DUAL UNION ALL SELECT 5 FROM DUAL; -+INSERT INTO t2 VALUES (6), (1); -+ERROR 23000: Duplicate entry '1' for key 'PRIMARY' -+UPDATE t1 SET f1 = 9; -+UPDATE t2 SET f1 = 9 WHERE f1 = 1; -+DELETE FROM t1 WHERE f1 = 9; -+DELETE FROM t2 WHERE f1 = 9; -+TRUNCATE TABLE t1; -+TRUNCATE TABLE t1; -+SELECT COUNT(*) = 0 FROM t1; -+COUNT(*) = 0 -+1 -+SELECT COUNT(*) = 0 FROM t2; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -+DROP TABLE t2; -diff --git a/mysql-test/suite/galera/r/galera_myisam_transactions.result b/mysql-test/suite/galera/r/galera_myisam_transactions.result -new file mode 100644 -index 0000000..284f92b ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_myisam_transactions.result -@@ -0,0 +1,34 @@ -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+CREATE TABLE t2 (f1 INTEGER) ENGINE=MyISAM; -+CREATE TABLE t3 (f1 INTEGER) ENGINE=MyISAM; -+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t3 VALUES (NEW.f1); -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES (1); -+INSERT INTO t2 VALUES (1); -+COMMIT; -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 0 FROM t2; -+COUNT(*) = 0 -+1 -+SELECT COUNT(*) = 0 FROM t2; -+COUNT(*) = 0 -+1 -+START TRANSACTION; -+INSERT INTO t1 VALUES (1); -+INSERT INTO t2 VALUES (1); -+ROLLBACK; -+Warnings: -+Warning 1196 Some non-transactional changed tables couldn't be rolled back -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 0 FROM t2; -+COUNT(*) = 0 -+1 -+SELECT COUNT(*) = 0 FROM t2; -+COUNT(*) = 0 -+1 -+DROP TABLE t1, t2, t3; -diff --git a/mysql-test/suite/galera/r/galera_nopk_bit.result b/mysql-test/suite/galera/r/galera_nopk_bit.result -new file mode 100644 -index 0000000..5723dac ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_nopk_bit.result -@@ -0,0 +1,27 @@ -+CREATE TABLE t1 (f1 BIT) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (NULL),(0),(b'1'); -+SELECT f1 IS NULL, f1 = b'1' FROM t1; -+f1 IS NULL f1 = b'1' -+1 NULL -+0 0 -+0 1 -+DELETE FROM t1 WHERE f1 = b'1'; -+UPDATE t1 SET f1 = b'1' WHERE f1 IS NULL; -+UPDATE t1 SET f1 = 1 WHERE f1 = b'0'; -+SELECT f1 IS NULL, f1 = b'1' FROM t1; -+f1 IS NULL f1 = b'1' -+0 1 -+0 1 -+CREATE TABLE t2 (f1 BIT) ENGINE=InnoDB; -+INSERT INTO t2 VALUES (NULL); -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t2 SET f1 = 0 WHERE f1 IS NULL; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t2 SET f1 = 1 WHERE f1 IS NULL; -+COMMIT; -+COMMIT; -+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -+DROP TABLE t1; -+DROP TABLE t2; -diff --git a/mysql-test/suite/galera/r/galera_nopk_blob.result b/mysql-test/suite/galera/r/galera_nopk_blob.result -new file mode 100644 -index 0000000..7491b71 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_nopk_blob.result -@@ -0,0 +1,27 @@ -+CREATE TABLE t1 (f1 BLOB) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (NULL),('abc'); -+SELECT f1 FROM t1; -+f1 -+NULL -+abc -+DELETE FROM t1 WHERE f1 IS NULL; -+UPDATE t1 SET f1 = 'xyz' WHERE f1 = 'abc'; -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+SELECT f1 = 'abc' FROM t1; -+f1 = 'abc' -+0 -+CREATE TABLE t2 (f1 BLOB) ENGINE=InnoDB; -+INSERT INTO t2 VALUES (NULL); -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t2 SET f1 = 'abc' WHERE f1 IS NULL; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t2 SET f1 = 'xyz' WHERE f1 IS NULL; -+COMMIT; -+COMMIT; -+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -+DROP TABLE t1; -+DROP TABLE t2; -diff --git a/mysql-test/suite/galera/r/galera_nopk_large_varchar.result b/mysql-test/suite/galera/r/galera_nopk_large_varchar.result -new file mode 100644 -index 0000000..abca81e ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_nopk_large_varchar.result -@@ -0,0 +1,30 @@ -+CREATE TABLE t1 (f1 VARCHAR(8000)) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (NULL),(CONCAT(REPEAT('x', 7999), 'a')); -+SELECT LENGTH(f1) FROM t1; -+LENGTH(f1) -+NULL -+8000 -+DELETE FROM t1 WHERE f1 IS NULL; -+UPDATE t1 SET f1 = CONCAT(REPEAT('x', 7999), 'b') WHERE f1 = CONCAT(REPEAT('x', 7999), 'a'); -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+SELECT LENGTH(f1) = 8000 FROM t1; -+LENGTH(f1) = 8000 -+1 -+SELECT f1 = CONCAT(REPEAT('x', 7999), 'b') FROM t1; -+f1 = CONCAT(REPEAT('x', 7999), 'b') -+1 -+CREATE TABLE t2 (f1 BLOB) ENGINE=InnoDB; -+INSERT INTO t2 VALUES (CONCAT(REPEAT('x', 7999), 'a')); -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t2 SET f1 = 'abc' WHERE f1 = CONCAT(REPEAT('x', 7999), 'a'); -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t2 SET f1 = 'xyz' WHERE f1 = CONCAT(REPEAT('x', 7999), 'a'); -+COMMIT; -+COMMIT; -+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -+DROP TABLE t1; -+DROP TABLE t2; -diff --git a/mysql-test/suite/galera/r/galera_nopk_unicode.result b/mysql-test/suite/galera/r/galera_nopk_unicode.result -new file mode 100644 -index 0000000..68d049a ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_nopk_unicode.result -@@ -0,0 +1,24 @@ -+CREATE TABLE t1 ( -+f1 VARCHAR(255), -+KEY (f1) -+) ENGINE=InnoDB DEFAULT CHARSET=utf8; -+INSERT INTO t1 VALUES ('текст'); -+SELECT f1 = 'текст' FROM t1; -+f1 = 'текст' -+1 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t1 SET f1 = 'текст2'; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t1 SET f1 = 'текст3'; -+COMMIT; -+COMMIT; -+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -+SELECT f1 = 'текст2' FROM t1; -+f1 = 'текст2' -+1 -+SELECT f1 = 'текст2' FROM t1 WHERE f1 = 'текст2'; -+f1 = 'текст2' -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_parallel_apply_lock_table.result b/mysql-test/suite/galera/r/galera_parallel_apply_lock_table.result -new file mode 100644 -index 0000000..85ba022 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_parallel_apply_lock_table.result -@@ -0,0 +1,33 @@ -+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; -+CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=InnoDB; -+SET GLOBAL wsrep_slave_threads = 2; -+LOCK TABLE t1 READ; -+INSERT INTO t1 VALUES (1); -+INSERT INTO t2 VALUES (1); -+SET SESSION wsrep_sync_wait=0; -+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%applied write set%'; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Waiting for table level lock%'; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 0 FROM t1; -+COUNT(*) = 0 -+1 -+SELECT COUNT(*) = 0 FROM t2; -+COUNT(*) = 0 -+1 -+UNLOCK TABLES; -+SET SESSION wsrep_sync_wait = 7;; -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 1 FROM t2; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%committed%'; -+COUNT(*) = 2 -+1 -+SET GLOBAL wsrep_slave_threads = 1;; -+DROP TABLE t1; -+DROP TABLE t2; -diff --git a/mysql-test/suite/galera/r/galera_parallel_autoinc_largetrx.result b/mysql-test/suite/galera/r/galera_parallel_autoinc_largetrx.result -new file mode 100644 -index 0000000..1f163f4 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_parallel_autoinc_largetrx.result -@@ -0,0 +1,18 @@ -+CREATE TABLE ten (f1 INTEGER); -+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); -+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) Engine=InnoDB; -+SET GLOBAL wsrep_slave_threads = 4; -+INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;; -+INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;; -+INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;; -+SELECT COUNT(*) = 30000 FROM t1; -+COUNT(*) = 30000 -+1 -+SELECT COUNT(DISTINCT f1) = 30000 FROM t1; -+COUNT(DISTINCT f1) = 30000 -+1 -+SELECT COUNT(*) = 5 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user'; -+COUNT(*) = 5 -+1 -+DROP TABLE t1; -+DROP TABLE ten; -diff --git a/mysql-test/suite/galera/r/galera_parallel_autoinc_manytrx.result b/mysql-test/suite/galera/r/galera_parallel_autoinc_manytrx.result -new file mode 100644 -index 0000000..05ce328 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_parallel_autoinc_manytrx.result -@@ -0,0 +1,15 @@ -+CREATE TABLE ten (f1 INTEGER); -+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); -+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) Engine=InnoDB; -+SET GLOBAL wsrep_slave_threads = 4; -+SELECT COUNT(*) = 20000 FROM t1; -+COUNT(*) = 20000 -+1 -+SELECT COUNT(DISTINCT f1) = 20000 FROM t1; -+COUNT(DISTINCT f1) = 20000 -+1 -+SELECT COUNT(*) = 4 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE 'committed%'; -+COUNT(*) = 4 -+1 -+DROP TABLE t1; -+DROP TABLE ten; -diff --git a/mysql-test/suite/galera/r/galera_parallel_simple.result b/mysql-test/suite/galera/r/galera_parallel_simple.result -new file mode 100644 -index 0000000..294a94b ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_parallel_simple.result -@@ -0,0 +1,27 @@ -+CREATE TABLE t1 (id INT) ENGINE=InnoDB; -+CREATE TABLE t2 (id INT) ENGINE=InnoDB; -+SET GLOBAL wsrep_slave_threads = 2; -+INSERT INTO t1 VALUES (1); -+INSERT INTO t2 VALUES (1); -+INSERT INTO t1 VALUES (1); -+INSERT INTO t2 VALUES (1); -+INSERT INTO t1 VALUES (1); -+INSERT INTO t2 VALUES (1); -+INSERT INTO t1 VALUES (1); -+INSERT INTO t2 VALUES (1); -+INSERT INTO t1 VALUES (1); -+INSERT INTO t2 VALUES (1); -+INSERT INTO t1 VALUES (1); -+INSERT INTO t2 VALUES (1); -+SELECT COUNT(*) = 10 FROM t1; -+COUNT(*) = 10 -+0 -+SELECT COUNT(*) = 10 FROM t2; -+COUNT(*) = 10 -+0 -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'committed%'; -+COUNT(*) = 2 -+1 -+SET GLOBAL wsrep_slave_threads = 1;; -+DROP TABLE t1; -+DROP TABLE t2; -diff --git a/mysql-test/suite/galera/r/galera_pc_ignore_sb.result b/mysql-test/suite/galera/r/galera_pc_ignore_sb.result -new file mode 100644 -index 0000000..5fcccfe ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_pc_ignore_sb.result -@@ -0,0 +1,12 @@ -+SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true'; -+Killing server ... -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+DROP TABLE t1; -+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+VARIABLE_VALUE = 1 -+1 -+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; -+VARIABLE_VALUE = 'ON' -+1 -+SET GLOBAL wsrep_cluster_address = ''; -diff --git a/mysql-test/suite/galera/r/galera_pk_bigint_signed.result b/mysql-test/suite/galera/r/galera_pk_bigint_signed.result -new file mode 100644 -index 0000000..a307599 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_pk_bigint_signed.result -@@ -0,0 +1,26 @@ -+CREATE TABLE t1 (f1 BIGINT SIGNED PRIMARY KEY, f2 VARCHAR(5)) ENGINE=InnoDB; -+INSERT INTO t1 VALUES -+(-9223372036854775808, 'min'), -+(9223372036854775807, 'max') -+; -+SELECT * FROM t1; -+f1 f2 -+-9223372036854775808 min -+9223372036854775807 max -+UPDATE t1 SET f2 = CONCAT(f2, '_'); -+SELECT * FROM t1; -+f1 f2 -+-9223372036854775808 min_ -+9223372036854775807 max_ -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t1 SET f2 = 'foo' WHERE f1 = -9223372036854775808; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t1 SET f2 = 'bar' WHERE f1 = -9223372036854775808; -+COMMIT; -+SET AUTOCOMMIT=ON; -+COMMIT; -+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -+SET AUTOCOMMIT=ON; -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_pk_bigint_unsigned.result b/mysql-test/suite/galera/r/galera_pk_bigint_unsigned.result -new file mode 100644 -index 0000000..441926e ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_pk_bigint_unsigned.result -@@ -0,0 +1,23 @@ -+CREATE TABLE t1 (f1 BIGINT UNSIGNED PRIMARY KEY, f2 VARCHAR(5)) ENGINE=InnoDB; -+INSERT INTO t1 VALUES -+(18446744073709551615, 'max') -+; -+SELECT f1 = 18446744073709551615 FROM t1; -+f1 = 18446744073709551615 -+1 -+UPDATE t1 SET f2 = CONCAT(f2, '_'); -+SELECT f1 = 18446744073709551615 FROM t1; -+f1 = 18446744073709551615 -+1 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t1 SET f2 = 'foo' WHERE f1 = 18446744073709551615; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t1 SET f2 = 'bar' WHERE f1 = 18446744073709551615; -+COMMIT; -+SET AUTOCOMMIT=ON; -+COMMIT; -+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -+SET AUTOCOMMIT=ON; -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_query_cache.result b/mysql-test/suite/galera/r/galera_query_cache.result -new file mode 100644 -index 0000000..502d8a5 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_query_cache.result -@@ -0,0 +1,57 @@ -+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+RESET QUERY CACHE; -+FLUSH STATUS; -+SELECT COUNT(*) FROM t1; -+COUNT(*) -+1 -+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Qcache_queries_in_cache'; -+VARIABLE_VALUE = 1 -+1 -+SELECT COUNT(*) FROM t1; -+COUNT(*) -+1 -+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits'; -+VARIABLE_VALUE = 1 -+1 -+INSERT INTO t1 VALUES (2); -+FLUSH STATUS; -+SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Qcache_queries_in_cache'; -+VARIABLE_VALUE = 0 -+1 -+SELECT COUNT(*) FROM t1; -+COUNT(*) -+2 -+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Qcache_queries_in_cache'; -+VARIABLE_VALUE = 1 -+1 -+SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits'; -+VARIABLE_VALUE = 0 -+1 -+SELECT COUNT(*) FROM t1; -+COUNT(*) -+2 -+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits'; -+VARIABLE_VALUE = 1 -+1 -+ALTER TABLE t1 ADD COLUMN f2 INTEGER; -+FLUSH STATUS; -+SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Qcache_queries_in_cache'; -+VARIABLE_VALUE = 0 -+1 -+SELECT COUNT(*) FROM t1; -+COUNT(*) -+2 -+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Qcache_queries_in_cache'; -+VARIABLE_VALUE = 1 -+1 -+SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits'; -+VARIABLE_VALUE = 0 -+1 -+SELECT COUNT(*) FROM t1; -+COUNT(*) -+2 -+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits'; -+VARIABLE_VALUE = 1 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_read_only.result b/mysql-test/suite/galera/r/galera_read_only.result -new file mode 100644 -index 0000000..d2af386 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_read_only.result -@@ -0,0 +1,8 @@ -+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; -+SET GLOBAL read_only=TRUE; -+INSERT INTO t1 VALUES (1); -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+SET GLOBAL read_only=FALSE; -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_repl_key_format_flat16.result b/mysql-test/suite/galera/r/galera_repl_key_format_flat16.result -new file mode 100644 -index 0000000..4acf014 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_repl_key_format_flat16.result -@@ -0,0 +1,18 @@ -+SET GLOBAL wsrep_provider_options = 'repl.key_format=FLAT16'; -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (123); -+CREATE TABLE t2 (f1 VARCHAR(256)) ENGINE=InnoDB; -+INSERT INTO t2 VALUES (REPEAT('a', 256)); -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+UPDATE t1 SET f1 = 234; -+UPDATE t2 SET f1 = REPEAT('b', 256); -+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 234; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 1 FROM t2 WHERE f1 = REPEAT('b', 256); -+COUNT(*) = 1 -+1 -+DROP TABLE t1; -+DROP TABLE t2; -diff --git a/mysql-test/suite/galera/r/galera_repl_max_ws_size.result b/mysql-test/suite/galera/r/galera_repl_max_ws_size.result -new file mode 100644 -index 0000000..6e1054c ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_repl_max_ws_size.result -@@ -0,0 +1,10 @@ -+CREATE TABLE t1 (f1 VARCHAR(512)) ENGINE=InnoDB; -+SET GLOBAL wsrep_provider_options = 'repl.max_ws_size=512'; -+INSERT INTO t1 VALUES (REPEAT('a', 512)); -+ERROR HY000: Got error 5 during COMMIT -+SELECT COUNT(*) = 0 FROM t1; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -+CALL mtr.add_suppression("WSREP: Maximum writeset size exceeded by"); -+CALL mtr.add_suppression("WSREP: transaction size exceeded"); -diff --git a/mysql-test/suite/galera/r/galera_restart_nochanges.result b/mysql-test/suite/galera/r/galera_restart_nochanges.result -new file mode 100644 -index 0000000..accace9 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_restart_nochanges.result -@@ -0,0 +1,9 @@ -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+VARIABLE_VALUE = 2 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_rsu_add_pk.result b/mysql-test/suite/galera/r/galera_rsu_add_pk.result -new file mode 100644 -index 0000000..3d8677d ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_rsu_add_pk.result -@@ -0,0 +1,26 @@ -+CREATE TABLE ten (f1 INTEGER); -+INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); -+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB; -+INSERT INTO t1 (f1) SELECT 000000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; -+INSERT INTO t1 (f1) SELECT 100000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;; -+SET GLOBAL wsrep_OSU_method = "RSU"; -+ALTER TABLE t1 ADD PRIMARY KEY (f1); -+SET GLOBAL wsrep_OSU_method = "TOI"; -+INSERT INTO t1 (f1) SELECT 200000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; -+SELECT COUNT(*) = 300000 FROM t1; -+COUNT(*) = 300000 -+1 -+SELECT MAX(f1) = 299999 FROM t1; -+MAX(f1) = 299999 -+1 -+SELECT COUNT(*) = 300000 FROM t1; -+COUNT(*) = 300000 -+1 -+SELECT MAX(f1) = 299999 FROM t1; -+MAX(f1) = 299999 -+1 -+SET GLOBAL wsrep_OSU_method = "RSU"; -+ALTER TABLE t1 ADD PRIMARY KEY (f1); -+SET GLOBAL wsrep_OSU_method = "TOI"; -+DROP TABLE t1; -+DROP TABLE ten; -diff --git a/mysql-test/suite/galera/r/galera_rsu_drop_pk.result b/mysql-test/suite/galera/r/galera_rsu_drop_pk.result -new file mode 100644 -index 0000000..43b4b57 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_rsu_drop_pk.result -@@ -0,0 +1,42 @@ -+CREATE TABLE ten (f1 INTEGER); -+INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB; -+INSERT INTO t1 (f1) SELECT 000000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; -+INSERT INTO t1 (f1) SELECT 100000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5;; -+SET GLOBAL wsrep_OSU_method = "RSU"; -+ALTER TABLE t1 DROP PRIMARY KEY; -+SET GLOBAL wsrep_OSU_method = "TOI"; -+INSERT INTO t1 (f1) SELECT 200000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; -+SELECT COUNT(*) = 300000 FROM t1; -+COUNT(*) = 300000 -+1 -+SELECT MAX(f1) = 299999 FROM t1; -+MAX(f1) = 299999 -+1 -+SELECT COUNT(*) = 300000 FROM t1; -+COUNT(*) = 300000 -+1 -+SELECT MAX(f1) = 299999 FROM t1; -+MAX(f1) = 299999 -+1 -+SET GLOBAL wsrep_OSU_method = "RSU"; -+ALTER TABLE t1 DROP PRIMARY KEY; -+SET GLOBAL wsrep_OSU_method = "TOI"; -+INSERT INTO t1 (f1) VALUES (1); -+INSERT INTO t1 (f1) VALUES (10); -+SELECT COUNT(*) = 2 FROM t1 WHERE f1 = 1; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 2 FROM t1 WHERE f1 = 10; -+COUNT(*) = 2 -+1 -+INSERT INTO t1 (f1) VALUES (100); -+INSERT INTO t1 (f1) VALUES (1000); -+SELECT COUNT(*) = 2 FROM t1 WHERE f1 = 100; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 2 FROM t1 WHERE f1 = 1000; -+COUNT(*) = 2 -+1 -+DROP TABLE t1; -+DROP TABLE ten; -diff --git a/mysql-test/suite/galera/r/galera_rsu_error.result b/mysql-test/suite/galera/r/galera_rsu_error.result -new file mode 100644 -index 0000000..1f9ea36 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_rsu_error.result -@@ -0,0 +1,21 @@ -+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB; -+INSERT INTO t1 VALUES (1), (1); -+SET GLOBAL wsrep_OSU_method = "RSU"; -+ALTER TABLE t1 ADD PRIMARY KEY (f1); -+ERROR 23000: Duplicate entry '1' for key 'PRIMARY' -+SET GLOBAL wsrep_OSU_method = "TOI"; -+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE TABLE_NAME = 't1'; -+COUNT(*) = 0 -+1 -+INSERT INTO t1 VALUES (1); -+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE TABLE_NAME = 't1'; -+COUNT(*) = 0 -+1 -+SELECT COUNT(*) = 3 FROM t1; -+COUNT(*) = 3 -+1 -+INSERT INTO t1 VALUES (1); -+SELECT COUNT(3) = 4 FROM t1; -+COUNT(3) = 4 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_rsu_simple.result b/mysql-test/suite/galera/r/galera_rsu_simple.result -new file mode 100644 -index 0000000..169c4a5 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_rsu_simple.result -@@ -0,0 +1,22 @@ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB; -+SET GLOBAL wsrep_OSU_method = "RSU"; -+ALTER TABLE t1 ADD COLUMN f2 INTEGER; -+SET GLOBAL wsrep_OSU_method = "TOI"; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 1 -+1 -+INSERT INTO t1 VALUES (1); -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+INSERT INTO t1 (f1) VALUES (2); -+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 2 FROM t1; -+COUNT(*) = 2 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_sbr.result b/mysql-test/suite/galera/r/galera_sbr.result -new file mode 100644 -index 0000000..66ca8cf ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_sbr.result -@@ -0,0 +1,11 @@ -+SET GLOBAL binlog_format = 'STATEMENT'; -+SET SESSION binlog_format = 'STATEMENT'; -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+SET SESSION binlog_format = 'MIXED'; -+INSERT INTO t1 VALUES (2); -+SELECT COUNT(*) = 2 FROM t1; -+COUNT(*) = 2 -+1 -+DROP TABLE t1; -+SET GLOBAL binlog_format = 'ROW'; -diff --git a/mysql-test/suite/galera/r/galera_sbr_binlog.result b/mysql-test/suite/galera/r/galera_sbr_binlog.result -new file mode 100644 -index 0000000..66ca8cf ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_sbr_binlog.result -@@ -0,0 +1,11 @@ -+SET GLOBAL binlog_format = 'STATEMENT'; -+SET SESSION binlog_format = 'STATEMENT'; -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+SET SESSION binlog_format = 'MIXED'; -+INSERT INTO t1 VALUES (2); -+SELECT COUNT(*) = 2 FROM t1; -+COUNT(*) = 2 -+1 -+DROP TABLE t1; -+SET GLOBAL binlog_format = 'ROW'; -diff --git a/mysql-test/suite/galera/r/galera_split_brain.result b/mysql-test/suite/galera/r/galera_split_brain.result -new file mode 100644 -index 0000000..6156150 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_split_brain.result -@@ -0,0 +1,5 @@ -+call mtr.add_suppression("WSREP: TO isolation failed for: "); -+Killing server ... -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -+SET GLOBAL wsrep_cluster_address = ''; -diff --git a/mysql-test/suite/galera/r/galera_sql_log_bin_zero.result b/mysql-test/suite/galera/r/galera_sql_log_bin_zero.result -new file mode 100644 -index 0000000..89ab8d5 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_sql_log_bin_zero.result -@@ -0,0 +1,12 @@ -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+SET SESSION sql_log_bin = 0; -+INSERT INTO t1 VALUES (1); -+SET SESSION sql_log_bin = 1; -+INSERT INTO t1 VALUES (2); -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 0 FROM t1 WHERE f1 = 1; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_ssl.result b/mysql-test/suite/galera/r/galera_ssl.result -new file mode 100644 -index 0000000..569c3c6 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_ssl.result -@@ -0,0 +1,18 @@ -+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; -+VARIABLE_VALUE = 'Synced' -+1 -+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+VARIABLE_VALUE = 2 -+1 -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB; -+INSERT INTO t1 VALUES (1); -+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; -+VARIABLE_VALUE = 'Synced' -+1 -+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+VARIABLE_VALUE = 2 -+1 -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_sst_mysqldump.result b/mysql-test/suite/galera/r/galera_sst_mysqldump.result -new file mode 100644 -index 0000000..1be2002 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_sst_mysqldump.result -@@ -0,0 +1,459 @@ -+Setting SST method to mysqldump ... -+GRANT ALL PRIVILEGES ON *.* TO 'sst' IDENTIFIED BY 'sst'; -+SET GLOBAL wsrep_sst_auth = 'sst:sst'; -+SET GLOBAL wsrep_sst_method = 'mysqldump'; -+Performing State Transfer on a server that has been temporarily disconnected -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+COMMIT; -+Unloading wsrep provider ... -+SET GLOBAL wsrep_provider = 'none'; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+COMMIT; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+Loading wsrep provider ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+ROLLBACK; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+COMMIT; -+SET AUTOCOMMIT=ON; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -+COMMIT; -+SET AUTOCOMMIT=ON; -+Performing State Transfer on a server that has been shut down cleanly and restarted -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+COMMIT; -+Shutting down server ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+COMMIT; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+Starting server ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+ROLLBACK; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+COMMIT; -+SET AUTOCOMMIT=ON; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -+COMMIT; -+SET AUTOCOMMIT=ON; -+Performing State Transfer on a server that starts from a clean var directory -+This is accomplished by shutting down node #2 and removing its var directory before restarting it -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+COMMIT; -+Shutting down server ... -+Cleaning var directory ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+COMMIT; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+Starting server ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+ROLLBACK; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+COMMIT; -+SET AUTOCOMMIT=ON; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -+COMMIT; -+SET AUTOCOMMIT=ON; -+Performing State Transfer on a server that has been killed and restarted -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+COMMIT; -+Killing server ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+COMMIT; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+Performing --wsrep-recover ... -+Starting server ... -+Using --wsrep-start-position when starting mysqld ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+ROLLBACK; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+COMMIT; -+SET AUTOCOMMIT=ON; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -+COMMIT; -+SET AUTOCOMMIT=ON; -+Performing State Transfer on a server that has been killed and restarted -+while a DDL was in progress on it -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+COMMIT; -+SET GLOBAL debug = 'd,sync.alter_opened_table'; -+ALTER TABLE t1 ADD COLUMN f2 INTEGER; -+SET wsrep_sync_wait = 0; -+Killing server ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+COMMIT; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+Performing --wsrep-recover ... -+Starting server ... -+Using --wsrep-start-position when starting mysqld ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+COMMIT; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+COMMIT; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+ROLLBACK; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+COMMIT; -+SET AUTOCOMMIT=ON; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -+COMMIT; -+SET AUTOCOMMIT=ON; -+CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query"); -+DROP USER sst; -+CALL mtr.add_suppression("Slave SQL: Error 'The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement' on query"); -+CALL mtr.add_suppression("InnoDB: Error: Table \"mysql\"\\.\"innodb_index_stats\" not found"); -+CALL mtr.add_suppression("InnoDB: New log files created"); -+CALL mtr.add_suppression("InnoDB: Creating foreign key constraint system tables"); -+CALL mtr.add_suppression("Can't open and lock time zone table"); -+CALL mtr.add_suppression("Can't open and lock privilege tables"); -+CALL mtr.add_suppression("Info table is not ready to be used"); -+CALL mtr.add_suppression("Native table .* has the wrong structure"); -diff --git a/mysql-test/suite/galera/r/galera_sst_rsync.result b/mysql-test/suite/galera/r/galera_sst_rsync.result -new file mode 100644 -index 0000000..750d73b ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_sst_rsync.result -@@ -0,0 +1,358 @@ -+Performing State Transfer on a server that has been shut down cleanly and restarted -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+COMMIT; -+Shutting down server ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+COMMIT; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+Starting server ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+ROLLBACK; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+COMMIT; -+SET AUTOCOMMIT=ON; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -+COMMIT; -+SET AUTOCOMMIT=ON; -+Performing State Transfer on a server that starts from a clean var directory -+This is accomplished by shutting down node #2 and removing its var directory before restarting it -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+COMMIT; -+Shutting down server ... -+Cleaning var directory ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+COMMIT; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+Starting server ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+ROLLBACK; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+COMMIT; -+SET AUTOCOMMIT=ON; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -+COMMIT; -+SET AUTOCOMMIT=ON; -+Performing State Transfer on a server that has been killed and restarted -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+COMMIT; -+Killing server ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+COMMIT; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+Performing --wsrep-recover ... -+Starting server ... -+Using --wsrep-start-position when starting mysqld ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+ROLLBACK; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+COMMIT; -+SET AUTOCOMMIT=ON; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -+COMMIT; -+SET AUTOCOMMIT=ON; -+Performing State Transfer on a server that has been killed and restarted -+while a DDL was in progress on it -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+COMMIT; -+SET GLOBAL debug = 'd,sync.alter_opened_table'; -+ALTER TABLE t1 ADD COLUMN f2 INTEGER; -+SET wsrep_sync_wait = 0; -+Killing server ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+COMMIT; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+Performing --wsrep-recover ... -+Starting server ... -+Using --wsrep-start-position when starting mysqld ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+COMMIT; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+COMMIT; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+ROLLBACK; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+COMMIT; -+SET AUTOCOMMIT=ON; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -+COMMIT; -+SET AUTOCOMMIT=ON; -diff --git a/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2.result b/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2.result -new file mode 100644 -index 0000000..750d73b ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2.result -@@ -0,0 +1,358 @@ -+Performing State Transfer on a server that has been shut down cleanly and restarted -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+COMMIT; -+Shutting down server ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+COMMIT; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+Starting server ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+ROLLBACK; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+COMMIT; -+SET AUTOCOMMIT=ON; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -+COMMIT; -+SET AUTOCOMMIT=ON; -+Performing State Transfer on a server that starts from a clean var directory -+This is accomplished by shutting down node #2 and removing its var directory before restarting it -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+COMMIT; -+Shutting down server ... -+Cleaning var directory ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+COMMIT; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+Starting server ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+ROLLBACK; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+COMMIT; -+SET AUTOCOMMIT=ON; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -+COMMIT; -+SET AUTOCOMMIT=ON; -+Performing State Transfer on a server that has been killed and restarted -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+COMMIT; -+Killing server ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+INSERT INTO t1 VALUES ('node1_committed_during'); -+COMMIT; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+Performing --wsrep-recover ... -+Starting server ... -+Using --wsrep-start-position when starting mysqld ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+INSERT INTO t1 VALUES ('node2_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 VALUES ('node1_to_be_committed_after'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+INSERT INTO t1 VALUES ('node1_committed_after'); -+COMMIT; -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 VALUES ('node1_to_be_rollbacked_after'); -+ROLLBACK; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+COMMIT; -+SET AUTOCOMMIT=ON; -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -+COMMIT; -+SET AUTOCOMMIT=ON; -+Performing State Transfer on a server that has been killed and restarted -+while a DDL was in progress on it -+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+INSERT INTO t1 VALUES ('node1_committed_before'); -+START TRANSACTION; -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+INSERT INTO t1 VALUES ('node2_committed_before'); -+COMMIT; -+SET GLOBAL debug = 'd,sync.alter_opened_table'; -+ALTER TABLE t1 ADD COLUMN f2 INTEGER; -+SET wsrep_sync_wait = 0; -+Killing server ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_during'); -+COMMIT; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+Performing --wsrep-recover ... -+Starting server ... -+Using --wsrep-start-position when starting mysqld ... -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node2_committed_after'); -+COMMIT; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_committed_after'); -+COMMIT; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+INSERT INTO t1 (f1) VALUES ('node1_committed_after'); -+COMMIT; -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+INSERT INTO t1 (f1) VALUES ('node1_to_be_rollbacked_after'); -+ROLLBACK; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+COMMIT; -+SET AUTOCOMMIT=ON; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 35 FROM t1; -+COUNT(*) = 35 -+1 -+SELECT COUNT(*) = 0 FROM (SELECT COUNT(*) AS c, f1 FROM t1 GROUP BY f1 HAVING c NOT IN (5, 10)) AS a1; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -+COMMIT; -+SET AUTOCOMMIT=ON; -diff --git a/mysql-test/suite/galera/r/galera_status_cluster.result b/mysql-test/suite/galera/r/galera_status_cluster.result -new file mode 100644 -index 0000000..d7cf671 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_status_cluster.result -@@ -0,0 +1,12 @@ -+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+VARIABLE_VALUE = 2 -+1 -+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -+VARIABLE_VALUE = 'Primary' -+1 -+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+VARIABLE_VALUE = 2 -+1 -+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -+VARIABLE_VALUE = 'Primary' -+1 -diff --git a/mysql-test/suite/galera/r/galera_status_local_state.result b/mysql-test/suite/galera/r/galera_status_local_state.result -new file mode 100644 -index 0000000..65713f1 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_status_local_state.result -@@ -0,0 +1,14 @@ -+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state'; -+VARIABLE_VALUE = 4 -+1 -+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; -+VARIABLE_VALUE = 'Synced' -+1 -+SET GLOBAL wsrep_desync = 1; -+SELECT VARIABLE_VALUE = 'Donor/Desynced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; -+VARIABLE_VALUE = 'Donor/Desynced' -+1 -+SET GLOBAL wsrep_desync = 0; -+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; -+VARIABLE_VALUE = 'Synced' -+1 -diff --git a/mysql-test/suite/galera/r/galera_suspend_slave.result b/mysql-test/suite/galera/r/galera_suspend_slave.result -new file mode 100644 -index 0000000..0290481 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_suspend_slave.result -@@ -0,0 +1,10 @@ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+Suspending node_2 ... -+INSERT INTO t1 VALUES (1); -+Got one of the listed errors -+Resuming node_2 ... -+INSERT INTO t1 VALUES (1); -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_toi_alter_auto_increment.result b/mysql-test/suite/galera/r/galera_toi_alter_auto_increment.result -new file mode 100644 -index 0000000..f914153 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_toi_alter_auto_increment.result -@@ -0,0 +1,42 @@ -+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); -+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB; -+INSERT INTO t1 (f2) SELECT 1 FROM ten; -+INSERT INTO t1 (f2) SELECT 1 FROM ten; -+ALTER TABLE t1 AUTO_INCREMENT = 1000; -+INSERT INTO t1 (f2) SELECT 1 FROM ten; -+INSERT INTO t1 (f2) SELECT 1 FROM ten; -+SELECT MIN(f1) >= 1000, COUNT(*) = 20, COUNT(DISTINCT f1) = 20 FROM t1 WHERE f1 >= 1000; -+MIN(f1) >= 1000 COUNT(*) = 20 COUNT(DISTINCT f1) = 20 -+1 1 1 -+SELECT MIN(f1) >= 1000, COUNT(*) = 20, COUNT(DISTINCT f1) = 20 FROM t1 WHERE f1 >= 1000; -+MIN(f1) >= 1000 COUNT(*) = 20 COUNT(DISTINCT f1) = 20 -+1 1 1 -+ALTER TABLE t1 AUTO_INCREMENT = 5; -+INSERT INTO t1 (f2) SELECT 1 FROM ten; -+INSERT INTO t1 (f2) SELECT 1 FROM ten; -+SELECT MIN(f1) >= 1000, COUNT(*) = 40, COUNT(DISTINCT f1) = 40 FROM t1 WHERE f1 >= 1000; -+MIN(f1) >= 1000 COUNT(*) = 40 COUNT(DISTINCT f1) = 40 -+1 1 1 -+SELECT MIN(f1) >= 1000, COUNT(*) = 40, COUNT(DISTINCT f1) = 40 FROM t1 WHERE f1 >= 1000; -+MIN(f1) >= 1000 COUNT(*) = 40 COUNT(DISTINCT f1) = 40 -+1 1 1 -+DROP TABLE t1; -+SET GLOBAL wsrep_auto_increment_control = OFF; -+SET GLOBAL auto_increment_increment = 1; -+SET GLOBAL auto_increment_offset = 1; -+SET GLOBAL wsrep_auto_increment_control = OFF; -+SET GLOBAL auto_increment_increment = 1; -+SET GLOBAL auto_increment_offset = 1; -+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB; -+ALTER TABLE t1 AUTO_INCREMENT=100; -+INSERT INTO t1 (f2) SELECT 1 FROM ten; -+INSERT INTO t1 (f2) SELECT 1 FROM ten; -+SELECT MIN(f1) = 100, MAX(f1) = 119, COUNT(f1) = 20, COUNT(DISTINCT f1) = 20 FROM t1; -+MIN(f1) = 100 MAX(f1) = 119 COUNT(f1) = 20 COUNT(DISTINCT f1) = 20 -+1 1 1 1 -+SELECT MIN(f1) = 100, MAX(f1) = 119, COUNT(f1) = 20, COUNT(DISTINCT f1) = 20 FROM t1; -+MIN(f1) = 100 MAX(f1) = 119 COUNT(f1) = 20 COUNT(DISTINCT f1) = 20 -+1 1 1 1 -+DROP TABLE t1; -+DROP TABLE ten; -diff --git a/mysql-test/suite/galera/r/galera_toi_ddl_error.result b/mysql-test/suite/galera/r/galera_toi_ddl_error.result -new file mode 100644 -index 0000000..656e20b ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_toi_ddl_error.result -@@ -0,0 +1,19 @@ -+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO t1 (f1) SELECT (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; -+INSERT INTO t1 (f1) SELECT MAX(f1) FROM t1; -+ALTER TABLE t1 ADD PRIMARY KEY (f1); -+ERROR 23000: Duplicate entry '111110' for key 'PRIMARY' -+SHOW CREATE TABLE t1; -+Table Create Table -+t1 CREATE TABLE `t1` ( -+ `f1` int(11) DEFAULT NULL -+) ENGINE=InnoDB DEFAULT CHARSET=latin1 -+SHOW CREATE TABLE t1; -+Table Create Table -+t1 CREATE TABLE `t1` ( -+ `f1` int(11) DEFAULT NULL -+) ENGINE=InnoDB DEFAULT CHARSET=latin1 -+DROP TABLE t1; -+DROP TABLE ten; -diff --git a/mysql-test/suite/galera/r/galera_toi_ddl_fk_insert.result b/mysql-test/suite/galera/r/galera_toi_ddl_fk_insert.result -new file mode 100644 -index 0000000..81781fb ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_toi_ddl_fk_insert.result -@@ -0,0 +1,31 @@ -+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); -+CREATE TABLE parent ( -+id INT PRIMARY KEY AUTO_INCREMENT, -+f2 INTEGER, -+KEY (id) -+) ENGINE=InnoDB; -+CREATE TABLE child ( -+id INT PRIMARY KEY AUTO_INCREMENT, -+parent_id INT -+) ENGINE=InnoDB; -+INSERT INTO parent VALUES (DEFAULT, 0); -+INSERT INTO child (parent_id) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;; -+INSERT INTO parent (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;; -+INSERT INTO parent (f2) SELECT 2 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;; -+ALTER TABLE child ADD FOREIGN KEY (parent_id) REFERENCES parent(id);; -+SELECT COUNT(*) = 20001 FROM parent; -+COUNT(*) = 20001 -+1 -+SELECT COUNT(*) = 10000 FROM child; -+COUNT(*) = 10000 -+1 -+SELECT COUNT(*) = 20001 FROM parent; -+COUNT(*) = 20001 -+1 -+SELECT COUNT(*) = 10000 FROM child; -+COUNT(*) = 10000 -+1 -+DROP TABLE child; -+DROP TABLE parent; -+DROP TABLE ten; -diff --git a/mysql-test/suite/galera/r/galera_toi_ddl_locking.result b/mysql-test/suite/galera/r/galera_toi_ddl_locking.result -new file mode 100644 -index 0000000..d961f04 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_toi_ddl_locking.result -@@ -0,0 +1,39 @@ -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB; -+SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue'; -+ALTER TABLE t1 ADD COLUMN f2 INTEGER;; -+SET SESSION wsrep_sync_wait = 0; -+SELECT COUNT(*) = 0 FROM t1; -+COUNT(*) = 0 -+1 -+SELECT COUNT(*) = 0 FROM t2; -+COUNT(*) = 0 -+1 -+INSERT INTO t1 VALUES (1); -+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t2 VALUES (1); -+COMMIT;; -+SET SESSION wsrep_sync_wait = 0; -+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO = 'Commit'; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 0 FROM t2; -+COUNT(*) = 0 -+1 -+SET DEBUG_SYNC= 'now SIGNAL continue'; -+SELECT COUNT(*) = 0 FROM t1; -+COUNT(*) = 0 -+1 -+SELECT COUNT(*) = 1 FROM t2; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 0 FROM t1; -+COUNT(*) = 0 -+1 -+SELECT COUNT(*) = 1 FROM t2; -+COUNT(*) = 1 -+1 -+DROP TABLE t1; -+DROP TABLE t2; -diff --git a/mysql-test/suite/galera/r/galera_toi_ddl_nonconflicting.result b/mysql-test/suite/galera/r/galera_toi_ddl_nonconflicting.result -new file mode 100644 -index 0000000..41e693c ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_toi_ddl_nonconflicting.result -@@ -0,0 +1,23 @@ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 INTEGER); -+ALTER TABLE t1 ADD COLUMN f3 INTEGER; INSERT INTO t1 (f1, f2) VALUES (DEFAULT, 123);; -+CREATE UNIQUE INDEX i1 ON t1(f2);; -+INSERT INTO t1 (f1, f2) VALUES (DEFAULT, 234); -+SELECT COUNT(*) = 3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 3 -+1 -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 2 FROM t1; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 3 -+1 -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME = 't1'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 2 FROM t1; -+COUNT(*) = 2 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_toi_ddl_sequential.result b/mysql-test/suite/galera/r/galera_toi_ddl_sequential.result -new file mode 100644 -index 0000000..9dfa433 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_toi_ddl_sequential.result -@@ -0,0 +1,35 @@ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+ALTER TABLE t1 ADD COLUMN f2 INTEGER; -+INSERT INTO t1 VALUES (2, 3); -+ALTER TABLE t1 DROP COLUMN f2; -+INSERT INTO t1 VALUES (4); -+SHOW CREATE TABLE t1; -+Table Create Table -+t1 CREATE TABLE `t1` ( -+ `f1` int(11) NOT NULL, -+ PRIMARY KEY (`f1`) -+) ENGINE=InnoDB DEFAULT CHARSET=latin1 -+SELECT COUNT(*) = 3 FROM t1; -+COUNT(*) = 3 -+1 -+SELECT * FROM t1 ORDER BY f1; -+f1 -+1 -+2 -+4 -+SHOW CREATE TABLE t1; -+Table Create Table -+t1 CREATE TABLE `t1` ( -+ `f1` int(11) NOT NULL, -+ PRIMARY KEY (`f1`) -+) ENGINE=InnoDB DEFAULT CHARSET=latin1 -+SELECT COUNT(*) = 3 FROM t1; -+COUNT(*) = 3 -+1 -+SELECT * FROM t1 ORDER BY f1; -+f1 -+1 -+2 -+4 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_toi_ftwrl.result b/mysql-test/suite/galera/r/galera_toi_ftwrl.result -new file mode 100644 -index 0000000..594717c ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_toi_ftwrl.result -@@ -0,0 +1,12 @@ -+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; -+FLUSH TABLES WITH READ LOCK; -+ALTER TABLE t1 ADD COLUMN f2 INTEGER; -+UNLOCK TABLES; -+SHOW CREATE TABLE t1; -+Table Create Table -+t1 CREATE TABLE `t1` ( -+ `id` int(11) NOT NULL, -+ `f2` int(11) DEFAULT NULL, -+ PRIMARY KEY (`id`) -+) ENGINE=InnoDB DEFAULT CHARSET=latin1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_toi_lock_exclusive.result b/mysql-test/suite/galera/r/galera_toi_lock_exclusive.result -new file mode 100644 -index 0000000..eac50e8 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_toi_lock_exclusive.result -@@ -0,0 +1,17 @@ -+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES (2); -+ALTER TABLE t1 ADD COLUMN f2 INTEGER, LOCK=EXCLUSIVE; -+COMMIT; -+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -+INSERT INTO t1 VALUES (2, 2); -+SELECT COUNT(*) = 2 FROM t1; -+COUNT(*) = 2 -+1 -+INSERT INTO t1 VALUES (3, 3); -+SELECT COUNT(*) = 3 FROM t1; -+COUNT(*) = 3 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_toi_lock_shared.result b/mysql-test/suite/galera/r/galera_toi_lock_shared.result -new file mode 100644 -index 0000000..36c3886 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_toi_lock_shared.result -@@ -0,0 +1,12 @@ -+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+ALTER TABLE t1 ADD COLUMN f2 INTEGER, LOCK=SHARED; -+INSERT INTO t1 VALUES (2, 2); -+SELECT COUNT(*) = 2 FROM t1; -+COUNT(*) = 2 -+1 -+INSERT INTO t1 VALUES (3, 3); -+SELECT COUNT(*) = 3 FROM t1; -+COUNT(*) = 3 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_transaction_read_only.result b/mysql-test/suite/galera/r/galera_transaction_read_only.result -new file mode 100644 -index 0000000..3cd1076 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_transaction_read_only.result -@@ -0,0 +1,21 @@ -+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+COMMIT; -+wsrep_last_committed_diff -+1 -+START TRANSACTION READ ONLY; -+SELECT COUNT(*) = 0 FROM t1; -+COUNT(*) = 0 -+1 -+COMMIT; -+wsrep_last_committed_diff -+1 -+START TRANSACTION; -+SELECT COUNT(*) = 0 FROM t1; -+COUNT(*) = 0 -+1 -+COMMIT; -+wsrep_last_committed_diff -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_transaction_replay.result b/mysql-test/suite/galera/r/galera_transaction_replay.result -new file mode 100644 -index 0000000..23ed87f ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_transaction_replay.result -@@ -0,0 +1,30 @@ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)); -+INSERT INTO t1 VALUES (1, 'a'); -+INSERT INTO t1 VALUES (2, 'a'); -+SET AUTOCOMMIT=ON; -+START TRANSACTION; -+UPDATE t1 SET f2 = 'b' WHERE f1 = 1; -+SELECT * FROM t1 WHERE f1 = 2 FOR UPDATE; -+f1 f2 -+2 a -+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_enter_sync'; -+COMMIT;; -+SET SESSION wsrep_sync_wait = 0; -+UPDATE t1 SET f2 = 'c' WHERE f1 = 2; -+SET GLOBAL wsrep_provider_options = 'dbug='; -+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_enter_sync'; -+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'b'; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c'; -+COUNT(*) = 1 -+1 -+wsrep_local_replays -+1 -+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'b'; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c'; -+COUNT(*) = 1 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_truncate.result b/mysql-test/suite/galera/r/galera_truncate.result -new file mode 100644 -index 0000000..eeeb672 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_truncate.result -@@ -0,0 +1,29 @@ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB; -+INSERT INTO t1 VALUES (1); -+TRUNCATE TABLE t1; -+SELECT COUNT(*) = 0 FROM t1; -+COUNT(*) = 0 -+1 -+SELECT COUNT(*) = 0 FROM t1; -+COUNT(*) = 0 -+1 -+CREATE TABLE t2 (f1 VARCHAR(255)) Engine=InnoDB; -+INSERT INTO t2 VALUES ('abc'); -+TRUNCATE TABLE t2; -+SELECT COUNT(*) = 0 FROM t2; -+COUNT(*) = 0 -+1 -+CREATE TABLE t3 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY) Engine=InnoDB; -+INSERT INTO t3 VALUES (DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT); -+CREATE TABLE t4 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY) Engine=InnoDB AUTO_INCREMENT=1234; -+INSERT INTO t4 VALUES (DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT); -+TRUNCATE TABLE t3; -+TRUNCATE TABLE t4; -+SELECT AUTO_INCREMENT = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME IN ('t3', 't4'); -+AUTO_INCREMENT = 1 -+1 -+1 -+DROP TABLE t1; -+DROP TABLE t2; -+DROP TABLE t3; -+DROP TABLE t4; -diff --git a/mysql-test/suite/galera/r/galera_truncate_temporary.result b/mysql-test/suite/galera/r/galera_truncate_temporary.result -new file mode 100644 -index 0000000..0bdc4e3 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_truncate_temporary.result -@@ -0,0 +1,63 @@ -+CREATE TEMPORARY TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB; -+INSERT INTO t1 VALUES (1); -+TRUNCATE TABLE t1; -+SELECT COUNT(*) = 0 FROM t1; -+COUNT(*) = 0 -+1 -+SELECT * FROM t1; -+ERROR 42S02: Table 'test.t1' doesn't exist -+DROP TABLE t1; -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+CREATE TEMPORARY TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (2); -+SELECT f1 = 2 FROM t1; -+f1 = 2 -+1 -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+TRUNCATE TABLE t1; -+SELECT COUNT(*) = 0 FROM t1; -+COUNT(*) = 0 -+1 -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+SELECT f1 = 1 FROM t1; -+f1 = 1 -+1 -+DROP TABLE t1; -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+SELECT f1 = 1 FROM t1; -+f1 = 1 -+1 -+TRUNCATE TABLE t1; -+SELECT COUNT(*) = 0 FROM t1; -+COUNT(*) = 0 -+1 -+SELECT COUNT(*) = 0 FROM t1; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+CREATE TEMPORARY TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (2); -+TRUNCATE TABLE t1; -+SELECT COUNT(*) = 0 FROM t1; -+COUNT(*) = 0 -+1 -+SELECT f1 = 2 FROM t1; -+f1 = 2 -+1 -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+DROP TABLE t1; -+SELECT COUNT(*) = 0 FROM t1; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_unicode_identifiers.result b/mysql-test/suite/galera/r/galera_unicode_identifiers.result -new file mode 100644 -index 0000000..212c6c6 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_unicode_identifiers.result -@@ -0,0 +1,46 @@ -+SET GLOBAL wsrep_sync_wait = 7; -+SET GLOBAL wsrep_sync_wait = 7; -+CREATE DATABASE `database with space`; -+USE `database with space`; -+CREATE TABLE `table with space` ( -+`column with space` INTEGER AUTO_INCREMENT PRIMARY KEY, -+`second column with space` INTEGER, -+UNIQUE `index name with space` (`second column with space`) -+); -+INSERT INTO `table with space` VALUES (DEFAULT, 1); -+CREATE DATABASE `база`; -+USE `база`; -+CREATE TABLE `таблица` ( -+`първа_колона` INTEGER PRIMARY KEY, -+`втора_колона` INTEGER, -+UNIQUE `индекс` (`втора_колона`) -+); -+INSERT INTO `таблица` VALUES (1, 1); -+CREATE DATABASE `втора база`; -+USE `втора база`; -+CREATE TABLE `втора таблица` ( -+`първа колона` INTEGER, -+`втора колона` INTEGER, -+KEY `първи индекс` (`първа колона`) -+); -+INSERT INTO `втора таблица` VALUES (1, 1); -+USE `database with space`; -+SELECT `second column with space` FROM `table with space`; -+second column with space -+1 -+USE `база`; -+SELECT * FROM `таблица`; -+първа_колона втора_колона -+1 1 -+USE `втора база`; -+SELECT `втора колона` FROM `втора таблица`; -+втора колона -+1 -+SET GLOBAL wsrep_sync_wait = (SELECT @@wsrep_sync_wait); -+DROP TABLE `database with space`.`table with space`; -+DROP TABLE `база`.`таблица`; -+DROP TABLE `втора база`.`втора таблица`; -+DROP DATABASE `database with space`; -+DROP DATABASE `база`; -+DROP DATABASE `втора база`; -+SET GLOBAL wsrep_sync_wait = (SELECT @@wsrep_sync_wait); -diff --git a/mysql-test/suite/galera/r/galera_unicode_pk.result b/mysql-test/suite/galera/r/galera_unicode_pk.result -new file mode 100644 -index 0000000..d59615b ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_unicode_pk.result -@@ -0,0 +1,31 @@ -+CREATE TABLE t1 ( -+f1 VARCHAR(255) PRIMARY KEY -+) ENGINE=InnoDB DEFAULT CHARSET=utf8; -+INSERT INTO t1 VALUES ('текст'); -+SELECT f1 = 'текст' FROM t1; -+f1 = 'текст' -+1 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t1 SET f1 = 'текст2'; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t1 SET f1 = 'текст3'; -+COMMIT; -+COMMIT; -+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -+SELECT f1 = 'текст2' FROM t1; -+f1 = 'текст2' -+1 -+SELECT f1 = 'текст2' FROM t1 WHERE f1 = 'текст2'; -+f1 = 'текст2' -+1 -+START TRANSACTION; -+INSERT INTO t1 VALUES ('текст4'); -+START TRANSACTION; -+INSERT INTO t1 VALUES ('текст4'); -+COMMIT; -+COMMIT; -+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -+COMMIT; -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_update_limit.result b/mysql-test/suite/galera/r/galera_update_limit.result -new file mode 100644 -index 0000000..c26eb1c ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_update_limit.result -@@ -0,0 +1,17 @@ -+CREATE TABLE ten (f1 INTEGER) Engine=InnoDB; -+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB; -+INSERT INTO t1 SELECT f1 FROM ten ORDER BY RAND(); -+UPDATE IGNORE t1 SET f1 = FLOOR(1 + (RAND() * 10)) ORDER BY RAND() LIMIT 5; -+sum_matches -+1 -+max_matches -+1 -+DROP TABLE t1; -+CREATE TABLE t2 (f1 INTEGER) Engine=InnoDB; -+INSERT INTO t2 SELECT f1 FROM ten ORDER BY RAND(); -+UPDATE IGNORE t2 SET f1 = FLOOR(1 + (RAND() * 10)) ORDER BY RAND() LIMIT 5; -+sum_matches -+1 -+DROP TABLE t2; -+DROP TABLE ten; -diff --git a/mysql-test/suite/galera/r/galera_v1_row_events.result b/mysql-test/suite/galera/r/galera_v1_row_events.result -new file mode 100644 -index 0000000..a6ab623 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_v1_row_events.result -@@ -0,0 +1,10 @@ -+CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+UPDATE t1 SET f1 = 2 WHERE f1 = 1; -+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; -+COUNT(*) = 1 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_var_auto_inc_control_off.result b/mysql-test/suite/galera/r/galera_var_auto_inc_control_off.result -new file mode 100644 -index 0000000..92b69fb ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_var_auto_inc_control_off.result -@@ -0,0 +1,61 @@ -+SET GLOBAL wsrep_auto_increment_control = OFF; -+SET GLOBAL auto_increment_increment = 1; -+SET GLOBAL auto_increment_offset = 1; -+SET GLOBAL wsrep_auto_increment_control = OFF; -+SET GLOBAL auto_increment_increment = 1; -+SET GLOBAL auto_increment_offset = 1; -+SELECT @@auto_increment_increment = 1; -+@@auto_increment_increment = 1 -+1 -+SELECT @@auto_increment_offset = 1; -+@@auto_increment_offset = 1 -+1 -+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, node VARCHAR(10)) ENGINE=InnoDB; -+SHOW CREATE TABLE t1; -+Table Create Table -+t1 CREATE TABLE `t1` ( -+ `f1` int(11) NOT NULL AUTO_INCREMENT, -+ `node` varchar(10) DEFAULT NULL, -+ PRIMARY KEY (`f1`) -+) ENGINE=InnoDB DEFAULT CHARSET=latin1 -+SHOW CREATE TABLE t1; -+Table Create Table -+t1 CREATE TABLE `t1` ( -+ `f1` int(11) NOT NULL AUTO_INCREMENT, -+ `node` varchar(10) DEFAULT NULL, -+ PRIMARY KEY (`f1`) -+) ENGINE=InnoDB DEFAULT CHARSET=latin1 -+SELECT @@auto_increment_increment = 1; -+@@auto_increment_increment = 1 -+1 -+SELECT @@auto_increment_offset = 1; -+@@auto_increment_offset = 1 -+1 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (node) VALUES ('node1'); -+SELECT f1 FROM t1; -+f1 -+1 -+SELECT @@auto_increment_increment = 1; -+@@auto_increment_increment = 1 -+1 -+SELECT @@auto_increment_offset = 1; -+@@auto_increment_offset = 1 -+1 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (node) VALUES ('node2'); -+SELECT f1 FROM t1; -+f1 -+1 -+COMMIT; -+COMMIT; -+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -+SELECT * FROM t1; -+f1 node -+1 node1 -+SELECT * FROM t1; -+f1 node -+1 node1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_var_auto_inc_control_on.result b/mysql-test/suite/galera/r/galera_var_auto_inc_control_on.result -new file mode 100644 -index 0000000..8859209 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_var_auto_inc_control_on.result -@@ -0,0 +1,30 @@ -+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, node VARCHAR(10)) ENGINE=InnoDB; -+SELECT @@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'); -+@@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size') -+1 -+SELECT @@auto_increment_offset = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index') + 1; -+@@auto_increment_offset = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index') + 1 -+1 -+INSERT INTO t1 VALUES (DEFAULT, 'node1');; -+INSERT INTO t1 VALUES (DEFAULT, 'node2');; -+SELECT @@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'); -+@@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size') -+1 -+SELECT @@auto_increment_offset = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index') + 1; -+@@auto_increment_offset = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index') + 1 -+1 -+INSERT INTO t1 VALUES (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2');; -+INSERT INTO t1 VALUES (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1');; -+SELECT COUNT(*) = 22 FROM t1; -+COUNT(*) = 22 -+1 -+SELECT COUNT(DISTINCT f1) = 22 FROM t1; -+COUNT(DISTINCT f1) = 22 -+1 -+SELECT COUNT(*) = 22 FROM t1; -+COUNT(*) = 22 -+1 -+SELECT COUNT(DISTINCT f1) = 22 FROM t1; -+COUNT(DISTINCT f1) = 22 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_var_certify_nonPK_off.result b/mysql-test/suite/galera/r/galera_var_certify_nonPK_off.result -new file mode 100644 -index 0000000..35dabb7 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_var_certify_nonPK_off.result -@@ -0,0 +1,21 @@ -+SET GLOBAL wsrep_certify_nonPK = OFF; -+SET GLOBAL wsrep_certify_nonPK = OFF; -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB /* Table has no primary key */; -+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1), (2); -+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -+INSERT INTO t2 VALUES (1), (2); -+UPDATE t2 SET f1 = 3 WHERE f1 = 1; -+SELECT COUNT(*) = 0 FROM t1; -+COUNT(*) = 0 -+1 -+SELECT COUNT(*) = 2 FROM t2; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 1 FROM t2 WHERE f1 = 3; -+COUNT(*) = 1 -+1 -+SET GLOBAL wsrep_certify_nonPK = 1; -+SET GLOBAL wsrep_certify_nonPK = 1; -+DROP TABLE t1; -+DROP TABLE t2; -diff --git a/mysql-test/suite/galera/r/galera_var_cluster_address.result b/mysql-test/suite/galera/r/galera_var_cluster_address.result -new file mode 100644 -index 0000000..cd52007 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_var_cluster_address.result -@@ -0,0 +1,63 @@ -+SET GLOBAL wsrep_cluster_address = 'foo://'; -+SHOW STATUS; -+ERROR HY000: Lock wait timeout exceeded; try restarting transaction -+SET SESSION wsrep_sync_wait=0; -+SELECT * FROM INFORMATION_SCHEMA.GLOBAL_STATUS; -+ERROR 08S01: Unknown command -+SHOW STATUS LIKE 'wsrep_ready'; -+Variable_name Value -+wsrep_ready OFF -+SHOW STATUS LIKE 'wsrep_cluster_status'; -+Variable_name Value -+wsrep_cluster_status non-Primary -+SHOW STATUS LIKE 'wsrep_local_state'; -+Variable_name Value -+wsrep_local_state 0 -+SHOW STATUS LIKE 'wsrep_local_state_comment'; -+Variable_name Value -+wsrep_local_state_comment Initialized -+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+VARIABLE_VALUE = 1 -+1 -+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -+VARIABLE_VALUE = 'Primary' -+1 -+SET GLOBAL wsrep_cluster_address = @@wsrep_cluster_address; -+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -+VARIABLE_VALUE = 'Primary' -+1 -+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+VARIABLE_VALUE = 2 -+1 -+SET GLOBAL wsrep_cluster_address = 'gcomm://192.0.2.1'; -+SELECT * FROM INFORMATION_SCHEMA.GLOBAL_STATUS; -+ERROR 08S01: Unknown command -+SHOW STATUS LIKE 'wsrep_ready'; -+Variable_name Value -+wsrep_ready OFF -+SHOW STATUS LIKE 'wsrep_cluster_status'; -+Variable_name Value -+wsrep_cluster_status non-Primary -+SHOW STATUS LIKE 'wsrep_local_state'; -+Variable_name Value -+wsrep_local_state 0 -+SHOW STATUS LIKE 'wsrep_local_state_comment'; -+Variable_name Value -+wsrep_local_state_comment Initialized -+SET GLOBAL wsrep_cluster_address = @@wsrep_cluster_address; -+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -+VARIABLE_VALUE = 'Primary' -+1 -+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+VARIABLE_VALUE = 2 -+1 -+CALL mtr.add_suppression("Backend not supported: foo"); -+CALL mtr.add_suppression("Failed to initialize backend using 'foo"); -+CALL mtr.add_suppression("Failed to open channel 'my_wsrep_cluster' at 'foo"); -+CALL mtr.add_suppression("gcs connect failed: Socket type not supported"); -+CALL mtr.add_suppression("wsrep::connect\\(\\) failed: 7"); -+CALL mtr.add_suppression("gcs_caused\\(\\) returned -103 \\(Software caused connection abort\\)"); -+CALL mtr.add_suppression("failed to open gcomm backend connection: 110: failed to reach primary view: 110"); -+CALL mtr.add_suppression("Failed to open backend connection: -110 \\(Connection timed out\\)"); -+CALL mtr.add_suppression("Failed to open channel 'my_wsrep_cluster' at 'gcomm://192\\.0\\.2\\.1': -110 \\(Connection timed out\\)"); -+CALL mtr.add_suppression("gcs connect failed: Connection timed out"); -diff --git a/mysql-test/suite/galera/r/galera_var_desync_on.result b/mysql-test/suite/galera/r/galera_var_desync_on.result -new file mode 100644 -index 0000000..0b5f346 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_var_desync_on.result -@@ -0,0 +1,29 @@ -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+SET GLOBAL wsrep_provider_options = 'gcs.fc_limit=1'; -+SET GLOBAL wsrep_desync = TRUE; -+FLUSH TABLES WITH READ LOCK; -+INSERT INTO t1 VALUES (2); -+INSERT INTO t1 VALUES (3); -+INSERT INTO t1 VALUES (4); -+INSERT INTO t1 VALUES (5); -+INSERT INTO t1 VALUES (6); -+INSERT INTO t1 VALUES (7); -+INSERT INTO t1 VALUES (8); -+INSERT INTO t1 VALUES (9); -+INSERT INTO t1 VALUES (10); -+SET SESSION wsrep_sync_wait = 0; -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+SET GLOBAL wsrep_desync = FALSE; -+UNLOCK TABLES; -+SET SESSION wsrep_sync_wait = 1; -+SELECT COUNT(*) = 10 FROM t1; -+COUNT(*) = 10 -+1 -+INSERT INTO t1 VALUES (11); -+SELECT COUNT(*) = 11 FROM t1; -+COUNT(*) = 11 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_var_fkchecks.result b/mysql-test/suite/galera/r/galera_var_fkchecks.result -new file mode 100644 -index 0000000..342212a ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_var_fkchecks.result -@@ -0,0 +1,26 @@ -+CREATE TABLE parent ( -+id INT PRIMARY KEY, -+KEY (id) -+) ENGINE=InnoDB; -+CREATE TABLE child ( -+id INT PRIMARY KEY, -+parent_id INT, -+FOREIGN KEY (parent_id) -+REFERENCES parent(id) -+) ENGINE=InnoDB; -+INSERT INTO parent VALUES (1); -+INSERT INTO child VALUES (1,1); -+SET SESSION foreign_key_checks = 0; -+INSERT INTO child VALUES (2,2); -+SELECT COUNT(*) = 1 FROM child WHERE id = 2; -+COUNT(*) = 1 -+1 -+INSERT INTO child VALUES (3,3); -+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`child`, CONSTRAINT `child_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `parent` (`id`)) -+SET SESSION foreign_key_checks = 0; -+DELETE FROM parent; -+SELECT COUNT(*) = 0 FROM parent; -+COUNT(*) = 0 -+1 -+DROP TABLE child; -+DROP TABLE parent; -diff --git a/mysql-test/suite/galera/r/galera_var_innodb_disallow_writes.result b/mysql-test/suite/galera/r/galera_var_innodb_disallow_writes.result -new file mode 100644 -index 0000000..912e45a ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_var_innodb_disallow_writes.result -@@ -0,0 +1,12 @@ -+SET SESSION wsrep_sync_wait = 0; -+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB; -+SET GLOBAL innodb_disallow_writes=ON; -+INSERT INTO t1 VALUES (1);; -+SET GLOBAL innodb_disallow_writes=OFF; -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_var_load_data_splitting.result b/mysql-test/suite/galera/r/galera_var_load_data_splitting.result -new file mode 100644 -index 0000000..db145fd ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_var_load_data_splitting.result -@@ -0,0 +1,9 @@ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+SET GLOBAL wsrep_load_data_splitting = TRUE; -+SELECT COUNT(*) = 95000 FROM t1; -+COUNT(*) = 95000 -+1 -+wsrep_last_committed_diff -+1 -+SET GLOBAL wsrep_load_data_splitting = 1;; -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_var_max_ws_size.result b/mysql-test/suite/galera/r/galera_var_max_ws_size.result -new file mode 100644 -index 0000000..6db5c24 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_var_max_ws_size.result -@@ -0,0 +1,12 @@ -+call mtr.add_suppression('WSREP: transaction size limit.*'); -+call mtr.add_suppression('WSREP: rbr write fail.*'); -+call mtr.add_suppression('WSREP: Maximum writeset size exceeded by.*'); -+call mtr.add_suppression('WSREP: transaction size exceeded.*'); -+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 VARCHAR(1024)) Engine=InnoDB; -+SET GLOBAL wsrep_max_ws_size = 1024; -+INSERT INTO t1 VALUES (DEFAULT, REPEAT('X', 1024)); -+ERROR HY000: Got error 5 during COMMIT -+SELECT COUNT(*) = 0 FROM t1; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_var_mysql_replication_bundle.result b/mysql-test/suite/galera/r/galera_var_mysql_replication_bundle.result -new file mode 100644 -index 0000000..f2a951c ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_var_mysql_replication_bundle.result -@@ -0,0 +1,12 @@ -+CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=InnoDB; -+SET GLOBAL wsrep_mysql_replication_bundle = 2; -+INSERT INTO t1 VALUES (1); -+SELECT COUNT(*) = 0 FROM t1; -+COUNT(*) = 0 -+0 -+INSERT INTO t1 VALUES (2); -+SELECT COUNT(*) = 2 FROM t1; -+COUNT(*) = 2 -+1 -+SET GLOBAL wsrep_mysql_replication_bundle = 0; -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_var_notify_cmd.result b/mysql-test/suite/galera/r/galera_var_notify_cmd.result -new file mode 100644 -index 0000000..e9e4605 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_var_notify_cmd.result -@@ -0,0 +1,10 @@ -+SELECT COUNT(DISTINCT uuid) = 2 FROM mtr_wsrep_notify.membership; -+COUNT(DISTINCT uuid) = 2 -+1 -+SELECT MAX(size) = 2 FROM mtr_wsrep_notify.status; -+MAX(size) = 2 -+1 -+SELECT COUNT(DISTINCT idx) = 2 FROM mtr_wsrep_notify.status; -+COUNT(DISTINCT idx) = 2 -+1 -+DROP SCHEMA mtr_wsrep_notify; -diff --git a/mysql-test/suite/galera/r/galera_var_replicate_myisam_off.result b/mysql-test/suite/galera/r/galera_var_replicate_myisam_off.result -new file mode 100644 -index 0000000..c8b7907 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_var_replicate_myisam_off.result -@@ -0,0 +1,8 @@ -+SET GLOBAL wsrep_replicate_myisam = FALSE; -+CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=MyISAM; -+INSERT INTO t1 VALUES (1); -+SELECT COUNT(*) = 0 FROM t1; -+COUNT(*) = 0 -+1 -+SET GLOBAL wsrep_replicate_myisam = 0; -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_var_replicate_myisam_on.result b/mysql-test/suite/galera/r/galera_var_replicate_myisam_on.result -new file mode 100644 -index 0000000..73a0576 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_var_replicate_myisam_on.result -@@ -0,0 +1,78 @@ -+SET GLOBAL wsrep_replicate_myisam = TRUE; -+SET GLOBAL wsrep_replicate_myisam = TRUE; -+CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=MyISAM; -+INSERT INTO t1 VALUES (1); -+INSERT INTO t1 VALUES (2), (3); -+INSERT INTO t1 SELECT 4 FROM DUAL UNION ALL SELECT 5 FROM DUAL; -+SELECT COUNT(*) = 5 FROM t1; -+COUNT(*) = 5 -+1 -+DROP TABLE t1; -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 VARCHAR(100)) ENGINE=MyISAM; -+INSERT INTO t1 VALUES (1, 'abc'),(2,'abc'), (3, 'xxx'); -+REPLACE INTO t1 VALUES (1, 'klm'), (2,'xyz'); -+REPLACE INTO t1 SELECT 3, 'yyy' FROM DUAL; -+SELECT COUNT(*) = 3 FROM t1; -+COUNT(*) = 3 -+1 -+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1 AND f2 = 'klm'; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2 AND f2 = 'xyz'; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 3 AND f2 = 'yyy'; -+COUNT(*) = 1 -+1 -+UPDATE t1 SET f2 = 'zzz' WHERE f2 = 'yyy'; -+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'zzz'; -+COUNT(*) = 1 -+1 -+DELETE FROM t1 WHERE f2 = 'zzz'; -+SELECT COUNT(*) = 0 FROM t1 WHERE f2 = 'zzz'; -+COUNT(*) = 0 -+1 -+TRUNCATE TABLE t1; -+SELECT COUNT(*) = 0 FROM t1; -+COUNT(*) = 0 -+1 -+DROP TABLE t1; -+CREATE TABLE t1 (f1 INTEGER) ENGINE=MyISAM; -+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES (1); -+INSERT INTO t2 VALUES (1); -+COMMIT; -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = 1 FROM t2; -+COUNT(*) = 1 -+1 -+START TRANSACTION; -+INSERT INTO t1 VALUES (2); -+INSERT INTO t2 VALUES (2); -+ROLLBACK; -+Warnings: -+Warning 1196 Some non-transactional changed tables couldn't be rolled back -+SELECT COUNT(*) = 2 FROM t1; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 1 FROM t2; -+COUNT(*) = 1 -+1 -+DROP TABLE t1; -+DROP TABLE t2; -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=MyISAM; -+CREATE TABLE t2 (f2 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+START TRANSACTION; -+INSERT INTO t1 VALUES (1); -+INSERT INTO t2 VALUES (1); -+INSERT INTO t1 VALUES (1); -+ERROR 23000: Duplicate entry '1' for key 'PRIMARY' -+COMMIT; -+DROP TABLE t1; -+DROP TABLE t2; -+SET GLOBAL wsrep_replicate_myisam = 0; -+SET GLOBAL wsrep_replicate_myisam = 0; -diff --git a/mysql-test/suite/galera/r/galera_var_slave_threads.result b/mysql-test/suite/galera/r/galera_var_slave_threads.result -new file mode 100644 -index 0000000..6b84f03 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_var_slave_threads.result -@@ -0,0 +1,106 @@ -+CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=InnoDB; -+CREATE TABLE t2 (f1 INT AUTO_INCREMENT PRIMARY KEY) Engine=InnoDB; -+SET GLOBAL wsrep_slave_threads = 0; -+Warnings: -+Warning 1292 Truncated incorrect wsrep_slave_threads value: '0' -+SHOW WARNINGS; -+Level Code Message -+Warning 1292 Truncated incorrect wsrep_slave_threads value: '0' -+SELECT @@wsrep_slave_threads = 1; -+@@wsrep_slave_threads = 1 -+1 -+SET GLOBAL wsrep_slave_threads = 1; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user'; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; -+COUNT(*) = 1 -+1 -+SET GLOBAL wsrep_slave_threads = 64; -+INSERT INTO t1 VALUES (1); -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+SELECT COUNT(*) = @@wsrep_slave_threads + 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user'; -+COUNT(*) = @@wsrep_slave_threads + 1 -+1 -+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; -+COUNT(*) = 1 -+1 -+SET GLOBAL wsrep_slave_threads = 1; -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+INSERT INTO t2 VALUES (DEFAULT); -+SELECT COUNT(*) = 64 FROM t2; -+COUNT(*) = 64 -+1 -+SELECT COUNT(*) = @@wsrep_slave_threads + 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user'; -+COUNT(*) = @@wsrep_slave_threads + 1 -+1 -+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; -+COUNT(*) = 1 -+1 -+SET GLOBAL wsrep_slave_threads = 1; -+DROP TABLE t1; -+DROP TABLE t2; -diff --git a/mysql-test/suite/galera/r/galera_var_sync_wait.result b/mysql-test/suite/galera/r/galera_var_sync_wait.result -new file mode 100644 -index 0000000..f6136a4 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_var_sync_wait.result -@@ -0,0 +1,21 @@ -+CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=InnoDB; -+SET GLOBAL wsrep_sync_wait = 1; -+SHOW TABLES LIKE '%t1'; -+Tables_in_test (%t1) -+t1 -+SELECT COUNT(*) = 0 FROM t1; -+COUNT(*) = 0 -+1 -+CREATE TABLE t2 (f1 INT PRIMARY KEY) Engine=InnoDB; -+SET GLOBAL wsrep_sync_wait = 4; -+INSERT INTO t2 VALUES (1); -+CREATE TABLE t3 (f1 INT PRIMARY KEY) Engine=InnoDB; -+INSERT INTO t3 VALUES (1); -+SET GLOBAL wsrep_sync_wait = 2; -+UPDATE t3 SET f1 = 2; -+affected rows: 1 -+info: Rows matched: 1 Changed: 1 Warnings: 0 -+SET GLOBAL wsrep_sync_wait = 7; -+DROP TABLE t1; -+DROP TABLE t2; -+DROP TABLE t3; -diff --git a/mysql-test/suite/galera/r/galera_var_wsrep_on_off.result b/mysql-test/suite/galera/r/galera_var_wsrep_on_off.result -new file mode 100644 -index 0000000..8b1c4eb ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_var_wsrep_on_off.result -@@ -0,0 +1,19 @@ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+SET SESSION wsrep_on = FALSE; -+INSERT INTO t1 VALUES (2); -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+SET GLOBAL wsrep_on = TRUE; -+INSERT INTO t1 VALUES (3); -+SELECT COUNT(*) = 2 FROM t1; -+COUNT(*) = 2 -+1 -+SELECT COUNT(*) = 0 FROM t1 WHERE f1 = 2; -+COUNT(*) = 0 -+1 -+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 3; -+COUNT(*) = 1 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_wan.result b/mysql-test/suite/galera/r/galera_wan.result -new file mode 100644 -index 0000000..6be32b2 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_wan.result -@@ -0,0 +1,14 @@ -+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+VARIABLE_VALUE = 4 -+1 -+CREATE TABLE t1 (f1 INTEGER); -+INSERT INTO t1 VALUES (1); -+CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside"); -+SELECT VARIABLE_VALUE LIKE '%gmcast.segment = 3%' FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME = 'wsrep_provider_options'; -+VARIABLE_VALUE LIKE '%gmcast.segment = 3%' -+1 -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+DROP TABLE t1; -+CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside"); -diff --git a/mysql-test/suite/galera/r/galera_wsrep_desync_wsrep_on.result b/mysql-test/suite/galera/r/galera_wsrep_desync_wsrep_on.result -new file mode 100644 -index 0000000..06fc27a ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_wsrep_desync_wsrep_on.result -@@ -0,0 +1,33 @@ -+CREATE TABLE ten (f1 INTEGER); -+INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); -+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB; -+INSERT INTO t1 (f1) SELECT 000000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; -+SET GLOBAL wsrep_desync = TRUE; -+SET SESSION wsrep_on = FALSE; -+ALTER TABLE t1 ADD PRIMARY KEY (f1); -+SET SESSION wsrep_on = TRUE; -+SET GLOBAL wsrep_desync = FALSE; -+INSERT INTO t1 (f1) SELECT 100000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; -+SELECT COUNT(*) = 200000 FROM t1; -+COUNT(*) = 200000 -+1 -+SELECT MAX(f1) = 199999 FROM t1; -+MAX(f1) = 199999 -+1 -+SELECT COUNT(*) = 200000 FROM t1; -+COUNT(*) = 200000 -+1 -+SELECT MAX(f1) = 199999 FROM t1; -+MAX(f1) = 199999 -+1 -+SET GLOBAL wsrep_desync = TRUE; -+SET SESSION wsrep_on = FALSE; -+ALTER TABLE t1 ADD PRIMARY KEY (f1); -+SET SESSION wsrep_on = TRUE; -+SET GLOBAL wsrep_desync = FALSE; -+INSERT INTO t1 (f1) VALUES (1); -+ERROR 23000: Duplicate entry '1' for key 'PRIMARY' -+INSERT INTO t1 (f1) VALUES (100); -+ERROR 23000: Duplicate entry '100' for key 'PRIMARY' -+DROP TABLE t1; -+DROP TABLE ten; -diff --git a/mysql-test/suite/galera/r/galera_wsrep_new_cluster.result b/mysql-test/suite/galera/r/galera_wsrep_new_cluster.result -new file mode 100644 -index 0000000..e3f2fa4 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_wsrep_new_cluster.result -@@ -0,0 +1,36 @@ -+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -+VARIABLE_VALUE = 'Primary' -+1 -+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected'; -+VARIABLE_VALUE = 'ON' -+1 -+SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index'; -+VARIABLE_VALUE = 0 -+1 -+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; -+VARIABLE_VALUE = 'ON' -+1 -+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state'; -+VARIABLE_VALUE = 4 -+1 -+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; -+VARIABLE_VALUE = 'Synced' -+1 -+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -+VARIABLE_VALUE = 'Primary' -+1 -+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected'; -+VARIABLE_VALUE = 'ON' -+1 -+SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index'; -+VARIABLE_VALUE = 0 -+1 -+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; -+VARIABLE_VALUE = 'ON' -+1 -+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state'; -+VARIABLE_VALUE = 4 -+1 -+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; -+VARIABLE_VALUE = 'Synced' -+1 -diff --git a/mysql-test/suite/galera/r/galera_wsrep_provider_unset_set.result b/mysql-test/suite/galera/r/galera_wsrep_provider_unset_set.result -new file mode 100644 -index 0000000..681e460 ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_wsrep_provider_unset_set.result -@@ -0,0 +1,13 @@ -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+SET GLOBAL wsrep_provider='none'; -+INSERT INTO t1 VALUES (2); -+INSERT INTO t1 VALUES (3); -+INSERT INTO t1 VALUES (4); -+SELECT COUNT(*) = 4 FROM t1; -+COUNT(*) = 4 -+1 -+SELECT COUNT(*) = 3 FROM t1; -+COUNT(*) = 3 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/galera_zero_length_column.result b/mysql-test/suite/galera/r/galera_zero_length_column.result -new file mode 100644 -index 0000000..2e6119b ---- /dev/null -+++ b/mysql-test/suite/galera/r/galera_zero_length_column.result -@@ -0,0 +1,38 @@ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY , f2 VARCHAR(0)) ENGINE=InnoDB; -+CREATE TABLE t2 (f1 VARCHAR(0)) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1, NULL); -+INSERT INTO t1 VALUES (2, ''); -+INSERT INTO t2 VALUES (NULL); -+INSERT INTO t2 VALUES (''); -+SELECT COUNT(*) = 2 FROM t1; -+COUNT(*) = 2 -+1 -+SELECT f2 IS NULL FROM t1 WHERE f1 = 1; -+f2 IS NULL -+1 -+SELECT f2 = '' FROM t1 WHERE f1 = 2; -+f2 = '' -+1 -+SELECT COUNT(*) = 2 FROM t2; -+COUNT(*) = 2 -+1 -+SELECT f1 IS NULL FROM t2 WHERE f1 IS NULL; -+f1 IS NULL -+1 -+SELECT f1 = '' FROM t2 WHERE f1 IS NOT NULL; -+f1 = '' -+1 -+UPDATE t1 SET f2 = '' WHERE f1 = 1; -+UPDATE t1 SET f2 = NULL WHERE f1 = 2; -+UPDATE t2 SET f1 = '' WHERE f1 IS NULL; -+SELECT f2 = '' FROM t1 WHERE f1 = 1; -+f2 = '' -+1 -+SELECT f2 IS NULL FROM t1 WHERE f1 = 2; -+f2 IS NULL -+1 -+SELECT COUNT(*) = 2 FROM t2 WHERE f1 = ''; -+COUNT(*) = 2 -+1 -+DROP TABLE t1; -+DROP TABLE t2; -diff --git a/mysql-test/suite/galera/r/lp1276424.result b/mysql-test/suite/galera/r/lp1276424.result -new file mode 100644 -index 0000000..5f09ec9 ---- /dev/null -+++ b/mysql-test/suite/galera/r/lp1276424.result -@@ -0,0 +1,11 @@ -+CREATE TABLE t1 (f1 INT DEFAULT NULL, UNIQUE KEY i1 (f1)) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (NULL); -+INSERT INTO t1 VALUES (NULL); -+SELECT COUNT(*) = 2 FROM t1; -+COUNT(*) = 2 -+1 -+SELECT f1 IS NULL FROM t1; -+f1 IS NULL -+1 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/r/lp1347768.result b/mysql-test/suite/galera/r/lp1347768.result -new file mode 100644 -index 0000000..c085059 ---- /dev/null -+++ b/mysql-test/suite/galera/r/lp1347768.result -@@ -0,0 +1,17 @@ -+CREATE TABLE `r8kmb_redirect_links` ( -+`id` int(10) unsigned NOT NULL AUTO_INCREMENT, -+`old_url` varchar(255) DEFAULT NULL, -+`new_url` varchar(255) NOT NULL, -+`referer` varchar(150) NOT NULL, -+`comment` varchar(255) NOT NULL, -+`published` tinyint(4) NOT NULL, -+`created_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', -+`modified_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', -+PRIMARY KEY (`id`), -+UNIQUE KEY `idx_link_old` (`old_url`), -+KEY `idx_link_modifed` (`modified_date`) -+) ENGINE=InnoDB DEFAULT CHARSET=utf8; -+INSERT INTO r8kmb_redirect_links VALUES (550,'http://mysite.com/images/download/ßуñûічýøù_ôþóþòір_þфõÑ.doc','','','',0,'2013-07-15 14:29:42','0000-00-00 00:00:00'); -+Warnings: -+Warning 1265 Data truncated for column 'old_url' at row 1 -+DROP TABLE r8kmb_redirect_links; -diff --git a/mysql-test/suite/galera/r/lp959512.result b/mysql-test/suite/galera/r/lp959512.result -new file mode 100644 -index 0000000..55adfa3 ---- /dev/null -+++ b/mysql-test/suite/galera/r/lp959512.result -@@ -0,0 +1,24 @@ -+DROP TABLE IF EXISTS variable; -+Warnings: -+Note 1051 Unknown table 'test.variable' -+DROP TABLE IF EXISTS foo; -+Warnings: -+Note 1051 Unknown table 'test.foo' -+CREATE TABLE variable ( -+name varchar(128) NOT NULL DEFAULT '' COMMENT 'The name of the variable.', -+value longblob NOT NULL COMMENT 'The value of the variable.', -+PRIMARY KEY (name) -+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Named variable/value pairs created by Drupal core or any...'; -+CREATE TABLE foo (a int); -+INSERT INTO variable (name, value) VALUES ('menu_expanded', 'a:0:{}'); -+START TRANSACTION; -+SELECT 1 AS expression FROM variable variable -+WHERE ( (name = 'menu_expanded') ) FOR UPDATE; -+expression -+1 -+UPDATE variable SET value='a:0:{}' WHERE ( (name = 'menu_expanded') ); -+COMMIT; -+INSERT INTO foo VALUES (1); -+UPDATE foo SET a = 2 WHERE a = 1; -+DROP TABLE foo; -+DROP TABLE variable; -diff --git a/mysql-test/suite/galera/t/disabled.def b/mysql-test/suite/galera/t/disabled.def -new file mode 100644 -index 0000000..a1495c6 ---- /dev/null -+++ b/mysql-test/suite/galera/t/disabled.def -@@ -0,0 +1,4 @@ -+galera_wsrep_provider_unset_set : lp1379204 'Unsupported protocol downgrade: incremental data collection disabled. Expect abort.' -+galera_kill_nochanges : mysql-wsrep#24 Galera server does not restart properly if killed -+galera_bf_abort_for_update : mysql-wsrep#26 SELECT FOR UPDATE sometimes allowed to proceed in the face of a concurrent update -+galera_toi_ddl_fk_insert : qa#39 galera_toi_ddl_fk_insert fails sporadically -diff --git a/mysql-test/suite/galera/t/galera_account_management.test b/mysql-test/suite/galera/t/galera_account_management.test -new file mode 100644 -index 0000000..357319a ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_account_management.test -@@ -0,0 +1,101 @@ -+# -+# Test the account management statements - GRANT, REVOKE, etc. -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# CREATE USER -+# -+--connection node_1 -+CREATE USER user1, user2 IDENTIFIED BY 'password'; -+ -+--connection node_2 -+SELECT COUNT(*) = 2 FROM mysql.user WHERE user IN ('user1', 'user2'); -+ -+# -+# ALTER USER -+# -+ -+# LP bug 1376269 -+# -+#--connection node_1 -+#ALTER USER user1 PASSWORD EXPIRE; -+#SELECT password_expired = 'Y' FROM mysql.user WHERE user = 'user1'; -+# -+#--connection node_2 -+#SELECT password_expired = 'Y' FROM mysql.user WHERE user = 'user1'; -+ -+# -+# RENAME USER -+# -+ -+--connection node_1 -+RENAME USER user2 TO user3; -+ -+--connection node_2 -+SELECT COUNT(*) = 0 FROM mysql.user WHERE user = 'user2'; -+SELECT COUNT(*) = 1 FROM mysql.user WHERE user = 'user3'; -+ -+# -+# SET PASSWORD -+# -+ -+--connection node_1 -+SET PASSWORD FOR user3 = PASSWORD('foo'); -+ -+--connection node_1 -+SELECT password != '' FROM mysql.user WHERE user = 'user3'; -+ -+# -+# DROP USER -+# -+--connection node_1 -+DROP USER user1, user3; -+ -+--connection node_2 -+SELECT COUNT(*) = 0 FROM mysql.user WHERE user IN ('user1', 'user2'); -+ -+# -+# GRANT -+# -+ -+--connection node_1 -+GRANT ALL ON *.* TO user4 IDENTIFIED BY 'password'; -+ -+--connection node_2 -+SELECT COUNT(*) = 1 FROM mysql.user WHERE user = 'user4'; -+SELECT Select_priv = 'Y' FROM mysql.user WHERE user = 'user4'; -+ -+# -+# GRANT PROXY ON -+# -+--connection node_1 -+CREATE USER user5; -+GRANT PROXY ON user4 TO user5; -+ -+--connection node_2 -+SELECT COUNT(*) = 1 FROM mysql.proxies_priv WHERE user = 'user5'; -+ -+# -+# REVOKE -+# -+ -+--connection node_1 -+REVOKE ALL PRIVILEGES ON *.* FROM user4; -+ -+--connection node_2 -+SELECT Select_priv = 'N' FROM mysql.user WHERE user = 'user4'; -+ -+# -+# REVOKE PROXY -+# -+ -+--connection node_1 -+REVOKE PROXY ON user4 FROM user5; -+ -+--connection node_2 -+SELECT COUNT(*) = 0 FROM mysql.proxies_priv WHERE user = 'user5'; -+ -+DROP USER user4, user5; -diff --git a/mysql-test/suite/galera/t/galera_alter_engine_innodb.test b/mysql-test/suite/galera/t/galera_alter_engine_innodb.test -new file mode 100644 -index 0000000..bc914a3 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_alter_engine_innodb.test -@@ -0,0 +1,17 @@ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# Test ALTER ENGINE from InnoDB to InnoDB -+# -+ -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+ -+ALTER TABLE t1 ENGINE=InnoDB; -+ -+--connection node_2 -+SELECT ENGINE = 'InnoDB' FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; -+SELECT COUNT(*) = 1 FROM t1; -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_alter_engine_myisam.test b/mysql-test/suite/galera/t/galera_alter_engine_myisam.test -new file mode 100644 -index 0000000..6d41d27 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_alter_engine_myisam.test -@@ -0,0 +1,25 @@ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# Test ALTER ENGINE from MyISAM to InnoDB under wsrep_replicate_myisam -+# -+ -+--let $wsrep_replicate_myisam_orig = `SELECT @@wsrep_replicate_myisam` -+SET GLOBAL wsrep_replicate_myisam = TRUE; -+ -+CREATE TABLE t1 (f1 INTEGER) ENGINE=MyISAM; -+INSERT INTO t1 VALUES (1); -+ -+ALTER TABLE t1 ENGINE=InnoDB; -+ -+--connection node_2 -+SELECT ENGINE = 'InnoDB' FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; -+SELECT COUNT(*) = 1 FROM t1; -+ -+--connection node_1 -+--disable_query_log -+--eval SET GLOBAL wsrep_replicate_myisam = $wsrep_replicate_myisam_orig -+--enable_query_log -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_alter_table_force.test b/mysql-test/suite/galera/t/galera_alter_table_force.test -new file mode 100644 -index 0000000..1fcc9d4 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_alter_table_force.test -@@ -0,0 +1,17 @@ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# Test ALTER TABLE FORCE, a 5.6.3 feature that simply rebuilds the table -+# -+ -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+ -+ALTER TABLE t1 FORCE; -+ -+--connection node_2 -+SELECT ENGINE = 'InnoDB' FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; -+SELECT COUNT(*) = 1 FROM t1; -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_as_master.cnf b/mysql-test/suite/galera/t/galera_as_master.cnf -new file mode 100644 -index 0000000..52fd309 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_as_master.cnf -@@ -0,0 +1 @@ -+!include ../galera_2nodes_as_master.cnf -diff --git a/mysql-test/suite/galera/t/galera_as_master.test b/mysql-test/suite/galera/t/galera_as_master.test -new file mode 100644 -index 0000000..3367a20 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_as_master.test -@@ -0,0 +1,39 @@ -+# -+# Test Galera as a master to a MySQL slave -+# -+# The galera/galera_2node_master.cnf describes the setup of the nodes -+# -+ -+--source include/have_innodb.inc -+--source include/have_log_bin.inc -+--source include/galera_cluster.inc -+ -+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 -+--disable_query_log -+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$NODE_MYPORT_1; -+--enable_query_log -+START SLAVE USER='root'; -+ -+--connection node_1 -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES(1); -+ -+--connection node_2 -+INSERT INTO t1 VALUES(2); -+ -+--connection node_3 -+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; -+--source include/wait_condition.inc -+ -+--let $wait_condition = SELECT COUNT(*) = 2 FROM t1; -+--source include/wait_condition.inc -+ -+--connection node_1 -+DROP TABLE t1; -+ -+--connection node_3 -+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; -+--source include/wait_condition.inc -+ -+STOP SLAVE; -+RESET SLAVE ALL; -diff --git a/mysql-test/suite/galera/t/galera_as_master_gtid.cnf b/mysql-test/suite/galera/t/galera_as_master_gtid.cnf -new file mode 100644 -index 0000000..1951755 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_as_master_gtid.cnf -@@ -0,0 +1,8 @@ -+!include ../galera_2nodes_as_master.cnf -+ -+[mysqld] -+gtid-mode=ON -+log-bin=mysqld-bin -+log-slave-updates -+enforce-gtid-consistency -+binlog-format=ROW -diff --git a/mysql-test/suite/galera/t/galera_as_master_gtid.test b/mysql-test/suite/galera/t/galera_as_master_gtid.test -new file mode 100644 -index 0000000..9db104b ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_as_master_gtid.test -@@ -0,0 +1,70 @@ -+# -+# Test Galera as a master to a MySQL slave with GTID -+# -+# The galera/galera_2node_master.cnf describes the setup of the nodes -+# -+# We check that all transactions originating from within Galera use a UUID that is -+# different from the server_uuid of either node -+# -+# -+ -+--source include/have_innodb.inc -+--source include/have_log_bin.inc -+--source include/galera_cluster.inc -+ -+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 -+--disable_query_log -+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$NODE_MYPORT_1; -+--enable_query_log -+START SLAVE USER='root'; -+ -+--connection node_1 -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES(1); -+ -+--let $effective_uuid = `SELECT LEFT(@@global.gtid_executed, 36)` -+--disable_query_log -+--eval SELECT '$effective_uuid' != @@global.server_uuid AS uuids_do_not_match; -+--enable_query_log -+ -+--replace_result $effective_uuid -+--replace_regex /table_id: [0-9]+/table_id: #/ /xid=[0-9]+/xid=#/ -+SHOW BINLOG EVENTS IN 'mysqld-bin.000002' FROM 120; -+ -+--connection node_2 -+INSERT INTO t1 VALUES(2); -+ -+--disable_query_log -+--eval SELECT '$effective_uuid' != @@global.server_uuid AS uuids_do_not_match; -+--eval SELECT '$effective_uuid' = LEFT(@@global.gtid_executed, 36) AS uuids_match; -+--enable_query_log -+ -+--replace_result $effective_uuid -+--replace_regex /table_id: [0-9]+/table_id: #/ /xid=[0-9]+/xid=#/ -+SHOW BINLOG EVENTS IN 'mysqld-bin.000003' FROM 120; -+ -+--connection node_3 -+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; -+--source include/wait_condition.inc -+ -+--let $wait_condition = SELECT COUNT(*) = 2 FROM t1; -+--source include/wait_condition.inc -+ -+--disable_query_log -+--eval SELECT '$effective_uuid' != @@global.server_uuid AS uuids_do_not_match; -+--eval SELECT '$effective_uuid' = LEFT(@@global.gtid_executed, 36) AS uuids_match; -+--enable_query_log -+ -+--replace_result $effective_uuid -+--replace_regex /table_id: [0-9]+/table_id: #/ /xid=[0-9]+/xid=#/ -+SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 120; -+ -+--connection node_1 -+DROP TABLE t1; -+ -+--connection node_3 -+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; -+--source include/wait_condition.inc -+ -+STOP SLAVE; -+RESET SLAVE ALL; -diff --git a/mysql-test/suite/galera/t/galera_as_master_gtid_change_master.cnf b/mysql-test/suite/galera/t/galera_as_master_gtid_change_master.cnf -new file mode 100644 -index 0000000..1951755 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_as_master_gtid_change_master.cnf -@@ -0,0 +1,8 @@ -+!include ../galera_2nodes_as_master.cnf -+ -+[mysqld] -+gtid-mode=ON -+log-bin=mysqld-bin -+log-slave-updates -+enforce-gtid-consistency -+binlog-format=ROW -diff --git a/mysql-test/suite/galera/t/galera_as_master_gtid_change_master.test b/mysql-test/suite/galera/t/galera_as_master_gtid_change_master.test -new file mode 100644 -index 0000000..23606d7 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_as_master_gtid_change_master.test -@@ -0,0 +1,54 @@ -+# -+# Test that a MySQL slave can use CHANGE MASTER MASTER_AUTO_POSITION to begin replicating -+# from another Galera node -+# -+# The galera/galera_2node_master.cnf describes the setup of the nodes -+# -+# -+ -+--source include/have_innodb.inc -+--source include/have_log_bin.inc -+--source include/galera_cluster.inc -+ -+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 -+--disable_query_log -+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$NODE_MYPORT_1; -+--enable_query_log -+START SLAVE USER='root'; -+ -+--connection node_1 -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES(1); -+ -+--connection node_2 -+INSERT INTO t1 VALUES(2); -+ -+--connection node_3 -+STOP SLAVE; -+--disable_query_log -+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$NODE_MYPORT_2, MASTER_AUTO_POSITION=1; -+--enable_query_log -+START SLAVE USER='root'; -+ -+--connection node_1 -+INSERT INTO t1 VALUES(3); -+ -+--connection node_2 -+INSERT INTO t1 VALUES(4); -+ -+--connection node_3 -+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; -+--source include/wait_condition.inc -+ -+--let $wait_condition = SELECT COUNT(*) = 4 FROM t1; -+--source include/wait_condition.inc -+ -+--connection node_1 -+DROP TABLE t1; -+ -+--connection node_3 -+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; -+--source include/wait_condition.inc -+ -+STOP SLAVE; -+RESET SLAVE ALL; -diff --git a/mysql-test/suite/galera/t/galera_as_slave.cnf b/mysql-test/suite/galera/t/galera_as_slave.cnf -new file mode 100644 -index 0000000..9449ec9 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_as_slave.cnf -@@ -0,0 +1 @@ -+!include ../galera_2nodes_as_slave.cnf -diff --git a/mysql-test/suite/galera/t/galera_as_slave.test b/mysql-test/suite/galera/t/galera_as_slave.test -new file mode 100644 -index 0000000..0f899fd ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_as_slave.test -@@ -0,0 +1,48 @@ -+# -+# Test Galera as a slave to a MySQL master -+# -+# The galera/galera_2node_slave.cnf describes the setup of the nodes -+# -+ -+--source include/have_innodb.inc -+--source include/have_log_bin.inc -+ -+# As node #1 is not a Galera node, we connect to node #2 in order to run include/galera_cluster.inc -+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2 -+--source include/galera_cluster.inc -+ -+--connection node_2 -+--disable_query_log -+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$NODE_MYPORT_1; -+--enable_query_log -+START SLAVE USER='root'; -+ -+--connection node_1 -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES(1); -+ -+--connection node_2 -+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; -+--source include/wait_condition.inc -+ -+--let $wait_condition = SELECT COUNT(*) = 1 FROM t1; -+--source include/wait_condition.inc -+ -+INSERT INTO t1 VALUES (2); -+ -+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 -+SELECT COUNT(*) = 2 FROM t1; -+INSERT INTO t1 VALUES (3); -+ -+--connection node_2 -+SELECT COUNT(*) = 3 FROM t1; -+ -+--connection node_1 -+DROP TABLE t1; -+ -+--connection node_2 -+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; -+--source include/wait_condition.inc -+ -+STOP SLAVE; -+RESET SLAVE ALL; -diff --git a/mysql-test/suite/galera/t/galera_as_slave_gtid.cnf b/mysql-test/suite/galera/t/galera_as_slave_gtid.cnf -new file mode 100644 -index 0000000..92f6a16 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_as_slave_gtid.cnf -@@ -0,0 +1,8 @@ -+!include ../galera_2nodes_as_slave.cnf -+ -+[mysqld] -+gtid-mode=ON -+log-bin=mysqld-bin -+log-slave-updates -+enforce-gtid-consistency -+binlog-format=ROW -diff --git a/mysql-test/suite/galera/t/galera_as_slave_gtid.test b/mysql-test/suite/galera/t/galera_as_slave_gtid.test -new file mode 100644 -index 0000000..02fe5f7 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_as_slave_gtid.test -@@ -0,0 +1,68 @@ -+# -+# Test Galera as a slave to a MySQL master using GTIDs -+# -+# suite/galera/galera_2nodes_as_slave.cnf describes the setup of the nodes -+# suite/galera/t/galera_as_slave_gtid.cnf has the GTID options -+# -+# In addition to performing DDL and DML, we check that the gtid of the master is preserved inside the cluster -+# -+ -+--source include/have_innodb.inc -+--source include/have_log_bin.inc -+ -+# As node #1 is not a Galera node, we connect to node #2 in order to run include/galera_cluster.inc -+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2 -+--source include/galera_cluster.inc -+ -+--connection node_2 -+--disable_query_log -+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$NODE_MYPORT_1; -+--enable_query_log -+START SLAVE USER='root'; -+ -+--connection node_1 -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES(1); -+ -+SELECT LENGTH(@@global.gtid_executed) > 1; -+--let $gtid_executed_node1 = `SELECT @@global.gtid_executed;` -+ -+--connection node_2 -+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; -+--source include/wait_condition.inc -+ -+--let $wait_condition = SELECT COUNT(*) = 1 FROM t1; -+--source include/wait_condition.inc -+ -+--disable_query_log -+--eval SELECT '$gtid_executed_node1' = @@global.gtid_executed AS gtid_executed_equal; -+--enable_query_log -+ -+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 -+SELECT COUNT(*) = 1 FROM t1; -+ -+--disable_query_log -+--eval SELECT '$gtid_executed_node1' = @@global.gtid_executed AS gtid_executed_equal; -+--enable_query_log -+ -+--connection node_1 -+DROP TABLE t1; -+ -+# -+# Unfortunately without the sleep below the following statement fails with "query returned no rows", which -+# is difficult to understand given that it is an aggregate query. A "query execution was interrupted" -+# warning is also reported by MTR, which is also weird. -+# -+ -+--sleep 1 -+ -+--connection node_3 -+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; -+--source include/wait_condition.inc -+ -+--connection node_2 -+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; -+--source include/wait_condition.inc -+ -+STOP SLAVE; -+RESET SLAVE ALL; -diff --git a/mysql-test/suite/galera/t/galera_bf_abort.test b/mysql-test/suite/galera/t/galera_bf_abort.test -new file mode 100644 -index 0000000..69825ea ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_bf_abort.test -@@ -0,0 +1,29 @@ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# Test a local transaction being aborted by a slave one -+# -+ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+ -+--connection node_2 -+--let $wsrep_local_bf_aborts_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'` -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES (1); -+ -+--connection node_1 -+INSERT INTO t1 VALUES (1); -+ -+--connection node_2 -+--error ER_LOCK_DEADLOCK -+INSERT INTO t1 VALUES (2); -+ -+--let $wsrep_local_bf_aborts_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'` -+ -+--disable_query_log -+--eval SELECT $wsrep_local_bf_aborts_after - $wsrep_local_bf_aborts_before = 1 AS wsrep_local_aborts_increment; -+--enable_query_log -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_bf_abort_for_update.test b/mysql-test/suite/galera/t/galera_bf_abort_for_update.test -new file mode 100644 -index 0000000..24c2977 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_bf_abort_for_update.test -@@ -0,0 +1,29 @@ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# Test a local transaction being aborted by a slave one while it is running a SELECT FOR UPDATE -+# -+ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+ -+--connection node_2 -+--let $wsrep_local_bf_aborts_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'` -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES (1); -+ -+--connection node_1 -+INSERT INTO t1 VALUES (1); -+ -+--connection node_2 -+--error ER_LOCK_DEADLOCK -+SELECT * FROM t1 FOR UPDATE; -+ -+--let $wsrep_local_bf_aborts_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'` -+ -+--disable_query_log -+--eval SELECT $wsrep_local_bf_aborts_after - $wsrep_local_bf_aborts_before = 1 AS wsrep_local_aborts_increment; -+--enable_query_log -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_bf_abort_ftwrl.test b/mysql-test/suite/galera/t/galera_bf_abort_ftwrl.test -new file mode 100644 -index 0000000..44398e7 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_bf_abort_ftwrl.test -@@ -0,0 +1,30 @@ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# A local transaction running FLUSH TABLES WITH READ LOCK will not be aborted by a slave transaction -+# -+ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+ -+--connection node_2 -+SET AUTOCOMMIT=OFF; -+--let $wsrep_local_bf_aborts_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'` -+--send FLUSH TABLES WITH READ LOCK; -+ -+--connection node_1 -+INSERT INTO t1 VALUES (1); -+ -+--connection node_2 -+--reap -+ -+UNLOCK TABLES; -+ -+--let $wsrep_local_bf_aborts_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'` -+ -+# No aborts should be registered on the counter -+--disable_query_log -+--eval SELECT $wsrep_local_bf_aborts_after - $wsrep_local_bf_aborts_before = 0 AS wsrep_local_aborts_increment; -+--enable_query_log -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_bf_abort_get_lock.test b/mysql-test/suite/galera/t/galera_bf_abort_get_lock.test -new file mode 100644 -index 0000000..72fc1c5 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_bf_abort_get_lock.test -@@ -0,0 +1,36 @@ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# Test a local transaction being aborted by a slave one while it is running a GET_LOCK() -+# -+ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+ -+--let $galera_connection_name = node_2a -+--let $galera_server_number = 2 -+--source include/galera_connect.inc -+--connection node_2a -+SELECT GET_LOCK("foo", 1000); -+ -+--connection node_2 -+SET AUTOCOMMIT=OFF; -+--let $wsrep_local_bf_aborts_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'` -+INSERT INTO t1 VALUES (1); -+--send SELECT GET_LOCK("foo", 1000); -+ -+--connection node_1 -+INSERT INTO t1 VALUES (1); -+ -+--connection node_2 -+--error ER_LOCK_DEADLOCK -+--reap -+ -+--let $wsrep_local_bf_aborts_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'` -+ -+# Check that wsrep_local_bf_aborts has been incremented by exactly 1 -+--disable_query_log -+--eval SELECT $wsrep_local_bf_aborts_after - $wsrep_local_bf_aborts_before = 1 AS wsrep_local_aborts_increment; -+--enable_query_log -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_bf_abort_lock_table.test b/mysql-test/suite/galera/t/galera_bf_abort_lock_table.test -new file mode 100644 -index 0000000..7884271 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_bf_abort_lock_table.test -@@ -0,0 +1,33 @@ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# Test that a local LOCK TABLE will be broken by an incoming remote transaction against that table -+# -+ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+ -+--connection node_2 -+SET AUTOCOMMIT=OFF; -+--let $wsrep_local_bf_aborts_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'` -+LOCK TABLE t1 WRITE; -+ -+# Issue a concurrent INSERT against the lock table that will block -+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2 -+--send INSERT INTO t1 VALUES (1); -+ -+--connection node_1 -+INSERT INTO t1 VALUES (2); -+ -+# The concurent insert is allowed to complete because the LOCK TABLE is now broken -+--connection node_2a -+--error 0 -+--reap -+ -+--let $wsrep_local_bf_aborts_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'` -+ -+--disable_query_log -+--eval SELECT $wsrep_local_bf_aborts_after - $wsrep_local_bf_aborts_before = 1 AS wsrep_local_aborts_increment; -+--enable_query_log -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_bf_abort_sleep.test b/mysql-test/suite/galera/t/galera_bf_abort_sleep.test -new file mode 100644 -index 0000000..8d135dc ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_bf_abort_sleep.test -@@ -0,0 +1,30 @@ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# Test a local transaction being aborted by a slave one while it is running a SLEEP() -+# -+ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+ -+--connection node_2 -+SET AUTOCOMMIT=OFF; -+--let $wsrep_local_bf_aborts_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'` -+INSERT INTO t1 VALUES (1); -+--send SELECT SLEEP(1000); -+ -+--connection node_1 -+INSERT INTO t1 VALUES (1); -+ -+--connection node_2 -+--error ER_LOCK_DEADLOCK -+--reap -+ -+--let $wsrep_local_bf_aborts_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_bf_aborts'` -+ -+# Check that wsrep_local_bf_aborts has been incremented by exactly 1 -+--disable_query_log -+--eval SELECT $wsrep_local_bf_aborts_after - $wsrep_local_bf_aborts_before = 1 AS wsrep_local_aborts_increment; -+--enable_query_log -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_binlog_cache_size.test b/mysql-test/suite/galera/t/galera_binlog_cache_size.test -new file mode 100644 -index 0000000..6ce9072 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_binlog_cache_size.test -@@ -0,0 +1,35 @@ -+# -+# Test that Galera, like the stock MySQL, returns an error on transactions -+# larger than max_binlog_cache_size -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TABLE t1 (f1 VARCHAR(767)) ENGINE=InnoDB; -+CREATE TABLE ten (f1 INTEGER); -+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); -+ -+--let $max_binlog_cache_size_orig = `SELECT @@max_binlog_cache_size` -+--let $binlog_cache_size_orig = `SELECT @@binlog_cache_size` -+ -+SET GLOBAL binlog_cache_size=4096; -+SET GLOBAL max_binlog_cache_size=4096; -+ -+--let $galera_connection_name = node_1a -+--let $galera_server_number = 1 -+--source include/galera_connect.inc -+--connection node_1a -+SET AUTOCOMMIT=ON; -+START TRANSACTION; -+INSERT INTO t1 SELECT REPEAT('a', 767) FROM ten; -+--error ER_TRANS_CACHE_FULL -+INSERT INTO t1 SELECT REPEAT('a', 767) FROM ten; -+ -+--disable_query_log -+--eval SET GLOBAL max_binlog_cache_size = $max_binlog_cache_size_orig -+--eval SET GLOBAL binlog_cache_size = $binlog_cache_size_orig -+--enable_query_log -+ -+DROP TABLE t1; -+DROP TABLE ten; -diff --git a/mysql-test/suite/galera/t/galera_binlog_checksum-master.opt b/mysql-test/suite/galera/t/galera_binlog_checksum-master.opt -new file mode 100644 -index 0000000..c8e53f0 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_binlog_checksum-master.opt -@@ -0,0 +1 @@ -+--binlog-checksum=CRC32 --master-verify-checksum=1 --slave-sql-verify-checksum=1 -diff --git a/mysql-test/suite/galera/t/galera_binlog_checksum.test b/mysql-test/suite/galera/t/galera_binlog_checksum.test -new file mode 100644 -index 0000000..4866930 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_binlog_checksum.test -@@ -0,0 +1,22 @@ -+# -+# Test that Galera works with binary log checksums. -+# The galera_binlog_checksum-master.opt file is used to enable checksums. -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB; -+ -+INSERT INTO t1 VALUES (1); -+ -+--connection node_2 -+SELECT COUNT(*) = 1 FROM t1; -+ -+--connection node_1 -+UPDATE t1 SET f1 = 2 WHERE f1 = 1; -+ -+--connection node_2 -+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_binlog_event_max_size_max-master.opt b/mysql-test/suite/galera/t/galera_binlog_event_max_size_max-master.opt -new file mode 100644 -index 0000000..a36d213 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_binlog_event_max_size_max-master.opt -@@ -0,0 +1 @@ -+--binlog-row-event-max-size=4294967295 -diff --git a/mysql-test/suite/galera/t/galera_binlog_event_max_size_max.test b/mysql-test/suite/galera/t/galera_binlog_event_max_size_max.test -new file mode 100644 -index 0000000..600432c ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_binlog_event_max_size_max.test -@@ -0,0 +1,20 @@ -+# -+# Test that replication works event with the maximum value of binlog-row-event-max-size - 4294967295 (on 32-bit platforms) -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TABLE ten (f1 INTEGER); -+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); -+ -+CREATE TABLE t1 (f1 VARCHAR(1000)); -+ -+# Insert 10K records, 1K bytes each -+INSERT INTO t1 SELECT REPEAT('x', 1000) FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4; -+ -+--connection node_2 -+SELECT COUNT(*) = 10000 FROM t1; -+ -+DROP TABLE t1; -+DROP TABLE ten; -diff --git a/mysql-test/suite/galera/t/galera_binlog_event_max_size_min-master.opt b/mysql-test/suite/galera/t/galera_binlog_event_max_size_min-master.opt -new file mode 100644 -index 0000000..2217475 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_binlog_event_max_size_min-master.opt -@@ -0,0 +1 @@ -+--binlog-row-event-max-size=256 -diff --git a/mysql-test/suite/galera/t/galera_binlog_event_max_size_min.test b/mysql-test/suite/galera/t/galera_binlog_event_max_size_min.test -new file mode 100644 -index 0000000..00b5533 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_binlog_event_max_size_min.test -@@ -0,0 +1,15 @@ -+# -+# Test that replication works event with the minimum value of binlog-row-event-max-size - 256 -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TABLE t1 (f1 VARCHAR(1000)); -+INSERT INTO t1 VALUES (REPEAT('x', 1000)); -+ -+--connection node_2 -+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = REPEAT('x', 1000); -+ -+DROP TABLE t1; -+ -diff --git a/mysql-test/suite/galera/t/galera_binlog_row_image.test b/mysql-test/suite/galera/t/galera_binlog_row_image.test -new file mode 100644 -index 0000000..70262ec ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_binlog_row_image.test -@@ -0,0 +1,100 @@ -+# -+# Test the operation on the different values of the binlog_row_image option -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# binlog_row_image = minimal -+# -+ -+--connection node_1 -+SET SESSION binlog_row_image=minimal; -+ -+# Create a table with a PK, with a unique key and with no key -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+CREATE TABLE t2 (f1 INTEGER NOT NULL UNIQUE) ENGINE=InnoDB; -+CREATE TABLE t3 (f1 VARCHAR(1)) ENGINE=InnoDB; -+ -+INSERT INTO t1 VALUES (1); -+INSERT INTO t2 VALUES (1); -+INSERT INTO t3 VALUES (1); -+ -+--connection node_2 -+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1; -+SELECT COUNT(*) = 1 FROM t2 WHERE f1 = 1; -+SELECT COUNT(*) = 1 FROM t3 WHERE f1 = 1; -+ -+--connection node_1 -+UPDATE t1 SET f1 = 2 WHERE f1 = 1; -+UPDATE t2 SET f1 = 2 WHERE f1 = 1; -+UPDATE t3 SET f1 = 2 WHERE f1 = 1; -+ -+--connection node_2 -+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; -+SELECT COUNT(*) = 1 FROM t2 WHERE f1 = 2; -+SELECT COUNT(*) = 1 FROM t3 WHERE f1 = 2; -+ -+--connection node_1 -+DELETE FROM t1; -+DELETE FROM t2; -+DELETE FROM t3; -+ -+--connection node_2 -+SELECT COUNT(*) = 0 FROM t1; -+SELECT COUNT(*) = 0 FROM t2; -+SELECT COUNT(*) = 0 FROM t3; -+ -+DROP TABLE t1; -+DROP TABLE t2; -+DROP TABLE t3; -+ -+# -+# binlog_row_image = noblob -+# -+ -+# A table with only a blob, and a table with a PK and a blob -+ -+--connection node_1 -+SET SESSION binlog_row_image=noblob; -+ -+CREATE TABLE t1 (f1 BLOB, f2 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+CREATE TABLE t2 (f1 BLOB) ENGINE=InnoDB; -+ -+INSERT INTO t1 VALUES ('abc', 1); -+INSERT INTO t2 VALUES ('abc'); -+ -+--connection node_2 -+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 'abc'; -+SELECT COUNT(*) = 1 FROM t2 WHERE f1 = 'abc'; -+ -+--connection node_1 -+UPDATE t1 SET f1 = 'xyz'; -+UPDATE t2 SET f1 = 'xyz'; -+ -+--connection node_2 -+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 'xyz'; -+SELECT COUNT(*) = 1 FROM t2 WHERE f1 = 'xyz'; -+ -+--connection node_1 -+UPDATE t1 SET f2 = 2 WHERE f2 = 1; -+ -+--connection node_2 -+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 2; -+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 'xyz'; -+ -+--connection node_1 -+DELETE FROM t1; -+DELETE FROM t2; -+ -+--connection node_2 -+SELECT COUNT(*) = 0 FROM t1; -+SELECT COUNT(*) = 0 FROM t2; -+ -+DROP TABLE t1; -+DROP TABLE t2; -+ -+ -+ -+ -diff --git a/mysql-test/suite/galera/t/galera_binlog_rows_query_log_events.test b/mysql-test/suite/galera/t/galera_binlog_rows_query_log_events.test -new file mode 100644 -index 0000000..95bc85c ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_binlog_rows_query_log_events.test -@@ -0,0 +1,28 @@ -+# -+# Test that Galera continues to run even with binlog-rows-query-log-events=TRUE -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--let $binlog_rows_query_log_events_orig = `SELECT @@binlog_rows_query_log_events` -+ -+SET GLOBAL binlog_rows_query_log_events=TRUE; -+ -+CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB; -+ -+INSERT INTO t1 VALUES (1); -+ -+--connection node_2 -+SELECT COUNT(*) = 1 FROM t1; -+ -+--connection node_1 -+UPDATE t1 SET f1 = 2 WHERE f1 = 1; -+ -+--connection node_2 -+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; -+ -+--connection node_1 -+--eval SET GLOBAL binlog_rows_query_log_events = $binlog_rows_query_log_events_orig -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_create_function.test b/mysql-test/suite/galera/t/galera_create_function.test -new file mode 100644 -index 0000000..fd4903a ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_create_function.test -@@ -0,0 +1,57 @@ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# Test CREATE FUNCTION -+# -+ -+--connection node_1 -+CREATE USER 'user1'; -+ -+CREATE -+DEFINER = 'user1' -+FUNCTION f1 (param INTEGER) -+RETURNS VARCHAR(200) -+COMMENT 'f1_comment' -+LANGUAGE SQL -+NOT DETERMINISTIC -+MODIFIES SQL DATA -+SQL SECURITY DEFINER -+RETURN 'abc'; -+GRANT EXECUTE ON FUNCTION f1 TO user1; -+ -+CREATE -+DEFINER = CURRENT_USER -+FUNCTION f2 (param VARCHAR(100)) -+RETURNS INTEGER -+DETERMINISTIC -+NO SQL -+SQL SECURITY INVOKER -+RETURN 123; -+ -+--connection node_1 -+SHOW CREATE FUNCTION f1; -+ -+--connection node_2 -+SHOW CREATE FUNCTION f1; -+ -+--connection node_1 -+SHOW CREATE FUNCTION f2; -+ -+--connection node_2 -+SHOW CREATE FUNCTION f2; -+ -+SELECT f1(1) = 'abc'; -+SELECT f2('abc') = 123; -+ -+--connection node_1 -+DROP FUNCTION f1; -+DROP FUNCTION f2; -+ -+DROP USER 'user1'; -+ -+ -+ -+ -+ -+ -diff --git a/mysql-test/suite/galera/t/galera_create_procedure.test b/mysql-test/suite/galera/t/galera_create_procedure.test -new file mode 100644 -index 0000000..30bc85f ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_create_procedure.test -@@ -0,0 +1,52 @@ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# Test CREATE PROCEDURE -+# -+ -+--connection node_1 -+CREATE USER 'user1'; -+CREATE TABLE t1 (f1 INTEGER); -+ -+CREATE -+DEFINER = 'user1' -+PROCEDURE p1 (IN param1 INTEGER, OUT param2 INTEGER, INOUT param3 INTEGER) -+COMMENT 'p1_comment' -+LANGUAGE SQL -+NOT DETERMINISTIC -+MODIFIES SQL DATA -+SQL SECURITY DEFINER -+INSERT INTO t1 VALUES (1); -+GRANT EXECUTE ON PROCEDURE p1 TO user1; -+ -+CREATE -+DEFINER = CURRENT_USER -+PROCEDURE p2 (param VARCHAR(100)) -+DETERMINISTIC -+NO SQL -+SQL SECURITY INVOKER BEGIN END ; -+ -+--connection node_1 -+SHOW CREATE PROCEDURE p1; -+ -+--connection node_2 -+# Perform causal wait -+SELECT 1 FROM DUAL; -+SHOW CREATE PROCEDURE p1; -+ -+--connection node_1 -+SHOW CREATE PROCEDURE p2; -+ -+--connection node_2 -+SHOW CREATE PROCEDURE p2; -+ -+CALL p1(@a, @b, @c); -+CALL p2('abc'); -+ -+--connection node_1 -+DROP PROCEDURE p1; -+DROP PROCEDURE p2; -+ -+DROP USER 'user1'; -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_create_table_like.test b/mysql-test/suite/galera/t/galera_create_table_like.test -new file mode 100644 -index 0000000..0e0e8b0 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_create_table_like.test -@@ -0,0 +1,50 @@ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# Test the various forms of CREATE TABLE LIKE ... , since Galera has special handling -+# for them, especially when one of the tables is a temporary one. -+# -+ -+CREATE SCHEMA schema1; -+CREATE SCHEMA schema2; -+ -+USE schema1; -+CREATE TABLE real_table (f1 INTEGER) ENGINE=InnoDB; -+CREATE TEMPORARY TABLE temp_table (f1 INTEGER) ENGINE=InnoDB; -+CREATE TABLE myisam_table (f1 INTEGER) ENGINE=MyISAM; -+ -+USE schema2; -+CREATE TABLE real_table1 LIKE schema1.real_table; -+CREATE TABLE real_table2 LIKE schema1.temp_table; -+CREATE TABLE real_table3 LIKE schema1.myisam_table; -+ -+CREATE TEMPORARY TABLE temp_table1 LIKE schema1.real_table; -+CREATE TEMPORARY TABLE temp_table2 LIKE schema1.temp_table; -+CREATE TEMPORARY TABLE temp_table3 LIKE schema1.myisam_table; -+ -+--connection node_2 -+# Only the non-temporary tables are replicated, regardless of the type of table they are based on -+ -+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'real_table' AND TABLE_SCHEMA = 'schema1'; -+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'myisam_table' AND TABLE_SCHEMA = 'schema1'; -+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'temp_table' AND TABLE_SCHEMA = 'schema1'; -+ -+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'real_table1' AND TABLE_SCHEMA = 'schema2'; -+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'real_table2' AND TABLE_SCHEMA = 'schema2'; -+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'real_table3' AND TABLE_SCHEMA = 'schema2'; -+ -+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'temp_table1' AND TABLE_SCHEMA = 'schema2'; -+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'temp_table2' AND TABLE_SCHEMA = 'schema2'; -+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'temp_table3' AND TABLE_SCHEMA = 'schema2'; -+ -+--connection node_1 -+DROP TABLE schema1.real_table; -+DROP TABLE schema1.myisam_table; -+ -+DROP TABLE schema2.real_table1; -+DROP TABLE schema2.real_table2; -+DROP TABLE schema2.real_table3; -+ -+DROP SCHEMA schema1; -+DROP SCHEMA schema2; -diff --git a/mysql-test/suite/galera/t/galera_create_trigger.test b/mysql-test/suite/galera/t/galera_create_trigger.test -new file mode 100644 -index 0000000..74dc616 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_create_trigger.test -@@ -0,0 +1,48 @@ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# Test CREATE TRIGGER, especially with different DEFINER -+# -+ -+CREATE TABLE definer_root (f1 INTEGER, trigger_user VARCHAR(100)) ENGINE=InnoDB; -+CREATE TABLE definer_user (f1 INTEGER, trigger_user VARCHAR(100)) ENGINE=InnoDB; -+CREATE TABLE definer_current_user (f1 INTEGER, trigger_user VARCHAR(100)) ENGINE=InnoDB; -+CREATE TABLE definer_default (f1 INTEGER, trigger_user VARCHAR(100)) ENGINE=InnoDB; -+ -+CREATE USER 'user1'; -+CREATE DEFINER=root@localhost TRIGGER definer_root BEFORE INSERT ON definer_root FOR EACH ROW SET NEW.trigger_user = CURRENT_USER(); -+CREATE DEFINER=user1 TRIGGER definer_user BEFORE INSERT ON definer_user FOR EACH ROW SET NEW.trigger_user = CURRENT_USER(); -+CREATE DEFINER=current_user TRIGGER definer_current_user BEFORE INSERT ON definer_current_user FOR EACH ROW SET NEW.trigger_user = CURRENT_USER(); -+CREATE TRIGGER definer_default BEFORE INSERT ON definer_default FOR EACH ROW SET NEW.trigger_user = CURRENT_USER(); -+ -+--connection node_2 -+INSERT INTO definer_root (f1) VALUES (1); -+SELECT DEFINER = 'root@localhost' FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME = 'definer_root'; -+SELECT trigger_user = 'root@localhost' FROM definer_root; -+ -+INSERT INTO definer_user (f1) VALUES (1); -+SELECT DEFINER = 'user1@%' FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME = 'definer_user'; -+SELECT trigger_user = 'user1@%' FROM definer_user; -+ -+INSERT INTO definer_current_user (f1) VALUES (1); -+SELECT DEFINER = 'root@localhost' FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME = 'definer_current_user'; -+SELECT trigger_user = 'root@localhost' FROM definer_current_user; -+ -+INSERT INTO definer_default (f1) VALUES (1); -+SELECT DEFINER = 'root@localhost' FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME = 'definer_default'; -+SELECT trigger_user = 'root@localhost' FROM definer_default; -+ -+--connection node_1 -+DROP TABLE definer_current_user; -+DROP TABLE definer_user; -+DROP TABLE definer_root; -+DROP TABLE definer_default; -+ -+DROP USER 'user1'; -+ -+ -+ -+ -+ -+ -diff --git a/mysql-test/suite/galera/t/galera_defaults.test b/mysql-test/suite/galera/t/galera_defaults.test -new file mode 100644 -index 0000000..25d85b7 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_defaults.test -@@ -0,0 +1,63 @@ -+# -+# The purpose of this test is to preserve the current state of the following: -+# * SHOW VARIABLES LIKE 'wsrep%' -+# * wsrep_provider_options -+# * The names of the Galera status variables -+# -+# This way, if there is any change, inadvertent or not, the test will fail and the -+# developer and QA will be alerted. -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# Global Variables -+ -+SELECT COUNT(*) = 40 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_%'; -+ -+SELECT VARIABLE_NAME, VARIABLE_VALUE -+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES -+WHERE VARIABLE_NAME LIKE 'wsrep_%' -+AND VARIABLE_NAME NOT IN ( -+ 'WSREP_PROVIDER_OPTIONS', -+ 'WSREP_SST_RECEIVE_ADDRESS', -+ 'WSREP_NODE_ADDRESS', -+ 'WSREP_NODE_NAME', -+ 'WSREP_PROVIDER', -+ 'WSREP_DATA_HOME_DIR', -+ 'WSREP_NODE_INCOMING_ADDRESS', -+ 'WSREP_START_POSITION' -+) -+ORDER BY VARIABLE_NAME; -+ -+# wsrep_provider_options -+# -+# We replace the ones that vary from run to run with placeholders -+ -+--let _WSREP_PROVIDER_OPTIONS = `SELECT @@wsrep_provider_options` -+--perl -+ use strict; -+ my $wsrep_provider_options = $ENV{'_WSREP_PROVIDER_OPTIONS'}; -+ $wsrep_provider_options =~ s/base_dir = .*?;/;/sgio; -+ $wsrep_provider_options =~ s/base_host = .*?;/;/sgio; -+ $wsrep_provider_options =~ s/base_port = .*?;/;/sgio; -+ $wsrep_provider_options =~ s/gcache\.dir = .*?;/;/sgio; -+ $wsrep_provider_options =~ s/gcache\.name = .*?;/;/sgio; -+ $wsrep_provider_options =~ s/gmcast\.listen_addr = .*?;/;/sgio; -+ $wsrep_provider_options =~ s/ist\.recv_addr = .*?;/;/sgio; -+ $wsrep_provider_options =~ s/evs\.evict = .*?;/;/sgio; -+ $wsrep_provider_options =~ s/signal = .*?;\s*//sgio; -+ $wsrep_provider_options =~ s/dbug = .*?;\s*//sgio; -+ print $wsrep_provider_options."\n"; -+EOF -+ -+# Global Status -+ -+SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS -+WHERE VARIABLE_NAME LIKE 'wsrep_%' -+AND VARIABLE_NAME != 'wsrep_debug_sync_waiters'; -+ -+SELECT VARIABLE_NAME FROM INFORMATION_SCHEMA.GLOBAL_STATUS -+WHERE VARIABLE_NAME LIKE 'wsrep_%' -+AND VARIABLE_NAME != 'wsrep_debug_sync_waiters' -+ORDER BY VARIABLE_NAME; -diff --git a/mysql-test/suite/galera/t/galera_delete_limit.test b/mysql-test/suite/galera/t/galera_delete_limit.test -new file mode 100644 -index 0000000..4cbadbd ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_delete_limit.test -@@ -0,0 +1,52 @@ -+# -+# DELETE LIMIT should not cause any issues with row-based Galera replication -+# regardless of the order in which the rows were deleted -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# With a PK -+# -+ -+--connection node_1 -+CREATE TABLE ten (f1 INTEGER) Engine=InnoDB; -+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); -+ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB; -+INSERT INTO t1 SELECT f1 FROM ten ORDER BY RAND(); -+ -+--connection node_2 -+DELETE FROM t1 ORDER BY RAND() LIMIT 5; -+--let $sum_remaining = `SELECT SUM(f1) FROM t1` -+--let $max_remaining = `SELECT MAX(f1) FROM t1` -+ -+--connection node_1 -+--disable_query_log -+--eval SELECT (SELECT SUM(f1) FROM t1) = $sum_remaining AS sum_matches; -+--eval SELECT f1 = $max_remaining AS max_matches FROM t1 WHERE f1 = $max_remaining; -+--enable_query_log -+ -+DROP TABLE t1; -+ -+# -+# Without a PK -+# -+ -+CREATE TABLE t2 (f1 INTEGER) Engine=InnoDB; -+INSERT INTO t2 SELECT f1 FROM ten ORDER BY RAND(); -+ -+--connection node_2 -+DELETE FROM t2 ORDER BY RAND() LIMIT 5; -+--let $sum_remaining = `SELECT SUM(f1) FROM t2` -+--let $max_remaining = `SELECT MAX(f1) FROM t2` -+ -+--connection node_1 -+--disable_query_log -+--eval SELECT (SELECT SUM(f1) FROM t2) = $sum_remaining AS sum_matches; -+--eval SELECT f1 = $max_remaining AS max_matches FROM t2 WHERE f1 = $max_remaining; -+--enable_query_log -+ -+DROP TABLE t2; -+DROP TABLE ten; -diff --git a/mysql-test/suite/galera/t/galera_enum.test b/mysql-test/suite/galera/t/galera_enum.test -new file mode 100644 -index 0000000..ff53324 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_enum.test -@@ -0,0 +1,62 @@ -+# -+# Test the ENUM column type, as it is frequently an unwanted child -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# ENUM as key -+# -+ -+--connection node_1 -+CREATE TABLE t1 (f1 ENUM('', 'one', 'two'), KEY (f1)) ENGINE=InnoDB; -+ -+INSERT INTO t1 VALUES (''); -+INSERT INTO t1 VALUES ('one'), ('two'); -+INSERT INTO t1 VALUES (0), (1), (2); -+ -+--connection node_2 -+SELECT COUNT(*) = 6 FROM t1; -+SELECT COUNT(*) = 2 FROM t1 where f1 = ''; -+SELECT COUNT(*) = 2 FROM t1 where f1 = 'one'; -+ -+DROP TABLE t1; -+ -+# -+# ENUM as PK -+# -+ -+--connection node_1 -+CREATE TABLE t1 (f1 ENUM('', 'one', 'two', 'three', 'four') PRIMARY KEY) ENGINE=InnoDB; -+ -+INSERT INTO t1 VALUES (''), ('one'), ('two'); -+ -+--connection node_2 -+SELECT COUNT(*) = 3 FROM t1; -+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = ''; -+ -+# Conflict -+ -+--connection node_1 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t1 SET f1 = 'three' where f1 = ''; -+ -+--connection node_2 -+SET AUTOCOMMIt=OFF; -+START TRANSACTION; -+UPDATE t1 SET f1 = 'four' where f1 = ''; -+ -+--connection node_1 -+COMMIT; -+ -+--connection node_2 -+--error ER_LOCK_DEADLOCK -+COMMIT; -+ -+--connection node_1 -+ -+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 'three'; -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_events.test b/mysql-test/suite/galera/t/galera_events.test -new file mode 100644 -index 0000000..ae9940f ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_events.test -@@ -0,0 +1,53 @@ -+# -+# Test that the replication of MySQL events conforms to the behavior of stock MySQL replication as described here -+# http://dev.mysql.com/doc/refman/5.6/en/replication-features-invoked.html -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--let $event_scheduler_orig = `SELECT @@event_scheduler;` -+ -+# -+# Events arrive on slave as SLAVESIDE_DISABLED -+# -+ -+--connection node_1 -+CREATE EVENT event1 ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT 1; -+ -+--connection node_2 -+SELECT DEFINER= 'root@localhost', ORIGINATOR = 1, STATUS = 'SLAVESIDE_DISABLED', EVENT_TYPE = 'ONE TIME', ON_COMPLETION = 'NOT PRESERVE' FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME = 'event1'; -+ -+--connection node_1 -+ALTER EVENT event1 DISABLE; -+ -+--connection node_2 -+# The definition on node 2 should still say SLAVESIDE_DISABLED -+SELECT DEFINER= 'root@localhost', ORIGINATOR = 1, STATUS = 'SLAVESIDE_DISABLED', EVENT_TYPE = 'ONE TIME', ON_COMPLETION = 'NOT PRESERVE' FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME = 'event1'; -+ -+# -+# Expired event should be dropped from the slave -+# -+ -+--connection node_2 -+SET GLOBAL event_scheduler = ON; -+CREATE EVENT event2 ON SCHEDULE AT CURRENT_TIMESTAMP ON COMPLETION NOT PRESERVE DO SELECT 1; -+--sleep 1 -+ -+--connection node_1 -+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME = 'event2'; -+ -+# -+# DROP EVENT causes event to be dropped everywhere -+# -+ -+--connection node_1 -+DROP EVENT event1; -+ -+--connection node_2 -+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME = 'event1'; -+ -+# Cleanup -+ -+--connection node_2 -+--eval SET GLOBAL event_scheduler = $event_scheduler_orig; -diff --git a/mysql-test/suite/galera/t/galera_fk_cascade_delete.test b/mysql-test/suite/galera/t/galera_fk_cascade_delete.test -new file mode 100644 -index 0000000..9b79b4c ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_fk_cascade_delete.test -@@ -0,0 +1,41 @@ -+# -+# Test Foreign Key Cascading DELETEs -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TABLE grandparent ( -+ id INT NOT NULL PRIMARY KEY -+) ENGINE=InnoDB; -+ -+CREATE TABLE parent ( -+ id INT NOT NULL PRIMARY KEY, -+ grandparent_id INT, -+ FOREIGN KEY (grandparent_id) -+ REFERENCES grandparent(id) -+ ON DELETE CASCADE -+) ENGINE=InnoDB; -+ -+CREATE TABLE child ( -+ id INT NOT NULL PRIMARY KEY, -+ parent_id INT, -+ FOREIGN KEY (parent_id) -+ REFERENCES parent(id) -+ ON DELETE CASCADE -+) ENGINE=InnoDB; -+ -+INSERT INTO grandparent VALUES (1),(2); -+INSERT INTO parent VALUES (1,1), (2,2); -+INSERT INTO child VALUES (1,1), (2,2); -+ -+--connection node_2 -+DELETE FROM grandparent WHERE id = 1; -+ -+--connection node_1 -+SELECT COUNT(*) = 0 FROM parent WHERE grandparent_id = 1; -+SELECT COUNT(*) = 0 FROM child WHERE parent_id = 1; -+ -+DROP TABLE child; -+DROP TABLE parent; -+DROP TABLE grandparent; -diff --git a/mysql-test/suite/galera/t/galera_fk_cascade_update.test b/mysql-test/suite/galera/t/galera_fk_cascade_update.test -new file mode 100644 -index 0000000..e736803 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_fk_cascade_update.test -@@ -0,0 +1,41 @@ -+# -+# Test Foreign Key Cascading UPDATEs -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TABLE grandparent ( -+ id INT NOT NULL PRIMARY KEY -+) ENGINE=InnoDB; -+ -+CREATE TABLE parent ( -+ id INT NOT NULL PRIMARY KEY, -+ grandparent_id INT, -+ FOREIGN KEY (grandparent_id) -+ REFERENCES grandparent(id) -+ ON UPDATE CASCADE -+) ENGINE=InnoDB; -+ -+CREATE TABLE child ( -+ id INT NOT NULL PRIMARY KEY, -+ grandparent_id INT, -+ FOREIGN KEY (grandparent_id) -+ REFERENCES parent(grandparent_id) -+ ON UPDATE CASCADE -+) ENGINE=InnoDB; -+ -+INSERT INTO grandparent VALUES (1),(2); -+INSERT INTO parent VALUES (1,1), (2,2); -+INSERT INTO child VALUES (1,1), (2,2); -+ -+--connection node_2 -+UPDATE grandparent SET id = 3 WHERE id = 1; -+ -+--connection node_1 -+SELECT COUNT(*) = 1 FROM parent WHERE grandparent_id = 3; -+SELECT COUNT(*) = 1 FROM child WHERE grandparent_id = 3; -+ -+DROP TABLE child; -+DROP TABLE parent; -+DROP TABLE grandparent; -diff --git a/mysql-test/suite/galera/t/galera_fk_conflict.test b/mysql-test/suite/galera/t/galera_fk_conflict.test -new file mode 100644 -index 0000000..cb6f95e ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_fk_conflict.test -@@ -0,0 +1,41 @@ -+# -+# Test two transactions on separate nodes which conflict on a FK -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TABLE parent ( -+ id INT PRIMARY KEY, -+ KEY (id) -+) ENGINE=InnoDB; -+ -+CREATE TABLE child ( -+ id INT PRIMARY KEY, -+ parent_id INT, -+ FOREIGN KEY (parent_id) -+ REFERENCES parent(id) -+) ENGINE=InnoDB; -+ -+INSERT INTO parent VALUES (1), (2); -+INSERT INTO child VALUES (1,1); -+ -+--connection node_1 -+SET AUTOCOMMIT = OFF; -+START TRANSACTION; -+DELETE FROM parent WHERE id = 2; -+ -+--connection node_2 -+SET AUTOCOMMIT = OFF; -+START TRANSACTION; -+INSERT INTO child VALUES (2, 2); -+ -+--connection node_1 -+COMMIT; -+ -+--connection node_2 -+--error ER_LOCK_DEADLOCK -+COMMIT; -+ -+DROP TABLE child; -+DROP TABLE parent; -diff --git a/mysql-test/suite/galera/t/galera_fk_mismatch.test b/mysql-test/suite/galera/t/galera_fk_mismatch.test -new file mode 100644 -index 0000000..bded413 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_fk_mismatch.test -@@ -0,0 +1,38 @@ -+# -+# Test the operation where the definition of the FK is different from the one of the underlying key -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TABLE parent ( -+ id1 INT, -+ id2 INT, -+ PRIMARY KEY (id1, id2) /* Multipart PK */ -+) ENGINE=InnoDB; -+ -+CREATE TABLE child ( -+ id INT PRIMARY KEY, -+ parent_id1 INT, -+ FOREIGN KEY (parent_id1) -+ REFERENCES parent(id1) /* FK is subset of PK above */ -+ ON UPDATE CASCADE -+ ON DELETE CASCADE -+) ENGINE=InnoDB; -+ -+INSERT INTO parent VALUES (1, 2); -+INSERT INTO child VALUES (1, 1); -+ -+--connection node_2 -+UPDATE parent SET id1 = 3 WHERE id1 = 1; -+ -+--connection node_1 -+SELECT COUNT(*) = 1 FROM child WHERE parent_id1 = 3; -+ -+DELETE FROM parent WHERE id1 = 3; -+ -+--connection node_2 -+SELECT COUNT(*) = 0 FROM child WHERE parent_id1 = 3; -+ -+DROP TABLE child; -+DROP TABLE parent; -diff --git a/mysql-test/suite/galera/t/galera_fk_multicolumn.test b/mysql-test/suite/galera/t/galera_fk_multicolumn.test -new file mode 100644 -index 0000000..ad42f65 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_fk_multicolumn.test -@@ -0,0 +1,42 @@ -+# -+# Test UPDATE on multiple columns with multiple FKs -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TABLE t0 ( -+ f1 INT PRIMARY KEY, -+ f2 INT UNIQUE -+); -+ -+CREATE TABLE t1 ( -+ f1 INT PRIMARY KEY, -+ FOREIGN KEY (f1) -+ REFERENCES t0(f1) -+ ON UPDATE CASCADE -+); -+ -+CREATE TABLE t2 ( -+ f2 INT PRIMARY KEY, -+ FOREIGN KEY (f2) -+ REFERENCES t0(f2) -+ ON UPDATE CASCADE -+); -+ -+INSERT INTO t0 VALUES (0, 0); -+INSERT INTO t1 VALUES (0); -+INSERT INTO t2 VALUES (0); -+ -+--connection node_2 -+UPDATE t0 SET f1 = 1, f2 = 2; -+ -+--connection node_1 -+SELECT f1 = 1 FROM t1 WHERE f1 = 1; -+SELECT f2 = 2 FROM t2 WHERE f2 = 2; -+SELECT f1 = 1 FROM t1; -+SELECT f2 = 2 FROM t2; -+ -+DROP TABLE t2; -+DROP TABLE t1; -+DROP TABLE t0; -diff --git a/mysql-test/suite/galera/t/galera_fk_multitable.test b/mysql-test/suite/galera/t/galera_fk_multitable.test -new file mode 100644 -index 0000000..6adfb81 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_fk_multitable.test -@@ -0,0 +1,32 @@ -+# -+# Test multi-table DELETE in the presence of FKs -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TABLE t0 ( -+ f0 INT PRIMARY KEY -+); -+ -+CREATE TABLE t1 ( -+ f1 INT PRIMARY KEY, -+ f0 INTEGER, -+ FOREIGN KEY (f0) -+ REFERENCES t0(f0) -+ ON DELETE CASCADE -+); -+ -+INSERT INTO t0 VALUES (0), (1); -+INSERT INTO t1 VALUES (0, 0); -+INSERT INTO t1 VALUES (1, 0); -+ -+--connection node_2 -+DELETE t0.*, t1.* FROM t0, t1 WHERE t0.f0 = 0 AND t1.f1 = 0; -+ -+--connection node_1 -+SELECT COUNT(*) = 1 FROM t0; -+SELECT COUNT(*) = 0 FROM t1; -+ -+DROP TABLE t1; -+DROP TABLE t0; -diff --git a/mysql-test/suite/galera/t/galera_fk_no_pk.test b/mysql-test/suite/galera/t/galera_fk_no_pk.test -new file mode 100644 -index 0000000..d1f9c26 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_fk_no_pk.test -@@ -0,0 +1,37 @@ -+# -+# Test foreign keys if no PK is present -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TABLE parent ( -+ id INT, -+ KEY (id) -+) ENGINE=InnoDB; -+ -+CREATE TABLE child ( -+ id INT, -+ parent_id INT, -+ FOREIGN KEY (parent_id) -+ REFERENCES parent(id) -+ ON UPDATE CASCADE -+ ON DELETE CASCADE -+) ENGINE=InnoDB; -+ -+INSERT INTO parent VALUES (1), (1), (2), (2); -+INSERT INTO child VALUES (1,1), (2,2), (1,1), (2,2); -+ -+--connection node_2 -+DELETE FROM parent WHERE id = 1; -+SELECT COUNT(*) = 0 FROM child WHERE id = 1; -+ -+--connection node_1 -+UPDATE parent SET id = 3 WHERE id = 2; -+ -+--connection node_2 -+SELECT COUNT(*) = 0 FROM child WHERE parent_id = 1; -+SELECT parent_id = 3 FROM child WHERE id = 2; -+ -+DROP TABLE child; -+DROP TABLE parent; -diff --git a/mysql-test/suite/galera/t/galera_fk_selfreferential.test b/mysql-test/suite/galera/t/galera_fk_selfreferential.test -new file mode 100644 -index 0000000..e2c1900 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_fk_selfreferential.test -@@ -0,0 +1,24 @@ -+# -+# Test self-referential foreign keys -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TABLE t1 ( -+ f1 INT NOT NULL PRIMARY KEY, -+ f2 INT, -+ FOREIGN KEY (f2) -+ REFERENCES t1(f1) -+ ON DELETE CASCADE -+) ENGINE=InnoDB; -+ -+INSERT INTO t1 VALUES (1, 1), (2, 1); -+ -+--connection node_2 -+DELETE FROM t1 WHERE f1 = 1; -+ -+--connection node_1 -+SELECT COUNT(*) = 0 FROM t1; -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_fk_setnull.test b/mysql-test/suite/galera/t/galera_fk_setnull.test -new file mode 100644 -index 0000000..46ba82d ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_fk_setnull.test -@@ -0,0 +1,36 @@ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TABLE parent ( -+ id INT NOT NULL, -+ PRIMARY KEY (id) -+) ENGINE=InnoDB; -+ -+CREATE TABLE child ( -+ id INT, -+ parent_id INT, -+ FOREIGN KEY (parent_id) -+ REFERENCES parent(id) -+ ON UPDATE SET NULL -+ ON DELETE SET NULL -+) ENGINE=InnoDB; -+ -+INSERT INTO parent VALUES (1),(2); -+INSERT INTO child VALUES (1,1),(2,2); -+ -+--connection node_2 -+DELETE FROM parent WHERE id = 1; -+SELECT parent_id IS NULL FROM child WHERE id = 1; -+ -+--connection node_1 -+SELECT parent_id IS NULL FROM child WHERE id = 1; -+ -+UPDATE parent SET id = 3 WHERE id = 2; -+SELECT parent_id IS NULL FROM child WHERE id = 2; -+ -+--connection node_2 -+SELECT parent_id IS NULL FROM child WHERE id = 2; -+ -+--connection node_1 -+DROP TABLE child; -+DROP TABLE parent; -diff --git a/mysql-test/suite/galera/t/galera_ftwrl.test b/mysql-test/suite/galera/t/galera_ftwrl.test -new file mode 100644 -index 0000000..db9bd13 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_ftwrl.test -@@ -0,0 +1,39 @@ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# At this time, issing a FLUSH TABLES WITH READ LOCK causes SELECT and SHOW to hang if -+# casuality can not be ensured because another node issued a statement in the meantime -+# which could not be applied because FTWRL blocks the applier as well -+# -+# See LP bug 1271177 -+# -+ -+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; -+ -+--connection node_2 -+--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options;` -+SET GLOBAL wsrep_provider_options = "repl.causal_read_timeout=PT1S"; -+FLUSH TABLES WITH READ LOCK; -+ -+--connection node_1 -+INSERT INTO t1 VALUES (1); -+ -+--connection node_2 -+--error ER_LOCK_WAIT_TIMEOUT -+SHOW TABLES; -+ -+--error ER_LOCK_WAIT_TIMEOUT -+SELECT * FROM t1; -+ -+UNLOCK TABLES; -+ -+SHOW TABLES; -+SELECT COUNT(*) = 1 FROM t1; -+ -+--disable_query_log -+--eval SET GLOBAL wsrep_provider_options = "$wsrep_provider_options_orig"; -+--enable_query_log -+ -+DROP TABLE t1; -+ -diff --git a/mysql-test/suite/galera/t/galera_fulltext.test b/mysql-test/suite/galera/t/galera_fulltext.test -new file mode 100644 -index 0000000..aa93a33 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_fulltext.test -@@ -0,0 +1,62 @@ -+--source include/big_test.inc -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# InnoDB FULLTEXT indexes -+# -+ -+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); -+ -+# -+# Fulltext index creation causes the creation of multiple system tables -+# -+ -+--connection node_1 -+CREATE TABLE t1 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 VARCHAR(100), FULLTEXT (f2)) ENGINE=InnoDB; -+ -+--connection node_2 -+SELECT COUNT(*) = 13 FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE name LIKE 'test/%'; -+ -+# -+# Fulltext insertion causes a flurry of updates on those system tables -+# -+ -+--connection node_1 -+# Insert 10K rows -+INSERT INTO t1 (f2) SELECT 'foobarbaz' FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4; -+ -+--connection node_2 -+SELECT COUNT(f2) = 10000 FROM t1 WHERE MATCH(f2) AGAINST ('foobarbaz'); -+ -+UPDATE t1 SET f2 = 'abcdefjhk'; -+ -+--connection node_1 -+SELECT COUNT(f2) = 10000 FROM t1 WHERE MATCH(f2) AGAINST ('abcdefjhk'); -+ -+--connection node_2 -+ -+DROP TABLE t1; -+ -+# -+# Same on a table with no PK -+# -+ -+--connection node_1 -+CREATE TABLE t1 (f1 VARCHAR(100), FULLTEXT (f1)) ENGINE=InnoDB; -+ -+--connection node_2 -+# We insert only 1K rows here, because updates without a PK are very slow -+INSERT INTO t1 (f1) SELECT 'foobarbaz' FROM ten AS a1, ten AS a2, ten AS a3; -+ -+--connection node_1 -+SELECT COUNT(f1) = 1000 FROM t1 WHERE MATCH(f1) AGAINST ('foobarbaz'); -+ -+UPDATE t1 SET f1 = 'abcdefjhk'; -+ -+--connection node_2 -+SELECT COUNT(f1) = 1000 FROM t1 WHERE MATCH(f1) AGAINST ('abcdefjhk'); -+ -+DROP TABLE t1; -+DROP TABLE ten; -diff --git a/mysql-test/suite/galera/t/galera_gcs_fc_limit.test b/mysql-test/suite/galera/t/galera_gcs_fc_limit.test -new file mode 100644 -index 0000000..e15da0e ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_gcs_fc_limit.test -@@ -0,0 +1,52 @@ -+# -+# Test that under gcs.fc_limit=1 on the slave, transactions on the master can not commit. -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+ -+--connection node_2 -+--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options` -+SET GLOBAL wsrep_provider_options = 'gcs.fc_limit=1'; -+ -+# Block the slave applier thread -+FLUSH TABLES WITH READ LOCK; -+ -+--connection node_1 -+ -+INSERT INTO t1 VALUES (2); -+INSERT INTO t1 VALUES (3); -+INSERT INTO t1 VALUES (4); -+ -+# This query will hang because flow control will kick in -+--send -+INSERT INTO t1 VALUES (5); -+--sleep 1 -+ -+--let $galera_connection_name = node_1a -+--let $galera_server_number = 1 -+--source include/galera_connect.inc -+--connection node_1a -+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE = 'query end' AND INFO = 'INSERT INTO t1 VALUES (5)'; -+ -+--connection node_2 -+# Unblock the slave applier thread -+UNLOCK TABLES; -+ -+--connection node_1 -+--reap -+ -+INSERT INTO t1 VALUES (6); -+ -+--connection node_2 -+# Replication catches up and continues normally -+SELECT COUNT(*) = 6 FROM t1; -+ -+--disable_query_log -+--eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_orig'; -+--enable_query_log -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_gcs_max_packet_size.cnf b/mysql-test/suite/galera/t/galera_gcs_max_packet_size.cnf -new file mode 100644 -index 0000000..aae3fee ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_gcs_max_packet_size.cnf -@@ -0,0 +1,5 @@ -+!include ../galera_2nodes.cnf -+[mysqld.1] -+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcs.max_packet_size=64' -+[mysqld.2] -+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcs.max_packet_size=64' -diff --git a/mysql-test/suite/galera/t/galera_gcs_max_packet_size.test b/mysql-test/suite/galera/t/galera_gcs_max_packet_size.test -new file mode 100644 -index 0000000..cafd8ac ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_gcs_max_packet_size.test -@@ -0,0 +1,25 @@ -+# -+# Test fragmentation by setting gcs.max_packet_size to a low value -+# The actual setting is performed in galera_gcs_max_packet_size.cnf -+# as gcs.max_packet_size is not a dynamic variable -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TABLE ten (f1 INTEGER); -+INSERT INTO ten VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); -+ -+CREATE TABLE t1 (f1 INT PRIMARY KEY AUTO_INCREMENT, f2 INTEGER) ENGINE=InnoDB; -+CREATE TABLE t2 (f1 VARCHAR(512) UNIQUE) ENGINE=InnoDB; -+ -+INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4; -+INSERT INTO t2 VALUES (REPEAT('x', 512)); -+ -+--connection node_2 -+SELECT COUNT(*) = 10000 FROM t1; -+SELECT LENGTH(f1) = 512 FROM t2 WHERE f1 = REPEAT('x', 512); -+ -+DROP TABLE t1; -+DROP TABLE t2; -+DROP TABLE ten; -diff --git a/mysql-test/suite/galera/t/galera_gtid-master.opt b/mysql-test/suite/galera/t/galera_gtid-master.opt -new file mode 100644 -index 0000000..48e46d7 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_gtid-master.opt -@@ -0,0 +1 @@ -+--gtid-mode=ON --log-bin --log-slave-updates --enforce-gtid-consistency -diff --git a/mysql-test/suite/galera/t/galera_gtid.test b/mysql-test/suite/galera/t/galera_gtid.test -new file mode 100644 -index 0000000..97e7d1f ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_gtid.test -@@ -0,0 +1,27 @@ -+# -+# Test basic Galera operation under --gtid-mode=ON -+# -+ -+--source include/have_log_bin.inc -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TABLE t1 (f1 INT PRIMARY KEY); -+ -+INSERT INTO t1 VALUES (1); -+ -+--connection node_2 -+SELECT COUNT(*) = 1 FROM t1; -+ -+UPDATE t1 SET f1 = 2; -+ -+--let $gtid_executed_node2 = `SELECT @@global.gtid_executed;` -+ -+--connection node_1 -+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; -+ -+--disable_query_log -+--eval SELECT '$gtid_executed_node2' = @@global.gtid_executed AS gtid_executed_equal; -+--enable_query_log -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_insert_ignore.test b/mysql-test/suite/galera/t/galera_insert_ignore.test -new file mode 100644 -index 0000000..4b4b0a6 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_insert_ignore.test -@@ -0,0 +1,60 @@ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--let $wsrep_sync_wait_orig = (SELECT @@wsrep_sync_wait) -+SET GLOBAL wsrep_sync_wait = 7; -+ -+--connection node_2 -+SET GLOBAL wsrep_sync_wait = 7; -+ -+ -+# -+# INSERT IGNORE with PRIMARY KEY -+# -+ -+--connection node_1 -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+ -+INSERT IGNORE INTO t1 VALUES (1), (2); -+SELECT * FROM t1; -+ -+--connection node_2 -+SELECT * FROM t1; -+ -+# -+# INSERT IGNORE ... SELECT -+# -+ -+--connection node_2 -+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO t2 VALUES (0), (2), (3); -+INSERT IGNORE INTO t1 SELECT f1 FROM t2; -+ -+SELECT * FROM t1; -+--connection node_1 -+SELECT * FROM t1; -+ -+# -+# INSERT IGNORE with UNIQUE + NULLs -+# -+ -+--connection node_2 -+CREATE TABLE t3 (f1 INTEGER UNIQUE) Engine=InnoDB; -+INSERT INTO t3 VALUES (NULL); -+ -+--connection node_1 -+INSERT IGNORE INTO t3 VALUES (1), (NULL), (2); -+SELECT * FROM t3; -+ -+--connection node_2 -+SELECT * FROM t3; -+ -+--eval SET GLOBAL wsrep_sync_wait = $wsrep_sync_wait_orig -+ -+--connection node_1 -+DROP TABLE t1; -+DROP TABLE t2; -+DROP TABLE t3; -+--eval SET GLOBAL wsrep_sync_wait = $wsrep_sync_wait_orig -+ -diff --git a/mysql-test/suite/galera/t/galera_insert_multi.test b/mysql-test/suite/galera/t/galera_insert_multi.test -new file mode 100644 -index 0000000..d62283a ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_insert_multi.test -@@ -0,0 +1,122 @@ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# Multi-row INSERT with a PK -+# -+ -+--connection node_1 -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1),(2); -+ -+--connection node_2 -+INSERT INTO t1 VALUES (3),(4); -+ -+--connection node_1 -+SELECT COUNT(*) = 4 FROM t1; -+ -+--connection node_2 -+SELECT COUNT(*) = 4 FROM t1; -+ -+DROP TABLE t1; -+ -+# -+# Multi-row INSERT without a PK -+# -+ -+--connection node_2 -+CREATE TABLE t1 (f1 INTEGER, KEY (f1)) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1),(1); -+ -+--connection node_1 -+INSERT INTO t1 VALUES (2),(2); -+ -+--connection node_2 -+SELECT COUNT(*) = 4 FROM t1; -+ -+--connection node_1 -+SELECT COUNT(*) = 4 FROM t1; -+ -+DROP TABLE t1; -+ -+# -+# Error in the middle of a multi-row INSERT -+# -+ -+--connection node_1 -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+ -+--error ER_DUP_ENTRY -+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (1); -+ -+SELECT COUNT(*) = 0 FROM t1; -+ -+--connection node_2 -+SELECT COUNT(*) = 0 FROM t1; -+ -+DROP TABLE t1; -+ -+# -+# Deadlock -+# -+ -+--connection node_1 -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+ -+SET AUTOCOMMIT = OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES (1), (2); -+ -+--connection node_2 -+SET AUTOCOMMIT = OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES (2), (1); -+ -+--connection node_1 -+COMMIT; -+ -+--connection node_2 -+--error ER_LOCK_DEADLOCK -+COMMIT; -+ -+# Workaround for mysql-wsrep#39 Transaction receives deadlock error twice in row -+--error 0,ER_LOCK_DEADLOCK -+ROLLBACK; -+ -+--error ER_DUP_ENTRY -+INSERT INTO t1 VALUES (1), (2); -+ -+DROP TABLE t1; -+ -+# -+# Rollback -+# -+ -+--connection node_1 -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+ -+START TRANSACTION; -+INSERT INTO t1 VALUES (1), (2); -+ -+--connection node_2 -+START TRANSACTION; -+INSERT INTO t1 VALUES (2), (1); -+ -+--connection node_1 -+ROLLBACK; -+ -+--connection node_2 -+COMMIT; -+SELECT COUNT(*) = 2 FROM t1; -+ -+--connection node_1 -+SELECT COUNT(*) = 2 FROM t1; -+ -+DROP TABLE t1; -+ -+ -+ -+ -+ -+ -+ -diff --git a/mysql-test/suite/galera/t/galera_ist_innodb_flush_logs.cnf b/mysql-test/suite/galera/t/galera_ist_innodb_flush_logs.cnf -new file mode 100644 -index 0000000..85245ff ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_ist_innodb_flush_logs.cnf -@@ -0,0 +1,12 @@ -+!include ../galera_2nodes.cnf -+ -+[mysqld] -+wsrep_sst_method=xtrabackup-v2 -+innodb_flush_log_at_trx_commit=0 -+ -+[mysqld.1] -+wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true' -+ -+[mysqld.2] -+wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true' -+ -diff --git a/mysql-test/suite/galera/t/galera_ist_innodb_flush_logs.test b/mysql-test/suite/galera/t/galera_ist_innodb_flush_logs.test -new file mode 100644 -index 0000000..0783870 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_ist_innodb_flush_logs.test -@@ -0,0 +1,12 @@ -+# -+# This test performs server kill and IST while innodb_flush_logs_on_trx_commit = 0 -+# This confirms that IST can properly catch up even in the face of relaxed single-node durability -+# -+# -+ -+--source include/big_test.inc -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--source suite/galera/include/galera_st_kill_slave.inc -+--source suite/galera/include/galera_st_kill_slave_ddl.inc -diff --git a/mysql-test/suite/galera/t/galera_ist_mysqldump.cnf b/mysql-test/suite/galera/t/galera_ist_mysqldump.cnf -new file mode 100644 -index 0000000..db6b7d5 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_ist_mysqldump.cnf -@@ -0,0 +1,11 @@ -+!include ../galera_2nodes.cnf -+ -+# We do not set mysqldump-related SST options here because doing so on startup -+# causes the first MTR connection to be forefully dropped by Galera, which in turn confuses MTR -+ -+[mysqld.1] -+wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true' -+ -+[mysqld.2] -+wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true' -+ -diff --git a/mysql-test/suite/galera/t/galera_ist_mysqldump.test b/mysql-test/suite/galera/t/galera_ist_mysqldump.test -new file mode 100644 -index 0000000..a9ff8c4 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_ist_mysqldump.test -@@ -0,0 +1,17 @@ -+--source include/big_test.inc -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--source suite/galera/include/galera_sst_set_mysqldump.inc -+ -+# mysql-wsrep#33 - nnoDB: Failing assertion: xid_seqno > trx_sys_cur_xid_seqno in trx_sys_update_wsrep_checkpoint with mysqldump IST -+# --source suite/galera/include/galera_st_disconnect_slave.inc -+ -+# We set the required mysqldump SST options here so that they are used every time the server is restarted during the test -+--let $start_mysqld_params = --wsrep_sst_auth=sst:sst --wsrep_sst_method=mysqldump --wsrep-sst-receive-address=127.0.0.1:$NODE_MYPORT_2 --skip-grant-tables -+ -+--source suite/galera/include/galera_st_shutdown_slave.inc -+--source suite/galera/include/galera_st_kill_slave.inc -+--source suite/galera/include/galera_st_kill_slave_ddl.inc -+ -+--source suite/galera/include/galera_sst_restore.inc -diff --git a/mysql-test/suite/galera/t/galera_ist_restart_joiner.cnf b/mysql-test/suite/galera/t/galera_ist_restart_joiner.cnf -new file mode 100644 -index 0000000..10958aa ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_ist_restart_joiner.cnf -@@ -0,0 +1,4 @@ -+!include ../galera_2nodes.cnf -+ -+[mysqld.1] -+wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true' -diff --git a/mysql-test/suite/galera/t/galera_ist_restart_joiner.test b/mysql-test/suite/galera/t/galera_ist_restart_joiner.test -new file mode 100644 -index 0000000..69446f0 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_ist_restart_joiner.test -@@ -0,0 +1,106 @@ -+# -+# Test that a joiner performing IST can be killed and restarted with no adverse consequences. -+# This is achieved by using the recv_IST_after_apply_trx Galera dbug sync point to block IST after -+# one transaction has been applied. When IST blocks, we kill and restart the joiner -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+--source include/have_debug_sync.inc -+--source suite/galera/include/galera_have_debug_sync.inc -+ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)); -+INSERT INTO t1 VALUES (1, 'a'), (2, 'a'), (3, 'a'), (4, 'a'), (5, 'a'),(6, 'a'); -+ -+# Disconnect node #2 -+--connection node_2 -+--source suite/galera/include/galera_unload_provider.inc -+ -+--connection node_1 -+UPDATE t1 SET f2 = 'b' WHERE f1 > 1; -+ -+# Wait until node #1 has left -+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' -+--source include/wait_condition.inc -+ -+UPDATE t1 SET f2 = 'c' WHERE f1 > 2; -+ -+--connection node_2 -+# Make sure IST will block ... -+SET GLOBAL wsrep_provider_options = 'dbug=d,recv_IST_after_apply_trx'; -+SET SESSION wsrep_sync_wait = 0; -+ -+ -+# Write file to make mysql-test-run.pl expect the crash, but don't start it -+--let $_server_id= `SELECT @@server_id` -+--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect -+--exec echo "wait" > $_expect_file_name -+ -+--let KILL_NODE_PIDFILE = `SELECT @@pid_file` -+ -+# ... and restart provider to force IST -+--echo Loading wsrep_provider ... -+--disable_query_log -+--eval SET GLOBAL wsrep_provider = '$wsrep_provider_orig'; -+--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig'; -+--enable_query_log -+ -+# We can not use a wait_condition on SELECT * FROM INFORMATION_SCHEMA.GLOBAL_STATUS as such queries are blocked during IST -+# so we perform a simple sleep and SHOW instead -+ -+--sleep 5 -+SHOW STATUS LIKE 'wsrep_debug_sync_waiters'; -+ -+--connection node_1 -+# Perform DML and DDL while IST is in progress -+--connection node_1 -+UPDATE t1 SET f2 = 'd' WHERE f1 > 3; -+CREATE TABLE t2 (f1 INTEGER); -+ -+# Kill node #2 while IST is in progress -+--connection node_2 -+ -+# Kill the connected server -+--disable_reconnect -+ -+--perl -+ my $pid_filename = $ENV{'KILL_NODE_PIDFILE'}; -+ my $mysqld_pid = `cat $pid_filename`; -+ chomp($mysqld_pid); -+ system("kill -9 $mysqld_pid"); -+ exit(0); -+EOF -+ -+--source include/wait_until_disconnected.inc -+ -+--connection node_1 -+--source include/wait_until_connected_again.inc -+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' -+--source include/wait_condition.inc -+ -+# Perform DML and DDL while node #2 is down -+UPDATE t1 SET f2 = 'e' WHERE f1 > 4; -+CREATE TABLE t3 (f1 INTEGER); -+ -+--connection node_2 -+ -+--let $galera_wsrep_recover_server_id=2 -+--source suite/galera/include/galera_wsrep_recover.inc -+ -+--echo Starting server ... -+--source include/start_mysqld.inc -+ -+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' -+--source include/wait_condition.inc -+ -+--connection node_1 -+UPDATE t1 SET f2 = 'f' WHERE f1 > 5; -+SELECT * FROM t1; -+ -+--connection node_2 -+SELECT * FROM t1; -+SELECT COUNT(*) = 0 FROM t2; -+SELECT COUNT(*) = 0 FROM t3; -+ -+--connection node_1 -+DROP TABLE t1, t2, t3; -diff --git a/mysql-test/suite/galera/t/galera_ist_rsync.cnf b/mysql-test/suite/galera/t/galera_ist_rsync.cnf -new file mode 100644 -index 0000000..bbe0f60 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_ist_rsync.cnf -@@ -0,0 +1,11 @@ -+!include ../galera_2nodes.cnf -+ -+[mysqld] -+wsrep_sst_method=rsync -+ -+[mysqld.1] -+wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true' -+ -+[mysqld.2] -+wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true' -+ -diff --git a/mysql-test/suite/galera/t/galera_ist_rsync.test b/mysql-test/suite/galera/t/galera_ist_rsync.test -new file mode 100644 -index 0000000..41d1a0c ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_ist_rsync.test -@@ -0,0 +1,8 @@ -+--source include/big_test.inc -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--source suite/galera/include/galera_st_disconnect_slave.inc -+--source suite/galera/include/galera_st_shutdown_slave.inc -+--source suite/galera/include/galera_st_kill_slave.inc -+--source suite/galera/include/galera_st_kill_slave_ddl.inc -diff --git a/mysql-test/suite/galera/t/galera_ist_xtrabackup-v2.cnf b/mysql-test/suite/galera/t/galera_ist_xtrabackup-v2.cnf -new file mode 100644 -index 0000000..21e5974 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_ist_xtrabackup-v2.cnf -@@ -0,0 +1,11 @@ -+!include ../galera_2nodes.cnf -+ -+[mysqld] -+wsrep_sst_method=xtrabackup-v2 -+ -+[mysqld.1] -+wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true' -+ -+[mysqld.2] -+wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true' -+ -diff --git a/mysql-test/suite/galera/t/galera_ist_xtrabackup-v2.test b/mysql-test/suite/galera/t/galera_ist_xtrabackup-v2.test -new file mode 100644 -index 0000000..8b399e7 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_ist_xtrabackup-v2.test -@@ -0,0 +1,9 @@ -+--source include/big_test.inc -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--source suite/galera/include/galera_st_disconnect_slave.inc -+--source suite/galera/include/galera_st_shutdown_slave.inc -+ -+--source suite/galera/include/galera_st_kill_slave.inc -+--source suite/galera/include/galera_st_kill_slave_ddl.inc -diff --git a/mysql-test/suite/galera/t/galera_kill_ddl.test b/mysql-test/suite/galera/t/galera_kill_ddl.test -new file mode 100644 -index 0000000..3c2bce5 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_kill_ddl.test -@@ -0,0 +1,39 @@ -+# -+# This test kill -9-s a slave while small updates have been performed on the master. -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--connection node_1 -+ -+# Enable the master to continue running during the split-brain situation that -+# occurs when the slave is killed -+--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options` -+SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true'; -+ -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+ -+--connection node_2 -+--source include/kill_galera.inc -+ -+--connection node_1 -+ALTER TABLE t1 ADD COLUMN f2 INTEGER; -+ -+--connection node_2 -+--source include/start_mysqld.inc -+ -+--let $galera_connection_name = node_2a -+--let $galera_server_number = 2 -+--source include/galera_connect.inc -+--connection node_2a -+ -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='t1'; -+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+ -+--connection node_1 -+--disable_query_log -+--eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_orig'; -+--enable_query_log -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_kill_largechanges.test b/mysql-test/suite/galera/t/galera_kill_largechanges.test -new file mode 100644 -index 0000000..e9a32ce ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_kill_largechanges.test -@@ -0,0 +1,43 @@ -+# -+# This test kill -9-s a slave while a large update has been performed on the master. SST is performed. -+# -+ -+--source include/big_test.inc -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--connection node_1 -+# Enable the master to continue running during the split-brain situation that -+# occurs when the slave is killed -+--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options` -+SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true'; -+ -+CREATE TABLE ten (f1 INTEGER); -+INSERT INTO ten VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); -+CREATE TABLE t1 (f1 VARCHAR(128)) ENGINE=InnoDB; -+ -+--connection node_2 -+--source include/kill_galera.inc -+ -+--connection node_1 -+# We create a 128Mb (or so) transaction that is larger than gcache. The size of the gcache is not adjustable dynamically -+INSERT INTO t1 SELECT REPEAT('a', 128) FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6; -+ -+--connection node_2 -+--source include/start_mysqld.inc -+ -+--let $galera_connection_name = node_2a -+--let $galera_server_number = 2 -+--source include/galera_connect.inc -+--connection node_2a -+ -+SELECT COUNT(*) = 1000000 FROM t1; -+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+ -+--connection node_1 -+--disable_query_log -+--eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_orig'; -+--enable_query_log -+ -+DROP TABLE t1; -+DROP TABLE ten; -diff --git a/mysql-test/suite/galera/t/galera_kill_nochanges.test b/mysql-test/suite/galera/t/galera_kill_nochanges.test -new file mode 100644 -index 0000000..1903df4 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_kill_nochanges.test -@@ -0,0 +1,24 @@ -+# -+# This test kill -9-s a slave while no updates have been performed on the master. -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--connection node_1 -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+ -+--connection node_2 -+--source include/kill_galera.inc -+--source include/start_mysqld.inc -+ -+--let $galera_connection_name = node_2a -+--let $galera_server_number = 2 -+--source include/galera_connect.inc -+--connection node_2a -+ -+SELECT COUNT(*) = 1 FROM t1; -+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_kill_smallchanges.test b/mysql-test/suite/galera/t/galera_kill_smallchanges.test -new file mode 100644 -index 0000000..d998032 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_kill_smallchanges.test -@@ -0,0 +1,39 @@ -+# -+# This test kill -9-s a slave while small updates have been performed on the master. -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--connection node_1 -+ -+# Enable the master to continue running during the split-brain situation that -+# occurs when the slave is killed -+--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options` -+SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true'; -+ -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+ -+--connection node_2 -+--source include/kill_galera.inc -+ -+--connection node_1 -+INSERT INTO t1 VALUES (1); -+ -+--connection node_2 -+--source include/start_mysqld.inc -+ -+--let $galera_connection_name = node_2a -+--let $galera_server_number = 2 -+--source include/galera_connect.inc -+--connection node_2a -+ -+SELECT COUNT(*) = 1 FROM t1; -+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+ -+--connection node_1 -+--disable_query_log -+--eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_orig'; -+--enable_query_log -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_lock_table.test b/mysql-test/suite/galera/t/galera_lock_table.test -new file mode 100644 -index 0000000..bd58184 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_lock_table.test -@@ -0,0 +1,43 @@ -+# -+# Test that a LOCK TABLE on the slave will cause the applier thread to block, so no subsequent updates -+# are replicated on the slave until UNLOCK TABLE is issued. -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--let $wsrep_sync_wait_orig = `SELECT @@wsrep_sync_wait` -+ -+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; -+CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=InnoDB; -+ -+--connection node_2 -+LOCK TABLE t1 READ; -+ -+--connection node_1 -+INSERT INTO t1 VALUES (1); -+INSERT INTO t2 VALUES (1); -+ -+# We use a separate connection here so that we can SELECT from both tables -+# without running into "table t2 was not locked" error. -+ -+--let $galera_connection_name = node_2a -+--let $galera_server_number = 2 -+--source include/galera_connect.inc -+--connection node_2a -+SET SESSION wsrep_sync_wait=0; -+SELECT COUNT(*) = 0 FROM t1; -+SELECT COUNT(*) = 0 FROM t2; -+ -+--connection node_2 -+UNLOCK TABLES; -+ -+--disable_query_log -+--eval SET SESSION wsrep_sync_wait=$wsrep_sync_wait_orig; -+--enable_query_log -+ -+SELECT COUNT(*) = 1 FROM t1; -+SELECT COUNT(*) = 1 FROM t2; -+ -+DROP TABLE t1; -+DROP TABLE t2; -diff --git a/mysql-test/suite/galera/t/galera_log_bin-master.opt b/mysql-test/suite/galera/t/galera_log_bin-master.opt -new file mode 100644 -index 0000000..8a755e9 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_log_bin-master.opt -@@ -0,0 +1 @@ -+--log-bin --log-slave-updates -diff --git a/mysql-test/suite/galera/t/galera_log_bin.test b/mysql-test/suite/galera/t/galera_log_bin.test -new file mode 100644 -index 0000000..14f04e9 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_log_bin.test -@@ -0,0 +1,36 @@ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# Test Galera with --log-bin --log-slave-updates . -+# This way the actual MySQL binary log is used, -+# rather than Galera's own implementation -+# -+ -+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+ -+CREATE TABLE t2 (id INT) ENGINE=InnoDB; -+INSERT INTO t2 VALUES (1); -+INSERT INTO t2 VALUES (1); -+ -+--connection node_2 -+SELECT COUNT(*) = 1 FROM t1; -+SELECT COUNT(*) = 2 FROM t2; -+ -+--connection node_1 -+ALTER TABLE t1 ADD COLUMN f2 INTEGER; -+ -+FLUSH LOGS; -+# Use pos 120 in order to skip the header that contains the MySQL version number. -+# Otherwise, version number changes will cause the test to break -+SHOW BINLOG EVENTS IN '0.000002' FROM 120; -+ -+--connection node_2 -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+ -+SHOW BINLOG EVENTS IN '0.000001' FROM 120; -+ -+DROP TABLE t1; -+DROP TABLE t2; -+ -diff --git a/mysql-test/suite/galera/t/galera_log_output_csv-master.opt b/mysql-test/suite/galera/t/galera_log_output_csv-master.opt -new file mode 100644 -index 0000000..2f71b14 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_log_output_csv-master.opt -@@ -0,0 +1 @@ -+--log-output=TABLE --log-queries-not-using-indexes --general-log --slow-query-log -diff --git a/mysql-test/suite/galera/t/galera_log_output_csv.test b/mysql-test/suite/galera/t/galera_log_output_csv.test -new file mode 100644 -index 0000000..0000939 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_log_output_csv.test -@@ -0,0 +1,27 @@ -+# -+# Test that --log-output=FILE works with Galera. -+# The relevant options are set using a -master.opt file -+# wsrep_replicate_myisam is not used as it crashes in MTR with mysql-wsrep#14 -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+ -+SELECT COUNT(*) > 0 FROM mysql.general_log; -+ -+SELECT 1 = 1 FROM t1; -+SELECT COUNT(*) = 1 FROM mysql.slow_log WHERE sql_text = 'SELECT 1 = 1 FROM t1'; -+ -+--connection node_2 -+ -+# CREATE TABLE from master is also present in the slave query log, but is logged twice, mysql-wsrep#44 -+SELECT COUNT(*) > 0 FROM mysql.general_log WHERE argument = 'CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB'; -+ -+SELECT 2 = 2 FROM t1; -+SELECT COUNT(*) = 1 FROM mysql.slow_log WHERE sql_text = 'SELECT 2 = 2 FROM t1'; -+ -+--connection node_1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_many_columns.test b/mysql-test/suite/galera/t/galera_many_columns.test -new file mode 100644 -index 0000000..1961eae ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_many_columns.test -@@ -0,0 +1,62 @@ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--disable_query_log -+SET @create_var1 = ""; -+--let $count = 1017 -+while ($count) -+{ -+ --eval SET @create_var1 = CONCAT(@create_var1, "f", $count, " VARCHAR(3) DEFAULT 'ABC', ") -+ --dec $count -+} -+ -+--let $create_var = `SELECT @create_var1` -+--eval CREATE TABLE t1 ($create_var PRIMARY KEY (f1, f1017)) ENGINE=InnoDB; -+--enable_query_log -+ -+INSERT INTO t1 (f1) VALUES (DEFAULT); -+ -+--connection node_2 -+SELECT f1 = 'ABC', f1017 = 'ABC' FROM t1; -+UPDATE t1 SET f1 = 'XYZ', f1017 = 'XYZ' ; -+ -+--connection node_1 -+SELECT f1 = 'XYZ', f1017 = 'XYZ' FROM t1 WHERE f1 = 'XYZ' AND f1017 = 'XYZ'; -+ -+ -+# Deadlock -+ -+--connection node_1 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t1 SET f2 = 'KLM' WHERE f1 = 'XYZ' AND f1017 = 'XYZ'; -+ -+--connection node_2 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t1 SET f2 = 'CDE' WHERE f1 = 'XYZ' AND f1017 = 'XYZ'; -+COMMIT; -+ -+--connection node_1 -+--error ER_LOCK_DEADLOCK -+COMMIT; -+ROLLBACK; -+ -+--connection node_2 -+ROLLBACK; -+ -+# Rollback -+ -+--connection node_1 -+START TRANSACTION; -+INSERT INTO t1 (f1, f1017) VALUES ('BCE','BCE'); -+INSERT INTO t1 (f1, f1017) VALUES ('CED','CED'); -+INSERT INTO t1 (f1, f1017) VALUES ('EDF','EDF'); -+INSERT INTO t1 (f1, f1017) VALUES ('FED','FED'); -+ROLLBACK; -+SELECT COUNT(*) = 1 FROM t1; -+ -+--connection node_2 -+SELECT COUNT(*) = 1 FROM t1; -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_many_indexes.test b/mysql-test/suite/galera/t/galera_many_indexes.test -new file mode 100644 -index 0000000..e01d0b2 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_many_indexes.test -@@ -0,0 +1,74 @@ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TABLE t1 (f1 VARCHAR(767) PRIMARY KEY) ENGINE=InnoDB; -+ -+# MySQL complains about multiple identical indexes on the same column -+--disable_warnings -+ -+--let $count = 63 -+while ($count) -+{ -+ --disable_query_log -+ --eval SET @ddl_var1 = CONCAT("CREATE UNIQUE INDEX i", $count, " ON t1(f1)") -+ --let $ddl_var = `SELECT @ddl_var1` -+ --enable_query_log -+ --eval $ddl_var -+ --dec $count -+} -+--enable_warnings -+ -+INSERT INTO t1 VALUES (REPEAT('a', 767)); -+--connection node_2 -+SELECT COUNT(*) = 1 FROM t1; -+SELECT LENGTH(f1) = 767 FROM t1; -+ -+EXPLAIN SELECT COUNT(*) = 1 FROM t1 FORCE KEY (PRIMARY) WHERE f1 = REPEAT('a', 767); -+SELECT COUNT(*) = 1 FROM t1 FORCE KEY (PRIMARY) WHERE f1 = REPEAT('a', 767); -+ -+EXPLAIN SELECT COUNT(*) = 1 FROM t1 FORCE KEY (i1) WHERE f1 = REPEAT('a', 767); -+SELECT COUNT(*) = 1 FROM t1 FORCE KEY (i1) WHERE f1 = REPEAT('a', 767); -+ -+EXPLAIN SELECT COUNT(*) = 1 FROM t1 FORCE KEY (i63) WHERE f1 = REPEAT('a', 767); -+SELECT COUNT(*) = 1 FROM t1 FORCE KEY (i63) WHERE f1 = REPEAT('a', 767); -+ -+INSERT INTO t1 VALUES (REPEAT('b', 767)); -+ANALYZE TABLE t1; -+ -+--connection node_1 -+SELECT COUNT(*) = 2 FROM t1; -+ANALYZE TABLE t1; -+DELETE FROM t1 WHERE f1 = REPEAT('b', 767); -+ -+# Rollback -+--connection node_1 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+SELECT COUNT(*) = 1 FROM t1; -+INSERT INTO t1 (f1) VALUES (REPEAT('c', 767)); -+ROLLBACK; -+SELECT COUNT(*) = 1 FROM t1; -+ -+--connection node_2 -+START TRANSACTION; -+SET AUTOCOMMIT=OFF; -+SELECT COUNT(*) = 1 FROM t1; -+ -+# Deadlock -+--connection node_1 -+START TRANSACTION; -+--connection node_2 -+START TRANSACTION; -+ -+--connection node_1 -+UPDATE t1 SET f1 = REPEAT('e', 767); -+--connection node_2 -+UPDATE t1 SET f1 = REPEAT('f', 767); -+ -+--connection node_1 -+COMMIT; -+--connection node_2 -+--error ER_LOCK_DEADLOCK -+COMMIT; -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_many_rows.test b/mysql-test/suite/galera/t/galera_many_rows.test -new file mode 100644 -index 0000000..0f4c4c0 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_many_rows.test -@@ -0,0 +1,55 @@ -+ -+--source include/big_test.inc -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TABLE ten (f1 INTEGER); -+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); -+ -+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) Engine=InnoDB; -+INSERT INTO t1 (f2) SELECT a1.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; -+ -+--connection node_2 -+SELECT COUNT(*) = 100000 FROM t1; -+INSERT INTO t1 (f2) SELECT a1.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; -+ -+--connection node_1 -+SELECT COUNT(*) = 200000 FROM t1; -+UPDATE t1 SET f2 = 1; -+ -+--connection node_2 -+SELECT COUNT(*) = 200000 FROM t1 WHERE f2 = 1; -+ -+# Rollback -+--connection node_1 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (f2) SELECT a1.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; -+ROLLBACK; -+SELECT COUNT(*) = 200000 FROM t1; -+ -+--connection node_2 -+SELECT COUNT(*) = 200000 FROM t1; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t1 SET f2 = 2; -+ROLLBACK; -+ -+--connection node_1 -+START TRANSACTION; -+SELECT COUNT(*) = 200000 FROM t1; -+UPDATE t1 SET f2 = 3; -+ -+--connection node_2 -+START TRANSACTION; -+UPDATE t1 SET f2 = 4; -+ -+--connection node_1 -+COMMIT; -+ -+--connection node_2 -+--error ER_LOCK_DEADLOCK -+COMMIT; -+ -+DROP TABLE t1; -+DROP TABLE ten; -diff --git a/mysql-test/suite/galera/t/galera_many_tables_nopk.test b/mysql-test/suite/galera/t/galera_many_tables_nopk.test -new file mode 100644 -index 0000000..2496d14 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_many_tables_nopk.test -@@ -0,0 +1,103 @@ -+--source include/big_test.inc -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# This test forces 1K tables without a PK to participate in a single transaction -+# -+ -+# -+# First, create 1K tables -+# -+ -+--connection node_1 -+ -+--let $count = 1000 -+while ($count) -+{ -+ --disable_query_log -+ --let $ddl_var = `SELECT CONCAT("CREATE TABLE t", $count, " (f1 INTEGER) ENGINE=InnoDB")` -+ --eval $ddl_var -+ --enable_query_log -+ --dec $count -+} -+ -+--let $count = 1000 -+while ($count) -+{ -+ --disable_query_log -+ --let $ddl_var = `SELECT CONCAT("INSERT INTO t", $count, " VALUES (1234)")` -+ --eval $ddl_var -+ --enable_query_log -+ --dec $count -+} -+ -+# -+# Second, perform 1K updates -+# -+ -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+ -+--let $count = 1000 -+while ($count) -+{ -+ --disable_query_log -+ --let $ddl_var = `SELECT CONCAT("UPDATE t", $count, " SET f1 = 1")` -+ --eval $ddl_var -+ --enable_query_log -+ --dec $count -+} -+ -+COMMIT; -+ -+# Third, confirm that all the inserts have arrived on the second node -+# -+ -+--connection node_2 -+CREATE TABLE sum_table (f1 INTEGER); -+ -+--let $count = 1000 -+while ($count) -+{ -+ --disable_query_log -+ --let $ddl_var = `SELECT CONCAT("INSERT INTO sum_table SELECT COUNT(*) FROM t", $count)` -+ --eval $ddl_var -+ --enable_query_log -+ --dec $count -+} -+ -+SELECT SUM(f1) = 1000 FROM sum_table; -+ -+# -+# Fourth, create a deadlock -+# -+ -+--connection node_1 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+ -+--let $count = 1000 -+while ($count) -+{ -+ --disable_query_log -+ --let $ddl_var = `SELECT CONCAT("UPDATE t", $count, " SET f1 = 2")` -+ --eval $ddl_var -+ --enable_query_log -+ --dec $count -+} -+ -+--connection node_2 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t1000 SET f1 = 3; -+ -+--connection node_1 -+COMMIT; -+ -+--connection node_2 -+--error ER_LOCK_DEADLOCK -+COMMIT; -+ -+DROP SCHEMA test; -+CREATE SCHEMA test; -diff --git a/mysql-test/suite/galera/t/galera_many_tables_pk.test b/mysql-test/suite/galera/t/galera_many_tables_pk.test -new file mode 100644 -index 0000000..886cb7c ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_many_tables_pk.test -@@ -0,0 +1,98 @@ -+--source include/big_test.inc -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# This test forces 1K tables with a PK to participate in a single transaction -+# -+ -+# -+# First, create 1K tables and make sure the DDLs are all propagated -+# -+ -+--connection node_1 -+ -+--let $count = 1000 -+while ($count) -+{ -+ --disable_query_log -+ --let $ddl_var = `SELECT CONCAT("CREATE TABLE t", $count, " (f1 INTEGER AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB")` -+ --eval $ddl_var -+ --enable_query_log -+ --dec $count -+} -+ -+--connection node_2 -+SELECT COUNT(*) = 1000 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME LIKE 't%'; -+ -+# -+# Second, create a transaction that uses all those tables -+# -+ -+--connection node_1 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+ -+--let $count = 1000 -+while ($count) -+{ -+ --disable_query_log -+ --let $ddl_var = `SELECT CONCAT("INSERT INTO t", $count, " VALUES (DEFAULT)")` -+ --eval $ddl_var -+ --enable_query_log -+ --dec $count -+} -+ -+COMMIT; -+ -+# -+# Third, confirm that all the inserts have arrived on the second node -+# -+ -+--connection node_2 -+CREATE TABLE sum_table (f1 INTEGER); -+ -+--let $count = 1000 -+while ($count) -+{ -+ --disable_query_log -+ --let $ddl_var = `SELECT CONCAT("INSERT INTO sum_table SELECT COUNT(*) FROM t", $count)` -+ --eval $ddl_var -+ --enable_query_log -+ --dec $count -+} -+ -+SELECT SUM(f1) = 1000 FROM sum_table; -+ -+# -+# Fourth, create a deadlock -+# -+ -+--connection node_1 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+ -+--let $count = 1000 -+while ($count) -+{ -+ --disable_query_log -+ --let $ddl_var = `SELECT CONCAT("UPDATE t", $count, " SET f1 = 2")` -+ --eval $ddl_var -+ --enable_query_log -+ --dec $count -+} -+ -+--connection node_2 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t1000 SET f1 = 3; -+ -+--connection node_1 -+COMMIT; -+ -+--connection node_2 -+--error ER_LOCK_DEADLOCK -+COMMIT; -+ -+DROP SCHEMA test; -+CREATE SCHEMA test; -diff --git a/mysql-test/suite/galera/t/galera_migrate.cnf b/mysql-test/suite/galera/t/galera_migrate.cnf -new file mode 100644 -index 0000000..dfaf4a6 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_migrate.cnf -@@ -0,0 +1,47 @@ -+# -+# This .cnf file starts 4 servers without enabling Galera. -+# The galera_migrate.test will set wsrep_provider and the other settings as needed. -+# -+ -+!include include/default_mysqld.cnf -+ -+[mysqld] -+binlog-format=row -+innodb_autoinc_lock_mode=2 -+innodb_flush_log_at_trx_commit=2 -+log-bin=mysqld-bin -+ -+wsrep_node_address=127.0.0.1 -+wsrep_causal_reads=ON -+wsrep_sync_wait = 7 -+ -+[mysqld.1] -+ -+[mysqld.2] -+ -+[mysqld.3] -+ -+[mysqld.4] -+ -+[ENV] -+NODE_MYPORT_1= @mysqld.1.port -+NODE_MYSOCK_1= @mysqld.1.socket -+ -+NODE_MYPORT_2= @mysqld.2.port -+NODE_MYSOCK_2= @mysqld.2.socket -+ -+NODE_MYPORT_3= @mysqld.3.port -+NODE_MYSOCK_3= @mysqld.3.socket -+ -+NODE_MYPORT_4= @mysqld.4.port -+NODE_MYSOCK_4= @mysqld.4.socket -+ -+NODE_GALERAPORT_1= @mysqld.1.#galera_port -+NODE_GALERAPORT_2= @mysqld.2.#galera_port -+NODE_GALERAPORT_3= @mysqld.3.#galera_port -+NODE_GALERAPORT_4= @mysqld.4.#galera_port -+ -+NODE_SSTPORT_1= @mysqld.1.#sst_port -+NODE_SSTPORT_2= @mysqld.2.#sst_port -+NODE_SSTPORT_3= @mysqld.3.#sst_port -+NODE_SSTPORT_4= @mysqld.4.#sst_port -diff --git a/mysql-test/suite/galera/t/galera_migrate.test b/mysql-test/suite/galera/t/galera_migrate.test -new file mode 100644 -index 0000000..5c34fd6 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_migrate.test -@@ -0,0 +1,204 @@ -+# -+# Execute a migration from MySQL replication to Galera replication. -+# The test starts with 4 stand-alone servers defined by galera_migrate.cnf and then -+# performs the following steps: -+# -+# 1. Begin with a single MySQL server -+# 2. Establish traditional MySQL master-slave replication -+# 3. Attach a new sever to serve as a MySQL replication slave -+# 4. Enable Galera on the new slave and create a single-node Galera cluster -+# 5. Attach a second Galera node -+# 6. Turn off the traditional replication parts of the system -+# 7. Continue replicating within Galera only -+# -+ -+--source include/big_test.inc -+--source include/have_innodb.inc -+--source include/have_log_bin.inc -+ -+# -+# Step #1 Begin with a single server -+# -+ -+--connect node_1, 127.0.0.1, root, , test, $NODE_MYPORT_1 -+ -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+ -+# -+# Step #2. Establish traditional MySQL replication -+# -+ -+--connect node_2, 127.0.0.1, root, , test, $NODE_MYPORT_2 -+--disable_query_log -+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT = $NODE_MYPORT_1; -+--enable_query_log -+START SLAVE USER='root'; -+ -+--connection node_1 -+INSERT INTO t1 VALUES (2); -+ -+--connection node_2 -+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; -+--source include/wait_condition.inc -+ -+--let $wait_condition = SELECT COUNT(*) = 2 FROM t1; -+--source include/wait_condition.inc -+ -+# -+# Step #3. Attach a second slave, later to be converted to Galera -+# -+ -+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 -+--disable_query_log -+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT = $NODE_MYPORT_1; -+--enable_query_log -+START SLAVE USER='root'; -+ -+--connection node_1 -+INSERT INTO t1 VALUES (3); -+ -+--connection node_3 -+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; -+--source include/wait_condition.inc -+ -+--let $wait_condition = SELECT COUNT(*) = 3 FROM t1; -+--source include/wait_condition.inc -+ -+# -+# Step #4. Convert this MySQL slave into a Galera node -+# -+ -+--connection node_1 -+INSERT INTO t1 VALUES (4); -+ -+--connection node_3 -+--disable_query_log -+--eval SET GLOBAL wsrep_provider='$WSREP_PROVIDER' -+--eval SET GLOBAL wsrep_provider_options='base_port=$NODE_GALERAPORT_3' -+--enable_query_log -+SET GLOBAL wsrep_cluster_address='gcomm://'; -+ -+--connection node_1 -+INSERT INTO t1 VALUES (5); -+ -+--connection node_3 -+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; -+--source include/wait_condition.inc -+--let $wait_condition = SELECT COUNT(*) = 5 FROM t1; -+--source include/wait_condition.inc -+ -+--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; -+--source include/wait_condition.inc -+ -+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; -+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+ -+--connection node_1 -+INSERT INTO t1 VALUES (6); -+ -+# -+# Step #5. Attach a second Galera node using mysqldump SST -+# -+ -+--connection node_3 -+# We need a user with a password for mysqldump SST -+GRANT ALL PRIVILEGES ON *.* TO 'sst' IDENTIFIED BY 'sst'; -+SET GLOBAL wsrep_sst_auth = 'sst:sst'; -+ -+--connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4 -+GRANT ALL PRIVILEGES ON *.* TO 'sst' IDENTIFIED BY 'sst'; -+ -+--disable_query_log -+--eval SET GLOBAL wsrep_sst_method = 'mysqldump'; -+--eval SET GLOBAL wsrep_provider='$WSREP_PROVIDER' -+--eval SET GLOBAL wsrep_provider_options='base_port=$NODE_GALERAPORT_4' -+--eval SET GLOBAL wsrep_sst_receive_address = '127.0.0.2:$NODE_MYPORT_4'; -+--eval SET GLOBAL wsrep_cluster_address='gcomm://127.0.0.1:$NODE_GALERAPORT_3' -+--enable_query_log -+ -+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; -+--source include/wait_condition.inc -+ -+--let $wait_condition = SELECT COUNT(*) = 6 FROM t1; -+--source include/wait_condition.inc -+ -+--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; -+--source include/wait_condition.inc -+ -+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; -+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+ -+ -+# -+# Step #6. Turn off traditional replication -+# -+ -+--connection node_2 -+STOP SLAVE; -+RESET SLAVE ALL; -+ -+--connection node_3 -+STOP SLAVE; -+RESET SLAVE ALL; -+ -+# -+# Step #7. Continue replicating within Galera only -+# -+ -+# We need fresh connections due to galera#191 -+ -+--connect node_3a, 127.0.0.1, root, , test, $NODE_MYPORT_3 -+INSERT INTO t1 VALUES (7); -+ -+--connect node_4a, 127.0.0.1, root, , test, $NODE_MYPORT_4 -+INSERT INTO t1 VALUES (8); -+ -+--connection node_4a -+SELECT COUNT(*) = 8 FROM t1; -+ -+--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; -+--source include/wait_condition.inc -+ -+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; -+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+ -+--connection node_3a -+SELECT COUNT(*) = 8 FROM t1; -+ -+--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; -+--source include/wait_condition.inc -+ -+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; -+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+ -+# -+# Teardown -+# -+ -+--connection node_1 -+DROP TABLE t1; -+ -+--connection node_2 -+DROP TABLE t1; -+ -+--connection node_3 -+SET GLOBAL wsrep_provider = 'none'; -+SET GLOBAL wsrep_sst_auth = ''; -+SET GLOBAL wsrep_provider_options = ''; -+DROP TABLE t1; -+DROP USER sst; -+ -+--connection node_4 -+SET GLOBAL wsrep_provider = 'none'; -+SET GLOBAL wsrep_sst_method = 'rsync'; -+SET GLOBAL wsrep_provider_options = ''; -+SET GLOBAL wsrep_sst_receive_address = 'AUTO'; -+DROP TABLE t1; -+DROP USER sst; -+ -+CALL mtr.add_suppression("InnoDB: Error: Table \"mysql\"\\.\"innodb_index_stats\" not found"); -diff --git a/mysql-test/suite/galera/t/galera_multi_database.test b/mysql-test/suite/galera/t/galera_multi_database.test -new file mode 100644 -index 0000000..6e06aaa ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_multi_database.test -@@ -0,0 +1,43 @@ -+# -+# Test that identical updates can be delivered to two separate -+# databases without this causing a certification conflict -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE DATABASE d1; -+CREATE TABLE d1.t1(f1 INTEGER) ENGINE=InnoDB; -+ -+CREATE DATABASE d2; -+CREATE TABLE d2.t1(f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+ -+--connection node_1 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO d1.t1 VALUES (1); -+ -+--connection node_2 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO d2.t1 VALUES (1); -+ -+--connection node_1 -+COMMIT; -+ -+--connection node_2 -+COMMIT; -+ -+SELECT COUNT(*) = 1 FROM d1.t1; -+SELECT COUNT(*) = 1 FROM d2.t1; -+ -+--connection node_1 -+ -+SELECT COUNT(*) = 1 FROM d1.t1; -+SELECT COUNT(*) = 1 FROM d2.t1; -+ -+DROP TABLE d1.t1; -+DROP TABLE d2.t1; -+ -+DROP DATABASE d1; -+DROP DATABASE d2; -diff --git a/mysql-test/suite/galera/t/galera_myisam_autocommit.test b/mysql-test/suite/galera/t/galera_myisam_autocommit.test -new file mode 100644 -index 0000000..b01b5dc ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_myisam_autocommit.test -@@ -0,0 +1,45 @@ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# This tests simple autocommit replication of MyISAM tables. No updates arrive on the slave. -+# -+ -+# Without a PK -+ -+CREATE TABLE t1 (f1 INTEGER) ENGINE=MyISAM; -+ -+INSERT INTO t1 VALUES (1); -+INSERT INTO t1 VALUES (2), (3); -+INSERT INTO t1 SELECT 4 FROM DUAL UNION ALL SELECT 5 FROM DUAL; -+ -+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) ENGINE=MyISAM; -+INSERT INTO t2 VALUES (1); -+INSERT INTO t2 VALUES (2), (3); -+INSERT INTO t2 SELECT 4 FROM DUAL UNION ALL SELECT 5 FROM DUAL; -+ -+# Error -+--error ER_DUP_ENTRY -+INSERT INTO t2 VALUES (6), (1); -+ -+# UPDATE -+ -+UPDATE t1 SET f1 = 9; -+UPDATE t2 SET f1 = 9 WHERE f1 = 1; -+ -+# DELETE -+ -+DELETE FROM t1 WHERE f1 = 9; -+DELETE FROM t2 WHERE f1 = 9; -+ -+# TRUNCATE -+ -+TRUNCATE TABLE t1; -+TRUNCATE TABLE t1; -+ -+--connection node_2 -+SELECT COUNT(*) = 0 FROM t1; -+SELECT COUNT(*) = 0 FROM t2; -+ -+DROP TABLE t1; -+DROP TABLE t2; -diff --git a/mysql-test/suite/galera/t/galera_myisam_transactions.test b/mysql-test/suite/galera/t/galera_myisam_transactions.test -new file mode 100644 -index 0000000..00e0bf3 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_myisam_transactions.test -@@ -0,0 +1,36 @@ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# This tests MyISAM tables in transactions. No MyISAM updates arrive on the slave, but InnoDB ones do. -+# -+ -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+CREATE TABLE t2 (f1 INTEGER) ENGINE=MyISAM; -+CREATE TABLE t3 (f1 INTEGER) ENGINE=MyISAM; -+ -+CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t3 VALUES (NEW.f1); -+ -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES (1); -+INSERT INTO t2 VALUES (1); -+COMMIT; -+ -+--connection node_2 -+SELECT COUNT(*) = 1 FROM t1; -+SELECT COUNT(*) = 0 FROM t2; -+SELECT COUNT(*) = 0 FROM t2; -+ -+--connection node_1 -+START TRANSACTION; -+INSERT INTO t1 VALUES (1); -+INSERT INTO t2 VALUES (1); -+ROLLBACK; -+ -+--connection node_2 -+SELECT COUNT(*) = 1 FROM t1; -+SELECT COUNT(*) = 0 FROM t2; -+SELECT COUNT(*) = 0 FROM t2; -+ -+DROP TABLE t1, t2, t3; -diff --git a/mysql-test/suite/galera/t/galera_nopk_bit.test b/mysql-test/suite/galera/t/galera_nopk_bit.test -new file mode 100644 -index 0000000..4292a6d ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_nopk_bit.test -@@ -0,0 +1,46 @@ -+# -+# This checks that even tables with a single BIT column are replicated properly without a PK -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TABLE t1 (f1 BIT) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (NULL),(0),(b'1'); -+ -+--connection node_2 -+SELECT f1 IS NULL, f1 = b'1' FROM t1; -+ -+DELETE FROM t1 WHERE f1 = b'1'; -+UPDATE t1 SET f1 = b'1' WHERE f1 IS NULL; -+UPDATE t1 SET f1 = 1 WHERE f1 = b'0'; -+ -+--connection node_1 -+SELECT f1 IS NULL, f1 = b'1' FROM t1; -+ -+# -+# Provoke a conflict -+# -+ -+--connection node_1 -+CREATE TABLE t2 (f1 BIT) ENGINE=InnoDB; -+INSERT INTO t2 VALUES (NULL); -+ -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t2 SET f1 = 0 WHERE f1 IS NULL; -+ -+--connection node_2 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t2 SET f1 = 1 WHERE f1 IS NULL; -+ -+--connection node_1 -+COMMIT; -+ -+--connection node_2 -+--error ER_LOCK_DEADLOCK -+COMMIT; -+ -+DROP TABLE t1; -+DROP TABLE t2; -diff --git a/mysql-test/suite/galera/t/galera_nopk_blob.test b/mysql-test/suite/galera/t/galera_nopk_blob.test -new file mode 100644 -index 0000000..08e3b99 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_nopk_blob.test -@@ -0,0 +1,46 @@ -+# -+# This checks that even tables with a single BLOB column and no FK are replicated properly -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TABLE t1 (f1 BLOB) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (NULL),('abc'); -+ -+--connection node_2 -+SELECT f1 FROM t1; -+ -+DELETE FROM t1 WHERE f1 IS NULL; -+UPDATE t1 SET f1 = 'xyz' WHERE f1 = 'abc'; -+ -+--connection node_1 -+SELECT COUNT(*) = 1 FROM t1; -+SELECT f1 = 'abc' FROM t1; -+ -+# -+# Provoke a conflict -+# -+ -+--connection node_1 -+CREATE TABLE t2 (f1 BLOB) ENGINE=InnoDB; -+INSERT INTO t2 VALUES (NULL); -+ -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t2 SET f1 = 'abc' WHERE f1 IS NULL; -+ -+--connection node_2 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t2 SET f1 = 'xyz' WHERE f1 IS NULL; -+ -+--connection node_1 -+COMMIT; -+ -+--connection node_2 -+--error ER_LOCK_DEADLOCK -+COMMIT; -+ -+DROP TABLE t1; -+DROP TABLE t2; -diff --git a/mysql-test/suite/galera/t/galera_nopk_large_varchar.test b/mysql-test/suite/galera/t/galera_nopk_large_varchar.test -new file mode 100644 -index 0000000..bb9bcd5 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_nopk_large_varchar.test -@@ -0,0 +1,50 @@ -+# -+# This checks that even tables with a single long VARCHARcolumn and no FK are replicated properly -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# From the Innodb manual: "The maximum row length, except for variable-length columns (VARBINARY, VARCHAR, BLOB and TEXT), -+# is slightly less than half of a database page. That is, the maximum row length is about 8000 bytes" -+ -+CREATE TABLE t1 (f1 VARCHAR(8000)) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (NULL),(CONCAT(REPEAT('x', 7999), 'a')); -+ -+--connection node_2 -+SELECT LENGTH(f1) FROM t1; -+ -+DELETE FROM t1 WHERE f1 IS NULL; -+UPDATE t1 SET f1 = CONCAT(REPEAT('x', 7999), 'b') WHERE f1 = CONCAT(REPEAT('x', 7999), 'a'); -+ -+--connection node_1 -+SELECT COUNT(*) = 1 FROM t1; -+SELECT LENGTH(f1) = 8000 FROM t1; -+SELECT f1 = CONCAT(REPEAT('x', 7999), 'b') FROM t1; -+ -+# -+# Provoke a conflict -+# -+ -+--connection node_1 -+CREATE TABLE t2 (f1 BLOB) ENGINE=InnoDB; -+INSERT INTO t2 VALUES (CONCAT(REPEAT('x', 7999), 'a')); -+ -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t2 SET f1 = 'abc' WHERE f1 = CONCAT(REPEAT('x', 7999), 'a'); -+ -+--connection node_2 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t2 SET f1 = 'xyz' WHERE f1 = CONCAT(REPEAT('x', 7999), 'a'); -+ -+--connection node_1 -+COMMIT; -+ -+--connection node_2 -+--error ER_LOCK_DEADLOCK -+COMMIT; -+ -+DROP TABLE t1; -+DROP TABLE t2; -diff --git a/mysql-test/suite/galera/t/galera_nopk_unicode.test b/mysql-test/suite/galera/t/galera_nopk_unicode.test -new file mode 100644 -index 0000000..e036e14 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_nopk_unicode.test -@@ -0,0 +1,43 @@ -+# -+# Test non-ascii data in table without a PK -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TABLE t1 ( -+ f1 VARCHAR(255), -+ KEY (f1) -+) ENGINE=InnoDB DEFAULT CHARSET=utf8; -+ -+INSERT INTO t1 VALUES ('текст'); -+ -+--connection node_2 -+SELECT f1 = 'текст' FROM t1; -+ -+# -+# Provoke a conflict -+# -+ -+--connection node_1 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t1 SET f1 = 'текст2'; -+ -+--connection node_2 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t1 SET f1 = 'текст3'; -+ -+--connection node_1 -+COMMIT; -+ -+--connection node_2 -+--error ER_LOCK_DEADLOCK -+COMMIT; -+ -+SELECT f1 = 'текст2' FROM t1; -+SELECT f1 = 'текст2' FROM t1 WHERE f1 = 'текст2'; -+ -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_parallel_apply_lock_table.test b/mysql-test/suite/galera/t/galera_parallel_apply_lock_table.test -new file mode 100644 -index 0000000..7c49a57 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_parallel_apply_lock_table.test -@@ -0,0 +1,51 @@ -+# -+# Test that a LOCK TABLE on the slave will cause all applier threads to block, -+# Even though the two INSERTS are independent transactions, the fact that t1 is locked -+# prevents the applier thread from committing the insert against t2, as commits are done -+# in order. -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; -+CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=InnoDB; -+ -+--connection node_2 -+ -+--let $wsrep_slave_threads_orig = `SELECT @@wsrep_slave_threads` -+--let $wsrep_sync_wait_orig = `SELECT @@wsrep_sync_wait` -+ -+SET GLOBAL wsrep_slave_threads = 2; -+LOCK TABLE t1 READ; -+ -+--connection node_1 -+INSERT INTO t1 VALUES (1); -+INSERT INTO t2 VALUES (1); -+ -+# We use a separate connection here so that we can SELECT from both tables -+# without running into "table t2 was not locked" error. -+ -+--let $galera_connection_name = node_2a -+--let $galera_server_number = 2 -+--source include/galera_connect.inc -+--connection node_2a -+--sleep 1 -+SET SESSION wsrep_sync_wait=0; -+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%applied write set%'; -+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%Waiting for table level lock%'; -+SELECT COUNT(*) = 0 FROM t1; -+SELECT COUNT(*) = 0 FROM t2; -+ -+--connection node_2 -+UNLOCK TABLES; -+ -+--connection node_2a -+--eval SET SESSION wsrep_sync_wait = $wsrep_sync_wait_orig; -+SELECT COUNT(*) = 1 FROM t1; -+SELECT COUNT(*) = 1 FROM t2; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%committed%'; -+ -+--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig; -+DROP TABLE t1; -+DROP TABLE t2; -diff --git a/mysql-test/suite/galera/t/galera_parallel_autoinc_largetrx.test b/mysql-test/suite/galera/t/galera_parallel_autoinc_largetrx.test -new file mode 100644 -index 0000000..a192044 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_parallel_autoinc_largetrx.test -@@ -0,0 +1,50 @@ -+## -+## This test tests parallel application of multiple auto-increment insert transactions -+## -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# Create a second connection to node1 so that we can run transactions concurrently -+--let $galera_connection_name = node_1a -+--let $galera_server_number = 1 -+--source include/galera_connect.inc -+ -+--connection node_1 -+CREATE TABLE ten (f1 INTEGER); -+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); -+ -+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) Engine=InnoDB; -+--connection node_2 -+--let $wsrep_slave_threads_orig = `SELECT @@wsrep_slave_threads` -+SET GLOBAL wsrep_slave_threads = 4; -+ -+--connection node_1 -+--send INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4; -+ -+--connection node_1a -+--send INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4; -+ -+--connection node_2 -+--send INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4; -+ -+--connection node_1 -+--reap -+ -+--connection node_1a -+--reap -+ -+--connection node_2 -+--reap -+SELECT COUNT(*) = 30000 FROM t1; -+SELECT COUNT(DISTINCT f1) = 30000 FROM t1; -+SELECT COUNT(*) = 5 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user'; -+ -+--disable_query_log -+--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig; -+--enable_query_log -+ -+--connection default -+DROP TABLE t1; -+DROP TABLE ten; -+ -diff --git a/mysql-test/suite/galera/t/galera_parallel_autoinc_manytrx.test b/mysql-test/suite/galera/t/galera_parallel_autoinc_manytrx.test -new file mode 100644 -index 0000000..cf984f9 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_parallel_autoinc_manytrx.test -@@ -0,0 +1,53 @@ -+## -+## Tests the parallel application of many small-ish auto-increment insert transactions -+## -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# Create a second connection to node1 so that we can run transactions concurrently -+--let $galera_connection_name = node_1a -+--let $galera_server_number = 1 -+--source include/galera_connect.inc -+ -+--connection node_1 -+CREATE TABLE ten (f1 INTEGER); -+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); -+ -+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) Engine=InnoDB; -+--connection node_2 -+--let $wsrep_slave_threads_orig = `SELECT @@wsrep_slave_threads` -+SET GLOBAL wsrep_slave_threads = 4; -+ -+--connection node_1 -+--let $count = 1000 -+while ($count) -+{ -+ --disable_query_log -+ INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1; -+ --enable_query_log -+ --dec $count -+} -+ -+--connection node_2 -+--let $count = 1000 -+while ($count) -+{ -+ --disable_query_log -+ INSERT INTO t1 (f2) SELECT 1 FROM ten AS a1; -+ --enable_query_log -+ --dec $count -+} -+ -+SELECT COUNT(*) = 20000 FROM t1; -+SELECT COUNT(DISTINCT f1) = 20000 FROM t1; -+SELECT COUNT(*) = 4 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE 'committed%'; -+ -+--disable_query_log -+--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig; -+--enable_query_log -+ -+--connection default -+DROP TABLE t1; -+DROP TABLE ten; -+ -diff --git a/mysql-test/suite/galera/t/galera_parallel_simple.test b/mysql-test/suite/galera/t/galera_parallel_simple.test -new file mode 100644 -index 0000000..b1dc14d ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_parallel_simple.test -@@ -0,0 +1,45 @@ -+# -+# Test that SHOW PROCESSLIST reports that two slave threads have been involved in applying -+# two independent transactions -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--let $wsrep_slave_threads_orig = `SELECT @@wsrep_slave_threads` -+ -+CREATE TABLE t1 (id INT) ENGINE=InnoDB; -+CREATE TABLE t2 (id INT) ENGINE=InnoDB; -+ -+--connection node_2 -+SET GLOBAL wsrep_slave_threads = 2; -+ -+--connection node_1 -+INSERT INTO t1 VALUES (1); -+INSERT INTO t2 VALUES (1); -+ -+INSERT INTO t1 VALUES (1); -+INSERT INTO t2 VALUES (1); -+ -+INSERT INTO t1 VALUES (1); -+INSERT INTO t2 VALUES (1); -+ -+INSERT INTO t1 VALUES (1); -+INSERT INTO t2 VALUES (1); -+ -+INSERT INTO t1 VALUES (1); -+INSERT INTO t2 VALUES (1); -+ -+INSERT INTO t1 VALUES (1); -+INSERT INTO t2 VALUES (1); -+ -+--connection node_2 -+ -+SELECT COUNT(*) = 10 FROM t1; -+SELECT COUNT(*) = 10 FROM t2; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'committed%'; -+ -+--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig; -+ -+DROP TABLE t1; -+DROP TABLE t2; -diff --git a/mysql-test/suite/galera/t/galera_pc_ignore_sb.test b/mysql-test/suite/galera/t/galera_pc_ignore_sb.test -new file mode 100644 -index 0000000..4be7331 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_pc_ignore_sb.test -@@ -0,0 +1,35 @@ -+# -+# Test pc.ignore_sb=true wsrep_provider option . Killing one node should leave the other running. -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--connection node_1 -+--let $wsrep_cluster_address_orig = `SELECT @@wsrep_cluster_address` -+--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options` -+ -+SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true'; -+ -+--connection node_2 -+--source include/kill_galera.inc -+ -+--connection node_1 -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+DROP TABLE t1; -+ -+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; -+ -+# Reset the master and restart the slave so that post-test checks can run -+ -+SET GLOBAL wsrep_cluster_address = ''; -+--disable_query_log -+--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig'; -+--eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_orig'; -+--enable_query_log -+ -+--connection node_2 -+--source include/start_mysqld.inc -+--source include/wait_until_connected_again.inc -diff --git a/mysql-test/suite/galera/t/galera_pk_bigint_signed.test b/mysql-test/suite/galera/t/galera_pk_bigint_signed.test -new file mode 100644 -index 0000000..12a8a8f ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_pk_bigint_signed.test -@@ -0,0 +1,46 @@ -+# -+# PK that is a BIGINT SIGNED -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TABLE t1 (f1 BIGINT SIGNED PRIMARY KEY, f2 VARCHAR(5)) ENGINE=InnoDB; -+ -+INSERT INTO t1 VALUES -+ (-9223372036854775808, 'min'), -+ (9223372036854775807, 'max') -+; -+ -+--connection node_2 -+SELECT * FROM t1; -+ -+UPDATE t1 SET f2 = CONCAT(f2, '_'); -+ -+--connection node_1 -+SELECT * FROM t1; -+ -+# -+# Deadlock -+# -+ -+--connection node_1 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t1 SET f2 = 'foo' WHERE f1 = -9223372036854775808; -+ -+--connection node_2 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t1 SET f2 = 'bar' WHERE f1 = -9223372036854775808; -+ -+--connection node_1 -+COMMIT; -+SET AUTOCOMMIT=ON; -+ -+--connection node_2 -+--error ER_LOCK_DEADLOCK -+COMMIT; -+SET AUTOCOMMIT=ON; -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_pk_bigint_unsigned.test b/mysql-test/suite/galera/t/galera_pk_bigint_unsigned.test -new file mode 100644 -index 0000000..2bb02d5 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_pk_bigint_unsigned.test -@@ -0,0 +1,45 @@ -+# -+# PK that is a BIGINT UNSIGNED -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TABLE t1 (f1 BIGINT UNSIGNED PRIMARY KEY, f2 VARCHAR(5)) ENGINE=InnoDB; -+ -+INSERT INTO t1 VALUES -+ (18446744073709551615, 'max') -+; -+ -+--connection node_2 -+SELECT f1 = 18446744073709551615 FROM t1; -+ -+UPDATE t1 SET f2 = CONCAT(f2, '_'); -+ -+--connection node_1 -+SELECT f1 = 18446744073709551615 FROM t1; -+ -+# -+# Deadlock -+# -+ -+--connection node_1 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t1 SET f2 = 'foo' WHERE f1 = 18446744073709551615; -+ -+--connection node_2 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t1 SET f2 = 'bar' WHERE f1 = 18446744073709551615; -+ -+--connection node_1 -+COMMIT; -+SET AUTOCOMMIT=ON; -+ -+--connection node_2 -+--error ER_LOCK_DEADLOCK -+COMMIT; -+SET AUTOCOMMIT=ON; -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_query_cache-master.opt b/mysql-test/suite/galera/t/galera_query_cache-master.opt -new file mode 100644 -index 0000000..18f8004 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_query_cache-master.opt -@@ -0,0 +1,2 @@ -+--query_cache_type=1 -+ -diff --git a/mysql-test/suite/galera/t/galera_query_cache.test b/mysql-test/suite/galera/t/galera_query_cache.test -new file mode 100644 -index 0000000..900faba ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_query_cache.test -@@ -0,0 +1,67 @@ -+--source include/have_query_cache.inc -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# Ensure that the query cache behaves properly with respect to Galera -+# -+# * in the absence of updates, the query cache does serve cached results -+# * any cache-invalidating query on the remote node also causes the local cache to be invalidated -+# -+ -+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; -+ -+INSERT INTO t1 VALUES (1); -+ -+--connection node_2 -+RESET QUERY CACHE; -+FLUSH STATUS; -+ -+# -+# 1. Cache works -+# -+ -+SELECT COUNT(*) FROM t1; -+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Qcache_queries_in_cache'; -+ -+SELECT COUNT(*) FROM t1; -+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits'; -+ -+# -+# 2. Cache is invalidated by DML on remote node -+# -+ -+--connection node_1 -+INSERT INTO t1 VALUES (2); -+ -+--connection node_2 -+FLUSH STATUS; -+ -+SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Qcache_queries_in_cache'; -+SELECT COUNT(*) FROM t1; -+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Qcache_queries_in_cache'; -+ -+SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits'; -+SELECT COUNT(*) FROM t1; -+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits'; -+ -+# -+# 3. Cache is invalidated by DDL on remote node -+# -+ -+--connection node_1 -+ALTER TABLE t1 ADD COLUMN f2 INTEGER; -+ -+--connection node_2 -+FLUSH STATUS; -+ -+SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Qcache_queries_in_cache'; -+SELECT COUNT(*) FROM t1; -+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Qcache_queries_in_cache'; -+ -+SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits'; -+SELECT COUNT(*) FROM t1; -+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits'; -+ -+DROP TABLE t1; -+ -diff --git a/mysql-test/suite/galera/t/galera_read_only.test b/mysql-test/suite/galera/t/galera_read_only.test -new file mode 100644 -index 0000000..828f35d ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_read_only.test -@@ -0,0 +1,23 @@ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# Ensure that the read_only option does not apply to Galera appliers and that replication -+# continues, the way MySQL replication would. -+# -+ -+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; -+ -+--connection node_2 -+SET GLOBAL read_only=TRUE; -+ -+--connection node_1 -+INSERT INTO t1 VALUES (1); -+ -+--connection node_2 -+SELECT COUNT(*) = 1 FROM t1; -+ -+SET GLOBAL read_only=FALSE; -+ -+DROP TABLE t1; -+ -diff --git a/mysql-test/suite/galera/t/galera_repl_key_format_flat16.test b/mysql-test/suite/galera/t/galera_repl_key_format_flat16.test -new file mode 100644 -index 0000000..8749c20 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_repl_key_format_flat16.test -@@ -0,0 +1,34 @@ -+# -+# Test repl.key_format = FLAT16 . Since it is very difficult to cause a collision on a 16-byte hash, -+# we simply verify that the option is settable and that replication works. -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--connection node_1 -+--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options` -+SET GLOBAL wsrep_provider_options = 'repl.key_format=FLAT16'; -+ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (123); -+ -+CREATE TABLE t2 (f1 VARCHAR(256)) ENGINE=InnoDB; -+INSERT INTO t2 VALUES (REPEAT('a', 256)); -+ -+--connection node_2 -+SELECT COUNT(*) = 1 FROM t1; -+UPDATE t1 SET f1 = 234; -+UPDATE t2 SET f1 = REPEAT('b', 256); -+ -+--connection node_1 -+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 234; -+SELECT COUNT(*) = 1 FROM t2 WHERE f1 = REPEAT('b', 256); -+ -+ -+--disable_query_log -+--eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_orig'; -+--enable_query_log -+ -+DROP TABLE t1; -+DROP TABLE t2; -diff --git a/mysql-test/suite/galera/t/galera_repl_max_ws_size.test b/mysql-test/suite/galera/t/galera_repl_max_ws_size.test -new file mode 100644 -index 0000000..255e292 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_repl_max_ws_size.test -@@ -0,0 +1,27 @@ -+# -+# Test repl.max_ws_size . A transaction larger than this size can not commit. -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--connection node_1 -+--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options` -+ -+CREATE TABLE t1 (f1 VARCHAR(512)) ENGINE=InnoDB; -+ -+SET GLOBAL wsrep_provider_options = 'repl.max_ws_size=512'; -+ -+--error ER_ERROR_DURING_COMMIT -+INSERT INTO t1 VALUES (REPEAT('a', 512)); -+ -+SELECT COUNT(*) = 0 FROM t1; -+ -+--disable_query_log -+--eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_orig'; -+--enable_query_log -+ -+DROP TABLE t1; -+ -+CALL mtr.add_suppression("WSREP: Maximum writeset size exceeded by"); -+CALL mtr.add_suppression("WSREP: transaction size exceeded"); -diff --git a/mysql-test/suite/galera/t/galera_restart_nochanges.test b/mysql-test/suite/galera/t/galera_restart_nochanges.test -new file mode 100644 -index 0000000..8eb7617 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_restart_nochanges.test -@@ -0,0 +1,23 @@ -+# -+# This test restarts a slave while no updates have been performed on the master. No SST is performed. -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--connection node_1 -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+ -+--connection node_2 -+--source include/restart_mysqld.inc -+ -+--let $galera_connection_name = node_2a -+--let $galera_server_number = 2 -+--source include/galera_connect.inc -+--connection node_2a -+ -+SELECT COUNT(*) = 1 FROM t1; -+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_rsu_add_pk.test b/mysql-test/suite/galera/t/galera_rsu_add_pk.test -new file mode 100644 -index 0000000..1a5501a ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_rsu_add_pk.test -@@ -0,0 +1,44 @@ -+# -+# ALTER TABLE ... ADD PRIMARY KEY under Rolling Schema Upgrade -+# -+ -+--source include/big_test.inc -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--connection node_1 -+CREATE TABLE ten (f1 INTEGER); -+INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); -+ -+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB; -+ -+# Insert some values before the ALTER -+INSERT INTO t1 (f1) SELECT 000000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; -+ -+# Insert more values while the ALTER is running -+--send INSERT INTO t1 (f1) SELECT 100000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; -+ -+--connection node_2 -+SET GLOBAL wsrep_OSU_method = "RSU"; -+ALTER TABLE t1 ADD PRIMARY KEY (f1); -+SET GLOBAL wsrep_OSU_method = "TOI"; -+ -+# Insert values after the ALTER -+INSERT INTO t1 (f1) SELECT 200000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; -+ -+ -+SELECT COUNT(*) = 300000 FROM t1; -+SELECT MAX(f1) = 299999 FROM t1; -+ -+--connection node_1 -+--reap -+SELECT COUNT(*) = 300000 FROM t1; -+SELECT MAX(f1) = 299999 FROM t1; -+ -+SET GLOBAL wsrep_OSU_method = "RSU"; -+ALTER TABLE t1 ADD PRIMARY KEY (f1); -+SET GLOBAL wsrep_OSU_method = "TOI"; -+ -+ -+DROP TABLE t1; -+DROP TABLE ten; -diff --git a/mysql-test/suite/galera/t/galera_rsu_drop_pk.test b/mysql-test/suite/galera/t/galera_rsu_drop_pk.test -new file mode 100644 -index 0000000..c3ccf89 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_rsu_drop_pk.test -@@ -0,0 +1,58 @@ -+# -+# ALTER TABLE ... DROP PRIMARY KEY under Rolling Schema Upgrade -+# -+ -+--source include/big_test.inc -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--connection node_1 -+CREATE TABLE ten (f1 INTEGER); -+INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); -+ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB; -+ -+# Insert some values before the ALTER -+INSERT INTO t1 (f1) SELECT 000000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; -+ -+# Insert more values while the ALTER is running -+--send INSERT INTO t1 (f1) SELECT 100000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; -+ -+--connection node_2 -+SET GLOBAL wsrep_OSU_method = "RSU"; -+ALTER TABLE t1 DROP PRIMARY KEY; -+SET GLOBAL wsrep_OSU_method = "TOI"; -+ -+# Insert even more data after the ALTER has completed -+INSERT INTO t1 (f1) SELECT 200000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; -+ -+SELECT COUNT(*) = 300000 FROM t1; -+SELECT MAX(f1) = 299999 FROM t1; -+ -+--connection node_1 -+--reap -+SELECT COUNT(*) = 300000 FROM t1; -+SELECT MAX(f1) = 299999 FROM t1; -+ -+SET GLOBAL wsrep_OSU_method = "RSU"; -+ALTER TABLE t1 DROP PRIMARY KEY; -+SET GLOBAL wsrep_OSU_method = "TOI"; -+ -+# Insert some previously-conflicting values after the ALTER has been applied on all nodes. -+--connection node_2 -+INSERT INTO t1 (f1) VALUES (1); -+INSERT INTO t1 (f1) VALUES (10); -+ -+--connection node_1 -+SELECT COUNT(*) = 2 FROM t1 WHERE f1 = 1; -+SELECT COUNT(*) = 2 FROM t1 WHERE f1 = 10; -+ -+INSERT INTO t1 (f1) VALUES (100); -+INSERT INTO t1 (f1) VALUES (1000); -+ -+--connection node_2 -+SELECT COUNT(*) = 2 FROM t1 WHERE f1 = 100; -+SELECT COUNT(*) = 2 FROM t1 WHERE f1 = 1000; -+ -+DROP TABLE t1; -+DROP TABLE ten; -diff --git a/mysql-test/suite/galera/t/galera_rsu_error.test b/mysql-test/suite/galera/t/galera_rsu_error.test -new file mode 100644 -index 0000000..b762d2b ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_rsu_error.test -@@ -0,0 +1,31 @@ -+# -+# Test DDL errors under Rolling Schema Upgrade -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB; -+INSERT INTO t1 VALUES (1), (1); -+ -+--connection node_2 -+SET GLOBAL wsrep_OSU_method = "RSU"; -+--error ER_DUP_ENTRY -+ALTER TABLE t1 ADD PRIMARY KEY (f1); -+SET GLOBAL wsrep_OSU_method = "TOI"; -+ -+# The ALTER has no effect -+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE TABLE_NAME = 't1'; -+ -+INSERT INTO t1 VALUES (1); -+ -+--connection node_1 -+SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE TABLE_NAME = 't1'; -+SELECT COUNT(*) = 3 FROM t1; -+ -+INSERT INTO t1 VALUES (1); -+ -+--connection node_2 -+SELECT COUNT(3) = 4 FROM t1; -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_rsu_simple.test b/mysql-test/suite/galera/t/galera_rsu_simple.test -new file mode 100644 -index 0000000..ea0eec1 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_rsu_simple.test -@@ -0,0 +1,35 @@ -+# -+# Test Rolling Schema Upgrade -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB; -+ -+--connection node_2 -+SET GLOBAL wsrep_OSU_method = "RSU"; -+ALTER TABLE t1 ADD COLUMN f2 INTEGER; -+SET GLOBAL wsrep_OSU_method = "TOI"; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+ -+--connection node_1 -+# The ALTER above is not visible on node_1 -+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+ -+INSERT INTO t1 VALUES (1); -+ -+--connection node_2 -+# The INSERT above is now visible on node_2 -+SELECT COUNT(*) = 1 FROM t1; -+ -+INSERT INTO t1 (f1) VALUES (2); -+ -+--connection node_1 -+# The ALTER has not replicated -+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+ -+# However the INSERT above has -+SELECT COUNT(*) = 2 FROM t1; -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_sbr.test b/mysql-test/suite/galera/t/galera_sbr.test -new file mode 100644 -index 0000000..b598759 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_sbr.test -@@ -0,0 +1,27 @@ -+# -+# Test behavior if the user attempts to use statement-based replication -+# -+# SBR is not currently supported but we expect that no crashes or binlog-related assertions will be triggered. -+# -+ -+--source include/have_innodb.inc -+--source include/galera_cluster.inc -+ -+--connection node_1 -+SET GLOBAL binlog_format = 'STATEMENT'; -+SET SESSION binlog_format = 'STATEMENT'; -+ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+ -+SET SESSION binlog_format = 'MIXED'; -+ -+INSERT INTO t1 VALUES (2); -+ -+--connection node_2 -+SELECT COUNT(*) = 2 FROM t1; -+ -+DROP TABLE t1; -+ -+--connection node_1 -+SET GLOBAL binlog_format = 'ROW'; -diff --git a/mysql-test/suite/galera/t/galera_sbr_binlog-master.opt b/mysql-test/suite/galera/t/galera_sbr_binlog-master.opt -new file mode 100644 -index 0000000..beae84b ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_sbr_binlog-master.opt -@@ -0,0 +1 @@ -+--log-bin -diff --git a/mysql-test/suite/galera/t/galera_sbr_binlog.test b/mysql-test/suite/galera/t/galera_sbr_binlog.test -new file mode 100644 -index 0000000..23e490a ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_sbr_binlog.test -@@ -0,0 +1,28 @@ -+# -+# Test behavior if the user attempts to use statement-based replication -+# -+# SBR is not currently supported but we expect that no crashes or binlog-related assertions will be triggered. -+# -+ -+--source include/have_log_bin.inc -+--source include/have_innodb.inc -+--source include/galera_cluster.inc -+ -+--connection node_1 -+SET GLOBAL binlog_format = 'STATEMENT'; -+SET SESSION binlog_format = 'STATEMENT'; -+ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+ -+SET SESSION binlog_format = 'MIXED'; -+ -+INSERT INTO t1 VALUES (2); -+ -+--connection node_2 -+SELECT COUNT(*) = 2 FROM t1; -+ -+DROP TABLE t1; -+ -+--connection node_1 -+SET GLOBAL binlog_format = 'ROW'; -diff --git a/mysql-test/suite/galera/t/galera_split_brain.test b/mysql-test/suite/galera/t/galera_split_brain.test -new file mode 100644 -index 0000000..4e53e96 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_split_brain.test -@@ -0,0 +1,38 @@ -+# -+# Confirm that with two nodes, killing one causes the other to stop accepting connections -+# The pc.ignore_sb=true wsrep_provider option is tested in the galera_kill_* tests. -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+call mtr.add_suppression("WSREP: TO isolation failed for: "); -+ -+--connection node_1 -+--let $wsrep_cluster_address_orig = `SELECT @@wsrep_cluster_address` -+ -+--connection node_2 -+--source include/kill_galera.inc -+ -+--connection node_1 -+--error ER_LOCK_DEADLOCK -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+ -+# Reset the master and restart the slave so that post-test checks can run -+ -+SET GLOBAL wsrep_cluster_address = ''; -+--disable_query_log -+--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig'; -+--enable_query_log -+ -+--source include/start_mysqld.inc -+--sleep 5 -+--source include/wait_until_connected_again.inc -+ -+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' -+--source include/wait_condition.inc -+ -+--sleep 5 -+ -+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2 -+--source include/wait_until_connected_again.inc -diff --git a/mysql-test/suite/galera/t/galera_sql_log_bin_zero.test b/mysql-test/suite/galera/t/galera_sql_log_bin_zero.test -new file mode 100644 -index 0000000..b6965fa ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_sql_log_bin_zero.test -@@ -0,0 +1,25 @@ -+# -+# Test SET SESSION sql_log_bin = 0 . We expect that unlogged updates will not be replicated -+# to the slave and that there will be no assertions in the process. -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+ -+SET SESSION sql_log_bin = 0; -+ -+INSERT INTO t1 VALUES (1); -+ -+SET SESSION sql_log_bin = 1; -+ -+INSERT INTO t1 VALUES (2); -+ -+ -+--connection node_2 -+SELECT COUNT(*) = 1 FROM t1; -+SELECT COUNT(*) = 0 FROM t1 WHERE f1 = 1; -+ -+--connection node_1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_ssl.cnf b/mysql-test/suite/galera/t/galera_ssl.cnf -new file mode 100644 -index 0000000..59ea286 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_ssl.cnf -@@ -0,0 +1,51 @@ -+# Use default setting for mysqld processes -+!include include/default_mysqld.cnf -+ -+[mysqld.1] -+binlog-format=row -+ -+wsrep_provider=@ENV.WSREP_PROVIDER -+wsrep_cluster_address='gcomm://' -+wsrep_provider_options='base_port=@mysqld.1.#galera_port;socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/galera-key.pem' -+ -+# enforce read-committed characteristics across the cluster -+wsrep_causal_reads=ON -+wsrep_sync_wait = 7 -+ -+wsrep_node_address=127.0.0.1 -+wsrep_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port -+wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port -+ -+# Required for Galera -+innodb_autoinc_lock_mode=2 -+ -+[mysqld.2] -+binlog-format=row -+ -+wsrep_provider=@ENV.WSREP_PROVIDER -+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port' -+wsrep_provider_options='base_port=@mysqld.2.#galera_port;socket.ssl=yes;socket.ssl_cert=@ENV.MYSQL_TEST_DIR/std_data/galera-cert.pem;socket.ssl_key=@ENV.MYSQL_TEST_DIR/std_data/galera-key.pem' -+ -+# enforce read-committed characteristics across the cluster -+wsrep_causal_reads=ON -+wsrep_sync_wait = 7 -+ -+wsrep_node_address=127.0.0.1 -+wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port -+wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port -+ -+# Required for Galera -+innodb_autoinc_lock_mode=2 -+ -+[ENV] -+NODE_MYPORT_1= @mysqld.1.port -+NODE_MYSOCK_1= @mysqld.1.socket -+ -+NODE_MYPORT_2= @mysqld.2.port -+NODE_MYSOCK_2= @mysqld.2.socket -+ -+NODE_GALERAPORT_1= @mysqld.1.#galera_port -+NODE_GALERAPORT_2= @mysqld.2.#galera_port -+ -+NODE_SSTPORT_1= @mysqld.1.#sst_port -+NODE_SSTPORT_2= @mysqld.2.#sst_port -diff --git a/mysql-test/suite/galera/t/galera_ssl.test b/mysql-test/suite/galera/t/galera_ssl.test -new file mode 100644 -index 0000000..8dc94dc ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_ssl.test -@@ -0,0 +1,24 @@ -+# -+# Test node connections over SSL. The accompanying galera_ssl.cnf has a customized -+# wsrep_provider_options setting that enables SSL. -+# -+# At this time, the actual operation of SSL is not visible only in the error log and not in SHOW STATUS. -+# So this test can only check that the cluster has formed and is replicating. -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; -+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB; -+INSERT INTO t1 VALUES (1); -+ -+--connection node_2 -+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; -+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+ -+SELECT COUNT(*) = 1 FROM t1; -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_sst_mysqldump.cnf b/mysql-test/suite/galera/t/galera_sst_mysqldump.cnf -new file mode 100644 -index 0000000..574ae28 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_sst_mysqldump.cnf -@@ -0,0 +1,11 @@ -+!include ../galera_2nodes.cnf -+ -+# We do not set mysqldump-related SST options here because doing so on startup -+# causes the first MTR connection to be forefully dropped by Galera, which in turn confuses MTR -+ -+[mysqld.1] -+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true' -+ -+[mysqld.2] -+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true' -+ -diff --git a/mysql-test/suite/galera/t/galera_sst_mysqldump.test b/mysql-test/suite/galera/t/galera_sst_mysqldump.test -new file mode 100644 -index 0000000..0b71715 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_sst_mysqldump.test -@@ -0,0 +1,18 @@ -+--source include/big_test.inc -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--source suite/galera/include/galera_sst_set_mysqldump.inc -+ -+--source suite/galera/include/galera_st_disconnect_slave.inc -+ -+# We set the required mysqldump SST options here so that they are used every time the server is restarted during the test -+--let $start_mysqld_params = --wsrep_sst_auth=sst:sst --wsrep_sst_method=mysqldump --wsrep-sst-receive-address=127.0.0.1:$NODE_MYPORT_2 --skip-grant-tables -+ -+--source suite/galera/include/galera_st_shutdown_slave.inc -+--source suite/galera/include/galera_st_clean_slave.inc -+ -+--source suite/galera/include/galera_st_kill_slave.inc -+--source suite/galera/include/galera_st_kill_slave_ddl.inc -+ -+--source suite/galera/include/galera_sst_restore.inc -diff --git a/mysql-test/suite/galera/t/galera_sst_rsync.cnf b/mysql-test/suite/galera/t/galera_sst_rsync.cnf -new file mode 100644 -index 0000000..93981d9 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_sst_rsync.cnf -@@ -0,0 +1,11 @@ -+!include ../galera_2nodes.cnf -+ -+[mysqld] -+wsrep_sst_method=rsync -+ -+[mysqld.1] -+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true' -+ -+[mysqld.2] -+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true' -+ -diff --git a/mysql-test/suite/galera/t/galera_sst_rsync.test b/mysql-test/suite/galera/t/galera_sst_rsync.test -new file mode 100644 -index 0000000..c682379 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_sst_rsync.test -@@ -0,0 +1,9 @@ -+--source include/big_test.inc -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--source suite/galera/include/galera_st_shutdown_slave.inc -+--source suite/galera/include/galera_st_clean_slave.inc -+ -+--source suite/galera/include/galera_st_kill_slave.inc -+--source suite/galera/include/galera_st_kill_slave_ddl.inc -diff --git a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.cnf b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.cnf -new file mode 100644 -index 0000000..47cb3e0 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.cnf -@@ -0,0 +1,13 @@ -+!include ../galera_2nodes.cnf -+ -+[mysqld] -+wsrep_sst_method=xtrabackup-v2 -+wsrep_sst_auth="root:" -+wsrep_debug=ON -+ -+[mysqld.1] -+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true' -+ -+[mysqld.2] -+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true' -+ -diff --git a/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.test b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.test -new file mode 100644 -index 0000000..c682379 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_sst_xtrabackup-v2.test -@@ -0,0 +1,9 @@ -+--source include/big_test.inc -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--source suite/galera/include/galera_st_shutdown_slave.inc -+--source suite/galera/include/galera_st_clean_slave.inc -+ -+--source suite/galera/include/galera_st_kill_slave.inc -+--source suite/galera/include/galera_st_kill_slave_ddl.inc -diff --git a/mysql-test/suite/galera/t/galera_status_cluster.test b/mysql-test/suite/galera/t/galera_status_cluster.test -new file mode 100644 -index 0000000..3299613 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_status_cluster.test -@@ -0,0 +1,18 @@ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# A simple test for the wsrep_cluster_* status variables -+# -+ -+--connection node_1 -+ -+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -+ -+--connection node_2 -+ -+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -+ -+ -diff --git a/mysql-test/suite/galera/t/galera_status_local_state.test b/mysql-test/suite/galera/t/galera_status_local_state.test -new file mode 100644 -index 0000000..09cdb25 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_status_local_state.test -@@ -0,0 +1,28 @@ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# Test wsrep_local_state . We can not reliably produce all possible statuses in MTR, but -+# we can at least test for the ones we can. -+# -+ -+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state'; -+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; -+ -+SET GLOBAL wsrep_desync = 1; -+ -+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state'; -+--source include/wait_condition.inc -+ -+SELECT VARIABLE_VALUE = 'Donor/Desynced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; -+ -+SET GLOBAL wsrep_desync = 0; -+ -+--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state'; -+--source include/wait_condition.inc -+ -+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; -+ -+ -+ -+ -diff --git a/mysql-test/suite/galera/t/galera_suspend_slave.test b/mysql-test/suite/galera/t/galera_suspend_slave.test -new file mode 100644 -index 0000000..6330711 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_suspend_slave.test -@@ -0,0 +1,51 @@ -+## -+## This test tests that transactions on the master will fail if the slave -+## is made completely unresponsive by suspending the process. Resuming the -+## process should allow replication to continue to run. -+## -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--connection node_1 -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+ -+--connection node_2 -+--let NODE_2_PIDFILE = `SELECT @@pid_file` -+--disconnect node_2 -+ -+--connection node_1 -+--echo Suspending node_2 ... -+--perl -+ my $pid_filename = $ENV{'NODE_2_PIDFILE'}; -+ my $mysqld_pid = `cat $pid_filename`; -+ chomp($mysqld_pid); -+ system("kill -19 $mysqld_pid"); -+ exit(0); -+EOF -+ -+--error ER_UNKNOWN_COM_ERROR,ER_LOCK_WAIT_TIMEOUT -+INSERT INTO t1 VALUES (1); -+ -+--echo Resuming node_2 ... -+--perl -+ my $pid_filename = $ENV{'NODE_2_PIDFILE'}; -+ my $mysqld_pid = `cat $pid_filename`; -+ chomp($mysqld_pid); -+ system("kill -18 $mysqld_pid"); -+ exit(0); -+EOF -+ -+--sleep 10 -+--source include/galera_wait_ready.inc -+INSERT INTO t1 VALUES (1); -+ -+--let $galera_connection_name = node_2a -+--let $galera_server_number = 2 -+--source include/galera_connect.inc -+--connection node_2a -+ -+--source include/galera_wait_ready.inc -+SELECT COUNT(*) = 1 FROM t1; -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_toi_alter_auto_increment.test b/mysql-test/suite/galera/t/galera_toi_alter_auto_increment.test -new file mode 100644 -index 0000000..641d210 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_toi_alter_auto_increment.test -@@ -0,0 +1,120 @@ -+ -+# -+# Test the operation of ALTER TABLE ... AUTO_INCREMENT -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--connection node_1 -+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); -+ -+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB; -+ -+INSERT INTO t1 (f2) SELECT 1 FROM ten; -+ -+--connection node_2 -+INSERT INTO t1 (f2) SELECT 1 FROM ten; -+ -+ALTER TABLE t1 AUTO_INCREMENT = 1000; -+INSERT INTO t1 (f2) SELECT 1 FROM ten; -+ -+--connection node_1 -+INSERT INTO t1 (f2) SELECT 1 FROM ten; -+ -+SELECT MIN(f1) >= 1000, COUNT(*) = 20, COUNT(DISTINCT f1) = 20 FROM t1 WHERE f1 >= 1000; -+ -+--connection node_2 -+SELECT MIN(f1) >= 1000, COUNT(*) = 20, COUNT(DISTINCT f1) = 20 FROM t1 WHERE f1 >= 1000; -+ -+# -+# AUTO_INCREMENT set to a value lower than the current one. -+# The ALTER does nothing, the sequence continues from the current maximum. -+# -+ -+--connection node_1 -+ALTER TABLE t1 AUTO_INCREMENT = 5; -+INSERT INTO t1 (f2) SELECT 1 FROM ten; -+ -+--connection node_2 -+INSERT INTO t1 (f2) SELECT 1 FROM ten; -+SELECT MIN(f1) >= 1000, COUNT(*) = 40, COUNT(DISTINCT f1) = 40 FROM t1 WHERE f1 >= 1000; -+ -+--connection node_1 -+SELECT MIN(f1) >= 1000, COUNT(*) = 40, COUNT(DISTINCT f1) = 40 FROM t1 WHERE f1 >= 1000; -+ -+DROP TABLE t1; -+ -+# -+# Under wsrep_auto_increment_control = OFF -+# -+ -+--connection node_1 -+--let $auto_increment_control_orig = `SELECT @@wsrep_auto_increment_control` -+--let $auto_increment_increment_node1 = `SELECT @@auto_increment_increment` -+--let $auto_increment_offset_node1 = `SELECT @@auto_increment_offset` -+ -+# Restore stock MySQL defaults -+SET GLOBAL wsrep_auto_increment_control = OFF; -+SET GLOBAL auto_increment_increment = 1; -+SET GLOBAL auto_increment_offset = 1; -+ -+#Open a fresh connection to node_1 so that the variables above take effect -+--let $galera_connection_name = node_1a -+--let $galera_server_number = 1 -+--source include/galera_connect.inc -+ -+--connection node_2 -+--let $auto_increment_increment_node2 = `SELECT @@auto_increment_increment` -+--let $auto_increment_offset_node2 = `SELECT @@auto_increment_offset` -+ -+SET GLOBAL wsrep_auto_increment_control = OFF; -+SET GLOBAL auto_increment_increment = 1; -+SET GLOBAL auto_increment_offset = 1; -+ -+#Open a fresh connection to node_2 -+--let $galera_connection_name = node_2a -+--let $galera_server_number = 2 -+--source include/galera_connect.inc -+ -+--connection node_1a -+ -+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB; -+ -+--connection node_2a -+ -+ALTER TABLE t1 AUTO_INCREMENT=100; -+ -+--connection node_1a -+INSERT INTO t1 (f2) SELECT 1 FROM ten; -+ -+--connection node_2a -+INSERT INTO t1 (f2) SELECT 1 FROM ten; -+ -+SELECT MIN(f1) = 100, MAX(f1) = 119, COUNT(f1) = 20, COUNT(DISTINCT f1) = 20 FROM t1; -+ -+--connection node_1a -+SELECT MIN(f1) = 100, MAX(f1) = 119, COUNT(f1) = 20, COUNT(DISTINCT f1) = 20 FROM t1; -+ -+DROP TABLE t1; -+ -+# -+# Restore all variables as they were -+# -+ -+--disable_query_log -+ -+--connection node_1 -+--eval SET GLOBAL wsrep_auto_increment_control = $auto_increment_control_orig -+--eval SET GLOBAL auto_increment_increment = $auto_increment_increment_node1 -+--eval SET GLOBAL auto_increment_offset = $auto_increment_offset_node1 -+ -+--connection node_2 -+--eval SET GLOBAL wsrep_auto_increment_control = $auto_increment_control_orig -+--eval SET GLOBAL auto_increment_increment = $auto_increment_increment_node2 -+--eval SET GLOBAL auto_increment_offset = $auto_increment_offset_node2 -+ -+--enable_query_log -+ -+DROP TABLE ten; -diff --git a/mysql-test/suite/galera/t/galera_toi_ddl_error.test b/mysql-test/suite/galera/t/galera_toi_ddl_error.test -new file mode 100644 -index 0000000..c586d97 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_toi_ddl_error.test -@@ -0,0 +1,29 @@ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+--source include/big_test.inc -+ -+# -+# Test the operation of DDLs that fail partway through -+# -+ -+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); -+ -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+ -+# Insert 100K rows -+INSERT INTO t1 (f1) SELECT (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; -+ -+# Insert one duplicate value -+INSERT INTO t1 (f1) SELECT MAX(f1) FROM t1; -+ -+--connection node_2 -+--error ER_DUP_ENTRY -+ALTER TABLE t1 ADD PRIMARY KEY (f1); -+SHOW CREATE TABLE t1; -+ -+--connection node_1 -+SHOW CREATE TABLE t1; -+ -+DROP TABLE t1; -+DROP TABLE ten; -diff --git a/mysql-test/suite/galera/t/galera_toi_ddl_fk_insert.test b/mysql-test/suite/galera/t/galera_toi_ddl_fk_insert.test -new file mode 100644 -index 0000000..1f44693 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_toi_ddl_fk_insert.test -@@ -0,0 +1,70 @@ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+--source include/big_test.inc -+ -+# -+# This test creates a new FK constraint while concurrent INSERTS are running -+# -+ -+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); -+ -+CREATE TABLE parent ( -+ id INT PRIMARY KEY AUTO_INCREMENT, -+ f2 INTEGER, -+ KEY (id) -+) ENGINE=InnoDB; -+ -+CREATE TABLE child ( -+ id INT PRIMARY KEY AUTO_INCREMENT, -+ parent_id INT -+) ENGINE=InnoDB; -+ -+INSERT INTO parent VALUES (DEFAULT, 0); -+ -+--connection node_2 -+--send INSERT INTO child (parent_id) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4; -+ -+--let $galera_connection_name = node_1a -+--let $galera_server_number = 1 -+--source include/galera_connect.inc -+--connection node_1a -+--send INSERT INTO parent (f2) SELECT 1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4; -+ -+--let $galera_connection_name = node_2a -+--let $galera_server_number = 2 -+--source include/galera_connect.inc -+--connection node_2a -+--send INSERT INTO parent (f2) SELECT 2 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4; -+ -+--let $galera_connection_name = node_1b -+--let $galera_server_number = 1 -+--source include/galera_connect.inc -+--connection node_1b -+--sleep 2 -+--send ALTER TABLE child ADD FOREIGN KEY (parent_id) REFERENCES parent(id); -+ -+--connection node_1a -+--reap -+ -+--connection node_1b -+--reap -+ -+--connection node_2 -+--reap -+ -+--connection node_2a -+--reap -+ -+--connection node_1 -+SELECT COUNT(*) = 20001 FROM parent; -+SELECT COUNT(*) = 10000 FROM child; -+ -+--connection node_2 -+SELECT COUNT(*) = 20001 FROM parent; -+SELECT COUNT(*) = 10000 FROM child; -+ -+DROP TABLE child; -+DROP TABLE parent; -+ -+DROP TABLE ten; -diff --git a/mysql-test/suite/galera/t/galera_toi_ddl_locking.test b/mysql-test/suite/galera/t/galera_toi_ddl_locking.test -new file mode 100644 -index 0000000..24f918a ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_toi_ddl_locking.test -@@ -0,0 +1,70 @@ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+--source include/have_debug.inc -+--source include/have_debug_sync.inc -+ -+# -+# Test that DDL indeed causes all nodes to block so even unrelated updates -+# are not allowed to proceed. We block the DDL using DBUG_SYNC -+# -+ -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB; -+ -+--connection node_1 -+SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue'; -+--send ALTER TABLE t1 ADD COLUMN f2 INTEGER; -+ -+--let $galera_connection_name = node_1a -+--let $galera_server_number = 1 -+--source include/galera_connect.inc -+ -+--let $galera_connection_name = node_1b -+--let $galera_server_number = 1 -+--source include/galera_connect.inc -+ -+--connection node_1a -+SET SESSION wsrep_sync_wait = 0; -+ -+# Allowed -+SELECT COUNT(*) = 0 FROM t1; -+ -+# Allowed -+SELECT COUNT(*) = 0 FROM t2; -+ -+# Not allowed -+--error ER_LOCK_DEADLOCK -+INSERT INTO t1 VALUES (1); -+ -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+ -+# Allowed -+INSERT INTO t2 VALUES (1); -+ -+# Hangs -+--send COMMIT; -+--sleep 1 -+ -+--connection node_1b -+SET SESSION wsrep_sync_wait = 0; -+ -+# The Commit issued above is still not done -+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO = 'Commit'; -+SELECT COUNT(*) = 0 FROM t2; -+SET DEBUG_SYNC= 'now SIGNAL continue'; -+ -+--connection node_1a -+--reap -+ -+--connection node_1 -+--reap -+SELECT COUNT(*) = 0 FROM t1; -+SELECT COUNT(*) = 1 FROM t2; -+ -+--connection node_2 -+SELECT COUNT(*) = 0 FROM t1; -+SELECT COUNT(*) = 1 FROM t2; -+ -+DROP TABLE t1; -+DROP TABLE t2; -diff --git a/mysql-test/suite/galera/t/galera_toi_ddl_nonconflicting.test b/mysql-test/suite/galera/t/galera_toi_ddl_nonconflicting.test -new file mode 100644 -index 0000000..821f7a6 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_toi_ddl_nonconflicting.test -@@ -0,0 +1,30 @@ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# In this test, we simultaneously send two non-conflicting ALTER TABLE statements -+# -+ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 INTEGER); -+ -+--connection node_2 -+--send ALTER TABLE t1 ADD COLUMN f3 INTEGER; INSERT INTO t1 (f1, f2) VALUES (DEFAULT, 123); -+ -+--connection node_1 -+--send CREATE UNIQUE INDEX i1 ON t1(f2); -+ -+--connection node_2 -+--reap -+INSERT INTO t1 (f1, f2) VALUES (DEFAULT, 234); -+ -+SELECT COUNT(*) = 3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME = 't1'; -+SELECT COUNT(*) = 2 FROM t1; -+ -+--connection node_1 -+--reap -+SELECT COUNT(*) = 3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1'; -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME = 't1'; -+SELECT COUNT(*) = 2 FROM t1; -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_toi_ddl_sequential.test b/mysql-test/suite/galera/t/galera_toi_ddl_sequential.test -new file mode 100644 -index 0000000..51eae70 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_toi_ddl_sequential.test -@@ -0,0 +1,29 @@ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# In this test, we send two ALTER TABLE statements that would only work if executed in the right order -+# -+ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+ -+--connection node_2 -+ALTER TABLE t1 ADD COLUMN f2 INTEGER; -+INSERT INTO t1 VALUES (2, 3); -+ -+--connection node_1 -+ALTER TABLE t1 DROP COLUMN f2; -+INSERT INTO t1 VALUES (4); -+ -+--connection node_2 -+SHOW CREATE TABLE t1; -+SELECT COUNT(*) = 3 FROM t1; -+SELECT * FROM t1 ORDER BY f1; -+ -+--connection node_1 -+SHOW CREATE TABLE t1; -+SELECT COUNT(*) = 3 FROM t1; -+SELECT * FROM t1 ORDER BY f1; -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_toi_ftwrl.test b/mysql-test/suite/galera/t/galera_toi_ftwrl.test -new file mode 100644 -index 0000000..4d0edef ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_toi_ftwrl.test -@@ -0,0 +1,22 @@ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# At this time, issing a FLUSH TABLES WITH READ LOCK on one node does not prevent DDLs from other nodes -+# from proceeding. The locked node will apply the DDL after it has been unlocked -+# -+ -+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; -+ -+--connection node_2 -+FLUSH TABLES WITH READ LOCK; -+ -+--connection node_1 -+ALTER TABLE t1 ADD COLUMN f2 INTEGER; -+ -+--connection node_2 -+UNLOCK TABLES; -+SHOW CREATE TABLE t1; -+ -+DROP TABLE t1; -+ -diff --git a/mysql-test/suite/galera/t/galera_toi_lock_exclusive.test b/mysql-test/suite/galera/t/galera_toi_lock_exclusive.test -new file mode 100644 -index 0000000..3c66286 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_toi_lock_exclusive.test -@@ -0,0 +1,38 @@ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# Ensure that ALTER LOCK=EXCLUSIVE works under TOI. It is difficult to check that concurrent operations -+# are truly not possible, but at least we expect no hangs or deadlocks -+# -+ -+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+ -+# Start a transaction that is concurrent to the DDL. This is not strictly necessary for this test -+# but does put more locks into play. -+--connection node_2 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES (2); -+ -+--let $galera_connection_name = node_2a -+--let $galera_server_number = 2 -+--source include/galera_connect.inc -+--connection node_2a -+ALTER TABLE t1 ADD COLUMN f2 INTEGER, LOCK=EXCLUSIVE; -+ -+# In Galera, a concurrent transaction aborts in the face of ALTER -+--connection node_2 -+--error ER_LOCK_DEADLOCK -+COMMIT; -+ -+--connection node_1 -+INSERT INTO t1 VALUES (2, 2); -+SELECT COUNT(*) = 2 FROM t1; -+ -+--connection node_2 -+INSERT INTO t1 VALUES (3, 3); -+SELECT COUNT(*) = 3 FROM t1; -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_toi_lock_shared.test b/mysql-test/suite/galera/t/galera_toi_lock_shared.test -new file mode 100644 -index 0000000..6857a0e ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_toi_lock_shared.test -@@ -0,0 +1,23 @@ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# Ensure that ALTER LOCK=SHARED works under TOI. It is difficult to check that concurrent operations -+# will be possible, but at least we expect no hangs or deadlocks -+# -+ -+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+ -+--connection node_2 -+ALTER TABLE t1 ADD COLUMN f2 INTEGER, LOCK=SHARED; -+ -+--connection node_1 -+INSERT INTO t1 VALUES (2, 2); -+SELECT COUNT(*) = 2 FROM t1; -+ -+--connection node_2 -+INSERT INTO t1 VALUES (3, 3); -+SELECT COUNT(*) = 3 FROM t1; -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_transaction_read_only.test b/mysql-test/suite/galera/t/galera_transaction_read_only.test -new file mode 100644 -index 0000000..386d73f ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_transaction_read_only.test -@@ -0,0 +1,58 @@ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# Ensure that transactions that do not write anything do not cause the wsrep_last_committed counter to advance -+# -+ -+# Empty transaction -+ -+--connection node_1 -+CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB; -+ -+--connection node_2 -+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'` -+ -+--connection node_1 -+ -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+COMMIT; -+ -+--connection node_2 -+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'` -+--disable_query_log -+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before AS wsrep_last_committed_diff; -+--enable_query_log -+ -+# START TRANSACTION READ ONLY -+ -+--connection node_2 -+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'` -+ -+--connection node_1 -+START TRANSACTION READ ONLY; -+SELECT COUNT(*) = 0 FROM t1; -+COMMIT; -+ -+--connection node_2 -+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'` -+--disable_query_log -+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before AS wsrep_last_committed_diff; -+--enable_query_log -+ -+# Ordinary transaction with only SELECTs -+ -+--connection node_1 -+START TRANSACTION; -+SELECT COUNT(*) = 0 FROM t1; -+COMMIT; -+ -+--connection node_2 -+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'` -+--disable_query_log -+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before AS wsrep_last_committed_diff; -+--enable_query_log -+ -+DROP TABLE t1; -+ -diff --git a/mysql-test/suite/galera/t/galera_transaction_replay.test b/mysql-test/suite/galera/t/galera_transaction_replay.test -new file mode 100644 -index 0000000..d2c74ab ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_transaction_replay.test -@@ -0,0 +1,63 @@ -+# -+# This test tests the operation of transaction replay. If a potentially conflicting remote transaction arrives at -+# just the right time during the commit of a local transaction, the local transaction will be aborted and replayed. -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+--source include/have_debug_sync.inc -+--source suite/galera/include/galera_have_debug_sync.inc -+ -+--let $wsrep_local_replays_old = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays'` -+ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1)); -+INSERT INTO t1 VALUES (1, 'a'); -+INSERT INTO t1 VALUES (2, 'a'); -+ -+--connection node_1 -+SET AUTOCOMMIT=ON; -+START TRANSACTION; -+ -+UPDATE t1 SET f2 = 'b' WHERE f1 = 1; -+SELECT * FROM t1 WHERE f1 = 2 FOR UPDATE; -+ -+# Block the commit -+--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1 -+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_enter_sync'; -+ -+--connection node_1 -+--send COMMIT; -+ -+# Wait until commit is blocked -+--connection node_1a -+SET SESSION wsrep_sync_wait = 0; -+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters' AND VARIABLE_VALUE = 'apply_monitor_enter_sync' -+--source include/wait_condition.inc -+ -+# Issue a conflicting update on node #2 -+--connection node_2 -+UPDATE t1 SET f2 = 'c' WHERE f1 = 2; -+ -+# Unblock the commit -+--connection node_1a -+SET GLOBAL wsrep_provider_options = 'dbug='; -+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_enter_sync'; -+ -+# Commit succeeds -+--connection node_1 -+--reap -+ -+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'b'; -+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c'; -+ -+# wsrep_local_replays has increased by 1 -+--let $wsrep_local_replays_new = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_replays'` -+--disable_query_log -+--eval SELECT $wsrep_local_replays_new - $wsrep_local_replays_old = 1 AS wsrep_local_replays; -+--enable_query_log -+ -+--connection node_2 -+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'b'; -+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c'; -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_truncate.test b/mysql-test/suite/galera/t/galera_truncate.test -new file mode 100644 -index 0000000..79f9bad ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_truncate.test -@@ -0,0 +1,57 @@ -+# -+# Test TRUNCATE -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# Simple case -+# -+ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB; -+ -+INSERT INTO t1 VALUES (1); -+ -+--connection node_2 -+TRUNCATE TABLE t1; -+SELECT COUNT(*) = 0 FROM t1; -+ -+--connection node_1 -+SELECT COUNT(*) = 0 FROM t1; -+ -+# -+# Table with no PK -+# -+ -+--connection node_2 -+CREATE TABLE t2 (f1 VARCHAR(255)) Engine=InnoDB; -+INSERT INTO t2 VALUES ('abc'); -+ -+--connection node_1 -+TRUNCATE TABLE t2; -+ -+--connection node_2 -+SELECT COUNT(*) = 0 FROM t2; -+ -+# -+# Table with AUTO_INCREMENT. The AUTO_INCREMENT counter must be reset on all nodes -+# -+ -+--connection node_1 -+CREATE TABLE t3 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY) Engine=InnoDB; -+INSERT INTO t3 VALUES (DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT); -+ -+CREATE TABLE t4 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY) Engine=InnoDB AUTO_INCREMENT=1234; -+INSERT INTO t4 VALUES (DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT); -+ -+TRUNCATE TABLE t3; -+TRUNCATE TABLE t4; -+ -+--connection node_2 -+SELECT AUTO_INCREMENT = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME IN ('t3', 't4'); -+ -+DROP TABLE t1; -+DROP TABLE t2; -+DROP TABLE t3; -+DROP TABLE t4; -diff --git a/mysql-test/suite/galera/t/galera_truncate_temporary.test b/mysql-test/suite/galera/t/galera_truncate_temporary.test -new file mode 100644 -index 0000000..3ad94eb ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_truncate_temporary.test -@@ -0,0 +1,82 @@ -+# -+# Test TRUNCATE on TEMPORARY tables. It should not be replicated -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TEMPORARY TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB; -+ -+INSERT INTO t1 VALUES (1); -+ -+TRUNCATE TABLE t1; -+SELECT COUNT(*) = 0 FROM t1; -+ -+--connection node_2 -+--error ER_NO_SUCH_TABLE -+SELECT * FROM t1; -+ -+--connection node_1 -+DROP TABLE t1; -+ -+# -+# Test the case where a TEMPORARY table is masking an existing one -+# -+ -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+ -+CREATE TEMPORARY TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (2); -+ -+SELECT f1 = 2 FROM t1; -+SELECT COUNT(*) = 1 FROM t1; -+ -+TRUNCATE TABLE t1; -+ -+SELECT COUNT(*) = 0 FROM t1; -+ -+--connection node_2 -+SELECT COUNT(*) = 1 FROM t1; -+SELECT f1 = 1 FROM t1; -+ -+--connection node_1 -+ -+DROP TABLE t1; -+SELECT COUNT(*) = 1 FROM t1; -+SELECT f1 = 1 FROM t1; -+ -+TRUNCATE TABLE t1; -+SELECT COUNT(*) = 0 FROM t1; -+ -+--connection node_2 -+SELECT COUNT(*) = 0 FROM t1; -+ -+--connection node_1 -+DROP TABLE t1; -+ -+# -+# Test the case where one node has a TEMPORARY table but the TRUNCATE arrives from another node -+# -+ -+--connection node_1 -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+ -+CREATE TEMPORARY TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (2); -+ -+--connection node_2 -+TRUNCATE TABLE t1; -+ -+SELECT COUNT(*) = 0 FROM t1; -+ -+--connection node_1 -+SELECT f1 = 2 FROM t1; -+SELECT COUNT(*) = 1 FROM t1; -+ -+DROP TABLE t1; -+ -+SELECT COUNT(*) = 0 FROM t1; -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_udf-master.opt b/mysql-test/suite/galera/t/galera_udf-master.opt -new file mode 100644 -index 0000000..14dfe3e ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_udf-master.opt -@@ -0,0 +1,2 @@ -+$UDF_EXAMPLE_LIB_OPT -+--query_cache_type=1 -diff --git a/mysql-test/suite/galera/t/galera_unicode_identifiers.test b/mysql-test/suite/galera/t/galera_unicode_identifiers.test -new file mode 100644 -index 0000000..2f255e9 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_unicode_identifiers.test -@@ -0,0 +1,72 @@ -+# -+# Test non-ascii table, column and index names -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--let $wsrep_sync_wait_orig = (SELECT @@wsrep_sync_wait) -+SET GLOBAL wsrep_sync_wait = 7; -+ -+--connection node_2 -+SET GLOBAL wsrep_sync_wait = 7; -+ -+--connection node_1 -+ -+# Spaces in identifiers -+ -+CREATE DATABASE `database with space`; -+USE `database with space`; -+CREATE TABLE `table with space` ( -+ `column with space` INTEGER AUTO_INCREMENT PRIMARY KEY, -+ `second column with space` INTEGER, -+ UNIQUE `index name with space` (`second column with space`) -+); -+INSERT INTO `table with space` VALUES (DEFAULT, 1); -+ -+# Unicode identifiers -+ -+CREATE DATABASE `база`; -+USE `база`; -+CREATE TABLE `таблица` ( -+ `първа_колона` INTEGER PRIMARY KEY, -+ `втора_колона` INTEGER, -+ UNIQUE `индекс` (`втора_колона`) -+); -+ -+INSERT INTO `таблица` VALUES (1, 1); -+ -+# Without a PK -+ -+CREATE DATABASE `втора база`; -+USE `втора база`; -+CREATE TABLE `втора таблица` ( -+ `първа колона` INTEGER, -+ `втора колона` INTEGER, -+ KEY `първи индекс` (`първа колона`) -+); -+ -+INSERT INTO `втора таблица` VALUES (1, 1); -+ -+--connection node_2 -+USE `database with space`; -+SELECT `second column with space` FROM `table with space`; -+ -+USE `база`; -+SELECT * FROM `таблица`; -+ -+USE `втора база`; -+SELECT `втора колона` FROM `втора таблица`; -+ -+--eval SET GLOBAL wsrep_sync_wait = $wsrep_sync_wait_orig -+ -+--connection node_1 -+DROP TABLE `database with space`.`table with space`; -+DROP TABLE `база`.`таблица`; -+DROP TABLE `втора база`.`втора таблица`; -+ -+DROP DATABASE `database with space`; -+DROP DATABASE `база`; -+DROP DATABASE `втора база`; -+--eval SET GLOBAL wsrep_sync_wait = $wsrep_sync_wait_orig -+ -diff --git a/mysql-test/suite/galera/t/galera_unicode_pk.test b/mysql-test/suite/galera/t/galera_unicode_pk.test -new file mode 100644 -index 0000000..0d571f5 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_unicode_pk.test -@@ -0,0 +1,64 @@ -+# -+# Test non-ascii data in table where the PK is unicode -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TABLE t1 ( -+ f1 VARCHAR(255) PRIMARY KEY -+) ENGINE=InnoDB DEFAULT CHARSET=utf8; -+ -+INSERT INTO t1 VALUES ('текст'); -+ -+--connection node_2 -+SELECT f1 = 'текст' FROM t1; -+ -+# -+# Provoke a conflict -+# -+ -+--connection node_1 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t1 SET f1 = 'текст2'; -+ -+--connection node_2 -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+UPDATE t1 SET f1 = 'текст3'; -+ -+--connection node_1 -+COMMIT; -+ -+--connection node_2 -+--error ER_LOCK_DEADLOCK -+COMMIT; -+ -+SELECT f1 = 'текст2' FROM t1; -+SELECT f1 = 'текст2' FROM t1 WHERE f1 = 'текст2'; -+ -+# -+# Provoke a duplicate key error -+# -+ -+--connection node_2 -+START TRANSACTION; -+INSERT INTO t1 VALUES ('текст4'); -+ -+--connection node_1 -+START TRANSACTION; -+INSERT INTO t1 VALUES ('текст4'); -+ -+--connection node_2 -+COMMIT; -+ -+--connection node_1 -+--error ER_LOCK_DEADLOCK -+COMMIT; -+ -+# Work around for mysql-wsrep#29 'Spurious deadlock error on a DROP TABLE' -+--error 0,ER_LOCK_DEADLOCK -+COMMIT; -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_update_limit.test b/mysql-test/suite/galera/t/galera_update_limit.test -new file mode 100644 -index 0000000..baacf2a ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_update_limit.test -@@ -0,0 +1,55 @@ -+# -+# UPDATE LIMIT should not cause any issues with row-based Galera replication -+# regardless of the order in which the rows were updated -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# With a PK -+# -+ -+--connection node_1 -+CREATE TABLE ten (f1 INTEGER) Engine=InnoDB; -+INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); -+ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB; -+INSERT INTO t1 SELECT f1 FROM ten ORDER BY RAND(); -+ -+--connection node_2 -+UPDATE IGNORE t1 SET f1 = FLOOR(1 + (RAND() * 10)) ORDER BY RAND() LIMIT 5; -+ -+# Check that the sum of all elements and the max element are identical across nodes -+# as this will indicate that the same UPDATE was applied to both nodes -+ -+--let $sum_rows = `SELECT SUM(f1) FROM t1` -+--let $max_row = `SELECT MAX(f1) FROM t1` -+ -+--connection node_1 -+--disable_query_log -+--eval SELECT (SELECT SUM(f1) FROM t1) = $sum_rows AS sum_matches; -+--eval SELECT f1 = $max_row AS max_matches FROM t1 WHERE f1 = $max_row; -+--enable_query_log -+ -+DROP TABLE t1; -+ -+# -+# Without a PK -+# -+ -+CREATE TABLE t2 (f1 INTEGER) Engine=InnoDB; -+INSERT INTO t2 SELECT f1 FROM ten ORDER BY RAND(); -+ -+--connection node_2 -+UPDATE IGNORE t2 SET f1 = FLOOR(1 + (RAND() * 10)) ORDER BY RAND() LIMIT 5; -+ -+--let $sum_rows = `SELECT SUM(f1) FROM t2` -+ -+--connection node_1 -+--disable_query_log -+--eval SELECT (SELECT SUM(f1) FROM t2) = $sum_rows AS sum_matches; -+--enable_query_log -+ -+DROP TABLE t2; -+DROP TABLE ten; -diff --git a/mysql-test/suite/galera/t/galera_v1_row_events-master.opt b/mysql-test/suite/galera/t/galera_v1_row_events-master.opt -new file mode 100644 -index 0000000..dc82542 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_v1_row_events-master.opt -@@ -0,0 +1 @@ -+--log-bin-use-v1-row-events=1 -diff --git a/mysql-test/suite/galera/t/galera_v1_row_events.test b/mysql-test/suite/galera/t/galera_v1_row_events.test -new file mode 100644 -index 0000000..0c0a044 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_v1_row_events.test -@@ -0,0 +1,21 @@ -+# -+# Test that Galera continues to run even with --log-bin-use-v1-row-events=1 -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB; -+ -+INSERT INTO t1 VALUES (1); -+ -+--connection node_2 -+SELECT COUNT(*) = 1 FROM t1; -+ -+--connection node_1 -+UPDATE t1 SET f1 = 2 WHERE f1 = 1; -+ -+--connection node_2 -+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_var_auto_inc_control_off.test b/mysql-test/suite/galera/t/galera_var_auto_inc_control_off.test -new file mode 100644 -index 0000000..c0bbe5a ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_var_auto_inc_control_off.test -@@ -0,0 +1,105 @@ -+# -+# Test wsrep_auto_increment_control = OFF -+# We issue two concurrent INSERTs and one will fail with a deadlock error -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--let $auto_increment_control_orig = `SELECT @@wsrep_auto_increment_control` -+ -+# -+# Preserve existing variable values -+# -+ -+--connection node_1 -+--let $auto_increment_increment_node1 = `SELECT @@auto_increment_increment` -+--let $auto_increment_offset_node1 = `SELECT @@auto_increment_offset` -+ -+# Restore stock MySQL defaults -+SET GLOBAL wsrep_auto_increment_control = OFF; -+SET GLOBAL auto_increment_increment = 1; -+SET GLOBAL auto_increment_offset = 1; -+ -+#Open a fresh connection to node_1 so that the variables above take effect -+--let $galera_connection_name = node_1a -+--let $galera_server_number = 1 -+--source include/galera_connect.inc -+ -+--connection node_2 -+--let $auto_increment_increment_node2 = `SELECT @@auto_increment_increment` -+--let $auto_increment_offset_node2 = `SELECT @@auto_increment_offset` -+ -+SET GLOBAL wsrep_auto_increment_control = OFF; -+SET GLOBAL auto_increment_increment = 1; -+SET GLOBAL auto_increment_offset = 1; -+ -+#Open a fresh connection to node_2 -+--let $galera_connection_name = node_2a -+--let $galera_server_number = 2 -+--source include/galera_connect.inc -+ -+--connection node_1a -+SELECT @@auto_increment_increment = 1; -+SELECT @@auto_increment_offset = 1; -+ -+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, node VARCHAR(10)) ENGINE=InnoDB; -+ -+# -+# We expect that SHOW CREATE TABLE on both nodes will return identical values -+# -+ -+SHOW CREATE TABLE t1; -+ -+--connection node_2a -+ -+SHOW CREATE TABLE t1; -+ -+--connection node_1a -+SELECT @@auto_increment_increment = 1; -+SELECT @@auto_increment_offset = 1; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (node) VALUES ('node1'); -+SELECT f1 FROM t1; -+ -+--connection node_2a -+SELECT @@auto_increment_increment = 1; -+SELECT @@auto_increment_offset = 1; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 (node) VALUES ('node2'); -+SELECT f1 FROM t1; -+ -+--connection node_1a -+COMMIT; -+ -+--connection node_2a -+--error ER_LOCK_DEADLOCK -+COMMIT; -+ -+--connection node_1a -+SELECT * FROM t1; -+ -+--connection node_2a -+SELECT * FROM t1; -+ -+# -+# Restore all variables as they were -+# -+ -+--disable_query_log -+ -+--connection node_1 -+--eval SET GLOBAL wsrep_auto_increment_control = $auto_increment_control_orig -+--eval SET GLOBAL auto_increment_increment = $auto_increment_increment_node1 -+--eval SET GLOBAL auto_increment_offset = $auto_increment_offset_node1 -+ -+--connection node_2 -+--eval SET GLOBAL wsrep_auto_increment_control = $auto_increment_control_orig -+--eval SET GLOBAL auto_increment_increment = $auto_increment_increment_node2 -+--eval SET GLOBAL auto_increment_offset = $auto_increment_offset_node2 -+ -+--enable_query_log -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_var_auto_inc_control_on.test b/mysql-test/suite/galera/t/galera_var_auto_inc_control_on.test -new file mode 100644 -index 0000000..59f2615 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_var_auto_inc_control_on.test -@@ -0,0 +1,53 @@ -+# -+# Test the operation of wsrep_auto_increment_control = ON -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--connection node_1 -+ -+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, node VARCHAR(10)) ENGINE=InnoDB; -+ -+# auto_increment_increment is equal to the number of nodes -+# auto_increment_offset is equal to the ID of the node -+ -+SELECT @@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'); -+SELECT @@auto_increment_offset = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index') + 1; -+ -+# Expect no conflicts -+--send INSERT INTO t1 VALUES (DEFAULT, 'node1'); -+ -+--connection node_2 -+--send INSERT INTO t1 VALUES (DEFAULT, 'node2'); -+ -+--connection node_1 -+--reap -+ -+--connection node_2 -+--reap -+ -+SELECT @@auto_increment_increment = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'); -+SELECT @@auto_increment_offset = (SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index') + 1; -+ -+# Expect no conflicts -+--send INSERT INTO t1 VALUES (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'), (DEFAULT, 'node2'); -+ -+--connection node_1 -+--send INSERT INTO t1 VALUES (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'), (DEFAULT, 'node1'); -+ -+--connection node_2 -+--reap -+ -+--connection node_1 -+--reap -+ -+--connection node_2 -+SELECT COUNT(*) = 22 FROM t1; -+SELECT COUNT(DISTINCT f1) = 22 FROM t1; -+ -+--connection node_1 -+SELECT COUNT(*) = 22 FROM t1; -+SELECT COUNT(DISTINCT f1) = 22 FROM t1; -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_var_certify_nonPK_off.test b/mysql-test/suite/galera/t/galera_var_certify_nonPK_off.test -new file mode 100644 -index 0000000..f7967da ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_var_certify_nonPK_off.test -@@ -0,0 +1,39 @@ -+# -+# Test wsrep_certify_nonPK = OFF -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--let $wsrep_certify_nonPK_orig = `SELECT @@wsrep_certify_nonPK` -+SET GLOBAL wsrep_certify_nonPK = OFF; -+ -+--connection node_2 -+SET GLOBAL wsrep_certify_nonPK = OFF; -+ -+--connection node_1 -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB /* Table has no primary key */; -+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+ -+# All DML without a PK is rejected with an error -+--error ER_LOCK_DEADLOCK -+INSERT INTO t1 VALUES (1), (2); -+ -+# DML with a PK is allowed to proceed -+INSERT INTO t2 VALUES (1), (2); -+UPDATE t2 SET f1 = 3 WHERE f1 = 1; -+ -+--connection node_2 -+SELECT COUNT(*) = 0 FROM t1; -+SELECT COUNT(*) = 2 FROM t2; -+SELECT COUNT(*) = 1 FROM t2 WHERE f1 = 3; -+ -+--connection node_1 -+--eval SET GLOBAL wsrep_certify_nonPK = $wsrep_certify_nonPK_orig -+ -+--connection node_2 -+--eval SET GLOBAL wsrep_certify_nonPK = $wsrep_certify_nonPK_orig -+ -+DROP TABLE t1; -+DROP TABLE t2; -+ -diff --git a/mysql-test/suite/galera/t/galera_var_cluster_address.test b/mysql-test/suite/galera/t/galera_var_cluster_address.test -new file mode 100644 -index 0000000..609c62c ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_var_cluster_address.test -@@ -0,0 +1,105 @@ -+# -+# Check the handling of @@wsrep_cluster_address -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# -+# Set to invalid value -+# -+ -+--connection node_1 -+--let $wsrep_cluster_address_node1 = `SELECT @@wsrep_cluster_address` -+SET GLOBAL wsrep_cluster_address = 'foo://'; -+ -+# With wsrep_sync_wait, this returns an error -+--error ER_LOCK_WAIT_TIMEOUT -+SHOW STATUS; -+ -+SET SESSION wsrep_sync_wait=0; -+ -+--error ER_UNKNOWN_COM_ERROR -+SELECT * FROM INFORMATION_SCHEMA.GLOBAL_STATUS; -+ -+# Must return 'OFF' -+SHOW STATUS LIKE 'wsrep_ready'; -+ -+# Must return 'Non-primary' -+SHOW STATUS LIKE 'wsrep_cluster_status'; -+ -+# Must return 0 = 'Initialized' -+SHOW STATUS LIKE 'wsrep_local_state'; -+SHOW STATUS LIKE 'wsrep_local_state_comment'; -+ -+--connection node_2 -+--sleep 1 -+# Node #2 thinks that it is now part of a single-node primary cluster -+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -+ -+# -+# Reset everything as it was -+# -+ -+--connection node_1 -+--disable_query_log -+--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_node1'; -+--enable_query_log -+ -+--connection node_2 -+SET GLOBAL wsrep_cluster_address = @@wsrep_cluster_address; -+ -+--source include/wait_until_connected_again.inc -+ -+--connection node_1 -+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+ -+# -+# Set to invalid host -+# -+ -+--connection node_1 -+SET GLOBAL wsrep_cluster_address = 'gcomm://192.0.2.1'; -+ -+--error ER_UNKNOWN_COM_ERROR -+SELECT * FROM INFORMATION_SCHEMA.GLOBAL_STATUS; -+ -+# Must return 'OFF' -+SHOW STATUS LIKE 'wsrep_ready'; -+ -+# Must return 'Non-primary' -+SHOW STATUS LIKE 'wsrep_cluster_status'; -+ -+# Must return 0 = 'Initialized' -+SHOW STATUS LIKE 'wsrep_local_state'; -+SHOW STATUS LIKE 'wsrep_local_state_comment'; -+ -+# -+# Reset everything as it was -+# -+ -+--connection node_1 -+--disable_query_log -+--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_node1'; -+--enable_query_log -+ -+--connection node_2 -+SET GLOBAL wsrep_cluster_address = @@wsrep_cluster_address; -+--sleep 1 -+ -+--connection node_1 -+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+ -+CALL mtr.add_suppression("Backend not supported: foo"); -+CALL mtr.add_suppression("Failed to initialize backend using 'foo"); -+CALL mtr.add_suppression("Failed to open channel 'my_wsrep_cluster' at 'foo"); -+CALL mtr.add_suppression("gcs connect failed: Socket type not supported"); -+CALL mtr.add_suppression("wsrep::connect\\(\\) failed: 7"); -+CALL mtr.add_suppression("gcs_caused\\(\\) returned -103 \\(Software caused connection abort\\)"); -+CALL mtr.add_suppression("failed to open gcomm backend connection: 110: failed to reach primary view: 110"); -+CALL mtr.add_suppression("Failed to open backend connection: -110 \\(Connection timed out\\)"); -+CALL mtr.add_suppression("Failed to open channel 'my_wsrep_cluster' at 'gcomm://192\\.0\\.2\\.1': -110 \\(Connection timed out\\)"); -+CALL mtr.add_suppression("gcs connect failed: Connection timed out"); -diff --git a/mysql-test/suite/galera/t/galera_var_desync_on.test b/mysql-test/suite/galera/t/galera_var_desync_on.test -new file mode 100644 -index 0000000..fb0fb9f ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_var_desync_on.test -@@ -0,0 +1,58 @@ -+# -+# Test wsrep_desync = ON . Node should temporarily not participate in flow control -+# so even if fc_limit has been reached, the master should be able to continue to -+# commit transactions. -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+ -+--connection node_2 -+--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options` -+SET GLOBAL wsrep_provider_options = 'gcs.fc_limit=1'; -+SET GLOBAL wsrep_desync = TRUE; -+ -+# Block the slave applier thread -+FLUSH TABLES WITH READ LOCK; -+ -+--connection node_1 -+ -+# Without wsrep_desync = TRUE it would not be possible to perform 10 inserts on the master with gcs.fc_limit=1 -+INSERT INTO t1 VALUES (2); -+INSERT INTO t1 VALUES (3); -+INSERT INTO t1 VALUES (4); -+INSERT INTO t1 VALUES (5); -+INSERT INTO t1 VALUES (6); -+INSERT INTO t1 VALUES (7); -+INSERT INTO t1 VALUES (8); -+INSERT INTO t1 VALUES (9); -+INSERT INTO t1 VALUES (10); -+--sleep 1 -+ -+--connection node_2 -+SET SESSION wsrep_sync_wait = 0; -+# No updates have arrived after the FLUSH TABLES -+SELECT COUNT(*) = 1 FROM t1; -+ -+# Resync the slave -+SET GLOBAL wsrep_desync = FALSE; -+--disable_query_log -+--eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_orig'; -+--enable_query_log -+UNLOCK TABLES; -+ -+SET SESSION wsrep_sync_wait = 1; -+# The slave is now fully caught up -+SELECT COUNT(*) = 10 FROM t1; -+ -+--connection node_1 -+INSERT INTO t1 VALUES (11); -+ -+--connection node_2 -+# Replication continues normally -+SELECT COUNT(*) = 11 FROM t1; -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_var_fkchecks.test b/mysql-test/suite/galera/t/galera_var_fkchecks.test -new file mode 100644 -index 0000000..c771b50 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_var_fkchecks.test -@@ -0,0 +1,40 @@ -+# -+# Test the operation on the foreign_key_checks variable -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TABLE parent ( -+ id INT PRIMARY KEY, -+ KEY (id) -+) ENGINE=InnoDB; -+ -+CREATE TABLE child ( -+ id INT PRIMARY KEY, -+ parent_id INT, -+ FOREIGN KEY (parent_id) -+ REFERENCES parent(id) -+) ENGINE=InnoDB; -+ -+INSERT INTO parent VALUES (1); -+INSERT INTO child VALUES (1,1); -+ -+SET SESSION foreign_key_checks = 0; -+ -+INSERT INTO child VALUES (2,2); -+ -+--connection node_2 -+SELECT COUNT(*) = 1 FROM child WHERE id = 2; -+ -+--error ER_NO_REFERENCED_ROW_2 -+INSERT INTO child VALUES (3,3); -+ -+SET SESSION foreign_key_checks = 0; -+DELETE FROM parent; -+ -+--connection node_1 -+SELECT COUNT(*) = 0 FROM parent; -+ -+DROP TABLE child; -+DROP TABLE parent; -diff --git a/mysql-test/suite/galera/t/galera_var_innodb_disallow_writes.test b/mysql-test/suite/galera/t/galera_var_innodb_disallow_writes.test -new file mode 100644 -index 0000000..c08483b ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_var_innodb_disallow_writes.test -@@ -0,0 +1,33 @@ -+# -+# This test checks that innodb_disallow_writes works as expected -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+# Open a separate connection to be used to run SHOW PROCESSLIST -+--let $galera_connection_name = node_1a -+--let $galera_server_number = 1 -+--source include/galera_connect.inc -+--connection node_1a -+SET SESSION wsrep_sync_wait = 0; -+ -+--connection node_1 -+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB; -+SET GLOBAL innodb_disallow_writes=ON; -+--send INSERT INTO t1 VALUES (1); -+ -+--connection node_1a -+let $wait_condition = SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO = 'INSERT INTO t1 VALUES (1)' AND State = 'query end'; -+--source include/wait_condition.inc -+ -+SET GLOBAL innodb_disallow_writes=OFF; -+ -+--connection node_1 -+--reap -+SELECT COUNT(*) = 1 FROM t1; -+ -+--connection node_2 -+SELECT COUNT(*) = 1 FROM t1; -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_var_load_data_splitting.test b/mysql-test/suite/galera/t/galera_var_load_data_splitting.test -new file mode 100644 -index 0000000..0783dc8 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_var_load_data_splitting.test -@@ -0,0 +1,38 @@ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--let $wsrep_load_data_splitting_orig = `SELECT @@wsrep_load_data_splitting` -+ -+# Create a file for LOAD DATA with 95K entries -+--perl -+open(FILE, ">", "$ENV{'MYSQLTEST_VARDIR'}/tmp/galera_var_load_data_splitting.csv") or die; -+foreach my $i (1..95000) { -+ print FILE "$i\n"; -+} -+EOF -+ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+ -+# Record wsrep_last_committed as it was before LOAD DATA -+--connection node_2 -+--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'` -+ -+SET GLOBAL wsrep_load_data_splitting = TRUE; -+--disable_query_log -+--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/galera_var_load_data_splitting.csv' INTO TABLE t1; -+--enable_query_log -+ -+--connection node_2 -+--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'` -+ -+SELECT COUNT(*) = 95000 FROM t1; -+ -+# LOAD-ing 95K rows causes 10 commits to be registered -+--disable_query_log -+--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 10 AS wsrep_last_committed_diff; -+--enable_query_log -+ -+--connection node_1 -+--eval SET GLOBAL wsrep_load_data_splitting = $wsrep_load_data_splitting_orig; -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_var_max_ws_size.test b/mysql-test/suite/galera/t/galera_var_max_ws_size.test -new file mode 100644 -index 0000000..bd98bab ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_var_max_ws_size.test -@@ -0,0 +1,26 @@ -+# -+# This test sets wsrep_max_ws_size to a very low value and checks that the transaction is rejected -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+call mtr.add_suppression('WSREP: transaction size limit.*'); -+call mtr.add_suppression('WSREP: rbr write fail.*'); -+call mtr.add_suppression('WSREP: Maximum writeset size exceeded by.*'); -+call mtr.add_suppression('WSREP: transaction size exceeded.*'); -+ -+CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 VARCHAR(1024)) Engine=InnoDB; -+ -+--let $wsrep_max_ws_size_orig = `SELECT @@wsrep_max_ws_size` -+SET GLOBAL wsrep_max_ws_size = 1024; -+ -+--error ER_ERROR_DURING_COMMIT -+INSERT INTO t1 VALUES (DEFAULT, REPEAT('X', 1024)); -+SELECT COUNT(*) = 0 FROM t1; -+ -+--disable_query_log -+--eval SET GLOBAL wsrep_max_ws_size = $wsrep_max_ws_size_orig -+--enable_query_log -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_var_mysql_replication_bundle.test b/mysql-test/suite/galera/t/galera_var_mysql_replication_bundle.test -new file mode 100644 -index 0000000..642d939 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_var_mysql_replication_bundle.test -@@ -0,0 +1,30 @@ -+# -+# Simple test for the operation on the wsrep-mysql-replication-bundle -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--let $wsrep_mysql_replication_bundle_orig = `SELECT @@wsrep_mysql_replication_bundle` -+ -+CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=InnoDB; -+ -+SET GLOBAL wsrep_mysql_replication_bundle = 2; -+ -+--connection node_1 -+# This statement will not be replicated immediately -+INSERT INTO t1 VALUES (1); -+ -+--connection node_2 -+SELECT COUNT(*) = 0 FROM t1; -+ -+--connection node_1 -+INSERT INTO t1 VALUES (2); -+ -+--connection node_2 -+SELECT COUNT(*) = 2 FROM t1; -+ -+--connection node_1 -+--eval SET GLOBAL wsrep_mysql_replication_bundle = $wsrep_mysql_replication_bundle_orig -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_var_notify_cmd-master.opt b/mysql-test/suite/galera/t/galera_var_notify_cmd-master.opt -new file mode 100644 -index 0000000..70dfc98 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_var_notify_cmd-master.opt -@@ -0,0 +1 @@ -+--wsrep_notify_cmd=$MYSQL_TEST_DIR/std_data/wsrep_notify.sh --wsrep-sync-wait=0 -diff --git a/mysql-test/suite/galera/t/galera_var_notify_cmd.test b/mysql-test/suite/galera/t/galera_var_notify_cmd.test -new file mode 100644 -index 0000000..4fea69f ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_var_notify_cmd.test -@@ -0,0 +1,14 @@ -+# -+# Test wsrep_notify_cmd. We use a version of the support-files/wsrep_notify.sh script that writes -+# notifications into a table. -+# -+ -+--source include/have_innodb.inc -+--source include/galera_cluster.inc -+ -+--connection node_1 -+SELECT COUNT(DISTINCT uuid) = 2 FROM mtr_wsrep_notify.membership; -+SELECT MAX(size) = 2 FROM mtr_wsrep_notify.status; -+SELECT COUNT(DISTINCT idx) = 2 FROM mtr_wsrep_notify.status; -+ -+DROP SCHEMA mtr_wsrep_notify; -diff --git a/mysql-test/suite/galera/t/galera_var_replicate_myisam_off.test b/mysql-test/suite/galera/t/galera_var_replicate_myisam_off.test -new file mode 100644 -index 0000000..a981128 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_var_replicate_myisam_off.test -@@ -0,0 +1,21 @@ -+# -+# Simple test for wsrep-replicate-myisam = FALSE -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--let $wsrep_replicate_myisam_orig = `SELECT @@wsrep_replicate_myisam` -+ -+SET GLOBAL wsrep_replicate_myisam = FALSE; -+ -+CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=MyISAM; -+INSERT INTO t1 VALUES (1); -+ -+--connection node_2 -+SELECT COUNT(*) = 0 FROM t1; -+ -+--connection node_1 -+--eval SET GLOBAL wsrep_replicate_myisam = $wsrep_replicate_myisam_orig -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_var_replicate_myisam_on.test b/mysql-test/suite/galera/t/galera_var_replicate_myisam_on.test -new file mode 100644 -index 0000000..a09ba2e ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_var_replicate_myisam_on.test -@@ -0,0 +1,138 @@ -+# -+# Simple test for wsrep-replicate-myisam = ON -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--let $wsrep_replicate_myisam_orig = `SELECT @@wsrep_replicate_myisam` -+ -+--connection node_1 -+SET GLOBAL wsrep_replicate_myisam = TRUE; -+--connection node_2 -+SET GLOBAL wsrep_replicate_myisam = TRUE; -+ -+# -+# Simple INSERT -+# -+ -+--connection node_1 -+CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=MyISAM; -+INSERT INTO t1 VALUES (1); -+INSERT INTO t1 VALUES (2), (3); -+INSERT INTO t1 SELECT 4 FROM DUAL UNION ALL SELECT 5 FROM DUAL; -+ -+--connection node_2 -+SELECT COUNT(*) = 5 FROM t1; -+ -+DROP TABLE t1; -+ -+# -+# REPLACE -+# -+ -+--connection node_1 -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 VARCHAR(100)) ENGINE=MyISAM; -+INSERT INTO t1 VALUES (1, 'abc'),(2,'abc'), (3, 'xxx'); -+REPLACE INTO t1 VALUES (1, 'klm'), (2,'xyz'); -+REPLACE INTO t1 SELECT 3, 'yyy' FROM DUAL; -+ -+--connection node_2 -+SELECT COUNT(*) = 3 FROM t1; -+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1 AND f2 = 'klm'; -+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2 AND f2 = 'xyz'; -+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 3 AND f2 = 'yyy'; -+ -+# -+# UPDATE -+# -+ -+--connection node_1 -+UPDATE t1 SET f2 = 'zzz' WHERE f2 = 'yyy'; -+ -+--connection node_2 -+SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'zzz'; -+ -+# -+# DELETE -+# -+ -+--connection node_1 -+DELETE FROM t1 WHERE f2 = 'zzz'; -+ -+--connection node_2 -+SELECT COUNT(*) = 0 FROM t1 WHERE f2 = 'zzz'; -+ -+# -+# TRUNCATE -+# -+ -+--connection node_1 -+TRUNCATE TABLE t1; -+ -+--connection node_2 -+SELECT COUNT(*) = 0 FROM t1; -+DROP TABLE t1; -+ -+# -+# Transaction -+# -+ -+--connection node_1 -+CREATE TABLE t1 (f1 INTEGER) ENGINE=MyISAM; -+CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES (1); -+INSERT INTO t2 VALUES (1); -+COMMIT; -+ -+--connection node_2 -+SELECT COUNT(*) = 1 FROM t1; -+SELECT COUNT(*) = 1 FROM t2; -+ -+# -+# Transaction rollback -+# -+ -+--connection node_1 -+START TRANSACTION; -+INSERT INTO t1 VALUES (2); -+INSERT INTO t2 VALUES (2); -+ROLLBACK; -+ -+--connection node_2 -+SELECT COUNT(*) = 2 FROM t1; -+SELECT COUNT(*) = 1 FROM t2; -+ -+DROP TABLE t1; -+DROP TABLE t2; -+ -+# -+# Transaction conflict -+# -+ -+--connection node_1 -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=MyISAM; -+CREATE TABLE t2 (f2 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+ -+START TRANSACTION; -+INSERT INTO t1 VALUES (1); -+INSERT INTO t2 VALUES (1); -+ -+--connection node_2 -+# The MyISAM update is replicated immediately, so a duplicate key error happens even before the COMMIT -+--error ER_DUP_ENTRY -+INSERT INTO t1 VALUES (1); -+ -+--connection node_1 -+COMMIT; -+ -+DROP TABLE t1; -+DROP TABLE t2; -+ -+--connection node_1 -+--eval SET GLOBAL wsrep_replicate_myisam = $wsrep_replicate_myisam_orig -+ -+--connection node_2 -+--eval SET GLOBAL wsrep_replicate_myisam = $wsrep_replicate_myisam_orig -diff --git a/mysql-test/suite/galera/t/galera_var_slave_threads.test b/mysql-test/suite/galera/t/galera_var_slave_threads.test -new file mode 100644 -index 0000000..a83924c ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_var_slave_threads.test -@@ -0,0 +1,70 @@ -+# -+# This tests the very basic operations around wsrep-slave-threads -+# More complex scenarios will be tested separately in the context of -+# parallel replication -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--let $wsrep_slave_threads_orig = `SELECT @@wsrep_slave_threads` -+ -+--connection node_1 -+CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=InnoDB; -+CREATE TABLE t2 (f1 INT AUTO_INCREMENT PRIMARY KEY) Engine=InnoDB; -+ -+--connection node_2 -+ -+# Setting wsrep_slave_threads to zero triggers a warning -+SET GLOBAL wsrep_slave_threads = 0; -+SHOW WARNINGS; -+SELECT @@wsrep_slave_threads = 1; -+ -+SET GLOBAL wsrep_slave_threads = 1; -+# There is a separate wsrep_aborter thread at all times -+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user'; -+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; -+ -+# -+# Increase the number of slave threads. The change takes effect immediately -+# -+ -+SET GLOBAL wsrep_slave_threads = 64; -+--sleep 0.5 -+ -+--connection node_1 -+INSERT INTO t1 VALUES (1); -+ -+--connection node_2 -+SELECT COUNT(*) = 1 FROM t1; -+ -+SELECT COUNT(*) = @@wsrep_slave_threads + 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user'; -+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; -+ -+# -+# Reduce the number of slave threads. The change is not immediate -- a thread will only exit after a replication event -+# -+ -+SET GLOBAL wsrep_slave_threads = 1; -+ -+--connection node_1 -+ -+# Generate 64 replication events -+--let $count = 64 -+while ($count) -+{ -+ INSERT INTO t2 VALUES (DEFAULT); -+ --dec $count -+} -+ -+--connection node_2 -+SELECT COUNT(*) = 64 FROM t2; -+ -+SELECT COUNT(*) = @@wsrep_slave_threads + 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user'; -+SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; -+ -+ -+--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig -+ -+DROP TABLE t1; -+DROP TABLE t2; -diff --git a/mysql-test/suite/galera/t/galera_var_sync_wait.test b/mysql-test/suite/galera/t/galera_var_sync_wait.test -new file mode 100644 -index 0000000..935c271 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_var_sync_wait.test -@@ -0,0 +1,43 @@ -+# -+# Simple test for the various levels of wsrep-sync-wait -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--let $wsrep_sync_wait_orig = `SELECT @@wsrep_sync_wait` -+ -+--connection node_1 -+CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=InnoDB; -+ -+--connection node_2 -+SET GLOBAL wsrep_sync_wait = 1; -+# Those statements should see the table -+SHOW TABLES LIKE '%t1'; -+SELECT COUNT(*) = 0 FROM t1; -+ -+--connection node_1 -+CREATE TABLE t2 (f1 INT PRIMARY KEY) Engine=InnoDB; -+ -+--connection node_2 -+SET GLOBAL wsrep_sync_wait = 4; -+# This insert should see the table and succeed -+INSERT INTO t2 VALUES (1); -+ -+--connection node_1 -+CREATE TABLE t3 (f1 INT PRIMARY KEY) Engine=InnoDB; -+INSERT INTO t3 VALUES (1); -+ -+--connection node_2 -+SET GLOBAL wsrep_sync_wait = 2; -+# This statement should see and update 1 row -+--enable_info -+UPDATE t3 SET f1 = 2; -+--disable_info -+ -+--connection node_2 -+--eval SET GLOBAL wsrep_sync_wait = $wsrep_sync_wait_orig -+ -+DROP TABLE t1; -+DROP TABLE t2; -+DROP TABLE t3; -diff --git a/mysql-test/suite/galera/t/galera_var_wsrep_on_off.test b/mysql-test/suite/galera/t/galera_var_wsrep_on_off.test -new file mode 100644 -index 0000000..783b787 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_var_wsrep_on_off.test -@@ -0,0 +1,32 @@ -+# -+# Test wsrep_on = OFF. Some events will not be replicated -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+SET SESSION wsrep_on = FALSE; -+ -+# This statement will not be replicated -+INSERT INTO t1 VALUES (2); -+ -+--connection node_2 -+SELECT COUNT(*) = 1 FROM t1; -+ -+--connection node_1 -+SET GLOBAL wsrep_on = TRUE; -+INSERT INTO t1 VALUES (3); -+ -+--connection node_2 -+SELECT COUNT(*) = 2 FROM t1; -+ -+# Middle insert is not replicated -+SELECT COUNT(*) = 0 FROM t1 WHERE f1 = 2; -+ -+# Final insert is replicated -+SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 3; -+ -+DROP TABLE t1; -+ -diff --git a/mysql-test/suite/galera/t/galera_wan.cnf b/mysql-test/suite/galera/t/galera_wan.cnf -new file mode 100644 -index 0000000..37ac58a ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_wan.cnf -@@ -0,0 +1,14 @@ -+!include ../galera_4nodes.cnf -+ -+[mysqld.1] -+wsrep_provider_options='base_port=@mysqld.1.#galera_port;gmcast.segment=1' -+ -+[mysqld.2] -+wsrep_provider_options='base_port=@mysqld.2.#galera_port;gmcast.segment=1' -+ -+[mysqld.3] -+wsrep_provider_options='base_port=@mysqld.3.#galera_port;gmcast.segment=2' -+ -+[mysqld.4] -+wsrep_provider_options='base_port=@mysqld.4.#galera_port;gmcast.segment=3' -+ -diff --git a/mysql-test/suite/galera/t/galera_wan.test b/mysql-test/suite/galera/t/galera_wan.test -new file mode 100644 -index 0000000..a8fd351 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_wan.test -@@ -0,0 +1,30 @@ -+# -+# Test WAN replication and the gmcast.segment functionality. -+# The galera_wan.cnf file partitions 4 Galera nodes into 3 WAN segments -+# -+# We can not test any of the actual WAN optimizations from inside MTR and no -+# status variables are provided. So we only check that simple replication works. -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+ -+--connection node_1 -+CREATE TABLE t1 (f1 INTEGER); -+ -+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 -+--connection node_3 -+INSERT INTO t1 VALUES (1); -+CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside"); -+ -+--connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4 -+--connection node_4 -+SELECT VARIABLE_VALUE LIKE '%gmcast.segment = 3%' FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME = 'wsrep_provider_options'; -+ -+SELECT COUNT(*) = 1 FROM t1; -+ -+DROP TABLE t1; -+ -+CALL mtr.add_suppression("There are no nodes in the same segment that will ever be able to become donors, yet there is a suitable donor outside"); -diff --git a/mysql-test/suite/galera/t/galera_wsrep_desync_wsrep_on.test b/mysql-test/suite/galera/t/galera_wsrep_desync_wsrep_on.test -new file mode 100644 -index 0000000..3c7988a ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_wsrep_desync_wsrep_on.test -@@ -0,0 +1,57 @@ -+# -+# Test the wsrep_desync + wsrep_on method for schema upgrades discussed at -+# http://www.slideshare.net/Severalnines/schema-upgrades-codershippresodec2013 , slide 30 -+# -+ -+--source include/big_test.inc -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--connection node_1 -+CREATE TABLE ten (f1 INTEGER); -+INSERT INTO ten VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); -+ -+CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB; -+ -+# Insert some values before the ALTER -+INSERT INTO t1 (f1) SELECT 000000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; -+ -+--connection node_2 -+SET GLOBAL wsrep_desync = TRUE; -+SET SESSION wsrep_on = FALSE; -+ -+ALTER TABLE t1 ADD PRIMARY KEY (f1); -+ -+SET SESSION wsrep_on = TRUE; -+SET GLOBAL wsrep_desync = FALSE; -+ -+# Insert even more data after the ALTER has completed -+INSERT INTO t1 (f1) SELECT 100000 + (10000 * a1.f1) + (1000 * a2.f1) + (100 * a3.f1) + (10 * a4.f1) + a5.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5; -+ -+SELECT COUNT(*) = 200000 FROM t1; -+SELECT MAX(f1) = 199999 FROM t1; -+ -+--connection node_1 -+SELECT COUNT(*) = 200000 FROM t1; -+SELECT MAX(f1) = 199999 FROM t1; -+ -+SET GLOBAL wsrep_desync = TRUE; -+SET SESSION wsrep_on = FALSE; -+ -+ALTER TABLE t1 ADD PRIMARY KEY (f1); -+ -+SET SESSION wsrep_on = TRUE; -+SET GLOBAL wsrep_desync = FALSE; -+ -+# Insert some conflicting values after the ALTER has been applied on all nodes. -+ -+--connection node_2 -+--error ER_DUP_ENTRY -+INSERT INTO t1 (f1) VALUES (1); -+ -+--connection node_1 -+--error ER_DUP_ENTRY -+INSERT INTO t1 (f1) VALUES (100); -+ -+DROP TABLE t1; -+DROP TABLE ten; -diff --git a/mysql-test/suite/galera/t/galera_wsrep_new_cluster-master.opt b/mysql-test/suite/galera/t/galera_wsrep_new_cluster-master.opt -new file mode 100644 -index 0000000..c31150c ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_wsrep_new_cluster-master.opt -@@ -0,0 +1 @@ -+--wsrep-new-cluster -diff --git a/mysql-test/suite/galera/t/galera_wsrep_new_cluster.test b/mysql-test/suite/galera/t/galera_wsrep_new_cluster.test -new file mode 100644 -index 0000000..6ba8ce7 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_wsrep_new_cluster.test -@@ -0,0 +1,24 @@ -+# -+# Test the --wsrep-new-cluster option by putting it in the galera_wsrep_new_cluster-master.opt file -+# -+# In MTR, running two nodes, the result is two separate clusters of size 1 -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected'; -+SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index'; -+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; -+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state'; -+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; -+ -+--connection node_2 -+ -+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected'; -+SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index'; -+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; -+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state'; -+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; -diff --git a/mysql-test/suite/galera/t/galera_wsrep_provider_unset_set.test b/mysql-test/suite/galera/t/galera_wsrep_provider_unset_set.test -new file mode 100644 -index 0000000..fe4c358 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_wsrep_provider_unset_set.test -@@ -0,0 +1,41 @@ -+# -+# Test that wsrep_provider can be unset and then set back to its original value -+# and replication will continue except for any updates made while the value was 'none' -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--connection node_1 -+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+ -+--connection node_2 -+--let $wsrep_provider_orig = `SELECT @@wsrep_provider` -+--let $wsrep_cluster_address_orig = `SELECT @@wsrep_cluster_address` -+ -+SET GLOBAL wsrep_provider='none'; -+INSERT INTO t1 VALUES (2); -+ -+--connection node_1 -+INSERT INTO t1 VALUES (3); -+ -+--connection node_2 -+--disable_query_log -+--eval SET GLOBAL wsrep_provider = '$wsrep_provider_orig'; -+--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig'; -+--enable_query_log -+ -+--source include/wait_until_connected_again.inc -+--source include/galera_wait_ready.inc -+ -+INSERT INTO t1 VALUES (4); -+ -+# Node #2 has all the inserts -+SELECT COUNT(*) = 4 FROM t1; -+ -+--connection node_1 -+# Node #1 is missing the insert made while Node #2 was not replicated -+SELECT COUNT(*) = 3 FROM t1; -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/galera_zero_length_column.test b/mysql-test/suite/galera/t/galera_zero_length_column.test -new file mode 100644 -index 0000000..6ae81a8 ---- /dev/null -+++ b/mysql-test/suite/galera/t/galera_zero_length_column.test -@@ -0,0 +1,41 @@ -+# -+# Test columns with size zero. This is known to have tripped other storage engines. -+# Keys are not allowed on such columns -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--connection node_1 -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY , f2 VARCHAR(0)) ENGINE=InnoDB; -+CREATE TABLE t2 (f1 VARCHAR(0)) ENGINE=InnoDB; -+ -+ -+INSERT INTO t1 VALUES (1, NULL); -+INSERT INTO t1 VALUES (2, ''); -+ -+INSERT INTO t2 VALUES (NULL); -+INSERT INTO t2 VALUES (''); -+ -+--connection node_2 -+SELECT COUNT(*) = 2 FROM t1; -+SELECT f2 IS NULL FROM t1 WHERE f1 = 1; -+SELECT f2 = '' FROM t1 WHERE f1 = 2; -+ -+SELECT COUNT(*) = 2 FROM t2; -+SELECT f1 IS NULL FROM t2 WHERE f1 IS NULL; -+SELECT f1 = '' FROM t2 WHERE f1 IS NOT NULL; -+ -+UPDATE t1 SET f2 = '' WHERE f1 = 1; -+UPDATE t1 SET f2 = NULL WHERE f1 = 2; -+ -+UPDATE t2 SET f1 = '' WHERE f1 IS NULL; -+ -+--connection node_1 -+SELECT f2 = '' FROM t1 WHERE f1 = 1; -+SELECT f2 IS NULL FROM t1 WHERE f1 = 2; -+ -+SELECT COUNT(*) = 2 FROM t2 WHERE f1 = ''; -+ -+DROP TABLE t1; -+DROP TABLE t2; -diff --git a/mysql-test/suite/galera/t/lp1276424.test b/mysql-test/suite/galera/t/lp1276424.test -new file mode 100644 -index 0000000..a37e950 ---- /dev/null -+++ b/mysql-test/suite/galera/t/lp1276424.test -@@ -0,0 +1,17 @@ -+# -+# LP:1276424 Deadlock with insertion of NULL unique ke -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TABLE t1 (f1 INT DEFAULT NULL, UNIQUE KEY i1 (f1)) ENGINE=InnoDB; -+ -+INSERT INTO t1 VALUES (NULL); -+INSERT INTO t1 VALUES (NULL); -+ -+--connection node_2 -+SELECT COUNT(*) = 2 FROM t1; -+SELECT f1 IS NULL FROM t1; -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera/t/lp1347768.test b/mysql-test/suite/galera/t/lp1347768.test -new file mode 100644 -index 0000000..96d4286 ---- /dev/null -+++ b/mysql-test/suite/galera/t/lp1347768.test -@@ -0,0 +1,24 @@ -+# -+# LP:1347768 Assertion failure in file ha_innodb.cc line 6759 -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+CREATE TABLE `r8kmb_redirect_links` ( -+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT, -+ `old_url` varchar(255) DEFAULT NULL, -+ `new_url` varchar(255) NOT NULL, -+ `referer` varchar(150) NOT NULL, -+ `comment` varchar(255) NOT NULL, -+ `published` tinyint(4) NOT NULL, -+ `created_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', -+ `modified_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', -+ PRIMARY KEY (`id`), -+ UNIQUE KEY `idx_link_old` (`old_url`), -+ KEY `idx_link_modifed` (`modified_date`) -+) ENGINE=InnoDB DEFAULT CHARSET=utf8; -+ -+INSERT INTO r8kmb_redirect_links VALUES (550,'http://mysite.com/images/download/ßуñûічýøù_ôþóþòір_þфõÑ.doc','','','',0,'2013-07-15 14:29:42','0000-00-00 00:00:00'); -+ -+DROP TABLE r8kmb_redirect_links; -diff --git a/mysql-test/suite/galera/t/lp959512.test b/mysql-test/suite/galera/t/lp959512.test -new file mode 100644 -index 0000000..bcc0db2 ---- /dev/null -+++ b/mysql-test/suite/galera/t/lp959512.test -@@ -0,0 +1,26 @@ -+# -+# LP#959512 IO cache not reset at trx cleanup if write set was empty Edit -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+DROP TABLE IF EXISTS variable; -+DROP TABLE IF EXISTS foo; -+CREATE TABLE variable ( -+ name varchar(128) NOT NULL DEFAULT '' COMMENT 'The name of the variable.', -+ value longblob NOT NULL COMMENT 'The value of the variable.', -+ PRIMARY KEY (name) -+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Named variable/value pairs created by Drupal core or any...'; -+CREATE TABLE foo (a int); -+INSERT INTO variable (name, value) VALUES ('menu_expanded', 'a:0:{}'); -+START TRANSACTION; -+SELECT 1 AS expression FROM variable variable -+ WHERE ( (name = 'menu_expanded') ) FOR UPDATE; -+UPDATE variable SET value='a:0:{}' WHERE ( (name = 'menu_expanded') ); -+COMMIT; -+INSERT INTO foo VALUES (1); -+UPDATE foo SET a = 2 WHERE a = 1; -+ -+DROP TABLE foo; -+DROP TABLE variable; -diff --git a/mysql-test/suite/galera_3nodes/galera_3nodes.cnf b/mysql-test/suite/galera_3nodes/galera_3nodes.cnf -new file mode 100644 -index 0000000..e837635 ---- /dev/null -+++ b/mysql-test/suite/galera_3nodes/galera_3nodes.cnf -@@ -0,0 +1,75 @@ -+# Use default setting for mysqld processes -+!include include/default_mysqld.cnf -+ -+[mysqld.1] -+binlog-format=row -+ -+wsrep_provider=@ENV.WSREP_PROVIDER -+wsrep_cluster_address='gcomm://' -+wsrep_provider_options='base_port=@mysqld.1.#galera_port' -+ -+# enforce read-committed characteristics across the cluster -+wsrep_causal_reads=ON -+wsrep_sync_wait = 7 -+ -+wsrep_node_address=127.0.0.1 -+wsrep_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port -+wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port -+ -+# Required for Galera -+innodb_autoinc_lock_mode=2 -+ -+[mysqld.2] -+binlog-format=row -+ -+wsrep_provider=@ENV.WSREP_PROVIDER -+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port' -+wsrep_provider_options='base_port=@mysqld.2.#galera_port' -+ -+# enforce read-committed characteristics across the cluster -+wsrep_causal_reads=ON -+wsrep_sync_wait = 7 -+ -+wsrep_node_address=127.0.0.1 -+wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port -+wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port -+ -+# Required for Galera -+innodb_autoinc_lock_mode=2 -+ -+[mysqld.3] -+binlog-format=row -+ -+wsrep_provider=@ENV.WSREP_PROVIDER -+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port' -+wsrep_provider_options='base_port=@mysqld.3.#galera_port' -+ -+# enforce read-committed characteristics across the cluster -+wsrep_causal_reads=ON -+wsrep_sync_wait = 7 -+ -+wsrep_node_address=127.0.0.1 -+wsrep_sst_receive_address=127.0.0.2:@mysqld.3.#sst_port -+wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port -+ -+# Required for Galera -+innodb_autoinc_lock_mode=2 -+ -+[ENV] -+NODE_MYPORT_1= @mysqld.1.port -+NODE_MYSOCK_1= @mysqld.1.socket -+ -+NODE_MYPORT_2= @mysqld.2.port -+NODE_MYSOCK_2= @mysqld.2.socket -+ -+NODE_MYPORT_3= @mysqld.3.port -+NODE_MYSOCK_3= @mysqld.3.socket -+ -+NODE_GALERAPORT_1= @mysqld.1.#galera_port -+NODE_GALERAPORT_2= @mysqld.2.#galera_port -+NODE_GALERAPORT_3= @mysqld.3.#galera_port -+ -+NODE_SSTPORT_1= @mysqld.1.#sst_port -+NODE_SSTPORT_2= @mysqld.2.#sst_port -+NODE_SSTPORT_3= @mysqld.3.#sst_port -+ -diff --git a/mysql-test/suite/galera_3nodes/my.cnf b/mysql-test/suite/galera_3nodes/my.cnf -new file mode 100644 -index 0000000..bb25b95 ---- /dev/null -+++ b/mysql-test/suite/galera_3nodes/my.cnf -@@ -0,0 +1 @@ -+!include galera_3nodes.cnf -diff --git a/mysql-test/suite/galera_3nodes/r/galera_certification_ccc.result b/mysql-test/suite/galera_3nodes/r/galera_certification_ccc.result -new file mode 100644 -index 0000000..96a2bec ---- /dev/null -+++ b/mysql-test/suite/galera_3nodes/r/galera_certification_ccc.result -@@ -0,0 +1,17 @@ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES (1); -+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+VARIABLE_VALUE = 3 -+1 -+SET GLOBAL wsrep_cluster_address = ''; -+INSERT INTO t1 VALUES (2); -+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+VARIABLE_VALUE = 2 -+1 -+COMMIT; -+SELECT COUNT(*) = 2 FROM t1; -+COUNT(*) = 2 -+1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera_3nodes/r/galera_certification_double_failure.result b/mysql-test/suite/galera_3nodes/r/galera_certification_double_failure.result -new file mode 100644 -index 0000000..9dc735d ---- /dev/null -+++ b/mysql-test/suite/galera_3nodes/r/galera_certification_double_failure.result -@@ -0,0 +1,12 @@ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES (1); -+INSERT INTO t2 VALUES (1); -+INSERT INTO t1 VALUES (1); -+INSERT INTO t2 VALUES (1); -+COMMIT; -+ERROR 40001: Deadlock found when trying to get lock; try restarting transaction -+DROP TABLE t1; -+DROP TABLE t2; -diff --git a/mysql-test/suite/galera_3nodes/r/galera_evs_suspect_timeout.result b/mysql-test/suite/galera_3nodes/r/galera_evs_suspect_timeout.result -new file mode 100644 -index 0000000..1464222 ---- /dev/null -+++ b/mysql-test/suite/galera_3nodes/r/galera_evs_suspect_timeout.result -@@ -0,0 +1,19 @@ -+SET GLOBAL wsrep_provider_options = 'evs.inactive_timeout=PT100M; evs.suspect_timeout=PT1S'; -+SET GLOBAL wsrep_provider_options = 'evs.inactive_timeout=PT100M; evs.suspect_timeout=PT1S'; -+Suspending node ... -+SET SESSION wsrep_sync_wait = 0; -+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+VARIABLE_VALUE = 2 -+1 -+CREATE TABLE t1 (f1 INTEGER); -+INSERT INTO t1 VALUES (1); -+SET SESSION wsrep_sync_wait = 0; -+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+VARIABLE_VALUE = 2 -+1 -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+DROP TABLE t1; -+Resuming node ... -+CALL mtr.add_suppression("WSREP: gcs_caused() returned -1 \\(Operation not permitted\\)"); -diff --git a/mysql-test/suite/galera_3nodes/r/galera_garbd.result b/mysql-test/suite/galera_3nodes/r/galera_garbd.result -new file mode 100644 -index 0000000..616c9d3 ---- /dev/null -+++ b/mysql-test/suite/galera_3nodes/r/galera_garbd.result -@@ -0,0 +1,14 @@ -+Killing node #3 to free ports for garbd ... -+Starting garbd ... -+CREATE TABLE t1 (f1 INTEGER); -+INSERT INTO t1 VALUES (1); -+SELECT COUNT(*) = 1 FROM t1; -+COUNT(*) = 1 -+1 -+Killing garbd ... -+INSERT INTO t1 VALUES (2); -+SELECT COUNT(*) = 2 FROM t1; -+COUNT(*) = 2 -+1 -+DROP TABLE t1; -+Restarting node #3 to satisfy MTR's end-of-test checks -diff --git a/mysql-test/suite/galera_3nodes/r/galera_ist_gcache_rollover.result b/mysql-test/suite/galera_3nodes/r/galera_ist_gcache_rollover.result -new file mode 100644 -index 0000000..1ecea5d ---- /dev/null -+++ b/mysql-test/suite/galera_3nodes/r/galera_ist_gcache_rollover.result -@@ -0,0 +1,46 @@ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY); -+INSERT INTO t1 VALUES (01), (02), (03), (04), (05); -+Unloading wsrep provider ... -+SET GLOBAL wsrep_provider = 'none'; -+Unloading wsrep provider ... -+SET GLOBAL wsrep_provider = 'none'; -+INSERT INTO t1 VALUES (11), (12), (13), (14), (15); -+INSERT INTO t1 VALUES (21), (22), (23), (24), (25); -+SET GLOBAL wsrep_provider_options = 'dbug=d,ist_sender_send_after_get_buffers'; -+INSERT INTO t1 VALUES (31), (32), (33), (34), (35); -+SHOW STATUS LIKE 'wsrep_debug_sync_waiters'; -+Variable_name Value -+wsrep_debug_sync_waiters ist_sender_send_after_get_buffers ist_sender_send_after_get_buffers -+INSERT INTO t1 VALUES (41), (42), (43), (44), (45); -+CREATE TABLE t2 (f1 LONGTEXT); -+INSERT INTO t2 VALUES (REPEAT('x', 512 * 1024)); -+INSERT INTO t2 VALUES (REPEAT('x', 512 * 1024)); -+INSERT INTO t2 VALUES (REPEAT('x', 512 * 1024)); -+SET GLOBAL wsrep_provider_options = 'signal=ist_sender_send_after_get_buffers'; -+SET GLOBAL wsrep_provider_options = 'dbug='; -+INSERT INTO t1 VALUES (51), (52), (53), (54), (55); -+SELECT COUNT(*) = 30 FROM t1; -+COUNT(*) = 30 -+1 -+SELECT COUNT(*) = 3 FROM t2; -+COUNT(*) = 3 -+1 -+SELECT LENGTH(f1) = 512 * 1024 FROM t2; -+LENGTH(f1) = 512 * 1024 -+1 -+1 -+1 -+CALL mtr.add_suppression("WSREP: Unsupported protocol downgrade: incremental data collection disabled"); -+SELECT COUNT(*) = 30 FROM t1; -+COUNT(*) = 30 -+1 -+SELECT COUNT(*) = 3 FROM t2; -+COUNT(*) = 3 -+1 -+SELECT LENGTH(f1) = 512 * 1024 FROM t2; -+LENGTH(f1) = 512 * 1024 -+1 -+1 -+1 -+CALL mtr.add_suppression("WSREP: Unsupported protocol downgrade: incremental data collection disabled"); -+DROP TABLE t1, t2; -diff --git a/mysql-test/suite/galera_3nodes/r/galera_parallel_apply_3nodes.result b/mysql-test/suite/galera_3nodes/r/galera_parallel_apply_3nodes.result -new file mode 100644 -index 0000000..9a6d40a ---- /dev/null -+++ b/mysql-test/suite/galera_3nodes/r/galera_parallel_apply_3nodes.result -@@ -0,0 +1,13 @@ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+SET GLOBAL wsrep_slave_threads = 2; -+UPDATE t1 SET f1 = f1 + 10;; -+UPDATE t1 SET f1 = f1 + 100;; -+SELECT f1 = 111 FROM t1; -+f1 = 111 -+1 -+SELECT COUNT(*) IN (1, 2) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%committed%'; -+COUNT(*) IN (1, 2) -+1 -+SET GLOBAL wsrep_slave_threads = 1;; -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera_3nodes/r/galera_pc_weight.result b/mysql-test/suite/galera_3nodes/r/galera_pc_weight.result -new file mode 100644 -index 0000000..ca05143 ---- /dev/null -+++ b/mysql-test/suite/galera_3nodes/r/galera_pc_weight.result -@@ -0,0 +1,118 @@ -+SET GLOBAL wsrep_provider_options = 'pc.weight=3'; -+Suspending node ... -+SET SESSION wsrep_sync_wait=0; -+SHOW STATUS LIKE 'wsrep_cluster_size'; -+Variable_name Value -+wsrep_cluster_size 2 -+SHOW STATUS LIKE 'wsrep_cluster_status'; -+Variable_name Value -+wsrep_cluster_status non-Primary -+SHOW STATUS LIKE 'wsrep_connected'; -+Variable_name Value -+wsrep_connected ON -+SHOW STATUS LIKE 'wsrep_ready'; -+Variable_name Value -+wsrep_ready OFF -+SHOW STATUS LIKE 'wsrep_local_state'; -+Variable_name Value -+wsrep_local_state 0 -+SHOW STATUS LIKE 'wsrep_local_state_comment'; -+Variable_name Value -+wsrep_local_state_comment Initialized -+SET SESSION wsrep_sync_wait=0; -+SHOW STATUS LIKE 'wsrep_cluster_size'; -+Variable_name Value -+wsrep_cluster_size 2 -+SHOW STATUS LIKE 'wsrep_cluster_status'; -+Variable_name Value -+wsrep_cluster_status non-Primary -+SHOW STATUS LIKE 'wsrep_connected'; -+Variable_name Value -+wsrep_connected ON -+SHOW STATUS LIKE 'wsrep_ready'; -+Variable_name Value -+wsrep_ready OFF -+SHOW STATUS LIKE 'wsrep_local_state'; -+Variable_name Value -+wsrep_local_state 0 -+SHOW STATUS LIKE 'wsrep_local_state_comment'; -+Variable_name Value -+wsrep_local_state_comment Initialized -+Resuming node ... -+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+VARIABLE_VALUE = 1 -+1 -+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -+VARIABLE_VALUE = 'Primary' -+1 -+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected'; -+VARIABLE_VALUE = 'ON' -+1 -+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; -+VARIABLE_VALUE = 'ON' -+1 -+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state'; -+VARIABLE_VALUE = 4 -+1 -+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; -+VARIABLE_VALUE = 'Synced' -+1 -+SET SESSION wsrep_sync_wait=0; -+SET SESSION wsrep_sync_wait=0; -+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+VARIABLE_VALUE = 3 -+1 -+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -+VARIABLE_VALUE = 'Primary' -+1 -+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected'; -+VARIABLE_VALUE = 'ON' -+1 -+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; -+VARIABLE_VALUE = 'ON' -+1 -+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state'; -+VARIABLE_VALUE = 4 -+1 -+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; -+VARIABLE_VALUE = 'Synced' -+1 -+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+VARIABLE_VALUE = 3 -+1 -+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -+VARIABLE_VALUE = 'Primary' -+1 -+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected'; -+VARIABLE_VALUE = 'ON' -+1 -+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; -+VARIABLE_VALUE = 'ON' -+1 -+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state'; -+VARIABLE_VALUE = 4 -+1 -+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; -+VARIABLE_VALUE = 'Synced' -+1 -+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+VARIABLE_VALUE = 3 -+1 -+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -+VARIABLE_VALUE = 'Primary' -+1 -+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected'; -+VARIABLE_VALUE = 'ON' -+1 -+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; -+VARIABLE_VALUE = 'ON' -+1 -+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state'; -+VARIABLE_VALUE = 4 -+1 -+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; -+VARIABLE_VALUE = 'Synced' -+1 -+CALL mtr.add_suppression('WSREP: gcs_caused\\(\\) returned -1'); -+CALL mtr.add_suppression('WSREP: user message in state LEAVING'); -+CALL mtr.add_suppression('sending install message failed: Transport endpoint is not connected'); -diff --git a/mysql-test/suite/galera_3nodes/t/galera_certification_ccc.test b/mysql-test/suite/galera_3nodes/t/galera_certification_ccc.test -new file mode 100644 -index 0000000..da4a609 ---- /dev/null -+++ b/mysql-test/suite/galera_3nodes/t/galera_certification_ccc.test -@@ -0,0 +1,41 @@ -+# -+# Test that a cluster configuration change during a transaction does not cause a failure -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--let $galera_connection_name = node_3 -+--let $galera_server_number = 3 -+--source include/galera_connect.inc -+ -+--connection node_1 -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+ -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES (1); -+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+ -+--connection node_3 -+--let $wsrep_cluster_address_orig = `SELECT @@wsrep_cluster_address` -+SET GLOBAL wsrep_cluster_address = ''; -+--sleep 5 -+ -+--connection node_1 -+INSERT INTO t1 VALUES (2); -+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+COMMIT; -+ -+--connection node_2 -+SELECT COUNT(*) = 2 FROM t1; -+ -+--connection node_3 -+--disable_query_log -+--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig'; -+--enable_query_log -+--sleep 5 -+--source include/galera_wait_ready.inc -+ -+--connection node_1 -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera_3nodes/t/galera_certification_double_failure.test b/mysql-test/suite/galera_3nodes/t/galera_certification_double_failure.test -new file mode 100644 -index 0000000..a2ad076 ---- /dev/null -+++ b/mysql-test/suite/galera_3nodes/t/galera_certification_double_failure.test -@@ -0,0 +1,33 @@ -+# -+# This test creates a transaction whose certification will fail on two separate nodes -+# for two different reasons. -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--let $galera_connection_name = node_3 -+--let $galera_server_number = 3 -+--source include/galera_connect.inc -+ -+--connection node_1 -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+ -+SET AUTOCOMMIT=OFF; -+START TRANSACTION; -+INSERT INTO t1 VALUES (1); -+INSERT INTO t2 VALUES (1); -+ -+--connection node_2 -+INSERT INTO t1 VALUES (1); -+ -+--connection node_3 -+INSERT INTO t2 VALUES (1); -+ -+--connection node_1 -+--error ER_LOCK_DEADLOCK -+COMMIT; -+ -+DROP TABLE t1; -+DROP TABLE t2; -diff --git a/mysql-test/suite/galera_3nodes/t/galera_evs_suspect_timeout.test b/mysql-test/suite/galera_3nodes/t/galera_evs_suspect_timeout.test -new file mode 100644 -index 0000000..a87f19a ---- /dev/null -+++ b/mysql-test/suite/galera_3nodes/t/galera_evs_suspect_timeout.test -@@ -0,0 +1,67 @@ -+# -+# Test the operation of evs.suspect_timeout. -+# -+# We set evs.inactive_timeout to a very high value so that evs.suspect_timeout can kick in instead. -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--connection node_1 -+--let $wsrep_provider_options_node1 = `SELECT @@wsrep_provider_options` -+SET GLOBAL wsrep_provider_options = 'evs.inactive_timeout=PT100M; evs.suspect_timeout=PT1S'; -+ -+--connection node_2 -+--source include/wait_until_connected_again.inc -+--let $wsrep_provider_options_node2 = `SELECT @@wsrep_provider_options` -+SET GLOBAL wsrep_provider_options = 'evs.inactive_timeout=PT100M; evs.suspect_timeout=PT1S'; -+ -+--let $galera_connection_name = node_3 -+--let $galera_server_number = 3 -+--source include/galera_connect.inc -+--connection node_3 -+--source include/wait_until_connected_again.inc -+--let $wsrep_cluster_address_node3 = `SELECT @@wsrep_cluster_address` -+ -+# Suspend node #3 -+ -+--source include/galera_suspend.inc -+--sleep 5 -+ -+# Confirm that the other nodes have booted it out -+ -+--connection node_1 -+--source include/wait_until_connected_again.inc -+SET SESSION wsrep_sync_wait = 0; -+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+--disable_query_log -+--eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_node1'; -+--enable_query_log -+ -+--source include/wait_until_connected_again.inc -+CREATE TABLE t1 (f1 INTEGER); -+INSERT INTO t1 VALUES (1); -+ -+--connection node_2 -+SET SESSION wsrep_sync_wait = 0; -+SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+--disable_query_log -+--eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_node2'; -+--enable_query_log -+ -+--source include/wait_until_connected_again.inc -+SELECT COUNT(*) = 1 FROM t1; -+DROP TABLE t1; -+ -+# Reconnect node #3 so that MTR's end-of-test checks can run -+ -+--connection node_3 -+--source include/galera_resume.inc -+--source include/wait_until_connected_again.inc -+ -+CALL mtr.add_suppression("WSREP: gcs_caused() returned -1 \\(Operation not permitted\\)"); -+ -+--disable_query_log -+--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_node3'; -+--enable_query_log -+--source include/wait_until_connected_again.inc -diff --git a/mysql-test/suite/galera_3nodes/t/galera_garbd.test b/mysql-test/suite/galera_3nodes/t/galera_garbd.test -new file mode 100644 -index 0000000..3f58783 ---- /dev/null -+++ b/mysql-test/suite/galera_3nodes/t/galera_garbd.test -@@ -0,0 +1,50 @@ -+# -+# A very basic test for the galera arbitrator. We shut down node #3 and use its port allocation to start garbd. -+# As MTR does not allow multiple servers to be down at the same time, we are limited as to what we can test. -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+--source include/big_test.inc -+ -+--echo Killing node #3 to free ports for garbd ... -+--let $galera_connection_name = node_3 -+--let $galera_server_number = 3 -+--source include/galera_connect.inc -+--source include/shutdown_mysqld.inc -+ -+--connection node_1 -+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' -+--source include/wait_condition.inc -+ -+--echo Starting garbd ... -+--exec `dirname $WSREP_PROVIDER`/garb/garbd --address "gcomm://127.0.0.1:$NODE_GALERAPORT_1" --group my_wsrep_cluster --options 'base_port=$NODE_GALERAPORT_3' > $MYSQL_TMP_DIR/garbd.log 2>&1 & -+ -+--sleep 5 -+ -+--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' -+--source include/wait_condition.inc -+ -+CREATE TABLE t1 (f1 INTEGER); -+INSERT INTO t1 VALUES (1); -+ -+--connection node_2 -+SELECT COUNT(*) = 1 FROM t1; -+ -+--echo Killing garbd ... -+--exec pkill --oldest --full garbd.*$NODE_GALERAPORT_3 -+ -+--connection node_1 -+--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' -+--source include/wait_condition.inc -+ -+INSERT INTO t1 VALUES (2); -+ -+--connection node_2 -+SELECT COUNT(*) = 2 FROM t1; -+ -+DROP TABLE t1; -+ -+--echo Restarting node #3 to satisfy MTR's end-of-test checks -+--connection node_3 -+--source include/start_mysqld.inc -diff --git a/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.cnf b/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.cnf -new file mode 100644 -index 0000000..8211752 ---- /dev/null -+++ b/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.cnf -@@ -0,0 +1,11 @@ -+!include ../galera_3nodes.cnf -+ -+[mysqld.1] -+wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true;gcache.size=1M' -+ -+[mysqld.2] -+wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true;gcache.size=1M' -+ -+[mysqld.3] -+wsrep_provider_options='base_port=@mysqld.3.#galera_port;pc.ignore_sb=true;gcache.size=1M' -+ -diff --git a/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test b/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test -new file mode 100644 -index 0000000..0668c24 ---- /dev/null -+++ b/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test -@@ -0,0 +1,98 @@ -+# -+# Test that if the gcache rolls over while IST is in progress, IST will still complete. -+# This is achieved by using the ist_sender_send_after_get_buffers Galera dbug sync point to block the donor after -+# the first gcache buffer has been locked for IST. -+# -+# After IST blocks, we roll over the gcache and resume IST to confirm that it completes successfully. -+# -+# Two nodes perform IST at the same time in order to make the test more stressfull -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+--source include/have_debug_sync.inc -+--source suite/galera/include/galera_have_debug_sync.inc -+ -+--let $galera_connection_name = node_3 -+--let $galera_server_number = 3 -+--source include/galera_connect.inc -+ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY); -+INSERT INTO t1 VALUES (01), (02), (03), (04), (05); -+ -+# Disconnect nodes #2 and #3 -+--connection node_2 -+--source suite/galera/include/galera_unload_provider.inc -+ -+--connection node_3 -+--source suite/galera/include/galera_unload_provider.inc -+ -+--connection node_1 -+--source include/wait_until_connected_again.inc -+INSERT INTO t1 VALUES (11), (12), (13), (14), (15); -+ -+# Wait until nodes #2 and #3 have left -+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size' -+--source include/wait_condition.inc -+ -+INSERT INTO t1 VALUES (21), (22), (23), (24), (25); -+ -+# Make sure IST will block ... -+SET GLOBAL wsrep_provider_options = 'dbug=d,ist_sender_send_after_get_buffers'; -+ -+# ... and restart providers to force IST -+--connection node_2 -+--disable_query_log -+--eval SET GLOBAL wsrep_provider = '$wsrep_provider_orig'; -+--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig'; -+--enable_query_log -+ -+--connection node_1 -+INSERT INTO t1 VALUES (31), (32), (33), (34), (35); -+ -+--connection node_3 -+--disable_query_log -+--eval SET GLOBAL wsrep_provider = '$wsrep_provider_orig'; -+--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig'; -+--enable_query_log -+ -+--connection node_1 -+--sleep 2 -+SHOW STATUS LIKE 'wsrep_debug_sync_waiters'; -+ -+INSERT INTO t1 VALUES (41), (42), (43), (44), (45); -+ -+# Roll over gcache by writing a lot of information to it -+ -+CREATE TABLE t2 (f1 LONGTEXT); -+INSERT INTO t2 VALUES (REPEAT('x', 512 * 1024)); -+INSERT INTO t2 VALUES (REPEAT('x', 512 * 1024)); -+INSERT INTO t2 VALUES (REPEAT('x', 512 * 1024)); -+ -+# Unlock IST and wait for it to complete -+SET GLOBAL wsrep_provider_options = 'signal=ist_sender_send_after_get_buffers'; -+SET GLOBAL wsrep_provider_options = 'dbug='; -+ -+INSERT INTO t1 VALUES (51), (52), (53), (54), (55); -+ -+--connection node_2 -+--source include/wait_until_connected_again.inc -+ -+--connection node_3 -+--source include/wait_until_connected_again.inc -+ -+# Final checks -+--connection node_2 -+SELECT COUNT(*) = 30 FROM t1; -+SELECT COUNT(*) = 3 FROM t2; -+SELECT LENGTH(f1) = 512 * 1024 FROM t2; -+CALL mtr.add_suppression("WSREP: Unsupported protocol downgrade: incremental data collection disabled"); -+ -+# Final checks -+--connection node_3 -+SELECT COUNT(*) = 30 FROM t1; -+SELECT COUNT(*) = 3 FROM t2; -+SELECT LENGTH(f1) = 512 * 1024 FROM t2; -+CALL mtr.add_suppression("WSREP: Unsupported protocol downgrade: incremental data collection disabled"); -+ -+DROP TABLE t1, t2; -diff --git a/mysql-test/suite/galera_3nodes/t/galera_parallel_apply_3nodes.test b/mysql-test/suite/galera_3nodes/t/galera_parallel_apply_3nodes.test -new file mode 100644 -index 0000000..659df2b ---- /dev/null -+++ b/mysql-test/suite/galera_3nodes/t/galera_parallel_apply_3nodes.test -@@ -0,0 +1,38 @@ -+# -+# This test performs two dependent updates on two nodes and checks the results on the third where -+# parallel apply is enabled. -+# -+ -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--let $galera_connection_name = node_3 -+--let $galera_server_number = 3 -+--source include/galera_connect.inc -+ -+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; -+INSERT INTO t1 VALUES (1); -+ -+--connection node_3 -+--let $wsrep_slave_threads_orig = `SELECT @@wsrep_slave_threads` -+SET GLOBAL wsrep_slave_threads = 2; -+ -+--connection node_1 -+--send UPDATE t1 SET f1 = f1 + 10; -+ -+--connection node_2 -+--send UPDATE t1 SET f1 = f1 + 100; -+ -+--connection node_1 -+--reap -+ -+--connection node_2 -+--reap -+ -+--connection node_3 -+SELECT f1 = 111 FROM t1; -+SELECT COUNT(*) IN (1, 2) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%committed%'; -+ -+--eval SET GLOBAL wsrep_slave_threads = $wsrep_slave_threads_orig; -+ -+DROP TABLE t1; -diff --git a/mysql-test/suite/galera_3nodes/t/galera_pc_weight.test b/mysql-test/suite/galera_3nodes/t/galera_pc_weight.test -new file mode 100644 -index 0000000..8956bae ---- /dev/null -+++ b/mysql-test/suite/galera_3nodes/t/galera_pc_weight.test -@@ -0,0 +1,110 @@ -+# -+# Test the pc.weight wsrep provider option. We set Node #1 to have a high weight and then -+# suspend it. This will cause Nodes #2 and #3 to transition to non-primary component. -+# -+ -+--source include/big_test.inc -+--source include/galera_cluster.inc -+--source include/have_innodb.inc -+ -+--let $wsrep_provider_options_node1 = `SELECT @@wsrep_provider_options` -+SET GLOBAL wsrep_provider_options = 'pc.weight=3'; -+ -+--source include/wait_until_connected_again.inc -+--source include/galera_suspend.inc -+--sleep 10 -+ -+--connection node_2 -+# Do not wait for causality as we are no longer in the primary component -+SET SESSION wsrep_sync_wait=0; -+--source include/wait_until_connected_again.inc -+ -+# We can not use SELECT queries here, as only SHOW is allowed to run. -+# For nodes #2 and #3, we expect a non-primary component of size 2 -+ -+SHOW STATUS LIKE 'wsrep_cluster_size'; -+SHOW STATUS LIKE 'wsrep_cluster_status'; -+SHOW STATUS LIKE 'wsrep_connected'; -+SHOW STATUS LIKE 'wsrep_ready'; -+SHOW STATUS LIKE 'wsrep_local_state'; -+SHOW STATUS LIKE 'wsrep_local_state_comment'; -+ -+--let $galera_connection_name = node_3 -+--let $galera_server_number = 3 -+--source include/galera_connect.inc -+--connection node_3 -+SET SESSION wsrep_sync_wait=0; -+--source include/wait_until_connected_again.inc -+ -+SHOW STATUS LIKE 'wsrep_cluster_size'; -+SHOW STATUS LIKE 'wsrep_cluster_status'; -+SHOW STATUS LIKE 'wsrep_connected'; -+SHOW STATUS LIKE 'wsrep_ready'; -+SHOW STATUS LIKE 'wsrep_local_state'; -+SHOW STATUS LIKE 'wsrep_local_state_comment'; -+ -+--connection node_1 -+--source include/galera_resume.inc -+--sleep 5 -+--source include/wait_until_connected_again.inc -+ -+# For Node #1, we expect a primary component of size 1 -+ -+SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected'; -+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; -+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state'; -+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; -+ -+# Restore the cluster by resetting wsrep_cluster_address on nodes #1 and #2 -+ -+--connection node_2 -+--disable_query_log -+--eval SET GLOBAL wsrep_cluster_address = @@wsrep_cluster_address; -+--enable_query_log -+ -+SET SESSION wsrep_sync_wait=0; -+--source include/wait_until_connected_again.inc -+ -+--connection node_3 -+--disable_query_log -+--eval SET GLOBAL wsrep_cluster_address = @@wsrep_cluster_address; -+--enable_query_log -+ -+SET SESSION wsrep_sync_wait=0; -+--source include/wait_until_connected_again.inc -+ -+# On all nodes, we now expect a Primary component of size 3, Synced and ready -+ -+--connection node_1 -+--source include/wait_until_connected_again.inc -+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected'; -+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; -+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state'; -+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; -+ -+--connection node_2 -+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected'; -+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; -+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state'; -+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; -+ -+--connection node_3 -+SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; -+SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected'; -+SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; -+SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state'; -+SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; -+ -+--connection node_1 -+CALL mtr.add_suppression('WSREP: gcs_caused\\(\\) returned -1'); -+ -+--connection node_3 -+CALL mtr.add_suppression('WSREP: user message in state LEAVING'); -+CALL mtr.add_suppression('sending install message failed: Transport endpoint is not connected'); -diff --git a/mysql-test/suite/innodb/r/innodb-autoinc.result b/mysql-test/suite/innodb/r/innodb-autoinc.result -index 0e0f49b..21acf06 100644 ---- a/mysql-test/suite/innodb/r/innodb-autoinc.result -+++ b/mysql-test/suite/innodb/r/innodb-autoinc.result -@@ -197,7 +197,7 @@ c1 c2 - 5 9 - DROP TABLE t1; - SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - Variable_name Value - auto_increment_increment 100 - auto_increment_offset 10 -@@ -228,9 +228,10 @@ c1 - 410 - 1000 - DROP TABLE t1; -+SET GLOBAL wsrep_auto_increment_control=OFF; - SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; - SET @@INSERT_ID=1; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - Variable_name Value - auto_increment_increment 1 - auto_increment_offset 1 -@@ -269,7 +270,7 @@ c1 - DROP TABLE t1; - SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; - SET @@INSERT_ID=1; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - Variable_name Value - auto_increment_increment 1 - auto_increment_offset 1 -@@ -282,7 +283,7 @@ SELECT * FROM t1; - c1 - -1 - SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - Variable_name Value - auto_increment_increment 100 - auto_increment_offset 10 -@@ -315,7 +316,7 @@ c1 - DROP TABLE t1; - SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; - SET @@INSERT_ID=1; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - Variable_name Value - auto_increment_increment 1 - auto_increment_offset 1 -@@ -330,7 +331,7 @@ SELECT * FROM t1; - c1 - 1 - SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - Variable_name Value - auto_increment_increment 100 - auto_increment_offset 10 -@@ -370,7 +371,7 @@ c1 - DROP TABLE t1; - SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; - SET @@INSERT_ID=1; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - Variable_name Value - auto_increment_increment 1 - auto_increment_offset 1 -@@ -385,7 +386,7 @@ SELECT * FROM t1; - c1 - 1 - SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - Variable_name Value - auto_increment_increment 100 - auto_increment_offset 10 -@@ -419,7 +420,7 @@ c1 - DROP TABLE t1; - SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; - SET @@INSERT_ID=1; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - Variable_name Value - auto_increment_increment 1 - auto_increment_offset 1 -@@ -434,7 +435,7 @@ c1 - 1 - 9223372036854775794 - SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - Variable_name Value - auto_increment_increment 2 - auto_increment_offset 10 -@@ -452,7 +453,7 @@ c1 - DROP TABLE t1; - SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; - SET @@INSERT_ID=1; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - Variable_name Value - auto_increment_increment 1 - auto_increment_offset 1 -@@ -467,7 +468,7 @@ c1 - 1 - 18446744073709551603 - SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - Variable_name Value - auto_increment_increment 2 - auto_increment_offset 10 -@@ -480,7 +481,7 @@ c1 - DROP TABLE t1; - SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; - SET @@INSERT_ID=1; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - Variable_name Value - auto_increment_increment 1 - auto_increment_offset 1 -@@ -495,7 +496,7 @@ c1 - 1 - 18446744073709551603 - SET @@SESSION.AUTO_INCREMENT_INCREMENT=5, @@SESSION.AUTO_INCREMENT_OFFSET=7; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - Variable_name Value - auto_increment_increment 5 - auto_increment_offset 7 -@@ -508,7 +509,7 @@ c1 - DROP TABLE t1; - SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; - SET @@INSERT_ID=1; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - Variable_name Value - auto_increment_increment 1 - auto_increment_offset 1 -@@ -527,7 +528,7 @@ c1 - -9223372036854775806 - 1 - SET @@SESSION.AUTO_INCREMENT_INCREMENT=3, @@SESSION.AUTO_INCREMENT_OFFSET=3; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - Variable_name Value - auto_increment_increment 3 - auto_increment_offset 3 -@@ -544,7 +545,7 @@ c1 - DROP TABLE t1; - SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; - SET @@INSERT_ID=1; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - Variable_name Value - auto_increment_increment 1 - auto_increment_offset 1 -@@ -562,7 +563,7 @@ SET @@SESSION.AUTO_INCREMENT_INCREMENT=1152921504606846976, @@SESSION.AUTO_INCRE - Warnings: - Warning 1292 Truncated incorrect auto_increment_increment value: '1152921504606846976' - Warning 1292 Truncated incorrect auto_increment_offset value: '1152921504606846976' --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - Variable_name Value - auto_increment_increment 65535 - auto_increment_offset 65535 -@@ -575,7 +576,7 @@ c1 - DROP TABLE t1; - SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; - SET @@INSERT_ID=1; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - Variable_name Value - auto_increment_increment 1 - auto_increment_offset 1 -@@ -862,7 +863,7 @@ Got one of the listed errors - DROP TABLE t1; - DROP TABLE t2; - SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - Variable_name Value - auto_increment_increment 1 - auto_increment_offset 1 -@@ -1252,7 +1253,7 @@ t1 CREATE TABLE `t1` ( - ) ENGINE=InnoDB AUTO_INCREMENT=18446744073709551615 DEFAULT CHARSET=latin1 - DROP TABLE t1; - SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=256; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - Variable_name Value - auto_increment_increment 1 - auto_increment_offset 256 -@@ -1270,7 +1271,7 @@ c1 c2 - 1 NULL - DROP TABLE t1; - SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - Variable_name Value - auto_increment_increment 1 - auto_increment_offset 1 -diff --git a/mysql-test/suite/innodb/t/galera.skip b/mysql-test/suite/innodb/t/galera.skip -new file mode 100644 -index 0000000..54e07b4 ---- /dev/null -+++ b/mysql-test/suite/innodb/t/galera.skip -@@ -0,0 +1,43 @@ -+innodb : deadlock, failure in UPDATE IGNORE, lp1372296 -+innodb_ctype_ldml : Test contains statements unsafe to replicate in statement-based replication -+innodb-autoinc : deadlock, failure in REPLACE, lp1372296 -+innodb_mysql : deadlock due to DDL -+innodb_buffer_pool_load : Test contains statements unsafe to replicate in statement-based replication -+innodb-autoinc-56228 : deadlock, lp1372301 -+innodb_lock_wait_timeout_1 : Test contains statements unsafe to replicate in statement-based replication -+innodb-consistent : Test contains statements unsafe to replicate in statement-based replication -+innodb-semi-consistent : Test contains statements unsafe to replicate in statement-based replication -+innodb-index : DDL concurrent with transaction -+innodb-lock : deadlock on INSERT IGNORE, lp1372296 -+innodb-status-output : Test performs server restart -+innodb-wl5522 : Test contains statements unsafe to replicate in statement-based replication -+innodb-wl6445 : Test performs server restart -+innodb_bug40360 : Test contains statements unsafe to replicate in statement-based replication -+innodb_bug40565 : Galera git bug #137 - Invalid deadlock on UPDATE to NULL without a PK -+innodb_bug42419 : Test contains statements unsafe to replicate in statement-based replication -+innodb_bug49164 : Test contains statements unsafe to replicate in statement-based replication -+innodb_bug45357 : impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging -+innodb_bug52663 : Test contains statements unsafe to replicate in statement-based replication -+innodb_bug59733 : Test contains statements unsafe to replicate in statement-based replication -+innodb_gis : Test contains statements unsafe to replicate in statement-based replication -+innodb_prefix_index_restart_server : crash, lp1372288 -+innodb_stats_external_pages : Test contains statements unsafe to replicate in statement-based replication -+innodb-2byte-collation : Unsafe statement written to the binary log -+innodb-change-buffer-recovery : Test contains statements unsafe to replicate in statement-based replication -+innodb_bug53756 : Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT -+innodb-alter-autoinc : AUTO_INCREMENT differences -+innodb_bug13635833 : Test contains statements unsafe to replicate in statement-based replication -+innodb_bug13867871 : mysql-wsrep#3 - innodb_bug13867871 test fails with wsrep loaded -+innodb_bug14006907 : DDL lock wait timeout -+innodb_bug38231 : Deadlock on UNLOCK TABLE -+innodb_bug-13628249 : mysql-wsrep#12 InnoDB: Failing assertion: !srv_read_only_mode with server restart -+innodb-wl6445-1 : mysql-wsrep#12 InnoDB: Failing assertion: !srv_read_only_mode with server restart -+innodb-wl6445-2 : mysql-wsrep#12 InnoDB: Failing assertion: !srv_read_only_mode with server restart -+innodb_bug12400341 : Test does not account for applier threads when performing SHOW PROCESSLIST -+innodb-blob : 'Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging' -+innodb_corrupt_bit : 'Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.' -+innodb-index-online : ALTER succeeds as it is given a higher priority -+innodb-table-online : ALTER succeeds as it is given a higher priority -+innodb-index-online-purge : ALTER succeeds as it is given a higher priority -+innodb-wl5522-debug : Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. -+innodb_stats_table_flag_auto_recalc : Performs multiple restarts in a row which causes '1047: Unknown command' errors -diff --git a/mysql-test/suite/innodb/t/innodb-autoinc.test b/mysql-test/suite/innodb/t/innodb-autoinc.test -index 3d9f591..7cc8065 100644 ---- a/mysql-test/suite/innodb/t/innodb-autoinc.test -+++ b/mysql-test/suite/innodb/t/innodb-autoinc.test -@@ -156,7 +156,7 @@ DROP TABLE t1; - # - # Test changes to AUTOINC next value calculation - SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - DROP TABLE IF EXISTS t1; - CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; - INSERT INTO t1 VALUES (NULL),(5),(NULL); -@@ -171,9 +171,11 @@ DROP TABLE t1; - # Test with SIGNED INT column, by inserting a 0 for the first column value - # 0 is treated in the same was NULL. - # Reset the AUTOINC session variables -+SET GLOBAL wsrep_auto_increment_control=OFF; -+ - SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; - SET @@INSERT_ID=1; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - DROP TABLE IF EXISTS t1; - CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; - INSERT INTO t1 VALUES(0); -@@ -193,13 +195,13 @@ DROP TABLE t1; - # Reset the AUTOINC session variables - SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; - SET @@INSERT_ID=1; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - DROP TABLE IF EXISTS t1; - CREATE TABLE t1 (c1 INT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; - INSERT INTO t1 VALUES(-1); - SELECT * FROM t1; - SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - INSERT INTO t1 VALUES (-2), (NULL),(2),(NULL); - INSERT INTO t1 VALUES (250),(NULL); - SELECT * FROM t1; -@@ -214,13 +216,13 @@ DROP TABLE t1; - # Reset the AUTOINC session variables - SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; - SET @@INSERT_ID=1; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - DROP TABLE IF EXISTS t1; - CREATE TABLE t1 (c1 INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; - INSERT INTO t1 VALUES(-1); - SELECT * FROM t1; - SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - INSERT INTO t1 VALUES (-2); - INSERT INTO t1 VALUES (NULL); - INSERT INTO t1 VALUES (2); -@@ -240,13 +242,13 @@ DROP TABLE t1; - # Reset the AUTOINC session variables - SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; - SET @@INSERT_ID=1; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - DROP TABLE IF EXISTS t1; - CREATE TABLE t1 (c1 INT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; - INSERT INTO t1 VALUES(-1); - SELECT * FROM t1; - SET @@SESSION.AUTO_INCREMENT_INCREMENT=100, @@SESSION.AUTO_INCREMENT_OFFSET=10; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - INSERT INTO t1 VALUES (-2),(NULL),(2),(NULL); - INSERT INTO t1 VALUES (250),(NULL); - SELECT * FROM t1; -@@ -262,7 +264,7 @@ DROP TABLE t1; - # Check for overflow handling when increment is > 1 - SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; - SET @@INSERT_ID=1; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - DROP TABLE IF EXISTS t1; - CREATE TABLE t1 (c1 BIGINT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; - # TODO: Fix the autoinc init code -@@ -271,7 +273,7 @@ INSERT INTO t1 VALUES(NULL); - INSERT INTO t1 VALUES (9223372036854775794); #-- 2^63 - 14 - SELECT * FROM t1; - SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - # This should just fit - INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL); - SELECT * FROM t1; -@@ -281,7 +283,7 @@ DROP TABLE t1; - # Check for overflow handling when increment and offser are > 1 - SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; - SET @@INSERT_ID=1; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - DROP TABLE IF EXISTS t1; - CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; - # TODO: Fix the autoinc init code -@@ -290,7 +292,7 @@ INSERT INTO t1 VALUES(NULL); - INSERT INTO t1 VALUES (18446744073709551603); #-- 2^64 - 13 - SELECT * FROM t1; - SET @@SESSION.AUTO_INCREMENT_INCREMENT=2, @@SESSION.AUTO_INCREMENT_OFFSET=10; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - --error ER_AUTOINC_READ_FAILED - INSERT INTO t1 VALUES (NULL),(NULL),(NULL),(NULL),(NULL),(NULL),(NULL); - SELECT * FROM t1; -@@ -300,7 +302,7 @@ DROP TABLE t1; - # Check for overflow handling when increment and offset are odd numbers - SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; - SET @@INSERT_ID=1; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - DROP TABLE IF EXISTS t1; - CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; - # TODO: Fix the autoinc init code -@@ -309,7 +311,7 @@ INSERT INTO t1 VALUES(NULL); - INSERT INTO t1 VALUES (18446744073709551603); #-- 2^64 - 13 - SELECT * FROM t1; - SET @@SESSION.AUTO_INCREMENT_INCREMENT=5, @@SESSION.AUTO_INCREMENT_OFFSET=7; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - --error ER_AUTOINC_READ_FAILED - INSERT INTO t1 VALUES (NULL),(NULL), (NULL); - SELECT * FROM t1; -@@ -319,7 +321,7 @@ DROP TABLE t1; - # and check for large -ve numbers - SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; - SET @@INSERT_ID=1; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - DROP TABLE IF EXISTS t1; - CREATE TABLE t1 (c1 BIGINT AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; - # TODO: Fix the autoinc init code -@@ -330,7 +332,7 @@ INSERT INTO t1 VALUES(-9223372036854775807); #-- -2^63 + 1 - INSERT INTO t1 VALUES(-9223372036854775808); #-- -2^63 - SELECT * FROM t1; - SET @@SESSION.AUTO_INCREMENT_INCREMENT=3, @@SESSION.AUTO_INCREMENT_OFFSET=3; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - INSERT INTO t1 VALUES (NULL),(NULL), (NULL); - SELECT * FROM t1; - DROP TABLE t1; -@@ -339,7 +341,7 @@ DROP TABLE t1; - # large numbers 2^60 - SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; - SET @@INSERT_ID=1; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - DROP TABLE IF EXISTS t1; - CREATE TABLE t1 (c1 BIGINT UNSIGNED AUTO_INCREMENT, PRIMARY KEY(c1)) ENGINE=InnoDB; - # TODO: Fix the autoinc init code -@@ -348,7 +350,7 @@ INSERT INTO t1 VALUES(NULL); - INSERT INTO t1 VALUES (18446744073709551610); #-- 2^64 - 2 - SELECT * FROM t1; - SET @@SESSION.AUTO_INCREMENT_INCREMENT=1152921504606846976, @@SESSION.AUTO_INCREMENT_OFFSET=1152921504606846976; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - --error ER_WARN_DATA_OUT_OF_RANGE - INSERT INTO t1 VALUES (NULL),(NULL); - SELECT * FROM t1; -@@ -359,7 +361,7 @@ DROP TABLE t1; - # - SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; - SET @@INSERT_ID=1; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - CREATE TABLE t1 (c1 DOUBLE NOT NULL AUTO_INCREMENT, c2 INT, PRIMARY KEY (c1)) ENGINE=InnoDB; - INSERT INTO t1 VALUES(NULL, 1); - INSERT INTO t1 VALUES(NULL, 2); -@@ -445,7 +447,7 @@ DROP TABLE t2; - # If the user has specified negative values for an AUTOINC column then - # InnoDB should ignore those values when setting the table's max value. - SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - # TINYINT - CREATE TABLE t1 (c1 TINYINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; - INSERT INTO t1 VALUES (1, NULL); -@@ -641,7 +643,7 @@ DROP TABLE t1; - - # Check if we handle offset > column max value properly - SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=256; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - # TINYINT - CREATE TABLE t1 (c1 TINYINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; - INSERT INTO t1 VALUES (1, NULL); -@@ -653,7 +655,7 @@ DROP TABLE t1; - # of the column. IMO, this should not be allowed and the assertion that fails - # is actually an invariant. - SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1; --SHOW VARIABLES LIKE "%auto_inc%"; -+SHOW VARIABLES LIKE "auto_inc%"; - # TINYINT - CREATE TABLE t1 (c1 INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB; - INSERT INTO t1 VALUES (2147483648, 'a'); -diff --git a/mysql-test/suite/opt_trace/t/disabled.def b/mysql-test/suite/opt_trace/t/disabled.def -new file mode 100644 -index 0000000..3ed40b8 ---- /dev/null -+++ b/mysql-test/suite/opt_trace/t/disabled.def -@@ -0,0 +1,2 @@ -+general_no_prot_all : Galera mysql-wsrep#5 2014-10-28 pstoev opt_trace.general_no_prot_none and opt_trace.general_no_prot_all fail in mysql-wsrep -+general_no_prot_none : Galera mysql-wsrep#5 2014-10-28 pstoev opt_trace.general_no_prot_none and opt_trace.general_no_prot_all fail in mysql-wsrep -diff --git a/mysql-test/suite/parts/r/partition_exch_qa_10.result b/mysql-test/suite/parts/r/partition_exch_qa_10.result -index 77b91f1..7193a6c 100644 ---- a/mysql-test/suite/parts/r/partition_exch_qa_10.result -+++ b/mysql-test/suite/parts/r/partition_exch_qa_10.result -@@ -23,7 +23,7 @@ a b - DROP PROCEDURE test_p1; - SET @save_autocommit= @@autocommit; - SET @@autocommit= OFF; --SHOW VARIABLES LIKE '%autocommit%'; -+SHOW VARIABLES LIKE 'autocommit%'; - Variable_name Value - autocommit OFF - CREATE TRIGGER test_trg_1 BEFORE UPDATE ON tp FOR EACH ROW -diff --git a/mysql-test/suite/parts/t/partition_exch_qa_10.test b/mysql-test/suite/parts/t/partition_exch_qa_10.test -index 4f56960..a87d658 100644 ---- a/mysql-test/suite/parts/t/partition_exch_qa_10.test -+++ b/mysql-test/suite/parts/t/partition_exch_qa_10.test -@@ -37,7 +37,7 @@ DROP PROCEDURE test_p1; - - SET @save_autocommit= @@autocommit; - SET @@autocommit= OFF; --SHOW VARIABLES LIKE '%autocommit%'; -+SHOW VARIABLES LIKE 'autocommit%'; - DELIMITER |; - --error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG - CREATE TRIGGER test_trg_1 BEFORE UPDATE ON tp FOR EACH ROW -diff --git a/mysql-test/suite/perfschema/r/dml_setup_instruments.result b/mysql-test/suite/perfschema/r/dml_setup_instruments.result -index b3de51e..5152d9f 100644 ---- a/mysql-test/suite/perfschema/r/dml_setup_instruments.result -+++ b/mysql-test/suite/perfschema/r/dml_setup_instruments.result -@@ -34,6 +34,7 @@ where name like 'Wait/Synch/Cond/sql/%' - and name not in ( - 'wait/synch/cond/sql/COND_handler_count', - 'wait/synch/cond/sql/DEBUG_SYNC::cond') -+and name not like 'wait/synch/cond/sql/COND_wsrep_%' - order by name limit 10; - NAME ENABLED TIMED - wait/synch/cond/sql/COND_flush_thread_cache YES YES -diff --git a/mysql-test/suite/perfschema/r/rpl_statements.result b/mysql-test/suite/perfschema/r/rpl_statements.result -index dd8d349..96016bd 100644 ---- a/mysql-test/suite/perfschema/r/rpl_statements.result -+++ b/mysql-test/suite/perfschema/r/rpl_statements.result -@@ -14,7 +14,7 @@ Note #### Storing MySQL user name or password information in the master info rep - - *** Create test tables - --show variables like '%binlog_format%'; -+show variables like 'binlog_format%'; - Variable_name Value - binlog_format MIXED - drop table if exists test.marker; -@@ -58,7 +58,7 @@ Expect 1 - *** MASTER *** - ************** - --show variables like '%binlog_format%'; -+show variables like 'binlog_format%'; - Variable_name Value - binlog_format MIXED - *** Clear statement events -diff --git a/mysql-test/suite/perfschema/t/disabled.def b/mysql-test/suite/perfschema/t/disabled.def -index 888298b..1a6d6b5 100644 ---- a/mysql-test/suite/perfschema/t/disabled.def -+++ b/mysql-test/suite/perfschema/t/disabled.def -@@ -9,3 +9,6 @@ - # Do not use any TAB characters for whitespace. - # - ############################################################################## -+ -+perfschema.sizing_growth : Galera LP#1370988 2014-10-28 pstoev Performance schema heuristics need to be updated -+ortho_iter : Galera mysql-wsrep#34 2014-12-19 perfschema.ortho_iter MTR test fails sporadically -diff --git a/mysql-test/suite/perfschema/t/dml_setup_instruments.test b/mysql-test/suite/perfschema/t/dml_setup_instruments.test -index 8a4f11b..b679b7a 100644 ---- a/mysql-test/suite/perfschema/t/dml_setup_instruments.test -+++ b/mysql-test/suite/perfschema/t/dml_setup_instruments.test -@@ -36,7 +36,8 @@ select * from performance_schema.setup_instruments - and name not in ( - 'wait/synch/cond/sql/COND_handler_count', - 'wait/synch/cond/sql/DEBUG_SYNC::cond') -- order by name limit 10; -+ and name not like 'wait/synch/cond/sql/COND_wsrep_%' -+order by name limit 10; - - --disable_result_log - select * from performance_schema.setup_instruments -diff --git a/mysql-test/suite/perfschema/t/rpl_statements.test b/mysql-test/suite/perfschema/t/rpl_statements.test -index 8e71961..ac4ece5 100644 ---- a/mysql-test/suite/perfschema/t/rpl_statements.test -+++ b/mysql-test/suite/perfschema/t/rpl_statements.test -@@ -63,7 +63,7 @@ connection master; - --echo *** Create test tables - --echo - --show variables like '%binlog_format%'; -+show variables like 'binlog_format%'; - - --disable_warnings - drop table if exists test.marker; -@@ -128,7 +128,7 @@ connection master; - --echo *** MASTER *** - --echo ************** - --echo --show variables like '%binlog_format%'; -+show variables like 'binlog_format%'; - - --echo *** Clear statement events - --source ../include/rpl_statements_truncate.inc -diff --git a/mysql-test/suite/rpl/r/rpl_auto_increment.result b/mysql-test/suite/rpl/r/rpl_auto_increment.result -index 0d858cf..283d244 100644 ---- a/mysql-test/suite/rpl/r/rpl_auto_increment.result -+++ b/mysql-test/suite/rpl/r/rpl_auto_increment.result -@@ -42,6 +42,7 @@ show variables like "%auto_inc%"; - Variable_name Value - auto_increment_increment 100 - auto_increment_offset 10 -+wsrep_auto_increment_control ON - create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; - insert into t1 values (NULL),(5),(NULL); - insert into t1 values (250),(NULL); -diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def -index a82c31c..fd07c96 100644 ---- a/mysql-test/suite/rpl/t/disabled.def -+++ b/mysql-test/suite/rpl/t/disabled.def -@@ -13,3 +13,4 @@ - rpl_row_create_table : Bug#11759274 2010-02-27 andrei failed different way than earlier with bug#45576 - rpl_delayed_slave : Bug#11764654 2010-11-09 andrei rpl_delayed_slave fails sporadically in pb - rpl_row_binlog_max_cache_size : BUG#14126780 May 29 2012 Vasil Dimov timeout if est number of rows is 3 instead of 4 -+rpl_test_framework : Too many servers started, so fails under Galera-enabled MTR -diff --git a/mysql-test/suite/sys_vars/r/all_vars.result b/mysql-test/suite/sys_vars/r/all_vars.result -index e042384..4edc039 100644 ---- a/mysql-test/suite/sys_vars/r/all_vars.result -+++ b/mysql-test/suite/sys_vars/r/all_vars.result -@@ -1,8 +1,8 @@ - create table t1 (test_name text); - create table t2 (variable_name text); - load data infile "MYSQLTEST_VARDIR/tmp/sys_vars.all_vars.txt" into table t1; --insert into t2 select variable_name from information_schema.global_variables; --insert into t2 select variable_name from information_schema.session_variables; -+insert into t2 select variable_name from information_schema.global_variables where variable_name not like 'wsrep_%' and variable_name not like 'innodb_disallow_writes'; -+insert into t2 select variable_name from information_schema.session_variables where variable_name not like 'wsrep_%' and variable_name not like 'innodb_disallow_writes'; - update t2 set variable_name= replace(variable_name, "PERFORMANCE_SCHEMA_", "PFS_"); - update t2 set variable_name= replace(variable_name, "_HISTORY_LONG_", "_HL_"); - update t2 set variable_name= replace(variable_name, "_HISTORY_", "_H_"); -diff --git a/mysql-test/suite/sys_vars/t/all_vars.test b/mysql-test/suite/sys_vars/t/all_vars.test -index c272528..90f977e 100644 ---- a/mysql-test/suite/sys_vars/t/all_vars.test -+++ b/mysql-test/suite/sys_vars/t/all_vars.test -@@ -49,8 +49,8 @@ create table t2 (variable_name text); - --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR - eval load data infile "$MYSQLTEST_VARDIR/tmp/sys_vars.all_vars.txt" into table t1; - --insert into t2 select variable_name from information_schema.global_variables; --insert into t2 select variable_name from information_schema.session_variables; -+insert into t2 select variable_name from information_schema.global_variables where variable_name not like 'wsrep_%' and variable_name not like 'innodb_disallow_writes'; -+insert into t2 select variable_name from information_schema.session_variables where variable_name not like 'wsrep_%' and variable_name not like 'innodb_disallow_writes'; - - # Performance schema variables are too long for files named - # 'mysql-test/suite/sys_vars/t/' ... -diff --git a/mysql-test/suite/wsrep/my.cnf b/mysql-test/suite/wsrep/my.cnf -new file mode 100644 -index 0000000..81e22a5 ---- /dev/null -+++ b/mysql-test/suite/wsrep/my.cnf -@@ -0,0 +1,12 @@ -+# Use default setting for mysqld processes -+!include include/default_mysqld.cnf -+ -+[mysqld.1] -+wsrep_provider=@ENV.WSREP_PROVIDER -+wsrep_cluster_address='gcomm://' -+wsrep_node_address=127.0.0.1 -+binlog-format=row -+ -+[ENV] -+GALERA_BASE_PORT=@mysqld.1.#galera_port -+ -diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def -index dd8a6f4..ae0eb82 100644 ---- a/mysql-test/t/disabled.def -+++ b/mysql-test/t/disabled.def -@@ -18,3 +18,4 @@ ds_mrr-big @solaris : Bug#14168107 2012-04-03 Hemant disabled new test adde - mysql_embedded_client_test : Bug#13964673 2012-04-16 amitbha since most of the test cases are failing - mysql_client_test_embedded : Bug#16084066 2013-01-08 Disabled since this test is failing - file_contents : Fails without bzr revision id -+bootstrap : Galera mysql-wsrep#19 2014-11-21 pstoev Crash in LOGGER::error_log_print when printing a WSREP message -diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test -index 2b92d9e..8c0c56f 100644 ---- a/mysql-test/t/mysqltest.test -+++ b/mysql-test/t/mysqltest.test -@@ -708,7 +708,7 @@ remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql; - - # Too many errorcodes specified - --error 1 ----exec echo "--error 1,2,3,4,5,6,7,8,9,10,11" | $MYSQL_TEST 2>&1 -+--exec echo "--error 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21" | $MYSQL_TEST 2>&1 - - - # ---------------------------------------------------------------------------- -diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c -index 9ef8632..9098cd8 100644 ---- a/mysys/thr_lock.c -+++ b/mysys/thr_lock.c -@@ -82,7 +82,24 @@ one TL_WRITE_DELAYED lock at the same time as multiple read locks. - my_bool thr_lock_inited=0; - ulong locks_immediate = 0L, locks_waited = 0L; - enum thr_lock_type thr_upgraded_concurrent_insert_lock = TL_WRITE; -- -+#ifdef WITH_WSREP -+static wsrep_thd_is_brute_force_fun wsrep_thd_is_brute_force= NULL; -+static wsrep_abort_thd_fun wsrep_abort_thd= NULL; -+static my_bool wsrep_debug; -+static my_bool wsrep_convert_LOCK_to_trx; -+static wsrep_on_fun wsrep_on = NULL; -+ -+void wsrep_thr_lock_init( -+ wsrep_thd_is_brute_force_fun bf_fun, wsrep_abort_thd_fun abort_fun, -+ my_bool debug, my_bool convert_LOCK_to_trx, wsrep_on_fun on_fun -+) { -+ wsrep_thd_is_brute_force = bf_fun; -+ wsrep_abort_thd = abort_fun; -+ wsrep_debug = debug; -+ wsrep_convert_LOCK_to_trx= convert_LOCK_to_trx; -+ wsrep_on = on_fun; -+} -+#endif - /* The following constants are only for debug output */ - #define MAX_THREADS 100 - #define MAX_LOCKS 100 -@@ -536,6 +553,108 @@ wait_for_lock(struct st_lock_list *wait, THR_LOCK_DATA *data, - DBUG_RETURN(result); - } - -+#ifdef WITH_WSREP -+/* -+ * If brute force applier would need to wait for a thr lock, -+ * it needs to make sure that it will get the lock without (too much) -+ * delay. -+ * We identify here the owners of blocking locks and ask them to -+ * abort. We then put our lock request in the first place in the -+ * wait queue. When lock holders abort (one by one) the lock release -+ * algorithm should grant the lock to us. We rely on this and proceed -+ * to wait_for_locks(). -+ * wsrep_break_locks() should be called in all the cases, where lock -+ * wait would happen. -+ * -+ * TODO: current implementation might not cover all possible lock wait -+ * situations. This needs an review still. -+ * TODO: lock release, might favor some other lock (instead our bf). -+ * This needs an condition to check for bf locks first. -+ * TODO: we still have a debug fprintf, this should be removed -+ */ -+static inline my_bool -+wsrep_break_lock( -+ THR_LOCK_DATA *data, struct st_lock_list *lock_queue1, -+ struct st_lock_list *lock_queue2, struct st_lock_list *wait_queue) -+{ -+ if (wsrep_on(data->owner->mysql_thd) && -+ wsrep_thd_is_brute_force && -+ wsrep_thd_is_brute_force(data->owner->mysql_thd, TRUE)) -+ { -+ THR_LOCK_DATA *holder; -+ -+ /* if locking session conversion to transaction has been enabled, -+ we know that this conflicting lock must be read lock and furthermore, -+ lock holder is read-only. It is safe to wait for him. -+ */ -+#ifdef TODO -+ if (wsrep_convert_LOCK_to_trx && -+ (THD*)(data->owner->mysql_thd)->in_lock_tables) -+ { -+ if (wsrep_debug) -+ fprintf(stderr,"WSREP wsrep_break_lock read lock untouched\n"); -+ return FALSE; -+ } -+#endif -+ if (wsrep_debug) -+ fprintf(stderr,"WSREP wsrep_break_lock aborting locks\n"); -+ -+ /* aborting lock holder(s) here */ -+ for (holder=(lock_queue1) ? lock_queue1->data : NULL; -+ holder; -+ holder=holder->next) -+ { -+ if (!wsrep_thd_is_brute_force(holder->owner->mysql_thd, TRUE)) -+ { -+ wsrep_abort_thd(data->owner->mysql_thd, -+ holder->owner->mysql_thd, FALSE); -+ } -+ else -+ { -+ if (wsrep_debug) -+ fprintf(stderr,"WSREP wsrep_break_lock skipping BF lock conflict\n"); -+ return FALSE; -+ } -+ } -+ for (holder=(lock_queue2) ? lock_queue2->data : NULL; -+ holder; -+ holder=holder->next) -+ { -+ if (!wsrep_thd_is_brute_force(holder->owner->mysql_thd, TRUE)) -+ { -+ wsrep_abort_thd(data->owner->mysql_thd, -+ holder->owner->mysql_thd, FALSE); -+ } -+ else -+ { -+ if (wsrep_debug) -+ fprintf(stderr,"WSREP wsrep_break_lock skipping BF lock conflict\n"); -+ return FALSE; -+ } -+ } -+ -+ /* Add our lock to the head of the wait queue */ -+ if (*(wait_queue->last)==wait_queue->data) -+ { -+ wait_queue->last=&data->next; -+ assert(wait_queue->data==0); -+ } -+ else -+ { -+ assert(wait_queue->data!=0); -+ wait_queue->data->prev=&data->next; -+ } -+ data->next=wait_queue->data; -+ data->prev=&wait_queue->data; -+ wait_queue->data=data; -+ data->cond=get_cond(); -+ -+ statistic_increment(locks_immediate,&THR_LOCK_lock); -+ return TRUE; -+ } -+ return FALSE; -+} -+#endif - - enum enum_thr_lock_result - thr_lock(THR_LOCK_DATA *data, THR_LOCK_INFO *owner, -@@ -544,6 +663,9 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_INFO *owner, - THR_LOCK *lock=data->lock; - enum enum_thr_lock_result result= THR_LOCK_SUCCESS; - struct st_lock_list *wait_queue; -+#ifdef WITH_WSREP -+ my_bool wsrep_lock_inserted= FALSE; -+#endif - MYSQL_TABLE_WAIT_VARIABLES(locker, state) /* no ';' */ - DBUG_ENTER("thr_lock"); - -@@ -613,6 +735,13 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_INFO *owner, - } - if (lock->write.data->type == TL_WRITE_ONLY) - { -+#ifdef WITH_WSREP -+ if (wsrep_break_lock(data, &lock->write, NULL, &lock->read_wait)) -+ { -+ wsrep_lock_inserted= TRUE; -+ goto wsrep_read_wait; -+ } -+#endif - /* We are not allowed to get a READ lock in this case */ - data->type=TL_UNLOCK; - result= THR_LOCK_ABORTED; /* Can't wait for this one */ -@@ -640,6 +769,13 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_INFO *owner, - lock but a high priority write waiting in the write_wait queue. - In the latter case we should yield the lock to the writer. - */ -+#ifdef WITH_WSREP -+ if (wsrep_break_lock(data, &lock->write, NULL, &lock->read_wait)) -+ { -+ wsrep_lock_inserted= TRUE; -+ } -+ wsrep_read_wait: -+#endif - wait_queue= &lock->read_wait; - } - else /* Request for WRITE lock */ -@@ -648,12 +784,25 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_INFO *owner, - { - if (lock->write.data && lock->write.data->type == TL_WRITE_ONLY) - { -+#ifdef WITH_WSREP -+ if (wsrep_break_lock(data, &lock->write, NULL, &lock->write_wait)) -+ { -+ wsrep_lock_inserted=TRUE; -+ goto wsrep_write_wait; -+ } -+#endif - data->type=TL_UNLOCK; - result= THR_LOCK_ABORTED; /* Can't wait for this one */ - goto end; - } - if (lock->write.data || lock->read.data) - { -+#ifdef WITH_WSREP -+ if (wsrep_break_lock(data, &lock->write, NULL, &lock->write_wait)) -+ { -+ goto end; -+ } -+#endif - /* Add delayed write lock to write_wait queue, and return at once */ - (*lock->write_wait.last)=data; - data->prev=lock->write_wait.last; -@@ -678,6 +827,13 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_INFO *owner, - /* Allow lock owner to bypass TL_WRITE_ONLY. */ - if (!thr_lock_owner_equal(data->owner, lock->write.data->owner)) - { -+#ifdef WITH_WSREP -+ if (wsrep_break_lock(data, &lock->write, NULL, &lock->write_wait)) -+ { -+ wsrep_lock_inserted=TRUE; -+ goto wsrep_write_wait; -+ } -+#endif - /* We are not allowed to get a lock in this case */ - data->type=TL_UNLOCK; - result= THR_LOCK_ABORTED; /* Can't wait for this one */ -@@ -781,9 +937,20 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_INFO *owner, - DBUG_PRINT("lock",("write locked 3 by thread: 0x%lx type: %d", - lock->read.data->owner->thread_id, data->type)); - } -+#ifdef WITH_WSREP -+ if (wsrep_break_lock(data, &lock->write, NULL, &lock->write_wait)) -+ { -+ wsrep_lock_inserted= TRUE; -+ } -+ wsrep_write_wait: -+#endif - wait_queue= &lock->write_wait; - } - /* Can't get lock yet; Wait for it */ -+#ifdef WITH_WSREP -+ if (wsrep_on(data->owner->mysql_thd) && wsrep_lock_inserted) -+ DBUG_RETURN(wait_for_lock(wait_queue, data, 1, lock_wait_timeout)); -+#endif - result= wait_for_lock(wait_queue, data, 0, lock_wait_timeout); - MYSQL_END_TABLE_LOCK_WAIT(locker); - DBUG_RETURN(result); -diff --git a/mysys_ssl/my_default.cc b/mysys_ssl/my_default.cc -index 6712b79..ff8f44c 100644 ---- a/mysys_ssl/my_default.cc -+++ b/mysys_ssl/my_default.cc -@@ -110,6 +110,12 @@ static char my_login_file[FN_REFLEN]; - - static my_bool defaults_already_read= FALSE; - -+#ifdef WITH_WSREP -+/* The only purpose of this global array is to hold full name of my.cnf -+ * which seems to be otherwise unavailable */ -+char wsrep_defaults_file[FN_REFLEN + 10]={0,}; -+char wsrep_defaults_group_suffix[FN_EXTLEN]={0,}; -+#endif /* WITH_WREP */ - /* Set to TRUE, if --no-defaults is found. */ - static my_bool found_no_defaults= FALSE; - -@@ -534,6 +540,13 @@ int get_defaults_options(int argc, char **argv, - if (!*group_suffix && is_prefix(*argv, "--defaults-group-suffix=")) - { - *group_suffix= *argv + sizeof("--defaults-group-suffix=")-1; -+ -+#ifdef WITH_WSREP -+ /* make sure we do this only once - for top-level file */ -+ if ('\0' == wsrep_defaults_group_suffix[0]) -+ strncpy(wsrep_defaults_group_suffix, *group_suffix, sizeof(wsrep_defaults_group_suffix) - 1); -+#endif /* WITH_WSREP */ -+ - argc--; - default_option_count ++; - continue; -@@ -893,6 +906,11 @@ static int search_default_file_with_ext(Process_option_func opt_handler, - if ( !(fp = mysql_file_fopen(key_file_cnf, name, O_RDONLY, MYF(0)))) - return 1; /* Ignore wrong files */ - } -+#ifdef WITH_WSREP -+ /* make sure we do this only once - for top-level file */ -+ if ('\0' == wsrep_defaults_file[0]) -+ strncpy(wsrep_defaults_file, name, sizeof(wsrep_defaults_file) - 1); -+#endif /* WITH_WSREP */ - - while (mysql_file_getline(buff, sizeof(buff) - 1, fp)) - { -diff --git a/mysys_ssl/my_md5.cc b/mysys_ssl/my_md5.cc -index 4c14366..1ef0b42 100644 ---- a/mysys_ssl/my_md5.cc -+++ b/mysys_ssl/my_md5.cc -@@ -66,3 +66,34 @@ void compute_md5_hash(char *digest, const char *buf, int len) - my_md5_hash((unsigned char*)digest, (unsigned const char*)buf, len); - #endif /* HAVE_YASSL */ - } -+#ifdef WITH_WSREP -+void *wsrep_md5_init() -+{ -+#if defined(HAVE_YASSL) -+ TaoCrypt::MD5 *hasher= new TaoCrypt::MD5; -+ return (void*)hasher; -+#elif defined(HAVE_OPENSSL) -+ MD5_CTX *ctx = new MD5_CTX(); -+ MD5_Init (ctx); -+ return (void *)ctx; -+#endif /* HAVE_YASSL */ -+} -+void wsrep_md5_update(void *ctx, char* buf, int len) -+{ -+#if defined(HAVE_YASSL) -+ ((TaoCrypt::MD5 *)ctx)->Update((TaoCrypt::byte *) buf, len); -+#elif defined(HAVE_OPENSSL) -+ MD5_Update((MD5_CTX*)(ctx), buf, len); -+#endif /* HAVE_YASSL */ -+} -+void wsrep_compute_md5_hash(char *digest, void *ctx) -+{ -+#if defined(HAVE_YASSL) -+ ((TaoCrypt::MD5*)ctx)->Final((TaoCrypt::byte *) digest); -+ delete (TaoCrypt::MD5*)ctx; -+#elif defined(HAVE_OPENSSL) -+ MD5_Final ((unsigned char*)digest, (MD5_CTX*)ctx); -+ delete (MD5_CTX*)ctx; -+#endif /* HAVE_YASSL */ -+} -+#endif -diff --git a/plugin/innodb_memcached/daemon_memcached/CMakeLists.txt b/plugin/innodb_memcached/daemon_memcached/CMakeLists.txt -index 11a1276..e53980b 100644 ---- a/plugin/innodb_memcached/daemon_memcached/CMakeLists.txt -+++ b/plugin/innodb_memcached/daemon_memcached/CMakeLists.txt -@@ -78,7 +78,7 @@ SET(MEMCACHED_SOURCES - MYSQL_ADD_PLUGIN(libmemcached ${MEMCACHED_SOURCES} - MODULE_ONLY MODULE_OUTPUT_NAME "libmemcached") - --TARGET_LINK_LIBRARIES(libmemcached ${LIBEVENT_LIBRARY}) -+TARGET_LINK_LIBRARIES(libmemcached ${LIBEVENT_LIBRARY} ${LIBEVENT_LIBRARIES}) - TARGET_LINK_LIBRARIES(libmemcached memcached_utilities) - - IF(ENABLE_MEMCACHED_SASL) -diff --git a/plugin/innodb_memcached/innodb_memcache/src/innodb_api.c b/plugin/innodb_memcached/innodb_memcache/src/innodb_api.c -index 14e2fa7..e062343 100644 ---- a/plugin/innodb_memcached/innodb_memcache/src/innodb_api.c -+++ b/plugin/innodb_memcached/innodb_memcache/src/innodb_api.c -@@ -666,7 +666,6 @@ innodb_api_copy_mci( - - } else { - mci_item->value_str = malloc(data_len); -- - if (!mci_item->value_str) { - return(false); - } -diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt -index c043f07..a69d938 100644 ---- a/scripts/CMakeLists.txt -+++ b/scripts/CMakeLists.txt -@@ -320,6 +320,15 @@ IF(WIN32) - INSTALL_SCRIPT(${CMAKE_CURRENT_BINARY_DIR}/${file}.pl COMPONENT Server_Scripts) - ENDFOREACH() - ELSE() -+ IF(WITH_WSREP) -+ SET(WSREP_BINARIES -+ wsrep_sst_common -+ wsrep_sst_mysqldump -+ wsrep_sst_rsync -+ wsrep_sst_xtrabackup -+ wsrep_sst_xtrabackup-v2 -+ ) -+ ENDIF() - # Configure this one, for testing, but do not install it. - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_config.pl.in - ${CMAKE_CURRENT_BINARY_DIR}/mysql_config.pl ESCAPE_QUOTES @ONLY) -@@ -339,6 +348,7 @@ ELSE() - mysqldumpslow - mysqld_multi - mysqld_safe -+ ${WSREP_BINARIES} - ) - FOREACH(file ${BIN_SCRIPTS}) - IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh) -diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh -index 3b588ef..4520503 100644 ---- a/scripts/mysqld_safe.sh -+++ b/scripts/mysqld_safe.sh -@@ -141,7 +141,7 @@ log_notice () { - } - - eval_log_error () { -- cmd="$1" -+ local cmd="$1" - case $logging in - file) cmd="$cmd >> "`shell_quote_string "$err_log"`" 2>&1" ;; - syslog) -@@ -169,6 +169,78 @@ shell_quote_string() { - echo "$1" | sed -e 's,\([^a-zA-Z0-9/_.=-]\),\\\1,g' - } - -+wsrep_pick_url() { -+ [ $# -eq 0 ] && return 0 -+ -+ log_error "WSREP: 'wsrep_urls' is DEPRECATED! Use wsrep_cluster_address to specify multiple addresses instead." -+ -+ if ! which nc >/dev/null; then -+ log_error "ERROR: nc tool not found in PATH! Make sure you have it installed." -+ return 1 -+ fi -+ -+ local url -+ # Assuming URL in the form scheme://host:port -+ # If host and port are not NULL, the liveness of URL is assumed to be tested -+ # If port part is absent, the url is returned literally and unconditionally -+ # If every URL has port but none is reachable, nothing is returned -+ for url in `echo $@ | sed s/,/\ /g` 0; do -+ local host=`echo $url | cut -d \: -f 2 | sed s/^\\\/\\\///` -+ local port=`echo $url | cut -d \: -f 3` -+ [ -z "$port" ] && break -+ nc -z "$host" $port >/dev/null && break -+ done -+ -+ if [ "$url" == "0" ]; then -+ log_error "ERROR: none of the URLs in '$@' is reachable." -+ return 1 -+ fi -+ -+ echo $url -+} -+ -+# Run mysqld with --wsrep-recover and parse recovered position from log. -+# Position will be stored in wsrep_start_position_opt global. -+wsrep_start_position_opt="" -+wsrep_recover_position() { -+ local mysqld_cmd="$@" -+ local euid=$(id -u) -+ local ret=0 -+ -+ local wr_logfile=$(mktemp $DATADIR/wsrep_recovery.XXXXXX) -+ -+ [ "$euid" = "0" ] && chown $user $wr_logfile -+ chmod 600 $wr_logfile -+ -+ local wr_pidfile="$DATADIR/"`@HOSTNAME@`"-recover.pid" -+ -+ local wr_options="--log_error='$wr_logfile' --pid-file='$wr_pidfile'" -+ -+ log_notice "WSREP: Running position recovery with $wr_options" -+ -+ eval_log_error "$mysqld_cmd --wsrep_recover $wr_options" -+ -+ local rp="$(grep 'WSREP: Recovered position:' $wr_logfile)" -+ if [ -z "$rp" ]; then -+ local skipped="$(grep WSREP $wr_logfile | grep 'skipping position recovery')" -+ if [ -z "$skipped" ]; then -+ log_error "WSREP: Failed to recover position: " `cat $wr_logfile`; -+ ret=1 -+ else -+ log_notice "WSREP: Position recovery skipped" -+ fi -+ else -+ local start_pos="$(echo $rp | sed 's/.*WSREP\:\ Recovered\ position://' \ -+ | sed 's/^[ \t]*//')" -+ log_notice "WSREP: Recovered position $start_pos" -+ wsrep_start_position_opt="--wsrep_start_position=$start_pos" -+ fi -+ -+ rm $wr_logfile -+ -+ return $ret -+} -+ - parse_arguments() { - # We only need to pass arguments through to the server if we don't - # handle them here. So, we collect unrecognized options (passed on -@@ -224,7 +296,13 @@ parse_arguments() { - --skip-syslog) want_syslog=0 ;; - --syslog-tag=*) syslog_tag="$val" ;; - --timezone=*) TZ="$val"; export TZ; ;; -- -+ --wsrep[-_]urls=*) wsrep_urls="$val"; ;; -+ --wsrep[-_]provider=*) -+ if test -n "$val" && test "$val" != "none" -+ then -+ wsrep_restart=1 -+ fi -+ ;; - --help) usage ;; - - *) -@@ -770,7 +848,8 @@ do - done - cmd="$cmd $args" - # Avoid 'nohup: ignoring input' warning --test -n "$NOHUP_NICENESS" && cmd="$cmd < /dev/null" -+nohup_redir="" -+test -n "$NOHUP_NICENESS" && nohup_redir=" < /dev/null" - - log_notice "Starting $MYSQLD daemon with databases from $DATADIR" - -@@ -781,13 +860,28 @@ max_fast_restarts=5 - # flag whether a usable sleep command exists - have_sleep=1 - -+# maximum number of wsrep restarts -+max_wsrep_restarts=0 -+ - while true - do - rm -f $safe_mysql_unix_port "$pid_file" # Some extra safety - - start_time=`date +%M%S` - -- eval_log_error "$cmd" -+ # this sets wsrep_start_position_opt -+ wsrep_recover_position "$cmd" -+ -+ [ $? -ne 0 ] && exit 1 # -+ -+ [ -n "$wsrep_urls" ] && url=`wsrep_pick_url $wsrep_urls` # check connect address -+ -+ if [ -z "$url" ] -+ then -+ eval_log_error "$cmd $wsrep_start_position_opt $nohup_redir" -+ else -+ eval_log_error "$cmd $wsrep_start_position_opt --wsrep_cluster_address=$url $nohup_redir" -+ fi - - if [ $want_syslog -eq 0 -a ! -f "$err_log" ]; then - touch "$err_log" # hypothetical: log was renamed but not -@@ -857,6 +951,20 @@ do - I=`expr $I + 1` - done - fi -+ -+ if [ -n "$wsrep_restart" ] -+ then -+ if [ $wsrep_restart -le $max_wsrep_restarts ] -+ then -+ wsrep_restart=`expr $wsrep_restart + 1` -+ log_notice "WSREP: sleeping 15 seconds before restart" -+ sleep 15 -+ else -+ log_notice "WSREP: not restarting wsrep node automatically" -+ break -+ fi -+ fi -+ - log_notice "mysqld restarted" - done - -diff --git a/scripts/wsrep_sst_common.sh b/scripts/wsrep_sst_common.sh -new file mode 100644 -index 0000000..46f4076 ---- /dev/null -+++ b/scripts/wsrep_sst_common.sh -@@ -0,0 +1,187 @@ -+# Copyright (C) 2012-2014 Codership Oy -+# -+# 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; see the file COPYING. If not, write to the -+# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston -+# MA 02110-1301 USA. -+ -+# This is a common command line parser to be sourced by other SST scripts -+ -+set -u -+ -+WSREP_SST_OPT_BYPASS=0 -+WSREP_SST_OPT_BINLOG="" -+WSREP_SST_OPT_DATA="" -+WSREP_SST_OPT_AUTH="" -+ -+while [ $# -gt 0 ]; do -+case "$1" in -+ '--address') -+ readonly WSREP_SST_OPT_ADDR="$2" -+ shift -+ ;; -+ '--auth') -+ WSREP_SST_OPT_AUTH="$2" -+ shift -+ ;; -+ '--bypass') -+ WSREP_SST_OPT_BYPASS=1 -+ ;; -+ '--datadir') -+ readonly WSREP_SST_OPT_DATA="$2" -+ shift -+ ;; -+ '--defaults-file') -+ readonly WSREP_SST_OPT_CONF="$2" -+ shift -+ ;; -+ '--defaults-group-suffix') -+ readonly WSREP_SST_OPT_CONF_SUFFIX="$2" -+ shift -+ ;; -+ '--host') -+ readonly WSREP_SST_OPT_HOST="$2" -+ shift -+ ;; -+ '--local-port') -+ readonly WSREP_SST_OPT_LPORT="$2" -+ shift -+ ;; -+ '--parent') -+ readonly WSREP_SST_OPT_PARENT="$2" -+ shift -+ ;; -+ '--password') -+ WSREP_SST_OPT_PSWD="$2" -+ shift -+ ;; -+ '--port') -+ readonly WSREP_SST_OPT_PORT="$2" -+ shift -+ ;; -+ '--role') -+ readonly WSREP_SST_OPT_ROLE="$2" -+ shift -+ ;; -+ '--socket') -+ readonly WSREP_SST_OPT_SOCKET="$2" -+ shift -+ ;; -+ '--user') -+ WSREP_SST_OPT_USER="$2" -+ shift -+ ;; -+ '--gtid') -+ readonly WSREP_SST_OPT_GTID="$2" -+ shift -+ ;; -+ '--binlog') -+ WSREP_SST_OPT_BINLOG="$2" -+ shift -+ ;; -+ *) # must be command -+ # usage -+ # exit 1 -+ ;; -+esac -+shift -+done -+readonly WSREP_SST_OPT_BYPASS -+readonly WSREP_SST_OPT_BINLOG -+ -+# try to use my_print_defaults, mysql and mysqldump that come with the sources -+# (for MTR suite) -+SCRIPTS_DIR="$(cd $(dirname "$0"); pwd -P)" -+EXTRA_DIR="$SCRIPTS_DIR/../extra" -+CLIENT_DIR="$SCRIPTS_DIR/../client" -+ -+if [ -x "$CLIENT_DIR/mysql" ]; then -+ MYSQL_CLIENT="$CLIENT_DIR/mysql" -+else -+ MYSQL_CLIENT=$(which mysql) -+fi -+ -+if [ -x "$CLIENT_DIR/mysqldump" ]; then -+ MYSQLDUMP="$CLIENT_DIR/mysqldump" -+else -+ MYSQLDUMP=$(which mysqldump) -+fi -+ -+if [ -x "$SCRIPTS_DIR/my_print_defaults" ]; then -+ MY_PRINT_DEFAULTS="$SCRIPTS_DIR/my_print_defaults" -+elif [ -x "$EXTRA_DIR/my_print_defaults" ]; then -+ MY_PRINT_DEFAULTS="$EXTRA_DIR/my_print_defaults" -+else -+ MY_PRINT_DEFAULTS=$(which my_print_defaults) -+fi -+ -+# For Bug:1200727 -+if $MY_PRINT_DEFAULTS -c $WSREP_SST_OPT_CONF sst | grep -q "wsrep_sst_auth";then -+ if [ -z "$WSREP_SST_OPT_AUTH" -o "$WSREP_SST_OPT_AUTH" = "(null)" ];then -+ WSREP_SST_OPT_AUTH=$(my_print_defaults -c $WSREP_SST_OPT_CONF sst | grep -- "--wsrep_sst_auth" | cut -d= -f2) -+ fi -+fi -+ -+if [ -n "${WSREP_SST_OPT_DATA:-}" ] -+then -+ SST_PROGRESS_FILE="$WSREP_SST_OPT_DATA/sst_in_progress" -+else -+ SST_PROGRESS_FILE="" -+fi -+ -+ -+wsrep_log() -+{ -+ # echo everything to stderr so that it gets into common error log -+ # deliberately made to look different from the rest of the log -+ local readonly tst="$(date +%Y%m%d\ %H:%M:%S.%N | cut -b -21)" -+ echo "WSREP_SST: $* ($tst)" >&2 -+} -+ -+wsrep_log_error() -+{ -+ wsrep_log "[ERROR] $*" -+} -+ -+wsrep_log_info() -+{ -+ wsrep_log "[INFO] $*" -+} -+ -+wsrep_cleanup_progress_file() -+{ -+ [ -n "$SST_PROGRESS_FILE" ] && rm -f "$SST_PROGRESS_FILE" 2>/dev/null -+} -+ -+wsrep_check_program() -+{ -+ local prog=$1 -+ -+ if ! which $prog >/dev/null -+ then -+ echo "'$prog' not found in PATH" -+ return 2 # no such file or directory -+ fi -+} -+ -+wsrep_check_programs() -+{ -+ local ret=0 -+ -+ while [ $# -gt 0 ] -+ do -+ wsrep_check_program $1 || ret=$? -+ shift -+ done -+ -+ return $ret -+} -diff --git a/scripts/wsrep_sst_mysqldump.sh b/scripts/wsrep_sst_mysqldump.sh -new file mode 100644 -index 0000000..89eb755 ---- /dev/null -+++ b/scripts/wsrep_sst_mysqldump.sh -@@ -0,0 +1,136 @@ -+#!/bin/bash -e -+# Copyright (C) 2009 Codership Oy -+# -+# 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; see the file COPYING. If not, write to the -+# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston -+# MA 02110-1301 USA. -+ -+# This is a reference script for mysqldump-based state snapshot tansfer -+ -+. $(dirname $0)/wsrep_sst_common -+ -+EINVAL=22 -+ -+local_ip() -+{ -+ PATH=$PATH:/usr/sbin:/usr/bin:/sbin:/bin -+ -+ [ "$1" = "127.0.0.1" ] && return 0 -+ [ "$1" = "localhost" ] && return 0 -+ [ "$1" = "$(hostname -s)" ] && return 0 -+ [ "$1" = "$(hostname -f)" ] && return 0 -+ [ "$1" = "$(hostname -d)" ] && return 0 -+ -+ # Now if ip program is not found in the path, we can't return 0 since -+ # it would block any address. Thankfully grep should fail in this case -+ ip route get "$1" | grep local >/dev/null && return 0 -+ -+ return 1 -+} -+ -+if test -z "$WSREP_SST_OPT_USER"; then wsrep_log_error "USER cannot be nil"; exit $EINVAL; fi -+if test -z "$WSREP_SST_OPT_HOST"; then wsrep_log_error "HOST cannot be nil"; exit $EINVAL; fi -+if test -z "$WSREP_SST_OPT_PORT"; then wsrep_log_error "PORT cannot be nil"; exit $EINVAL; fi -+if test -z "$WSREP_SST_OPT_LPORT"; then wsrep_log_error "LPORT cannot be nil"; exit $EINVAL; fi -+if test -z "$WSREP_SST_OPT_SOCKET";then wsrep_log_error "SOCKET cannot be nil";exit $EINVAL; fi -+if test -z "$WSREP_SST_OPT_GTID"; then wsrep_log_error "GTID cannot be nil"; exit $EINVAL; fi -+ -+if local_ip $WSREP_SST_OPT_HOST && \ -+ [ "$WSREP_SST_OPT_PORT" = "$WSREP_SST_OPT_LPORT" ] -+then -+ wsrep_log_error \ -+ "destination address '$WSREP_SST_OPT_HOST:$WSREP_SST_OPT_PORT' matches source address." -+ exit $EINVAL -+fi -+ -+# Check client version -+CLIENT_MINOR=$(mysql --version | cut -d ' ' -f 6 | cut -d '.' -f 2) -+if [ $CLIENT_MINOR -lt "6" ] -+then -+ $MYSQL_CLIENT --version >&2 -+ wsrep_log_error "this operation requires MySQL client version 5.6.x" -+ exit $EINVAL -+fi -+ -+# For Bug:1293798 -+if [ -z "$WSREP_SST_OPT_PSWD" -a -n "$WSREP_SST_OPT_AUTH" ]; then -+ WSREP_SST_OPT_USER=$(echo $WSREP_SST_OPT_AUTH | cut -d: -f1) -+ WSREP_SST_OPT_PSWD=$(echo $WSREP_SST_OPT_AUTH | cut -d: -f2) -+fi -+AUTH="-u$WSREP_SST_OPT_USER" -+if test -n "$WSREP_SST_OPT_PSWD"; then AUTH="$AUTH -p$WSREP_SST_OPT_PSWD"; fi -+ -+STOP_WSREP="SET wsrep_on=OFF;" -+ -+# NOTE: we don't use --routines here because we're dumping mysql.proc table -+MYSQLDUMP="$MYSQLDUMP $AUTH -S$WSREP_SST_OPT_SOCKET \ -+--add-drop-database --add-drop-table --skip-add-locks --create-options \ -+--disable-keys --extended-insert --skip-lock-tables --quick --set-charset \ -+--skip-comments --flush-privileges --all-databases --events" -+ -+# mysqldump cannot restore CSV tables, fix this issue -+CSV_TABLES_FIX=" -+set sql_mode=''; -+ -+USE mysql; -+ -+SET @str = IF (@@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS general_log (event_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT NOT NULL, thread_id INTEGER NOT NULL, server_id INTEGER UNSIGNED NOT NULL, command_type VARCHAR(64) NOT NULL,argument MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8 comment=\"General log\"', 'SET @dummy = 0'); -+ -+PREPARE stmt FROM @str; -+EXECUTE stmt; -+DROP PREPARE stmt; -+ -+SET @str = IF (@@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS slow_log (start_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT NOT NULL, query_time TIME NOT NULL, lock_time TIME NOT NULL, rows_sent INTEGER NOT NULL, rows_examined INTEGER NOT NULL, db VARCHAR(512) NOT NULL, last_insert_id INTEGER NOT NULL, insert_id INTEGER NOT NULL, server_id INTEGER UNSIGNED NOT NULL, sql_text MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8 comment=\"Slow log\"', 'SET @dummy = 0'); -+ -+PREPARE stmt FROM @str; -+EXECUTE stmt; -+DROP PREPARE stmt;" -+ -+SET_START_POSITION="SET GLOBAL wsrep_start_position='$WSREP_SST_OPT_GTID';" -+ -+MYSQL="$MYSQL_CLIENT $AUTH -h$WSREP_SST_OPT_HOST -P$WSREP_SST_OPT_PORT "\ -+"--disable-reconnect --connect_timeout=10" -+ -+# need to disable logging when loading the dump -+# reason is that dump contains ALTER TABLE for log tables, and -+# this causes an error if logging is enabled -+GENERAL_LOG_OPT=`$MYSQL --skip-column-names -e"$STOP_WSREP SELECT @@GENERAL_LOG"` -+SLOW_LOG_OPT=`$MYSQL --skip-column-names -e"$STOP_WSREP SELECT @@SLOW_QUERY_LOG"` -+$MYSQL -e"$STOP_WSREP SET GLOBAL GENERAL_LOG=OFF" -+$MYSQL -e"$STOP_WSREP SET GLOBAL SLOW_QUERY_LOG=OFF" -+ -+# commands to restore log settings -+RESTORE_GENERAL_LOG="SET GLOBAL GENERAL_LOG=$GENERAL_LOG_OPT;" -+RESTORE_SLOW_QUERY_LOG="SET GLOBAL SLOW_QUERY_LOG=$SLOW_LOG_OPT;" -+ -+# reset master for 5.6 to clear GTID_EXECUTED -+RESET_MASTER="RESET MASTER;" -+ -+ -+if [ $WSREP_SST_OPT_BYPASS -eq 0 ] -+then -+ # commented out from dump command for 5.6: && echo $CSV_TABLES_FIX \ -+ # error is ignored because joiner binlog might be disabled. -+ # and if joiner binlog is disabled, 'RESET MASTER' returns error -+ # ERROR 1186 (HY000) at line 2: Binlog closed, cannot RESET MASTER -+ (echo $STOP_WSREP && echo $RESET_MASTER) | $MYSQL || true -+ (echo $STOP_WSREP && $MYSQLDUMP \ -+ && echo $RESTORE_GENERAL_LOG && echo $RESTORE_SLOW_QUERY_LOG \ -+ && echo $SET_START_POSITION \ -+ || echo "SST failed to complete;") | $MYSQL -+else -+ wsrep_log_info "Bypassing state dump." -+ echo $SET_START_POSITION | $MYSQL -+fi -+ -+# -diff --git a/scripts/wsrep_sst_rsync.sh b/scripts/wsrep_sst_rsync.sh -new file mode 100644 -index 0000000..8998f73 ---- /dev/null -+++ b/scripts/wsrep_sst_rsync.sh -@@ -0,0 +1,329 @@ -+#!/bin/bash -ue -+ -+# Copyright (C) 2010-2014 Codership Oy -+# -+# 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; see the file COPYING. If not, write to the -+# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston -+# MA 02110-1301 USA. -+ -+# This is a reference script for rsync-based state snapshot tansfer -+ -+RSYNC_PID= -+RSYNC_CONF= -+OS=$(uname) -+[ "$OS" == "Darwin" ] && export -n LD_LIBRARY_PATH -+ -+# Setting the path for lsof on CentOS -+export PATH="/usr/sbin:/sbin:$PATH" -+ -+. $(dirname $0)/wsrep_sst_common -+ -+wsrep_check_programs rsync -+ -+cleanup_joiner() -+{ -+ wsrep_log_info "Joiner cleanup." -+ local PID=$(cat "$RSYNC_PID" 2>/dev/null || echo 0) -+ [ "0" != "$PID" ] && kill $PID && sleep 0.5 && kill -9 $PID >/dev/null 2>&1 \ -+ || : -+ rm -rf "$RSYNC_CONF" -+ rm -rf "$MAGIC_FILE" -+ rm -rf "$RSYNC_PID" -+ wsrep_log_info "Joiner cleanup done." -+ if [ "${WSREP_SST_OPT_ROLE}" = "joiner" ];then -+ wsrep_cleanup_progress_file -+ fi -+} -+ -+check_pid() -+{ -+ local pid_file=$1 -+ [ -r "$pid_file" ] && ps -p $(cat $pid_file) >/dev/null 2>&1 -+} -+ -+check_pid_and_port() -+{ -+ local pid_file=$1 -+ local rsync_pid=$2 -+ local rsync_port=$3 -+ -+ local port_info=$(lsof -i :$rsync_port -Pn 2>/dev/null | \ -+ grep "(LISTEN)") -+ local is_rsync=$(echo $port_info | \ -+ grep -w '^rsync[[:space:]]\+'"$rsync_pid" 2>/dev/null) -+ -+ if [ -n "$port_info" -a -z "$is_rsync" ]; then -+ wsrep_log_error "rsync daemon port '$rsync_port' has been taken" -+ exit 16 # EBUSY -+ fi -+ check_pid $pid_file && \ -+ [ -n "$port_info" ] && [ -n "$is_rsync" ] && \ -+ [ $(cat $pid_file) -eq $rsync_pid ] -+} -+ -+MAGIC_FILE="$WSREP_SST_OPT_DATA/rsync_sst_complete" -+rm -rf "$MAGIC_FILE" -+ -+BINLOG_TAR_FILE="$WSREP_SST_OPT_DATA/wsrep_sst_binlog.tar" -+BINLOG_N_FILES=1 -+rm -f "$BINLOG_TAR_FILE" || : -+ -+if ! [ -z $WSREP_SST_OPT_BINLOG ] -+then -+ BINLOG_DIRNAME=$(dirname $WSREP_SST_OPT_BINLOG) -+ BINLOG_FILENAME=$(basename $WSREP_SST_OPT_BINLOG) -+fi -+ -+WSREP_LOG_DIR=${WSREP_LOG_DIR:-""} -+# if WSREP_LOG_DIR env. variable is not set, try to get it from my.cnf -+if [ -z "$WSREP_LOG_DIR" ]; then -+ WSREP_LOG_DIR=$($MY_PRINT_DEFAULTS --defaults-file \ -+ "$WSREP_SST_OPT_CONF" mysqld server mysqld-5.6 \ -+ | grep -- '--innodb[-_]log[-_]group[-_]home[-_]dir=' \ -+ | cut -b 29- ) -+fi -+ -+if [ -n "$WSREP_LOG_DIR" ]; then -+ # handle both relative and absolute paths -+ WSREP_LOG_DIR=$(cd $WSREP_SST_OPT_DATA; mkdir -p "$WSREP_LOG_DIR"; cd $WSREP_LOG_DIR; pwd -P) -+else -+ # default to datadir -+ WSREP_LOG_DIR=$(cd $WSREP_SST_OPT_DATA; pwd -P) -+fi -+ -+# Old filter - include everything except selected -+# FILTER=(--exclude '*.err' --exclude '*.pid' --exclude '*.sock' \ -+# --exclude '*.conf' --exclude core --exclude 'galera.*' \ -+# --exclude grastate.txt --exclude '*.pem' \ -+# --exclude '*.[0-9][0-9][0-9][0-9][0-9][0-9]' --exclude '*.index') -+ -+# New filter - exclude everything except dirs (schemas) and innodb files -+FILTER=(-f '- /lost+found' -f '- /.fseventsd' -f '- /.Trashes' -+ -f '+ /wsrep_sst_binlog.tar' -f '+ /ib_lru_dump' -f '+ /ibdata*' -f '+ /*/' -f '- /*') -+ -+if [ "$WSREP_SST_OPT_ROLE" = "donor" ] -+then -+ -+ if [ $WSREP_SST_OPT_BYPASS -eq 0 ] -+ then -+ -+ FLUSHED="$WSREP_SST_OPT_DATA/tables_flushed" -+ rm -rf "$FLUSHED" -+ -+ # Use deltaxfer only for WAN -+ inv=$(basename $0) -+ [ "$inv" = "wsrep_sst_rsync_wan" ] && WHOLE_FILE_OPT="" \ -+ || WHOLE_FILE_OPT="--whole-file" -+ -+ echo "flush tables" -+ -+ # wait for tables flushed and state ID written to the file -+ while [ ! -r "$FLUSHED" ] && ! grep -q ':' "$FLUSHED" >/dev/null 2>&1 -+ do -+ sleep 0.2 -+ done -+ -+ STATE="$(cat $FLUSHED)" -+ rm -rf "$FLUSHED" -+ -+ sync -+ -+ if ! [ -z $WSREP_SST_OPT_BINLOG ] -+ then -+ # Prepare binlog files -+ pushd $BINLOG_DIRNAME &> /dev/null -+ binlog_files_full=$(tail -n $BINLOG_N_FILES ${BINLOG_FILENAME}.index) -+ binlog_files="" -+ for ii in $binlog_files_full -+ do -+ binlog_files="$binlog_files $(basename $ii)" -+ done -+ if ! [ -z "$binlog_files" ] -+ then -+ wsrep_log_info "Preparing binlog files for transfer:" -+ tar -cvf $BINLOG_TAR_FILE $binlog_files >&2 -+ fi -+ popd &> /dev/null -+ fi -+ -+ # first, the normal directories, so that we can detect incompatible protocol -+ RC=0 -+ rsync --owner --group --perms --links --specials \ -+ --ignore-times --inplace --dirs --delete --quiet \ -+ $WHOLE_FILE_OPT "${FILTER[@]}" "$WSREP_SST_OPT_DATA/" \ -+ rsync://$WSREP_SST_OPT_ADDR >&2 || RC=$? -+ -+ if [ "$RC" -ne 0 ]; then -+ wsrep_log_error "rsync returned code $RC:" -+ -+ case $RC in -+ 12) RC=71 # EPROTO -+ wsrep_log_error \ -+ "rsync server on the other end has incompatible protocol. " \ -+ "Make sure you have the same version of rsync on all nodes." -+ ;; -+ 22) RC=12 # ENOMEM -+ ;; -+ *) RC=255 # unknown error -+ ;; -+ esac -+ exit $RC -+ fi -+ -+ # second, we transfer InnoDB log files -+ rsync --owner --group --perms --links --specials \ -+ --ignore-times --inplace --dirs --delete --quiet \ -+ $WHOLE_FILE_OPT -f '+ /ib_logfile[0-9]*' -f '- **' "$WSREP_LOG_DIR/" \ -+ rsync://$WSREP_SST_OPT_ADDR-log_dir >&2 || RC=$? -+ -+ if [ $RC -ne 0 ]; then -+ wsrep_log_error "rsync innodb_log_group_home_dir returned code $RC:" -+ exit 255 # unknown error -+ fi -+ -+ # then, we parallelize the transfer of database directories, use . so that pathconcatenation works -+ pushd "$WSREP_SST_OPT_DATA" >/dev/null -+ -+ count=1 -+ [ "$OS" == "Linux" ] && count=$(grep -c processor /proc/cpuinfo) -+ [ "$OS" == "Darwin" -o "$OS" == "FreeBSD" ] && count=$(sysctl -n hw.ncpu) -+ -+ find . -maxdepth 1 -mindepth 1 -type d -print0 | xargs -I{} -0 -P $count \ -+ rsync --owner --group --perms --links --specials \ -+ --ignore-times --inplace --recursive --delete --quiet \ -+ $WHOLE_FILE_OPT --exclude '*/ib_logfile*' "$WSREP_SST_OPT_DATA"/{}/ \ -+ rsync://$WSREP_SST_OPT_ADDR/{} >&2 || RC=$? -+ -+ popd >/dev/null -+ -+ if [ $RC -ne 0 ]; then -+ wsrep_log_error "find/rsync returned code $RC:" -+ exit 255 # unknown error -+ fi -+ -+ else # BYPASS -+ wsrep_log_info "Bypassing state dump." -+ STATE="$WSREP_SST_OPT_GTID" -+ fi -+ -+ echo "continue" # now server can resume updating data -+ -+ echo "$STATE" > "$MAGIC_FILE" -+ rsync --archive --quiet --checksum "$MAGIC_FILE" rsync://$WSREP_SST_OPT_ADDR -+ -+ echo "done $STATE" -+ -+elif [ "$WSREP_SST_OPT_ROLE" = "joiner" ] -+then -+ wsrep_check_programs lsof -+ -+ touch $SST_PROGRESS_FILE -+ MYSQLD_PID=$WSREP_SST_OPT_PARENT -+ -+ MODULE="rsync_sst" -+ -+ RSYNC_PID="$WSREP_SST_OPT_DATA/$MODULE.pid" -+ -+ if check_pid $RSYNC_PID -+ then -+ wsrep_log_error "rsync daemon already running." -+ exit 114 # EALREADY -+ fi -+ rm -rf "$RSYNC_PID" -+ -+ ADDR=$WSREP_SST_OPT_ADDR -+ RSYNC_PORT=$(echo $ADDR | awk -F ':' '{ print $2 }') -+ if [ -z "$RSYNC_PORT" ] -+ then -+ RSYNC_PORT=4444 -+ ADDR="$(echo $ADDR | awk -F ':' '{ print $1 }'):$RSYNC_PORT" -+ fi -+ -+ trap "exit 32" HUP PIPE -+ trap "exit 3" INT TERM ABRT -+ trap cleanup_joiner EXIT -+ -+ RSYNC_CONF="$WSREP_SST_OPT_DATA/$MODULE.conf" -+ -+cat << EOF > "$RSYNC_CONF" -+pid file = $RSYNC_PID -+use chroot = no -+read only = no -+timeout = 300 -+[$MODULE] -+ path = $WSREP_SST_OPT_DATA -+[$MODULE-log_dir] -+ path = $WSREP_LOG_DIR -+EOF -+ -+# rm -rf "$DATA"/ib_logfile* # we don't want old logs around -+ -+ # listen at all interfaces (for firewalled setups) -+ rsync --daemon --no-detach --port $RSYNC_PORT --config "$RSYNC_CONF" & -+ RSYNC_REAL_PID=$! -+ -+ until check_pid_and_port $RSYNC_PID $RSYNC_REAL_PID $RSYNC_PORT -+ do -+ sleep 0.2 -+ done -+ -+ echo "ready $ADDR/$MODULE" -+ -+ # wait for SST to complete by monitoring magic file -+ while [ ! -r "$MAGIC_FILE" ] && check_pid "$RSYNC_PID" && \ -+ ps -p $MYSQLD_PID >/dev/null -+ do -+ sleep 1 -+ done -+ -+ if ! ps -p $MYSQLD_PID >/dev/null -+ then -+ wsrep_log_error \ -+ "Parent mysqld process (PID:$MYSQLD_PID) terminated unexpectedly." -+ exit 32 -+ fi -+ -+ if ! [ -z $WSREP_SST_OPT_BINLOG ] -+ then -+ -+ pushd $BINLOG_DIRNAME &> /dev/null -+ if [ -f $BINLOG_TAR_FILE ] -+ then -+ # Clean up old binlog files first -+ rm -f ${BINLOG_FILENAME}.* -+ wsrep_log_info "Extracting binlog files:" -+ tar -xvf $BINLOG_TAR_FILE >&2 -+ for ii in $(ls -1 ${BINLOG_FILENAME}.*) -+ do -+ echo ${BINLOG_DIRNAME}/${ii} >> ${BINLOG_FILENAME}.index -+ done -+ fi -+ popd &> /dev/null -+ fi -+ if [ -r "$MAGIC_FILE" ] -+ then -+ cat "$MAGIC_FILE" # output UUID:seqno -+ else -+ # this message should cause joiner to abort -+ echo "rsync process ended without creating '$MAGIC_FILE'" -+ fi -+ wsrep_cleanup_progress_file -+# cleanup_joiner -+else -+ wsrep_log_error "Unrecognized role: '$WSREP_SST_OPT_ROLE'" -+ exit 22 # EINVAL -+fi -+ -+rm -f $BINLOG_TAR_FILE || : -+ -+exit 0 -diff --git a/scripts/wsrep_sst_xtrabackup-v2.sh b/scripts/wsrep_sst_xtrabackup-v2.sh -new file mode 100644 -index 0000000..1d1267d ---- /dev/null -+++ b/scripts/wsrep_sst_xtrabackup-v2.sh -@@ -0,0 +1,930 @@ -+#!/bin/bash -ue -+# Copyright (C) 2013 Percona 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; see the file COPYING. If not, write to the -+# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston -+# MA 02110-1301 USA. -+ -+# Documentation: http://www.percona.com/doc/percona-xtradb-cluster/manual/xtrabackup_sst.html -+# Make sure to read that before proceeding! -+ -+ -+ -+ -+. $(dirname $0)/wsrep_sst_common -+ -+ealgo="" -+ekey="" -+ekeyfile="" -+encrypt=0 -+nproc=1 -+ecode=0 -+XTRABACKUP_PID="" -+SST_PORT="" -+REMOTEIP="" -+tcert="" -+tpem="" -+tkey="" -+sockopt="" -+progress="" -+ttime=0 -+totime=0 -+lsn="" -+incremental=0 -+ecmd="" -+rlimit="" -+# Initially -+stagemsg="${WSREP_SST_OPT_ROLE}" -+cpat="" -+speciald=0 -+ib_home_dir="" -+ib_log_dir="" -+ -+sfmt="tar" -+strmcmd="" -+tfmt="" -+tcmd="" -+rebuild=0 -+rebuildcmd="" -+payload=0 -+pvformat="-F '%N => Rate:%r Avg:%a Elapsed:%t %e Bytes: %b %p' " -+pvopts="-f -i 10 -N $WSREP_SST_OPT_ROLE " -+STATDIR="" -+uextra=0 -+disver="" -+ -+tmpopts="" -+itmpdir="" -+xtmpdir="" -+ -+scomp="" -+sdecomp="" -+ -+if which pv &>/dev/null && pv --help | grep -q FORMAT;then -+ pvopts+=$pvformat -+fi -+pcmd="pv $pvopts" -+declare -a RC -+ -+INNOBACKUPEX_BIN=innobackupex -+readonly AUTH=(${WSREP_SST_OPT_AUTH//:/ }) -+DATA="${WSREP_SST_OPT_DATA}" -+INFO_FILE="xtrabackup_galera_info" -+IST_FILE="xtrabackup_ist" -+MAGIC_FILE="${DATA}/${INFO_FILE}" -+ -+# Setting the path for ss and ip -+export PATH="/usr/sbin:/sbin:$PATH" -+ -+timeit(){ -+ local stage=$1 -+ shift -+ local cmd="$@" -+ local x1 x2 took extcode -+ -+ if [[ $ttime -eq 1 ]];then -+ x1=$(date +%s) -+ wsrep_log_info "Evaluating $cmd" -+ eval "$cmd" -+ extcode=$? -+ x2=$(date +%s) -+ took=$(( x2-x1 )) -+ wsrep_log_info "NOTE: $stage took $took seconds" -+ totime=$(( totime+took )) -+ else -+ wsrep_log_info "Evaluating $cmd" -+ eval "$cmd" -+ extcode=$? -+ fi -+ return $extcode -+} -+ -+get_keys() -+{ -+ # $encrypt -eq 1 is for internal purposes only -+ if [[ $encrypt -ge 2 || $encrypt -eq -1 ]];then -+ return -+ fi -+ -+ if [[ $encrypt -eq 0 ]];then -+ if $MY_PRINT_DEFAULTS -c $WSREP_SST_OPT_CONF xtrabackup | grep -q encrypt;then -+ wsrep_log_error "Unexpected option combination. SST may fail. Refer to http://www.percona.com/doc/percona-xtradb-cluster/manual/xtrabackup_sst.html " -+ fi -+ return -+ fi -+ -+ if [[ $sfmt == 'tar' ]];then -+ wsrep_log_info "NOTE: Xtrabackup-based encryption - encrypt=1 - cannot be enabled with tar format" -+ encrypt=-1 -+ return -+ fi -+ -+ wsrep_log_info "Xtrabackup based encryption enabled in my.cnf - Supported only from Xtrabackup 2.1.4" -+ -+ if [[ -z $ealgo ]];then -+ wsrep_log_error "FATAL: Encryption algorithm empty from my.cnf, bailing out" -+ exit 3 -+ fi -+ -+ if [[ -z $ekey && ! -r $ekeyfile ]];then -+ wsrep_log_error "FATAL: Either key or keyfile must be readable" -+ exit 3 -+ fi -+ -+ if [[ -z $ekey ]];then -+ ecmd="xbcrypt --encrypt-algo=$ealgo --encrypt-key-file=$ekeyfile" -+ else -+ ecmd="xbcrypt --encrypt-algo=$ealgo --encrypt-key=$ekey" -+ fi -+ -+ if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then -+ ecmd+=" -d" -+ fi -+ -+ stagemsg+="-XB-Encrypted" -+} -+ -+get_transfer() -+{ -+ if [[ -z $SST_PORT ]];then -+ TSST_PORT=4444 -+ else -+ TSST_PORT=$SST_PORT -+ fi -+ -+ if [[ $tfmt == 'nc' ]];then -+ if [[ ! -x `which nc` ]];then -+ wsrep_log_error "nc(netcat) not found in path: $PATH" -+ exit 2 -+ fi -+ wsrep_log_info "Using netcat as streamer" -+ if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then -+ tcmd="nc -dl ${TSST_PORT}" -+ else -+ tcmd="nc ${REMOTEIP} ${TSST_PORT}" -+ fi -+ else -+ tfmt='socat' -+ wsrep_log_info "Using socat as streamer" -+ if [[ ! -x `which socat` ]];then -+ wsrep_log_error "socat not found in path: $PATH" -+ exit 2 -+ fi -+ -+ if [[ $encrypt -eq 2 || $encrypt -eq 3 ]] && ! socat -V | grep -q WITH_OPENSSL;then -+ wsrep_log_info "NOTE: socat is not openssl enabled, falling back to plain transfer" -+ encrypt=-1 -+ fi -+ -+ if [[ $encrypt -eq 2 ]];then -+ wsrep_log_info "Using openssl based encryption with socat: with crt and pem" -+ if [[ -z $tpem || -z $tcert ]];then -+ wsrep_log_error "Both PEM and CRT files required" -+ exit 22 -+ fi -+ stagemsg+="-OpenSSL-Encrypted-2" -+ if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then -+ wsrep_log_info "Decrypting with PEM $tpem, CA: $tcert" -+ tcmd="socat -u openssl-listen:${TSST_PORT},reuseaddr,cert=$tpem,cafile=${tcert}${sockopt} stdio" -+ else -+ wsrep_log_info "Encrypting with PEM $tpem, CA: $tcert" -+ tcmd="socat -u stdio openssl-connect:${REMOTEIP}:${TSST_PORT},cert=$tpem,cafile=${tcert}${sockopt}" -+ fi -+ elif [[ $encrypt -eq 3 ]];then -+ wsrep_log_info "Using openssl based encryption with socat: with key and crt" -+ if [[ -z $tpem || -z $tkey ]];then -+ wsrep_log_error "Both certificate and key files required" -+ exit 22 -+ fi -+ stagemsg+="-OpenSSL-Encrypted-3" -+ if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then -+ wsrep_log_info "Decrypting with certificate $tpem, key $tkey" -+ tcmd="socat -u openssl-listen:${TSST_PORT},reuseaddr,cert=$tpem,key=${tkey},verify=0${sockopt} stdio" -+ else -+ wsrep_log_info "Encrypting with certificate $tpem, key $tkey" -+ tcmd="socat -u stdio openssl-connect:${REMOTEIP}:${TSST_PORT},cert=$tpem,key=${tkey},verify=0${sockopt}" -+ fi -+ -+ else -+ if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then -+ tcmd="socat -u TCP-LISTEN:${TSST_PORT},reuseaddr${sockopt} stdio" -+ else -+ tcmd="socat -u stdio TCP:${REMOTEIP}:${TSST_PORT}${sockopt}" -+ fi -+ fi -+ fi -+ -+} -+ -+parse_cnf() -+{ -+ local group=$1 -+ local var=$2 -+ reval=$($MY_PRINT_DEFAULTS -c $WSREP_SST_OPT_CONF $group | awk -F= '{if ($1 ~ /_/) { gsub(/_/,"-",$1); print $1"="$2 } else { print $0 }}' | grep -- "--$var=" | cut -d= -f2-) -+ if [[ -z $reval ]];then -+ [[ -n $3 ]] && reval=$3 -+ fi -+ echo $reval -+} -+ -+get_footprint() -+{ -+ pushd $WSREP_SST_OPT_DATA 1>/dev/null -+ payload=$(find . -regex '.*\.ibd$\|.*\.MYI$\|.*\.MYD$\|.*ibdata1$' -type f -print0 | xargs -0 du --block-size=1 -c | awk 'END { print $1 }') -+ if $MY_PRINT_DEFAULTS -c $WSREP_SST_OPT_CONF xtrabackup | grep -q -- "--compress";then -+ # QuickLZ has around 50% compression ratio -+ # When compression/compaction used, the progress is only an approximate. -+ payload=$(( payload*1/2 )) -+ fi -+ popd 1>/dev/null -+ pcmd+=" -s $payload" -+ adjust_progress -+} -+ -+adjust_progress() -+{ -+ if [[ -n $progress && $progress != '1' ]];then -+ if [[ -e $progress ]];then -+ pcmd+=" 2>>$progress" -+ else -+ pcmd+=" 2>$progress" -+ fi -+ elif [[ -z $progress && -n $rlimit ]];then -+ # When rlimit is non-zero -+ pcmd="pv -q" -+ fi -+ -+ if [[ -n $rlimit && "$WSREP_SST_OPT_ROLE" == "donor" ]];then -+ wsrep_log_info "Rate-limiting SST to $rlimit" -+ pcmd+=" -L \$rlimit" -+ fi -+} -+ -+read_cnf() -+{ -+ sfmt=$(parse_cnf sst streamfmt "xbstream") -+ tfmt=$(parse_cnf sst transferfmt "socat") -+ tcert=$(parse_cnf sst tca "") -+ tpem=$(parse_cnf sst tcert "") -+ tkey=$(parse_cnf sst tkey "") -+ encrypt=$(parse_cnf sst encrypt 0) -+ sockopt=$(parse_cnf sst sockopt "") -+ progress=$(parse_cnf sst progress "") -+ rebuild=$(parse_cnf sst rebuild 0) -+ ttime=$(parse_cnf sst time 0) -+ cpat=$(parse_cnf sst cpat '.*galera\.cache$\|.*sst_in_progress$\|.*grastate\.dat$\|.*gvwstate\.dat$\|.*\.err$\|.*\.log$\|.*RPM_UPGRADE_MARKER$\|.*RPM_UPGRADE_HISTORY$') -+ incremental=$(parse_cnf sst incremental 0) -+ ealgo=$(parse_cnf xtrabackup encrypt "") -+ ekey=$(parse_cnf xtrabackup encrypt-key "") -+ ekeyfile=$(parse_cnf xtrabackup encrypt-key-file "") -+ scomp=$(parse_cnf sst compressor "") -+ sdecomp=$(parse_cnf sst decompressor "") -+ -+ -+ # Refer to http://www.percona.com/doc/percona-xtradb-cluster/manual/xtrabackup_sst.html -+ if [[ -z $ealgo ]];then -+ ealgo=$(parse_cnf sst encrypt-algo "") -+ ekey=$(parse_cnf sst encrypt-key "") -+ ekeyfile=$(parse_cnf sst encrypt-key-file "") -+ fi -+ rlimit=$(parse_cnf sst rlimit "") -+ uextra=$(parse_cnf sst use-extra 0) -+ speciald=$(parse_cnf sst sst-special-dirs 1) -+ iopts=$(parse_cnf sst inno-backup-opts "") -+ iapts=$(parse_cnf sst inno-apply-opts "") -+ impts=$(parse_cnf sst inno-move-opts "") -+ stimeout=$(parse_cnf sst sst-initial-timeout 100) -+} -+ -+get_stream() -+{ -+ if [[ $sfmt == 'xbstream' ]];then -+ wsrep_log_info "Streaming with xbstream" -+ if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then -+ strmcmd="xbstream -x" -+ else -+ strmcmd="xbstream -c \${INFO_FILE}" -+ fi -+ else -+ sfmt="tar" -+ wsrep_log_info "Streaming with tar" -+ if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then -+ strmcmd="tar xfi - " -+ else -+ strmcmd="tar cf - \${INFO_FILE} " -+ fi -+ -+ fi -+} -+ -+get_proc() -+{ -+ set +e -+ nproc=$(grep -c processor /proc/cpuinfo) -+ [[ -z $nproc || $nproc -eq 0 ]] && nproc=1 -+ set -e -+} -+ -+sig_joiner_cleanup() -+{ -+ wsrep_log_error "Removing $MAGIC_FILE file due to signal" -+ rm -f "$MAGIC_FILE" -+} -+ -+cleanup_joiner() -+{ -+ # Since this is invoked just after exit NNN -+ local estatus=$? -+ if [[ $estatus -ne 0 ]];then -+ wsrep_log_error "Cleanup after exit with status:$estatus" -+ fi -+ if [ "${WSREP_SST_OPT_ROLE}" = "joiner" ];then -+ wsrep_log_info "Removing the sst_in_progress file" -+ wsrep_cleanup_progress_file -+ fi -+ if [[ -n $progress && -p $progress ]];then -+ wsrep_log_info "Cleaning up fifo file $progress" -+ rm $progress -+ fi -+ if [[ -n ${STATDIR:-} ]];then -+ [[ -d $STATDIR ]] && rm -rf $STATDIR -+ fi -+} -+ -+check_pid() -+{ -+ local pid_file="$1" -+ [ -r "$pid_file" ] && ps -p $(cat "$pid_file") >/dev/null 2>&1 -+} -+ -+cleanup_donor() -+{ -+ # Since this is invoked just after exit NNN -+ local estatus=$? -+ if [[ $estatus -ne 0 ]];then -+ wsrep_log_error "Cleanup after exit with status:$estatus" -+ fi -+ -+ if [[ -n ${XTRABACKUP_PID:-} ]];then -+ if check_pid $XTRABACKUP_PID -+ then -+ wsrep_log_error "xtrabackup process is still running. Killing... " -+ kill_xtrabackup -+ fi -+ -+ fi -+ rm -f ${DATA}/${IST_FILE} || true -+ -+ if [[ -n $progress && -p $progress ]];then -+ wsrep_log_info "Cleaning up fifo file $progress" -+ rm -f $progress || true -+ fi -+ -+ wsrep_log_info "Cleaning up temporary directories" -+ -+ if [[ -n $xtmpdir ]];then -+ [[ -d $xtmpdir ]] && rm -rf $xtmpdir || true -+ fi -+ -+ if [[ -n $itmpdir ]];then -+ [[ -d $itmpdir ]] && rm -rf $itmpdir || true -+ fi -+} -+ -+kill_xtrabackup() -+{ -+ local PID=$(cat $XTRABACKUP_PID) -+ [ -n "$PID" -a "0" != "$PID" ] && kill $PID && (kill $PID && kill -9 $PID) || : -+ wsrep_log_info "Removing xtrabackup pid file $XTRABACKUP_PID" -+ rm -f "$XTRABACKUP_PID" || true -+} -+ -+setup_ports() -+{ -+ if [[ "$WSREP_SST_OPT_ROLE" == "donor" ]];then -+ SST_PORT=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $2 }') -+ REMOTEIP=$(echo $WSREP_SST_OPT_ADDR | awk -F ':' '{ print $1 }') -+ lsn=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $4 }') -+ else -+ SST_PORT=$(echo ${WSREP_SST_OPT_ADDR} | awk -F ':' '{ print $2 }') -+ fi -+} -+ -+# waits ~10 seconds for nc to open the port and then reports ready -+# (regardless of timeout) -+wait_for_listen() -+{ -+ local PORT=$1 -+ local ADDR=$2 -+ local MODULE=$3 -+ for i in {1..50} -+ do -+ ss -p state listening "( sport = :$PORT )" | grep -qE 'socat|nc' && break -+ sleep 0.2 -+ done -+ if [[ $incremental -eq 1 ]];then -+ echo "ready ${ADDR}/${MODULE}/$lsn" -+ else -+ echo "ready ${ADDR}/${MODULE}" -+ fi -+} -+ -+check_extra() -+{ -+ local use_socket=1 -+ if [[ $uextra -eq 1 ]];then -+ if $MY_PRINT_DEFAULTS -c $WSREP_SST_OPT_CONF mysqld | tr '_' '-' | grep -- "--thread-handling=" | grep -q 'pool-of-threads';then -+ local eport=$($MY_PRINT_DEFAULTS -c $WSREP_SST_OPT_CONF mysqld | tr '_' '-' | grep -- "--extra-port=" | cut -d= -f2) -+ if [[ -n $eport ]];then -+ # Xtrabackup works only locally. -+ # Hence, setting host to 127.0.0.1 unconditionally. -+ wsrep_log_info "SST through extra_port $eport" -+ INNOEXTRA+=" --host=127.0.0.1 --port=$eport " -+ use_socket=0 -+ else -+ wsrep_log_error "Extra port $eport null, failing" -+ exit 1 -+ fi -+ else -+ wsrep_log_info "Thread pool not set, ignore the option use_extra" -+ fi -+ fi -+ if [[ $use_socket -eq 1 ]] && [[ -n "${WSREP_SST_OPT_SOCKET}" ]];then -+ INNOEXTRA+=" --socket=${WSREP_SST_OPT_SOCKET}" -+ fi -+} -+ -+recv_joiner() -+{ -+ local dir=$1 -+ local msg=$2 -+ local tmt=$3 -+ local ltcmd -+ -+ pushd ${dir} 1>/dev/null -+ set +e -+ -+ if [[ $tmt -gt 0 && -x `which timeout` ]];then -+ if timeout --help | grep -q -- '-k';then -+ ltcmd="timeout -k $(( tmt+10 )) $tmt $tcmd" -+ else -+ ltcmd="timeout $tmt $tcmd" -+ fi -+ timeit "$msg" "$ltcmd | $strmcmd; RC=( "\${PIPESTATUS[@]}" )" -+ else -+ timeit "$msg" "$tcmd | $strmcmd; RC=( "\${PIPESTATUS[@]}" )" -+ fi -+ -+ set -e -+ popd 1>/dev/null -+ -+ if [[ ${RC[0]} -eq 124 ]];then -+ wsrep_log_error "Possible timeout in receving first data from donor in gtid stage" -+ exit 32 -+ fi -+ -+ for ecode in "${RC[@]}";do -+ if [[ $ecode -ne 0 ]];then -+ wsrep_log_error "Error while getting data from donor node: " \ -+ "exit codes: ${RC[@]}" -+ exit 32 -+ fi -+ done -+ -+ if [ ! -r "${MAGIC_FILE}" ];then -+ # this message should cause joiner to abort -+ wsrep_log_error "xtrabackup process ended without creating '${MAGIC_FILE}'" -+ wsrep_log_info "Contents of datadir" -+ wsrep_log_info "$(ls -l ${dir}/*)" -+ exit 32 -+ fi -+} -+ -+ -+send_donor() -+{ -+ local dir=$1 -+ local msg=$2 -+ -+ pushd ${dir} 1>/dev/null -+ set +e -+ timeit "$msg" "$strmcmd | $tcmd; RC=( "\${PIPESTATUS[@]}" )" -+ set -e -+ popd 1>/dev/null -+ -+ -+ for ecode in "${RC[@]}";do -+ if [[ $ecode -ne 0 ]];then -+ wsrep_log_error "Error while getting data from donor node: " \ -+ "exit codes: ${RC[@]}" -+ exit 32 -+ fi -+ done -+ -+} -+ -+if [[ ! -x `which $INNOBACKUPEX_BIN` ]];then -+ wsrep_log_error "innobackupex not in path: $PATH" -+ exit 2 -+fi -+ -+rm -f "${MAGIC_FILE}" -+ -+if [[ ! ${WSREP_SST_OPT_ROLE} == 'joiner' && ! ${WSREP_SST_OPT_ROLE} == 'donor' ]];then -+ wsrep_log_error "Invalid role ${WSREP_SST_OPT_ROLE}" -+ exit 22 -+fi -+ -+read_cnf -+setup_ports -+get_stream -+get_transfer -+ -+if ${INNOBACKUPEX_BIN} /tmp --help | grep -q -- '--version-check'; then -+ disver="--no-version-check" -+fi -+ -+ -+INNOEXTRA="" -+INNOAPPLY="${INNOBACKUPEX_BIN} $disver $iapts --apply-log \$rebuildcmd \${DATA} &>\${DATA}/innobackup.prepare.log" -+INNOMOVE="${INNOBACKUPEX_BIN} --defaults-file=${WSREP_SST_OPT_CONF} --defaults-group=mysqld${WSREP_SST_OPT_CONF_SUFFIX} $disver $impts --move-back --force-non-empty-directories \${DATA} &>\${DATA}/innobackup.move.log" -+INNOBACKUP="${INNOBACKUPEX_BIN} --defaults-file=${WSREP_SST_OPT_CONF} --defaults-group=mysqld${WSREP_SST_OPT_CONF_SUFFIX} $disver $iopts \$tmpopts \$INNOEXTRA --galera-info --stream=\$sfmt \$itmpdir 2>\${DATA}/innobackup.backup.log" -+ -+if [ "$WSREP_SST_OPT_ROLE" = "donor" ] -+then -+ trap cleanup_donor EXIT -+ -+ if [ $WSREP_SST_OPT_BYPASS -eq 0 ] -+ then -+ -+ if [[ -z $(parse_cnf mysqld tmpdir "") && -z $(parse_cnf xtrabackup tmpdir "") ]];then -+ xtmpdir=$(mktemp -d) -+ tmpopts=" --tmpdir=$xtmpdir " -+ wsrep_log_info "Using $xtmpdir as xtrabackup temporary directory" -+ fi -+ -+ itmpdir=$(mktemp -d) -+ wsrep_log_info "Using $itmpdir as innobackupex temporary directory" -+ -+ if [ "${AUTH[0]}" != "(null)" ]; then -+ INNOEXTRA+=" --user=${AUTH[0]}" -+ fi -+ -+ if [ ${#AUTH[*]} -eq 2 ]; then -+ INNOEXTRA+=" --password=${AUTH[1]}" -+ elif [ "${AUTH[0]}" != "(null)" ]; then -+ # Empty password, used for testing, debugging etc. -+ INNOEXTRA+=" --password=" -+ fi -+ -+ get_keys -+ if [[ $encrypt -eq 1 ]];then -+ if [[ -n $ekey ]];then -+ INNOEXTRA+=" --encrypt=$ealgo --encrypt-key=$ekey " -+ else -+ INNOEXTRA+=" --encrypt=$ealgo --encrypt-key-file=$ekeyfile " -+ fi -+ fi -+ -+ if [[ -n $lsn ]];then -+ INNOEXTRA+=" --incremental --incremental-lsn=$lsn " -+ fi -+ -+ check_extra -+ -+ wsrep_log_info "Streaming GTID file before SST" -+ -+ echo "${WSREP_SST_OPT_GTID}" > "${MAGIC_FILE}" -+ -+ ttcmd="$tcmd" -+ -+ if [[ $encrypt -eq 1 ]];then -+ if [[ -n $scomp ]];then -+ tcmd=" $ecmd | $scomp | $tcmd " -+ else -+ tcmd=" $ecmd | $tcmd " -+ fi -+ elif [[ -n $scomp ]];then -+ tcmd=" $scomp | $tcmd " -+ fi -+ -+ -+ send_donor $DATA "${stagemsg}-gtid" -+ -+ tcmd="$ttcmd" -+ if [[ -n $progress ]];then -+ get_footprint -+ tcmd="$pcmd | $tcmd" -+ elif [[ -n $rlimit ]];then -+ adjust_progress -+ tcmd="$pcmd | $tcmd" -+ fi -+ -+ wsrep_log_info "Sleeping before data transfer for SST" -+ sleep 10 -+ -+ wsrep_log_info "Streaming the backup to joiner at ${REMOTEIP} ${SST_PORT:-4444}" -+ -+ if [[ -n $scomp ]];then -+ tcmd="$scomp | $tcmd" -+ fi -+ -+ set +e -+ timeit "${stagemsg}-SST" "$INNOBACKUP | $tcmd; RC=( "\${PIPESTATUS[@]}" )" -+ set -e -+ -+ if [ ${RC[0]} -ne 0 ]; then -+ wsrep_log_error "${INNOBACKUPEX_BIN} finished with error: ${RC[0]}. " \ -+ "Check ${DATA}/innobackup.backup.log" -+ exit 22 -+ elif [[ ${RC[$(( ${#RC[@]}-1 ))]} -eq 1 ]];then -+ wsrep_log_error "$tcmd finished with error: ${RC[1]}" -+ exit 22 -+ fi -+ -+ # innobackupex implicitly writes PID to fixed location in $xtmpdir -+ XTRABACKUP_PID="$xtmpdir/xtrabackup_pid" -+ -+ -+ else # BYPASS FOR IST -+ -+ wsrep_log_info "Bypassing the SST for IST" -+ echo "continue" # now server can resume updating data -+ echo "${WSREP_SST_OPT_GTID}" > "${MAGIC_FILE}" -+ echo "1" > "${DATA}/${IST_FILE}" -+ get_keys -+ if [[ $encrypt -eq 1 ]];then -+ if [[ -n $scomp ]];then -+ tcmd=" $ecmd | $scomp | $tcmd " -+ else -+ tcmd=" $ecmd | $tcmd " -+ fi -+ elif [[ -n $scomp ]];then -+ tcmd=" $scomp | $tcmd " -+ fi -+ strmcmd+=" \${IST_FILE}" -+ -+ send_donor $DATA "${stagemsg}-IST" -+ -+ fi -+ -+ echo "done ${WSREP_SST_OPT_GTID}" -+ wsrep_log_info "Total time on donor: $totime seconds" -+ -+elif [ "${WSREP_SST_OPT_ROLE}" = "joiner" ] -+then -+ [[ -e $SST_PROGRESS_FILE ]] && wsrep_log_info "Stale sst_in_progress file: $SST_PROGRESS_FILE" -+ [[ -n $SST_PROGRESS_FILE ]] && touch $SST_PROGRESS_FILE -+ -+ if [[ $speciald -eq 1 ]];then -+ ib_home_dir=$(parse_cnf mysqld innodb-data-home-dir "") -+ ib_log_dir=$(parse_cnf mysqld innodb-log-group-home-dir "") -+ if [[ -z $ib_home_dir && -z $ib_log_dir ]];then -+ speciald=0 -+ fi -+ fi -+ -+ stagemsg="Joiner-Recv" -+ -+ if [[ ! -e ${DATA}/ibdata1 ]];then -+ incremental=0 -+ fi -+ -+ if [[ $incremental -eq 1 ]];then -+ wsrep_log_info "Incremental SST enabled: NOT SUPPORTED yet" -+ lsn=$(grep to_lsn xtrabackup_checkpoints | cut -d= -f2 | tr -d ' ') -+ wsrep_log_info "Recovered LSN: $lsn" -+ fi -+ -+ sencrypted=1 -+ nthreads=1 -+ -+ MODULE="xtrabackup_sst" -+ -+ rm -f "${DATA}/${IST_FILE}" -+ -+ # May need xtrabackup_checkpoints later on -+ rm -f ${DATA}/xtrabackup_binary ${DATA}/xtrabackup_galera_info ${DATA}/xtrabackup_logfile -+ -+ ADDR=${WSREP_SST_OPT_ADDR} -+ if [ -z "${SST_PORT}" ] -+ then -+ SST_PORT=4444 -+ ADDR="$(echo ${WSREP_SST_OPT_ADDR} | awk -F ':' '{ print $1 }'):${SST_PORT}" -+ fi -+ -+ wait_for_listen ${SST_PORT} ${ADDR} ${MODULE} & -+ -+ trap sig_joiner_cleanup HUP PIPE INT TERM -+ trap cleanup_joiner EXIT -+ -+ if [[ -n $progress ]];then -+ adjust_progress -+ tcmd+=" | $pcmd" -+ fi -+ -+ if [[ $incremental -eq 1 ]];then -+ BDATA=$DATA -+ DATA=$(mktemp -d) -+ MAGIC_FILE="${DATA}/${INFO_FILE}" -+ fi -+ -+ get_keys -+ if [[ $encrypt -eq 1 && $sencrypted -eq 1 ]];then -+ if [[ -n $sdecomp ]];then -+ strmcmd=" $sdecomp | $ecmd | $strmcmd" -+ else -+ strmcmd=" $ecmd | $strmcmd" -+ fi -+ elif [[ -n $sdecomp ]];then -+ strmcmd=" $sdecomp | $strmcmd" -+ fi -+ -+ STATDIR=$(mktemp -d) -+ MAGIC_FILE="${STATDIR}/${INFO_FILE}" -+ recv_joiner $STATDIR "${stagemsg}-gtid" $stimeout -+ -+ if ! ps -p ${WSREP_SST_OPT_PARENT} &>/dev/null -+ then -+ wsrep_log_error "Parent mysqld process (PID:${WSREP_SST_OPT_PARENT}) terminated unexpectedly." -+ exit 32 -+ fi -+ -+ if [ ! -r "${STATDIR}/${IST_FILE}" ] -+ then -+ wsrep_log_info "Proceeding with SST" -+ -+ if [[ $speciald -eq 1 && -d ${DATA}/.sst ]];then -+ wsrep_log_info "WARNING: Stale temporary SST directory: ${DATA}/.sst from previous SST" -+ fi -+ -+ if [[ $incremental -ne 1 ]];then -+ if [[ $speciald -eq 1 ]];then -+ wsrep_log_info "Cleaning the existing datadir and innodb-data/log directories" -+ find $ib_home_dir $ib_log_dir $DATA -mindepth 1 -regex $cpat -prune -o -exec rm -rfv {} 1>&2 \+ -+ else -+ wsrep_log_info "Cleaning the existing datadir" -+ find $DATA -mindepth 1 -regex $cpat -prune -o -exec rm -rfv {} 1>&2 \+ -+ fi -+ tempdir=$(parse_cnf mysqld log-bin "") -+ if [[ -n ${tempdir:-} ]];then -+ binlog_dir=$(dirname $tempdir) -+ binlog_file=$(basename $tempdir) -+ if [[ -n ${binlog_dir:-} && $binlog_dir != '.' && $binlog_dir != $DATA ]];then -+ pattern="$binlog_dir/$binlog_file\.[0-9]+$" -+ wsrep_log_info "Cleaning the binlog directory $binlog_dir as well" -+ find $binlog_dir -maxdepth 1 -type f -regex $pattern -exec rm -fv {} 1>&2 \+ -+ rm $binlog_dir/*.index || true -+ fi -+ fi -+ -+ else -+ wsrep_log_info "Removing existing ib_logfile files" -+ rm -f ${BDATA}/ib_logfile* -+ fi -+ -+ -+ if [[ $speciald -eq 1 ]];then -+ mkdir -p ${DATA}/.sst -+ TDATA=${DATA} -+ DATA="${DATA}/.sst" -+ fi -+ -+ -+ MAGIC_FILE="${DATA}/${INFO_FILE}" -+ recv_joiner $DATA "${stagemsg}-SST" 0 -+ -+ get_proc -+ -+ # Rebuild indexes for compact backups -+ if grep -q 'compact = 1' ${DATA}/xtrabackup_checkpoints;then -+ wsrep_log_info "Index compaction detected" -+ rebuild=1 -+ fi -+ -+ if [[ $rebuild -eq 1 ]];then -+ nthreads=$(parse_cnf xtrabackup rebuild-threads $nproc) -+ wsrep_log_info "Rebuilding during prepare with $nthreads threads" -+ rebuildcmd="--rebuild-indexes --rebuild-threads=$nthreads" -+ fi -+ -+ if test -n "$(find ${DATA} -maxdepth 1 -type f -name '*.qp' -print -quit)";then -+ -+ wsrep_log_info "Compressed qpress files found" -+ -+ if [[ ! -x `which qpress` ]];then -+ wsrep_log_error "qpress not found in path: $PATH" -+ exit 22 -+ fi -+ -+ if [[ -n $progress ]] && pv --help | grep -q 'line-mode';then -+ count=$(find ${DATA} -type f -name '*.qp' | wc -l) -+ count=$(( count*2 )) -+ if pv --help | grep -q FORMAT;then -+ pvopts="-f -s $count -l -N Decompression -F '%N => Rate:%r Elapsed:%t %e Progress: [%b/$count]'" -+ else -+ pvopts="-f -s $count -l -N Decompression" -+ fi -+ pcmd="pv $pvopts" -+ adjust_progress -+ dcmd="$pcmd | xargs -n 2 qpress -T${nproc}d" -+ else -+ dcmd="xargs -n 2 qpress -T${nproc}d" -+ fi -+ -+ -+ # Decompress the qpress files -+ wsrep_log_info "Decompression with $nproc threads" -+ timeit "Joiner-Decompression" "find ${DATA} -type f -name '*.qp' -printf '%p\n%h\n' | $dcmd" -+ extcode=$? -+ -+ if [[ $extcode -eq 0 ]];then -+ wsrep_log_info "Removing qpress files after decompression" -+ find ${DATA} -type f -name '*.qp' -delete -+ if [[ $? -ne 0 ]];then -+ wsrep_log_error "Something went wrong with deletion of qpress files. Investigate" -+ fi -+ else -+ wsrep_log_error "Decompression failed. Exit code: $extcode" -+ exit 22 -+ fi -+ fi -+ -+ -+ if [[ ! -z $WSREP_SST_OPT_BINLOG ]];then -+ -+ BINLOG_DIRNAME=$(dirname $WSREP_SST_OPT_BINLOG) -+ BINLOG_FILENAME=$(basename $WSREP_SST_OPT_BINLOG) -+ -+ # To avoid comparing data directory and BINLOG_DIRNAME -+ mv $DATA/${BINLOG_FILENAME}.* $BINLOG_DIRNAME/ 2>/dev/null || true -+ -+ pushd $BINLOG_DIRNAME &>/dev/null -+ for bfiles in $(ls -1 ${BINLOG_FILENAME}.*);do -+ echo ${BINLOG_DIRNAME}/${bfiles} >> ${BINLOG_FILENAME}.index -+ done -+ popd &> /dev/null -+ -+ fi -+ -+ if [[ $incremental -eq 1 ]];then -+ # Added --ibbackup=xtrabackup_55 because it fails otherwise citing connection issues. -+ INNOAPPLY="${INNOBACKUPEX_BIN} $disver --defaults-file=${WSREP_SST_OPT_CONF} --defaults-group=mysqld${WSREP_SST_OPT_CONF_SUFFIX} \ -+ --ibbackup=xtrabackup_56 --apply-log $rebuildcmd --redo-only $BDATA --incremental-dir=${DATA} &>>${BDATA}/innobackup.prepare.log" -+ fi -+ -+ wsrep_log_info "Preparing the backup at ${DATA}" -+ timeit "Xtrabackup prepare stage" "$INNOAPPLY" -+ -+ if [ $? -ne 0 ]; -+ then -+ wsrep_log_error "${INNOBACKUPEX_BIN} apply finished with errors. Check ${DATA}/innobackup.prepare.log" -+ exit 22 -+ fi -+ -+ if [[ $speciald -eq 1 ]];then -+ MAGIC_FILE="${TDATA}/${INFO_FILE}" -+ set +e -+ rm $TDATA/innobackup.prepare.log $TDATA/innobackup.move.log -+ set -e -+ wsrep_log_info "Moving the backup to ${TDATA}" -+ timeit "Xtrabackup move stage" "$INNOMOVE" -+ if [[ $? -eq 0 ]];then -+ wsrep_log_info "Move successful, removing ${DATA}" -+ rm -rf $DATA -+ DATA=${TDATA} -+ else -+ wsrep_log_error "Move failed, keeping ${DATA} for further diagnosis" -+ wsrep_log_error "Check ${DATA}/innobackup.move.log for details" -+ fi -+ fi -+ -+ if [[ $incremental -eq 1 ]];then -+ wsrep_log_info "Cleaning up ${DATA} after incremental SST" -+ [[ -d ${DATA} ]] && rm -rf ${DATA} -+ DATA=$BDATA -+ fi -+ -+ else -+ wsrep_log_info "${IST_FILE} received from donor: Running IST" -+ fi -+ -+ if [[ ! -r ${MAGIC_FILE} ]];then -+ wsrep_log_error "SST magic file ${MAGIC_FILE} not found/readable" -+ exit 2 -+ fi -+ cat "${MAGIC_FILE}" # output UUID:seqno -+ wsrep_log_info "Total time on joiner: $totime seconds" -+fi -+ -+exit 0 -diff --git a/scripts/wsrep_sst_xtrabackup.sh b/scripts/wsrep_sst_xtrabackup.sh -new file mode 100644 -index 0000000..05dbcea ---- /dev/null -+++ b/scripts/wsrep_sst_xtrabackup.sh -@@ -0,0 +1,715 @@ -+#!/bin/bash -ue -+# Copyright (C) 2013 Percona 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; see the file COPYING. If not, write to the -+# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston -+# MA 02110-1301 USA. -+ -+# Optional dependencies and options documented here: http://www.percona.com/doc/percona-xtradb-cluster/manual/xtrabackup_sst.html -+# Make sure to read that before proceeding! -+ -+ -+ -+ -+. $(dirname $0)/wsrep_sst_common -+ -+ealgo="" -+ekey="" -+ekeyfile="" -+encrypt=0 -+nproc=1 -+ecode=0 -+XTRABACKUP_PID="" -+SST_PORT="" -+REMOTEIP="" -+tcert="" -+tpem="" -+sockopt="" -+progress="" -+ttime=0 -+totime=0 -+lsn="" -+incremental=0 -+ecmd="" -+rlimit="" -+ -+sfmt="tar" -+strmcmd="" -+tfmt="" -+tcmd="" -+rebuild=0 -+rebuildcmd="" -+payload=0 -+pvformat="-F '%N => Rate:%r Avg:%a Elapsed:%t %e Bytes: %b %p' " -+pvopts="-f -i 10 -N $WSREP_SST_OPT_ROLE " -+uextra=0 -+ -+if which pv &>/dev/null && pv --help | grep -q FORMAT;then -+ pvopts+=$pvformat -+fi -+pcmd="pv $pvopts" -+declare -a RC -+ -+INNOBACKUPEX_BIN=innobackupex -+readonly AUTH=(${WSREP_SST_OPT_AUTH//:/ }) -+DATA="${WSREP_SST_OPT_DATA}" -+INFO_FILE="xtrabackup_galera_info" -+IST_FILE="xtrabackup_ist" -+MAGIC_FILE="${DATA}/${INFO_FILE}" -+ -+# Setting the path for ss and ip -+export PATH="/usr/sbin:/sbin:$PATH" -+ -+timeit(){ -+ local stage=$1 -+ shift -+ local cmd="$@" -+ local x1 x2 took extcode -+ -+ if [[ $ttime -eq 1 ]];then -+ x1=$(date +%s) -+ wsrep_log_info "Evaluating $cmd" -+ eval "$cmd" -+ extcode=$? -+ x2=$(date +%s) -+ took=$(( x2-x1 )) -+ wsrep_log_info "NOTE: $stage took $took seconds" -+ totime=$(( totime+took )) -+ else -+ wsrep_log_info "Evaluating $cmd" -+ eval "$cmd" -+ extcode=$? -+ fi -+ return $extcode -+} -+ -+get_keys() -+{ -+ if [[ $encrypt -eq 2 ]];then -+ return -+ fi -+ -+ if [[ $encrypt -eq 0 ]];then -+ if $MY_PRINT_DEFAULTS -c $WSREP_SST_OPT_CONF xtrabackup | grep -q encrypt;then -+ wsrep_log_error "Unexpected option combination. SST may fail. Refer to http://www.percona.com/doc/percona-xtradb-cluster/manual/xtrabackup_sst.html " -+ fi -+ return -+ fi -+ -+ if [[ $sfmt == 'tar' ]];then -+ wsrep_log_info "NOTE: Xtrabackup-based encryption - encrypt=1 - cannot be enabled with tar format" -+ encrypt=0 -+ return -+ fi -+ -+ wsrep_log_info "Xtrabackup based encryption enabled in my.cnf - Supported only from Xtrabackup 2.1.4" -+ -+ if [[ -z $ealgo ]];then -+ wsrep_log_error "FATAL: Encryption algorithm empty from my.cnf, bailing out" -+ exit 3 -+ fi -+ -+ if [[ -z $ekey && ! -r $ekeyfile ]];then -+ wsrep_log_error "FATAL: Either key or keyfile must be readable" -+ exit 3 -+ fi -+ -+ if [[ -z $ekey ]];then -+ ecmd="xbcrypt --encrypt-algo=$ealgo --encrypt-key-file=$ekeyfile" -+ else -+ ecmd="xbcrypt --encrypt-algo=$ealgo --encrypt-key=$ekey" -+ fi -+ -+ if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then -+ ecmd+=" -d" -+ fi -+} -+ -+get_transfer() -+{ -+ if [[ -z $SST_PORT ]];then -+ TSST_PORT=4444 -+ else -+ TSST_PORT=$SST_PORT -+ fi -+ -+ if [[ $tfmt == 'nc' ]];then -+ if [[ ! -x `which nc` ]];then -+ wsrep_log_error "nc(netcat) not found in path: $PATH" -+ exit 2 -+ fi -+ wsrep_log_info "Using netcat as streamer" -+ if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then -+ tcmd="nc -dl ${TSST_PORT}" -+ else -+ tcmd="nc ${REMOTEIP} ${TSST_PORT}" -+ fi -+ else -+ tfmt='socat' -+ wsrep_log_info "Using socat as streamer" -+ if [[ ! -x `which socat` ]];then -+ wsrep_log_error "socat not found in path: $PATH" -+ exit 2 -+ fi -+ -+ if [[ $encrypt -eq 2 ]] && ! socat -V | grep -q OPENSSL;then -+ wsrep_log_info "NOTE: socat is not openssl enabled, falling back to plain transfer" -+ encrypt=0 -+ fi -+ -+ if [[ $encrypt -eq 2 ]];then -+ wsrep_log_info "Using openssl based encryption with socat" -+ if [[ -z $tpem || -z $tcert ]];then -+ wsrep_log_error "Both PEM and CRT files required" -+ exit 22 -+ fi -+ if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then -+ wsrep_log_info "Decrypting with PEM $tpem, CA: $tcert" -+ tcmd="socat -u openssl-listen:${TSST_PORT},reuseaddr,cert=$tpem,cafile=${tcert}${sockopt} stdio" -+ else -+ wsrep_log_info "Encrypting with PEM $tpem, CA: $tcert" -+ tcmd="socat -u stdio openssl-connect:${REMOTEIP}:${TSST_PORT},cert=$tpem,cafile=${tcert}${sockopt}" -+ fi -+ else -+ if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then -+ tcmd="socat -u TCP-LISTEN:${TSST_PORT},reuseaddr${sockopt} stdio" -+ else -+ tcmd="socat -u stdio TCP:${REMOTEIP}:${TSST_PORT}${sockopt}" -+ fi -+ fi -+ fi -+ -+} -+ -+parse_cnf() -+{ -+ local group=$1 -+ local var=$2 -+ reval=$($MY_PRINT_DEFAULTS -c $WSREP_SST_OPT_CONF $group | awk -F= '{if ($1 ~ /_/) { gsub(/_/,"-",$1); print $1"="$2 } else { print $0 }}' | grep -- "--$var=" | cut -d= -f2-) -+ if [[ -z $reval ]];then -+ [[ -n $3 ]] && reval=$3 -+ fi -+ echo $reval -+} -+ -+get_footprint() -+{ -+ pushd $WSREP_SST_OPT_DATA 1>/dev/null -+ payload=$(find . -regex '.*\.ibd$\|.*\.MYI$\|.*\.MYD$\|.*ibdata1$' -type f -print0 | xargs -0 du --block-size=1 -c | awk 'END { print $1 }') -+ if $MY_PRINT_DEFAULTS -c $WSREP_SST_OPT_CONF xtrabackup | grep -q -- "--compress";then -+ # QuickLZ has around 50% compression ratio -+ # When compression/compaction used, the progress is only an approximate. -+ payload=$(( payload*1/2 )) -+ fi -+ popd 1>/dev/null -+ pcmd+=" -s $payload" -+ adjust_progress -+} -+ -+adjust_progress() -+{ -+ if [[ -n $progress && $progress != '1' ]];then -+ if [[ -e $progress ]];then -+ pcmd+=" 2>>$progress" -+ else -+ pcmd+=" 2>$progress" -+ fi -+ elif [[ -z $progress && -n $rlimit ]];then -+ # When rlimit is non-zero -+ pcmd="pv -q" -+ fi -+ -+ if [[ -n $rlimit && "$WSREP_SST_OPT_ROLE" == "donor" ]];then -+ wsrep_log_info "Rate-limiting SST to $rlimit" -+ pcmd+=" -L \$rlimit" -+ fi -+} -+ -+read_cnf() -+{ -+ sfmt=$(parse_cnf sst streamfmt "tar") -+ tfmt=$(parse_cnf sst transferfmt "socat") -+ tcert=$(parse_cnf sst tca "") -+ tpem=$(parse_cnf sst tcert "") -+ encrypt=$(parse_cnf sst encrypt 0) -+ sockopt=$(parse_cnf sst sockopt "") -+ progress=$(parse_cnf sst progress "") -+ rebuild=$(parse_cnf sst rebuild 0) -+ ttime=$(parse_cnf sst time 0) -+ incremental=$(parse_cnf sst incremental 0) -+ ealgo=$(parse_cnf xtrabackup encrypt "") -+ ekey=$(parse_cnf xtrabackup encrypt-key "") -+ ekeyfile=$(parse_cnf xtrabackup encrypt-key-file "") -+ -+ # Refer to http://www.percona.com/doc/percona-xtradb-cluster/manual/xtrabackup_sst.html -+ if [[ -z $ealgo ]];then -+ ealgo=$(parse_cnf sst encrypt-algo "") -+ ekey=$(parse_cnf sst encrypt-key "") -+ ekeyfile=$(parse_cnf sst encrypt-key-file "") -+ fi -+ rlimit=$(parse_cnf sst rlimit "") -+ uextra=$(parse_cnf sst use_extra 0) -+} -+ -+get_stream() -+{ -+ if [[ $sfmt == 'xbstream' ]];then -+ wsrep_log_info "Streaming with xbstream" -+ if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then -+ strmcmd="xbstream -x" -+ else -+ strmcmd="xbstream -c \${INFO_FILE} \${IST_FILE}" -+ fi -+ else -+ sfmt="tar" -+ wsrep_log_info "Streaming with tar" -+ if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then -+ strmcmd="tar xfi - --recursive-unlink -h" -+ else -+ strmcmd="tar cf - \${INFO_FILE} \${IST_FILE}" -+ fi -+ -+ fi -+} -+ -+get_proc() -+{ -+ set +e -+ nproc=$(grep -c processor /proc/cpuinfo) -+ [[ -z $nproc || $nproc -eq 0 ]] && nproc=1 -+ set -e -+} -+ -+sig_joiner_cleanup() -+{ -+ wsrep_log_error "Removing $MAGIC_FILE file due to signal" -+ rm -f "$MAGIC_FILE" -+} -+ -+cleanup_joiner() -+{ -+ # Since this is invoked just after exit NNN -+ local estatus=$? -+ if [[ $estatus -ne 0 ]];then -+ wsrep_log_error "Cleanup after exit with status:$estatus" -+ fi -+ if [ "${WSREP_SST_OPT_ROLE}" = "joiner" ];then -+ wsrep_log_info "Removing the sst_in_progress file" -+ wsrep_cleanup_progress_file -+ fi -+ if [[ -n $progress && -p $progress ]];then -+ wsrep_log_info "Cleaning up fifo file $progress" -+ rm $progress -+ fi -+} -+ -+check_pid() -+{ -+ local pid_file="$1" -+ [ -r "$pid_file" ] && ps -p $(cat "$pid_file") >/dev/null 2>&1 -+} -+ -+cleanup_donor() -+{ -+ # Since this is invoked just after exit NNN -+ local estatus=$? -+ if [[ $estatus -ne 0 ]];then -+ wsrep_log_error "Cleanup after exit with status:$estatus" -+ fi -+ -+ if [[ -n $XTRABACKUP_PID ]];then -+ if check_pid $XTRABACKUP_PID -+ then -+ wsrep_log_error "xtrabackup process is still running. Killing... " -+ kill_xtrabackup -+ fi -+ -+ rm -f $XTRABACKUP_PID -+ fi -+ rm -f ${DATA}/${IST_FILE} -+ -+ if [[ -n $progress && -p $progress ]];then -+ wsrep_log_info "Cleaning up fifo file $progress" -+ rm $progress -+ fi -+} -+ -+kill_xtrabackup() -+{ -+ local PID=$(cat $XTRABACKUP_PID) -+ [ -n "$PID" -a "0" != "$PID" ] && kill $PID && (kill $PID && kill -9 $PID) || : -+ rm -f "$XTRABACKUP_PID" -+} -+ -+setup_ports() -+{ -+ if [[ "$WSREP_SST_OPT_ROLE" == "donor" ]];then -+ SST_PORT=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $2 }') -+ REMOTEIP=$(echo $WSREP_SST_OPT_ADDR | awk -F ':' '{ print $1 }') -+ lsn=$(echo $WSREP_SST_OPT_ADDR | awk -F '[:/]' '{ print $4 }') -+ else -+ SST_PORT=$(echo ${WSREP_SST_OPT_ADDR} | awk -F ':' '{ print $2 }') -+ fi -+} -+ -+# waits ~10 seconds for nc to open the port and then reports ready -+# (regardless of timeout) -+wait_for_listen() -+{ -+ local PORT=$1 -+ local ADDR=$2 -+ local MODULE=$3 -+ for i in {1..50} -+ do -+ ss -p state listening "( sport = :$PORT )" | grep -qE 'socat|nc' && break -+ sleep 0.2 -+ done -+ if [[ $incremental -eq 1 ]];then -+ echo "ready ${ADDR}/${MODULE}/$lsn" -+ else -+ echo "ready ${ADDR}/${MODULE}" -+ fi -+} -+ -+check_extra() -+{ -+ local use_socket=1 -+ if [[ $uextra -eq 1 ]];then -+ if $MY_PRINT_DEFAULTS -c $WSREP_SST_OPT_CONF mysqld | tr '_' '-' | grep -- "--thread-handling=" | grep -q 'pool-of-threads';then -+ local eport=$($MY_PRINT_DEFAULTS -c $WSREP_SST_OPT_CONF mysqld | tr '_' '-' | grep -- "--extra-port=" | cut -d= -f2) -+ if [[ -n $eport ]];then -+ # Xtrabackup works only locally. -+ # Hence, setting host to 127.0.0.1 unconditionally. -+ wsrep_log_info "SST through extra_port $eport" -+ INNOEXTRA+=" --host=127.0.0.1 --port=$eport " -+ use_socket=0 -+ else -+ wsrep_log_error "Extra port $eport null, failing" -+ exit 1 -+ fi -+ else -+ wsrep_log_info "Thread pool not set, ignore the option use_extra" -+ fi -+ fi -+ if [[ $use_socket -eq 1 ]] && [[ -n "${WSREP_SST_OPT_SOCKET}" ]];then -+ INNOEXTRA+=" --socket=${WSREP_SST_OPT_SOCKET}" -+ fi -+} -+ -+if [[ ! -x `which innobackupex` ]];then -+ wsrep_log_error "innobackupex not in path: $PATH" -+ exit 2 -+fi -+ -+rm -f "${MAGIC_FILE}" -+ -+if [[ ! ${WSREP_SST_OPT_ROLE} == 'joiner' && ! ${WSREP_SST_OPT_ROLE} == 'donor' ]];then -+ wsrep_log_error "Invalid role ${WSREP_SST_OPT_ROLE}" -+ exit 22 -+fi -+ -+read_cnf -+setup_ports -+get_stream -+get_transfer -+ -+INNOEXTRA="" -+INNOAPPLY="${INNOBACKUPEX_BIN} --defaults-file=${WSREP_SST_OPT_CONF} --apply-log \$rebuildcmd \${DATA} &>\${DATA}/innobackup.prepare.log" -+INNOBACKUP="${INNOBACKUPEX_BIN} --defaults-file=${WSREP_SST_OPT_CONF} \$INNOEXTRA --galera-info --stream=\$sfmt \${TMPDIR} 2>\${DATA}/innobackup.backup.log" -+ -+if [ "$WSREP_SST_OPT_ROLE" = "donor" ] -+then -+ trap cleanup_donor EXIT -+ -+ if [ $WSREP_SST_OPT_BYPASS -eq 0 ] -+ then -+ TMPDIR="${TMPDIR:-/tmp}" -+ -+ if [ "${AUTH[0]}" != "(null)" ]; then -+ INNOEXTRA+=" --user=${AUTH[0]}" -+ fi -+ -+ if [ ${#AUTH[*]} -eq 2 ]; then -+ INNOEXTRA+=" --password=${AUTH[1]}" -+ elif [ "${AUTH[0]}" != "(null)" ]; then -+ # Empty password, used for testing, debugging etc. -+ INNOEXTRA+=" --password=" -+ fi -+ -+ get_keys -+ if [[ $encrypt -eq 1 ]];then -+ if [[ -n $ekey ]];then -+ INNOEXTRA+=" --encrypt=$ealgo --encrypt-key=$ekey " -+ else -+ INNOEXTRA+=" --encrypt=$ealgo --encrypt-key-file=$ekeyfile " -+ fi -+ fi -+ -+ if [[ -n $lsn ]];then -+ INNOEXTRA+=" --incremental --incremental-lsn=$lsn " -+ fi -+ -+ check_extra -+ -+ wsrep_log_info "Streaming the backup to joiner at ${REMOTEIP} ${SST_PORT}" -+ -+ if [[ -n $progress ]];then -+ get_footprint -+ tcmd="$pcmd | $tcmd" -+ elif [[ -n $rlimit ]];then -+ adjust_progress -+ tcmd="$pcmd | $tcmd" -+ fi -+ -+ set +e -+ timeit "Donor-Transfer" "$INNOBACKUP | $tcmd; RC=( "\${PIPESTATUS[@]}" )" -+ set -e -+ -+ if [ ${RC[0]} -ne 0 ]; then -+ wsrep_log_error "${INNOBACKUPEX_BIN} finished with error: ${RC[0]}. " \ -+ "Check ${DATA}/innobackup.backup.log" -+ exit 22 -+ elif [[ ${RC[$(( ${#RC[@]}-1 ))]} -eq 1 ]];then -+ wsrep_log_error "$tcmd finished with error: ${RC[1]}" -+ exit 22 -+ fi -+ -+ # innobackupex implicitly writes PID to fixed location in ${TMPDIR} -+ XTRABACKUP_PID="${TMPDIR}/xtrabackup_pid" -+ -+ -+ else # BYPASS FOR IST -+ -+ wsrep_log_info "Bypassing the SST for IST" -+ STATE="${WSREP_SST_OPT_GTID}" -+ echo "continue" # now server can resume updating data -+ echo "${STATE}" > "${MAGIC_FILE}" -+ echo "1" > "${DATA}/${IST_FILE}" -+ get_keys -+ pushd ${DATA} 1>/dev/null -+ set +e -+ if [[ $encrypt -eq 1 ]];then -+ tcmd=" $ecmd | $tcmd" -+ fi -+ timeit "Donor-IST-Unencrypted-transfer" "$strmcmd | $tcmd; RC=( "\${PIPESTATUS[@]}" )" -+ set -e -+ popd 1>/dev/null -+ -+ for ecode in "${RC[@]}";do -+ if [[ $ecode -ne 0 ]];then -+ wsrep_log_error "Error while streaming data to joiner node: " \ -+ "exit codes: ${RC[@]}" -+ exit 1 -+ fi -+ done -+ fi -+ -+ echo "done ${WSREP_SST_OPT_GTID}" -+ wsrep_log_info "Total time on donor: $totime seconds" -+ -+elif [ "${WSREP_SST_OPT_ROLE}" = "joiner" ] -+then -+ [[ -e $SST_PROGRESS_FILE ]] && wsrep_log_info "Stale sst_in_progress file: $SST_PROGRESS_FILE" -+ touch $SST_PROGRESS_FILE -+ -+ if [[ ! -e ${DATA}/ibdata1 ]];then -+ incremental=0 -+ fi -+ -+ if [[ $incremental -eq 1 ]];then -+ wsrep_log_info "Incremental SST enabled" -+ #lsn=$(/pxc/bin/mysqld --defaults-file=$WSREP_SST_OPT_CONF --basedir=/pxc --wsrep-recover 2>&1 | grep -o 'log sequence number .*' | cut -d " " -f 4 | head -1) -+ lsn=$(grep to_lsn xtrabackup_checkpoints | cut -d= -f2 | tr -d ' ') -+ wsrep_log_info "Recovered LSN: $lsn" -+ fi -+ -+ sencrypted=1 -+ nthreads=1 -+ -+ MODULE="xtrabackup_sst" -+ -+ # May need xtrabackup_checkpoints later on -+ rm -f ${DATA}/xtrabackup_binary ${DATA}/xtrabackup_galera_info ${DATA}/xtrabackup_logfile -+ -+ ADDR=${WSREP_SST_OPT_ADDR} -+ if [ -z "${SST_PORT}" ] -+ then -+ SST_PORT=4444 -+ ADDR="$(echo ${WSREP_SST_OPT_ADDR} | awk -F ':' '{ print $1 }'):${SST_PORT}" -+ fi -+ -+ wait_for_listen ${SST_PORT} ${ADDR} ${MODULE} & -+ -+ trap sig_joiner_cleanup HUP PIPE INT TERM -+ trap cleanup_joiner EXIT -+ -+ if [[ -n $progress ]];then -+ adjust_progress -+ tcmd+=" | $pcmd" -+ fi -+ -+ if [[ $incremental -eq 1 ]];then -+ BDATA=$DATA -+ DATA=$(mktemp -d) -+ MAGIC_FILE="${DATA}/${INFO_FILE}" -+ fi -+ -+ get_keys -+ set +e -+ if [[ $encrypt -eq 1 && $sencrypted -eq 1 ]];then -+ strmcmd=" $ecmd | $strmcmd" -+ fi -+ -+ pushd ${DATA} 1>/dev/null -+ timeit "Joiner-Recv-Unencrypted" "$tcmd | $strmcmd; RC=( "\${PIPESTATUS[@]}" )" -+ popd 1>/dev/null -+ -+ set -e -+ -+ if [[ $sfmt == 'xbstream' ]];then -+ # Special handling till lp:1193240 is fixed" -+ if [[ ${RC[$(( ${#RC[@]}-1 ))]} -eq 1 ]];then -+ wsrep_log_error "Xbstream failed" -+ wsrep_log_error "Data directory ${DATA} may not be empty: lp:1193240" \ -+ "Manual intervention required in that case" -+ exit 32 -+ fi -+ fi -+ -+ wait %% # join for wait_for_listen thread -+ -+ for ecode in "${RC[@]}";do -+ if [[ $ecode -ne 0 ]];then -+ wsrep_log_error "Error while getting data from donor node: " \ -+ "exit codes: ${RC[@]}" -+ exit 32 -+ fi -+ done -+ -+ if [ ! -r "${MAGIC_FILE}" ] -+ then -+ # this message should cause joiner to abort -+ wsrep_log_error "xtrabackup process ended without creating '${MAGIC_FILE}'" -+ wsrep_log_info "Contents of datadir" -+ wsrep_log_info "$(ls -l ${DATA}/**/*)" -+ exit 32 -+ fi -+ -+ if ! ps -p ${WSREP_SST_OPT_PARENT} &>/dev/null -+ then -+ wsrep_log_error "Parent mysqld process (PID:${WSREP_SST_OPT_PARENT}) terminated unexpectedly." -+ exit 32 -+ fi -+ -+ if [ ! -r "${DATA}/${IST_FILE}" ] -+ then -+ wsrep_log_info "Proceeding with SST" -+ wsrep_log_info "Removing existing ib_logfile files" -+ if [[ $incremental -ne 1 ]];then -+ rm -f ${DATA}/ib_logfile* -+ else -+ rm -f ${BDATA}/ib_logfile* -+ fi -+ -+ get_proc -+ -+ # Rebuild indexes for compact backups -+ if grep -q 'compact = 1' ${DATA}/xtrabackup_checkpoints;then -+ wsrep_log_info "Index compaction detected" -+ rebuild=1 -+ fi -+ -+ if [[ $rebuild -eq 1 ]];then -+ nthreads=$(parse_cnf xtrabackup rebuild-threads $nproc) -+ wsrep_log_info "Rebuilding during prepare with $nthreads threads" -+ rebuildcmd="--rebuild-indexes --rebuild-threads=$nthreads" -+ fi -+ -+ if test -n "$(find ${DATA} -maxdepth 1 -type f -name '*.qp' -print -quit)";then -+ -+ wsrep_log_info "Compressed qpress files found" -+ -+ if [[ ! -x `which qpress` ]];then -+ wsrep_log_error "qpress not found in path: $PATH" -+ exit 22 -+ fi -+ -+ if [[ -n $progress ]] && pv --help | grep -q 'line-mode';then -+ count=$(find ${DATA} -type f -name '*.qp' | wc -l) -+ count=$(( count*2 )) -+ if pv --help | grep -q FORMAT;then -+ pvopts="-f -s $count -l -N Decompression -F '%N => Rate:%r Elapsed:%t %e Progress: [%b/$count]'" -+ else -+ pvopts="-f -s $count -l -N Decompression" -+ fi -+ pcmd="pv $pvopts" -+ adjust_progress -+ dcmd="$pcmd | xargs -n 2 qpress -T${nproc}d" -+ else -+ dcmd="xargs -n 2 qpress -T${nproc}d" -+ fi -+ -+ wsrep_log_info "Removing existing ibdata1 file" -+ rm -f ${DATA}/ibdata1 -+ -+ # Decompress the qpress files -+ wsrep_log_info "Decompression with $nproc threads" -+ timeit "Decompression" "find ${DATA} -type f -name '*.qp' -printf '%p\n%h\n' | $dcmd" -+ extcode=$? -+ -+ if [[ $extcode -eq 0 ]];then -+ wsrep_log_info "Removing qpress files after decompression" -+ find ${DATA} -type f -name '*.qp' -delete -+ if [[ $? -ne 0 ]];then -+ wsrep_log_error "Something went wrong with deletion of qpress files. Investigate" -+ fi -+ else -+ wsrep_log_error "Decompression failed. Exit code: $extcode" -+ exit 22 -+ fi -+ fi -+ -+ if [[ $incremental -eq 1 ]];then -+ # Added --ibbackup=xtrabackup_55 because it fails otherwise citing connection issues. -+ INNOAPPLY="${INNOBACKUPEX_BIN} --defaults-file=${WSREP_SST_OPT_CONF} \ -+ --ibbackup=xtrabackup_55 --apply-log $rebuildcmd --redo-only $BDATA --incremental-dir=${DATA} &>>${BDATA}/innobackup.prepare.log" -+ fi -+ -+ wsrep_log_info "Preparing the backup at ${DATA}" -+ timeit "Xtrabackup prepare stage" "$INNOAPPLY" -+ -+ if [[ $incremental -eq 1 ]];then -+ wsrep_log_info "Cleaning up ${DATA} after incremental SST" -+ [[ -d ${DATA} ]] && rm -rf ${DATA} -+ DATA=$BDATA -+ fi -+ -+ if [ $? -ne 0 ]; -+ then -+ wsrep_log_error "${INNOBACKUPEX_BIN} finished with errors. Check ${DATA}/innobackup.prepare.log" -+ exit 22 -+ fi -+ else -+ wsrep_log_info "${IST_FILE} received from donor: Running IST" -+ fi -+ -+ if [[ ! -r ${MAGIC_FILE} ]];then -+ wsrep_log_error "SST magic file ${MAGIC_FILE} not found/readable" -+ exit 2 -+ fi -+ -+ cat "${MAGIC_FILE}" # output UUID:seqno -+ wsrep_log_info "Total time on joiner: $totime seconds" -+fi -+ -+exit 0 -diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt -index 3eeb07d..a63d98e 100644 ---- a/sql/CMakeLists.txt -+++ b/sql/CMakeLists.txt -@@ -13,6 +13,10 @@ - # along with this program; if not, write to the Free Software - # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -+IF(WITH_WSREP) -+ SET(WSREP_INCLUDES ${CMAKE_SOURCE_DIR}/wsrep) -+ENDIF() -+ - INCLUDE_DIRECTORIES( - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/sql -@@ -20,6 +24,7 @@ INCLUDE_DIRECTORIES( - ${ZLIB_INCLUDE_DIR} - ${SSL_INCLUDE_DIRS} - ${CMAKE_BINARY_DIR}/sql -+ ${WSREP_INCLUDES} - ) - - SET(GEN_SOURCES -@@ -171,7 +176,24 @@ SET(SQL_SHARED_SOURCES - - SET(SQL_EXPORTED_SOURCES ${SQL_SHARED_SOURCES} PARENT_SCOPE) - -+IF(WITH_WSREP) -+ SET(WSREP_SOURCES -+ wsrep_check_opts.cc -+ wsrep_hton.cc -+ wsrep_mysqld.cc -+ wsrep_notify.cc -+ wsrep_sst.cc -+ wsrep_utils.cc -+ wsrep_var.cc -+ wsrep_binlog.cc -+ wsrep_applier.cc -+ wsrep_thd.cc -+ ) -+ SET(WSREP_LIB wsrep) -+ENDIF() -+ - SET(SQL_SOURCE -+ ${WSREP_SOURCES} - ${GEN_SOURCES} - ${MYSYS_LIBWRAP_SOURCE} - ${SQL_SHARED_SOURCES} -@@ -208,6 +230,7 @@ DTRACE_INSTRUMENT(sql) - TARGET_LINK_LIBRARIES(sql ${MYSQLD_STATIC_PLUGIN_LIBS} - mysys mysys_ssl dbug strings vio regex - ${LIBWRAP} ${LIBCRYPT} ${LIBDL} -+ ${WSREP_LIB} - ${SSL_LIBRARIES}) - - # -@@ -246,7 +269,6 @@ ADD_LIBRARY(sqlgunitlib - ) - ADD_DEPENDENCIES(sqlgunitlib GenError) - -- - IF(WIN32) - SET(MYSQLD_SOURCE main.cc nt_servc.cc nt_servc.h message.rc) - ELSE() -diff --git a/sql/binlog.cc b/sql/binlog.cc -index d1babfe..bbf87dd 100644 ---- a/sql/binlog.cc -+++ b/sql/binlog.cc -@@ -60,7 +60,11 @@ static ulonglong limit_unsafe_suppression_start_time= 0; - static bool unsafe_warning_suppression_is_activated= false; - static int limit_unsafe_warning_count= 0; - -+#ifndef WITH_WSREP - static handlerton *binlog_hton; -+#else -+handlerton *binlog_hton; // we need it in wsrep_binlog.cc -+#endif - bool opt_binlog_order_commits= true; - - const char *log_bin_index= 0; -@@ -795,7 +799,9 @@ static binlog_cache_mngr *thd_get_cache_mngr(const THD *thd) - If opt_bin_log is not set, binlog_hton->slot == -1 and hence - thd_get_ha_data(thd, hton) segfaults. - */ -+#ifndef WITH_WSREP - DBUG_ASSERT(opt_bin_log); -+#endif - return (binlog_cache_mngr *)thd_get_ha_data(thd, binlog_hton); - } - -@@ -881,7 +887,11 @@ binlog_trans_log_savepos(THD *thd, my_off_t *pos) - DBUG_ENTER("binlog_trans_log_savepos"); - DBUG_ASSERT(pos != NULL); - binlog_cache_mngr *const cache_mngr= thd_get_cache_mngr(thd); -+#ifdef WITH_WSREP -+ DBUG_ASSERT((WSREP_EMULATE_BINLOG(thd)) || mysql_bin_log.is_open()); -+#else - DBUG_ASSERT(mysql_bin_log.is_open()); -+#endif /* WITH_WSREP */ - *pos= cache_mngr->trx_cache.get_byte_position(); - DBUG_PRINT("return", ("position: %lu", (ulong) *pos)); - DBUG_VOID_RETURN; -@@ -897,7 +907,16 @@ binlog_trans_log_savepos(THD *thd, my_off_t *pos) - static int binlog_init(void *p) - { - binlog_hton= (handlerton *)p; -+#ifdef WITH_WSREP -+ if (WSREP_ON) -+ binlog_hton->state= SHOW_OPTION_YES; -+ else -+ { -+#endif /* WITH_WSREP */ - binlog_hton->state=opt_bin_log ? SHOW_OPTION_YES : SHOW_OPTION_NO; -+#ifdef WITH_WSREP -+ } -+#endif /* WITH_WSREP */ - binlog_hton->db_type=DB_TYPE_BINLOG; - binlog_hton->savepoint_offset= sizeof(my_off_t); - binlog_hton->close_connection= binlog_close_connection; -@@ -912,10 +931,30 @@ static int binlog_init(void *p) - return 0; - } - -+#ifdef WITH_WSREP -+#include "wsrep_binlog.h" -+#endif /* WITH_WSREP */ - static int binlog_close_connection(handlerton *hton, THD *thd) - { - DBUG_ENTER("binlog_close_connection"); - binlog_cache_mngr *const cache_mngr= thd_get_cache_mngr(thd); -+#ifdef WITH_WSREP -+ if (!cache_mngr->is_binlog_empty()) { -+ IO_CACHE* cache= get_trans_log(thd); -+ uchar *buf; -+ size_t len=0; -+ wsrep_write_cache_buf(cache, &buf, &len); -+ WSREP_WARN("binlog trx cache not empty (%lu bytes) @ connection close %lu", -+ len, thd->thread_id); -+ if (len > 0) wsrep_dump_rbr_buf(thd, buf, len); -+ -+ cache = cache_mngr->get_binlog_cache_log(false); -+ wsrep_write_cache_buf(cache, &buf, &len); -+ WSREP_WARN("binlog stmt cache not empty (%lu bytes) @ connection close %lu", -+ len, thd->thread_id); -+ if (len > 0) wsrep_dump_rbr_buf(thd, buf, len); -+ } -+#endif /* WITH_WSREP */ - DBUG_ASSERT(cache_mngr->is_binlog_empty()); - DBUG_ASSERT(cache_mngr->trx_cache.is_group_cache_empty() && - cache_mngr->stmt_cache.is_group_cache_empty()); -@@ -1666,7 +1705,11 @@ int MYSQL_BIN_LOG::rollback(THD *thd, bool all) - if (error == 0 && stuff_logged) - error= ordered_commit(thd, all, /* skip_commit */ true); - -+#ifdef WITH_WSREP -+ if (!WSREP_EMULATE_BINLOG(thd) && check_write_error(thd)) -+#else - if (check_write_error(thd)) -+#endif - { - /* - "all == true" means that a "rollback statement" triggered the error and -@@ -4771,6 +4814,43 @@ int MYSQL_BIN_LOG::purge_logs_before_date(time_t purge_time, bool auto_purge) - no_of_log_files_purged, no_of_log_files_to_purge); - } - -+ if (log_is_active) -+ { -+ if(!auto_purge) -+ push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, -+ ER_WARN_PURGE_LOG_IS_ACTIVE, -+ ER(ER_WARN_PURGE_LOG_IS_ACTIVE), -+ log_info.log_file_name); -+ -+ } -+ -+ if (log_is_in_use) -+ { -+ int no_of_log_files_to_purge= no_of_log_files_purged+1; -+ while (strcmp(log_file_name, log_info.log_file_name)) -+ { -+ if (mysql_file_stat(m_key_file_log, log_info.log_file_name, -+ &stat_area, MYF(0))) -+ { -+ if (stat_area.st_mtime < purge_time) -+ no_of_log_files_to_purge++; -+ else -+ break; -+ } -+ if (find_next_log(&log_info, false/*need_lock_index=false*/)) -+ { -+ no_of_log_files_to_purge++; -+ break; -+ } -+ } -+ -+ push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, -+ ER_WARN_PURGE_LOG_IN_USE, -+ ER(ER_WARN_PURGE_LOG_IN_USE), -+ copy_log_in_use, no_of_threads_locking_log, -+ no_of_log_files_purged, no_of_log_files_to_purge); -+ } -+ - error= (to_log[0] ? purge_logs(to_log, true, - false/*need_lock_index=false*/, - true/*need_update_threads=true*/, -@@ -5190,7 +5270,11 @@ MYSQL_BIN_LOG::flush_and_set_pending_rows_event(THD *thd, - bool is_transactional) - { - DBUG_ENTER("MYSQL_BIN_LOG::flush_and_set_pending_rows_event(event)"); -+#ifdef WITH_WSREP -+ DBUG_ASSERT(WSREP_EMULATE_BINLOG(thd) || mysql_bin_log.is_open()); -+#else - DBUG_ASSERT(mysql_bin_log.is_open()); -+#endif /* WITH_WSREP */ - DBUG_PRINT("enter", ("event: 0x%lx", (long) event)); - - int error= 0; -@@ -5265,7 +5349,13 @@ bool MYSQL_BIN_LOG::write_event(Log_event *event_info) - mostly called if is_open() *was* true a few instructions before, but it - could have changed since. - */ -+#ifdef WITH_WSREP -+ /* applier and replayer can skip writing binlog events */ -+ if ((WSREP_EMULATE_BINLOG(thd) && (thd->wsrep_exec_mode != REPL_RECV)) || -+ is_open()) -+#else - if (likely(is_open())) -+#endif - { - #ifdef HAVE_REPLICATION - /* -@@ -5412,6 +5502,15 @@ int MYSQL_BIN_LOG::rotate(bool force_rotate, bool* check_purge) - { - int error= 0; - DBUG_ENTER("MYSQL_BIN_LOG::rotate"); -+#ifdef WITH_WSREP -+ if (WSREP_ON && wsrep_to_isolation) -+ { -+ *check_purge= false; -+ WSREP_DEBUG("avoiding binlog rotate due to TO isolation: %d", -+ wsrep_to_isolation); -+ DBUG_RETURN(0); -+ } -+#endif - - DBUG_ASSERT(!is_relay_log); - mysql_mutex_assert_owner(&LOCK_log); -@@ -5898,6 +5997,9 @@ bool MYSQL_BIN_LOG::write_incident(THD *thd, bool need_lock_log, - bool MYSQL_BIN_LOG::write_cache(THD *thd, binlog_cache_data *cache_data) - { - DBUG_ENTER("MYSQL_BIN_LOG::write_cache(THD *, binlog_cache_data *, bool)"); -+#ifdef WITH_WSREP -+ if (WSREP_EMULATE_BINLOG(thd)) DBUG_RETURN(0); -+#endif /* WITH_WSREP */ - - IO_CACHE *cache= &cache_data->cache_log; - bool incident= cache_data->has_incident(); -@@ -6353,7 +6455,13 @@ TC_LOG::enum_result MYSQL_BIN_LOG::commit(THD *thd, bool all) - DBUG_ENTER("MYSQL_BIN_LOG::commit"); - - binlog_cache_mngr *cache_mngr= thd_get_cache_mngr(thd); -+#ifdef WITH_WSREP -+ my_xid xid= (wsrep_is_wsrep_xid(&thd->transaction.xid_state.xid) ? -+ wsrep_xid_seqno(&thd->transaction.xid_state.xid) : -+ thd->transaction.xid_state.xid.get_my_xid()); -+#else - my_xid xid= thd->transaction.xid_state.xid.get_my_xid(); -+#endif /* WITH_WSREP */ - int error= RESULT_SUCCESS; - bool stuff_logged= false; - -@@ -6939,6 +7047,27 @@ int MYSQL_BIN_LOG::ordered_commit(THD *thd, bool all, bool skip_commit) - my_off_t total_bytes= 0; - bool do_rotate= false; - -+#ifdef WITH_WSREP -+ if (WSREP_EMULATE_BINLOG(thd)) -+ { -+ /* -+ Skip group commit, just do storage engine commit. -+ */ -+ int rcode = ha_commit_low(thd, all); -+ -+ /* if there is myisam statement inside innodb transaction, we may -+ have events in stmt cache -+ */ -+ binlog_cache_mngr *const cache_mngr= thd_get_cache_mngr(thd); -+ if(!cache_mngr->stmt_cache.is_binlog_empty()) -+ { -+ WSREP_DEBUG("stmt transaction inside MST, SQL: %s", thd->query()); -+ cache_mngr->stmt_cache.reset(); -+ } -+ DBUG_RETURN(rcode); -+ } -+#endif /* WITH_WSREP */ -+ - /* - These values are used while flushing a transaction, so clear - everything. -@@ -7143,6 +7272,24 @@ int MYSQL_BIN_LOG::recover(IO_CACHE *log, Format_description_log_event *fdle, - */ - bool in_transaction= FALSE; - -+#ifdef WITH_WSREP -+ /* -+ Read current wsrep position from storage engines to have consistent -+ end position for binlog scan. -+ */ -+ XID xid; -+ memset(&xid, 0, sizeof(xid)); -+ xid.formatID= -1; -+ wsrep_get_SE_checkpoint(&xid); -+ char uuid_str[40]; -+ wsrep_uuid_print(wsrep_xid_uuid(&xid), uuid_str, sizeof(uuid_str)); -+ WSREP_INFO("Binlog recovery, found wsrep position %s:%lld", uuid_str, -+ (long long)wsrep_xid_seqno(&xid)); -+ const wsrep_seqno_t last_xid_seqno= wsrep_xid_seqno(&xid); -+ wsrep_seqno_t cur_xid_seqno=WSREP_SEQNO_UNDEFINED; -+#endif /* WITH_WSREP */ -+ -+ - if (! fdle->is_valid() || - my_hash_init(&xids, &my_charset_bin, TC_LOG_PAGE_SIZE/3, 0, - sizeof(my_xid), 0, 0, MYF(0))) -@@ -7151,7 +7298,12 @@ int MYSQL_BIN_LOG::recover(IO_CACHE *log, Format_description_log_event *fdle, - init_alloc_root(&mem_root, TC_LOG_PAGE_SIZE, TC_LOG_PAGE_SIZE); - - while ((ev= Log_event::read_log_event(log, 0, fdle, TRUE)) -- && ev->is_valid()) -+ && ev->is_valid() -+#ifdef WITH_WSREP -+ && (last_xid_seqno == WSREP_SEQNO_UNDEFINED || -+ last_xid_seqno != cur_xid_seqno) -+#endif -+ ) - { - if (ev->get_type_code() == QUERY_EVENT && - !strcmp(((Query_log_event*)ev)->query, "BEGIN")) -@@ -7172,6 +7324,9 @@ int MYSQL_BIN_LOG::recover(IO_CACHE *log, Format_description_log_event *fdle, - sizeof(xev->xid)); - if (!x || my_hash_insert(&xids, x)) - goto err2; -+#ifdef WITH_WSREP -+ cur_xid_seqno= xev->xid; -+#endif /* WITH_WSREP */ - } - - /* -@@ -7216,6 +7371,11 @@ int MYSQL_BIN_LOG::recover(IO_CACHE *log, Format_description_log_event *fdle, - delete ev; - } - -+#ifdef WITH_WSREP -+ WSREP_INFO("Binlog recovery scan stopped at Xid event %lld", -+ (long long)cur_xid_seqno); -+#endif /* WITH_WSREP */ -+ - if (ha_recover(&xids)) - goto err2; - -@@ -7240,7 +7400,9 @@ Group_cache *THD::get_group_cache(bool is_transactional) - - // If opt_bin_log==0, it is not safe to call thd_get_cache_mngr - // because binlog_hton has not been completely set up. -+#ifndef WITH_WSREP - DBUG_ASSERT(opt_bin_log); -+#endif - binlog_cache_mngr *cache_mngr= thd_get_cache_mngr(this); - - // cache_mngr is NULL until we call thd->binlog_setup_trx_data, so -@@ -7433,7 +7595,12 @@ int THD::binlog_write_table_map(TABLE *table, bool is_transactional, - table->s->table_map_id.id())); - - /* Pre-conditions */ -+#ifdef WITH_WSREP -+ DBUG_ASSERT(is_current_stmt_binlog_format_row() && -+ (WSREP_EMULATE_BINLOG(this) || mysql_bin_log.is_open())); -+#else - DBUG_ASSERT(is_current_stmt_binlog_format_row() && mysql_bin_log.is_open()); -+#endif /* WITH_WSREP */ - DBUG_ASSERT(table->s->table_map_id.is_valid()); - - Table_map_log_event -@@ -7721,9 +7888,16 @@ int THD::decide_logging_format(TABLE_LIST *tables) - binlogging is off, or if the statement is filtered out from the - binlog by filtering rules. - */ -+#ifdef WITH_WSREP -+ if ((WSREP_EMULATE_BINLOG(this) || -+ (mysql_bin_log.is_open() && (variables.option_bits & OPTION_BIN_LOG))) && -+ !(WSREP_BINLOG_FORMAT(variables.binlog_format) == BINLOG_FORMAT_STMT && -+ !binlog_filter->db_ok(db))) -+#else - if (mysql_bin_log.is_open() && (variables.option_bits & OPTION_BIN_LOG) && - !(variables.binlog_format == BINLOG_FORMAT_STMT && - !binlog_filter->db_ok(db))) -+#endif /* WITH_WSREP */ - { - /* - Compute one bit field with the union of all the engine -@@ -7967,7 +8141,7 @@ int THD::decide_logging_format(TABLE_LIST *tables) - */ - my_error((error= ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE), MYF(0)); - } -- else if (variables.binlog_format == BINLOG_FORMAT_ROW && -+ else if (WSREP_BINLOG_FORMAT(variables.binlog_format) == BINLOG_FORMAT_ROW && - sqlcom_can_generate_row_events(this)) - { - /* -@@ -7996,8 +8170,8 @@ int THD::decide_logging_format(TABLE_LIST *tables) - else - { - /* binlog_format = STATEMENT */ -- if (variables.binlog_format == BINLOG_FORMAT_STMT) -- { -+ if (WSREP_BINLOG_FORMAT(variables.binlog_format) == BINLOG_FORMAT_STMT) -+ { - if (lex->is_stmt_row_injection()) - { - /* -@@ -8013,7 +8187,14 @@ int THD::decide_logging_format(TABLE_LIST *tables) - 5. Error: Cannot modify table that uses a storage engine - limited to row-logging when binlog_format = STATEMENT - */ -+#ifdef WITH_WSREP -+ if (!WSREP(this) || wsrep_exec_mode == LOCAL_STATE) -+ { -+#endif /* WITH_WSREP */ - my_error((error= ER_BINLOG_STMT_MODE_AND_ROW_ENGINE), MYF(0), ""); -+#ifdef WITH_WSREP -+ } -+#endif /* WITH_WSREP */ - } - else if (is_write && (unsafe_flags= lex->get_stmt_unsafe_flags()) != 0) - { -@@ -8159,7 +8340,7 @@ int THD::decide_logging_format(TABLE_LIST *tables) - "and binlog_filter->db_ok(db) = %d", - mysql_bin_log.is_open(), - (variables.option_bits & OPTION_BIN_LOG), -- variables.binlog_format, -+ WSREP_BINLOG_FORMAT(variables.binlog_format), - binlog_filter->db_ok(db))); - #endif - -@@ -8469,7 +8650,12 @@ int THD::binlog_write_row(TABLE* table, bool is_trans, - uchar const *record, - const uchar* extra_row_info) - { -+#ifdef WITH_WSREP -+ DBUG_ASSERT(is_current_stmt_binlog_format_row() && -+ ((WSREP_EMULATE_BINLOG(this) || mysql_bin_log.is_open()))); -+#else - DBUG_ASSERT(is_current_stmt_binlog_format_row() && mysql_bin_log.is_open()); -+#endif /* WITH_WSREP */ - - /* - Pack records into format for transfer. We are allocating more -@@ -8499,7 +8685,13 @@ int THD::binlog_update_row(TABLE* table, bool is_trans, - const uchar *after_record, - const uchar* extra_row_info) - { -+#ifdef WITH_WSREP -+ DBUG_ASSERT(is_current_stmt_binlog_format_row() && -+ ((WSREP_EMULATE_BINLOG(this) || mysql_bin_log.is_open()))); -+#else - DBUG_ASSERT(is_current_stmt_binlog_format_row() && mysql_bin_log.is_open()); -+#endif /* WITH_WSREP */ -+ - int error= 0; - - /** -@@ -8565,7 +8757,13 @@ int THD::binlog_delete_row(TABLE* table, bool is_trans, - uchar const *record, - const uchar* extra_row_info) - { -+#ifdef WITH_WSREP -+ DBUG_ASSERT(is_current_stmt_binlog_format_row() && -+ ((WSREP_EMULATE_BINLOG(this) || mysql_bin_log.is_open()))); -+#else - DBUG_ASSERT(is_current_stmt_binlog_format_row() && mysql_bin_log.is_open()); -+#endif /* WITH_WSREP */ -+ - int error= 0; - - /** -@@ -8683,7 +8881,11 @@ int THD::binlog_flush_pending_rows_event(bool stmt_end, bool is_transactional) - mode: it might be the case that we left row-based mode before - flushing anything (e.g., if we have explicitly locked tables). - */ -- if (!mysql_bin_log.is_open()) -+#ifdef WITH_WSREP -+ if (!(WSREP_EMULATE_BINLOG(this) || mysql_bin_log.is_open())) -+#else -+ if (!mysql_bin_log.is_open()) -+#endif /* WITH_WSREP */ - DBUG_RETURN(0); - - /* -@@ -8952,7 +9154,21 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype, char const *query_arg, - DBUG_ENTER("THD::binlog_query"); - DBUG_PRINT("enter", ("qtype: %s query: '%s'", - show_query_type(qtype), query_arg)); -+#ifdef WITH_WSREP -+ DBUG_ASSERT(query_arg && (WSREP_EMULATE_BINLOG(this) -+ || mysql_bin_log.is_open())); -+#else - DBUG_ASSERT(query_arg && mysql_bin_log.is_open()); -+#endif /* WITH_WSREP */ -+ -+ if (get_binlog_local_stmt_filter() == BINLOG_FILTER_SET) -+ { -+ /* -+ The current statement is to be ignored, and not written to -+ the binlog. Do not call issue_unsafe_warnings(). -+ */ -+ DBUG_RETURN(0); -+ } - - if (get_binlog_local_stmt_filter() == BINLOG_FILTER_SET) - { -@@ -9056,6 +9272,72 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype, char const *query_arg, - } - - #endif /* !defined(MYSQL_CLIENT) */ -+#ifdef WITH_WSREP -+IO_CACHE * get_trans_log(THD * thd) -+{ -+ binlog_cache_mngr *const cache_mngr= thd_get_cache_mngr(thd); -+ if (cache_mngr) -+ { -+ return cache_mngr->get_binlog_cache_log(true); -+ } -+ else -+ { -+ WSREP_DEBUG("binlog cache not initialized, conn :%ld", thd->thread_id); -+ return NULL; -+ } -+} -+ -+bool wsrep_trans_cache_is_empty(THD *thd) -+{ -+ binlog_cache_mngr *const cache_mngr= -+ (binlog_cache_mngr*) thd_get_ha_data(thd, binlog_hton); -+ return (!cache_mngr || cache_mngr->trx_cache.is_binlog_empty()); -+} -+ -+void thd_binlog_flush_pending_rows_event(THD *thd, bool stmt_end) -+{ -+ thd->binlog_flush_pending_rows_event(stmt_end); -+} -+void thd_binlog_trx_reset(THD * thd) -+{ -+ /* -+ todo: fix autocommit select to not call the caller -+ */ -+ if (thd_get_ha_data(thd, binlog_hton) != NULL) -+ { -+ binlog_cache_mngr *const cache_mngr= thd_get_cache_mngr(thd); -+ if (cache_mngr) -+ { -+ cache_mngr->trx_cache.reset(); -+ if (!cache_mngr->stmt_cache.is_binlog_empty()) -+ { -+ WSREP_DEBUG("pending events in stmt cache, sql: %s", thd->query()); -+ cache_mngr->stmt_cache.reset(); -+ } -+ } -+ } -+ thd->clear_binlog_table_maps(); -+} -+ -+TC_LOG::enum_result wsrep_thd_binlog_commit(THD* thd, bool all) -+{ -+ /* applier and replayer can skip binlog commit */ -+ if (WSREP_EMULATE_BINLOG(thd) && (thd->wsrep_exec_mode != REPL_RECV)) -+ return mysql_bin_log.commit(thd, all); -+ else -+ return (ha_commit_low(thd, all) ? -+ TC_LOG::RESULT_ABORTED : TC_LOG::RESULT_SUCCESS); -+} -+ -+int wsrep_thd_binlog_rollback(THD* thd, bool all) -+{ -+ /* applier and replayer can skip binlog rollback */ -+ if (WSREP_EMULATE_BINLOG(thd) && (thd->wsrep_exec_mode != REPL_RECV)) -+ return mysql_bin_log.rollback(thd, all); -+ else -+ return ha_rollback_low(thd, all); -+} -+#endif /* WITH_WSREP */ - - struct st_mysql_storage_engine binlog_storage_engine= - { MYSQL_HANDLERTON_INTERFACE_VERSION }; -diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc -index 13a7691..139f0dc 100644 ---- a/sql/event_data_objects.cc -+++ b/sql/event_data_objects.cc -@@ -1477,8 +1477,25 @@ end: - bool save_tx_read_only= thd->tx_read_only; - thd->tx_read_only= false; - -+#ifdef WITH_WSREP -+ if (WSREP(thd)) { -+ // sql_print_information("sizeof(LEX) = %d", sizeof(struct LEX)); -+ // sizeof(LEX) = 4512, so it's relatively safe to allocate it on stack. -+ LEX lex; -+ LEX* saved = thd->lex; -+ lex.sql_command = SQLCOM_DROP_EVENT; -+ thd->lex = &lex; -+ WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL); -+ thd->lex = saved; -+ } -+#endif -+ - ret= Events::drop_event(thd, dbname, name, FALSE); - -+#ifdef WITH_WSREP -+ WSREP_TO_ISOLATION_END; -+ error: -+#endif - thd->tx_read_only= save_tx_read_only; - thd->security_ctx->master_access= saved_master_access; - } -diff --git a/sql/events.cc b/sql/events.cc -index ff87dd4..25e2e04 100644 ---- a/sql/events.cc -+++ b/sql/events.cc -@@ -1139,7 +1139,20 @@ Events::load_events_from_db(THD *thd) - delete et; - goto end; - } -- -+#ifdef WITH_WSREP -+ // when SST from master node who initials event, the event status is ENABLED -+ // this is problematic because there are two nodes with same events and both enabled. -+ if (et->originator != thd->server_id) -+ { -+ store_record(table, record[1]); -+ table->field[ET_FIELD_STATUS]-> -+ store((longlong) Event_parse_data::SLAVESIDE_DISABLED, -+ TRUE); -+ (void) table->file->ha_update_row(table->record[1], table->record[0]); -+ delete et; -+ continue; -+ } -+#endif - /** - Since the Event_queue_element object could be deleted inside - Event_queue::create_event we should save the value of dropped flag -@@ -1183,7 +1196,46 @@ end: - close_mysql_tables(thd); - DBUG_RETURN(ret); - } -+#ifdef WITH_WSREP -+int wsrep_create_event_query(THD *thd, uchar** buf, size_t* buf_len) -+{ -+ String log_query; - -+ if (create_query_string(thd, &log_query)) -+ { -+ WSREP_WARN("events create string failed: %s", thd->query()); -+ return 1; -+ } -+ return wsrep_to_buf_helper(thd, log_query.ptr(), log_query.length(), buf, buf_len); -+} -+static int -+wsrep_alter_query_string(THD *thd, String *buf) -+{ -+ /* Append the "ALTER" part of the query */ -+ if (buf->append(STRING_WITH_LEN("ALTER "))) -+ return 1; -+ /* Append definer */ -+ append_definer(thd, buf, &(thd->lex->definer->user), &(thd->lex->definer->host)); -+ /* Append the left part of thd->query after event name part */ -+ if (buf->append(thd->lex->stmt_definition_begin, -+ thd->lex->stmt_definition_end - -+ thd->lex->stmt_definition_begin)) -+ return 1; -+ -+ return 0; -+} -+int wsrep_alter_event_query(THD *thd, uchar** buf, size_t* buf_len) -+{ -+ String log_query; -+ -+ if (wsrep_alter_query_string(thd, &log_query)) -+ { -+ WSREP_WARN("events alter string failed: %s", thd->query()); -+ return 1; -+ } -+ return wsrep_to_buf_helper(thd, log_query.ptr(), log_query.length(), buf, buf_len); -+} -+#endif /* WITH_WSREP */ - /** - @} (End of group Event_Scheduler) - */ -diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc -index 26172ca..f92eb5d 100644 ---- a/sql/ha_partition.cc -+++ b/sql/ha_partition.cc -@@ -411,7 +411,13 @@ const char *ha_partition::table_type() const - // we can do this since we only support a single engine type - return m_file[0]->table_type(); - } -- -+#ifdef WITH_WSREP -+int ha_partition::wsrep_db_type() const -+{ -+ // we can do this since we only support a single engine type -+ return ha_legacy_type(m_file[0]->ht); -+} -+#endif /* WITH_WSREP */ - - /* - Destructor method -diff --git a/sql/ha_partition.h b/sql/ha_partition.h -index 6b20de0..acdfeb9 100644 ---- a/sql/ha_partition.h -+++ b/sql/ha_partition.h -@@ -1244,6 +1244,9 @@ public: - ------------------------------------------------------------------------- - virtual void append_create_info(String *packet) - */ -+#ifdef WITH_WSREP -+ virtual int wsrep_db_type() const; -+#endif /* WITH_WSREP */ - }; - - #endif /* HA_PARTITION_INCLUDED */ -diff --git a/sql/handler.cc b/sql/handler.cc -index f91c04c..e39e0d8 100644 ---- a/sql/handler.cc -+++ b/sql/handler.cc -@@ -60,7 +60,9 @@ inline double log2(double x) - return (log(x) / M_LN2); - } - #endif -- -+#ifdef WITH_WSREP -+#include "wsrep_mysqld.h" -+#endif - /* - While we have legacy_db_type, we have this array to - check for dups and to find handlerton from legacy_db_type. -@@ -1219,10 +1221,27 @@ int ha_prepare(THD *thd) - { - if ((err= ht->prepare(ht, thd, all))) - { -+#ifdef WITH_WSREP -+ if (WSREP(thd) && ht->db_type== DB_TYPE_WSREP) -+ { -+ error= 1; -+ /* avoid sending error, if we need to replay */ -+ if (thd->wsrep_conflict_state!= MUST_REPLAY) -+ { -+ my_error(ER_LOCK_DEADLOCK, MYF(0), err); -+ } -+ } -+ else -+ { -+ /* not wsrep hton, bail to native mysql behavior */ -+#endif - my_error(ER_ERROR_DURING_COMMIT, MYF(0), err); - ha_rollback_trans(thd, all); - error=1; - break; -+#ifdef WITH_WSREP -+ } -+#endif - } - } - else -@@ -1233,7 +1252,6 @@ int ha_prepare(THD *thd) - } - } - } -- - DBUG_RETURN(error); - } - -@@ -1408,7 +1426,12 @@ int ha_commit_trans(THD *thd, bool all, bool ignore_global_read_lock) - MDL_EXPLICIT); - - DBUG_PRINT("debug", ("Acquire MDL commit lock")); -+#ifdef WITH_WSREP -+ if (!WSREP(thd) && -+ thd->mdl_context.acquire_lock(&mdl_request, -+#else - if (thd->mdl_context.acquire_lock(&mdl_request, -+#endif /* WITH_WSREP */ - thd->variables.lock_wait_timeout)) - { - ha_rollback_trans(thd, all); -@@ -1482,7 +1505,19 @@ int ha_commit_low(THD *thd, bool all, bool run_after_commit) - int error=0; - THD_TRANS *trans=all ? &thd->transaction.all : &thd->transaction.stmt; - Ha_trx_info *ha_info= trans->ha_list, *ha_info_next; -+ - DBUG_ENTER("ha_commit_low"); -+#ifdef WITH_WSREP -+#ifdef WSREP_PROC_INFO -+ char info[64]= { 0, }; -+ snprintf (info, sizeof(info) - 1, "ha_commit_one_phase(%lld)", -+ (long long)wsrep_thd_trx_seqno(thd)); -+#else -+ const char info[]="ha_commit_one_phase()"; -+#endif /* WSREP_PROC_INFO */ -+ char* tmp_info= NULL; -+ if (WSREP(thd)) tmp_info= (char *)thd_proc_info(thd, info); -+#endif /* WITH_WSREP */ - - if (ha_info) - { -@@ -1513,6 +1548,9 @@ int ha_commit_low(THD *thd, bool all, bool run_after_commit) - /* Free resources and perform other cleanup even for 'empty' transactions. */ - if (all) - thd->transaction.cleanup(); -+#ifdef WITH_WSREP -+ if (WSREP(thd)) thd_proc_info(thd, tmp_info); -+#endif /* WITH_WSREP */ - /* - When the transaction has been committed, we clear the commit_low - flag. This allow other parts of the system to check if commit_low -@@ -1798,7 +1836,13 @@ static my_bool xarecover_handlerton(THD *unused, plugin_ref plugin, - got, ha_resolve_storage_engine_name(hton)); - for (int i=0; i < got; i ++) - { -+#ifdef WITH_WSREP -+ my_xid x=(wsrep_is_wsrep_xid(&info->list[i]) ? -+ wsrep_xid_seqno(&info->list[i]) : -+ info->list[i].get_my_xid()); -+#else - my_xid x=info->list[i].get_my_xid(); -+#endif /* WITH_WSREP */ - if (!x) // not "mine" - that is generated by external TM - { - #ifndef DBUG_OFF -@@ -1867,7 +1911,9 @@ int ha_recover(HASH *commit_list) - for now, only InnoDB supports 2pc. It means we can always safely - rollback all pending transactions, without risking inconsistent data - */ -+#ifndef WITH_WSREP - DBUG_ASSERT(total_ha_2pc == (ulong) opt_bin_log+1); // only InnoDB and binlog -+#endif - tc_heuristic_recover= TC_HEURISTIC_RECOVER_ROLLBACK; // forcing ROLLBACK - info.dry_run=FALSE; - #endif -@@ -2103,8 +2149,35 @@ int ha_prepare_low(THD *thd, bool all) - continue; - if ((err= ht->prepare(ht, thd, all))) - { -+#ifdef WITH_WSREP -+ if (WSREP(thd) && ht->db_type== DB_TYPE_WSREP) -+ { -+ error= 1; -+ switch (err) -+ { -+ case WSREP_TRX_SIZE_EXCEEDED: -+ /* give user size exeeded erro from wsrep_api.h */ -+ my_error(ER_ERROR_DURING_COMMIT, MYF(0), WSREP_SIZE_EXCEEDED); -+ break; -+ case WSREP_TRX_CERT_FAIL: -+ case WSREP_TRX_ERROR: -+ /* avoid sending error, if we need to replay */ -+ if (thd->wsrep_conflict_state!= MUST_REPLAY) -+ { -+ my_error(ER_LOCK_DEADLOCK, MYF(0), err); -+ } -+ } -+ } -+ -+ else -+ { -+ /* not wsrep hton, bail to native mysql behavior */ -+#endif - my_error(ER_ERROR_DURING_COMMIT, MYF(0), err); - error= 1; -+#ifdef WITH_WSREP -+ } -+#endif - } - status_var_increment(thd->status_var.ha_prepare_count); - } -@@ -3336,7 +3409,12 @@ int handler::update_auto_increment() - variables->auto_increment_increment); - auto_inc_intervals_count++; - /* Row-based replication does not need to store intervals in binlog */ -+#ifdef WITH_WSREP -+ if (((WSREP_EMULATE_BINLOG(thd)) || mysql_bin_log.is_open()) && -+ !thd->is_current_stmt_binlog_format_row()) -+#else - if (mysql_bin_log.is_open() && !thd->is_current_stmt_binlog_format_row()) -+#endif /* WITH_WSREP */ - thd->auto_inc_intervals_in_cur_stmt_for_binlog.append(auto_inc_interval_for_cur_row.minimum(), - auto_inc_interval_for_cur_row.values(), - variables->auto_increment_increment); -@@ -4621,7 +4699,9 @@ int ha_enable_transaction(THD *thd, bool on) - int error=0; - DBUG_ENTER("ha_enable_transaction"); - DBUG_PRINT("enter", ("on: %d", (int) on)); -- -+#ifdef WITH_WSREP -+ if (thd->wsrep_applier) DBUG_RETURN(0); -+#endif - if ((thd->transaction.flags.enabled= on)) - { - /* -@@ -7017,7 +7097,13 @@ static bool check_table_binlog_row_based(THD *thd, TABLE *table) - return (thd->is_current_stmt_binlog_format_row() && - table->s->cached_row_logging_check && - (thd->variables.option_bits & OPTION_BIN_LOG) && -+#ifdef WITH_WSREP -+ /* applier and replayer should not binlog */ -+ ((WSREP_EMULATE_BINLOG(thd) && (thd->wsrep_exec_mode != REPL_RECV)) || -+ mysql_bin_log.is_open())); -+#else - mysql_bin_log.is_open()); -+#endif - } - - -@@ -7118,6 +7204,17 @@ int binlog_log_row(TABLE* table, - bool error= 0; - THD *const thd= table->in_use; - -+#ifdef WITH_WSREP -+ /* only InnoDB tables will be replicated through binlog emulation */ -+ if (WSREP_EMULATE_BINLOG(thd) && -+ table->file->ht->db_type != DB_TYPE_INNODB && -+ !(table->file->ht->db_type == DB_TYPE_PARTITION_DB && -+ (((ha_partition*)(table->file))->wsrep_db_type() == DB_TYPE_INNODB))) -+ // !strcmp(table->file->table_type(), "InnoDB")) -+ { -+ return 0; -+ } -+#endif /* WITH_WSREP */ - if (check_table_binlog_row_based(thd, table)) - { - DBUG_DUMP("read_set 10", (uchar*) table->read_set->bitmap, -@@ -7438,6 +7535,64 @@ void signal_log_not_needed(struct handlerton, char *log_file) - DBUG_VOID_RETURN; - } - -+#ifdef WITH_WSREP -+/** -+ @details -+ This function makes the storage engine to force the victim transaction -+ to abort. Currently, only innodb has this functionality, but any SE -+ implementing the wsrep API should provide this service to support -+ multi-master operation. -+ -+ @param bf_thd brute force THD asking for the abort -+ @param victim_thd victim THD to be aborted -+ -+ @return -+ always 0 -+*/ -+ -+int ha_wsrep_abort_transaction(THD *bf_thd, THD *victim_thd, my_bool signal) -+{ -+ DBUG_ENTER("ha_wsrep_abort_transaction"); -+ if (!WSREP(bf_thd) && -+ !(wsrep_OSU_method_options == WSREP_OSU_RSU && -+ bf_thd->wsrep_exec_mode == TOTAL_ORDER)) { -+ DBUG_RETURN(0); -+ } -+ -+ handlerton *hton= installed_htons[DB_TYPE_INNODB]; -+ if (hton && hton->wsrep_abort_transaction) -+ { -+ hton->wsrep_abort_transaction(hton, bf_thd, victim_thd, signal); -+ } -+ else -+ { -+ WSREP_WARN("cannot abort InnoDB transaction"); -+ } -+ -+ DBUG_RETURN(0); -+} -+ -+void ha_wsrep_fake_trx_id(THD *thd) -+{ -+ DBUG_ENTER("ha_wsrep_fake_trx_id"); -+ if (!WSREP(thd)) -+ { -+ DBUG_VOID_RETURN; -+ } -+ -+ handlerton *hton= installed_htons[DB_TYPE_INNODB]; -+ if (hton && hton->wsrep_fake_trx_id) -+ { -+ hton->wsrep_fake_trx_id(hton, thd); -+ } -+ else -+ { -+ WSREP_WARN("cannot get get fake InnoDB transaction ID"); -+ } -+ -+ DBUG_VOID_RETURN; -+} -+#endif /* WITH_WSREP */ - #ifdef TRANS_LOG_MGM_EXAMPLE_CODE - /* - Example of transaction log management functions based on assumption that logs -diff --git a/sql/handler.h b/sql/handler.h -index 3d7d4fa..702b291 100644 ---- a/sql/handler.h -+++ b/sql/handler.h -@@ -392,6 +392,7 @@ enum legacy_db_type - DB_TYPE_MARIA, - /** Performance schema engine. */ - DB_TYPE_PERFORMANCE_SCHEMA, -+ DB_TYPE_WSREP, - DB_TYPE_FIRST_DYNAMIC=42, - DB_TYPE_DEFAULT=127 // Must be last - }; -@@ -924,6 +925,11 @@ struct handlerton - const char *wild, bool dir, List *files); - int (*table_exists_in_engine)(handlerton *hton, THD* thd, const char *db, - const char *name); -+ int (*wsrep_abort_transaction)(handlerton *hton, THD *bf_thd, -+ THD *victim_thd, my_bool signal); -+ int (*wsrep_set_checkpoint)(handlerton *hton, const XID* xid); -+ int (*wsrep_get_checkpoint)(handlerton *hton, XID* xid); -+ void (*wsrep_fake_trx_id)(handlerton *hton, THD *thd); - int (*make_pushed_join)(handlerton *hton, THD* thd, - const AQP::Join_plan* plan); - -@@ -3332,6 +3338,9 @@ private: - extern const char *ha_row_type[]; - extern MYSQL_PLUGIN_IMPORT const char *tx_isolation_names[]; - extern MYSQL_PLUGIN_IMPORT const char *binlog_format_names[]; -+#ifdef WITH_WSREP -+extern MYSQL_PLUGIN_IMPORT const char *wsrep_binlog_format_names[]; -+#endif /* WITH_WSREP */ - extern TYPELIB tx_isolation_typelib; - extern const char *myisam_stats_method_names[]; - extern ulong total_ha, total_ha_2pc; -@@ -3440,6 +3449,10 @@ int ha_rollback_to_savepoint(THD *thd, SAVEPOINT *sv); - bool ha_rollback_to_savepoint_can_release_mdl(THD *thd); - int ha_savepoint(THD *thd, SAVEPOINT *sv); - int ha_release_savepoint(THD *thd, SAVEPOINT *sv); -+#ifdef WITH_WSREP -+int ha_wsrep_abort_transaction(THD *bf_thd, THD *victim_thd, my_bool signal); -+void ha_wsrep_fake_trx_id(THD *thd); -+#endif /* WITH_WSREP */ - - /* Build pushed joins in handlers implementing this feature */ - int ha_make_pushed_joins(THD *thd, const AQP::Join_plan* plan); -@@ -3471,6 +3484,12 @@ void ha_binlog_wait(THD *thd); - #define ha_binlog_log_query(a,b,c,d,e,f,g) do {} while (0) - #define ha_binlog_wait(a) do {} while (0) - #endif -+#ifdef WITH_WSREP -+void wsrep_brute_force_aborts(); -+#endif -+ -+/* It is required by basic binlog features on both MySQL server and libmysqld */ -+int ha_binlog_end(THD *thd); - - /* It is required by basic binlog features on both MySQL server and libmysqld */ - int ha_binlog_end(THD *thd); -diff --git a/sql/item_func.cc b/sql/item_func.cc -index e5ff0b8..9030a02 100644 ---- a/sql/item_func.cc -+++ b/sql/item_func.cc -@@ -2618,7 +2618,19 @@ void Item_func_rand::seed_random(Item *arg) - TODO: do not do reinit 'rand' for every execute of PS/SP if - args[0] is a constant. - */ -+#ifdef WITH_WSREP -+ uint32 tmp; -+ if (WSREP(current_thd)) -+ { -+ if (current_thd->wsrep_exec_mode==REPL_RECV) -+ tmp= current_thd->wsrep_rand; -+ else -+ tmp= current_thd->wsrep_rand= (uint32) arg->val_int(); -+ } else -+ tmp= (uint32) arg->val_int(); -+#else - uint32 tmp= (uint32) arg->val_int(); -+#endif - randominit(rand, (uint32) (tmp*0x10001L+55555555L), - (uint32) (tmp*0x10000001L)); - } -diff --git a/sql/lock.cc b/sql/lock.cc -index 43f2773..e3f613d 100644 ---- a/sql/lock.cc -+++ b/sql/lock.cc -@@ -83,6 +83,10 @@ - #include - #include - -+#ifdef WITH_WSREP -+#include "wsrep_mysqld.h" -+#endif /* WITH_WSREP */ -+ - /** - @defgroup Locking Locking - @{ -@@ -314,6 +318,10 @@ MYSQL_LOCK *mysql_lock_tables(THD *thd, TABLE **tables, uint count, uint flags) - /* Copy the lock data array. thr_multi_lock() reorders its contents. */ - memcpy(sql_lock->locks + sql_lock->lock_count, sql_lock->locks, - sql_lock->lock_count * sizeof(*sql_lock->locks)); -+#ifdef WITH_WSREP -+ //thd->main_lock_id.info->in_lock_tables= thd->in_lock_tables; -+ thd->lock_info.in_lock_tables= thd->in_lock_tables; -+#endif /* Lock on the copied half of the lock data array. */ - /* Lock on the copied half of the lock data array. */ - rc= thr_lock_errno_to_mysql[(int) thr_multi_lock(sql_lock->locks + - sql_lock->lock_count, -@@ -1014,11 +1022,15 @@ void Global_read_lock::unlock_global_read_lock(THD *thd) - { - thd->mdl_context.release_lock(m_mdl_blocks_commits_lock); - m_mdl_blocks_commits_lock= NULL; -+#ifdef WITH_WSREP -+ wsrep_locked_seqno= WSREP_SEQNO_UNDEFINED; -+ wsrep->resume(wsrep); -+#endif /* WITH_WSREP */ - } - thd->mdl_context.release_lock(m_mdl_global_shared_lock); - m_mdl_global_shared_lock= NULL; - m_state= GRL_NONE; -- -+ - DBUG_VOID_RETURN; - } - -@@ -1046,6 +1058,20 @@ bool Global_read_lock::make_global_read_lock_block_commit(THD *thd) - If we didn't succeed lock_global_read_lock(), or if we already suceeded - make_global_read_lock_block_commit(), do nothing. - */ -+ -+#ifdef WITH_WSREP -+ if (m_mdl_blocks_commits_lock) -+ { -+ WSREP_DEBUG("GRL was in block commit mode when entering " -+ "make_global_read_lock_block_commit"); -+ thd->mdl_context.release_lock(m_mdl_blocks_commits_lock); -+ m_mdl_blocks_commits_lock= NULL; -+ wsrep_locked_seqno= WSREP_SEQNO_UNDEFINED; -+ wsrep->resume(wsrep); -+ m_state= GRL_ACQUIRED; -+ } -+#endif /* WITH_WSREP */ -+ - if (m_state != GRL_ACQUIRED) - DBUG_RETURN(0); - -@@ -1058,6 +1084,22 @@ bool Global_read_lock::make_global_read_lock_block_commit(THD *thd) - m_mdl_blocks_commits_lock= mdl_request.ticket; - m_state= GRL_ACQUIRED_AND_BLOCKS_COMMIT; - -+#ifdef WITH_WSREP -+ long long ret = wsrep->pause(wsrep); -+ if (ret >= 0) -+ { -+ wsrep_locked_seqno= ret; -+ } -+ else if (ret != -ENOSYS) /* -ENOSYS - no provider */ -+ { -+ WSREP_ERROR("Failed to pause provider: %lld (%s)", -ret, strerror(-ret)); -+ -+ /* m_mdl_blocks_commits_lock is always NULL here */ -+ wsrep_locked_seqno= WSREP_SEQNO_UNDEFINED; -+ my_error(ER_LOCK_DEADLOCK, MYF(0)); -+ DBUG_RETURN(TRUE); -+ } -+#endif /* WITH_WSREP */ - DBUG_RETURN(FALSE); - } - -diff --git a/sql/log.cc b/sql/log.cc -index 808c176..caa23d2 100644 ---- a/sql/log.cc -+++ b/sql/log.cc -@@ -39,6 +39,9 @@ - #include - #include - #include // For test_if_number -+#ifdef WITH_WSREP -+#include "wsrep_mysqld.h" -+#endif /* WITH_WSREP */ - - #ifdef _WIN32 - #include "message.h" -@@ -300,7 +303,6 @@ bool LOGGER::is_log_table_enabled(uint log_table_type) - } - } - -- - /* Check if a given table is opened log table */ - int check_if_log_table(size_t db_len, const char *db, size_t table_name_len, - const char *table_name, bool check_if_opened) -@@ -2435,6 +2437,7 @@ int my_plugin_log_message(MYSQL_PLUGIN *plugin_ptr, plugin_log_level level, - - /********* transaction coordinator log for 2pc - mmap() based solution *******/ - -+ - /* - the log consists of a file, mmapped to a memory. - file is divided on pages of tc_log_page_size size. -@@ -2550,8 +2553,14 @@ int TC_LOG_MMAP::open(const char *opt_name) - mysql_mutex_init(key_PAGE_lock, &pg->lock, MY_MUTEX_INIT_FAST); - mysql_cond_init(key_PAGE_cond, &pg->cond, 0); - pg->start=(my_xid *)(data + i*tc_log_page_size); -+#ifdef WITH_WSREP -+ if (!WSREP_ON) -+#endif /* WITH_WSREP */ - pg->end=(my_xid *)(pg->start + tc_log_page_size); - pg->size=pg->free=tc_log_page_size/sizeof(my_xid); -+#ifdef WITH_WSREP -+ if (WSREP_ON) pg->end=pg->start + pg->size; -+#endif /* WITH_WSREP */ - } - pages[0].size=pages[0].free= - (tc_log_page_size-TC_LOG_HEADER_SIZE)/sizeof(my_xid); -diff --git a/sql/log.h b/sql/log.h -index 6536c9e..aaefce9 100644 ---- a/sql/log.h -+++ b/sql/log.h -@@ -104,6 +104,14 @@ class TC_LOG - virtual int prepare(THD *thd, bool all) = 0; - }; - -+#ifdef WITH_WSREP -+/* -+ Wrappers to MYSQL_BIN_LOG commit()/rollback() when wsrep_emulate_bin_log -+ is on. -+ */ -+TC_LOG::enum_result wsrep_thd_binlog_commit(THD* thd, bool all); -+int wsrep_thd_binlog_rollback(THD * thd, bool all); -+#endif /* WITH_WSREP */ - - class TC_LOG_DUMMY: public TC_LOG // use it to disable the logging - { -@@ -112,10 +120,18 @@ public: - int open(const char *opt_name) { return 0; } - void close() { } - enum_result commit(THD *thd, bool all) { -+#ifdef WITH_WSREP -+ return wsrep_thd_binlog_commit(thd, all); -+#else - return ha_commit_low(thd, all) ? RESULT_ABORTED : RESULT_SUCCESS; -+#endif /* WITH_WSREP */ - } - int rollback(THD *thd, bool all) { -+#ifdef WITH_WSREP -+ return wsrep_thd_binlog_rollback(thd, all); -+#else - return ha_rollback_low(thd, all); -+#endif /* WITH_WSREP */ - } - int prepare(THD *thd, bool all) { - return ha_prepare_low(thd, all); -@@ -542,12 +558,28 @@ enum enum_binlog_row_image { - }; - - enum enum_binlog_format { -+ /* -+ statement-based except for cases where only row-based can work (UUID() -+ etc): -+ */ - BINLOG_FORMAT_MIXED= 0, ///< statement if safe, otherwise row - autodetected - BINLOG_FORMAT_STMT= 1, ///< statement-based - BINLOG_FORMAT_ROW= 2, ///< row-based - BINLOG_FORMAT_UNSPEC=3 ///< thd_binlog_format() returns it when binlog is closed - }; - -+#ifdef WITH_WSREP -+IO_CACHE* get_trans_log(THD * thd); -+bool wsrep_trans_cache_is_empty(THD *thd); -+void thd_binlog_flush_pending_rows_event(THD *thd, bool stmt_end); -+void thd_binlog_trx_reset(THD * thd); -+ -+#define WSREP_BINLOG_FORMAT(my_format) \ -+ ((wsrep_forced_binlog_format != BINLOG_FORMAT_UNSPEC) ? \ -+ wsrep_forced_binlog_format : my_format) -+#else -+#define WSREP_BINLOG_FORMAT(my_format) my_format -+#endif /* WITH_WSREP */ - int query_error_code(THD *thd, bool not_killed); - uint purge_log_get_error_code(int res); - -diff --git a/sql/log_event.cc b/sql/log_event.cc -index d4176cb..9173566 100644 ---- a/sql/log_event.cc -+++ b/sql/log_event.cc -@@ -45,6 +45,9 @@ - #include "rpl_rli_pdb.h" - #include "sql_show.h" // append_identifier - #include -+#if WITH_WSREP -+#include "wsrep_mysqld.h" -+#endif - #define window_size Log_throttle::LOG_THROTTLE_WINDOW_SIZE - Error_log_throttle - slave_ignored_err_throttle(window_size, -@@ -3583,6 +3586,14 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg, - master_data_written(0), mts_accessed_dbs(0) - { - -+#ifdef WITH_WSREP -+ /* -+ If Query_log_event will contain non trans keyword (not BEGIN, COMMIT, -+ SAVEPOINT or ROLLBACK) we disable PA for this transaction. -+ */ -+ if (!is_trans_keyword()) -+ thd->wsrep_PA_safe= false; -+#endif /* WITH_WSREP */ - memset(&user, 0, sizeof(user)); - memset(&host, 0, sizeof(host)); - -@@ -11160,6 +11171,18 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli) - if (open_and_lock_tables(thd, rli->tables_to_lock, FALSE, 0)) - { - uint actual_error= thd->get_stmt_da()->sql_errno(); -+#ifdef WITH_WSREP -+ if (WSREP(thd)) -+ { -+ WSREP_WARN("BF applier failed to open_and_lock_tables: %u, fatal: %d " -+ "wsrep = (exec_mode: %d conflict_state: %d seqno: %lld)", -+ thd->get_stmt_da()->sql_errno(), -+ thd->is_fatal_error, -+ thd->wsrep_exec_mode, -+ thd->wsrep_conflict_state, -+ (long long)wsrep_thd_trx_seqno(thd)); -+ } -+#endif - if (thd->is_slave_error || thd->is_fatal_error) - { - /* -@@ -12132,7 +12155,12 @@ check_table_map(Relay_log_info const *rli, RPL_TABLE_LIST *table_list) - DBUG_ENTER("check_table_map"); - enum_tbl_map_status res= OK_TO_PROCESS; - -+#ifdef WITH_WSREP -+ if ((rli->info_thd->slave_thread /* filtering is for slave only */ || -+ (WSREP(rli->info_thd) && rli->info_thd->wsrep_applier)) && -+#else - if (rli->info_thd->slave_thread /* filtering is for slave only */ && -+#endif /* WITH_WSREP */ - (!rpl_filter->db_ok(table_list->db) || - (rpl_filter->is_on() && !rpl_filter->tables_ok("", table_list)))) - res= FILTERED_OUT; -@@ -12865,8 +12893,23 @@ int - Write_rows_log_event::do_exec_row(const Relay_log_info *const rli) - { - DBUG_ASSERT(m_table != NULL); -+#ifdef WITH_WSREP -+#ifdef WSREP_PROC_INFO -+ char info[64]; -+ info[sizeof(info) - 1] = '\0'; -+ snprintf(info, sizeof(info) - 1, "Write_rows_log_event::write_row(%lld)", -+ (long long) wsrep_thd_trx_seqno(thd)); -+ const char* tmp = (WSREP(thd)) ? thd_proc_info(thd, info) : NULL; -+#else -+ const char* tmp = (WSREP(thd)) ? -+ thd_proc_info(thd,"Write_rows_log_event::write_row()") : NULL; -+#endif /* WSREP_PROC_INFO */ -+#endif /* WITH_WSREP */ - int error= write_row(rli, slave_exec_mode == SLAVE_EXEC_MODE_IDEMPOTENT); - -+#ifdef WITH_WSREP -+ if (WSREP(thd)) thd_proc_info(thd, tmp); -+#endif /* WITH_WSREP */ - if (error && !thd->is_error()) - { - DBUG_ASSERT(0); -diff --git a/sql/mdl.cc b/sql/mdl.cc -index 70a33ab..ea79bec 100644 ---- a/sql/mdl.cc -+++ b/sql/mdl.cc -@@ -24,6 +24,17 @@ - #include - #include - -+#ifdef WITH_WSREP -+#include "wsrep_mysqld.h" -+#include "wsrep_thd.h" -+extern "C" my_thread_id wsrep_thd_thread_id(THD *thd); -+extern "C" char *wsrep_thd_query(THD *thd); -+void sql_print_information(const char *format, ...) -+ ATTRIBUTE_FORMAT(printf, 1, 2); -+extern bool -+wsrep_grant_mdl_exception(MDL_context *requestor_ctx, -+ MDL_ticket *ticket); -+#endif /* WITH_WSREP */ - #ifdef HAVE_PSI_INTERFACE - static PSI_mutex_key key_MDL_map_mutex; - static PSI_mutex_key key_MDL_wait_LOCK_wait_status; -@@ -1389,11 +1400,54 @@ void MDL_lock::Ticket_list::add_ticket(MDL_ticket *ticket) - called by other threads. - */ - DBUG_ASSERT(ticket->get_lock()); -+#ifdef WITH_WSREP -+ if ((this == &(ticket->get_lock()->m_waiting)) && -+ wsrep_thd_is_BF((void *)(ticket->get_ctx()->wsrep_get_thd()), false)) -+ { -+ Ticket_iterator itw(ticket->get_lock()->m_waiting); -+ Ticket_iterator itg(ticket->get_lock()->m_granted); -+ -+ MDL_ticket *waiting, *granted; -+ MDL_ticket *prev=NULL; -+ bool added= false; -+ -+ while ((waiting= itw++) && !added) -+ { -+ if (!wsrep_thd_is_BF((void *)(waiting->get_ctx()->wsrep_get_thd()), true)) -+ { -+ WSREP_DEBUG("MDL add_ticket inserted before: %lu %s", -+ wsrep_thd_thread_id(waiting->get_ctx()->wsrep_get_thd()), -+ wsrep_thd_query(waiting->get_ctx()->wsrep_get_thd())); -+ m_list.insert_after(prev, ticket); -+ added= true; -+ } -+ prev= waiting; -+ } -+ if (!added) m_list.push_back(ticket); -+ -+ while ((granted= itg++)) -+ { -+ if (granted->get_ctx() != ticket->get_ctx() && -+ granted->is_incompatible_when_granted(ticket->get_type())) -+ { -+ if (!wsrep_grant_mdl_exception(ticket->get_ctx(), granted)) -+ { -+ WSREP_DEBUG("MDL victim killed at add_ticket"); -+ } -+ } -+ } -+ } -+ else -+ { -+#endif /* WITH_WSREP */ - /* - Add ticket to the *back* of the queue to ensure fairness - among requests with the same priority. - */ - m_list.push_back(ticket); -+#ifdef WITH_WSREP -+ } -+#endif /* WITH_WSREP */ - m_bitmap|= MDL_BIT(ticket->get_type()); - } - -@@ -1709,7 +1763,6 @@ MDL_object_lock::m_waiting_incompatible[MDL_TYPE_END] = - 0 - }; - -- - /** - Check if request for the metadata lock can be satisfied given its - current state. -@@ -1734,6 +1787,9 @@ MDL_lock::can_grant_lock(enum_mdl_type type_arg, - bool can_grant= FALSE; - bitmap_t waiting_incompat_map= incompatible_waiting_types_bitmap()[type_arg]; - bitmap_t granted_incompat_map= incompatible_granted_types_bitmap()[type_arg]; -+#ifdef WITH_WSREP -+ bool wsrep_can_grant= TRUE; -+#endif /* WITH_WSREP */ - - /* - New lock request can be satisfied iff: -@@ -1756,12 +1812,59 @@ MDL_lock::can_grant_lock(enum_mdl_type type_arg, - { - if (ticket->get_ctx() != requestor_ctx && - ticket->is_incompatible_when_granted(type_arg)) -+#ifdef WITH_WSREP -+ { -+ if (wsrep_thd_is_BF((void *)(requestor_ctx->wsrep_get_thd()),false) && -+ key.mdl_namespace() == MDL_key::GLOBAL) -+ { -+ WSREP_DEBUG("global lock granted for BF: %lu %s", -+ wsrep_thd_thread_id(requestor_ctx->wsrep_get_thd()), -+ wsrep_thd_query(requestor_ctx->wsrep_get_thd())); -+ can_grant = true; -+ } -+ else if (!wsrep_grant_mdl_exception(requestor_ctx, ticket)) -+ { -+ wsrep_can_grant= FALSE; -+ if (wsrep_log_conflicts) -+ { -+ MDL_lock * lock = ticket->get_lock(); -+ WSREP_INFO( -+ "MDL conflict db=%s table=%s ticket=%d solved by %s", -+ lock->key.db_name(), lock->key.name(), ticket->get_type(), "abort" -+ ); -+ } -+ } -+ else -+ { -+ can_grant= TRUE; -+ } -+ } -+#else - break; -+#endif /* WITH_WSREP */ - } -+#ifdef WITH_WSREP -+ if ((ticket == NULL) && wsrep_can_grant) -+#else - if (ticket == NULL) /* Incompatible locks are our own. */ -+#endif /* WITH_WSREP */ -+ - can_grant= TRUE; - } - } -+#ifdef WITH_WSREP -+ else -+ { -+ if (wsrep_thd_is_BF((void *)(requestor_ctx->wsrep_get_thd()), false) && -+ key.mdl_namespace() == MDL_key::GLOBAL) -+ { -+ WSREP_DEBUG("global lock granted for BF (waiting queue): %lu %s", -+ wsrep_thd_thread_id(requestor_ctx->wsrep_get_thd()), -+ wsrep_thd_query(requestor_ctx->wsrep_get_thd())); -+ can_grant = true; -+ } -+ } -+#endif /* WITH_WSREP */ - return can_grant; - } - -@@ -2780,6 +2883,12 @@ void MDL_context::release_locks_stored_before(enum_mdl_duration duration, - } - - -+#ifdef WITH_WSREP -+void MDL_context::release_explicit_locks() -+{ -+ release_locks_stored_before(MDL_EXPLICIT, NULL); -+} -+#endif - /** - Release all explicit locks in the context which correspond to the - same name/object as this lock request. -@@ -3068,3 +3177,32 @@ void MDL_context::set_transaction_duration_for_all_locks() - ticket->m_duration= MDL_TRANSACTION; - #endif - } -+#ifdef WITH_WSREP -+void MDL_ticket::wsrep_report(bool debug) -+{ -+ if (debug) -+ { -+ WSREP_DEBUG("MDL ticket: type: %s space: %s db: %s name: %s", -+ (get_type() == MDL_INTENTION_EXCLUSIVE) ? "intention exclusive" : -+ ((get_type() == MDL_SHARED) ? "shared" : -+ ((get_type() == MDL_SHARED_HIGH_PRIO ? "shared high prio" : -+ ((get_type() == MDL_SHARED_READ) ? "shared read" : -+ ((get_type() == MDL_SHARED_WRITE) ? "shared write" : -+ ((get_type() == MDL_SHARED_NO_WRITE) ? "shared no write" : -+ ((get_type() == MDL_SHARED_NO_READ_WRITE) ? "shared no read write" : -+ ((get_type() == MDL_EXCLUSIVE) ? "exclusive" : -+ "UNKNOWN")))))))), -+ (m_lock->key.mdl_namespace() == MDL_key::GLOBAL) ? "GLOBAL" : -+ ((m_lock->key.mdl_namespace() == MDL_key::SCHEMA) ? "SCHEMA" : -+ ((m_lock->key.mdl_namespace() == MDL_key::TABLE) ? "TABLE" : -+ ((m_lock->key.mdl_namespace() == MDL_key::TABLE) ? "FUNCTION" : -+ ((m_lock->key.mdl_namespace() == MDL_key::TABLE) ? "PROCEDURE" : -+ ((m_lock->key.mdl_namespace() == MDL_key::TABLE) ? "TRIGGER" : -+ ((m_lock->key.mdl_namespace() == MDL_key::TABLE) ? "EVENT" : -+ ((m_lock->key.mdl_namespace() == MDL_key::COMMIT) ? "COMMIT" : -+ (char *)"UNKNOWN"))))))), -+ m_lock->key.db_name(), -+ m_lock->key.name()); -+ } -+} -+#endif /* WITH_WSREP */ -diff --git a/sql/mdl.h b/sql/mdl.h -index ddbd55a..2d2502e 100644 ---- a/sql/mdl.h -+++ b/sql/mdl.h -@@ -577,6 +577,9 @@ public: - MDL_ticket *next_in_lock; - MDL_ticket **prev_in_lock; - public: -+#ifdef WITH_WSREP -+ void wsrep_report(bool debug); -+#endif /* WITH_WSREP */ - bool has_pending_conflicting_lock() const; - - MDL_context *get_ctx() const { return m_ctx; } -@@ -763,6 +766,13 @@ public: - m_tickets[MDL_EXPLICIT].is_empty()); - } - -+#ifdef WITH_WSREP -+ inline bool has_transactional_locks() const -+ { -+ return !m_tickets[MDL_TRANSACTION].is_empty(); -+ } -+#endif /* WITH_WSREP */ -+ - MDL_savepoint mdl_savepoint() - { - return MDL_savepoint(m_tickets[MDL_STATEMENT].front(), -@@ -775,6 +785,9 @@ public: - - void release_statement_locks(); - void release_transactional_locks(); -+#ifdef WITH_WSREP -+ void release_explicit_locks(); -+#endif - void rollback_to_savepoint(const MDL_savepoint &mdl_savepoint); - - MDL_context_owner *get_owner() { return m_owner; } -@@ -908,6 +921,9 @@ private: - MDL_ticket **out_ticket); - - public: -+#ifdef WITH_WSREP -+ THD *wsrep_get_thd() const { return get_thd(); } -+#endif /* WITH_WSREP */ - void find_deadlock(); - - bool visit_subgraph(MDL_wait_for_graph_visitor *dvisitor); -diff --git a/sql/mysqld.cc b/sql/mysqld.cc -index fa68613..8ed210f 100644 ---- a/sql/mysqld.cc -+++ b/sql/mysqld.cc -@@ -72,6 +72,12 @@ - #include "probes_mysql.h" - #include "scheduler.h" - #include "debug_sync.h" -+#ifdef WITH_WSREP -+#include "wsrep_mysqld.h" -+#include "wsrep_var.h" -+#include "wsrep_thd.h" -+#include "wsrep_sst.h" -+#endif - #include "sql_callback.h" - #include "opt_trace_context.h" - -@@ -483,6 +489,10 @@ ulong binlog_checksum_options; - my_bool opt_master_verify_checksum= 0; - my_bool opt_slave_sql_verify_checksum= 1; - const char *binlog_format_names[]= {"MIXED", "STATEMENT", "ROW", NullS}; -+#ifdef WITH_WSREP -+const char *wsrep_binlog_format_names[]= -+ {"MIXED", "STATEMENT", "ROW", "NONE", NullS}; -+#endif /*WITH_WSREP */ - my_bool enforce_gtid_consistency; - my_bool binlog_gtid_simple_recovery; - ulong binlog_error_action; -@@ -747,6 +757,23 @@ pthread_attr_t connection_attrib; - mysql_mutex_t LOCK_server_started; - mysql_cond_t COND_server_started; - -+#ifdef WITH_WSREP -+mysql_mutex_t LOCK_wsrep_ready; -+mysql_cond_t COND_wsrep_ready; -+mysql_mutex_t LOCK_wsrep_sst; -+mysql_cond_t COND_wsrep_sst; -+mysql_mutex_t LOCK_wsrep_sst_init; -+mysql_cond_t COND_wsrep_sst_init; -+mysql_mutex_t LOCK_wsrep_rollback; -+mysql_cond_t COND_wsrep_rollback; -+wsrep_aborting_thd_t wsrep_aborting_thd= NULL; -+mysql_mutex_t LOCK_wsrep_replaying; -+mysql_cond_t COND_wsrep_replaying; -+mysql_mutex_t LOCK_wsrep_slave_threads; -+mysql_mutex_t LOCK_wsrep_desync; -+int wsrep_replaying= 0; -+static void wsrep_close_threads(THD* thd); -+#endif /* WITH_WSREP */ - int mysqld_server_started= 0; - - File_parser_dummy_hook file_parser_dummy_hook; -@@ -1209,7 +1236,9 @@ bool mysqld_embedded=0; - bool mysqld_embedded=1; - #endif - -+#ifndef EMBEDDED_LIBRARY - static my_bool plugins_are_initialized= FALSE; -+#endif - - #ifndef DBUG_OFF - static const char* default_dbug_option; -@@ -1421,6 +1450,11 @@ static void close_connections(void) - /* We skip slave threads & scheduler on this first loop through. */ - if (tmp->slave_thread) - continue; -+#ifdef WITH_WSREP -+ /* skip wsrep system threads as well */ -+ if (WSREP(tmp) && (tmp->wsrep_exec_mode==REPL_RECV || tmp->wsrep_applier)) -+ continue; -+#endif /* WITH_WSREP */ - if (tmp->get_command() == COM_BINLOG_DUMP || - tmp->get_command() == COM_BINLOG_DUMP_GTID) - { -@@ -1523,6 +1557,33 @@ static void close_connections(void) - tmp->main_security_ctx.user : "")); - close_connection(tmp); - } -+#ifdef WITH_WSREP -+ /* -+ * TODO: this code block may turn out redundant. wsrep->disconnect() -+ * should terminate slave threads gracefully, and we don't need -+ * to signal them here. -+ * The code here makes sure mysqld will not hang during shutdown -+ * even if wsrep provider has problems in shutting down. -+ */ -+ if (WSREP(tmp) && tmp->wsrep_exec_mode==REPL_RECV) -+ { -+ sql_print_information("closing wsrep system thread"); -+ tmp->killed= THD::KILL_CONNECTION; -+ MYSQL_CALLBACK(thread_scheduler, post_kill_notification, (tmp)); -+ if (tmp->mysys_var) -+ { -+ tmp->mysys_var->abort=1; -+ mysql_mutex_lock(&tmp->mysys_var->mutex); -+ if (tmp->mysys_var->current_cond) -+ { -+ mysql_mutex_lock(tmp->mysys_var->current_mutex); -+ mysql_cond_broadcast(tmp->mysys_var->current_cond); -+ mysql_mutex_unlock(tmp->mysys_var->current_mutex); -+ } -+ mysql_mutex_unlock(&tmp->mysys_var->mutex); -+ } -+ } -+#endif - } - DBUG_PRINT("quit",("Unlocking LOCK_thread_count")); - mysql_mutex_unlock(&LOCK_thread_count); -@@ -1672,8 +1733,14 @@ static void __cdecl kill_server(int sig_ptr) - } - } - #endif -+#ifdef WITH_WSREP -+ if (WSREP_ON) wsrep_stop_replication(NULL); -+#endif - - close_connections(); -+#ifdef WITH_WSREP -+ if (WSREP_ON) wsrep_deinit(); -+#endif - if (sig != MYSQL_KILL_SIGNAL && - sig != 0) - unireg_abort(1); /* purecov: inspected */ -@@ -1768,6 +1835,23 @@ extern "C" void unireg_abort(int exit_code) - usage(); - if (exit_code) - sql_print_error("Aborting\n"); -+ -+#ifdef WITH_WSREP -+ if (wsrep) -+ { -+ /* This is an abort situation, we cannot expect to gracefully close all -+ * wsrep threads here, we can only diconnect from service */ -+ wsrep_close_client_connections(FALSE); -+ shutdown_in_progress= 1; -+ THD* thd(0); -+ wsrep->disconnect(wsrep); -+ WSREP_INFO("Service disconnected."); -+ wsrep_close_threads(thd); /* this won't close all threads */ -+ sleep(1); /* so give some time to exit for those which can */ -+ WSREP_INFO("Some threads may fail to exit."); -+ } -+#endif // WITH_WSREP -+ - clean_up(!opt_help && (exit_code || !opt_bootstrap)); /* purecov: inspected */ - DBUG_PRINT("quit",("done with cleanup in unireg_abort")); - mysqld_exit(exit_code); -@@ -2015,6 +2099,20 @@ static void clean_up_mutexes() - mysql_cond_destroy(&COND_thread_cache); - mysql_cond_destroy(&COND_flush_thread_cache); - mysql_cond_destroy(&COND_manager); -+#ifdef WITH_WSREP -+ (void) mysql_mutex_destroy(&LOCK_wsrep_ready); -+ (void) mysql_cond_destroy(&COND_wsrep_ready); -+ (void) mysql_mutex_destroy(&LOCK_wsrep_sst); -+ (void) mysql_cond_destroy(&COND_wsrep_sst); -+ (void) mysql_mutex_destroy(&LOCK_wsrep_sst_init); -+ (void) mysql_cond_destroy(&COND_wsrep_sst_init); -+ (void) mysql_mutex_destroy(&LOCK_wsrep_rollback); -+ (void) mysql_cond_destroy(&COND_wsrep_rollback); -+ (void) mysql_mutex_destroy(&LOCK_wsrep_replaying); -+ (void) mysql_cond_destroy(&COND_wsrep_replaying); -+ (void) mysql_mutex_destroy(&LOCK_wsrep_slave_threads); -+ (void) mysql_mutex_destroy(&LOCK_wsrep_desync); -+#endif - } - #endif /*EMBEDDED_LIBRARY*/ - -@@ -2463,6 +2561,9 @@ static void network_init(void) - socket_errno); - unireg_abort(1); - } -+#if defined(WITH_WSREP) && defined(HAVE_FCNTL) && defined(FD_CLOEXEC) -+ (void) fcntl(mysql_socket_getfd(ip_sock), F_SETFD, FD_CLOEXEC); -+#endif /* WITH_WSREP */ - } - - #ifdef _WIN32 -@@ -2559,6 +2660,9 @@ static void network_init(void) - if (mysql_socket_listen(unix_sock, (int)back_log) < 0) - sql_print_warning("listen() on Unix socket failed with error %d", - socket_errno); -+#if defined(WITH_WSREP) && defined(HAVE_FCNTL) && defined(FD_CLOEXEC) -+ (void) fcntl(mysql_socket_getfd(unix_sock), F_SETFD, FD_CLOEXEC); -+#endif /* WITH_WSREP */ - } - #endif - DBUG_PRINT("info",("server started")); -@@ -2578,7 +2682,11 @@ static void network_init(void) - @note - For the connection that is doing shutdown, this is called twice - */ -+#ifdef WITH_WSREP -+void close_connection(THD *thd, uint sql_errno, bool lock) -+#else - void close_connection(THD *thd, uint sql_errno) -+#endif - { - DBUG_ENTER("close_connection"); - -@@ -2752,6 +2860,13 @@ bool one_thread_per_connection_end(THD *thd, bool block_pthread) - block_pthread= false; - } - -+#ifdef WITH_WSREP -+ if (WSREP(thd) && thd->wsrep_applier) -+ { -+ WSREP_DEBUG("avoiding thread re-use for applier, thd: %lu", thd->thread_id); -+ block_pthread= false; -+ } -+#endif /* WITH_WSREP */ - // Clean up errors now, before possibly waiting for a new connection. - #ifndef EMBEDDED_LIBRARY - ERR_remove_state(0); -@@ -3792,6 +3907,13 @@ int init_common_variables() - strmake(default_logfile_name, glob_hostname, - sizeof(default_logfile_name)-5); - -+#ifdef WITH_WSREP -+ if (0 == wsrep_node_name || 0 == wsrep_node_name[0]) -+ { -+ my_free((void *)wsrep_node_name); -+ wsrep_node_name= my_strdup(glob_hostname, MYF(MY_WME)); -+ } -+#endif /* WITH_WSREP */ - strmake(pidfile_name, default_logfile_name, sizeof(pidfile_name)-5); - strmov(fn_ext(pidfile_name),".pid"); // Add proper extension - -@@ -3851,7 +3973,11 @@ int init_common_variables() - compile_time_assert(sizeof(com_status_vars)/sizeof(com_status_vars[0]) - 1 == - SQLCOM_END + 8); - #endif -- -+#ifdef WITH_WSREP -+ /* This is a protection against mutually incompatible option values. */ -+ if (WSREP_ON && wsrep_check_opts (remaining_argc, remaining_argv)) -+ return 1; -+#endif /* WITH_WSREP */ - if (get_options(&remaining_argc, &remaining_argv)) - return 1; - set_server_version(); -@@ -4260,6 +4386,27 @@ static int init_thread_environment() - sql_print_error("Can't create thread-keys"); - return 1; - } -+#ifdef WITH_WSREP -+ mysql_mutex_init(key_LOCK_wsrep_ready, -+ &LOCK_wsrep_ready, MY_MUTEX_INIT_FAST); -+ mysql_cond_init(key_COND_wsrep_ready, &COND_wsrep_ready, NULL); -+ mysql_mutex_init(key_LOCK_wsrep_sst, -+ &LOCK_wsrep_sst, MY_MUTEX_INIT_FAST); -+ mysql_cond_init(key_COND_wsrep_sst, &COND_wsrep_sst, NULL); -+ mysql_mutex_init(key_LOCK_wsrep_sst_init, -+ &LOCK_wsrep_sst_init, MY_MUTEX_INIT_FAST); -+ mysql_cond_init(key_COND_wsrep_sst_init, &COND_wsrep_sst_init, NULL); -+ mysql_mutex_init(key_LOCK_wsrep_rollback, -+ &LOCK_wsrep_rollback, MY_MUTEX_INIT_FAST); -+ mysql_cond_init(key_COND_wsrep_rollback, &COND_wsrep_rollback, NULL); -+ mysql_mutex_init(key_LOCK_wsrep_replaying, -+ &LOCK_wsrep_replaying, MY_MUTEX_INIT_FAST); -+ mysql_cond_init(key_COND_wsrep_replaying, &COND_wsrep_replaying, NULL); -+ mysql_mutex_init(key_LOCK_wsrep_slave_threads, -+ &LOCK_wsrep_slave_threads, MY_MUTEX_INIT_FAST); -+ mysql_mutex_init(key_LOCK_wsrep_desync, -+ &LOCK_wsrep_desync, MY_MUTEX_INIT_FAST); -+#endif - return 0; - } - -@@ -4602,7 +4749,6 @@ initialize_storage_engine(char *se_name, const char *se_kind, - return false; - } - -- - static int init_server_components() - { - DBUG_ENTER("init_server_components"); -@@ -4700,7 +4846,11 @@ static int init_server_components() - sql_print_warning("You need to use --log-bin to make " - "--log-slave-updates work."); - } -+#ifdef WITH_WSREP -+ if (!WSREP_ON && binlog_format_used && !opt_bin_log) -+#else - if (binlog_format_used && !opt_bin_log) -+#endif - sql_print_warning("You need to use --log-bin to make " - "--binlog-format work."); - -@@ -4783,10 +4933,67 @@ a file name for --log-bin-index option", opt_binlog_index_name); - my_free(opt_bin_logname); - opt_bin_logname=my_strdup(buf, MYF(0)); - } -+#ifdef WITH_WSREP /* WSREP BEFORE SE */ -+ /* -+ Wsrep initialization must happen at this point, because: -+ - opt_bin_logname must be known when starting replication -+ since SST may need it -+ - SST may modify binlog index file, so it must be opened -+ after SST has happened -+ */ -+ } -+ if (!wsrep_recovery) -+ { -+ if (opt_bootstrap) // bootsrap option given - disable wsrep functionality -+ { -+ wsrep_provider_init(WSREP_NONE); -+ if (wsrep_init()) unireg_abort(1); -+ } -+ else // full wsrep initialization -+ { -+ // add basedir/bin to PATH to resolve wsrep script names -+ char* const tmp_path((char*)alloca(strlen(mysql_home) + -+ strlen("/bin") + 1)); -+ if (tmp_path) -+ { -+ strcpy(tmp_path, mysql_home); -+ strcat(tmp_path, "/bin"); -+ wsrep_prepend_PATH(tmp_path); -+ } -+ else -+ { -+ WSREP_ERROR("Could not append %s/bin to PATH", mysql_home); -+ } -+ -+ if (wsrep_before_SE()) -+ { -+ set_ports(); // this is also called in network_init() later but we need -+ // to know mysqld_port now - lp:1071882 -+ wsrep_init_startup(true); -+ } -+ } -+ } -+ if (opt_bin_log) -+ { -+ /* -+ Variable ln is not defined at this scope. We use opt_bin_logname instead. -+ It should be the same as ln since -+ - mysql_bin_log.generate_name() returns first argument if new log name -+ is not generated -+ - if new log name is generated, return value is assigned to ln and copied -+ to opt_bin_logname above -+ */ -+ if (mysql_bin_log.open_index_file(opt_binlog_index_name, opt_bin_logname, -+ TRUE)) -+ { -+ unireg_abort(1); -+ } -+#else - if (mysql_bin_log.open_index_file(opt_binlog_index_name, ln, TRUE)) - { - unireg_abort(1); - } -+#endif /* WITH_WSREP */ - } - - if (opt_bin_log) -@@ -4844,6 +5051,7 @@ a file name for --log-bin-index option", opt_binlog_index_name); - unireg_abort(1); - } - -+#ifdef WITH_WSREP - if (plugin_init(&remaining_argc, remaining_argv, - (opt_noacl ? PLUGIN_INIT_SKIP_PLUGIN_TABLE : 0) | - (opt_help ? PLUGIN_INIT_SKIP_INITIALIZATION : 0))) -@@ -4852,7 +5060,7 @@ a file name for --log-bin-index option", opt_binlog_index_name); - unireg_abort(1); - } - plugins_are_initialized= TRUE; /* Don't separate from init function */ -- -+#endif /* WITH_WSREP */ - /* we do want to exit if there are any other unknown options */ - if (remaining_argc > 1) - { -@@ -4947,16 +5155,34 @@ a file name for --log-bin-index option", opt_binlog_index_name); - &global_system_variables.temp_table_plugin)) - unireg_abort(1); - -+#ifdef WITH_WSREP -+ if (!opt_bin_log) -+ { -+ wsrep_emulate_bin_log= 1; -+ } -+#endif - if (total_ha_2pc > 1 || (1 == total_ha_2pc && opt_bin_log)) - { - if (opt_bin_log) - tc_log= &mysql_bin_log; - else -+#ifdef WITH_WSREP -+ if (WSREP_ON) -+ tc_log= &tc_log_dummy; -+ else -+#endif /* WITH_WSREP */ - tc_log= &tc_log_mmap; - } - else - tc_log= &tc_log_dummy; - -+#ifdef WITH_WSREP -+ WSREP_DEBUG("Initial TC log open: %s", -+ (tc_log == &mysql_bin_log) ? "binlog" : -+ (tc_log == &tc_log_mmap) ? "mmap" : -+ (tc_log == &tc_log_dummy) ? "dummy" : "unknown" -+ ); -+#endif - if (tc_log->open(opt_bin_log ? opt_bin_logname : opt_tc_log_file)) - { - sql_print_error("Can't init tc log"); -@@ -5047,8 +5273,6 @@ a file name for --log-bin-index option", opt_binlog_index_name); - init_update_queries(); - DBUG_RETURN(0); - } -- -- - #ifndef EMBEDDED_LIBRARY - - static void create_shutdown_thread() -@@ -5070,6 +5294,421 @@ static void create_shutdown_thread() - - #endif /* EMBEDDED_LIBRARY */ - -+#ifdef WITH_WSREP -+typedef void (*wsrep_thd_processor_fun)(THD *); -+ -+pthread_handler_t start_wsrep_THD(void *arg) -+{ -+ THD *thd; -+ wsrep_thd_processor_fun processor= (wsrep_thd_processor_fun)arg; -+ -+ if (my_thread_init()) -+ { -+ WSREP_ERROR("Could not initialize thread"); -+ return(NULL); -+ } -+ -+ if (!(thd= new THD(true, true))) -+ { -+ return(NULL); -+ } -+ mysql_mutex_lock(&LOCK_thread_count); -+ thd->thread_id=thread_id++; -+ -+ thd->real_id=pthread_self(); // Keep purify happy -+ add_global_thread(thd); -+ thread_created++; -+ -+ my_net_init(&thd->net,(st_vio*) 0); -+ -+ DBUG_PRINT("wsrep",(("creating thread %lld"), (long long)thd->thread_id)); -+ thd->prior_thr_create_utime= thd->start_utime= my_micro_time(); -+ (void) mysql_mutex_unlock(&LOCK_thread_count); -+ -+ /* from bootstrap()... */ -+ thd->bootstrap=1; -+ thd->max_client_packet_length= thd->net.max_packet; -+ thd->security_ctx->master_access= ~(ulong)0; -+ -+ /* from handle_one_connection... */ -+ pthread_detach_this_thread(); -+ -+ mysql_thread_set_psi_id(thd->thread_id); -+ thd->thr_create_utime= my_micro_time(); -+ if (MYSQL_CALLBACK_ELSE(thread_scheduler, init_new_connection_thread, (), 0)) -+ { -+ close_connection(thd, ER_OUT_OF_RESOURCES, 1); -+ statistic_increment(aborted_connects,&LOCK_status); -+ MYSQL_CALLBACK(thread_scheduler, end_thread, (thd, 0)); -+ -+ return(NULL); -+ } -+ -+ /* now that we've called my_thread_init(), it is safe to call DBUG_* */ -+ -+ thd->thread_stack= (char*) &thd; -+ if (thd->store_globals()) -+ { -+ close_connection(thd, ER_OUT_OF_RESOURCES, 1); -+ statistic_increment(aborted_connects,&LOCK_status); -+ MYSQL_CALLBACK(thread_scheduler, end_thread, (thd, 0)); -+ delete thd; -+ -+ return(NULL); -+ } -+ -+ /* from handle_bootstrap() */ -+ -+ thd->system_thread= SYSTEM_THREAD_SLAVE_SQL; -+ thd->security_ctx->skip_grants(); -+ -+ /* handle_one_connection() again... */ -+ //thd->version= refresh_version; -+ thd->proc_info= 0; -+ thd->set_command(COM_SLEEP); -+ thd->set_time(); -+ thd->init_for_queries(); -+ -+ mysql_mutex_lock(&LOCK_connection_count); -+ ++connection_count; -+ mysql_mutex_unlock(&LOCK_connection_count); -+ -+ processor(thd); -+ -+ close_connection(thd, 0, 1); -+ -+ // Note: We can't call THD destructor without crashing -+ // if plugins have not been initialized. However, in most of the -+ // cases this means that pre SE initialization SST failed and -+ // we are going to exit anyway. -+ if (plugins_are_initialized) -+ { -+ net_end(&thd->net); -+ MYSQL_CALLBACK(thread_scheduler, end_thread, (thd, 1)); -+ } -+ else -+ { -+ // TODO: lightweight cleanup to get rid of: -+ // 'Error in my_thread_global_end(): 2 threads didn't exit' -+ // at server shutdown -+ } -+ return(NULL); -+} -+ -+/**/ -+static bool abort_replicated(THD *thd) -+{ -+ bool ret_code= false; -+ if (thd->wsrep_query_state== QUERY_COMMITTING) -+ { -+ if (wsrep_debug) WSREP_INFO("aborting replicated trx: %lu", thd->real_id); -+ -+ (void)wsrep_abort_thd(thd, thd, TRUE); -+ ret_code= true; -+ } -+ return ret_code; -+} -+/**/ -+static inline bool is_client_connection(THD *thd) -+{ -+#if REMOVE -+// REMOVE THIS LATER (lp:777201). Below we had to add an explicit check for -+// wsrep_applier since wsrep_exec_mode didn't seem to always work -+if (thd->wsrep_applier && thd->wsrep_exec_mode != REPL_RECV) -+WSREP_WARN("applier has wsrep_exec_mode = %d", thd->wsrep_exec_mode); -+ -+ if ( thd->slave_thread || /* declared as mysql slave */ -+ thd->system_thread || /* declared as system thread */ -+ !thd->vio_ok() || /* server internal thread */ -+ thd->wsrep_exec_mode==REPL_RECV || /* applier or replaying thread */ -+ thd->wsrep_applier || /* wsrep slave applier */ -+ !thd->variables.wsrep_on) /* client, but fenced outside wsrep */ -+ return false; -+ -+ return true; -+#else -+ return (thd->wsrep_client_thread && thd->variables.wsrep_on); -+#endif /* REMOVE */ -+} -+ -+static inline bool is_replaying_connection(THD *thd) -+{ -+ bool ret; -+ -+ mysql_mutex_lock(&thd->LOCK_wsrep_thd); -+ ret= (thd->wsrep_conflict_state == REPLAYING) ? true : false; -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ -+ return ret; -+} -+ -+static inline bool is_committing_connection(THD *thd) -+{ -+ bool ret; -+ -+ mysql_mutex_lock(&thd->LOCK_wsrep_thd); -+ ret= (thd->wsrep_query_state == QUERY_COMMITTING) ? true : false; -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ -+ return ret; -+} -+ -+static bool have_client_connections() -+{ -+ Thread_iterator it= global_thread_list->begin(); -+ for (; it != global_thread_list->end(); ++it) -+ { -+ THD *tmp= *it; -+ DBUG_PRINT("quit",("Informing thread %ld that it's time to die", -+ tmp->thread_id)); -+ if (is_client_connection(tmp) && tmp->killed == THD::KILL_CONNECTION) -+ { -+ (void)abort_replicated(tmp); -+ return true; -+ } -+ } -+ return false; -+} -+ -+/* -+ returns the number of wsrep appliers running. -+ However, the caller (thd parameter) is not taken in account -+ */ -+static int have_wsrep_appliers(THD *thd) -+{ -+ int ret= 0; -+ -+ Thread_iterator it= global_thread_list->begin(); -+ for (; it != global_thread_list->end(); ++it) -+ { -+ THD *tmp= *it; -+ ret+= (tmp != thd && tmp->wsrep_applier); -+ } -+ return ret; -+} -+ -+static void wsrep_close_thread(THD *thd) -+{ -+ thd->killed= THD::KILL_CONNECTION; -+ MYSQL_CALLBACK(thread_scheduler, post_kill_notification, (thd)); -+ if (thd->mysys_var) -+ { -+ thd->mysys_var->abort=1; -+ mysql_mutex_lock(&thd->mysys_var->mutex); -+ if (thd->mysys_var->current_cond) -+ { -+ mysql_mutex_lock(thd->mysys_var->current_mutex); -+ mysql_cond_broadcast(thd->mysys_var->current_cond); -+ mysql_mutex_unlock(thd->mysys_var->current_mutex); -+ } -+ mysql_mutex_unlock(&thd->mysys_var->mutex); -+ } -+} -+ -+static my_bool have_committing_connections() -+{ -+ Thread_iterator it= global_thread_list->begin(); -+ for (; it != global_thread_list->end(); ++it) -+ { -+ THD *tmp= *it; -+ -+ if (!is_client_connection(tmp)) -+ continue; -+ -+ if (is_committing_connection(tmp)) -+ { -+ return TRUE; -+ } -+ } -+ return FALSE; -+} -+ -+int wsrep_wait_committing_connections_close(int wait_time) -+{ -+ int sleep_time= 100; -+ -+ while (have_committing_connections() && wait_time > 0) -+ { -+ WSREP_DEBUG("wait for committing transaction to close: %d", wait_time); -+ my_sleep(sleep_time); -+ wait_time -= sleep_time; -+ } -+ if (have_committing_connections()) -+ { -+ return 1; -+ } -+ return 0; -+} -+ -+void wsrep_close_client_connections(my_bool wait_to_end) -+{ -+ /* -+ First signal all threads that it's time to die -+ */ -+ -+ /* Kill blocked pthreads */ -+ kill_blocked_pthreads_flag++; -+ kill_blocked_pthreads(); -+ -+ mysql_mutex_lock(&LOCK_thread_count); // For unlink from list -+ -+ Thread_iterator it= global_thread_list->begin(); -+ for (; it != global_thread_list->end(); ++it) -+ { -+ THD *tmp= *it; -+ DBUG_PRINT("quit",("Informing thread %ld that it's time to die", -+ tmp->thread_id)); -+ /* We skip slave threads & scheduler on this first loop through. */ -+ if (!is_client_connection(tmp)) -+ continue; -+ -+ if (is_replaying_connection(tmp)) -+ { -+ tmp->killed= THD::KILL_CONNECTION; -+ continue; -+ } -+ -+ /* replicated transactions must be skipped */ -+ if (abort_replicated(tmp)) -+ continue; -+ -+ WSREP_DEBUG("closing connection %ld", tmp->thread_id); -+ wsrep_close_thread(tmp); -+ } -+ mysql_mutex_unlock(&LOCK_thread_count); -+ -+ if (get_thread_count() > 0) -+ sleep(2); // Give threads time to die -+ -+ mysql_mutex_lock(&LOCK_thread_count); -+ /* -+ Force remaining threads to die by closing the connection to the client -+ */ -+ -+ for (it= global_thread_list->begin(); it != global_thread_list->end(); ++it) -+ { -+ THD *tmp= *it; -+#ifndef __bsdi__ // Bug in BSDI kernel -+ if (is_client_connection(tmp) && -+ !abort_replicated(tmp) && -+ !is_replaying_connection(tmp)) -+ { -+ WSREP_INFO("killing local connection: %ld",tmp->thread_id); -+ close_connection(tmp,0,0); -+ } -+#endif -+ } -+ -+ DBUG_PRINT("quit",("Waiting for threads to die (count=%u)", get_thread_count())); -+ if (wsrep_debug) -+ WSREP_INFO("waiting for client connections to close: %u", -+ get_thread_count()); -+ -+ while (wait_to_end && have_client_connections()) -+ { -+ mysql_cond_wait(&COND_thread_count, &LOCK_thread_count); -+ DBUG_PRINT("quit",("One thread died (count=%u)", get_thread_count())); -+ } -+ -+ mysql_mutex_unlock(&LOCK_thread_count); -+ -+ /* All client connection threads have now been aborted */ -+} -+ -+void wsrep_close_applier(THD *thd) -+{ -+ WSREP_DEBUG("closing applier %ld", thd->thread_id); -+ wsrep_close_thread(thd); -+} -+ -+static void wsrep_close_threads(THD *thd) -+{ -+ mysql_mutex_lock(&LOCK_thread_count); // For unlink from list -+ -+ Thread_iterator it= global_thread_list->begin(); -+ for (; it != global_thread_list->end(); ++it) -+ { -+ THD *tmp= *it; -+ DBUG_PRINT("quit",("Informing thread %ld that it's time to die", -+ tmp->thread_id)); -+ /* We skip slave threads & scheduler on this first loop through. */ -+ if (tmp->wsrep_applier && tmp != thd) -+ { -+ WSREP_DEBUG("closing wsrep thread %ld", tmp->thread_id); -+ wsrep_close_thread (tmp); -+ } -+ } -+ -+ mysql_mutex_unlock(&LOCK_thread_count); -+} -+ -+void wsrep_close_applier_threads(int count) -+{ -+ mysql_mutex_lock(&LOCK_thread_count); // For unlink from list -+ -+ Thread_iterator it= global_thread_list->begin(); -+ for (; it != global_thread_list->end(); ++it) -+ { -+ THD *tmp= *it; -+ DBUG_PRINT("quit",("Informing thread %ld that it's time to die", -+ tmp->thread_id)); -+ /* We skip slave threads & scheduler on this first loop through. */ -+ if (tmp->wsrep_applier) -+ { -+ WSREP_DEBUG("closing wsrep applier thread %ld", tmp->thread_id); -+ tmp->wsrep_applier_closing= TRUE; -+ count--; -+ } -+ } -+ -+ mysql_mutex_unlock(&LOCK_thread_count); -+} -+ -+void wsrep_wait_appliers_close(THD *thd) -+{ -+ /* Wait for wsrep appliers to gracefully exit */ -+ mysql_mutex_lock(&LOCK_thread_count); -+ while (have_wsrep_appliers(thd) > 1) -+ // 1 is for rollbacker thread which needs to be killed explicitly. -+ // This gotta be fixed in a more elegant manner if we gonna have arbitrary -+ // number of non-applier wsrep threads. -+ { -+ mysql_cond_wait(&COND_thread_count,&LOCK_thread_count); -+ DBUG_PRINT("quit",("One applier died (count=%u)", get_thread_count())); -+ } -+ mysql_mutex_unlock(&LOCK_thread_count); -+ /* Now kill remaining wsrep threads: rollbacker */ -+ wsrep_close_threads (thd); -+ /* and wait for them to die */ -+ mysql_mutex_lock(&LOCK_thread_count); -+ while (have_wsrep_appliers(thd) > 0) -+ { -+ mysql_cond_wait(&COND_thread_count,&LOCK_thread_count); -+ DBUG_PRINT("quit",("One thread died (count=%u)", get_thread_count())); -+ } -+ mysql_mutex_unlock(&LOCK_thread_count); -+ -+ /* All wsrep applier threads have now been aborted. However, if this thread -+ is also applier, we are still running... -+ */ -+} -+ -+void wsrep_kill_mysql(THD *thd) -+{ -+ if (mysqld_server_started) -+ { -+ if (!shutdown_in_progress) -+ { -+ WSREP_INFO("starting shutdown"); -+ kill_mysql(); -+ } -+ } -+ else -+ { -+ unireg_abort(1); -+ } -+} -+#endif /* WITH_WSREP */ - - #if (defined(_WIN32) || defined(HAVE_SMEM)) && !defined(EMBEDDED_LIBRARY) - static void handle_connections_methods() -@@ -5204,6 +5843,9 @@ int mysqld_main(int argc, char **argv) - return 1; - } - #endif -+#ifdef WITH_WSREP -+ wsrep_filter_new_cluster (&argc, argv); -+#endif /* WITH_WSREP */ - - orig_argc= argc; - orig_argv= argv; -@@ -5537,6 +6179,14 @@ int mysqld_main(int argc, char **argv) - my_str_free= &my_str_free_mysqld; - my_str_realloc= &my_str_realloc_mysqld; - -+#ifdef WITH_WSREP /* WSREP AFTER SE */ -+ if (wsrep_recovery) -+ { -+ select_thread_in_use= 0; -+ wsrep_recover(); -+ unireg_abort(0); -+ } -+#endif /* WITH_WSREP */ - /* - init signals & alarm - After this we can't quit by a simple unireg_abort -@@ -5615,6 +6265,31 @@ int mysqld_main(int argc, char **argv) - if (Events::init(opt_noacl || opt_bootstrap)) - unireg_abort(1); - -+#ifdef WITH_WSREP /* WSREP AFTER SE */ -+ if (opt_bootstrap) -+ { -+ /*! bootstrap wsrep init was taken care of above */ -+ } -+ else -+ { -+ wsrep_SE_initialized(); -+ -+ if (wsrep_before_SE()) -+ { -+ /*! in case of no SST wsrep waits in view handler callback */ -+ wsrep_SE_init_grab(); -+ wsrep_SE_init_done(); -+ /*! in case of SST wsrep waits for wsrep->sst_received */ -+ wsrep_sst_continue(); -+ } -+ else -+ { -+ wsrep_init_startup (false); -+ } -+ -+ wsrep_create_appliers(wsrep_slave_threads - 1); -+ } -+#endif /* WITH_WSREP */ - if (opt_bootstrap) - { - select_thread_in_use= 0; // Allow 'kill' to work -@@ -5676,6 +6351,9 @@ int mysqld_main(int argc, char **argv) - #ifdef EXTRA_DEBUG2 - sql_print_error("Before Lock_thread_count"); - #endif -+#ifdef WITH_WSREP -+ WSREP_DEBUG("Before Lock_thread_count"); -+#endif - mysql_mutex_lock(&LOCK_thread_count); - DBUG_PRINT("quit", ("Got thread_count mutex")); - select_thread_in_use=0; // For close_connections -@@ -5941,6 +6619,9 @@ static void bootstrap(MYSQL_FILE *file) - DBUG_ENTER("bootstrap"); - - THD *thd= new THD; -+#ifdef WITH_WSREP -+ thd->variables.wsrep_on= 0; -+#endif - thd->bootstrap=1; - my_net_init(&thd->net,(st_vio*) 0); - thd->max_client_packet_length= thd->net.max_packet; -@@ -6080,7 +6761,11 @@ void create_thread_to_handle_connection(THD *thd) - my_snprintf(error_message_buff, sizeof(error_message_buff), - ER_THD(thd, ER_CANT_CREATE_THREAD), error); - net_send_error(thd, ER_CANT_CREATE_THREAD, error_message_buff, NULL); -+#ifdef WITH_WSREP -+ close_connection(thd,0,0); -+#else - close_connection(thd); -+#endif - delete thd; - return; - /* purecov: end */ -@@ -6132,7 +6817,11 @@ static void create_new_thread(THD *thd) - with no sqlstate. - A client expecting a SQLSTATE will not find any, and assume 'HY000'. - */ -+#ifdef WITH_WSREP -+ close_connection(thd, ER_CON_COUNT_ERROR, 1); -+#else - close_connection(thd, ER_CON_COUNT_ERROR); -+#endif - delete thd; - statistic_increment(connection_errors_max_connection, &LOCK_status); - DBUG_VOID_RETURN; -@@ -6352,6 +7041,9 @@ void handle_connections_sockets() - sleep(1); // Give other threads some time - continue; - } -+#if defined(WITH_WSREP) && defined(HAVE_FCNTL) && defined(FD_CLOEXEC) -+ (void) fcntl(mysql_socket_getfd(new_sock), F_SETFD, FD_CLOEXEC); -+#endif /* WITH_WSREP */ - - #ifdef HAVE_LIBWRAP - { -@@ -6531,7 +7223,11 @@ pthread_handler_t handle_connections_namedpipes(void *arg) - if (!(thd->net.vio= vio_new_win32pipe(hConnectedPipe)) || - my_net_init(&thd->net, thd->net.vio)) - { -+#ifdef WITH_WSREP -+ close_connection(thd, ER_OUT_OF_RESOURCES, 1); -+#else - close_connection(thd, ER_OUT_OF_RESOURCES); -+#endif - delete thd; - continue; - } -@@ -6726,7 +7422,11 @@ pthread_handler_t handle_connections_shared_memory(void *arg) - event_conn_closed)) || - my_net_init(&thd->net, thd->net.vio)) - { -+#ifdef WITH_WSREP -+ close_connection(thd, ER_OUT_OF_RESOURCES, 1); -+#else - close_connection(thd, ER_OUT_OF_RESOURCES); -+#endif - errmsg= 0; - goto errorconn; - } -@@ -8029,6 +8729,20 @@ SHOW_VAR status_vars[]= { - #ifdef ENABLED_PROFILING - {"Uptime_since_flush_status",(char*) &show_flushstatustime, SHOW_FUNC}, - #endif -+#ifdef WITH_WSREP -+ {"wsrep_connected", (char*) &wsrep_connected, SHOW_BOOL}, -+ {"wsrep_ready", (char*) &wsrep_ready, SHOW_BOOL}, -+ {"wsrep_cluster_state_uuid", (char*) &wsrep_cluster_state_uuid,SHOW_CHAR_PTR}, -+ {"wsrep_cluster_conf_id", (char*) &wsrep_cluster_conf_id, SHOW_LONGLONG}, -+ {"wsrep_cluster_status", (char*) &wsrep_cluster_status, SHOW_CHAR_PTR}, -+ {"wsrep_cluster_size", (char*) &wsrep_cluster_size, SHOW_LONG_NOFLUSH}, -+ {"wsrep_local_index", (char*) &wsrep_local_index, SHOW_LONG_NOFLUSH}, -+ {"wsrep_local_bf_aborts", (char*) &wsrep_show_bf_aborts, SHOW_FUNC}, -+ {"wsrep_provider_name", (char*) &wsrep_provider_name, SHOW_CHAR_PTR}, -+ {"wsrep_provider_version", (char*) &wsrep_provider_version, SHOW_CHAR_PTR}, -+ {"wsrep_provider_vendor", (char*) &wsrep_provider_vendor, SHOW_CHAR_PTR}, -+ {"wsrep", (char*) &wsrep_show_status, SHOW_FUNC}, -+#endif - {NullS, NullS, SHOW_LONG} - }; - -@@ -8356,6 +9070,10 @@ static int mysql_init_variables(void) - tmpenv = DEFAULT_MYSQL_HOME; - (void) strmake(mysql_home, tmpenv, sizeof(mysql_home)-1); - #endif -+#ifdef WITH_WSREP -+ if (WSREP_ON && wsrep_init_vars()) -+ return 1; -+#endif - return 0; - } - -@@ -8567,6 +9285,14 @@ mysqld_get_one_option(int optid, - case OPT_LOWER_CASE_TABLE_NAMES: - lower_case_table_names_used= 1; - break; -+#ifdef WITH_WSREP -+ case OPT_WSREP_START_POSITION: -+ wsrep_start_position_init (argument); -+ break; -+ case OPT_WSREP_SST_AUTH: -+ wsrep_sst_auth_init (argument); -+ break; -+#endif - #if defined(ENABLED_DEBUG_SYNC) - case OPT_DEBUG_SYNC_TIMEOUT: - /* -@@ -8926,6 +9652,31 @@ static int get_options(int *argc_ptr, char ***argv_ptr) - else - global_system_variables.option_bits&= ~OPTION_BIG_SELECTS; - -+#ifdef WITH_WSREP -+ if (global_system_variables.wsrep_causal_reads) { -+ WSREP_WARN("option --wsrep-casual-reads is deprecated"); -+ if (!(global_system_variables.wsrep_sync_wait & -+ WSREP_SYNC_WAIT_BEFORE_READ)) { -+ WSREP_WARN("--wsrep-casual-reads=ON takes precedence over --wsrep-sync-wait=%u. " -+ "WSREP_SYNC_WAIT_BEFORE_READ is on", -+ global_system_variables.wsrep_sync_wait); -+ global_system_variables.wsrep_sync_wait |= WSREP_SYNC_WAIT_BEFORE_READ; -+ } else { -+ // they are turned on both. -+ } -+ } else { -+ if (global_system_variables.wsrep_sync_wait & -+ WSREP_SYNC_WAIT_BEFORE_READ) { -+ WSREP_WARN("--wsrep-sync-wait=%u takes precedence over --wsrep-causal-reads=OFF. " -+ "WSREP_SYNC_WAIT_BEFORE_READ is on", -+ global_system_variables.wsrep_sync_wait); -+ global_system_variables.wsrep_causal_reads = 1; -+ } else { -+ // they are turned off both. -+ } -+ } -+#endif // WITH_WSREP -+ - // Synchronize @@global.autocommit on --autocommit - const ulonglong turn_bit_on= opt_autocommit ? - OPTION_AUTOCOMMIT : OPTION_NOT_AUTOCOMMIT; -@@ -9320,6 +10071,9 @@ void refresh_status(THD *thd) - - /* Reset some global variables */ - reset_status_vars(); -+#ifdef WITH_WSREP -+ wsrep->stats_reset(wsrep); -+#endif /* WITH_WSREP */ - - /* Reset the counters of all key caches (default and named). */ - process_key_caches(reset_key_cache_counters); -@@ -9383,6 +10137,12 @@ PSI_mutex_key - key_structure_guard_mutex, key_TABLE_SHARE_LOCK_ha_data, - key_LOCK_error_messages, key_LOG_INFO_lock, key_LOCK_thread_count, - key_LOCK_log_throttle_qni; -+#ifdef WITH_WSREP -+PSI_mutex_key key_LOCK_wsrep_rollback, key_LOCK_wsrep_thd, -+ key_LOCK_wsrep_replaying, key_LOCK_wsrep_ready, key_LOCK_wsrep_sst, -+ key_LOCK_wsrep_sst_thread, key_LOCK_wsrep_sst_init, -+ key_LOCK_wsrep_slave_threads, key_LOCK_wsrep_desync; -+#endif - PSI_mutex_key key_LOCK_thd_remove; - PSI_mutex_key key_RELAYLOG_LOCK_commit; - PSI_mutex_key key_RELAYLOG_LOCK_commit_queue; -@@ -9468,6 +10228,18 @@ static PSI_mutex_info all_server_mutexes[]= - { &key_LOCK_error_messages, "LOCK_error_messages", PSI_FLAG_GLOBAL}, - { &key_LOG_INFO_lock, "LOG_INFO::lock", 0}, - { &key_LOCK_thread_count, "LOCK_thread_count", PSI_FLAG_GLOBAL}, -+#ifdef WITH_WSREP -+ { &key_LOCK_wsrep_ready, "LOCK_wsrep_ready", PSI_FLAG_GLOBAL}, -+ { &key_LOCK_wsrep_sst, "LOCK_wsrep_sst", PSI_FLAG_GLOBAL}, -+ { &key_LOCK_wsrep_sst_thread, "wsrep_sst_thread", 0}, -+ { &key_LOCK_wsrep_sst_init, "LOCK_wsrep_sst_init", PSI_FLAG_GLOBAL}, -+ { &key_LOCK_wsrep_sst, "LOCK_wsrep_sst", PSI_FLAG_GLOBAL}, -+ { &key_LOCK_wsrep_rollback, "LOCK_wsrep_rollback", PSI_FLAG_GLOBAL}, -+ { &key_LOCK_wsrep_thd, "THD::LOCK_wsrep_thd", 0}, -+ { &key_LOCK_wsrep_replaying, "LOCK_wsrep_replaying", PSI_FLAG_GLOBAL}, -+ { &key_LOCK_wsrep_slave_threads, "LOCK_wsrep_slave_threads", PSI_FLAG_GLOBAL}, -+ { &key_LOCK_wsrep_desync, "LOCK_wsrep_desync", PSI_FLAG_GLOBAL}, -+#endif - { &key_LOCK_thd_remove, "LOCK_thd_remove", PSI_FLAG_GLOBAL}, - { &key_LOCK_log_throttle_qni, "LOCK_log_throttle_qni", PSI_FLAG_GLOBAL}, - { &key_gtid_ensure_index_mutex, "Gtid_state", PSI_FLAG_GLOBAL}, -@@ -9523,6 +10295,12 @@ PSI_cond_key key_BINLOG_update_cond, - key_cond_slave_parallel_worker, - key_TABLE_SHARE_cond, key_user_level_lock_cond, - key_COND_thread_count, key_COND_thread_cache, key_COND_flush_thread_cache; -+#ifdef WITH_WSREP -+PSI_cond_key key_COND_wsrep_rollback, key_COND_wsrep_thd, -+ key_COND_wsrep_replaying, key_COND_wsrep_ready, key_COND_wsrep_sst, -+ key_COND_wsrep_sst_init, key_COND_wsrep_sst_thread; -+ -+#endif /* WITH_WSREP */ - PSI_cond_key key_RELAYLOG_update_cond; - PSI_cond_key key_BINLOG_COND_done; - PSI_cond_key key_RELAYLOG_COND_done; -@@ -9567,6 +10345,15 @@ static PSI_cond_info all_server_conds[]= - { &key_user_level_lock_cond, "User_level_lock::cond", 0}, - { &key_COND_thread_count, "COND_thread_count", PSI_FLAG_GLOBAL}, - { &key_COND_thread_cache, "COND_thread_cache", PSI_FLAG_GLOBAL}, -+#ifdef WITH_WSREP -+ { &key_COND_wsrep_ready, "COND_wsrep_ready", PSI_FLAG_GLOBAL}, -+ { &key_COND_wsrep_sst, "COND_wsrep_sst", PSI_FLAG_GLOBAL}, -+ { &key_COND_wsrep_sst_init, "COND_wsrep_sst_init", PSI_FLAG_GLOBAL}, -+ { &key_COND_wsrep_sst_thread, "wsrep_sst_thread", 0}, -+ { &key_COND_wsrep_rollback, "COND_wsrep_rollback", PSI_FLAG_GLOBAL}, -+ { &key_COND_wsrep_thd, "THD::COND_wsrep_thd", 0}, -+ { &key_COND_wsrep_replaying, "COND_wsrep_replaying", PSI_FLAG_GLOBAL}, -+#endif - { &key_COND_flush_thread_cache, "COND_flush_thread_cache", PSI_FLAG_GLOBAL}, - { &key_gtid_ensure_index_cond, "Gtid_state", PSI_FLAG_GLOBAL} - }; -diff --git a/sql/mysqld.h b/sql/mysqld.h -index 2844275..17b601a 100644 ---- a/sql/mysqld.h -+++ b/sql/mysqld.h -@@ -65,7 +65,11 @@ typedef Bitmap<((MAX_INDEXES+7)/8*8)> key_map; /* Used for finding keys */ - some places */ - /* Function prototypes */ - void kill_mysql(void); -+#ifdef WITH_WSREP -+void close_connection(THD *thd, uint sql_errno= 0, bool lock=1); -+#else - void close_connection(THD *thd, uint sql_errno= 0); -+#endif - void handle_connection_in_main_thread(THD *thd); - void create_thread_to_handle_connection(THD *thd); - void destroy_thd(THD *thd); -@@ -309,6 +313,10 @@ extern pthread_key(MEM_ROOT**,THR_MALLOC); - extern PSI_mutex_key key_PAGE_lock, key_LOCK_sync, key_LOCK_active, - key_LOCK_pool; - #endif /* HAVE_MMAP */ -+#ifdef WITH_WSREP -+extern PSI_mutex_key key_LOCK_wsrep_thd; -+extern PSI_cond_key key_COND_wsrep_thd; -+#endif /* HAVE_WSREP */ - - #ifdef HAVE_OPENSSL - extern PSI_mutex_key key_LOCK_des_key_file; -@@ -658,6 +666,14 @@ enum options_mysqld - OPT_WANT_CORE, - OPT_ENGINE_CONDITION_PUSHDOWN, - OPT_LOG_ERROR, -+#ifdef WITH_WSREP -+ OPT_WSREP_PROVIDER, -+ OPT_WSREP_PROVIDER_OPTIONS, -+ OPT_WSREP_CLUSTER_ADDRESS, -+ OPT_WSREP_START_POSITION, -+ OPT_WSREP_SST_AUTH, -+ OPT_WSREP_RECOVER, -+#endif /* WITH_WSREP */ - OPT_MAX_LONG_DATA_SIZE, - OPT_PLUGIN_LOAD, - OPT_PLUGIN_LOAD_ADD, -@@ -766,4 +782,9 @@ inline THD *_current_thd(void) - - extern const char *MY_BIND_ALL_ADDRESSES; - -+#ifdef WITH_WSREP -+#include "my_pthread.h" -+pthread_handler_t start_wsrep_THD(void*); -+#endif /* WITH_WSREP */ -+ - #endif /* MYSQLD_INCLUDED */ -diff --git a/sql/protocol.cc b/sql/protocol.cc -index c03d78b..8e6ba54 100644 ---- a/sql/protocol.cc -+++ b/sql/protocol.cc -@@ -485,6 +485,14 @@ static uchar *net_store_length_fast(uchar *packet, uint length) - - void Protocol::end_statement() - { -+#ifdef WITH_WSREP -+ /*sanity check, can be removed before 1.0 release */ -+ if (WSREP(thd) && thd->wsrep_conflict_state== REPLAYING) -+ { -+ WSREP_ERROR("attempting net_end_statement while replaying"); -+ return; -+ } -+#endif - DBUG_ENTER("Protocol::end_statement"); - DBUG_ASSERT(! thd->get_stmt_da()->is_sent()); - bool error= FALSE; -diff --git a/sql/rpl_gtid_cache.cc b/sql/rpl_gtid_cache.cc -index 271a99d..7e8a368 100644 ---- a/sql/rpl_gtid_cache.cc -+++ b/sql/rpl_gtid_cache.cc -@@ -147,7 +147,22 @@ enum_return_status Group_cache::generate_automatic_gno(THD *thd) - else - { - automatic_type= GTID_GROUP; -+#ifdef WITH_WSREP -+ /* -+ Replace sidno with wsrep_sidno -+ if transaction went through wsrep commit -+ */ -+ if (WSREP(thd) && thd->wsrep_trx_meta.gtid.seqno != -1) -+ { -+ automatic_gtid.sidno= wsrep_sidno; -+ } -+ else -+ { -+#endif /* WITH_WSREP */ - automatic_gtid.sidno= gtid_state->get_server_sidno(); -+#ifdef WITH_WSREP -+ } -+#endif /* WITH_WSREP */ - gtid_state->lock_sidno(automatic_gtid.sidno); - automatic_gtid.gno= - gtid_state->get_automatic_gno(automatic_gtid.sidno); -diff --git a/sql/rpl_slave.cc b/sql/rpl_slave.cc -index 736d790..af86bec 100644 ---- a/sql/rpl_slave.cc -+++ b/sql/rpl_slave.cc -@@ -55,6 +55,9 @@ - #include "rpl_rli_pdb.h" - #include "global_threads.h" - -+#ifdef WITH_WSREP -+#include "wsrep_mysqld.h" -+#endif - #ifdef HAVE_REPLICATION - - #include "rpl_tblmap.h" -@@ -3704,6 +3707,94 @@ apply_event_and_update_pos(Log_event** ptr_ev, THD* thd, Relay_log_info* rli) - rli->mts_recovery_index)); - } - #endif -+#ifdef WITH_WSREP -+ if (wsrep_preordered_opt && WSREP_ON && -+ (ev->get_type_code() == QUERY_EVENT || -+ ev->get_type_code() == XID_EVENT || -+ ev->get_type_code() == TABLE_MAP_EVENT || -+ ev->get_type_code() == WRITE_ROWS_EVENT || -+ ev->get_type_code() == UPDATE_ROWS_EVENT || -+ ev->get_type_code() == DELETE_ROWS_EVENT || -+ ev->get_type_code() == GTID_LOG_EVENT)) -+ { -+ if (ev->get_type_code() == GTID_LOG_EVENT) -+ { -+ thd->wsrep_po_sid= *((Gtid_log_event*)ev)->get_sid(); -+ } -+ wsrep_status_t err; -+ if (thd->wsrep_po_cnt == 0) -+ { -+ /* First event in write set, write format description event -+ as a write set header so that the receiver will know how -+ to interpret following events. */ -+ Log_event* fde= rli->get_rli_description_event(); -+ ulong len= uint4korr(fde->temp_buf + EVENT_LEN_OFFSET); -+ wsrep_buf_t data= {fde->temp_buf, len}; -+ if ((err= wsrep->preordered_collect( -+ wsrep, &thd->wsrep_po_handle, &data, 1, true)) != WSREP_OK) -+ { -+ WSREP_ERROR("wsrep preordered collect failed: %d", err); -+ if (err == WSREP_TRX_FAIL && -+ wsrep->preordered_commit(wsrep, &thd->wsrep_po_handle, NULL, -+ 0, 0, false)) -+ { -+ WSREP_WARN("failed to cancel preordered write set"); -+ } -+ DBUG_RETURN(SLAVE_APPLY_EVENT_AND_UPDATE_POS_APPLY_ERROR); -+ } -+ } -+ ++thd->wsrep_po_cnt; -+ ulong len= uint4korr(ev->temp_buf + EVENT_LEN_OFFSET); -+ wsrep_buf_t data= {ev->temp_buf, len}; -+ if ((err= wsrep->preordered_collect(wsrep, &thd->wsrep_po_handle, -+ &data, 1, 1)) != WSREP_OK) -+ { -+ WSREP_ERROR("wsrep preordered collect failed: %d", err); -+ DBUG_RETURN(SLAVE_APPLY_EVENT_AND_UPDATE_POS_APPLY_ERROR); -+ } -+ -+ if (ev->get_type_code() == QUERY_EVENT && -+ ((Query_log_event*)ev)->starts_group()) -+ { -+ thd->wsrep_po_in_trans= TRUE; -+ } -+ else if (ev->get_type_code() == XID_EVENT || -+ (ev->get_type_code() == QUERY_EVENT && -+ (thd->wsrep_po_in_trans == FALSE || -+ ((Query_log_event*)ev)->ends_group()))) -+ { -+ int flags= WSREP_FLAG_COMMIT | (thd->wsrep_po_in_trans == FALSE ? -+ WSREP_FLAG_ISOLATION : 0); -+ thd->wsrep_po_in_trans= FALSE; -+ thd->wsrep_po_cnt= 0; -+ wsrep_uuid_t source; -+ memcpy(source.data, thd->wsrep_po_sid.bytes, sizeof(source.data)); -+ if ((err= wsrep->preordered_commit(wsrep, &thd->wsrep_po_handle, -+ &source, flags, 1, true)) != WSREP_OK) -+ { -+ WSREP_ERROR("failed to commit preordered event: %d", err); -+ DBUG_RETURN(SLAVE_APPLY_EVENT_AND_UPDATE_POS_APPLY_ERROR); -+ } -+ } -+ reason= Log_event::EVENT_SKIP_IGNORE; -+ skip_event= TRUE; -+ } -+ else if (WSREP_ON && (ev->get_type_code() == XID_EVENT || -+ (ev->get_type_code() == QUERY_EVENT && thd->wsrep_mysql_replicated > 0 && -+ (!strncasecmp(((Query_log_event*)ev)->query , "BEGIN", 5) || -+ !strncasecmp(((Query_log_event*)ev)->query , "COMMIT", 6) )))) -+ { -+ if (++thd->wsrep_mysql_replicated < (int)wsrep_mysql_replication_bundle) -+ { -+ WSREP_DEBUG("skipping wsrep commit %d", thd->wsrep_mysql_replicated); -+ reason = Log_event::EVENT_SKIP_IGNORE; -+ } -+ else -+ { -+ thd->wsrep_mysql_replicated = 0; -+ } -+ } -+#endif /* WITH_WSREP */ - if (reason == Log_event::EVENT_SKIP_COUNT) - { - sql_slave_skip_counter= --rli->slave_skip_counter; -@@ -5825,6 +5916,9 @@ pthread_handler_t handle_slave_sql(void *arg) - my_off_t saved_log_pos= 0; - my_off_t saved_master_log_pos= 0; - my_off_t saved_skip= 0; -+#ifdef WITH_WSREP -+ my_bool wsrep_node_dropped= FALSE; -+#endif /* WITH_WSREP */ - - Relay_log_info* rli = ((Master_info*)arg)->rli; - const char *errmsg; -@@ -5833,6 +5927,9 @@ pthread_handler_t handle_slave_sql(void *arg) - // needs to call my_thread_init(), otherwise we get a coredump in DBUG_ stuff - my_thread_init(); - DBUG_ENTER("handle_slave_sql"); -+#ifdef WITH_WSREP -+ wsrep_restart_point: -+#endif /* WITH_WSREP */ - - DBUG_ASSERT(rli->inited); - mysql_mutex_lock(&rli->run_lock); -@@ -5976,6 +6073,18 @@ pthread_handler_t handle_slave_sql(void *arg) - } - #endif - -+#ifdef WITH_WSREP -+ thd->wsrep_exec_mode= LOCAL_STATE; -+ /* synchronize with wsrep replication */ -+ if (WSREP_ON) -+ { -+ thd->wsrep_po_handle= WSREP_PO_INITIALIZER; -+ thd->wsrep_po_cnt= 0; -+ thd->wsrep_po_in_trans= FALSE; -+ memset(&thd->wsrep_po_sid, 0, sizeof(thd->wsrep_po_sid)); -+ wsrep_ready_wait(); -+ } -+#endif - DBUG_PRINT("master_info",("log_file_name: %s position: %s", - rli->get_group_master_log_name(), - llstr(rli->get_group_master_log_pos(),llbuff))); -@@ -6118,6 +6227,12 @@ Error running query, slave SQL thread aborted. Fix the problem, and restart \ - the slave SQL thread with \"SLAVE START\". We stopped at log \ - '%s' position %s", rli->get_rpl_log_name(), - llstr(rli->get_group_master_log_pos(), llbuff)); -+#ifdef WITH_WSREP -+ if (WSREP_ON && last_errno == ER_UNKNOWN_COM_ERROR) -+ { -+ wsrep_node_dropped= TRUE; -+ } -+#endif /* WITH_WSREP */ - } - goto err; - } -@@ -6139,6 +6254,16 @@ llstr(rli->get_group_master_log_pos(), llbuff)); - rli->recovery_groups_inited= false; - } - -+#ifdef WITH_WSREP -+ if (WSREP_ON) -+ { -+ if (wsrep->preordered_commit(wsrep, &thd->wsrep_po_handle, -+ NULL, 0, 0, false)) -+ { -+ WSREP_WARN("preordered cleanup failed"); -+ } -+ } -+#endif /* WITH_WSREP */ - /* - Some events set some playgrounds, which won't be cleared because thread - stops. Stopping of this thread may not be known to these events ("stop" -@@ -6191,6 +6316,27 @@ llstr(rli->get_group_master_log_pos(), llbuff)); - if (thd_added) - remove_global_thread(thd); - delete thd; -+#ifdef WITH_WSREP -+ /* if slave stopped due to node going non primary, we set global flag to -+ trigger automatic restart of slave when node joins back to cluster -+ */ -+ if (wsrep_node_dropped && wsrep_restart_slave) -+ { -+ if (wsrep_ready) -+ { -+ WSREP_INFO("Slave error due to node temporarily non-primary" -+ "SQL slave will continue"); -+ wsrep_node_dropped= FALSE; -+ mysql_mutex_unlock(&rli->run_lock); -+ goto wsrep_restart_point; -+ } else { -+ WSREP_INFO("Slave error due to node going non-primary"); -+ WSREP_INFO("wsrep_restart_slave was set and therefore slave will be " -+ "automatically restarted when node joins back to cluster"); -+ wsrep_restart_slave_activated= TRUE; -+ } -+ } -+#endif /* WITH_WSREP */ - /* - Note: the order of the broadcast and unlock calls below (first broadcast, then unlock) - is important. Otherwise a killer_thread can execute between the calls and -diff --git a/sql/set_var.h b/sql/set_var.h -index fbc7e16..6995619 100644 ---- a/sql/set_var.h -+++ b/sql/set_var.h -@@ -256,6 +256,9 @@ public: - int check(THD *thd); - int update(THD *thd); - int light_check(THD *thd); -+#ifdef WITH_WSREP -+ int wsrep_store_variable(THD *thd); -+#endif - void print(THD *thd, String *str); /* To self-print */ - #ifdef OPTIMIZER_TRACE - virtual bool is_var_optimizer_trace() const -@@ -354,6 +357,9 @@ extern sys_var *Sys_gtid_purged_ptr; - - const CHARSET_INFO *get_old_charset_by_name(const char *old_name); - -+#ifdef WITH_WSREP -+int sql_set_wsrep_variables(THD *thd, List *var_list); -+#endif - int sys_var_init(); - int sys_var_add_options(std::vector *long_options, int parse_flags); - void sys_var_end(void); -diff --git a/sql/sp.cc b/sql/sp.cc -index 915a6af..d52a5ee 100644 ---- a/sql/sp.cc -+++ b/sql/sp.cc -@@ -2734,3 +2734,37 @@ String *sp_get_item_value(THD *thd, Item *item, String *str) - return NULL; - } - } -+#ifdef WITH_WSREP -+int wsrep_create_sp(THD *thd, uchar** buf, size_t* buf_len) -+{ -+ String log_query; -+ sp_head *sp = thd->lex->sphead; -+ ulong saved_mode= thd->variables.sql_mode; -+ String retstr(64); -+ retstr.set_charset(system_charset_info); -+ -+ log_query.set_charset(system_charset_info); -+ -+ if (sp->m_type == TYPE_ENUM_FUNCTION) -+ { -+ sp_returns_type(thd, retstr, sp); -+ } -+ -+ if (!create_string(thd, &log_query, -+ sp->m_type, -+ (sp->m_explicit_name ? sp->m_db.str : NULL), -+ (sp->m_explicit_name ? sp->m_db.length : 0), -+ sp->m_name.str, sp->m_name.length, -+ sp->m_params.str, sp->m_params.length, -+ retstr.c_ptr(), retstr.length(), -+ sp->m_body.str, sp->m_body.length, -+ sp->m_chistics, &(thd->lex->definer->user), -+ &(thd->lex->definer->host), -+ saved_mode)) -+ { -+ WSREP_WARN("SP create string failed: %s", thd->query()); -+ return 1; -+ } -+ return wsrep_to_buf_helper(thd, log_query.ptr(), log_query.length(), buf, buf_len); -+} -+#endif /* WITH_WSREP */ -diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc -index dc059b0..524b764 100644 ---- a/sql/sql_acl.cc -+++ b/sql/sql_acl.cc -@@ -2304,6 +2304,9 @@ int check_change_password(THD *thd, const char *host, const char *user, - return(1); - } - if (!thd->slave_thread && -+#ifdef WITH_WSREP -+ (!WSREP(thd) || !thd->wsrep_applier) && -+#endif /* WITH_WSREP */ - (strcmp(thd->security_ctx->user, user) || - my_strcasecmp(system_charset_info, host, - thd->security_ctx->priv_host))) -@@ -2311,7 +2314,12 @@ int check_change_password(THD *thd, const char *host, const char *user, - if (check_access(thd, UPDATE_ACL, "mysql", NULL, NULL, 1, 0)) - return(1); - } -+#ifdef WITH_WSREP -+ if ((!WSREP(thd) || !thd->wsrep_applier) && -+ !thd->slave_thread && !thd->security_ctx->user[0]) -+#else - if (!thd->slave_thread && !thd->security_ctx->user[0]) -+#endif /* WITH_WSREP */ - { - my_message(ER_PASSWORD_ANONYMOUS_USER, ER(ER_PASSWORD_ANONYMOUS_USER), - MYF(0)); -@@ -2392,7 +2400,7 @@ bool change_password(THD *thd, const char *host, const char *user, - TABLE *table; - /* Buffer should be extended when password length is extended. */ - char buff[512]; -- ulong query_length; -+ ulong query_length=0; - bool save_binlog_row_based; - uchar user_key[MAX_KEY_LENGTH]; - char *plugin_temp= NULL; -@@ -2400,6 +2408,9 @@ bool change_password(THD *thd, const char *host, const char *user, - uint new_password_len= (uint) strlen(new_password); - bool result= 1; - enum mysql_user_table_field password_field= MYSQL_USER_FIELD_PASSWORD; -+#ifdef WITH_WSREP -+ const CSET_STRING query_save = thd->query_string; -+#endif /* WITH_WSREP */ - DBUG_ENTER("change_password"); - DBUG_PRINT("enter",("host: '%s' user: '%s' new_password: '%s'", - host,user,new_password)); -@@ -2407,6 +2418,18 @@ bool change_password(THD *thd, const char *host, const char *user, - - if (check_change_password(thd, host, user, new_password, new_password_len)) - DBUG_RETURN(1); -+#ifdef WITH_WSREP -+ if (WSREP(thd) && !thd->wsrep_applier) -+ { -+ query_length= sprintf(buff, "SET PASSWORD FOR '%-.120s'@'%-.120s'='%-.120s'", -+ user ? user : "", -+ host ? host : "", -+ new_password); -+ thd->set_query_inner(buff, query_length, system_charset_info); -+ -+ WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, (char*)"user", NULL); -+ } -+#endif /* WITH_WSREP */ - - tables.init_one_table("mysql", 5, "user", 4, "user", TL_WRITE); - -@@ -2677,13 +2700,26 @@ bool change_password(THD *thd, const char *host, const char *user, - table->file->has_transactions()); - end: - result|= acl_trans_commit_and_close_tables(thd); -+#ifdef WITH_WSREP -+ if (WSREP(thd) && !thd->wsrep_applier) -+ { -+ WSREP_TO_ISOLATION_END; - -+ thd->query_string = query_save; -+ thd->wsrep_exec_mode = LOCAL_STATE; -+ } -+#endif /* WITH_WSREP */ - /* Restore the state of binlog format */ - DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); - if (save_binlog_row_based) - thd->set_current_stmt_binlog_format_row(); - - DBUG_RETURN(result); -+#ifdef WITH_WSREP -+ error: -+ WSREP_ERROR("Replication of SET PASSWORD failed: %s", buff); -+ DBUG_RETURN(result); -+#endif /* WITH_WSREP */ - } - - -@@ -10114,6 +10150,12 @@ static bool parse_com_change_user_packet(MPVIO_EXT *mpvio, uint packet_length) - if (mpvio->charset_adapter->init_client_charset(uint2korr(ptr))) - DBUG_RETURN(1); - } -+ else -+ { -+ sql_print_warning("Client failed to provide its character set. " -+ "'%s' will be used as client character set.", -+ mpvio->charset_adapter->charset()->csname); -+ } - - /* Convert database and user names to utf8 */ - db_len= copy_and_convert(db_buff, sizeof(db_buff) - 1, system_charset_info, -diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc -index 52b7ff4..7b53fa6 100644 ---- a/sql/sql_admin.cc -+++ b/sql/sql_admin.cc -@@ -1124,6 +1124,7 @@ bool Sql_cmd_optimize_table::execute(THD *thd) - if (check_table_access(thd, SELECT_ACL | INSERT_ACL, first_table, - FALSE, UINT_MAX, FALSE)) - goto error; /* purecov: inspected */ -+ WSREP_TO_ISOLATION_BEGIN(first_table->db, first_table->table_name, NULL) - thd->enable_slow_log= opt_log_slow_admin_statements; - res= (specialflag & SPECIAL_NO_NEW_FUNC) ? - mysql_recreate_table(thd, first_table, true) : -@@ -1156,6 +1157,7 @@ bool Sql_cmd_repair_table::execute(THD *thd) - FALSE, UINT_MAX, FALSE)) - goto error; /* purecov: inspected */ - thd->enable_slow_log= opt_log_slow_admin_statements; -+ WSREP_TO_ISOLATION_BEGIN(first_table->db, first_table->table_name, NULL) - res= mysql_admin_table(thd, first_table, &thd->lex->check_opt, "repair", - TL_WRITE, 1, - MY_TEST(thd->lex->check_opt.sql_flags & TT_USEFRM), -diff --git a/sql/sql_alter.cc b/sql/sql_alter.cc -index 3cf1c93..167daff 100644 ---- a/sql/sql_alter.cc -+++ b/sql/sql_alter.cc -@@ -18,6 +18,9 @@ - // mysql_exchange_partition - #include "sql_base.h" // open_temporary_tables - #include "sql_alter.h" -+#ifdef WITH_WSREP -+#include "wsrep_mysqld.h" -+#endif /* WITH_WSREP */ - - - Alter_info::Alter_info(const Alter_info &rhs, MEM_ROOT *mem_root) -@@ -304,6 +307,17 @@ bool Sql_cmd_alter_table::execute(THD *thd) - - thd->enable_slow_log= opt_log_slow_admin_statements; - -+#ifdef WITH_WSREP -+ TABLE *find_temporary_table(THD *thd, const TABLE_LIST *tl); -+ -+ if ((!thd->is_current_stmt_binlog_format_row() || -+ !find_temporary_table(thd, first_table))) -+ { -+ WSREP_TO_ISOLATION_BEGIN(((lex->name.str) ? select_lex->db : NULL), -+ ((lex->name.str) ? lex->name.str : NULL), -+ first_table); -+ } -+#endif /* WITH_WSREP */ - result= mysql_alter_table(thd, select_lex->db, lex->name.str, - &create_info, - first_table, -@@ -313,6 +327,13 @@ bool Sql_cmd_alter_table::execute(THD *thd) - lex->ignore); - - DBUG_RETURN(result); -+#ifdef WITH_WSREP -+ error: -+ { -+ WSREP_WARN("ALTER TABLE isolation failure"); -+ DBUG_RETURN(TRUE); -+ } -+#endif /* WITH_WSREP */ - } - - -diff --git a/sql/sql_base.cc b/sql/sql_base.cc -index ef5e7dc..a325273 100644 ---- a/sql/sql_base.cc -+++ b/sql/sql_base.cc -@@ -57,6 +57,9 @@ - #include - #endif - #include "table_cache.h" // Table_cache_manager, Table_cache -+#ifdef WITH_WSREP -+#include "wsrep_mysqld.h" -+#endif /* WITH_WSREP */ - - - bool -@@ -5229,6 +5232,22 @@ restart: - goto err; - } - } -+#ifdef WITH_WSREP -+ if ((thd->lex->sql_command== SQLCOM_INSERT || -+ thd->lex->sql_command== SQLCOM_INSERT_SELECT || -+ thd->lex->sql_command== SQLCOM_REPLACE || -+ thd->lex->sql_command== SQLCOM_REPLACE_SELECT || -+ thd->lex->sql_command== SQLCOM_UPDATE || -+ thd->lex->sql_command== SQLCOM_UPDATE_MULTI || -+ thd->lex->sql_command== SQLCOM_LOAD || -+ thd->lex->sql_command== SQLCOM_DELETE) && -+ wsrep_replicate_myisam && -+ (*start)->table && (*start)->table->file->ht->db_type == DB_TYPE_MYISAM) -+ { -+ WSREP_TO_ISOLATION_BEGIN(NULL, NULL, (*start)); -+ } -+ error: -+#endif - - /* Set appropriate TABLE::lock_type. */ - if (tbl && tables->lock_type != TL_UNLOCK && -diff --git a/sql/sql_builtin.cc.in b/sql/sql_builtin.cc.in -index cf7006f..a89bd06 100644 ---- a/sql/sql_builtin.cc.in -+++ b/sql/sql_builtin.cc.in -@@ -23,7 +23,11 @@ extern "C" - extern - #endif - builtin_plugin -- @mysql_mandatory_plugins@ @mysql_optional_plugins@ builtin_binlog_plugin, builtin_mysql_password_plugin; -+ @mysql_mandatory_plugins@ @mysql_optional_plugins@ builtin_binlog_plugin, -+#ifdef WITH_WSREP -+ builtin_wsrep_plugin@mysql_plugin_defs@, -+#endif /* WITH_WSREP */ -+ builtin_mysql_password_plugin; - - struct st_mysql_plugin *mysql_optional_plugins[]= - { -@@ -32,5 +36,9 @@ struct st_mysql_plugin *mysql_optional_plugins[]= - - struct st_mysql_plugin *mysql_mandatory_plugins[]= - { -- builtin_binlog_plugin, builtin_mysql_password_plugin, @mysql_mandatory_plugins@ 0 -+ builtin_binlog_plugin, -+#ifdef WITH_WSREP -+ builtin_wsrep_plugin@mysql_plugin_defs@, -+#endif /* WITH_WSREP */ -+ builtin_mysql_password_plugin, @mysql_mandatory_plugins@ 0 - }; -diff --git a/sql/sql_class.cc b/sql/sql_class.cc -index 79d56ad..cc35779 100644 ---- a/sql/sql_class.cc -+++ b/sql/sql_class.cc -@@ -57,6 +57,10 @@ - #include "debug_sync.h" - #include "sql_parse.h" // is_update_query - #include "sql_callback.h" -+#ifdef WITH_WSREP -+#include "wsrep_mysqld.h" -+#include "wsrep_thd.h" -+#endif - #include "lock.h" - #include "global_threads.h" - #include "mysqld.h" -@@ -816,6 +820,176 @@ char *thd_security_context(THD *thd, char *buffer, unsigned int length, - return buffer; - } - -+#ifdef WITH_WSREP -+extern int wsrep_on(void *thd) -+{ -+ return (int)(WSREP(((THD*)thd))); -+} -+extern "C" bool wsrep_thd_is_wsrep_on(THD *thd) -+{ -+ return thd->variables.wsrep_on; -+} -+ -+extern "C" bool wsrep_consistency_check(void *thd) -+{ -+ return ((THD*)thd)->wsrep_consistency_check == CONSISTENCY_CHECK_RUNNING; -+} -+ -+extern "C" void wsrep_thd_set_exec_mode(THD *thd, enum wsrep_exec_mode mode) -+{ -+ thd->wsrep_exec_mode= mode; -+} -+extern "C" void wsrep_thd_set_query_state( -+ THD *thd, enum wsrep_query_state state) -+{ -+ thd->wsrep_query_state= state; -+} -+extern "C" void wsrep_thd_set_conflict_state( -+ THD *thd, enum wsrep_conflict_state state) -+{ -+ thd->wsrep_conflict_state= state; -+} -+ -+ -+extern "C" enum wsrep_exec_mode wsrep_thd_exec_mode(THD *thd) -+{ -+ return thd->wsrep_exec_mode; -+} -+ -+extern "C" const char *wsrep_thd_exec_mode_str(THD *thd) -+{ -+ return -+ (!thd) ? "void" : -+ (thd->wsrep_exec_mode == LOCAL_STATE) ? "local" : -+ (thd->wsrep_exec_mode == REPL_RECV) ? "applier" : -+ (thd->wsrep_exec_mode == TOTAL_ORDER) ? "total order" : -+ (thd->wsrep_exec_mode == LOCAL_COMMIT) ? "local commit" : "void"; -+} -+ -+extern "C" enum wsrep_query_state wsrep_thd_query_state(THD *thd) -+{ -+ return thd->wsrep_query_state; -+} -+ -+extern "C" const char *wsrep_thd_query_state_str(THD *thd) -+{ -+ return -+ (!thd) ? "void" : -+ (thd->wsrep_query_state == QUERY_IDLE) ? "idle" : -+ (thd->wsrep_query_state == QUERY_EXEC) ? "executing" : -+ (thd->wsrep_query_state == QUERY_COMMITTING) ? "committing" : -+ (thd->wsrep_query_state == QUERY_EXITING) ? "exiting" : -+ (thd->wsrep_query_state == QUERY_ROLLINGBACK) ? "rolling back" : "void"; -+} -+ -+extern "C" enum wsrep_conflict_state wsrep_thd_conflict_state(THD *thd) -+{ -+ return thd->wsrep_conflict_state; -+} -+extern "C" const char *wsrep_thd_conflict_state_str(THD *thd) -+{ -+ return -+ (!thd) ? "void" : -+ (thd->wsrep_conflict_state == NO_CONFLICT) ? "no conflict" : -+ (thd->wsrep_conflict_state == MUST_ABORT) ? "must abort" : -+ (thd->wsrep_conflict_state == ABORTING) ? "aborting" : -+ (thd->wsrep_conflict_state == MUST_REPLAY) ? "must replay" : -+ (thd->wsrep_conflict_state == REPLAYING) ? "replaying" : -+ (thd->wsrep_conflict_state == RETRY_AUTOCOMMIT) ? "retrying" : -+ (thd->wsrep_conflict_state == CERT_FAILURE) ? "cert failure" : "void"; -+} -+ -+extern "C" wsrep_ws_handle_t* wsrep_thd_ws_handle(THD *thd) -+{ -+ return &thd->wsrep_ws_handle; -+} -+ -+extern "C"void wsrep_thd_LOCK(THD *thd) -+{ -+ mysql_mutex_lock(&thd->LOCK_wsrep_thd); -+} -+extern "C"void wsrep_thd_UNLOCK(THD *thd) -+{ -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+} -+extern "C" time_t wsrep_thd_query_start(THD *thd) -+{ -+ return thd->query_start(); -+} -+extern "C" uint32 wsrep_thd_wsrep_rand(THD *thd) -+{ -+ return thd->wsrep_rand; -+} -+extern "C" my_thread_id wsrep_thd_thread_id(THD *thd) -+{ -+ return thd->thread_id; -+} -+extern "C" wsrep_seqno_t wsrep_thd_trx_seqno(THD *thd) -+{ -+ return (thd) ? thd->wsrep_trx_meta.gtid.seqno : WSREP_SEQNO_UNDEFINED; -+} -+extern "C" query_id_t wsrep_thd_query_id(THD *thd) -+{ -+ return thd->query_id; -+} -+extern "C" char *wsrep_thd_query(THD *thd) -+{ -+ return (thd) ? thd->query() : NULL; -+} -+extern "C" query_id_t wsrep_thd_wsrep_last_query_id(THD *thd) -+{ -+ return thd->wsrep_last_query_id; -+} -+extern "C" void wsrep_thd_set_wsrep_last_query_id(THD *thd, query_id_t id) -+{ -+ thd->wsrep_last_query_id= id; -+} -+extern "C" void wsrep_thd_awake(THD *thd, my_bool signal) -+{ -+ if (signal) -+ { -+ mysql_mutex_lock(&thd->LOCK_thd_data); -+ thd->awake(THD::KILL_QUERY); -+ mysql_mutex_unlock(&thd->LOCK_thd_data); -+ } -+ else -+ { -+ mysql_mutex_lock(&LOCK_wsrep_replaying); -+ mysql_cond_broadcast(&COND_wsrep_replaying); -+ mysql_mutex_unlock(&LOCK_wsrep_replaying); -+ } -+} -+extern "C" int wsrep_thd_retry_counter(THD *thd) -+{ -+ return(thd->wsrep_retry_counter); -+} -+ -+extern int -+wsrep_trx_order_before(void *thd1, void *thd2) -+{ -+ if (wsrep_thd_trx_seqno((THD*)thd1) < wsrep_thd_trx_seqno((THD*)thd2)) { -+ WSREP_DEBUG("BF conflict, order: %lld %lld\n", -+ (long long)wsrep_thd_trx_seqno((THD*)thd1), -+ (long long)wsrep_thd_trx_seqno((THD*)thd2)); -+ return 1; -+ } -+ WSREP_DEBUG("waiting for BF, trx order: %lld %lld\n", -+ (long long)wsrep_thd_trx_seqno((THD*)thd1), -+ (long long)wsrep_thd_trx_seqno((THD*)thd2)); -+ return 0; -+} -+extern "C" int -+wsrep_trx_is_aborting(void *thd_ptr) -+{ -+ if (thd_ptr) { -+ if ((((THD *)thd_ptr)->wsrep_conflict_state == MUST_ABORT) || -+ (((THD *)thd_ptr)->wsrep_conflict_state == ABORTING)) { -+ return 1; -+ } -+ } -+ return 0; -+} -+#endif - - /** - Implementation of Drop_table_error_handler::handle_condition(). -@@ -843,7 +1017,6 @@ bool Drop_table_error_handler::handle_condition(THD *thd, - sql_errno == ER_TRG_NO_DEFINER); - } - -- - void Open_tables_state::set_open_tables_state(Open_tables_state *state) - { - this->open_tables= state->open_tables; -@@ -878,7 +1051,11 @@ void Open_tables_state::reset_open_tables_state() - } - - -+#ifdef WITH_WSREP -+THD::THD(bool enable_plugins, bool is_applier) -+#else - THD::THD(bool enable_plugins) -+#endif - :Statement(&main_lex, &main_mem_root, STMT_CONVENTIONAL_EXECUTION, - /* statement id */ 0), - rli_fake(0), rli_slave(NULL), -@@ -911,6 +1088,16 @@ THD::THD(bool enable_plugins) - bootstrap(0), - derived_tables_processing(FALSE), - sp_runtime_ctx(NULL), -+#ifdef WITH_WSREP -+ wsrep_applier(is_applier), -+ wsrep_applier_closing(FALSE), -+ wsrep_client_thread(0), -+ wsrep_po_handle(WSREP_PO_INITIALIZER), -+ wsrep_po_cnt(0), -+ wsrep_po_in_trans(FALSE), -+ wsrep_apply_format(0), -+ wsrep_apply_toi(false), -+#endif - m_parser_state(NULL), - #if defined(ENABLED_DEBUG_SYNC) - debug_sync_control(0), -@@ -1001,6 +1188,22 @@ THD::THD(bool enable_plugins) - *scramble= '\0'; - skip_gtid_rollback= false; - -+#ifdef WITH_WSREP -+ mysql_mutex_init(key_LOCK_wsrep_thd, &LOCK_wsrep_thd, MY_MUTEX_INIT_FAST); -+ mysql_cond_init(key_COND_wsrep_thd, &COND_wsrep_thd, NULL); -+ wsrep_ws_handle.trx_id = WSREP_UNDEFINED_TRX_ID; -+ wsrep_ws_handle.opaque = NULL; -+ wsrep_retry_counter = 0; -+ wsrep_PA_safe = true; -+ wsrep_retry_query = NULL; -+ wsrep_retry_query_len = 0; -+ wsrep_retry_command = COM_CONNECT; -+ wsrep_consistency_check = NO_CONSISTENCY_CHECK; -+ wsrep_status_vars = 0; -+ wsrep_mysql_replicated = 0; -+ wsrep_TOI_pre_query = NULL; -+ wsrep_TOI_pre_query_len = 0; -+#endif - /* Call to init() below requires fully initialized Open_tables_state. */ - reset_open_tables_state(); - -@@ -1033,6 +1236,13 @@ THD::THD(bool enable_plugins) - randominit(&rand, tmp + (ulong) &rand, tmp + (ulong) ::global_query_id); - substitute_null_with_insert_id = FALSE; - thr_lock_info_init(&lock_info); /* safety: will be reset after start */ -+#ifdef WITH_WSREP -+ lock_info.mysql_thd= (void *)this; -+ lock_info.in_lock_tables= false; -+#ifdef WSREP_PROC_INFO -+ wsrep_info[sizeof(wsrep_info) - 1] = '\0'; /* make sure it is 0-terminated */ -+#endif /* WSREP_PROC_INFO */ -+#endif /* WITH_WSREP */ - - m_internal_handler= NULL; - m_binlog_invoker= FALSE; -@@ -1379,6 +1589,22 @@ void THD::init(void) - reset_current_stmt_binlog_format_row(); - reset_binlog_local_stmt_filter(); - memset(&status_var, 0, sizeof(status_var)); -+#ifdef WITH_WSREP -+ wsrep_exec_mode= wsrep_applier ? REPL_RECV : LOCAL_STATE; -+ wsrep_conflict_state= NO_CONFLICT; -+ wsrep_query_state= QUERY_IDLE; -+ wsrep_last_query_id= 0; -+ wsrep_trx_meta.gtid= WSREP_GTID_UNDEFINED; -+ wsrep_trx_meta.depends_on= WSREP_SEQNO_UNDEFINED; -+ wsrep_converted_lock_session= false; -+ wsrep_retry_counter= 0; -+ wsrep_rli= NULL; -+ wsrep_PA_safe= true; -+ wsrep_consistency_check = NO_CONSISTENCY_CHECK; -+ wsrep_mysql_replicated = 0; -+ wsrep_TOI_pre_query = NULL; -+ wsrep_TOI_pre_query_len = 0; -+#endif - binlog_row_event_extra_data= 0; - - if (variables.sql_log_bin) -@@ -1573,6 +1799,13 @@ void THD::release_resources() - plugin_thdvar_cleanup(this); - - m_release_resources_done= true; -+#ifdef WITH_WSREP -+ mysql_mutex_lock(&LOCK_wsrep_thd); -+ mysql_mutex_unlock(&LOCK_wsrep_thd); -+ mysql_mutex_destroy(&LOCK_wsrep_thd); -+ if (wsrep_rli) delete wsrep_rli; -+ if (wsrep_status_vars) wsrep->stats_free(wsrep, wsrep_status_vars); -+#endif - } - - -@@ -1873,7 +2106,19 @@ bool THD::notify_shared_lock(MDL_context_owner *ctx_in_use, - (e.g. see partitioning code). - */ - if (!thd_table->needs_reopen()) -+#ifdef WITH_WSREP -+ { -+ signalled|= mysql_lock_abort_for_thread(this, thd_table); -+ if (this && WSREP(this) && wsrep_thd_is_BF((void *)this, FALSE)) -+ { -+ WSREP_DEBUG("remove_table_from_cache: %llu", -+ (unsigned long long) this->real_id); -+ wsrep_abort_thd((void *)this, (void *)in_use, FALSE); -+ } -+ } -+#else - signalled|= mysql_lock_abort_for_thread(this, thd_table); -+#endif - } - mysql_mutex_unlock(&in_use->LOCK_thd_data); - } -@@ -2438,6 +2683,13 @@ bool sql_exchange::escaped_given(void) - bool select_send::send_result_set_metadata(List &list, uint flags) - { - bool res; -+#ifdef WITH_WSREP -+ if (WSREP(thd) && thd->wsrep_retry_query) -+ { -+ WSREP_DEBUG("skipping select metadata"); -+ return FALSE; -+ } -+#endif /* WITH_WSREP */ - if (!(res= thd->protocol->send_result_set_metadata(&list, flags))) - is_result_set_started= 1; - return res; -@@ -4206,8 +4458,13 @@ extern "C" int thd_non_transactional_update(const MYSQL_THD thd) - - extern "C" int thd_binlog_format(const MYSQL_THD thd) - { -+#ifdef WITH_WSREP -+ if (((WSREP(thd) && wsrep_emulate_bin_log) || mysql_bin_log.is_open()) && -+ (thd->variables.option_bits & OPTION_BIN_LOG)) -+#else - if (mysql_bin_log.is_open() && (thd->variables.option_bits & OPTION_BIN_LOG)) -- return (int) thd->variables.binlog_format; -+#endif -+ return (int) WSREP_BINLOG_FORMAT(thd->variables.binlog_format); - else - return BINLOG_FORMAT_UNSPEC; - } -diff --git a/sql/sql_class.h b/sql/sql_class.h -index 17f0055..ded32a5 100644 ---- a/sql/sql_class.h -+++ b/sql/sql_class.h -@@ -70,6 +70,18 @@ void set_thd_stage_info(void *thd, - #define THD_STAGE_INFO(thd, stage) \ - (thd)->enter_stage(& stage, NULL, __func__, __FILE__, __LINE__) - -+#ifdef WITH_WSREP -+#include "wsrep_mysqld.h" -+struct wsrep_thd_shadow { -+ ulonglong options; -+ uint server_status; -+ enum wsrep_exec_mode wsrep_exec_mode; -+ Vio *vio; -+ ulong tx_isolation; -+ char *db; -+ size_t db_length; -+}; -+#endif - class Reprepare_observer; - class Relay_log_info; - -@@ -547,6 +559,12 @@ typedef struct system_variables - my_bool sysdate_is_now; - my_bool binlog_rows_query_log_events; - -+#ifdef WITH_WSREP -+ my_bool wsrep_on; -+ my_bool wsrep_causal_reads; -+ uint wsrep_sync_wait; -+ ulong wsrep_retry_autocommit; -+#endif - double long_query_time_double; - - my_bool pseudo_slave_mode; -@@ -2321,7 +2339,8 @@ public: - int is_current_stmt_binlog_format_row() const { - DBUG_ASSERT(current_stmt_binlog_format == BINLOG_FORMAT_STMT || - current_stmt_binlog_format == BINLOG_FORMAT_ROW); -- return current_stmt_binlog_format == BINLOG_FORMAT_ROW; -+ return (WSREP_BINLOG_FORMAT((ulong)current_stmt_binlog_format) == -+ BINLOG_FORMAT_ROW); - } - /** Tells whether the given optimizer_switch flag is on */ - inline bool optimizer_switch_flag(ulonglong flag) const -@@ -3114,6 +3133,45 @@ public: - query_id_t first_query_id; - } binlog_evt_union; - -+#ifdef WITH_WSREP -+ const bool wsrep_applier; /* dedicated slave applier thread */ -+ bool wsrep_applier_closing; /* applier marked to close */ -+ bool wsrep_client_thread; /* to identify client threads*/ -+ enum wsrep_exec_mode wsrep_exec_mode; -+ query_id_t wsrep_last_query_id; -+ enum wsrep_query_state wsrep_query_state; -+ enum wsrep_conflict_state wsrep_conflict_state; -+ mysql_mutex_t LOCK_wsrep_thd; -+ mysql_cond_t COND_wsrep_thd; -+ // changed from wsrep_seqno_t to wsrep_trx_meta_t in wsrep API rev 75 -+ // wsrep_seqno_t wsrep_trx_seqno; -+ wsrep_trx_meta_t wsrep_trx_meta; -+ uint32 wsrep_rand; -+ Relay_log_info* wsrep_rli; -+ bool wsrep_converted_lock_session; -+ wsrep_ws_handle_t wsrep_ws_handle; -+#ifdef WSREP_PROC_INFO -+ char wsrep_info[128]; /* string for dynamic proc info */ -+#endif /* WSREP_PROC_INFO */ -+ ulong wsrep_retry_counter; // of autocommit -+ bool wsrep_PA_safe; -+ char* wsrep_retry_query; -+ size_t wsrep_retry_query_len; -+ enum enum_server_command wsrep_retry_command; -+ enum wsrep_consistency_check_mode -+ wsrep_consistency_check; -+ wsrep_stats_var* wsrep_status_vars; -+ int wsrep_mysql_replicated; -+ const char* wsrep_TOI_pre_query; /* a query to apply before -+ the actual TOI query */ -+ size_t wsrep_TOI_pre_query_len; -+ wsrep_po_handle_t wsrep_po_handle; -+ size_t wsrep_po_cnt; -+ my_bool wsrep_po_in_trans; -+ rpl_sid wsrep_po_sid; -+ void* wsrep_apply_format; -+ bool wsrep_apply_toi; /* applier processing in TOI */ -+#endif /* WITH_WSREP */ - /** - Internal parser state. - Note that since the parser is not re-entrant, we keep only one parser -@@ -3149,7 +3207,11 @@ public: - // We don't want to load/unload plugins for unit tests. - bool m_enable_plugins; - -+#ifdef WITH_WSREP -+ THD(bool enable_plugins= true, bool is_applier = false); -+#else - THD(bool enable_plugins= true); -+#endif - - /* - The THD dtor is effectively split in two: -@@ -3657,7 +3719,7 @@ public: - tests fail and so force them to propagate the - lex->binlog_row_based_if_mixed upwards to the caller. - */ -- if ((variables.binlog_format == BINLOG_FORMAT_MIXED) && -+ if ((WSREP_BINLOG_FORMAT(variables.binlog_format) == BINLOG_FORMAT_MIXED)&& - (in_sub_stmt == 0)) - set_current_stmt_binlog_format_row(); - -@@ -3699,7 +3761,7 @@ public: - show_system_thread(system_thread))); - if (in_sub_stmt == 0) - { -- if (variables.binlog_format == BINLOG_FORMAT_ROW) -+ if (WSREP_BINLOG_FORMAT(variables.binlog_format) == BINLOG_FORMAT_ROW) - set_current_stmt_binlog_format_row(); - else if (temporary_tables == NULL) - clear_current_stmt_binlog_format_row(); -diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc -index 67b671b..9034a6e 100644 ---- a/sql/sql_connect.cc -+++ b/sql/sql_connect.cc -@@ -57,6 +57,9 @@ using std::max; - #else - #define MIN_HANDSHAKE_SIZE 6 - #endif /* HAVE_OPENSSL && !EMBEDDED_LIBRARY */ -+#ifdef WITH_WSREP -+#include "wsrep_mysqld.h" -+#endif - - /* - Get structure for logging connection data for the current user -@@ -706,7 +709,11 @@ bool setup_connection_thread_globals(THD *thd) - { - if (thd->store_globals()) - { -+#ifdef WITH_WSREP -+ close_connection(thd, ER_OUT_OF_RESOURCES, 1); -+#else - close_connection(thd, ER_OUT_OF_RESOURCES); -+#endif - statistic_increment(aborted_connects,&LOCK_status); - MYSQL_CALLBACK(thread_scheduler, end_thread, (thd, 0)); - return 1; // Error -@@ -772,6 +779,17 @@ bool login_connection(THD *thd) - void end_connection(THD *thd) - { - NET *net= &thd->net; -+#ifdef WITH_WSREP -+ if (WSREP(thd)) -+ { -+ wsrep_status_t rcode= wsrep->free_connection(wsrep, thd->thread_id); -+ if (rcode) { -+ WSREP_WARN("wsrep failed to free connection context: %lu, code: %d", -+ thd->thread_id, rcode); -+ } -+ } -+ thd->wsrep_client_thread= 0; -+#endif - plugin_thdvar_cleanup(thd); - - /* -@@ -912,6 +930,9 @@ bool thd_prepare_connection(THD *thd) - (char *) thd->security_ctx->host_or_ip); - - prepare_new_connection_state(thd); -+#ifdef WITH_WSREP -+ thd->wsrep_client_thread= 1; -+#endif /* WITH_WSREP */ - return FALSE; - } - -@@ -933,7 +954,11 @@ void do_handle_one_connection(THD *thd_arg) - - if (MYSQL_CALLBACK_ELSE(thread_scheduler, init_new_connection_thread, (), 0)) - { -+#ifdef WITH_WSREP -+ close_connection(thd, ER_OUT_OF_RESOURCES, 1); -+#else - close_connection(thd, ER_OUT_OF_RESOURCES); -+#endif - statistic_increment(aborted_connects,&LOCK_status); - MYSQL_CALLBACK(thread_scheduler, end_thread, (thd, 0)); - return; -@@ -983,9 +1008,21 @@ void do_handle_one_connection(THD *thd_arg) - break; - } - end_connection(thd); -+#ifdef WITH_WSREP -+ if (WSREP(thd)) -+ { -+ mysql_mutex_lock(&thd->LOCK_wsrep_thd); -+ thd->wsrep_query_state= QUERY_EXITING; -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ } -+#endif - - end_thread: -+#ifdef WITH_WSREP -+ close_connection(thd, 0, 1); -+#else - close_connection(thd); -+#endif - if (MYSQL_CALLBACK_ELSE(thread_scheduler, end_thread, (thd, 1), 0)) - return; // Probably no-threads - -diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc -index f3e8876..1b9ef9b 100644 ---- a/sql/sql_delete.cc -+++ b/sql/sql_delete.cc -@@ -451,7 +451,11 @@ cleanup: - /* See similar binlogging code in sql_update.cc, for comments */ - if ((error < 0) || thd->transaction.stmt.cannot_safely_rollback()) - { -+#ifdef WITH_WSREP -+ if ((WSREP_EMULATE_BINLOG(thd) || mysql_bin_log.is_open())) -+#else - if (mysql_bin_log.is_open()) -+#endif - { - int errcode= 0; - if (error < 0) -@@ -896,7 +900,11 @@ void multi_delete::abort_result_set() - /* - there is only side effects; to binlog with the error - */ -+#ifdef WITH_WSREP -+ if (WSREP_EMULATE_BINLOG(thd) || mysql_bin_log.is_open()) -+#else - if (mysql_bin_log.is_open()) -+#endif - { - int errcode= query_error_code(thd, thd->killed == THD::NOT_KILLED); - /* possible error of writing binary log is ignored deliberately */ -@@ -1067,7 +1075,11 @@ bool multi_delete::send_eof() - } - if ((local_error == 0) || thd->transaction.stmt.cannot_safely_rollback()) - { -+#ifdef WITH_WSREP -+ if (WSREP_EMULATE_BINLOG(thd) || mysql_bin_log.is_open()) -+#else - if (mysql_bin_log.is_open()) -+#endif - { - int errcode= 0; - if (local_error == 0) -diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc -index 114beaa..3da18a4 100644 ---- a/sql/sql_insert.cc -+++ b/sql/sql_insert.cc -@@ -1124,7 +1124,11 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, - thd->transaction.stmt.cannot_safely_rollback() || - was_insert_delayed) - { -+#ifdef WITH_WSREP -+ if (WSREP_EMULATE_BINLOG(thd) || mysql_bin_log.is_open()) -+#else - if (mysql_bin_log.is_open()) -+#endif - { - int errcode= 0; - if (error <= 0) -@@ -3773,7 +3777,13 @@ bool select_insert::send_eof() - DBUG_PRINT("enter", ("trans_table=%d, table_type='%s'", - trans_table, table->file->table_type())); - -+#ifdef WITH_WSREP -+ error= (thd->wsrep_conflict_state == MUST_ABORT || -+ thd->wsrep_conflict_state == CERT_FAILURE) ? -1 : -+ (bulk_insert_started ? -+#else - error= (bulk_insert_started ? -+#endif /* WITH_WSREP */ - table->file->ha_end_bulk_insert() : 0); - if (!error && thd->is_error()) - error= thd->get_stmt_da()->sql_errno(); -@@ -3800,8 +3810,13 @@ bool select_insert::send_eof() - events are in the transaction cache and will be written when - ha_autocommit_or_rollback() is issued below. - */ -+#ifdef WITH_WSREP -+ if ((WSREP_EMULATE_BINLOG(thd) || mysql_bin_log.is_open()) && -+ (!error || thd->transaction.stmt.cannot_safely_rollback())) -+#else - if (mysql_bin_log.is_open() && - (!error || thd->transaction.stmt.cannot_safely_rollback())) -+#endif - { - int errcode= 0; - if (!error) -@@ -3886,7 +3901,11 @@ void select_insert::abort_result_set() { - transactional_table= table->file->has_transactions(); - if (thd->transaction.stmt.cannot_safely_rollback()) - { -+#ifdef WITH_WSREP -+ if (WSREP_EMULATE_BINLOG(thd) || mysql_bin_log.is_open()) -+#else - if (mysql_bin_log.is_open()) -+#endif - { - int errcode= query_error_code(thd, thd->killed == THD::NOT_KILLED); - /* error of writing binary log is ignored */ -@@ -4293,7 +4312,11 @@ select_create::binlog_show_create_table(TABLE **tables, uint count) - /* show_database */ TRUE); - DBUG_ASSERT(result == 0); /* store_create_info() always return 0 */ - -+#ifdef WITH_WSREP -+ if (WSREP_EMULATE_BINLOG(thd) || mysql_bin_log.is_open()) -+#else - if (mysql_bin_log.is_open()) -+#endif /* WITH_WSREP */ - { - int errcode= query_error_code(thd, thd->killed == THD::NOT_KILLED); - result= thd->binlog_query(THD::STMT_QUERY_TYPE, -@@ -4303,6 +4326,9 @@ select_create::binlog_show_create_table(TABLE **tables, uint count) - /* suppress_use */ FALSE, - errcode); - } -+#ifdef WITH_WSREP -+ ha_wsrep_fake_trx_id(thd); -+#endif - return result; - } - -@@ -4368,6 +4394,18 @@ bool select_create::send_eof() - { - trans_commit_stmt(thd); - trans_commit_implicit(thd); -+#ifdef WITH_WSREP -+ mysql_mutex_lock(&thd->LOCK_wsrep_thd); -+ if (thd->wsrep_conflict_state != NO_CONFLICT) -+ { -+ WSREP_DEBUG("select_create commit failed, thd: %lu err: %d %s", -+ thd->thread_id, thd->wsrep_conflict_state, thd->query()); -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ abort_result_set(); -+ return TRUE; -+ } -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+#endif /* WITH_WSREP */ - } - - table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY); -diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc -index 0ba8bcb..f9e1e6b 100644 ---- a/sql/sql_parse.cc -+++ b/sql/sql_parse.cc -@@ -107,6 +107,12 @@ using std::min; - - #define FLAGSTR(V,F) ((V)&(F)?#F" ":"") - -+#ifdef WITH_WSREP -+#include "wsrep_mysqld.h" -+#include "wsrep_thd.h" -+static void wsrep_mysql_parse(THD *thd, char *rawbuf, uint length, -+ Parser_state *parser_state); -+#endif /* WITH_WSREP */ - /** - @defgroup Runtime_Environment Runtime Environment - @{ -@@ -823,7 +829,11 @@ void do_handle_bootstrap(THD *thd) - if (my_thread_init() || thd->store_globals()) - { - #ifndef EMBEDDED_LIBRARY -+#ifdef WITH_WSREP -+ close_connection(thd, ER_OUT_OF_RESOURCES, 1); -+#else - close_connection(thd, ER_OUT_OF_RESOURCES); -+#endif /* WITH_WSREP */ - #endif - thd->fatal_error(); - goto end; -@@ -913,7 +923,18 @@ bool do_command(THD *thd) - enum enum_server_command command; - - DBUG_ENTER("do_command"); -- -+#ifdef WITH_WSREP -+ if (WSREP(thd)) -+ { -+ mysql_mutex_lock(&thd->LOCK_wsrep_thd); -+ thd->wsrep_query_state= QUERY_IDLE; -+ if (thd->wsrep_conflict_state==MUST_ABORT) -+ { -+ wsrep_client_rollback(thd); -+ } -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ } -+#endif /* WITH_WSREP */ - /* - indicator of uninitialized lex => normal flow of errors handling - (see my_message_sql) -@@ -952,7 +973,6 @@ bool do_command(THD *thd) - matter here, because the read/recv() below doesn't use it. - */ - DEBUG_SYNC(thd, "before_do_command_net_read"); -- - /* - Because of networking layer callbacks in place, - this call will maintain the following instrumentation: -@@ -968,12 +988,45 @@ bool do_command(THD *thd) - packet_length= my_net_read(net); - thd->m_server_idle= false; - -+#ifdef WITH_WSREP -+ if (WSREP(thd)) { -+ mysql_mutex_lock(&thd->LOCK_wsrep_thd); -+ /* these THD's are aborted or are aborting during being idle */ -+ if (thd->wsrep_conflict_state == ABORTING) -+ { -+ while (thd->wsrep_conflict_state == ABORTING) { -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ my_sleep(1000); -+ mysql_mutex_lock(&thd->LOCK_wsrep_thd); -+ } -+ thd->store_globals(); -+ } -+ else if (thd->wsrep_conflict_state == ABORTED) -+ { -+ thd->store_globals(); -+ } -+ -+ thd->wsrep_query_state= QUERY_EXEC; -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ } -+#endif /* WITH_WSREP */ - if (packet_length == packet_error) - { - DBUG_PRINT("info",("Got error %d reading command from socket %s", - net->error, - vio_description(net->vio))); - -+#ifdef WITH_WSREP -+ if (WSREP(thd)) { -+ mysql_mutex_lock(&thd->LOCK_wsrep_thd); -+ if (thd->wsrep_conflict_state == MUST_ABORT) -+ { -+ DBUG_PRINT("wsrep",("aborted for wsrep rollback: %lu", thd->real_id)); -+ wsrep_client_rollback(thd); -+ } -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ } -+#endif /* WITH_WSREP */ - /* Instrument this broken statement as "statement/com/error" */ - thd->m_statement_psi= MYSQL_REFINE_STATEMENT(thd->m_statement_psi, - com_statement_info[COM_END].m_key); -@@ -1026,6 +1079,33 @@ bool do_command(THD *thd) - vio_description(net->vio), command, - command_name[command].str)); - -+#ifdef WITH_WSREP -+ if (WSREP(thd)) { -+ /* -+ * bail out if DB snapshot has not been installed. We however, -+ * allow queries "SET" and "SHOW", they are trapped later in execute_command -+ */ -+ if (thd->variables.wsrep_on && !thd->wsrep_applier && !wsrep_ready && -+ command != COM_QUERY && -+ command != COM_PING && -+ command != COM_QUIT && -+ command != COM_PROCESS_INFO && -+ command != COM_PROCESS_KILL && -+ command != COM_SET_OPTION && -+ command != COM_SHUTDOWN && -+ command != COM_SLEEP && -+ command != COM_STATISTICS && -+ command != COM_TIME && -+ command != COM_END -+ ) { -+ my_error(ER_UNKNOWN_COM_ERROR, MYF(0), -+ "WSREP has not yet prepared node for application use"); -+ thd->protocol->end_statement(); -+ return_value= FALSE; -+ goto out; -+ } -+ } -+#endif /* WITH_WSREP */ - /* Restore read timeout value */ - my_net_set_read_timeout(net, thd->variables.net_read_timeout); - -@@ -1033,6 +1113,22 @@ bool do_command(THD *thd) - - return_value= dispatch_command(command, thd, packet+1, (uint) (packet_length-1)); - -+#ifdef WITH_WSREP -+ if (WSREP(thd)) { -+ while (thd->wsrep_conflict_state== RETRY_AUTOCOMMIT) -+ { -+ return_value= dispatch_command(command, thd, thd->wsrep_retry_query, -+ thd->wsrep_retry_query_len); -+ } -+ } -+ if (thd->wsrep_retry_query && thd->wsrep_conflict_state != REPLAYING) -+ { -+ my_free(thd->wsrep_retry_query); -+ thd->wsrep_retry_query = NULL; -+ thd->wsrep_retry_query_len = 0; -+ thd->wsrep_retry_command = COM_CONNECT; -+ } -+#endif /* WITH_WSREP */ - out: - /* The statement instrumentation must be closed in all cases. */ - DBUG_ASSERT(thd->m_statement_psi == NULL); -@@ -1108,6 +1204,36 @@ static my_bool deny_updates_if_read_only_option(THD *thd, - DBUG_RETURN(FALSE); - } - -+#ifdef WITH_WSREP -+static my_bool wsrep_read_only_option(THD *thd, TABLE_LIST *all_tables) -+{ -+ int opt_readonly_saved = opt_readonly; -+ ulong flag_saved = (ulong)(thd->security_ctx->master_access & SUPER_ACL); -+ -+ opt_readonly = 0; -+ thd->security_ctx->master_access &= ~SUPER_ACL; -+ -+ my_bool ret = !deny_updates_if_read_only_option(thd, all_tables); -+ -+ opt_readonly = opt_readonly_saved; -+ thd->security_ctx->master_access |= flag_saved; -+ -+ return ret; -+} -+ -+static void wsrep_copy_query(THD *thd) -+{ -+ thd->wsrep_retry_command = thd->get_command(); -+ thd->wsrep_retry_query_len = thd->query_length(); -+ if (thd->wsrep_retry_query) { -+ my_free(thd->wsrep_retry_query); -+ } -+ thd->wsrep_retry_query = (char *)my_malloc( -+ thd->wsrep_retry_query_len + 1, MYF(0)); -+ strncpy(thd->wsrep_retry_query, thd->query(), thd->wsrep_retry_query_len); -+ thd->wsrep_retry_query[thd->wsrep_retry_query_len] = '\0'; -+} -+#endif /* WITH_WSREP */ - /** - Perform one connection-level (COM_XXXX) command. - -@@ -1136,7 +1262,42 @@ bool dispatch_command(enum enum_server_command command, THD *thd, - bool error= 0; - DBUG_ENTER("dispatch_command"); - DBUG_PRINT("info",("packet: '%*.s'; command: %d", packet_length, packet, command)); -+#ifdef WITH_WSREP -+ if (WSREP(thd)) { -+ if (!thd->in_multi_stmt_transaction_mode()) -+ { -+ thd->wsrep_PA_safe= true; -+ } - -+ mysql_mutex_lock(&thd->LOCK_wsrep_thd); -+ thd->wsrep_query_state= QUERY_EXEC; -+ if (thd->wsrep_conflict_state== RETRY_AUTOCOMMIT) -+ { -+ thd->wsrep_conflict_state= NO_CONFLICT; -+ } -+ if (thd->wsrep_conflict_state== MUST_ABORT) -+ { -+ wsrep_client_rollback(thd); -+ } -+ if (thd->wsrep_conflict_state== ABORTED) -+ { -+ my_error(ER_LOCK_DEADLOCK, MYF(0), "wsrep aborted transaction"); -+ WSREP_DEBUG("Deadlock error for: %s", thd->query()); -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ thd->killed = THD::NOT_KILLED; -+ thd->mysys_var->abort = 0; -+ thd->wsrep_conflict_state = NO_CONFLICT; -+ thd->wsrep_retry_counter = 0; -+ /* -+ Increment threads running to compensate dec_thread_running() called -+ after dispatch_end label. -+ */ -+ inc_thread_running(); -+ goto dispatch_end; -+ } -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ } -+#endif /* WITH_WSREP */ - /* SHOW PROFILE instrumentation, begin */ - #if defined(ENABLED_PROFILING) - thd->profiling.start_new_query(); -@@ -1319,6 +1480,37 @@ bool dispatch_command(enum enum_server_command command, THD *thd, - - DBUG_PRINT("query",("%-.4096s",thd->query())); - -+#ifdef WITH_WSREP -+ -+ if (WSREP(thd)) { -+ if (!thd->in_multi_stmt_transaction_mode()) -+ { -+ thd->wsrep_PA_safe= true; -+ } -+ -+ mysql_mutex_lock(&thd->LOCK_wsrep_thd); -+ thd->wsrep_query_state= QUERY_EXEC; -+ if (thd->wsrep_conflict_state== RETRY_AUTOCOMMIT) -+ { -+ thd->wsrep_conflict_state= NO_CONFLICT; -+ } -+ -+ if (thd->wsrep_conflict_state== MUST_ABORT) -+ { -+ wsrep_client_rollback(thd); -+ } -+ if (thd->wsrep_conflict_state== ABORTED) -+ { -+ my_error(ER_LOCK_DEADLOCK, MYF(0), "wsrep aborted transaction"); -+ WSREP_DEBUG("Deadlock error for: %s", thd->query()); -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ thd->killed= THD::NOT_KILLED; -+ thd->mysys_var->abort= 0; -+ goto dispatch_end; -+ } -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ } -+#endif /* WITH_WSREP */ - #if defined(ENABLED_PROFILING) - thd->profiling.set_query_source(thd->query(), thd->query_length()); - #endif -@@ -1329,7 +1521,11 @@ bool dispatch_command(enum enum_server_command command, THD *thd, - if (parser_state.init(thd, thd->query(), thd->query_length())) - break; - -+#ifdef WITH_WSREP -+ wsrep_mysql_parse(thd, thd->query(), thd->query_length(), &parser_state); -+#else - mysql_parse(thd, thd->query(), thd->query_length(), &parser_state); -+#endif /* WITH_WSREP */ - - while (!thd->killed && (parser_state.m_lip.found_semicolon != NULL) && - ! thd->is_error()) -@@ -1401,10 +1597,19 @@ bool dispatch_command(enum enum_server_command command, THD *thd, - Count each statement from the client. - */ - statistic_increment(thd->status_var.questions, &LOCK_status); -+#ifdef WITH_WSREP -+ if (!WSREP(thd)) -+ thd->set_time(); /* Reset the query start time. */ -+#else - thd->set_time(); /* Reset the query start time. */ -+#endif /* WITH_WSREP */ - parser_state.reset(beginning_of_next_stmt, length); - /* TODO: set thd->lex->sql_command to SQLCOM_END here */ -+#ifdef WITH_WSREP -+ wsrep_mysql_parse(thd, beginning_of_next_stmt, length, &parser_state); -+#else - mysql_parse(thd, beginning_of_next_stmt, length, &parser_state); -+#endif /* WITH_WSREP */ - } - - DBUG_PRINT("info",("query ready")); -@@ -1746,6 +1951,26 @@ bool dispatch_command(enum enum_server_command command, THD *thd, - my_message(ER_UNKNOWN_COM_ERROR, ER(ER_UNKNOWN_COM_ERROR), MYF(0)); - break; - } -+#ifdef WITH_WSREP -+ dispatch_end: -+ -+ if (WSREP(thd)) { -+ /* wsrep BF abort in query exec phase */ -+ mysql_mutex_lock(&thd->LOCK_wsrep_thd); -+ if ((thd->wsrep_conflict_state != REPLAYING) && -+ (thd->wsrep_conflict_state != RETRY_AUTOCOMMIT)) { -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ -+ thd->update_server_status(); -+ thd->protocol->end_statement(); -+ query_cache_end_of_result(thd); -+ } -+ else -+ { -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ } -+ } else { /* if (WSREP(thd))... */ -+#endif /* WITH_WSREP */ - - done: - DBUG_ASSERT(thd->derived_tables == NULL && -@@ -1758,6 +1983,9 @@ done: - thd->send_kill_message(); - thd->protocol->end_statement(); - query_cache_end_of_result(thd); -+#ifdef WITH_WSREP -+ } -+#endif /* WITH_WSREP */ - - if (!thd->is_error() && !thd->killed_errno()) - mysql_audit_general(thd, MYSQL_AUDIT_GENERAL_RESULT, 0, 0); -@@ -2256,6 +2484,13 @@ err: - return TRUE; - } - -+#ifdef WITH_WSREP -+static bool wsrep_is_show_query(enum enum_sql_command command) -+{ -+ DBUG_ASSERT(command >= 0 && command <= SQLCOM_END); -+ return (sql_command_flags[command] & CF_STATUS_COMMAND) != 0; -+} -+#endif /* WITH_WSREP */ - - /** - Execute command saved in thd and lex->sql_command. -@@ -2497,7 +2732,6 @@ mysql_execute_command(THD *thd) - #ifdef HAVE_REPLICATION - } /* endif unlikely slave */ - #endif -- - status_var_increment(thd->status_var.com_stat[lex->sql_command]); - - Opt_trace_start ots(thd, all_tables, lex->sql_command, &lex->var_list, -@@ -2506,6 +2740,45 @@ mysql_execute_command(THD *thd) - - Opt_trace_object trace_command(&thd->opt_trace); - Opt_trace_array trace_command_steps(&thd->opt_trace, "steps"); -+#ifdef WITH_WSREP -+ if (WSREP(thd)) { -+ /* -+ change LOCK TABLE WRITE to transaction -+ */ -+ if (lex->sql_command== SQLCOM_LOCK_TABLES && wsrep_convert_LOCK_to_trx) -+ { -+ for (TABLE_LIST *table= all_tables; table; table= table->next_global) -+ { -+ if (table->lock_type >= TL_WRITE_ALLOW_WRITE) -+ { -+ lex->sql_command= SQLCOM_BEGIN; -+ thd->wsrep_converted_lock_session= true; -+ break; -+ } -+ } -+ } -+ if (lex->sql_command== SQLCOM_UNLOCK_TABLES && -+ thd->wsrep_converted_lock_session) -+ { -+ thd->wsrep_converted_lock_session= false; -+ lex->sql_command= SQLCOM_COMMIT; -+ lex->tx_release= TVL_NO; -+ } -+ -+ /* -+ * bail out if DB snapshot has not been installed. We however, -+ * allow SET and SHOW queries -+ */ -+ if (thd->variables.wsrep_on && !thd->wsrep_applier && !wsrep_ready && -+ lex->sql_command != SQLCOM_SET_OPTION && -+ !wsrep_is_show_query(lex->sql_command)) -+ { -+ my_error(ER_UNKNOWN_COM_ERROR, MYF(0), -+ "WSREP has not yet prepared node for application use"); -+ goto error; -+ } -+ } -+#endif /* WITH_WSREP */ - - DBUG_ASSERT(thd->transaction.stmt.cannot_safely_rollback() == FALSE); - -@@ -2546,7 +2819,13 @@ mysql_execute_command(THD *thd) - - /* Commit the normal transaction if one is active. */ - if (trans_commit_implicit(thd)) -+ { -+ thd->mdl_context.release_transactional_locks(); -+#ifdef WITH_WSREP -+ WSREP_DEBUG("implicit commit failed, MDL released: %lu", thd->thread_id); -+#endif /* WITH_WSREP */ - goto error; -+ } - /* Release metadata locks acquired in this transaction. */ - thd->mdl_context.release_transactional_locks(); - } -@@ -2600,7 +2879,9 @@ mysql_execute_command(THD *thd) - { - system_status_var old_status_var= thd->status_var; - thd->initial_status_var= &old_status_var; -- -+#ifdef WITH_WSREP -+ if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error; -+#endif /* WITH_WSREP */ - if (!(res= select_precheck(thd, lex, all_tables, first_table))) - res= execute_sqlcom_select(thd, all_tables); - -@@ -2616,6 +2897,9 @@ mysql_execute_command(THD *thd) - &old_status_var); - thd->status_var= old_status_var; - mysql_mutex_unlock(&LOCK_status); -+#ifdef WITH_WSREP -+ if (lex->sql_command == SQLCOM_SHOW_STATUS) wsrep_free_status(thd); -+#endif /* WITH_WSREP */ - break; - } - case SQLCOM_SHOW_EVENTS: -@@ -2633,12 +2917,22 @@ mysql_execute_command(THD *thd) - case SQLCOM_SHOW_PLUGINS: - case SQLCOM_SHOW_FIELDS: - case SQLCOM_SHOW_KEYS: -+#ifndef WITH_WSREP - case SQLCOM_SHOW_VARIABLES: - case SQLCOM_SHOW_CHARSETS: - case SQLCOM_SHOW_COLLATIONS: - case SQLCOM_SHOW_STORAGE_ENGINES: - case SQLCOM_SHOW_PROFILE: -+#endif /* WITH_WSREP */ - case SQLCOM_SELECT: -+#ifdef WITH_WSREP -+ if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error; -+ case SQLCOM_SHOW_VARIABLES: -+ case SQLCOM_SHOW_CHARSETS: -+ case SQLCOM_SHOW_COLLATIONS: -+ case SQLCOM_SHOW_STORAGE_ENGINES: -+ case SQLCOM_SHOW_PROFILE: -+#endif /* WITH_WSREP */ - { - thd->status_var.last_query_cost= 0.0; - thd->status_var.last_query_partial_plans= 0; -@@ -2938,7 +3232,7 @@ case SQLCOM_PREPARE: - */ - if (thd->query_name_consts && - mysql_bin_log.is_open() && -- thd->variables.binlog_format == BINLOG_FORMAT_STMT && -+ WSREP_BINLOG_FORMAT(thd->variables.binlog_format) == BINLOG_FORMAT_STMT && - !mysql_bin_log.is_query_in_union(thd, thd->query_id)) - { - List_iterator_fast it(select_lex->item_list); -@@ -3056,6 +3350,15 @@ case SQLCOM_PREPARE: - } - else - { -+#ifdef WITH_WSREP -+ /* in STATEMENT format, we probably have to replicate also temporary -+ tables, like mysql replication does -+ */ -+ if (!thd->is_current_stmt_binlog_format_row() || -+ !(create_info.options & HA_LEX_CREATE_TMP_TABLE)) -+ WSREP_TO_ISOLATION_BEGIN(create_table->db, create_table->table_name, -+ NULL) -+#endif /* WITH_WSREP */ - /* Regular CREATE TABLE */ - res= mysql_create_table(thd, create_table, - &create_info, &alter_info); -@@ -3089,6 +3392,7 @@ end_with_restore_list: - DBUG_ASSERT(first_table == all_tables && first_table != 0); - if (check_one_table_access(thd, INDEX_ACL, all_tables)) - goto error; /* purecov: inspected */ -+ WSREP_TO_ISOLATION_BEGIN(first_table->db, first_table->table_name, NULL) - /* - Currently CREATE INDEX or DROP INDEX cause a full table rebuild - and thus classify as slow administrative statements just like -@@ -3181,8 +3485,11 @@ end_with_restore_list: - goto error; - } - -+ WSREP_TO_ISOLATION_BEGIN(0, 0, first_table) - if (mysql_rename_tables(thd, first_table, 0)) -+ { - goto error; -+ } - break; - } - #ifndef EMBEDDED_LIBRARY -@@ -3208,6 +3515,10 @@ end_with_restore_list: - goto error; - #else - { -+#ifdef WITH_WSREP -+ if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error; -+#endif /* WITH_WSREP */ -+ - /* - Access check: - SHOW CREATE TABLE require any privileges on the table level (ie -@@ -3270,6 +3581,10 @@ end_with_restore_list: - case SQLCOM_CHECKSUM: - { - DBUG_ASSERT(first_table == all_tables && first_table != 0); -+#ifdef WITH_WSREP -+ if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error; -+#endif /* WITH_WSREP */ -+ - if (check_table_access(thd, SELECT_ACL, all_tables, - FALSE, UINT_MAX, FALSE)) - goto error; /* purecov: inspected */ -@@ -3278,6 +3593,10 @@ end_with_restore_list: - break; - } - case SQLCOM_UPDATE: -+#ifdef WITH_WSREP -+ if (WSREP_CLIENT(thd) && -+ wsrep_sync_wait(thd, WSREP_SYNC_WAIT_BEFORE_UPDATE_DELETE)) goto error; -+#endif /* WITH_WSREP */ - { - ha_rows found= 0, updated= 0; - DBUG_ASSERT(first_table == all_tables && first_table != 0); -@@ -3317,6 +3636,10 @@ end_with_restore_list: - /* if we switched from normal update, rights are checked */ - if (up_result != 2) - { -+#ifdef WITH_WSREP -+ if (WSREP_CLIENT(thd) && -+ wsrep_sync_wait(thd, WSREP_SYNC_WAIT_BEFORE_UPDATE_DELETE)) goto error; -+#endif /* WITH_WSREP */ - if ((res= multi_update_precheck(thd, all_tables))) - break; - } -@@ -3386,6 +3709,10 @@ end_with_restore_list: - break; - } - case SQLCOM_REPLACE: -+#ifdef WITH_WSREP -+ if (WSREP_CLIENT(thd) && -+ wsrep_sync_wait(thd, WSREP_SYNC_WAIT_BEFORE_INSERT_REPLACE)) goto error; -+#endif /* WITH_WSREP */ - #ifndef DBUG_OFF - if (mysql_bin_log.is_open()) - { -@@ -3420,6 +3747,10 @@ end_with_restore_list: - } - #endif - case SQLCOM_INSERT: -+#ifdef WITH_WSREP -+ if (WSREP_CLIENT(thd) && -+ wsrep_sync_wait(thd, WSREP_SYNC_WAIT_BEFORE_INSERT_REPLACE)) goto error; -+#endif /* WITH_WSREP */ - { - DBUG_ASSERT(first_table == all_tables && first_table != 0); - -@@ -3465,11 +3796,23 @@ end_with_restore_list: - } - case SQLCOM_REPLACE_SELECT: - case SQLCOM_INSERT_SELECT: -+#ifdef WITH_WSREP -+ if (WSREP_CLIENT(thd) && -+ wsrep_sync_wait(thd, WSREP_SYNC_WAIT_BEFORE_INSERT_REPLACE)) goto error; -+#endif /* WITH_WSREP */ - { - select_insert *sel_result; - DBUG_ASSERT(first_table == all_tables && first_table != 0); - if ((res= insert_precheck(thd, all_tables))) - break; -+#ifdef WITH_WSREP -+ if (thd->wsrep_consistency_check == CONSISTENCY_CHECK_DECLARED) -+ { -+ thd->wsrep_consistency_check = CONSISTENCY_CHECK_RUNNING; -+ WSREP_TO_ISOLATION_BEGIN(first_table->db, first_table->table_name, NULL); -+ } -+ -+#endif - /* - INSERT...SELECT...ON DUPLICATE KEY UPDATE/REPLACE SELECT/ - INSERT...IGNORE...SELECT can be unsafe, unless ORDER BY PRIMARY KEY -@@ -3555,6 +3898,10 @@ end_with_restore_list: - break; - } - case SQLCOM_DELETE: -+#ifdef WITH_WSREP -+ if (WSREP_CLIENT(thd) && -+ wsrep_sync_wait(thd, WSREP_SYNC_WAIT_BEFORE_UPDATE_DELETE)) goto error; -+#endif /* WITH_WSREP */ - { - DBUG_ASSERT(first_table == all_tables && first_table != 0); - if ((res= delete_precheck(thd, all_tables))) -@@ -3570,6 +3917,10 @@ end_with_restore_list: - break; - } - case SQLCOM_DELETE_MULTI: -+#ifdef WITH_WSREP -+ if (WSREP_CLIENT(thd) && -+ wsrep_sync_wait(thd, WSREP_SYNC_WAIT_BEFORE_UPDATE_DELETE)) goto error; -+#endif /* WITH_WSREP */ - { - DBUG_ASSERT(first_table == all_tables && first_table != 0); - TABLE_LIST *aux_tables= thd->lex->auxiliary_table_list.first; -@@ -3636,6 +3987,18 @@ end_with_restore_list: - if (check_table_access(thd, DROP_ACL, all_tables, FALSE, UINT_MAX, FALSE)) - goto error; /* purecov: inspected */ - } -+#ifdef WITH_WSREP -+ for (TABLE_LIST *table= all_tables; table; table= table->next_global) -+ { -+ if (!lex->drop_temporary && -+ (!thd->is_current_stmt_binlog_format_row() || -+ !find_temporary_table(thd, table))) -+ { -+ WSREP_TO_ISOLATION_BEGIN(NULL, NULL, all_tables); -+ break; -+ } -+ } -+#endif /* WITH_WSREP */ - /* DDL and binlog write order are protected by metadata locks. */ - res= mysql_rm_table(thd, first_table, lex->drop_if_exists, - lex->drop_temporary); -@@ -3673,7 +4036,6 @@ end_with_restore_list: - - if (!mysql_change_db(thd, &db_str, FALSE)) - my_ok(thd); -- - break; - } - -@@ -3836,6 +4198,7 @@ end_with_restore_list: - #endif - if (check_access(thd, CREATE_ACL, lex->name.str, NULL, NULL, 1, 0)) - break; -+ WSREP_TO_ISOLATION_BEGIN(lex->name.str, NULL, NULL) - res= mysql_create_db(thd,(lower_case_table_names == 2 ? alias : - lex->name.str), &create_info, 0); - break; -@@ -3860,6 +4223,7 @@ end_with_restore_list: - #endif - if (check_access(thd, DROP_ACL, lex->name.str, NULL, NULL, 1, 0)) - break; -+ WSREP_TO_ISOLATION_BEGIN(lex->name.str, NULL, NULL) - res= mysql_rm_db(thd, lex->name.str, lex->drop_if_exists, 0); - break; - } -@@ -3883,6 +4247,7 @@ end_with_restore_list: - res= 1; - break; - } -+ WSREP_TO_ISOLATION_BEGIN(db->str, NULL, NULL) - res= mysql_upgrade_db(thd, db); - if (!res) - my_ok(thd); -@@ -3910,6 +4275,7 @@ end_with_restore_list: - #endif - if (check_access(thd, ALTER_ACL, db->str, NULL, NULL, 1, 0)) - break; -+ WSREP_TO_ISOLATION_BEGIN(db->str, NULL, NULL) - res= mysql_alter_db(thd, db->str, &create_info); - break; - } -@@ -3939,6 +4305,7 @@ end_with_restore_list: - if (res) - break; - -+ WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL) - switch (lex->sql_command) { - case SQLCOM_CREATE_EVENT: - { -@@ -3973,6 +4340,7 @@ end_with_restore_list: - lex->spname->m_name); - break; - case SQLCOM_DROP_EVENT: -+ WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL) - if (!(res= Events::drop_event(thd, - lex->spname->m_db, lex->spname->m_name, - lex->drop_if_exists))) -@@ -3987,6 +4355,7 @@ end_with_restore_list: - if (check_access(thd, INSERT_ACL, "mysql", NULL, NULL, 1, 0)) - break; - #ifdef HAVE_DLOPEN -+ WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL) - if (!(res = mysql_create_function(thd, &lex->udf))) - my_ok(thd); - #else -@@ -4001,6 +4370,7 @@ end_with_restore_list: - if (check_access(thd, INSERT_ACL, "mysql", NULL, NULL, 1, 1) && - check_global_access(thd,CREATE_USER_ACL)) - break; -+ WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL) - /* Conditionally writes to binlog */ - if (!(res= mysql_create_user(thd, lex->users_list))) - my_ok(thd); -@@ -4012,6 +4382,7 @@ end_with_restore_list: - check_global_access(thd,CREATE_USER_ACL)) - break; - /* Conditionally writes to binlog */ -+ WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL) - if (!(res= mysql_drop_user(thd, lex->users_list))) - my_ok(thd); - break; -@@ -4022,6 +4393,7 @@ end_with_restore_list: - check_global_access(thd,CREATE_USER_ACL)) - break; - /* Conditionally writes to binlog */ -+ WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL) - if (!(res= mysql_rename_user(thd, lex->users_list))) - my_ok(thd); - break; -@@ -4036,6 +4408,7 @@ end_with_restore_list: - thd->binlog_invoker(); - - /* Conditionally writes to binlog */ -+ WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL) - if (!(res = mysql_revoke_all(thd, lex->users_list))) - my_ok(thd); - break; -@@ -4102,6 +4475,7 @@ end_with_restore_list: - lex->type == TYPE_ENUM_PROCEDURE, 0)) - goto error; - /* Conditionally writes to binlog */ -+ WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL) - res= mysql_routine_grant(thd, all_tables, - lex->type == TYPE_ENUM_PROCEDURE, - lex->users_list, grants, -@@ -4115,6 +4489,7 @@ end_with_restore_list: - all_tables, FALSE, UINT_MAX, FALSE)) - goto error; - /* Conditionally writes to binlog */ -+ WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL) - res= mysql_table_grant(thd, all_tables, lex->users_list, - lex->columns, lex->grant, - lex->sql_command == SQLCOM_REVOKE); -@@ -4130,6 +4505,7 @@ end_with_restore_list: - } - else - { -+ WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL) - /* Conditionally writes to binlog */ - res = mysql_grant(thd, select_lex->db, lex->users_list, lex->grant, - lex->sql_command == SQLCOM_REVOKE, -@@ -4258,7 +4634,13 @@ end_with_restore_list: - #endif - case SQLCOM_BEGIN: - if (trans_begin(thd, lex->start_transaction_opt)) -+ { -+ thd->mdl_context.release_transactional_locks(); -+#ifdef WITH_WSREP -+ WSREP_DEBUG("BEGIN failed, MDL released: %lu", thd->thread_id); -+#endif /* WITH_WSREP */ - goto error; -+ } - my_ok(thd); - break; - case SQLCOM_COMMIT: -@@ -4272,7 +4654,13 @@ end_with_restore_list: - (thd->variables.completion_type == 2 && - lex->tx_release != TVL_NO)); - if (trans_commit(thd)) -+ { -+ thd->mdl_context.release_transactional_locks(); -+#ifdef WITH_WSREP -+ WSREP_DEBUG("COMMIT failed, MDL released: %lu", thd->thread_id); -+#endif /* WITH_WSREP */ - goto error; -+ } - thd->mdl_context.release_transactional_locks(); - /* Begin transaction with the same isolation level. */ - if (tx_chain) -@@ -4289,7 +4677,20 @@ end_with_restore_list: - /* Disconnect the current client connection. */ - if (tx_release) - thd->killed= THD::KILL_CONNECTION; -+#ifdef WITH_WSREP -+ if (WSREP(thd)) { -+ -+ if (thd->wsrep_conflict_state == NO_CONFLICT || -+ thd->wsrep_conflict_state == REPLAYING) -+ { -+ my_ok(thd); -+ } -+ } else { -+#endif /* WITH_WSREP */ - my_ok(thd); -+#ifdef WITH_WSREP -+ } -+#endif /* WITH_WSREP */ - break; - } - case SQLCOM_ROLLBACK: -@@ -4303,7 +4704,13 @@ end_with_restore_list: - (thd->variables.completion_type == 2 && - lex->tx_release != TVL_NO)); - if (trans_rollback(thd)) -+ { -+ thd->mdl_context.release_transactional_locks(); -+#ifdef WITH_WSREP -+ WSREP_DEBUG("rollback failed, MDL released: %lu", thd->thread_id); -+#endif /* WITH_WSREP */ - goto error; -+ } - thd->mdl_context.release_transactional_locks(); - /* Begin transaction with the same isolation level. */ - if (tx_chain) -@@ -4320,7 +4727,17 @@ end_with_restore_list: - /* Disconnect the current client connection. */ - if (tx_release) - thd->killed= THD::KILL_CONNECTION; -+#ifdef WITH_WSREP -+ if (WSREP(thd)) { -+ if (thd->wsrep_conflict_state == NO_CONFLICT) { -+ my_ok(thd); -+ } -+ } else { -+#endif /* WITH_WSREP */ - my_ok(thd); -+#ifdef WITH_WSREP -+ } -+#endif /* WITH_WSREP */ - break; - } - case SQLCOM_RELEASE_SAVEPOINT: -@@ -4386,6 +4803,7 @@ end_with_restore_list: - if (sp_process_definer(thd)) - goto create_sp_error; - -+ WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL) - res= (sp_result= sp_create_routine(thd, lex->sphead)); - switch (sp_result) { - case SP_OK: { -@@ -4602,6 +5020,7 @@ create_sp_error: - already puts on CREATE FUNCTION. - */ - /* Conditionally writes to binlog */ -+ WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL) - int sp_result= sp_update_routine(thd, sp_type, lex->spname, - &lex->sp_chistics); - if (thd->killed) -@@ -4673,6 +5092,7 @@ create_sp_error: - lex->sql_command == SQLCOM_DROP_PROCEDURE, - false)) - goto error; -+ WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL) - - enum_sp_type sp_type= (lex->sql_command == SQLCOM_DROP_PROCEDURE) ? - SP_TYPE_PROCEDURE : SP_TYPE_FUNCTION; -@@ -4793,6 +5213,7 @@ create_sp_error: - Note: SQLCOM_CREATE_VIEW also handles 'ALTER VIEW' commands - as specified through the thd->lex->create_view_mode flag. - */ -+ WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL) - res= mysql_create_view(thd, first_table, thd->lex->create_view_mode); - break; - } -@@ -4801,12 +5222,14 @@ create_sp_error: - if (check_table_access(thd, DROP_ACL, all_tables, FALSE, UINT_MAX, FALSE)) - goto error; - /* Conditionally writes to binlog. */ -+ WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL) - res= mysql_drop_view(thd, first_table, thd->lex->drop_mode); - break; - } - case SQLCOM_CREATE_TRIGGER: - { - /* Conditionally writes to binlog. */ -+ WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL) - res= mysql_create_or_drop_trigger(thd, all_tables, 1); - - break; -@@ -4814,6 +5237,7 @@ create_sp_error: - case SQLCOM_DROP_TRIGGER: - { - /* Conditionally writes to binlog. */ -+ WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL) - res= mysql_create_or_drop_trigger(thd, all_tables, 0); - break; - } -@@ -4834,7 +5258,13 @@ create_sp_error: - break; - case SQLCOM_XA_COMMIT: - if (trans_xa_commit(thd)) -+ { -+ thd->mdl_context.release_transactional_locks(); -+#ifdef WITH_WSREP -+ WSREP_DEBUG("XA commit failed, MDL released: %lu", thd->thread_id); -+#endif /* WITH_WSREP */ - goto error; -+ } - thd->mdl_context.release_transactional_locks(); - /* - We've just done a commit, reset transaction -@@ -4846,7 +5276,13 @@ create_sp_error: - break; - case SQLCOM_XA_ROLLBACK: - if (trans_xa_rollback(thd)) -+ { -+ thd->mdl_context.release_transactional_locks(); -+#ifdef WITH_WSREP -+ WSREP_DEBUG("XA rollback failed, MDL released: %lu", thd->thread_id); -+#endif /* WITH_WSREP */ - goto error; -+ } - thd->mdl_context.release_transactional_locks(); - /* - We've just done a rollback, reset transaction -@@ -4866,11 +5302,13 @@ create_sp_error: - my_ok(thd); - break; - case SQLCOM_INSTALL_PLUGIN: -+ WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL) - if (! (res= mysql_install_plugin(thd, &thd->lex->comment, - &thd->lex->ident))) - my_ok(thd); - break; - case SQLCOM_UNINSTALL_PLUGIN: -+ WSREP_TO_ISOLATION_BEGIN(WSREP_MYSQL_DB, NULL, NULL) - if (! (res= mysql_uninstall_plugin(thd, &thd->lex->comment))) - my_ok(thd); - break; -@@ -5012,6 +5450,9 @@ finish: - /* Free tables */ - THD_STAGE_INFO(thd, stage_closing_tables); - close_thread_tables(thd); -+#ifdef WITH_WSREP -+ thd->wsrep_consistency_check= NO_CONSISTENCY_CHECK; -+#endif /* WITH_WSREP */ - - #ifndef DBUG_OFF - if (lex->sql_command != SQLCOM_SET_OPTION && ! thd->in_sub_stmt) -@@ -5057,6 +5498,22 @@ finish: - { - thd->mdl_context.release_statement_locks(); - } -+ WSREP_TO_ISOLATION_END; -+ -+#ifdef WITH_WSREP -+ /* -+ Force release of transactional locks if not in active MST and wsrep is on. -+ */ -+ if (WSREP(thd) && -+ ! thd->in_sub_stmt && -+ ! thd->in_active_multi_stmt_transaction() && -+ thd->mdl_context.has_transactional_locks()) -+ { -+ WSREP_DEBUG("Forcing release of transactional locks for thd %lu", -+ thd->thread_id); -+ thd->mdl_context.release_transactional_locks(); -+ } -+#endif /* WITH_WSREP */ - - DBUG_RETURN(res || thd->is_error()); - } -@@ -5986,6 +6443,26 @@ void THD::reset_for_next_command() - thd->auto_inc_intervals_in_cur_stmt_for_binlog.empty(); - thd->stmt_depends_on_first_successful_insert_id_in_prev_stmt= 0; - -+#ifdef WITH_WSREP -+ /* -+ Autoinc variables should be adjusted only for locally executed -+ transactions. Appliers and replayers are either processing ROW -+ events or get autoinc variable values from Query_log_event. -+ */ -+ if (WSREP(thd) && thd->wsrep_exec_mode == LOCAL_STATE) { -+ if (wsrep_auto_increment_control) -+ { -+ if (thd->variables.auto_increment_offset != -+ global_system_variables.auto_increment_offset) -+ thd->variables.auto_increment_offset= -+ global_system_variables.auto_increment_offset; -+ if (thd->variables.auto_increment_increment != -+ global_system_variables.auto_increment_increment) -+ thd->variables.auto_increment_increment= -+ global_system_variables.auto_increment_increment; -+ } -+ } -+#endif /* WITH_WSREP */ - thd->query_start_used= thd->query_start_usec_used= 0; - thd->is_fatal_error= thd->time_zone_used= 0; - /* -@@ -6211,6 +6688,132 @@ void mysql_init_multi_delete(LEX *lex) - lex->query_tables_last= &lex->query_tables; - } - -+#ifdef WITH_WSREP -+static void wsrep_mysql_parse(THD *thd, char *rawbuf, uint length, -+ Parser_state *parser_state) -+{ -+ bool is_autocommit= -+ !thd->in_multi_stmt_transaction_mode() && -+ thd->wsrep_conflict_state == NO_CONFLICT && -+ !thd->wsrep_applier && -+ wsrep_read_only_option(thd, thd->lex->query_tables); -+ -+ do -+ { -+ if (thd->wsrep_conflict_state== RETRY_AUTOCOMMIT) -+ { -+ thd->wsrep_conflict_state= NO_CONFLICT; -+ } -+ mysql_parse(thd, rawbuf, length, parser_state); -+ -+ if (WSREP(thd)) { -+ /* wsrep BF abort in query exec phase */ -+ mysql_mutex_lock(&thd->LOCK_wsrep_thd); -+ if (thd->wsrep_conflict_state == MUST_ABORT) { -+ wsrep_client_rollback(thd); -+ -+ WSREP_DEBUG("abort in exec query state, avoiding autocommit"); -+ } -+ -+ /* checking if BF trx must be replayed */ -+ if (thd->wsrep_conflict_state== MUST_REPLAY) -+ { -+ wsrep_replay_transaction(thd); -+ } -+ -+ /* setting error code for BF aborted trxs */ -+ if (thd->wsrep_conflict_state == ABORTED || -+ thd->wsrep_conflict_state == CERT_FAILURE) -+ { -+ mysql_reset_thd_for_next_command(thd); -+ thd->killed= THD::NOT_KILLED; -+ if (is_autocommit && -+ thd->lex->sql_command != SQLCOM_SELECT && -+ (thd->wsrep_retry_counter < thd->variables.wsrep_retry_autocommit)) -+ { -+ WSREP_DEBUG("wsrep retrying AC query: %s", -+ (thd->query()) ? thd->query() : "void"); -+ -+ close_thread_tables(thd); -+ -+ thd->wsrep_conflict_state= RETRY_AUTOCOMMIT; -+ thd->wsrep_retry_counter++; // grow -+ wsrep_copy_query(thd); -+ thd->set_time(); -+ parser_state->reset(rawbuf, length); -+ -+ /* PSI end */ -+ MYSQL_END_STATEMENT(thd->m_statement_psi, thd->get_stmt_da()); -+ thd->m_statement_psi= NULL; -+ -+ /* DTRACE end */ -+ if (MYSQL_QUERY_DONE_ENABLED()) -+ { -+ MYSQL_QUERY_DONE(thd->is_error()); -+ } -+ -+ /* SHOW PROFILE end */ -+#if defined(ENABLED_PROFILING) -+ thd->profiling.finish_current_query(); -+#endif -+ -+ /* SHOW PROFILE begin */ -+#if defined(ENABLED_PROFILING) -+ thd->profiling.start_new_query("continuing"); -+ thd->profiling.set_query_source(rawbuf, length); -+#endif -+ -+ /* DTRACE begin */ -+ MYSQL_QUERY_START(rawbuf, thd->thread_id, -+ (char *) (thd->db ? thd->db : ""), -+ &thd->security_ctx->priv_user[0], -+ (char *) thd->security_ctx->host_or_ip); -+ -+ /* PSI begin */ -+ thd->m_statement_psi= MYSQL_START_STATEMENT(&thd->m_statement_state, -+ com_statement_info[thd->get_command()].m_key, -+ thd->db, thd->db_length, -+ thd->charset()); -+ } -+ else -+ { -+ WSREP_DEBUG("%s, thd: %lu is_AC: %d, retry: %lu - %lu SQL: %s", -+ (thd->wsrep_conflict_state == ABORTED) ? -+ "BF Aborted" : "cert failure", -+ thd->thread_id, is_autocommit, thd->wsrep_retry_counter, -+ thd->variables.wsrep_retry_autocommit, thd->query()); -+ my_error(ER_LOCK_DEADLOCK, MYF(0), "wsrep aborted transaction"); -+ thd->killed= THD::NOT_KILLED; -+ thd->wsrep_conflict_state= NO_CONFLICT; -+ if (thd->wsrep_conflict_state != REPLAYING) -+ thd->wsrep_retry_counter= 0; // reset -+ } -+ } -+ else -+ { -+ set_if_smaller(thd->wsrep_retry_counter, 0); // reset; eventually ok -+ } -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ } -+ } while (thd->wsrep_conflict_state== RETRY_AUTOCOMMIT); -+ -+ if (thd->wsrep_retry_query) -+ { -+ WSREP_DEBUG("releasing retry_query: " -+ "conf %d sent %d kill %d errno %d SQL %s", -+ thd->wsrep_conflict_state, -+ thd->get_stmt_da()->is_sent(), -+ thd->killed, -+ thd->get_stmt_da()->is_error() ? -+ thd->get_stmt_da()->sql_errno() : 0, -+ thd->wsrep_retry_query); -+ my_free(thd->wsrep_retry_query); -+ thd->wsrep_retry_query = NULL; -+ thd->wsrep_retry_query_len = 0; -+ thd->wsrep_retry_command = COM_CONNECT; -+ } -+} -+#endif /* WITH_WSREP */ - - /* - When you modify mysql_parse(), you may need to mofify -@@ -7265,8 +7868,14 @@ uint kill_one_thread(THD *thd, ulong id, bool only_kill_query) - slayage if both are string-equal. - */ - -+#ifdef WITH_WSREP -+ if (((thd->security_ctx->master_access & SUPER_ACL) || -+ thd->security_ctx->user_matches(tmp->security_ctx)) && -+ !wsrep_thd_is_BF((void *)tmp, true)) -+#else - if ((thd->security_ctx->master_access & SUPER_ACL) || - thd->security_ctx->user_matches(tmp->security_ctx)) -+#endif /* WITH_WSREP */ - { - /* process the kill only if thread is not already undergoing any kill - connection. -diff --git a/sql/sql_parse.h b/sql/sql_parse.h -index b1124d1..c54bc96 100644 ---- a/sql/sql_parse.h -+++ b/sql/sql_parse.h -@@ -210,6 +210,22 @@ inline bool is_supported_parser_charset(const CHARSET_INFO *cs) - { - return (cs->mbminlen == 1); - } -+#ifdef WITH_WSREP -+ -+#define WSREP_MYSQL_DB (char *)"mysql" -+#define WSREP_TO_ISOLATION_BEGIN(db_, table_, table_list_) \ -+ if (WSREP(thd) && wsrep_to_isolation_begin(thd, db_, table_, table_list_)) goto error; -+ -+#define WSREP_TO_ISOLATION_END \ -+ if (WSREP(thd) || (thd && thd->wsrep_exec_mode==TOTAL_ORDER)) \ -+ wsrep_to_isolation_end(thd); -+ -+#else -+ -+#define WSREP_TO_ISOLATION_BEGIN(db_, table_, table_list_) -+#define WSREP_TO_ISOLATION_END -+ -+#endif /* WITH_WSREP */ - - extern "C" bool sqlcom_can_generate_row_events(const THD *thd); - -diff --git a/sql/sql_partition_admin.cc b/sql/sql_partition_admin.cc -index 15ead35..dbf2be0 100644 ---- a/sql/sql_partition_admin.cc -+++ b/sql/sql_partition_admin.cc -@@ -767,6 +767,19 @@ bool Sql_cmd_alter_table_truncate_partition::execute(THD *thd) - if (check_one_table_access(thd, DROP_ACL, first_table)) - DBUG_RETURN(TRUE); - -+#ifdef WITH_WSREP -+ TABLE *find_temporary_table(THD *thd, const TABLE_LIST *tl); -+ -+ if ((!thd->is_current_stmt_binlog_format_row() || -+ !find_temporary_table(thd, first_table)) && -+ wsrep_to_isolation_begin( -+ thd, first_table->db, first_table->table_name, NULL) -+ ) -+ { -+ WSREP_WARN("ALTER TABLE isolation failure"); -+ DBUG_RETURN(TRUE); -+ } -+#endif /* WITH_WSREP */ - if (open_tables(thd, &first_table, &table_counter, 0)) - DBUG_RETURN(true); - -diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc -index bc89a8c..e43b2f2 100644 ---- a/sql/sql_plugin.cc -+++ b/sql/sql_plugin.cc -@@ -2827,7 +2827,11 @@ void plugin_thdvar_init(THD *thd, bool enable_plugins) - thd->variables.dynamic_variables_size= 0; - thd->variables.dynamic_variables_ptr= 0; - -+#ifdef WITH_WSREP -+ if ((!WSREP(thd) || !thd->wsrep_applier) && enable_plugins) -+#else - if (enable_plugins) -+#endif - { - mysql_mutex_lock(&LOCK_plugin); - thd->variables.table_plugin= -diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc -index d187418..5576e69 100644 ---- a/sql/sql_prepare.cc -+++ b/sql/sql_prepare.cc -@@ -3584,7 +3584,9 @@ Prepared_statement::set_parameters(String *expanded_query, - return res; - } - -- -+#ifdef WITH_WSREP -+void wsrep_replay_transaction(THD *thd); -+#endif /* WITH_WSREP */ - /** - Execute a prepared statement. Re-prepare it a limited number - of times if necessary. -@@ -3661,6 +3663,22 @@ reexecute: - thd->push_reprepare_observer(stmt_reprepare_observer); - - error= execute(expanded_query, open_cursor) || thd->is_error(); -+#ifdef WITH_WSREP -+ mysql_mutex_lock(&thd->LOCK_wsrep_thd); -+ switch (thd->wsrep_conflict_state) -+ { -+ case CERT_FAILURE: -+ WSREP_DEBUG("PS execute fail for CERT_FAILURE: thd: %ld err: %d", -+ thd->thread_id, thd->get_stmt_da()->sql_errno() ); -+ thd->wsrep_conflict_state = NO_CONFLICT; -+ break; -+ -+ case MUST_REPLAY: -+ (void)wsrep_replay_transaction(thd); -+ default: break; -+ } -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+#endif /* WITH_WSREP */ - - thd->pop_reprepare_observer(); - -diff --git a/sql/sql_reload.cc b/sql/sql_reload.cc -index 574ed4c..60ab476 100644 ---- a/sql/sql_reload.cc -+++ b/sql/sql_reload.cc -@@ -249,7 +249,18 @@ bool reload_acl_and_cache(THD *thd, unsigned long options, - thd->global_read_lock.unlock_global_read_lock(thd); - return 1; - } -- } -+#ifdef WITH_WSREP -+ /* -+ We need to do it second time after wsrep appliers were blocked in -+ make_global_read_lock_block_commit(thd) above since they could have -+ modified the tables too. -+ */ -+ if (WSREP(thd) && -+ close_cached_tables(thd, tables, (options & REFRESH_FAST) ? -+ FALSE : TRUE, TRUE)) -+ result= 1; -+#endif /* WITH_WSREP */ -+ } - else - { - if (thd && thd->locked_tables_mode) -diff --git a/sql/sql_show.cc b/sql/sql_show.cc -index 0dc4da5..9f73f8a 100644 ---- a/sql/sql_show.cc -+++ b/sql/sql_show.cc -@@ -61,6 +61,9 @@ - using std::max; - using std::min; - -+#if !defined(MYSQL_MAX_VARIABLE_VALUE_LEN) -+#define MYSQL_MAX_VARIABLE_VALUE_LEN 1024 -+#endif // !defined(MYSQL_MAX_VARIABLE_VALUE_LEN) - #define STR_OR_NIL(S) ((S) ? (S) : "") - - #ifdef WITH_PARTITION_STORAGE_ENGINE -@@ -7938,7 +7941,8 @@ ST_FIELD_INFO variables_fields_info[]= - { - {"VARIABLE_NAME", 64, MYSQL_TYPE_STRING, 0, 0, "Variable_name", - SKIP_OPEN_TABLE}, -- {"VARIABLE_VALUE", 1024, MYSQL_TYPE_STRING, 0, 1, "Value", SKIP_OPEN_TABLE}, -+ {"VARIABLE_VALUE", MYSQL_MAX_VARIABLE_VALUE_LEN, MYSQL_TYPE_STRING, 0, 1, -+ "Value", SKIP_OPEN_TABLE}, - {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE} - }; - -diff --git a/sql/sql_table.cc b/sql/sql_table.cc -index d85585e..26b0e77 100644 ---- a/sql/sql_table.cc -+++ b/sql/sql_table.cc -@@ -5301,6 +5301,60 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST* src_table, - uint not_used; - DBUG_ENTER("mysql_create_like_table"); - -+#ifdef WITH_WSREP -+ if (WSREP(thd) && !thd->wsrep_applier) -+ { -+ TABLE *tmp_table; -+ bool is_tmp_table= FALSE; -+ -+ for (tmp_table= thd->temporary_tables; tmp_table; tmp_table=tmp_table->next) -+ { -+ if (!strcmp(src_table->db, tmp_table->s->db.str) && -+ !strcmp(src_table->table_name, tmp_table->s->table_name.str)) -+ { -+ is_tmp_table= TRUE; -+ break; -+ } -+ } -+ if (create_info->options & HA_LEX_CREATE_TMP_TABLE) -+ { -+ /* CREATE TEMPORARY TABLE LIKE must be skipped from replication */ -+ WSREP_DEBUG("CREATE TEMPORARY TABLE LIKE... skipped replication\n %s", -+ thd->query()); -+ } -+ else if (!is_tmp_table) -+ { -+ /* this is straight CREATE TABLE LIKE... eith no tmp tables */ -+ WSREP_TO_ISOLATION_BEGIN(table->db, table->table_name, NULL); -+ } -+ else -+ { -+ /* here we have CREATE TABLE LIKE -+ the temporary table definition will be needed in slaves to -+ enable the create to succeed -+ */ -+ TABLE_LIST tbl; -+ memset(&tbl, 0, sizeof(tbl)); -+ tbl.db= src_table->db; -+ tbl.table_name= tbl.alias= src_table->table_name; -+ tbl.table= tmp_table; -+ char buf[2048]; -+ String query(buf, sizeof(buf), system_charset_info); -+ query.length(0); // Have to zero it since constructor doesn't -+ -+ (void) store_create_info(thd, &tbl, &query, NULL, TRUE); -+ WSREP_DEBUG("TMP TABLE: %s", query.ptr()); -+ -+ thd->wsrep_TOI_pre_query= query.ptr(); -+ thd->wsrep_TOI_pre_query_len= query.length(); -+ -+ WSREP_TO_ISOLATION_BEGIN(table->db, table->table_name, NULL); -+ -+ thd->wsrep_TOI_pre_query= NULL; -+ thd->wsrep_TOI_pre_query_len= 0; -+ } -+ } -+#endif - - /* - We the open source table to get its description in HA_CREATE_INFO -@@ -5474,6 +5528,11 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST* src_table, - - err: - DBUG_RETURN(res); -+#ifdef WITH_WSREP -+ error: -+ thd->wsrep_TOI_pre_query= NULL; -+ DBUG_RETURN(TRUE); -+#endif /* WITH_WSREP */ - } - - -@@ -7883,6 +7942,17 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, - - DEBUG_SYNC(thd, "alter_opened_table"); - -+#ifdef WITH_WSREP -+ DBUG_EXECUTE_IF("sync.alter_opened_table", -+ { -+ const char act[]= -+ "now " -+ "wait_for signal.alter_opened_table"; -+ DBUG_ASSERT(!debug_sync_set_action(thd, -+ STRING_WITH_LEN(act))); -+ };); -+#endif // WITH_WSREP -+ - if (error) - DBUG_RETURN(true); - -diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc -index e98b327..c9e92ad 100644 ---- a/sql/sql_trigger.cc -+++ b/sql/sql_trigger.cc -@@ -434,8 +434,14 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create) - binlogged, so they share the same danger, so trust_function_creators - applies to them too. - */ -+#ifdef WITH_WSREP -+ if (!trust_function_creators && -+ (WSREP_EMULATE_BINLOG(thd) || mysql_bin_log.is_open()) && -+ !(thd->security_ctx->master_access & SUPER_ACL)) -+#else - if (!trust_function_creators && mysql_bin_log.is_open() && - !(thd->security_ctx->master_access & SUPER_ACL)) -+#endif /* WITH_WSREP */ - { - my_error(ER_BINLOG_CREATE_ROUTINE_NEED_SUPER, MYF(0)); - DBUG_RETURN(TRUE); -@@ -2528,3 +2534,55 @@ bool load_table_name_for_trigger(THD *thd, - - DBUG_RETURN(FALSE); - } -+#ifdef WITH_WSREP -+int wsrep_create_trigger_query(THD *thd, uchar** buf, size_t* buf_len) -+{ -+ LEX *lex= thd->lex; -+ String stmt_query; -+ -+ LEX_STRING definer_user; -+ LEX_STRING definer_host; -+ -+ if (!lex->definer) -+ { -+ if (!thd->slave_thread) -+ { -+ if (!(lex->definer= create_default_definer(thd))) -+ return 1; -+ } -+ } -+ -+ if (lex->definer) -+ { -+ /* SUID trigger. */ -+ -+ definer_user= lex->definer->user; -+ definer_host= lex->definer->host; -+ } -+ else -+ { -+ /* non-SUID trigger. */ -+ -+ definer_user.str= 0; -+ definer_user.length= 0; -+ -+ definer_host.str= 0; -+ definer_host.length= 0; -+ } -+ -+ stmt_query.append(STRING_WITH_LEN("CREATE ")); -+ -+ append_definer(thd, &stmt_query, &definer_user, &definer_host); -+ -+ LEX_STRING stmt_definition; -+ stmt_definition.str= (char*) thd->lex->stmt_definition_begin; -+ stmt_definition.length= thd->lex->stmt_definition_end -+ - thd->lex->stmt_definition_begin; -+ trim_whitespace(thd->charset(), & stmt_definition); -+ -+ stmt_query.append(stmt_definition.str, stmt_definition.length); -+ -+ return wsrep_to_buf_helper(thd, stmt_query.c_ptr(), stmt_query.length(), -+ buf, buf_len); -+} -+#endif /* WITH_WSREP */ -diff --git a/sql/sql_truncate.cc b/sql/sql_truncate.cc -index 4d3d4e9..3b6173b 100644 ---- a/sql/sql_truncate.cc -+++ b/sql/sql_truncate.cc -@@ -24,6 +24,9 @@ - #include "sql_parse.h" // check_one_table_access() - #include "sql_truncate.h" - #include "sql_show.h" //append_identifier() -+#ifdef WITH_WSREP -+#include "wsrep_mysqld.h" -+#endif /* WITH_WSREP */ - - - /** -@@ -461,6 +464,12 @@ bool Sql_cmd_truncate_table::truncate_table(THD *thd, TABLE_LIST *table_ref) - { - bool hton_can_recreate; - -+#ifdef WITH_WSREP -+ if (WSREP(thd) && wsrep_to_isolation_begin(thd, -+ table_ref->db, -+ table_ref->table_name, NULL)) -+ DBUG_RETURN(TRUE); -+#endif /* WITH_WSREP */ - if (lock_table(thd, table_ref, &hton_can_recreate)) - DBUG_RETURN(TRUE); - -@@ -542,7 +551,6 @@ bool Sql_cmd_truncate_table::execute(THD *thd) - - if (! (res= truncate_table(thd, first_table))) - my_ok(thd); -- - DBUG_RETURN(res); - } - -diff --git a/sql/sql_update.cc b/sql/sql_update.cc -index 4c4714e..cb34af5 100644 ---- a/sql/sql_update.cc -+++ b/sql/sql_update.cc -@@ -988,7 +988,11 @@ int mysql_update(THD *thd, - */ - if ((error < 0) || thd->transaction.stmt.cannot_safely_rollback()) - { -+#ifdef WITH_WSREP -+ if (WSREP_EMULATE_BINLOG(thd) || mysql_bin_log.is_open()) -+#else - if (mysql_bin_log.is_open()) -+#endif - { - int errcode= 0; - if (error < 0) -@@ -2203,7 +2207,11 @@ void multi_update::abort_result_set() - The query has to binlog because there's a modified non-transactional table - either from the query's list or via a stored routine: bug#13270,23333 - */ -+#ifdef WITH_WSREP -+ if (WSREP_EMULATE_BINLOG(thd) || mysql_bin_log.is_open()) -+#else - if (mysql_bin_log.is_open()) -+#endif - { - /* - THD::killed status might not have been set ON at time of an error -@@ -2435,7 +2443,11 @@ bool multi_update::send_eof() - - if (local_error == 0 || thd->transaction.stmt.cannot_safely_rollback()) - { -+#ifdef WITH_WSREP -+ if (WSREP_EMULATE_BINLOG(thd) || mysql_bin_log.is_open()) -+#else - if (mysql_bin_log.is_open()) -+#endif - { - int errcode= 0; - if (local_error == 0) -diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy -index 180b7cd..4b6ef7a 100644 ---- a/sql/sql_yacc.yy -+++ b/sql/sql_yacc.yy -@@ -7433,7 +7433,7 @@ alter: - } - view_tail - {} -- | ALTER definer_opt EVENT_SYM sp_name -+ | ALTER definer_opt remember_name EVENT_SYM sp_name - { - /* - It is safe to use Lex->spname because -@@ -7445,9 +7445,12 @@ alter: - - if (!(Lex->event_parse_data= Event_parse_data::new_instance(YYTHD))) - MYSQL_YYABORT; -- Lex->event_parse_data->identifier= $4; -+ Lex->event_parse_data->identifier= $5; - - Lex->sql_command= SQLCOM_ALTER_EVENT; -+#ifdef WITH_WSREP -+ Lex->stmt_definition_begin= $3; -+#endif - } - ev_alter_on_schedule_completion - opt_ev_rename_to -@@ -7455,7 +7458,7 @@ alter: - opt_ev_comment - opt_ev_sql_stmt - { -- if (!($6 || $7 || $8 || $9 || $10)) -+ if (!($7 || $8 || $9 || $10 || $11)) - { - my_parse_error(ER(ER_SYNTAX_ERROR)); - MYSQL_YYABORT; -@@ -7465,6 +7468,9 @@ alter: - can overwrite it - */ - Lex->sql_command= SQLCOM_ALTER_EVENT; -+#ifdef WITH_WSREP -+ Lex->stmt_definition_end= (char*)YYLIP->get_cpp_ptr(); -+#endif - } - | ALTER TABLESPACE alter_tablespace_info - { -diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc -index f44196e..f26605a 100644 ---- a/sql/sys_vars.cc -+++ b/sql/sys_vars.cc -@@ -3222,6 +3222,10 @@ static bool fix_autocommit(sys_var *self, THD *thd, enum_var_type type) - if (trans_commit_stmt(thd) || trans_commit(thd)) - { - thd->variables.option_bits&= ~OPTION_AUTOCOMMIT; -+ thd->mdl_context.release_transactional_locks(); -+#ifdef WITH_WSREP -+ WSREP_DEBUG("autocommit, MDL TRX lock released: %lu", thd->thread_id); -+#endif /* WITH_WSREP */ - return true; - } - /* -@@ -4216,6 +4220,274 @@ static Sys_var_tz Sys_time_zone( - "time_zone", "time_zone", - SESSION_VAR(time_zone), NO_CMD_LINE, - DEFAULT(&default_tz), NO_MUTEX_GUARD, IN_BINLOG); -+#ifdef WITH_WSREP -+#include "wsrep_var.h" -+#include "wsrep_sst.h" -+#include "wsrep_binlog.h" -+ -+static Sys_var_charptr Sys_wsrep_provider( -+ "wsrep_provider", "Path to replication provider library", -+ PREALLOCATED GLOBAL_VAR(wsrep_provider), CMD_LINE(REQUIRED_ARG, OPT_WSREP_PROVIDER), -+ IN_FS_CHARSET, DEFAULT(wsrep_provider), -+ // IN_FS_CHARSET, DEFAULT(wsrep_provider_default), -+ NO_MUTEX_GUARD, NOT_IN_BINLOG, -+ ON_CHECK(wsrep_provider_check), ON_UPDATE(wsrep_provider_update)); -+ -+static Sys_var_charptr Sys_wsrep_provider_options( -+ "wsrep_provider_options", "provider specific options", -+ PREALLOCATED GLOBAL_VAR(wsrep_provider_options), -+ CMD_LINE(REQUIRED_ARG, OPT_WSREP_PROVIDER_OPTIONS), -+ IN_FS_CHARSET, DEFAULT(wsrep_provider_options), -+ NO_MUTEX_GUARD, NOT_IN_BINLOG, -+ ON_CHECK(wsrep_provider_options_check), -+ ON_UPDATE(wsrep_provider_options_update)); -+ -+static Sys_var_charptr Sys_wsrep_data_home_dir( -+ "wsrep_data_home_dir", "home directory for wsrep provider", -+ READ_ONLY GLOBAL_VAR(wsrep_data_home_dir), CMD_LINE(REQUIRED_ARG), -+ IN_FS_CHARSET, DEFAULT(""), -+ NO_MUTEX_GUARD, NOT_IN_BINLOG); -+ -+static Sys_var_charptr Sys_wsrep_cluster_name( -+ "wsrep_cluster_name", "Name for the cluster", -+ PREALLOCATED GLOBAL_VAR(wsrep_cluster_name), CMD_LINE(REQUIRED_ARG), -+ IN_FS_CHARSET, DEFAULT(wsrep_cluster_name), -+ NO_MUTEX_GUARD, NOT_IN_BINLOG, -+ ON_CHECK(wsrep_cluster_name_check), -+ ON_UPDATE(wsrep_cluster_name_update)); -+ -+static PolyLock_mutex PLock_wsrep_slave_threads(&LOCK_wsrep_slave_threads); -+static Sys_var_charptr Sys_wsrep_cluster_address ( -+ "wsrep_cluster_address", "Address to initially connect to cluster", -+ PREALLOCATED GLOBAL_VAR(wsrep_cluster_address), -+ CMD_LINE(REQUIRED_ARG, OPT_WSREP_CLUSTER_ADDRESS), -+ IN_FS_CHARSET, DEFAULT(wsrep_cluster_address), -+ &PLock_wsrep_slave_threads, NOT_IN_BINLOG, -+ ON_CHECK(wsrep_cluster_address_check), -+ ON_UPDATE(wsrep_cluster_address_update)); -+ -+static Sys_var_charptr Sys_wsrep_node_name ( -+ "wsrep_node_name", "Node name", -+ PREALLOCATED GLOBAL_VAR(wsrep_node_name), CMD_LINE(REQUIRED_ARG), -+ IN_FS_CHARSET, DEFAULT(wsrep_node_name), -+ NO_MUTEX_GUARD, NOT_IN_BINLOG); -+ -+static Sys_var_charptr Sys_wsrep_node_address ( -+ "wsrep_node_address", "Node address", -+ PREALLOCATED GLOBAL_VAR(wsrep_node_address), CMD_LINE(REQUIRED_ARG), -+ IN_FS_CHARSET, DEFAULT(wsrep_node_address), -+ NO_MUTEX_GUARD, NOT_IN_BINLOG, -+ ON_CHECK(wsrep_node_address_check), -+ ON_UPDATE(wsrep_node_address_update)); -+ -+static Sys_var_charptr Sys_wsrep_node_incoming_address( -+ "wsrep_node_incoming_address", "Client connection address", -+ PREALLOCATED GLOBAL_VAR(wsrep_node_incoming_address),CMD_LINE(REQUIRED_ARG), -+ IN_FS_CHARSET, DEFAULT(wsrep_node_incoming_address), -+ NO_MUTEX_GUARD, NOT_IN_BINLOG); -+ -+static Sys_var_ulong Sys_wsrep_slave_threads( -+ "wsrep_slave_threads", "Number of slave appliers to launch", -+ GLOBAL_VAR(wsrep_slave_threads), CMD_LINE(REQUIRED_ARG), -+ VALID_RANGE(1, 512), DEFAULT(1), BLOCK_SIZE(1), -+ &PLock_wsrep_slave_threads, NOT_IN_BINLOG, -+ ON_CHECK(wsrep_slave_threads_check), -+ ON_UPDATE(wsrep_slave_threads_update)); -+ -+static Sys_var_charptr Sys_wsrep_dbug_option( -+ "wsrep_dbug_option", "DBUG options to provider library", -+ GLOBAL_VAR(wsrep_dbug_option),CMD_LINE(REQUIRED_ARG), -+ IN_FS_CHARSET, DEFAULT(""), -+ NO_MUTEX_GUARD, NOT_IN_BINLOG); -+ -+static Sys_var_mybool Sys_wsrep_debug( -+ "wsrep_debug", "To enable debug level logging", -+ GLOBAL_VAR(wsrep_debug), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); -+ -+static Sys_var_mybool Sys_wsrep_convert_LOCK_to_trx( -+ "wsrep_convert_LOCK_to_trx", "To convert locking sessions " -+ "into transactions", -+ GLOBAL_VAR(wsrep_convert_LOCK_to_trx), -+ CMD_LINE(OPT_ARG), DEFAULT(FALSE)); -+ -+static Sys_var_ulong Sys_wsrep_retry_autocommit( -+ "wsrep_retry_autocommit", "Max number of times to retry " -+ "a failed autocommit statement", -+ SESSION_VAR(wsrep_retry_autocommit), CMD_LINE(REQUIRED_ARG), -+ VALID_RANGE(0, 10000), DEFAULT(1), BLOCK_SIZE(1)); -+ -+static Sys_var_mybool Sys_wsrep_auto_increment_control( -+ "wsrep_auto_increment_control", "To automatically control the " -+ "assignment of autoincrement variables", -+ GLOBAL_VAR(wsrep_auto_increment_control), -+ CMD_LINE(OPT_ARG), DEFAULT(TRUE)); -+ -+static Sys_var_mybool Sys_wsrep_drupal_282555_workaround( -+ "wsrep_drupal_282555_workaround", "To use a workaround for" -+ "bad autoincrement value", -+ GLOBAL_VAR(wsrep_drupal_282555_workaround), -+ CMD_LINE(OPT_ARG), DEFAULT(FALSE)); -+ -+static Sys_var_charptr sys_wsrep_sst_method( -+ "wsrep_sst_method", "State snapshot transfer method", -+ GLOBAL_VAR(wsrep_sst_method),CMD_LINE(REQUIRED_ARG), -+ IN_FS_CHARSET, DEFAULT(wsrep_sst_method), NO_MUTEX_GUARD, NOT_IN_BINLOG, -+ ON_CHECK(wsrep_sst_method_check), -+ ON_UPDATE(wsrep_sst_method_update)); -+ -+static Sys_var_charptr Sys_wsrep_sst_receive_address( -+ "wsrep_sst_receive_address", "Address where node is waiting for " -+ "SST contact", -+ GLOBAL_VAR(wsrep_sst_receive_address),CMD_LINE(REQUIRED_ARG), -+ IN_FS_CHARSET, DEFAULT(wsrep_sst_receive_address), NO_MUTEX_GUARD, -+ NOT_IN_BINLOG, -+ ON_CHECK(wsrep_sst_receive_address_check), -+ ON_UPDATE(wsrep_sst_receive_address_update)); -+ -+static Sys_var_charptr Sys_wsrep_sst_auth( -+ "wsrep_sst_auth", "Authentication for SST connection", -+ PREALLOCATED GLOBAL_VAR(wsrep_sst_auth), CMD_LINE(REQUIRED_ARG, OPT_WSREP_SST_AUTH), -+ IN_FS_CHARSET, DEFAULT(wsrep_sst_auth), NO_MUTEX_GUARD, -+ NOT_IN_BINLOG, -+ ON_CHECK(wsrep_sst_auth_check), -+ ON_UPDATE(wsrep_sst_auth_update)); -+ -+static Sys_var_charptr Sys_wsrep_sst_donor( -+ "wsrep_sst_donor", "preferred donor node for the SST", -+ GLOBAL_VAR(wsrep_sst_donor),CMD_LINE(REQUIRED_ARG), -+ IN_FS_CHARSET, DEFAULT(""), NO_MUTEX_GUARD, NOT_IN_BINLOG, -+ ON_CHECK(wsrep_sst_donor_check), -+ ON_UPDATE(wsrep_sst_donor_update)); -+ -+static Sys_var_mybool Sys_wsrep_sst_donor_rejects_queries( -+ "wsrep_sst_donor_rejects_queries", "Reject client queries " -+ "when donating state snapshot transfer", -+ GLOBAL_VAR(wsrep_sst_donor_rejects_queries), -+ CMD_LINE(OPT_ARG), DEFAULT(FALSE)); -+ -+static Sys_var_mybool Sys_wsrep_on ( -+ "wsrep_on", "To enable wsrep replication ", -+ SESSION_VAR(wsrep_on), -+ CMD_LINE(OPT_ARG), DEFAULT(TRUE), -+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), -+ ON_UPDATE(wsrep_on_update)); -+ -+static Sys_var_charptr Sys_wsrep_start_position ( -+ "wsrep_start_position", "global transaction position to start from ", -+ PREALLOCATED GLOBAL_VAR(wsrep_start_position), -+ CMD_LINE(REQUIRED_ARG, OPT_WSREP_START_POSITION), -+ IN_FS_CHARSET, DEFAULT(wsrep_start_position), -+ NO_MUTEX_GUARD, NOT_IN_BINLOG, -+ ON_CHECK(wsrep_start_position_check), -+ ON_UPDATE(wsrep_start_position_update)); -+ -+static Sys_var_ulong Sys_wsrep_max_ws_size ( -+ "wsrep_max_ws_size", "Max write set size (bytes)", -+ GLOBAL_VAR(wsrep_max_ws_size), CMD_LINE(REQUIRED_ARG), -+ /* Upper limit is 65K short of 4G to avoid overlows on 32-bit systems */ -+ VALID_RANGE(1024, WSREP_MAX_WS_SIZE), DEFAULT(1073741824UL), BLOCK_SIZE(1)); -+ -+static Sys_var_ulong Sys_wsrep_max_ws_rows ( -+ "wsrep_max_ws_rows", "Max number of rows in write set", -+ GLOBAL_VAR(wsrep_max_ws_rows), CMD_LINE(REQUIRED_ARG), -+ VALID_RANGE(1, 1048576), DEFAULT(131072), BLOCK_SIZE(1)); -+ -+static Sys_var_charptr Sys_wsrep_notify_cmd( -+ "wsrep_notify_cmd", "", -+ GLOBAL_VAR(wsrep_notify_cmd),CMD_LINE(REQUIRED_ARG), -+ IN_FS_CHARSET, DEFAULT(""), NO_MUTEX_GUARD, NOT_IN_BINLOG); -+ -+static Sys_var_mybool Sys_wsrep_certify_nonPK( -+ "wsrep_certify_nonPK", "Certify tables with no primary key", -+ GLOBAL_VAR(wsrep_certify_nonPK), -+ CMD_LINE(OPT_ARG), DEFAULT(TRUE)); -+ -+static Sys_var_mybool Sys_wsrep_causal_reads( -+ "wsrep_causal_reads", "(DEPRECATED) setting this variable is equivalent to setting wsrep_sync_wait READ flag", -+ SESSION_VAR(wsrep_causal_reads), -+ CMD_LINE(OPT_ARG), DEFAULT(FALSE), -+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), -+ ON_UPDATE(wsrep_causal_reads_update)); -+ -+static Sys_var_uint Sys_wsrep_sync_wait( -+ "wsrep_sync_wait", "Ensure \"synchronous\" read view before executing an operation of the type specified by bitmask: 1 - READ(includes SELECT, SHOW and BEGIN/START TRANSACTION); 2 - UPDATE and DELETE; 4 - INSERT and REPLACE", -+ SESSION_VAR(wsrep_sync_wait), -+ CMD_LINE(OPT_ARG), -+ VALID_RANGE(WSREP_SYNC_WAIT_NONE, WSREP_SYNC_WAIT_MAX), -+ DEFAULT(WSREP_SYNC_WAIT_NONE), -+ BLOCK_SIZE(1), -+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), -+ ON_UPDATE(wsrep_sync_wait_update)); -+ -+static const char *wsrep_OSU_method_names[]= { "TOI", "RSU", NullS }; -+static Sys_var_enum Sys_wsrep_OSU_method( -+ "wsrep_OSU_method", "Method for Online Schema Upgrade", -+ GLOBAL_VAR(wsrep_OSU_method_options), CMD_LINE(OPT_ARG), -+ wsrep_OSU_method_names, DEFAULT(WSREP_OSU_TOI), -+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), -+ ON_UPDATE(0)); -+ -+static PolyLock_mutex PLock_wsrep_desync(&LOCK_wsrep_desync); -+static Sys_var_mybool Sys_wsrep_desync ( -+ "wsrep_desync", "To desynchronize the node from the cluster", -+ GLOBAL_VAR(wsrep_desync), -+ CMD_LINE(OPT_ARG), DEFAULT(FALSE), -+ &PLock_wsrep_desync, NOT_IN_BINLOG, -+ ON_CHECK(wsrep_desync_check), -+ ON_UPDATE(wsrep_desync_update)); -+ -+static Sys_var_enum Sys_wsrep_forced_binlog_format( -+ "wsrep_forced_binlog_format", "binlog format to take effect over user's choice", -+ GLOBAL_VAR(wsrep_forced_binlog_format), -+ CMD_LINE(REQUIRED_ARG, OPT_BINLOG_FORMAT), -+ wsrep_binlog_format_names, DEFAULT(BINLOG_FORMAT_UNSPEC), -+ NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), -+ ON_UPDATE(0)); -+ -+static Sys_var_mybool Sys_wsrep_recover_datadir( -+ "wsrep_recover", "Recover database state after crash and exit", -+ READ_ONLY GLOBAL_VAR(wsrep_recovery), -+ CMD_LINE(OPT_ARG, OPT_WSREP_RECOVER), DEFAULT(FALSE)); -+ -+static Sys_var_mybool Sys_wsrep_replicate_myisam( -+ "wsrep_replicate_myisam", "To enable myisam replication", -+ GLOBAL_VAR(wsrep_replicate_myisam), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); -+ -+static Sys_var_mybool Sys_wsrep_log_conflicts( -+ "wsrep_log_conflicts", "To log multi-master conflicts", -+ GLOBAL_VAR(wsrep_log_conflicts), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); -+ -+static Sys_var_ulong Sys_wsrep_mysql_replication_bundle( -+ "wsrep_mysql_replication_bundle", "mysql replication group commit ", -+ GLOBAL_VAR(wsrep_mysql_replication_bundle), CMD_LINE(REQUIRED_ARG), -+ VALID_RANGE(0, 1000), DEFAULT(0), BLOCK_SIZE(1)); -+ -+static Sys_var_mybool Sys_wsrep_preordered( -+ "wsrep_preordered", "To enable preordered write set processing", -+ GLOBAL_VAR(wsrep_preordered_opt), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); -+ -+static Sys_var_mybool Sys_wsrep_load_data_splitting( -+ "wsrep_load_data_splitting", "To commit LOAD DATA " -+ "transaction after every 10K rows inserted", -+ GLOBAL_VAR(wsrep_load_data_splitting), -+ CMD_LINE(OPT_ARG), DEFAULT(TRUE)); -+ -+static Sys_var_mybool Sys_wsrep_slave_FK_checks( -+ "wsrep_slave_FK_checks", "Should slave thread do " -+ "foreign key constraint checks", -+ GLOBAL_VAR(wsrep_slave_FK_checks), -+ CMD_LINE(OPT_ARG), DEFAULT(TRUE)); -+ -+static Sys_var_mybool Sys_wsrep_slave_UK_checks( -+ "wsrep_slave_UK_checks", "Should slave thread do " -+ "secondary index uniqueness chesks", -+ GLOBAL_VAR(wsrep_slave_UK_checks), -+ CMD_LINE(OPT_ARG), DEFAULT(FALSE)); -+ -+static Sys_var_mybool Sys_wsrep_restart_slave( -+ "wsrep_restart_slave", "Should MySQL slave be restarted automatically, when node joins back to cluster", -+ GLOBAL_VAR(wsrep_restart_slave), CMD_LINE(OPT_ARG), DEFAULT(FALSE)); -+#endif /* WITH_WSREP */ - - static bool fix_host_cache_size(sys_var *, THD *, enum_var_type) - { -diff --git a/sql/table.cc b/sql/table.cc -index afd3947..95eb03d 100644 ---- a/sql/table.cc -+++ b/sql/table.cc -@@ -5321,8 +5321,17 @@ void TABLE::mark_columns_needed_for_delete() - in mark_columns_per_binlog_row_image, if not, then use - the hidden primary key - */ -+#ifdef WITH_WSREP -+ /* this does not affect wsrep patch as long as we use RBR only, -+ but this condition is just preparing for possible future STATEMENT -+ format support -+ */ -+ if (!((WSREP_EMULATE_BINLOG(current_thd) || mysql_bin_log.is_open()) && -+ in_use && in_use->is_current_stmt_binlog_format_row())) -+#else - if (!(mysql_bin_log.is_open() && in_use && - in_use->is_current_stmt_binlog_format_row())) -+#endif /* WITH_WSREP */ - file->use_hidden_primary_key(); - } - else -@@ -5388,8 +5397,17 @@ void TABLE::mark_columns_needed_for_update() - in mark_columns_per_binlog_row_image, if not, then use - the hidden primary key - */ -+#ifdef WITH_WSREP -+ /* this does not affect wsrep patch as long as we use RBR only, -+ but this condition is just preparing for possible future STATEMENT -+ format support -+ */ -+ if (!((WSREP_EMULATE_BINLOG(current_thd) || mysql_bin_log.is_open()) && -+ in_use && in_use->is_current_stmt_binlog_format_row())) -+#else - if (!(mysql_bin_log.is_open() && in_use && - in_use->is_current_stmt_binlog_format_row())) -+#endif /* WITH_WSREP */ - file->use_hidden_primary_key(); - } - else -@@ -5441,9 +5459,15 @@ void TABLE::mark_columns_per_binlog_row_image() - If in RBR we may need to mark some extra columns, - depending on the binlog-row-image command line argument. - */ -+#ifdef WITH_WSREP -+ if (((WSREP_EMULATE_BINLOG(current_thd) || mysql_bin_log.is_open()) && -+ in_use && in_use->is_current_stmt_binlog_format_row() && -+ !ha_check_storage_engine_flag(s->db_type(), HTON_NO_BINLOG_ROW_OPT))) -+#else - if ((mysql_bin_log.is_open() && in_use && - in_use->is_current_stmt_binlog_format_row() && - !ha_check_storage_engine_flag(s->db_type(), HTON_NO_BINLOG_ROW_OPT))) -+#endif /* WITH_WSREP */ - { - - THD *thd= current_thd; -diff --git a/sql/transaction.cc b/sql/transaction.cc -index a307e8a..1247917 100644 ---- a/sql/transaction.cc -+++ b/sql/transaction.cc -@@ -102,6 +102,9 @@ static bool xa_trans_force_rollback(THD *thd) - by ha_rollback()/THD::transaction::cleanup(). - */ - thd->transaction.xid_state.rm_error= 0; -+#ifdef WITH_WSREP -+ wsrep_register_hton(thd, TRUE); -+#endif /* WITH_WSREP */ - if (ha_rollback_trans(thd, true)) - { - my_error(ER_XAER_RMERR, MYF(0)); -@@ -140,10 +143,16 @@ bool trans_begin(THD *thd, uint flags) - (thd->variables.option_bits & OPTION_TABLE_LOCK)) - { - thd->variables.option_bits&= ~OPTION_TABLE_LOCK; -+#ifdef WITH_WSREP -+ wsrep_register_hton(thd, TRUE); -+#endif /* WITH_WSREP */ - thd->server_status&= - ~(SERVER_STATUS_IN_TRANS | SERVER_STATUS_IN_TRANS_READONLY); - DBUG_PRINT("info", ("clearing SERVER_STATUS_IN_TRANS")); - res= MY_TEST(ha_commit_trans(thd, TRUE)); -+#ifdef WITH_WSREP -+ wsrep_post_commit(thd, TRUE); -+#endif /* WITH_WSREP */ - } - - thd->variables.option_bits&= ~OPTION_BEGIN; -@@ -181,6 +190,12 @@ bool trans_begin(THD *thd, uint flags) - thd->tx_read_only= false; - } - -+#ifdef WITH_WSREP -+ thd->wsrep_PA_safe= true; -+ if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) -+ DBUG_RETURN(TRUE); -+#endif /* WITH_WSREP */ -+ - thd->variables.option_bits|= OPTION_BEGIN; - thd->server_status|= SERVER_STATUS_IN_TRANS; - if (thd->tx_read_only) -@@ -222,12 +237,18 @@ bool trans_commit(THD *thd) - if (trans_check_state(thd)) - DBUG_RETURN(TRUE); - -+#ifdef WITH_WSREP -+ wsrep_register_hton(thd, TRUE); -+#endif /* WITH_WSREP */ - thd->server_status&= - ~(SERVER_STATUS_IN_TRANS | SERVER_STATUS_IN_TRANS_READONLY); - DBUG_PRINT("info", ("clearing SERVER_STATUS_IN_TRANS")); - res= ha_commit_trans(thd, TRUE); - thd->variables.option_bits&= ~OPTION_BEGIN; - thd->transaction.all.reset_unsafe_rollback_flags(); -+#ifdef WITH_WSREP -+ wsrep_post_commit(thd, TRUE); -+#endif /* WITH_WSREP */ - thd->lex->start_transaction_opt= 0; - - DBUG_RETURN(MY_TEST(res)); -@@ -275,10 +296,16 @@ bool trans_commit_implicit(THD *thd) - /* Safety if one did "drop table" on locked tables */ - if (!thd->locked_tables_mode) - thd->variables.option_bits&= ~OPTION_TABLE_LOCK; -- thd->server_status&= -+#ifdef WITH_WSREP -+ wsrep_register_hton(thd, TRUE); -+#endif /* WITH_WSREP */ -+ thd->server_status&= - ~(SERVER_STATUS_IN_TRANS | SERVER_STATUS_IN_TRANS_READONLY); - DBUG_PRINT("info", ("clearing SERVER_STATUS_IN_TRANS")); - res= MY_TEST(ha_commit_trans(thd, TRUE)); -+#ifdef WITH_WSREP -+ wsrep_post_commit(thd, TRUE); -+#endif /* WITH_WSREP */ - } - else if (tc_log) - tc_log->commit(thd, true); -@@ -312,6 +339,9 @@ bool trans_rollback(THD *thd) - { - int res; - DBUG_ENTER("trans_rollback"); -+#ifdef WITH_WSREP -+ thd->wsrep_PA_safe= true; -+#endif /* WITH_WSREP */ - - #ifndef DBUG_OFF - char buf1[256], buf2[256]; -@@ -326,6 +356,9 @@ bool trans_rollback(THD *thd) - if (trans_check_state(thd)) - DBUG_RETURN(TRUE); - -+#ifdef WITH_WSREP -+ wsrep_register_hton(thd, TRUE); -+#endif /* WITH_WSREP */ - thd->server_status&= - ~(SERVER_STATUS_IN_TRANS | SERVER_STATUS_IN_TRANS_READONLY); - DBUG_PRINT("info", ("clearing SERVER_STATUS_IN_TRANS")); -@@ -366,6 +399,9 @@ bool trans_rollback_implicit(THD *thd) - */ - DBUG_ASSERT(thd->transaction.stmt.is_empty() && !thd->in_sub_stmt); - -+#ifdef WITH_WSREP -+ wsrep_register_hton(thd, true); -+#endif /* WITH_WSREP */ - thd->server_status&= - ~(SERVER_STATUS_IN_TRANS | SERVER_STATUS_IN_TRANS_READONLY); - DBUG_PRINT("info", ("clearing SERVER_STATUS_IN_TRANS")); -@@ -431,12 +467,20 @@ bool trans_commit_stmt(THD *thd) - - if (thd->transaction.stmt.ha_list) - { -+#ifdef WITH_WSREP -+ wsrep_register_hton(thd, FALSE); -+#endif /* WITH_WSREP */ - res= ha_commit_trans(thd, FALSE); - if (! thd->in_active_multi_stmt_transaction()) -+#ifdef WITH_WSREP - { -+#endif /* WITH_WSREP */ - thd->tx_isolation= (enum_tx_isolation) thd->variables.tx_isolation; - thd->tx_read_only= thd->variables.tx_read_only; -+#ifdef WITH_WSREP -+ wsrep_post_commit(thd, FALSE); - } -+#endif /* WITH_WSREP */ - } - else if (tc_log) - tc_log->commit(thd, false); -@@ -481,6 +525,9 @@ bool trans_rollback_stmt(THD *thd) - - if (thd->transaction.stmt.ha_list) - { -+#ifdef WITH_WSREP -+ wsrep_register_hton(thd, FALSE); -+#endif /* WITH_WSREP */ - ha_rollback_trans(thd, FALSE); - if (! thd->in_active_multi_stmt_transaction()) - { -@@ -652,9 +699,16 @@ bool trans_rollback_to_savepoint(THD *thd, LEX_STRING name) - For backward-compatibility reasons we always release MDL if binary - logging is off. - */ -+#ifdef WITH_WSREP -+ bool mdl_can_safely_rollback_to_savepoint= -+ (!((WSREP_EMULATE_BINLOG(thd) || mysql_bin_log.is_open()) -+ && thd->variables.sql_log_bin) || -+ ha_rollback_to_savepoint_can_release_mdl(thd)); -+#else - bool mdl_can_safely_rollback_to_savepoint= - (!(mysql_bin_log.is_open() && thd->variables.sql_log_bin) || - ha_rollback_to_savepoint_can_release_mdl(thd)); -+#endif /* WITH_WSREP */ - - if (ha_rollback_to_savepoint(thd, sv)) - res= TRUE; -@@ -871,9 +925,15 @@ bool trans_xa_commit(THD *thd) - } - else if (xa_state == XA_IDLE && thd->lex->xa_opt == XA_ONE_PHASE) - { -+#ifdef WITH_WSREP -+ wsrep_register_hton(thd, TRUE); -+#endif /* WITH_WSREP */ - int r= ha_commit_trans(thd, TRUE); - if ((res= MY_TEST(r))) - my_error(r == 1 ? ER_XA_RBROLLBACK : ER_XAER_RMERR, MYF(0)); -+#ifdef WITH_WSREP -+ wsrep_post_commit(thd, TRUE); -+#endif /* WITH_WSREP */ - } - else if (xa_state == XA_PREPARED && thd->lex->xa_opt == XA_NONE) - { -@@ -892,6 +952,9 @@ bool trans_xa_commit(THD *thd) - if (thd->mdl_context.acquire_lock(&mdl_request, - thd->variables.lock_wait_timeout)) - { -+#ifdef WITH_WSREP -+ wsrep_register_hton(thd, TRUE); -+#endif /* WITH_WSREP */ - ha_rollback_trans(thd, TRUE); - my_error(ER_XAER_RMERR, MYF(0)); - } -diff --git a/sql/wsrep_applier.cc b/sql/wsrep_applier.cc -new file mode 100644 -index 0000000..bb95a66 ---- /dev/null -+++ b/sql/wsrep_applier.cc -@@ -0,0 +1,386 @@ -+/* Copyright (C) 2013 Codership Oy -+ -+ 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -+ -+#include "wsrep_priv.h" -+#include "wsrep_binlog.h" // wsrep_dump_rbr_buf() -+ -+#include "log_event.h" // class THD, EVENT_LEN_OFFSET, etc. -+#include "wsrep_applier.h" -+#include "debug_sync.h" -+ -+/* -+ read the first event from (*buf). The size of the (*buf) is (*buf_len). -+ At the end (*buf) is shitfed to point to the following event or NULL and -+ (*buf_len) will be changed to account just being read bytes of the 1st event. -+*/ -+ -+static Log_event* wsrep_read_log_event( -+ char **arg_buf, size_t *arg_buf_len, -+ const Format_description_log_event *description_event) -+{ -+ DBUG_ENTER("wsrep_read_log_event"); -+ char *head= (*arg_buf); -+ -+ uint data_len = uint4korr(head + EVENT_LEN_OFFSET); -+ char *buf= (*arg_buf); -+ const char *error= 0; -+ Log_event *res= 0; -+ -+ if (data_len > wsrep_max_ws_size) -+ { -+ error = "Event too big"; -+ goto err; -+ } -+ -+ res= Log_event::read_log_event(buf, data_len, &error, description_event, 0); -+ -+err: -+ if (!res) -+ { -+ DBUG_ASSERT(error != 0); -+ sql_print_error("Error in Log_event::read_log_event(): " -+ "'%s', data_len: %d, event_type: %d", -+ error,data_len,head[EVENT_TYPE_OFFSET]); -+ } -+ (*arg_buf)+= data_len; -+ (*arg_buf_len)-= data_len; -+ DBUG_RETURN(res); -+} -+ -+#include "transaction.h" // trans_commit(), trans_rollback() -+#include "rpl_rli.h" // class Relay_log_info; -+#include "sql_base.h" // close_temporary_table() -+ -+static inline void -+wsrep_set_apply_format(THD* thd, Format_description_log_event* ev) -+{ -+ if (thd->wsrep_apply_format) -+ { -+ delete (Format_description_log_event*)thd->wsrep_apply_format; -+ } -+ thd->wsrep_apply_format= ev; -+} -+ -+static inline Format_description_log_event* -+wsrep_get_apply_format(THD* thd) -+{ -+ if (thd->wsrep_apply_format) -+ return (Format_description_log_event*) thd->wsrep_apply_format; -+ return thd->wsrep_rli->get_rli_description_event(); -+} -+ -+static wsrep_cb_status_t wsrep_apply_events(THD* thd, -+ const void* events_buf, -+ size_t buf_len) -+{ -+ char *buf= (char *)events_buf; -+ int rcode= 0; -+ int event= 1; -+ -+ DBUG_ENTER("wsrep_apply_events"); -+ -+ if (thd->killed == THD::KILL_CONNECTION && -+ thd->wsrep_conflict_state != REPLAYING) -+ { -+ WSREP_INFO("applier has been aborted, skipping apply_rbr: %lld", -+ (long long) wsrep_thd_trx_seqno(thd)); -+ DBUG_RETURN(WSREP_CB_FAILURE); -+ } -+ -+ mysql_mutex_lock(&thd->LOCK_wsrep_thd); -+ thd->wsrep_query_state= QUERY_EXEC; -+ if (thd->wsrep_conflict_state!= REPLAYING) -+ thd->wsrep_conflict_state= NO_CONFLICT; -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ -+ if (!buf_len) WSREP_DEBUG("empty rbr buffer to apply: %lld", -+ (long long) wsrep_thd_trx_seqno(thd)); -+ -+ while(buf_len) -+ { -+ int exec_res; -+ Log_event* ev= wsrep_read_log_event(&buf, &buf_len, -+ wsrep_get_apply_format(thd)); -+ -+ if (!ev) -+ { -+ WSREP_ERROR("applier could not read binlog event, seqno: %lld, len: %zu", -+ (long long)wsrep_thd_trx_seqno(thd), buf_len); -+ rcode= 1; -+ goto error; -+ } -+ -+ switch (ev->get_type_code()) { -+ case FORMAT_DESCRIPTION_EVENT: -+ wsrep_set_apply_format(thd, (Format_description_log_event*)ev); -+ continue; -+ case GTID_LOG_EVENT: -+ { -+ Gtid_log_event* gev= (Gtid_log_event*)ev; -+ if (gev->get_gno() == 0) -+ { -+ /* Skip GTID log event to make binlog to generate LTID on commit */ -+ delete ev; -+ continue; -+ } -+ } -+ default: -+ break; -+ } -+ -+ thd->server_id = ev->server_id; // use the original server id for logging -+ thd->set_time(); // time the query -+ wsrep_xid_init(&thd->transaction.xid_state.xid, -+ &thd->wsrep_trx_meta.gtid.uuid, -+ thd->wsrep_trx_meta.gtid.seqno); -+ thd->lex->current_select= 0; -+ if (!ev->when.tv_sec) -+ my_micro_time_to_timeval(my_micro_time(), &ev->when); -+ ev->thd = thd; -+ exec_res = ev->apply_event(thd->wsrep_rli); -+ DBUG_PRINT("info", ("exec_event result: %d", exec_res)); -+ -+ if (exec_res) -+ { -+ WSREP_WARN("RBR event %d %s apply warning: %d, %lld", -+ event, ev->get_type_str(), exec_res, -+ (long long) wsrep_thd_trx_seqno(thd)); -+ rcode= exec_res; -+ /* stop processing for the first error */ -+ delete ev; -+ goto error; -+ } -+ event++; -+ -+ if (thd->wsrep_conflict_state!= NO_CONFLICT && -+ thd->wsrep_conflict_state!= REPLAYING) -+ WSREP_WARN("conflict state after RBR event applying: %d, %lld", -+ thd->wsrep_query_state, (long long)wsrep_thd_trx_seqno(thd)); -+ -+ if (thd->wsrep_conflict_state == MUST_ABORT) { -+ WSREP_WARN("RBR event apply failed, rolling back: %lld", -+ (long long) wsrep_thd_trx_seqno(thd)); -+ trans_rollback(thd); -+ thd->locked_tables_list.unlock_locked_tables(thd); -+ /* Release transactional metadata locks. */ -+ thd->mdl_context.release_transactional_locks(); -+ thd->wsrep_conflict_state= NO_CONFLICT; -+ DBUG_RETURN(WSREP_CB_FAILURE); -+ } -+ -+ delete ev; -+ } -+ -+ error: -+ mysql_mutex_lock(&thd->LOCK_wsrep_thd); -+ thd->wsrep_query_state= QUERY_IDLE; -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ -+ assert(thd->wsrep_exec_mode== REPL_RECV); -+ -+ if (thd->killed == THD::KILL_CONNECTION) -+ WSREP_INFO("applier aborted: %lld", (long long)wsrep_thd_trx_seqno(thd)); -+ -+ if (rcode) DBUG_RETURN(WSREP_CB_FAILURE); -+ DBUG_RETURN(WSREP_CB_SUCCESS); -+} -+ -+wsrep_cb_status_t wsrep_apply_cb(void* const ctx, -+ const void* const buf, -+ size_t const buf_len, -+ uint32_t const flags, -+ const wsrep_trx_meta_t* meta) -+{ -+ THD* const thd((THD*)ctx); -+ -+// Allow tests to block the applier thread using the DBUG facilities -+ DBUG_EXECUTE_IF("sync.wsrep_apply_cb", -+ { -+ const char act[]= -+ "now " -+ "wait_for signal.wsrep_apply_cb"; -+ DBUG_ASSERT(!debug_sync_set_action(thd, -+ STRING_WITH_LEN(act))); -+ };); -+ -+ thd->wsrep_trx_meta = *meta; -+ -+#ifdef WSREP_PROC_INFO -+ snprintf(thd->wsrep_info, sizeof(thd->wsrep_info) - 1, -+ "applying write set %lld: %p, %zu", -+ (long long)wsrep_thd_trx_seqno(thd), buf, buf_len); -+ thd_proc_info(thd, thd->wsrep_info); -+#else -+ thd_proc_info(thd, "applying write set"); -+#endif /* WSREP_PROC_INFO */ -+ -+ /* tune FK and UK checking policy */ -+ if (wsrep_slave_UK_checks == FALSE) -+ thd->variables.option_bits|= OPTION_RELAXED_UNIQUE_CHECKS; -+ else -+ thd->variables.option_bits&= ~OPTION_RELAXED_UNIQUE_CHECKS; -+ -+ if (wsrep_slave_FK_checks == FALSE) -+ thd->variables.option_bits|= OPTION_NO_FOREIGN_KEY_CHECKS; -+ else -+ thd->variables.option_bits&= ~OPTION_NO_FOREIGN_KEY_CHECKS; -+ -+ if (flags & WSREP_FLAG_ISOLATION) -+ { -+ thd->wsrep_apply_toi= true; -+ /* -+ Don't run in transaction mode with TOI actions. -+ */ -+ thd->variables.option_bits&= ~OPTION_BEGIN; -+ thd->server_status&= ~SERVER_STATUS_IN_TRANS; -+ } -+ wsrep_cb_status_t rcode(wsrep_apply_events(thd, buf, buf_len)); -+ -+#ifdef WSREP_PROC_INFO -+ snprintf(thd->wsrep_info, sizeof(thd->wsrep_info) - 1, -+ "applied write set %lld", (long long)wsrep_thd_trx_seqno(thd)); -+ thd_proc_info(thd, thd->wsrep_info); -+#else -+ thd_proc_info(thd, "applied write set"); -+#endif /* WSREP_PROC_INFO */ -+ -+ if (WSREP_CB_SUCCESS != rcode) -+ { -+ wsrep_dump_rbr_buf(thd, buf, buf_len); -+ } -+ -+ TABLE *tmp; -+ while ((tmp = thd->temporary_tables)) -+ { -+ WSREP_DEBUG("Applier %lu, has temporary tables: %s.%s", -+ thd->thread_id, -+ (tmp->s) ? tmp->s->db.str : "void", -+ (tmp->s) ? tmp->s->table_name.str : "void"); -+ close_temporary_table(thd, tmp, 1, 1); -+ } -+ -+ return rcode; -+} -+ -+static wsrep_cb_status_t wsrep_commit(THD* const thd, -+ wsrep_seqno_t const global_seqno) -+{ -+#ifdef WSREP_PROC_INFO -+ snprintf(thd->wsrep_info, sizeof(thd->wsrep_info) - 1, -+ "committing %lld", (long long)wsrep_thd_trx_seqno(thd)); -+ thd_proc_info(thd, thd->wsrep_info); -+#else -+ thd_proc_info(thd, "committing"); -+#endif /* WSREP_PROC_INFO */ -+ -+ wsrep_cb_status_t const rcode(trans_commit(thd) ? -+ WSREP_CB_FAILURE : WSREP_CB_SUCCESS); -+ -+#ifdef WSREP_PROC_INFO -+ snprintf(thd->wsrep_info, sizeof(thd->wsrep_info) - 1, -+ "committed %lld", (long long)wsrep_thd_trx_seqno(thd)); -+ thd_proc_info(thd, thd->wsrep_info); -+#else -+ thd_proc_info(thd, "committed"); -+#endif /* WSREP_PROC_INFO */ -+ -+ if (WSREP_CB_SUCCESS == rcode) -+ { -+ thd->wsrep_rli->cleanup_context(thd, 0); -+ thd->variables.gtid_next.set_automatic(); -+ // TODO: mark snapshot with global_seqno. -+ } -+ -+ return rcode; -+} -+ -+static wsrep_cb_status_t wsrep_rollback(THD* const thd, -+ wsrep_seqno_t const global_seqno) -+{ -+#ifdef WSREP_PROC_INFO -+ snprintf(thd->wsrep_info, sizeof(thd->wsrep_info) - 1, -+ "rolling back %lld", (long long)wsrep_thd_trx_seqno(thd)); -+ thd_proc_info(thd, thd->wsrep_info); -+#else -+ thd_proc_info(thd, "rolling back"); -+#endif /* WSREP_PROC_INFO */ -+ -+ wsrep_cb_status_t const rcode(trans_rollback(thd) ? -+ WSREP_CB_FAILURE : WSREP_CB_SUCCESS); -+ -+#ifdef WSREP_PROC_INFO -+ snprintf(thd->wsrep_info, sizeof(thd->wsrep_info) - 1, -+ "rolled back %lld", (long long)wsrep_thd_trx_seqno(thd)); -+ thd_proc_info(thd, thd->wsrep_info); -+#else -+ thd_proc_info(thd, "rolled back"); -+#endif /* WSREP_PROC_INFO */ -+ thd->wsrep_rli->cleanup_context(thd, 0); -+ thd->variables.gtid_next.set_automatic(); -+ -+ return rcode; -+} -+ -+wsrep_cb_status_t wsrep_commit_cb(void* const ctx, -+ uint32_t const flags, -+ const wsrep_trx_meta_t* meta, -+ wsrep_bool_t* const exit, -+ bool const commit) -+{ -+ THD* const thd((THD*)ctx); -+ -+ assert(meta->gtid.seqno == wsrep_thd_trx_seqno(thd)); -+ -+ wsrep_cb_status_t rcode; -+ -+ if (commit) -+ rcode = wsrep_commit(thd, meta->gtid.seqno); -+ else -+ rcode = wsrep_rollback(thd, meta->gtid.seqno); -+ -+ wsrep_set_apply_format(thd, NULL); -+ thd->mdl_context.release_transactional_locks(); -+ free_root(thd->mem_root,MYF(MY_KEEP_PREALLOC)); -+ thd->tx_isolation= (enum_tx_isolation) thd->variables.tx_isolation; -+ -+ if (wsrep_slave_count_change < 0 && commit && WSREP_CB_SUCCESS == rcode) -+ { -+ mysql_mutex_lock(&LOCK_wsrep_slave_threads); -+ if (wsrep_slave_count_change < 0) -+ { -+ wsrep_slave_count_change++; -+ *exit = true; -+ } -+ mysql_mutex_unlock(&LOCK_wsrep_slave_threads); -+ } -+ -+ if (*exit == false && thd->wsrep_applier) -+ { -+ /* From trans_begin() */ -+ thd->variables.option_bits|= OPTION_BEGIN; -+ thd->server_status|= SERVER_STATUS_IN_TRANS; -+ thd->wsrep_apply_toi= false; -+ } -+ -+ return rcode; -+} -+ -+ -+wsrep_cb_status_t wsrep_unordered_cb(void* const ctx, -+ const void* const data, -+ size_t const size) -+{ -+ return WSREP_CB_SUCCESS; -+} -diff --git a/sql/wsrep_applier.h b/sql/wsrep_applier.h -new file mode 100644 -index 0000000..816970d ---- /dev/null -+++ b/sql/wsrep_applier.h -@@ -0,0 +1,38 @@ -+/* Copyright 2013 Codership Oy -+ -+ 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 */ -+ -+#ifndef WSREP_APPLIER_H -+#define WSREP_APPLIER_H -+ -+#include -+ -+/* wsrep callback prototypes */ -+ -+wsrep_cb_status_t wsrep_apply_cb(void *ctx, -+ const void* buf, size_t buf_len, -+ uint32_t flags, -+ const wsrep_trx_meta_t* meta); -+ -+wsrep_cb_status_t wsrep_commit_cb(void *ctx, -+ uint32_t flags, -+ const wsrep_trx_meta_t* meta, -+ wsrep_bool_t* exit, -+ bool commit); -+ -+wsrep_cb_status_t wsrep_unordered_cb(void* ctx, -+ const void* data, -+ size_t size); -+ -+#endif /* WSREP_APPLIER_H */ -diff --git a/sql/wsrep_binlog.cc b/sql/wsrep_binlog.cc -new file mode 100644 -index 0000000..e33422f ---- /dev/null -+++ b/sql/wsrep_binlog.cc -@@ -0,0 +1,414 @@ -+/* Copyright (C) 2013 Codership Oy -+ -+ 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -+ -+#include "wsrep_binlog.h" -+#include "wsrep_priv.h" -+ -+/* -+ Write the contents of a cache to a memory buffer. -+ -+ This function quite the same as MYSQL_BIN_LOG::write_cache(), -+ with the exception that here we write in buffer instead of log file. -+ */ -+int wsrep_write_cache_buf(IO_CACHE *cache, uchar **buf, size_t *buf_len) -+{ -+ *buf= NULL; -+ *buf_len= 0; -+ -+ my_off_t const saved_pos(my_b_tell(cache)); -+ -+ if (reinit_io_cache(cache, READ_CACHE, 0, 0, 0)) -+ { -+ WSREP_ERROR("failed to initialize io-cache"); -+ return ER_ERROR_ON_WRITE; -+ } -+ -+ uint length = my_b_bytes_in_cache(cache); -+ if (unlikely(0 == length)) length = my_b_fill(cache); -+ -+ size_t total_length = 0; -+ -+ if (likely(length > 0)) do -+ { -+ total_length += length; -+ /* -+ Bail out if buffer grows too large. -+ A temporary fix to avoid allocating indefinitely large buffer, -+ not a real limit on a writeset size which includes other things -+ like header and keys. -+ */ -+ if (total_length > wsrep_max_ws_size) -+ { -+ WSREP_WARN("transaction size limit (%lu) exceeded: %zu", -+ wsrep_max_ws_size, total_length); -+ goto error; -+ } -+ -+ uchar* tmp = (uchar *)my_realloc(*buf, total_length, MYF(0)); -+ if (!tmp) -+ { -+ WSREP_ERROR("could not (re)allocate buffer: %zu + %u", -+ *buf_len, length); -+ goto error; -+ } -+ *buf = tmp; -+ -+ memcpy(*buf + *buf_len, cache->read_pos, length); -+ *buf_len = total_length; -+ cache->read_pos = cache->read_end; -+ } while ((cache->file >= 0) && (length = my_b_fill(cache))); -+ -+ if (reinit_io_cache(cache, WRITE_CACHE, saved_pos, 0, 0)) -+ { -+ WSREP_WARN("failed to initialize io-cache"); -+ goto cleanup; -+ } -+ -+ if (reinit_io_cache(cache, WRITE_CACHE, saved_pos, 0, 0)) -+ { -+ WSREP_ERROR("failed to initialize io-cache"); -+ goto cleanup; -+ } -+ -+ return 0; -+ -+error: -+ if (reinit_io_cache(cache, WRITE_CACHE, saved_pos, 0, 0)) -+ { -+ WSREP_WARN("failed to initialize io-cache"); -+ } -+cleanup: -+ my_free(*buf); -+ *buf= NULL; -+ *buf_len= 0; -+ return ER_ERROR_ON_WRITE; -+} -+ -+#define STACK_SIZE 4096 /* 4K - for buffer preallocated on the stack: -+ * many transactions would fit in there -+ * so there is no need to reach for the heap */ -+ -+/* Returns minimum multiple of HEAP_PAGE_SIZE that is >= length */ -+static inline size_t -+heap_size(size_t length) -+{ -+ return (length + HEAP_PAGE_SIZE - 1)/HEAP_PAGE_SIZE*HEAP_PAGE_SIZE; -+} -+ -+/* append data to writeset */ -+static inline wsrep_status_t -+wsrep_append_data(wsrep_t* const wsrep, -+ wsrep_ws_handle_t* const ws, -+ const void* const data, -+ size_t const len) -+{ -+ struct wsrep_buf const buff = { data, len }; -+ wsrep_status_t const rc(wsrep->append_data(wsrep, ws, &buff, 1, -+ WSREP_DATA_ORDERED, true)); -+ if (rc != WSREP_OK) -+ { -+ WSREP_WARN("append_data() returned %d", rc); -+ } -+ -+ return rc; -+} -+ -+/* -+ Write the contents of a cache to wsrep provider. -+ -+ This function quite the same as MYSQL_BIN_LOG::write_cache(), -+ with the exception that here we write in buffer instead of log file. -+ -+ This version reads all of cache into single buffer and then appends to a -+ writeset at once. -+ */ -+static int wsrep_write_cache_once(wsrep_t* const wsrep, -+ THD* const thd, -+ IO_CACHE* const cache, -+ size_t* const len) -+{ -+ my_off_t const saved_pos(my_b_tell(cache)); -+ -+ if (reinit_io_cache(cache, READ_CACHE, 0, 0, 0)) -+ { -+ WSREP_ERROR("failed to initialize io-cache"); -+ return ER_ERROR_ON_WRITE; -+ } -+ -+ int err(WSREP_OK); -+ -+ size_t total_length(0); -+ uchar stack_buf[STACK_SIZE]; /* to avoid dynamic allocations for few data*/ -+ uchar* heap_buf(NULL); -+ uchar* buf(stack_buf); -+ size_t allocated(sizeof(stack_buf)); -+ size_t used(0); -+ -+ uint length(my_b_bytes_in_cache(cache)); -+ if (unlikely(0 == length)) length = my_b_fill(cache); -+ -+ if (likely(length > 0)) do -+ { -+ total_length += length; -+ /* -+ Bail out if buffer grows too large. -+ A temporary fix to avoid allocating indefinitely large buffer, -+ not a real limit on a writeset size which includes other things -+ like header and keys. -+ */ -+ if (unlikely(total_length > wsrep_max_ws_size)) -+ { -+ WSREP_WARN("transaction size limit (%lu) exceeded: %zu", -+ wsrep_max_ws_size, total_length); -+ err = WSREP_TRX_SIZE_EXCEEDED; -+ goto cleanup; -+ } -+ -+ if (total_length > allocated) -+ { -+ size_t const new_size(heap_size(total_length)); -+ uchar* tmp = (uchar *)my_realloc(heap_buf, new_size, MYF(0)); -+ if (!tmp) -+ { -+ WSREP_ERROR("could not (re)allocate buffer: %zu + %u", -+ allocated, length); -+ err = WSREP_TRX_SIZE_EXCEEDED; -+ goto cleanup; -+ } -+ -+ heap_buf = tmp; -+ buf = heap_buf; -+ allocated = new_size; -+ -+ if (used <= STACK_SIZE && used > 0) // there's data in stack_buf -+ { -+ DBUG_ASSERT(buf == stack_buf); -+ memcpy(heap_buf, stack_buf, used); -+ } -+ } -+ -+ memcpy(buf + used, cache->read_pos, length); -+ used = total_length; -+ cache->read_pos = cache->read_end; -+ } while ((cache->file >= 0) && (length = my_b_fill(cache))); -+ -+ if (used > 0) -+ err = wsrep_append_data(wsrep, &thd->wsrep_ws_handle, buf, used); -+ -+ if (WSREP_OK == err) *len = total_length; -+ -+cleanup: -+ if (reinit_io_cache(cache, WRITE_CACHE, saved_pos, 0, 0)) -+ { -+ WSREP_ERROR("failed to reinitialize io-cache"); -+ } -+ -+ if (unlikely(WSREP_OK != err)) wsrep_dump_rbr_buf(thd, buf, used); -+ -+ my_free(heap_buf); -+ return err; -+} -+ -+/* -+ Write the contents of a cache to wsrep provider. -+ -+ This function quite the same as MYSQL_BIN_LOG::write_cache(), -+ with the exception that here we write in buffer instead of log file. -+ -+ This version uses incremental data appending as it reads it from cache. -+ */ -+static int wsrep_write_cache_inc(wsrep_t* const wsrep, -+ THD* const thd, -+ IO_CACHE* const cache, -+ size_t* const len) -+{ -+ my_off_t const saved_pos(my_b_tell(cache)); -+ -+ if (reinit_io_cache(cache, READ_CACHE, 0, 0, 0)) -+ { -+ WSREP_ERROR("failed to initialize io-cache"); -+ return WSREP_TRX_ERROR; -+ } -+ -+ int err(WSREP_OK); -+ -+ size_t total_length(0); -+ -+ uint length(my_b_bytes_in_cache(cache)); -+ if (unlikely(0 == length)) length = my_b_fill(cache); -+ -+ if (likely(length > 0)) do -+ { -+ total_length += length; -+ /* bail out if buffer grows too large -+ not a real limit on a writeset size which includes other things -+ like header and keys. -+ */ -+ if (unlikely(total_length > wsrep_max_ws_size)) -+ { -+ WSREP_WARN("transaction size limit (%lu) exceeded: %zu", -+ wsrep_max_ws_size, total_length); -+ err = WSREP_TRX_SIZE_EXCEEDED; -+ goto cleanup; -+ } -+ -+ if(WSREP_OK != (err=wsrep_append_data(wsrep, &thd->wsrep_ws_handle, -+ cache->read_pos, length))) -+ goto cleanup; -+ -+ cache->read_pos = cache->read_end; -+ } while ((cache->file >= 0) && (length = my_b_fill(cache))); -+ -+ if (WSREP_OK == err) *len = total_length; -+ -+cleanup: -+ if (reinit_io_cache(cache, WRITE_CACHE, saved_pos, 0, 0)) -+ { -+ WSREP_ERROR("failed to reinitialize io-cache"); -+ } -+ -+ return err; -+} -+ -+/* -+ Write the contents of a cache to wsrep provider. -+ -+ This function quite the same as MYSQL_BIN_LOG::write_cache(), -+ with the exception that here we write in buffer instead of log file. -+ */ -+int wsrep_write_cache(wsrep_t* const wsrep, -+ THD* const thd, -+ IO_CACHE* const cache, -+ size_t* const len) -+{ -+ if (wsrep_incremental_data_collection) { -+ return wsrep_write_cache_inc(wsrep, thd, cache, len); -+ } -+ else { -+ return wsrep_write_cache_once(wsrep, thd, cache, len); -+ } -+} -+ -+void wsrep_dump_rbr_buf(THD *thd, const void* rbr_buf, size_t buf_len) -+{ -+ char filename[PATH_MAX]= {0}; -+ int len= snprintf(filename, PATH_MAX, "%s/GRA_%ld_%lld.log", -+ wsrep_data_home_dir, thd->thread_id, -+ (long long)wsrep_thd_trx_seqno(thd)); -+ if (len >= PATH_MAX) -+ { -+ WSREP_ERROR("RBR dump path too long: %d, skipping dump.", len); -+ return; -+ } -+ -+ FILE *of= fopen(filename, "wb"); -+ if (of) -+ { -+ fwrite (rbr_buf, buf_len, 1, of); -+ fclose(of); -+ } -+ else -+ { -+ WSREP_ERROR("Failed to open file '%s': %d (%s)", -+ filename, errno, strerror(errno)); -+ } -+} -+ -+void wsrep_dump_rbr_direct(THD* thd, IO_CACHE* cache) -+{ -+ char filename[PATH_MAX]= {0}; -+ int len= snprintf(filename, PATH_MAX, "%s/GRA_%ld_%lld.log", -+ wsrep_data_home_dir, thd->thread_id, -+ (long long)wsrep_thd_trx_seqno(thd)); -+ size_t bytes_in_cache = 0; -+ // check path -+ if (len >= PATH_MAX) -+ { -+ WSREP_ERROR("RBR dump path too long: %d, skipping dump.", len); -+ return ; -+ } -+ // init cache -+ my_off_t const saved_pos(my_b_tell(cache)); -+ if (reinit_io_cache(cache, READ_CACHE, 0, 0, 0)) -+ { -+ WSREP_ERROR("failed to initialize io-cache"); -+ return ; -+ } -+ // open file -+ FILE* of = fopen(filename, "wb"); -+ if (!of) -+ { -+ WSREP_ERROR("Failed to open file '%s': %d (%s)", -+ filename, errno, strerror(errno)); -+ goto cleanup; -+ } -+ // ready to write -+ bytes_in_cache= my_b_bytes_in_cache(cache); -+ if (unlikely(bytes_in_cache == 0)) bytes_in_cache = my_b_fill(cache); -+ if (likely(bytes_in_cache > 0)) do -+ { -+ if (my_fwrite(of, cache->read_pos, bytes_in_cache, -+ MYF(MY_WME | MY_NABP)) == (size_t) -1) -+ { -+ WSREP_ERROR("Failed to write file '%s'", filename); -+ goto cleanup; -+ } -+ cache->read_pos= cache->read_end; -+ } while ((cache->file >= 0) && (bytes_in_cache= my_b_fill(cache))); -+ if(cache->error == -1) -+ { -+ WSREP_ERROR("RBR inconsistent"); -+ goto cleanup; -+ } -+cleanup: -+ // init back -+ if (reinit_io_cache(cache, WRITE_CACHE, saved_pos, 0, 0)) -+ { -+ WSREP_ERROR("failed to reinitialize io-cache"); -+ } -+ // close file -+ if (of) fclose(of); -+} -+ -+extern handlerton *binlog_hton; -+ -+/* -+ wsrep exploits binlog's caches even if binlogging itself is not -+ activated. In such case connection close needs calling -+ actual binlog's method. -+ Todo: split binlog hton from its caches to use ones by wsrep -+ without referring to binlog's stuff. -+*/ -+int wsrep_binlog_close_connection(THD* thd) -+{ -+ DBUG_ENTER("wsrep_binlog_close_connection"); -+ if (thd_get_ha_data(thd, binlog_hton) != NULL) -+ binlog_hton->close_connection (binlog_hton, thd); -+ DBUG_RETURN(0); -+} -+ -+int wsrep_binlog_savepoint_set(THD *thd, void *sv) -+{ -+ if (!wsrep_emulate_bin_log) return 0; -+ int rcode = binlog_hton->savepoint_set(binlog_hton, thd, sv); -+ return rcode; -+} -+ -+int wsrep_binlog_savepoint_rollback(THD *thd, void *sv) -+{ -+ if (!wsrep_emulate_bin_log) return 0; -+ int rcode = binlog_hton->savepoint_rollback(binlog_hton, thd, sv); -+ return rcode; -+} -diff --git a/sql/wsrep_binlog.h b/sql/wsrep_binlog.h -new file mode 100644 -index 0000000..a7b680f ---- /dev/null -+++ b/sql/wsrep_binlog.h -@@ -0,0 +1,56 @@ -+/* Copyright (C) 2013 Codership Oy -+ -+ 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -+ -+#ifndef WSREP_BINLOG_H -+#define WSREP_BINLOG_H -+ -+#include "sql_class.h" // THD, IO_CACHE -+ -+#define HEAP_PAGE_SIZE 65536 /* 64K */ -+#define WSREP_MAX_WS_SIZE (0xFFFFFFFFUL - HEAP_PAGE_SIZE) -+ -+/* -+ Write the contents of a cache to a memory buffer. -+ -+ This function quite the same as MYSQL_BIN_LOG::write_cache(), -+ with the exception that here we write in buffer instead of log file. -+ */ -+int wsrep_write_cache_buf(IO_CACHE *cache, uchar **buf, size_t *buf_len); -+ -+/* -+ Write the contents of a cache to wsrep provider. -+ -+ This function quite the same as MYSQL_BIN_LOG::write_cache(), -+ with the exception that here we write in buffer instead of log file. -+ -+ @param len total amount of data written -+ @return wsrep error status -+ */ -+int wsrep_write_cache (wsrep_t* wsrep, -+ THD* thd, -+ IO_CACHE* cache, -+ size_t* len); -+ -+/* Dump replication buffer to disk */ -+void wsrep_dump_rbr_buf(THD *thd, const void* rbr_buf, size_t buf_len); -+ -+/* Dump replication buffer to disk without intermediate buffer */ -+void wsrep_dump_rbr_direct(THD* thd, IO_CACHE* cache); -+ -+int wsrep_binlog_close_connection(THD* thd); -+int wsrep_binlog_savepoint_set(THD *thd, void *sv); -+int wsrep_binlog_savepoint_rollback(THD *thd, void *sv); -+ -+#endif /* WSREP_BINLOG_H */ -diff --git a/sql/wsrep_check_opts.cc b/sql/wsrep_check_opts.cc -new file mode 100644 -index 0000000..5ec18c7 ---- /dev/null -+++ b/sql/wsrep_check_opts.cc -@@ -0,0 +1,379 @@ -+/* Copyright 2011 Codership Oy -+ -+ 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 */ -+ -+//#include -+#include -+//#include -+//#include -+ -+#include "wsrep_mysqld.h" -+ -+#include -+#include -+#include -+#include -+ -+/* This file is about checking for correctness of mysql configuration options */ -+ -+struct opt -+{ -+ const char* const name; -+ const char* value; -+}; -+ -+/* A list of options to check. -+ * At first we assume default values and then see if they are changed on CLI or -+ * in my.cnf */ -+static struct opt opts[] = -+{ -+ { "wsrep_slave_threads", "1" }, // mysqld.cc -+ { "bind_address", "0.0.0.0" }, // mysqld.cc -+ { "wsrep_sst_method", "rsync" }, // mysqld.cc -+ { "wsrep_sst_receive_address","AUTO"}, // mysqld.cc -+ { "binlog_format", "ROW" }, // mysqld.cc -+ { "wsrep_provider", "none" }, // mysqld.cc -+ { "query_cache_type", "0" }, // mysqld.cc -+ { "query_cache_size", "0" }, // mysqld.cc -+ { "locked_in_memory", "0" }, // mysqld.cc -+ { "wsrep_cluster_address", "0" }, // mysqld.cc -+ { "locks_unsafe_for_binlog", "0" }, // ha_innodb.cc -+ { "autoinc_lock_mode", "1" }, // ha_innodb.cc -+ { 0, 0 } -+}; -+ -+enum -+{ -+ WSREP_SLAVE_THREADS, -+ BIND_ADDRESS, -+ WSREP_SST_METHOD, -+ WSREP_SST_RECEIVE_ADDRESS, -+ BINLOG_FORMAT, -+ WSREP_PROVIDER, -+ QUERY_CACHE_TYPE, -+ QUERY_CACHE_SIZE, -+ LOCKED_IN_MEMORY, -+ WSREP_CLUSTER_ADDRESS, -+ LOCKS_UNSAFE_FOR_BINLOG, -+ AUTOINC_LOCK_MODE -+}; -+ -+ -+/* A class to make a copy of argv[] vector */ -+struct argv_copy -+{ -+ int const argc_; -+ char** argv_; -+ -+ argv_copy (int const argc, const char* const argv[]) : -+ argc_ (argc), -+ argv_ (reinterpret_cast(calloc(argc_, sizeof(char*)))) -+ { -+ if (argv_) -+ { -+ for (int i = 0; i < argc_; ++i) -+ { -+ argv_[i] = strdup(argv[i]); -+ -+ if (!argv_[i]) -+ { -+ argv_free (); // free whatever bee allocated -+ return; -+ } -+ } -+ } -+ } -+ -+ ~argv_copy () { argv_free (); } -+ -+private: -+ argv_copy (const argv_copy&); -+ argv_copy& operator= (const argv_copy&); -+ -+ void argv_free() -+ { -+ if (argv_) -+ { -+ for (int i = 0; (i < argc_) && argv_[i] ; ++i) free (argv_[i]); -+ free (argv_); -+ argv_ = 0; -+ } -+ } -+}; -+ -+/* a short corresponding to '--' byte sequence */ -+static short const long_opt_prefix ('-' + ('-' << 8)); -+ -+/* Normalizes long options to have '_' instead of '-' */ -+static int -+normalize_opts (argv_copy& a) -+{ -+ if (a.argv_) -+ { -+ for (int i = 0; i < a.argc_; ++i) -+ { -+ char* ptr = a.argv_[i]; -+ if (long_opt_prefix == *(short*)ptr) // long option -+ { -+ ptr += 2; -+ const char* end = strchr(ptr, '='); -+ -+ if (!end) end = ptr + strlen(ptr); -+ -+ for (; ptr != end; ++ptr) if ('-' == *ptr) *ptr = '_'; -+ } -+ } -+ -+ return 0; -+ } -+ -+ return EINVAL; -+} -+ -+/* Find required options in the argument list and change their values */ -+static int -+find_opts (argv_copy& a, struct opt* const opts) -+{ -+ for (int i = 0; i < a.argc_; ++i) -+ { -+ char* ptr = a.argv_[i] + 2; // we're interested only in long options -+ -+ struct opt* opt = opts; -+ for (; 0 != opt->name; ++opt) -+ { -+ if (!strstr(ptr, opt->name)) continue; // try next option -+ -+ /* 1. try to find value after the '=' */ -+ opt->value = strchr(ptr, '=') + 1; -+ -+ /* 2. if no '=', try next element in the argument vector */ -+ if (reinterpret_cast(1) == opt->value) -+ { -+ /* also check that the next element is not an option itself */ -+ if (i + 1 < a.argc_ && *(a.argv_[i + 1]) != '-') -+ { -+ ++i; -+ opt->value = a.argv_[i]; -+ } -+ else opt->value = ""; // no value supplied (like boolean opt) -+ } -+ -+ break; // option found, break inner loop -+ } -+ } -+ -+ return 0; -+} -+ -+/* Parses string for an integer. Returns 0 on success. */ -+int get_long_long (const struct opt& opt, long long* const val, int const base) -+{ -+ const char* const str = opt.value; -+ -+ if ('\0' != *str) -+ { -+ char* endptr; -+ -+ *val = strtoll (str, &endptr, base); -+ -+ if ('k' == *endptr || 'K' == *endptr) -+ { -+ *val *= 1024L; -+ endptr++; -+ } -+ else if ('m' == *endptr || 'M' == *endptr) -+ { -+ *val *= 1024L * 1024L; -+ endptr++; -+ } -+ else if ('g' == *endptr || 'G' == *endptr) -+ { -+ *val *= 1024L * 1024L * 1024L; -+ endptr++; -+ } -+ -+ if ('\0' == *endptr) return 0; // the whole string was a valid integer -+ } -+ -+ WSREP_ERROR ("Bad value for *%s: '%s'. Should be integer.", -+ opt.name, opt.value); -+ -+ return EINVAL; -+} -+ -+/* This is flimzy coz hell knows how mysql interprets boolean strings... -+ * and, no, I'm not going to become versed in how mysql handles options - -+ * I'd rather sing. -+ -+ Aha, http://dev.mysql.com/doc/refman/5.1/en/dynamic-system-variables.html: -+ Variables that have a type of “boolean” can be set to 0, 1, ON or OFF. (If you -+ set them on the command line or in an option file, use the numeric values.) -+ -+ So it is '0' for FALSE, '1' or empty string for TRUE -+ -+ */ -+int get_bool (const struct opt& opt, bool* const val) -+{ -+ const char* str = opt.value; -+ -+ while (isspace(*str)) ++str; // skip initial whitespaces -+ -+ ssize_t str_len = strlen(str); -+ switch (str_len) -+ { -+ case 0: -+ *val = true; -+ return 0; -+ case 1: -+ if ('0' == *str || '1' == *str) -+ { -+ *val = ('1' == *str); -+ return 0; -+ } -+ } -+ -+ WSREP_ERROR ("Bad value for *%s: '%s'. Should be '0', '1' or empty string.", -+ opt.name, opt.value); -+ -+ return EINVAL; -+} -+ -+static int -+check_opts (int const argc, const char* const argv[], struct opt opts[]) -+{ -+ /* First, make a copy of argv to be able to manipulate it */ -+ argv_copy a(argc, argv); -+ -+ if (!a.argv_) -+ { -+ WSREP_ERROR ("Could not copy argv vector: not enough memory."); -+ return ENOMEM; -+ } -+ -+ int err = normalize_opts (a); -+ if (err) -+ { -+ WSREP_ERROR ("Failed to normalize options."); -+ return err; -+ } -+ -+ err = find_opts (a, opts); -+ if (err) -+ { -+ WSREP_ERROR ("Failed to parse options."); -+ return err; -+ } -+ -+ /* At this point we have updated default values in our option list to -+ what has been specified on the command line / my.cnf */ -+ -+ long long slave_threads; -+ err = get_long_long (opts[WSREP_SLAVE_THREADS], &slave_threads, 10); -+ if (err) return err; -+ -+ int rcode = 0; -+ -+ if (slave_threads > 1) -+ /* Need to check AUTOINC_LOCK_MODE and LOCKS_UNSAFE_FOR_BINLOG */ -+ { -+ long long autoinc_lock_mode; -+ err = get_long_long (opts[AUTOINC_LOCK_MODE], &autoinc_lock_mode, 10); -+ if (err) return err; -+ -+ bool locks_unsafe_for_binlog; -+ err = get_bool (opts[LOCKS_UNSAFE_FOR_BINLOG],&locks_unsafe_for_binlog); -+ if (err) return err; -+ -+ if (autoinc_lock_mode != 2) -+ { -+ WSREP_ERROR ("Parallel applying (wsrep_slave_threads > 1) requires" -+ " innodb_autoinc_lock_mode = 2."); -+ rcode = EINVAL; -+ } -+ } -+ -+ bool locked_in_memory; -+ err = get_bool (opts[LOCKED_IN_MEMORY], &locked_in_memory); -+ if (err) { WSREP_ERROR("get_bool error: %s", strerror(err)); return err; } -+ if (locked_in_memory) -+ { -+ WSREP_ERROR ("Memory locking is not supported (locked_in_memory=%s)", -+ locked_in_memory ? "ON" : "OFF"); -+ rcode = EINVAL; -+ } -+ -+ if (!strcasecmp(opts[WSREP_SST_METHOD].value,"mysqldump")) -+ { -+ if (!strcasecmp(opts[BIND_ADDRESS].value, "127.0.0.1") || -+ !strcasecmp(opts[BIND_ADDRESS].value, "localhost")) -+ { -+ WSREP_ERROR ("wsrep_sst_method is set to 'mysqldump' yet " -+ "mysqld bind_address is set to '%s', which makes it " -+ "impossible to receive state transfer from another " -+ "node, since mysqld won't accept such connections. " -+ "If you wish to use mysqldump state transfer method, " -+ "set bind_address to allow mysql client connections " -+ "from other cluster members (e.g. 0.0.0.0).", -+ opts[BIND_ADDRESS].value); -+ rcode = EINVAL; -+ } -+ } -+ else -+ { -+ // non-mysqldump SST requires wsrep_cluster_address on startup -+ if (strlen(opts[WSREP_CLUSTER_ADDRESS].value) == 0) -+ { -+ WSREP_ERROR ("%s SST method requires wsrep_cluster_address to be " -+ "configured on startup.",opts[WSREP_SST_METHOD].value); -+ rcode = EINVAL; -+ } -+ } -+ -+ if (strcasecmp(opts[WSREP_SST_RECEIVE_ADDRESS].value, "AUTO")) -+ { -+ if (!strncasecmp(opts[WSREP_SST_RECEIVE_ADDRESS].value, -+ "127.0.0.1", strlen("127.0.0.1")) || -+ !strncasecmp(opts[WSREP_SST_RECEIVE_ADDRESS].value, -+ "localhost", strlen("localhost"))) -+ { -+ WSREP_WARN ("wsrep_sst_receive_address is set to '%s' which " -+ "makes it impossible for another host to reach this " -+ "one. Please set it to the address which this node " -+ "can be connected at by other cluster members.", -+ opts[WSREP_SST_RECEIVE_ADDRESS].value); -+// rcode = EINVAL; -+ } -+ } -+ -+ if (strcasecmp(opts[WSREP_PROVIDER].value, "none")) -+ { -+ if (strcasecmp(opts[BINLOG_FORMAT].value, "ROW")) -+ { -+ WSREP_ERROR ("Only binlog_format = 'ROW' is currently supported. " -+ "Configured value: '%s'. Please adjust your " -+ "configuration.", opts[BINLOG_FORMAT].value); -+ -+ rcode = EINVAL; -+ } -+ } -+ -+ return rcode; -+} -+ -+int -+wsrep_check_opts (int const argc, char* const* const argv) -+{ -+ return check_opts (argc, argv, opts); -+} -+ -diff --git a/sql/wsrep_hton.cc b/sql/wsrep_hton.cc -new file mode 100644 -index 0000000..e89858c ---- /dev/null -+++ b/sql/wsrep_hton.cc -@@ -0,0 +1,590 @@ -+/* Copyright 2008 Codership Oy -+ -+ 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 */ -+ -+#include -+#include "sql_base.h" -+#include "binlog.h" -+#include "rpl_filter.h" -+#include -+#include "wsrep_mysqld.h" -+#include "wsrep_binlog.h" -+#include -+#include -+ -+extern ulonglong thd_to_trx_id(THD *thd); -+ -+extern "C" int thd_binlog_format(const MYSQL_THD thd); -+// todo: share interface with ha_innodb.c -+ -+enum wsrep_trx_status wsrep_run_wsrep_commit(THD *thd, handlerton *hton, -+ bool all); -+ -+/* -+ Cleanup after local transaction commit/rollback, replay or TOI. -+*/ -+void wsrep_cleanup_transaction(THD *thd) -+{ -+ if (wsrep_emulate_bin_log) thd_binlog_trx_reset(thd); -+ thd->wsrep_ws_handle.trx_id= WSREP_UNDEFINED_TRX_ID; -+ thd->wsrep_trx_meta.gtid= WSREP_GTID_UNDEFINED; -+ thd->wsrep_trx_meta.depends_on= WSREP_SEQNO_UNDEFINED; -+ thd->wsrep_exec_mode= LOCAL_STATE; -+ return; -+} -+ -+/* -+ wsrep hton -+*/ -+handlerton *wsrep_hton; -+ -+ -+/* -+ Registers wsrep hton at commit time if transaction has registered htons -+ for supported engine types. -+ -+ Hton should not be registered for TOTAL_ORDER operations. -+ -+ Registration is needed for both LOCAL_MODE and REPL_RECV transactions to run -+ commit in 2pc so that wsrep position gets properly recorded in storage -+ engines. -+ -+ Note that all hton calls should immediately return for threads that are -+ in REPL_RECV mode as their states are controlled by wsrep appliers or -+ replaying code. Only threads in LOCAL_MODE should run wsrep callbacks -+ from hton methods. -+*/ -+void wsrep_register_hton(THD* thd, bool all) -+{ -+ if (thd->wsrep_exec_mode != TOTAL_ORDER && !thd->wsrep_apply_toi) -+ { -+ THD_TRANS *trans=all ? &thd->transaction.all : &thd->transaction.stmt; -+ for (Ha_trx_info *i= trans->ha_list; WSREP(thd) && i; i = i->next()) -+ { -+ if (i->ht()->db_type == DB_TYPE_INNODB) -+ { -+ trans_register_ha(thd, all, wsrep_hton); -+ -+ /* follow innodb read/write settting -+ * but, as an exception: CTAS with empty result set will not be -+ * replicated unless we declare wsrep hton as read/write here -+ */ -+ if (i->is_trx_read_write() || -+ (thd->lex->sql_command == SQLCOM_CREATE_TABLE && -+ thd->wsrep_exec_mode == LOCAL_STATE)) -+ { -+ thd->ha_data[wsrep_hton->slot].ha_info[all].set_trx_read_write(); -+ } -+ break; -+ } -+ } -+ } -+} -+ -+/* -+ Calls wsrep->post_commit() for locally executed transactions that have -+ got seqno from provider (must commit) and don't require replaying. -+ */ -+void wsrep_post_commit(THD* thd, bool all) -+{ -+ switch (thd->wsrep_exec_mode) -+ { -+ case LOCAL_COMMIT: -+ { -+ DBUG_ASSERT(thd->wsrep_trx_meta.gtid.seqno != WSREP_SEQNO_UNDEFINED); -+ if (wsrep->post_commit(wsrep, &thd->wsrep_ws_handle)) -+ { -+ DBUG_PRINT("wsrep", ("set committed fail")); -+ WSREP_WARN("set committed fail: %llu %d", -+ (long long)thd->real_id, thd->get_stmt_da()->status()); -+ } -+ wsrep_cleanup_transaction(thd); -+ break; -+ } -+ case LOCAL_STATE: -+ { -+ /* non-InnoDB statements may have populated events in stmt cache -+ => cleanup -+ */ -+ WSREP_DEBUG("cleanup transaction for LOCAL_STATE: %s", thd->query()); -+ wsrep_cleanup_transaction(thd); -+ break; -+ } -+ default: break; -+ } -+ -+} -+ -+/* -+ wsrep exploits binlog's caches even if binlogging itself is not -+ activated. In such case connection close needs calling -+ actual binlog's method. -+ Todo: split binlog hton from its caches to use ones by wsrep -+ without referring to binlog's stuff. -+*/ -+static int -+wsrep_close_connection(handlerton* hton, THD* thd) -+{ -+ DBUG_ENTER("wsrep_close_connection"); -+ -+ if (thd->wsrep_exec_mode == REPL_RECV) -+ { -+ DBUG_RETURN(0); -+ } -+ DBUG_RETURN(wsrep_binlog_close_connection (thd)); -+} -+ -+/* -+ prepare/wsrep_run_wsrep_commit can fail in two ways -+ - certification test or an equivalent. As a result, -+ the current transaction just rolls back -+ Error codes: -+ WSREP_TRX_CERT_FAIL, WSREP_TRX_SIZE_EXCEEDED, WSREP_TRX_ERROR -+ - a post-certification failure makes this server unable to -+ commit its own WS and therefore the server must abort -+*/ -+static int wsrep_prepare(handlerton *hton, THD *thd, bool all) -+{ -+ DBUG_ENTER("wsrep_prepare"); -+ -+ if (thd->wsrep_exec_mode == REPL_RECV) -+ { -+ DBUG_RETURN(0); -+ } -+ -+ DBUG_ASSERT(thd->ha_data[wsrep_hton->slot].ha_info[all].is_trx_read_write()); -+ DBUG_ASSERT(thd->wsrep_exec_mode == LOCAL_STATE); -+ DBUG_ASSERT(thd->wsrep_trx_meta.gtid.seqno == WSREP_SEQNO_UNDEFINED); -+ -+ if ((all || -+ !thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) && -+ (thd->variables.wsrep_on && !wsrep_trans_cache_is_empty(thd))) -+ { -+ DBUG_RETURN (wsrep_run_wsrep_commit(thd, hton, all)); -+ } -+ DBUG_RETURN(0); -+} -+ -+static int wsrep_savepoint_set(handlerton *hton, THD *thd, void *sv) -+{ -+ DBUG_ENTER("wsrep_savepoint_set"); -+ -+ if (thd->wsrep_exec_mode == REPL_RECV) -+ { -+ DBUG_RETURN(0); -+ } -+ -+ if (!wsrep_emulate_bin_log) DBUG_RETURN(0); -+ int rcode = wsrep_binlog_savepoint_set(thd, sv); -+ DBUG_RETURN(rcode); -+} -+ -+static int wsrep_savepoint_rollback(handlerton *hton, THD *thd, void *sv) -+{ -+ DBUG_ENTER("wsrep_savepoint_rollback"); -+ -+ if (thd->wsrep_exec_mode == REPL_RECV) -+ { -+ DBUG_RETURN(0); -+ } -+ -+ if (!wsrep_emulate_bin_log) DBUG_RETURN(0); -+ int rcode = wsrep_binlog_savepoint_rollback(thd, sv); -+ DBUG_RETURN(rcode); -+} -+ -+static int wsrep_rollback(handlerton *hton, THD *thd, bool all) -+{ -+ DBUG_ENTER("wsrep_rollback"); -+ -+ if (thd->wsrep_exec_mode == REPL_RECV) -+ { -+ DBUG_RETURN(0); -+ } -+ -+ mysql_mutex_lock(&thd->LOCK_wsrep_thd); -+ switch (thd->wsrep_exec_mode) -+ { -+ case TOTAL_ORDER: -+ case REPL_RECV: -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ WSREP_DEBUG("Avoiding wsrep rollback for failed DDL: %s", thd->query()); -+ DBUG_RETURN(0); -+ default: break; -+ } -+ -+ if ((all || !thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) && -+ (thd->variables.wsrep_on && thd->wsrep_conflict_state != MUST_REPLAY)) -+ { -+ if (wsrep->post_rollback(wsrep, &thd->wsrep_ws_handle)) -+ { -+ DBUG_PRINT("wsrep", ("setting rollback fail")); -+ WSREP_ERROR("settting rollback fail: thd: %llu SQL: %s", -+ (long long)thd->real_id, thd->query()); -+ } -+ wsrep_cleanup_transaction(thd); -+ } -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ DBUG_RETURN(0); -+} -+ -+int wsrep_commit(handlerton *hton, THD *thd, bool all) -+{ -+ DBUG_ENTER("wsrep_commit"); -+ -+ if (thd->wsrep_exec_mode == REPL_RECV) -+ { -+ DBUG_RETURN(0); -+ } -+ -+ mysql_mutex_lock(&thd->LOCK_wsrep_thd); -+ if ((all || !thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) && -+ (thd->variables.wsrep_on && thd->wsrep_conflict_state != MUST_REPLAY)) -+ { -+ if (thd->wsrep_exec_mode == LOCAL_COMMIT) -+ { -+ DBUG_ASSERT(thd->ha_data[wsrep_hton->slot].ha_info[all].is_trx_read_write()); -+ /* -+ Call to wsrep->post_commit() (moved to wsrep_post_commit()) must -+ be done only after commit has done for all involved htons. -+ */ -+ DBUG_PRINT("wsrep", ("commit")); -+ } -+ else -+ { -+ /* -+ Transaction didn't go through wsrep->pre_commit() so just roll back -+ possible changes to clean state. -+ */ -+ if (wsrep->post_rollback(wsrep, &thd->wsrep_ws_handle)) -+ { -+ DBUG_PRINT("wsrep", ("setting rollback fail")); -+ WSREP_ERROR("settting rollback fail: thd: %llu SQL: %s", -+ (long long)thd->real_id, thd->query()); -+ } -+ wsrep_cleanup_transaction(thd); -+ } -+ } -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ DBUG_RETURN(0); -+} -+ -+ -+extern Rpl_filter* binlog_filter; -+extern my_bool opt_log_slave_updates; -+ -+enum wsrep_trx_status -+wsrep_run_wsrep_commit(THD *thd, handlerton *hton, bool all) -+{ -+ int rcode= -1; -+ size_t data_len= 0; -+ IO_CACHE *cache; -+ int replay_round= 0; -+ -+ if (thd->get_stmt_da()->is_error()) { -+ WSREP_ERROR("commit issue, error: %d %s", -+ thd->get_stmt_da()->sql_errno(), thd->get_stmt_da()->message()); -+ } -+ -+ DBUG_ENTER("wsrep_run_wsrep_commit"); -+ -+ if (thd->slave_thread && !opt_log_slave_updates) DBUG_RETURN(WSREP_TRX_OK); -+ -+ if (thd->wsrep_exec_mode == REPL_RECV) { -+ -+ mysql_mutex_lock(&thd->LOCK_wsrep_thd); -+ if (thd->wsrep_conflict_state == MUST_ABORT) { -+ if (wsrep_debug) -+ WSREP_INFO("WSREP: must abort for BF"); -+ DBUG_PRINT("wsrep", ("BF apply commit fail")); -+ thd->wsrep_conflict_state = NO_CONFLICT; -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ // -+ // TODO: test all calls of the rollback. -+ // rollback must happen automagically innobase_rollback(hton, thd, 1); -+ // -+ DBUG_RETURN(WSREP_TRX_ERROR); -+ } -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ } -+ -+ if (thd->wsrep_exec_mode != LOCAL_STATE) DBUG_RETURN(WSREP_TRX_OK); -+ -+ if (thd->wsrep_consistency_check == CONSISTENCY_CHECK_RUNNING) { -+ WSREP_DEBUG("commit for consistency check: %s", thd->query()); -+ DBUG_RETURN(WSREP_TRX_OK); -+ } -+ -+ DBUG_PRINT("wsrep", ("replicating commit")); -+ -+ mysql_mutex_lock(&thd->LOCK_wsrep_thd); -+ if (thd->wsrep_conflict_state == MUST_ABORT) { -+ DBUG_PRINT("wsrep", ("replicate commit fail")); -+ thd->wsrep_conflict_state = ABORTED; -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ if (wsrep_debug) { -+ WSREP_INFO("innobase_commit, abort %s", -+ (thd->query()) ? thd->query() : "void"); -+ } -+ DBUG_RETURN(WSREP_TRX_CERT_FAIL); -+ } -+ -+ mysql_mutex_lock(&LOCK_wsrep_replaying); -+ -+ while (wsrep_replaying > 0 && -+ thd->wsrep_conflict_state == NO_CONFLICT && -+ thd->killed == THD::NOT_KILLED && -+ !shutdown_in_progress) -+ { -+ -+ mysql_mutex_unlock(&LOCK_wsrep_replaying); -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ -+ mysql_mutex_lock(&thd->mysys_var->mutex); -+ thd_proc_info(thd, "wsrep waiting on replaying"); -+ thd->mysys_var->current_mutex= &LOCK_wsrep_replaying; -+ thd->mysys_var->current_cond= &COND_wsrep_replaying; -+ mysql_mutex_unlock(&thd->mysys_var->mutex); -+ -+ mysql_mutex_lock(&LOCK_wsrep_replaying); -+ // Using timedwait is a hack to avoid deadlock in case if BF victim -+ // misses the signal. -+ struct timespec wtime = {0, 1000000}; -+ mysql_cond_timedwait(&COND_wsrep_replaying, &LOCK_wsrep_replaying, -+ &wtime); -+ -+ if (replay_round++ % 100000 == 0) -+ WSREP_DEBUG("commit waiting for replaying: replayers %d, thd: (%lu) " -+ "conflict: %d (round: %d)", -+ wsrep_replaying, thd->thread_id, -+ thd->wsrep_conflict_state, replay_round); -+ -+ mysql_mutex_unlock(&LOCK_wsrep_replaying); -+ -+ mysql_mutex_lock(&thd->mysys_var->mutex); -+ thd->mysys_var->current_mutex= 0; -+ thd->mysys_var->current_cond= 0; -+ mysql_mutex_unlock(&thd->mysys_var->mutex); -+ -+ mysql_mutex_lock(&thd->LOCK_wsrep_thd); -+ mysql_mutex_lock(&LOCK_wsrep_replaying); -+ } -+ mysql_mutex_unlock(&LOCK_wsrep_replaying); -+ -+ if (thd->wsrep_conflict_state == MUST_ABORT) { -+ DBUG_PRINT("wsrep", ("replicate commit fail")); -+ thd->wsrep_conflict_state = ABORTED; -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ WSREP_DEBUG("innobase_commit abort after replaying wait %s", -+ (thd->query()) ? thd->query() : "void"); -+ DBUG_RETURN(WSREP_TRX_CERT_FAIL); -+ } -+ -+ thd->wsrep_query_state = QUERY_COMMITTING; -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ -+ cache = get_trans_log(thd); -+ rcode = 0; -+ if (cache) { -+ thd->binlog_flush_pending_rows_event(true); -+ rcode = wsrep_write_cache(wsrep, thd, cache, &data_len); -+ if (WSREP_OK != rcode) { -+ WSREP_ERROR("rbr write fail, data_len: %zu, %d", data_len, rcode); -+ DBUG_RETURN(WSREP_TRX_SIZE_EXCEEDED); -+ } -+ } -+ -+ if (data_len == 0) -+ { -+ if (thd->get_stmt_da()->is_ok() && -+ thd->get_stmt_da()->affected_rows() > 0 && -+ !binlog_filter->is_on()) -+ { -+ WSREP_DEBUG("empty rbr buffer, query: %s, " -+ "affected rows: %llu, " -+ "changed tables: %d, " -+ "sql_log_bin: %d, " -+ "wsrep status (%d %d %d)", -+ thd->query(), thd->get_stmt_da()->affected_rows(), -+ stmt_has_updated_trans_table(thd), thd->variables.sql_log_bin, -+ thd->wsrep_exec_mode, thd->wsrep_query_state, -+ thd->wsrep_conflict_state); -+ } -+ else -+ { -+ WSREP_DEBUG("empty rbr buffer, query: %s", thd->query()); -+ } -+ thd->wsrep_query_state= QUERY_EXEC; -+ DBUG_RETURN(WSREP_TRX_OK); -+ } -+ -+ if (WSREP_UNDEFINED_TRX_ID == thd->wsrep_ws_handle.trx_id) -+ { -+ WSREP_WARN("SQL statement was ineffective, THD: %lu, buf: %zu\n" -+ "QUERY: %s\n" -+ " => Skipping replication", -+ thd->thread_id, data_len, thd->query()); -+ rcode = WSREP_TRX_FAIL; -+ } -+ else if (!rcode) -+ { -+ if (WSREP_OK == rcode) -+ rcode = wsrep->pre_commit(wsrep, -+ (wsrep_conn_id_t)thd->thread_id, -+ &thd->wsrep_ws_handle, -+ WSREP_FLAG_COMMIT | -+ ((thd->wsrep_PA_safe) ? -+ 0ULL : WSREP_FLAG_PA_UNSAFE), -+ &thd->wsrep_trx_meta); -+ -+ if (rcode == WSREP_TRX_MISSING) { -+ WSREP_WARN("Transaction missing in provider, thd: %ld, SQL: %s", -+ thd->thread_id, thd->query()); -+ rcode = WSREP_TRX_FAIL; -+ } else if (rcode == WSREP_BF_ABORT) { -+ WSREP_DEBUG("thd %lu seqno %lld BF aborted by provider, will replay", -+ thd->thread_id, (long long)thd->wsrep_trx_meta.gtid.seqno); -+ mysql_mutex_lock(&thd->LOCK_wsrep_thd); -+ thd->wsrep_conflict_state = MUST_REPLAY; -+ DBUG_ASSERT(wsrep_thd_trx_seqno(thd) > 0); -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ mysql_mutex_lock(&LOCK_wsrep_replaying); -+ wsrep_replaying++; -+ WSREP_DEBUG("replaying increased: %d, thd: %lu", -+ wsrep_replaying, thd->thread_id); -+ mysql_mutex_unlock(&LOCK_wsrep_replaying); -+ } -+ } else { -+ WSREP_ERROR("I/O error reading from thd's binlog iocache: " -+ "errno=%d, io cache code=%d", my_errno, cache->error); -+ DBUG_ASSERT(0); // failure like this can not normally happen -+ DBUG_RETURN(WSREP_TRX_ERROR); -+ } -+ -+ mysql_mutex_lock(&thd->LOCK_wsrep_thd); -+ switch(rcode) { -+ case 0: -+ /* -+ About MUST_ABORT: We assume that even if thd conflict state was set -+ to MUST_ABORT, underlying transaction was not rolled back or marked -+ as deadlock victim in QUERY_COMMITTING state. Conflict state is -+ set to NO_CONFLICT and commit proceeds as usual. -+ */ -+ if (thd->wsrep_conflict_state == MUST_ABORT) -+ thd->wsrep_conflict_state= NO_CONFLICT; -+ -+ if (thd->wsrep_conflict_state != NO_CONFLICT) -+ { -+ WSREP_WARN("thd %lu seqno %lld: conflict state %d after post commit", -+ thd->thread_id, -+ (long long)thd->wsrep_trx_meta.gtid.seqno, -+ thd->wsrep_conflict_state); -+ } -+ thd->wsrep_exec_mode= LOCAL_COMMIT; -+ DBUG_ASSERT(thd->wsrep_trx_meta.gtid.seqno != WSREP_SEQNO_UNDEFINED); -+ /* Override XID iff it was generated by mysql */ -+ if (thd->transaction.xid_state.xid.get_my_xid()) -+ { -+ wsrep_xid_init(&thd->transaction.xid_state.xid, -+ &thd->wsrep_trx_meta.gtid.uuid, -+ thd->wsrep_trx_meta.gtid.seqno); -+ } -+ DBUG_PRINT("wsrep", ("replicating commit success")); -+ break; -+ case WSREP_BF_ABORT: -+ DBUG_ASSERT(thd->wsrep_trx_meta.gtid.seqno != WSREP_SEQNO_UNDEFINED); -+ case WSREP_TRX_FAIL: -+ WSREP_DEBUG("commit failed for reason: %d %lu %s", rcode, thd->thread_id, thd->query()); -+ DBUG_PRINT("wsrep", ("replicating commit fail")); -+ -+ thd->wsrep_query_state= QUERY_EXEC; -+ -+ if (thd->wsrep_conflict_state == MUST_ABORT) { -+ thd->wsrep_conflict_state= ABORTED; -+ } -+ else -+ { -+ WSREP_DEBUG("conflict state: %d", thd->wsrep_conflict_state); -+ if (thd->wsrep_conflict_state == NO_CONFLICT) -+ { -+ thd->wsrep_conflict_state = CERT_FAILURE; -+ WSREP_LOG_CONFLICT(NULL, thd, FALSE); -+ } -+ } -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ -+ DBUG_RETURN(WSREP_TRX_CERT_FAIL); -+ -+ case WSREP_SIZE_EXCEEDED: -+ WSREP_ERROR("transaction size exceeded"); -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ DBUG_RETURN(WSREP_TRX_SIZE_EXCEEDED); -+ case WSREP_CONN_FAIL: -+ WSREP_ERROR("connection failure"); -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ DBUG_RETURN(WSREP_TRX_ERROR); -+ default: -+ WSREP_ERROR("unknown connection failure"); -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ DBUG_RETURN(WSREP_TRX_ERROR); -+ } -+ -+ thd->wsrep_query_state= QUERY_EXEC; -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ -+ DBUG_RETURN(WSREP_TRX_OK); -+} -+ -+ -+static int wsrep_hton_init(void *p) -+{ -+ wsrep_hton= (handlerton *)p; -+ //wsrep_hton->state=opt_bin_log ? SHOW_OPTION_YES : SHOW_OPTION_NO; -+ wsrep_hton->state= SHOW_OPTION_YES; -+ wsrep_hton->db_type=DB_TYPE_WSREP; -+ wsrep_hton->savepoint_offset= sizeof(my_off_t); -+ wsrep_hton->close_connection= wsrep_close_connection; -+ wsrep_hton->savepoint_set= wsrep_savepoint_set; -+ wsrep_hton->savepoint_rollback= wsrep_savepoint_rollback; -+ wsrep_hton->commit= wsrep_commit; -+ wsrep_hton->rollback= wsrep_rollback; -+ wsrep_hton->prepare= wsrep_prepare; -+ wsrep_hton->flags= HTON_NOT_USER_SELECTABLE | HTON_HIDDEN; // todo: fix flags -+ wsrep_hton->slot= 0; -+ return 0; -+} -+ -+ -+struct st_mysql_storage_engine wsrep_storage_engine= -+{ MYSQL_HANDLERTON_INTERFACE_VERSION }; -+ -+ -+mysql_declare_plugin(wsrep) -+{ -+ MYSQL_STORAGE_ENGINE_PLUGIN, -+ &wsrep_storage_engine, -+ "wsrep", -+ "Codership Oy", -+ "A pseudo storage engine to represent transactions in multi-master " -+ "synchornous replication", -+ PLUGIN_LICENSE_GPL, -+ wsrep_hton_init, /* Plugin Init */ -+ NULL, /* Plugin Deinit */ -+ 0x0100 /* 1.0 */, -+ NULL, /* status variables */ -+ NULL, /* system variables */ -+ NULL, /* config options */ -+ 0, /* flags */ -+} -+mysql_declare_plugin_end; -diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc -new file mode 100644 -index 0000000..e2816c4 ---- /dev/null -+++ b/sql/wsrep_mysqld.cc -@@ -0,0 +1,1564 @@ -+/* Copyright 2008-2013 Codership Oy -+ -+ 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 */ -+ -+#include -+#include -+#include -+#include "wsrep_priv.h" -+#include "wsrep_thd.h" -+#include "wsrep_sst.h" -+#include "wsrep_utils.h" -+#include "wsrep_var.h" -+#include "wsrep_binlog.h" -+#include "wsrep_applier.h" -+#include -+#include -+#include "log_event.h" -+#include -+ -+wsrep_t *wsrep = NULL; -+my_bool wsrep_emulate_bin_log = FALSE; // activating parts of binlog interface -+/* Sidno in global_sid_map corresponding to group uuid */ -+rpl_sidno wsrep_sidno= -1; -+my_bool wsrep_preordered_opt= FALSE; -+ -+/* -+ * Begin configuration options and their default values -+ */ -+ -+const char* wsrep_data_home_dir = NULL; -+const char* wsrep_dbug_option = ""; -+ -+long wsrep_slave_threads = 1; // # of slave action appliers wanted -+int wsrep_slave_count_change = 0; // # of appliers to stop or start -+my_bool wsrep_debug = 0; // enable debug level logging -+my_bool wsrep_convert_LOCK_to_trx = 1; // convert locking sessions to trx -+ulong wsrep_retry_autocommit = 5; // retry aborted autocommit trx -+my_bool wsrep_auto_increment_control = 1; // control auto increment variables -+my_bool wsrep_drupal_282555_workaround = 1; // retry autoinc insert after dupkey -+my_bool wsrep_incremental_data_collection = 0; // incremental data collection -+ulong wsrep_max_ws_size = 1073741824UL;//max ws (RBR buffer) size -+ulong wsrep_max_ws_rows = 65536; // max number of rows in ws -+int wsrep_to_isolation = 0; // # of active TO isolation threads -+my_bool wsrep_certify_nonPK = 1; // certify, even when no primary key -+long wsrep_max_protocol_version = 3; // maximum protocol version to use -+ulong wsrep_forced_binlog_format = BINLOG_FORMAT_UNSPEC; -+my_bool wsrep_recovery = 0; // recovery -+my_bool wsrep_replicate_myisam = 0; // enable myisam replication -+my_bool wsrep_log_conflicts = 0; -+ulong wsrep_mysql_replication_bundle = 0; -+my_bool wsrep_desync = 0; // desynchronize the node from the -+ // cluster -+my_bool wsrep_load_data_splitting = 1; // commit load data every 10K intervals -+my_bool wsrep_restart_slave = 0; // should mysql slave thread be -+ // restarted, if node joins back -+my_bool wsrep_restart_slave_activated = 0; // node has dropped, and slave -+ // restart will be needed -+my_bool wsrep_slave_UK_checks = 0; // slave thread does UK checks -+my_bool wsrep_slave_FK_checks = 0; // slave thread does FK checks -+/* -+ * End configuration options -+ */ -+ -+static const wsrep_uuid_t cluster_uuid = WSREP_UUID_UNDEFINED; -+static char cluster_uuid_str[40]= { 0, }; -+static const char* cluster_status_str[WSREP_VIEW_MAX] = -+{ -+ "Primary", -+ "non-Primary", -+ "Disconnected" -+}; -+ -+static char provider_name[256]= { 0, }; -+static char provider_version[256]= { 0, }; -+static char provider_vendor[256]= { 0, }; -+ -+/* -+ * wsrep status variables -+ */ -+my_bool wsrep_connected = FALSE; -+my_bool wsrep_ready = FALSE; // node can accept queries -+const char* wsrep_cluster_state_uuid = cluster_uuid_str; -+long long wsrep_cluster_conf_id = WSREP_SEQNO_UNDEFINED; -+const char* wsrep_cluster_status = cluster_status_str[WSREP_VIEW_DISCONNECTED]; -+long wsrep_cluster_size = 0; -+long wsrep_local_index = -1; -+long long wsrep_local_bf_aborts = 0; -+const char* wsrep_provider_name = provider_name; -+const char* wsrep_provider_version = provider_version; -+const char* wsrep_provider_vendor = provider_vendor; -+/* End wsrep status variables */ -+ -+wsrep_uuid_t local_uuid = WSREP_UUID_UNDEFINED; -+wsrep_seqno_t local_seqno = WSREP_SEQNO_UNDEFINED; -+wsp::node_status local_status; -+long wsrep_protocol_version = 3; -+ -+// Boolean denoting if server is in initial startup phase. This is needed -+// to make sure that main thread waiting in wsrep_sst_wait() is signaled -+// if there was no state gap on receiving first view event. -+static my_bool wsrep_startup = TRUE; -+ -+ -+static void wsrep_log_cb(wsrep_log_level_t level, const char *msg) { -+ switch (level) { -+ case WSREP_LOG_INFO: -+ sql_print_information("WSREP: %s", msg); -+ break; -+ case WSREP_LOG_WARN: -+ sql_print_warning("WSREP: %s", msg); -+ break; -+ case WSREP_LOG_ERROR: -+ case WSREP_LOG_FATAL: -+ sql_print_error("WSREP: %s", msg); -+ break; -+ case WSREP_LOG_DEBUG: -+ if (wsrep_debug) sql_print_information ("[Debug] WSREP: %s", msg); -+ default: -+ break; -+ } -+} -+ -+static void wsrep_log_states (wsrep_log_level_t const level, -+ const wsrep_uuid_t* const group_uuid, -+ wsrep_seqno_t const group_seqno, -+ const wsrep_uuid_t* const node_uuid, -+ wsrep_seqno_t const node_seqno) -+{ -+ char uuid_str[37]; -+ char msg[256]; -+ -+ wsrep_uuid_print (group_uuid, uuid_str, sizeof(uuid_str)); -+ snprintf (msg, 255, "WSREP: Group state: %s:%lld", -+ uuid_str, (long long)group_seqno); -+ wsrep_log_cb (level, msg); -+ -+ wsrep_uuid_print (node_uuid, uuid_str, sizeof(uuid_str)); -+ snprintf (msg, 255, "WSREP: Local state: %s:%lld", -+ uuid_str, (long long)node_seqno); -+ wsrep_log_cb (level, msg); -+} -+ -+static my_bool set_SE_checkpoint(THD* unused, plugin_ref plugin, void* arg) -+{ -+ XID* xid= reinterpret_cast(arg); -+ handlerton* hton= plugin_data(plugin, handlerton *); -+ if (hton->db_type == DB_TYPE_INNODB) -+ { -+ const wsrep_uuid_t* uuid(wsrep_xid_uuid(xid)); -+ char uuid_str[40] = {0, }; -+ wsrep_uuid_print(uuid, uuid_str, sizeof(uuid_str)); -+ WSREP_DEBUG("Set WSREPXid for InnoDB: %s:%lld", -+ uuid_str, (long long)wsrep_xid_seqno(xid)); -+ hton->wsrep_set_checkpoint(hton, xid); -+ } -+ return FALSE; -+} -+ -+void wsrep_set_SE_checkpoint(XID* xid) -+{ -+ plugin_foreach(NULL, set_SE_checkpoint, MYSQL_STORAGE_ENGINE_PLUGIN, xid); -+} -+ -+static my_bool get_SE_checkpoint(THD* unused, plugin_ref plugin, void* arg) -+{ -+ XID* xid= reinterpret_cast(arg); -+ handlerton* hton= plugin_data(plugin, handlerton *); -+ if (hton->db_type == DB_TYPE_INNODB) -+ { -+ hton->wsrep_get_checkpoint(hton, xid); -+ const wsrep_uuid_t* uuid(wsrep_xid_uuid(xid)); -+ char uuid_str[40] = {0, }; -+ wsrep_uuid_print(uuid, uuid_str, sizeof(uuid_str)); -+ WSREP_DEBUG("Read WSREPXid from InnoDB: %s:%lld", -+ uuid_str, (long long)wsrep_xid_seqno(xid)); -+ -+ } -+ return FALSE; -+} -+ -+void wsrep_get_SE_checkpoint(XID* xid) -+{ -+ plugin_foreach(NULL, get_SE_checkpoint, MYSQL_STORAGE_ENGINE_PLUGIN, xid); -+} -+ -+void wsrep_init_sidno(const wsrep_uuid_t& uuid) -+{ -+ /* generate new Sid map entry from inverted uuid */ -+ rpl_sid sid; -+ wsrep_uuid_t ltid_uuid; -+ for (size_t i= 0; i < sizeof(ltid_uuid.data); ++i) -+ { -+ ltid_uuid.data[i] = ~local_uuid.data[i]; -+ } -+ sid.copy_from(ltid_uuid.data); -+ global_sid_lock->wrlock(); -+ wsrep_sidno= global_sid_map->add_sid(sid); -+ WSREP_INFO("inited wsrep sidno %d", wsrep_sidno); -+ global_sid_lock->unlock(); -+} -+ -+ -+static wsrep_cb_status_t -+wsrep_view_handler_cb (void* app_ctx, -+ void* recv_ctx, -+ const wsrep_view_info_t* view, -+ const char* state, -+ size_t state_len, -+ void** sst_req, -+ size_t* sst_req_len) -+{ -+ *sst_req = NULL; -+ *sst_req_len = 0; -+ -+ wsrep_member_status_t new_status= local_status.get(); -+ -+ if (memcmp(&cluster_uuid, &view->state_id.uuid, sizeof(wsrep_uuid_t))) -+ { -+ memcpy((wsrep_uuid_t*)&cluster_uuid, &view->state_id.uuid, -+ sizeof(cluster_uuid)); -+ -+ wsrep_uuid_print (&cluster_uuid, cluster_uuid_str, -+ sizeof(cluster_uuid_str)); -+ } -+ -+ wsrep_cluster_conf_id= view->view; -+ wsrep_cluster_status= cluster_status_str[view->status]; -+ wsrep_cluster_size= view->memb_num; -+ wsrep_local_index= view->my_idx; -+ -+ WSREP_INFO("New cluster view: global state: %s:%lld, view# %lld: %s, " -+ "number of nodes: %ld, my index: %ld, protocol version %d", -+ wsrep_cluster_state_uuid, (long long)view->state_id.seqno, -+ (long long)wsrep_cluster_conf_id, wsrep_cluster_status, -+ wsrep_cluster_size, wsrep_local_index, view->proto_ver); -+ -+ /* Proceed further only if view is PRIMARY */ -+ if (WSREP_VIEW_PRIMARY != view->status) { -+ wsrep_ready_set(FALSE); -+ new_status= WSREP_MEMBER_UNDEFINED; -+ /* Always record local_uuid and local_seqno in non-prim since this -+ * may lead to re-initializing provider and start position is -+ * determined according to these variables */ -+ // WRONG! local_uuid should be the last primary configuration uuid we were -+ // a member of. local_seqno should be updated in commit calls. -+ // local_uuid= cluster_uuid; -+ // local_seqno= view->first - 1; -+ goto out; -+ } -+ -+ switch (view->proto_ver) -+ { -+ case 0: -+ case 1: -+ case 2: -+ case 3: -+ // version change -+ if (view->proto_ver != wsrep_protocol_version) -+ { -+ my_bool wsrep_ready_saved= wsrep_ready; -+ wsrep_ready_set(FALSE); -+ WSREP_INFO("closing client connections for " -+ "protocol change %ld -> %d", -+ wsrep_protocol_version, view->proto_ver); -+ wsrep_close_client_connections(TRUE); -+ wsrep_protocol_version= view->proto_ver; -+ wsrep_ready_set(wsrep_ready_saved); -+ } -+ break; -+ default: -+ WSREP_ERROR("Unsupported application protocol version: %d", -+ view->proto_ver); -+ unireg_abort(1); -+ } -+ -+ if (view->state_gap) -+ { -+ WSREP_WARN("Gap in state sequence. Need state transfer."); -+ -+ /* After that wsrep will call wsrep_sst_prepare. */ -+ /* keep ready flag 0 until we receive the snapshot */ -+ wsrep_ready_set(FALSE); -+ -+ /* Close client connections to ensure that they don't interfere -+ * with SST. Necessary only if storage engines are initialized -+ * before SST. -+ * TODO: Just killing all ongoing transactions should be enough -+ * since wsrep_ready is OFF and no new transactions can start. -+ */ -+ if (!wsrep_before_SE()) -+ { -+ WSREP_DEBUG("[debug]: closing client connections for PRIM"); -+ wsrep_close_client_connections(TRUE); -+ } -+ -+ ssize_t const req_len= wsrep_sst_prepare (sst_req); -+ -+ if (req_len < 0) -+ { -+ WSREP_ERROR("SST preparation failed: %zd (%s)", -req_len, -+ strerror(-req_len)); -+ new_status= WSREP_MEMBER_UNDEFINED; -+ } -+ else -+ { -+ assert(sst_req != NULL); -+ *sst_req_len= req_len; -+ new_status= WSREP_MEMBER_JOINER; -+ } -+ } -+ else -+ { -+ /* -+ * NOTE: Initialize wsrep_group_uuid here only if it wasn't initialized -+ * before - OR - it was reinitilized on startup (lp:992840) -+ */ -+ if (wsrep_startup) -+ { -+ if (wsrep_before_SE()) -+ { -+ wsrep_SE_init_grab(); -+ // Signal mysqld init thread to continue -+ wsrep_sst_complete (&cluster_uuid, view->state_id.seqno, false); -+ // and wait for SE initialization -+ wsrep_SE_init_wait(); -+ } -+ else -+ { -+ local_uuid= cluster_uuid; -+ local_seqno= view->state_id.seqno; -+ } -+ /* Init storage engine XIDs from first view */ -+ XID xid; -+ wsrep_xid_init(&xid, &local_uuid, local_seqno); -+ wsrep_set_SE_checkpoint(&xid); -+ new_status= WSREP_MEMBER_JOINED; -+ wsrep_init_sidno(local_uuid); -+ } -+ -+ // just some sanity check -+ if (memcmp (&local_uuid, &cluster_uuid, sizeof (wsrep_uuid_t))) -+ { -+ WSREP_ERROR("Undetected state gap. Can't continue."); -+ wsrep_log_states(WSREP_LOG_FATAL, &cluster_uuid, view->state_id.seqno, -+ &local_uuid, -1); -+ unireg_abort(1); -+ } -+ } -+ -+ if (wsrep_auto_increment_control) -+ { -+ global_system_variables.auto_increment_offset= view->my_idx + 1; -+ global_system_variables.auto_increment_increment= view->memb_num; -+ } -+ -+ { /* capabilities may be updated on new configuration */ -+ uint64_t const caps(wsrep->capabilities (wsrep)); -+ -+ my_bool const idc((caps & WSREP_CAP_INCREMENTAL_WRITESET) != 0); -+ if (TRUE == wsrep_incremental_data_collection && FALSE == idc) -+ { -+ WSREP_WARN("Unsupported protocol downgrade: " -+ "incremental data collection disabled. Expect abort."); -+ } -+ wsrep_incremental_data_collection = idc; -+ } -+ -+out: -+ if (view->status == WSREP_VIEW_PRIMARY) wsrep_startup= FALSE; -+ local_status.set(new_status, view); -+ -+ return WSREP_CB_SUCCESS; -+} -+ -+void wsrep_ready_set (my_bool x) -+{ -+ WSREP_DEBUG("Setting wsrep_ready to %d", x); -+ if (mysql_mutex_lock (&LOCK_wsrep_ready)) abort(); -+ if (wsrep_ready != x) -+ { -+ wsrep_ready= x; -+ mysql_cond_signal (&COND_wsrep_ready); -+ } -+ mysql_mutex_unlock (&LOCK_wsrep_ready); -+} -+ -+// Wait until wsrep has reached ready state -+void wsrep_ready_wait () -+{ -+ if (mysql_mutex_lock (&LOCK_wsrep_ready)) abort(); -+ while (!wsrep_ready) -+ { -+ WSREP_INFO("Waiting to reach ready state"); -+ mysql_cond_wait (&COND_wsrep_ready, &LOCK_wsrep_ready); -+ } -+ WSREP_INFO("ready state reached"); -+ mysql_mutex_unlock (&LOCK_wsrep_ready); -+} -+ -+static void wsrep_synced_cb(void* app_ctx) -+{ -+ WSREP_INFO("Synchronized with group, ready for connections"); -+ bool signal_main= false; -+ if (mysql_mutex_lock (&LOCK_wsrep_ready)) abort(); -+ if (!wsrep_ready) -+ { -+ wsrep_ready= TRUE; -+ mysql_cond_signal (&COND_wsrep_ready); -+ signal_main= true; -+ -+ } -+ local_status.set(WSREP_MEMBER_SYNCED); -+ mysql_mutex_unlock (&LOCK_wsrep_ready); -+ -+ if (signal_main) -+ { -+ wsrep_SE_init_grab(); -+ // Signal mysqld init thread to continue -+ wsrep_sst_complete (&local_uuid, local_seqno, false); -+ // and wait for SE initialization -+ wsrep_SE_init_wait(); -+ } -+ if (wsrep_restart_slave_activated) -+ { -+ int rcode; -+ WSREP_INFO("MySQL slave restart"); -+ wsrep_restart_slave_activated= FALSE; -+ -+ mysql_mutex_lock(&LOCK_active_mi); -+ if ((rcode = start_slave_threads(1 /* need mutex */, -+ 0 /* no wait for start*/, -+ active_mi, -+ SLAVE_SQL))) -+ { -+ WSREP_WARN("Failed to create slave threads: %d", rcode); -+ } -+ mysql_mutex_unlock(&LOCK_active_mi); -+ -+ } -+} -+ -+static void wsrep_init_position() -+{ -+ /* read XIDs from storage engines */ -+ XID xid; -+ memset(&xid, 0, sizeof(xid)); -+ xid.formatID= -1; -+ wsrep_get_SE_checkpoint(&xid); -+ -+ if (xid.formatID == -1) -+ { -+ WSREP_INFO("Read nil XID from storage engines, skipping position init"); -+ return; -+ } -+ else if (!wsrep_is_wsrep_xid(&xid)) -+ { -+ WSREP_WARN("Read non-wsrep XID from storage engines, skipping position init"); -+ return; -+ } -+ -+ const wsrep_uuid_t* uuid= wsrep_xid_uuid(&xid); -+ const wsrep_seqno_t seqno= wsrep_xid_seqno(&xid); -+ -+ char uuid_str[40] = {0, }; -+ wsrep_uuid_print(uuid, uuid_str, sizeof(uuid_str)); -+ WSREP_INFO("Initial position: %s:%lld", uuid_str, (long long)seqno); -+ -+ -+ if (!memcmp(&local_uuid, &WSREP_UUID_UNDEFINED, sizeof(local_uuid)) && -+ local_seqno == WSREP_SEQNO_UNDEFINED) -+ { -+ // Initial state -+ local_uuid= *uuid; -+ local_seqno= seqno; -+ } -+ else if (memcmp(&local_uuid, uuid, sizeof(local_uuid)) || -+ local_seqno != seqno) -+ { -+ WSREP_WARN("Initial position was provided by configuration or SST, " -+ "avoiding override"); -+ } -+} -+ -+int wsrep_init() -+{ -+ int rcode= -1; -+ -+ wsrep_ready_set(FALSE); -+ assert(wsrep_provider); -+ -+ wsrep_init_position(); -+ -+ if ((rcode= wsrep_load(wsrep_provider, &wsrep, wsrep_log_cb)) != WSREP_OK) -+ { -+ if (strcasecmp(wsrep_provider, WSREP_NONE)) -+ { -+ WSREP_ERROR("wsrep_load(%s) failed: %s (%d). Reverting to no provider.", -+ wsrep_provider, strerror(rcode), rcode); -+ strcpy((char*)wsrep_provider, WSREP_NONE); // damn it's a dirty hack -+ (void) wsrep_init(); -+ return rcode; -+ } -+ else /* this is for recursive call above */ -+ { -+ WSREP_ERROR("Could not revert to no provider: %s (%d). Need to abort.", -+ strerror(rcode), rcode); -+ unireg_abort(1); -+ } -+ } -+ -+ if (strlen(wsrep_provider)== 0 || -+ !strcmp(wsrep_provider, WSREP_NONE)) -+ { -+ // enable normal operation in case no provider is specified -+ wsrep_ready_set(TRUE); -+ global_system_variables.wsrep_on = 0; -+ wsrep_init_args args; -+ args.logger_cb = wsrep_log_cb; -+ args.options = (wsrep_provider_options) ? -+ wsrep_provider_options : ""; -+ rcode = wsrep->init(wsrep, &args); -+ if (rcode) -+ { -+ DBUG_PRINT("wsrep",("wsrep::init() failed: %d", rcode)); -+ WSREP_ERROR("wsrep::init() failed: %d, must shutdown", rcode); -+ wsrep->free(wsrep); -+ free(wsrep); -+ wsrep = NULL; -+ } -+ return rcode; -+ } -+ else -+ { -+ global_system_variables.wsrep_on = 1; -+ strncpy(provider_name, -+ wsrep->provider_name, sizeof(provider_name) - 1); -+ strncpy(provider_version, -+ wsrep->provider_version, sizeof(provider_version) - 1); -+ strncpy(provider_vendor, -+ wsrep->provider_vendor, sizeof(provider_vendor) - 1); -+ } -+ -+ if (!wsrep_data_home_dir || strlen(wsrep_data_home_dir) == 0) -+ wsrep_data_home_dir = mysql_real_data_home; -+ -+ char node_addr[512]= { 0, }; -+ size_t const node_addr_max= sizeof(node_addr) - 1; -+ if (!wsrep_node_address || !strcmp(wsrep_node_address, "")) -+ { -+ size_t const ret= wsrep_guess_ip(node_addr, node_addr_max); -+ if (!(ret > 0 && ret < node_addr_max)) -+ { -+ WSREP_WARN("Failed to guess base node address. Set it explicitly via " -+ "wsrep_node_address."); -+ node_addr[0]= '\0'; -+ } -+ } -+ else -+ { -+ strncpy(node_addr, wsrep_node_address, node_addr_max); -+ } -+ -+ char inc_addr[512]= { 0, }; -+ size_t const inc_addr_max= sizeof (inc_addr); -+ if ((!wsrep_node_incoming_address || -+ !strcmp (wsrep_node_incoming_address, WSREP_NODE_INCOMING_AUTO))) -+ { -+ unsigned int my_bind_ip= INADDR_ANY; // default if not set -+ if (my_bind_addr_str && strlen(my_bind_addr_str)) -+ { -+ my_bind_ip= wsrep_check_ip(my_bind_addr_str); -+ } -+ -+ if (INADDR_ANY != my_bind_ip) -+ { -+ if (INADDR_NONE != my_bind_ip && INADDR_LOOPBACK != my_bind_ip) -+ { -+ snprintf(inc_addr, inc_addr_max, "%s:%u", -+ my_bind_addr_str, (int)mysqld_port); -+ } // else leave inc_addr an empty string - mysqld is not listening for -+ // client connections on network interfaces. -+ } -+ else // mysqld binds to 0.0.0.0, take IP from wsrep_node_address if possible -+ { -+ size_t const node_addr_len= strlen(node_addr); -+ if (node_addr_len > 0) -+ { -+ const char* const colon= strrchr(node_addr, ':'); -+ if (strchr(node_addr, ':') == colon) // 1 or 0 ':' -+ { -+ size_t const ip_len= colon ? colon - node_addr : node_addr_len; -+ if (ip_len + 7 /* :55555\0 */ < inc_addr_max) -+ { -+ memcpy (inc_addr, node_addr, ip_len); -+ snprintf(inc_addr + ip_len, inc_addr_max - ip_len, ":%u", -+ (int)mysqld_port); -+ } -+ else -+ { -+ WSREP_WARN("Guessing address for incoming client connections: " -+ "address too long."); -+ inc_addr[0]= '\0'; -+ } -+ } -+ else -+ { -+ WSREP_WARN("Guessing address for incoming client connections: " -+ "too many colons :) ."); -+ inc_addr[0]= '\0'; -+ } -+ } -+ -+ if (!strlen(inc_addr)) -+ { -+ WSREP_WARN("Guessing address for incoming client connections failed. " -+ "Try setting wsrep_node_incoming_address explicitly."); -+ } -+ } -+ } -+ else if (!strchr(wsrep_node_incoming_address, ':')) // no port included -+ { -+ if ((int)inc_addr_max <= -+ snprintf(inc_addr, inc_addr_max, "%s:%u", -+ wsrep_node_incoming_address,(int)mysqld_port)) -+ { -+ WSREP_WARN("Guessing address for incoming client connections: " -+ "address too long."); -+ inc_addr[0]= '\0'; -+ } -+ } -+ else -+ { -+ size_t const need = strlen (wsrep_node_incoming_address); -+ if (need >= inc_addr_max) { -+ WSREP_WARN("wsrep_node_incoming_address too long: %zu", need); -+ inc_addr[0]= '\0'; -+ } -+ else { -+ memcpy (inc_addr, wsrep_node_incoming_address, need); -+ } -+ } -+ -+ struct wsrep_init_args wsrep_args; -+ -+ struct wsrep_gtid const state_id = { local_uuid, local_seqno }; -+ -+ wsrep_args.data_dir = wsrep_data_home_dir; -+ wsrep_args.node_name = (wsrep_node_name) ? wsrep_node_name : ""; -+ wsrep_args.node_address = node_addr; -+ wsrep_args.node_incoming = inc_addr; -+ wsrep_args.options = (wsrep_provider_options) ? -+ wsrep_provider_options : ""; -+ wsrep_args.proto_ver = wsrep_max_protocol_version; -+ -+ wsrep_args.state_id = &state_id; -+ -+ wsrep_args.logger_cb = wsrep_log_cb; -+ wsrep_args.view_handler_cb = wsrep_view_handler_cb; -+ wsrep_args.apply_cb = wsrep_apply_cb; -+ wsrep_args.commit_cb = wsrep_commit_cb; -+ wsrep_args.unordered_cb = wsrep_unordered_cb; -+ wsrep_args.sst_donate_cb = wsrep_sst_donate_cb; -+ wsrep_args.synced_cb = wsrep_synced_cb; -+ -+ rcode = wsrep->init(wsrep, &wsrep_args); -+ -+ if (rcode) -+ { -+ DBUG_PRINT("wsrep",("wsrep::init() failed: %d", rcode)); -+ WSREP_ERROR("wsrep::init() failed: %d, must shutdown", rcode); -+ wsrep->free(wsrep); -+ free(wsrep); -+ wsrep = NULL; -+ } -+ -+ return rcode; -+} -+ -+extern int wsrep_on(void *); -+ -+void wsrep_init_startup (bool first) -+{ -+ if (wsrep_init()) unireg_abort(1); -+ -+ wsrep_thr_lock_init(wsrep_thd_is_BF, wsrep_abort_thd, -+ wsrep_debug, wsrep_convert_LOCK_to_trx, wsrep_on); -+ -+ /* Skip replication start if no cluster address */ -+ if (!wsrep_cluster_address || strlen(wsrep_cluster_address) == 0) return; -+ -+ if (first) wsrep_sst_grab(); // do it so we can wait for SST below -+ -+ if (!wsrep_start_replication()) unireg_abort(1); -+ -+ wsrep_create_rollbacker(); -+ wsrep_create_appliers(1); -+ -+ if (first && !wsrep_sst_wait()) unireg_abort(1);// wait until SST is completed -+} -+ -+ -+void wsrep_deinit() -+{ -+ wsrep_unload(wsrep); -+ wsrep= 0; -+ provider_name[0]= '\0'; -+ provider_version[0]= '\0'; -+ provider_vendor[0]= '\0'; -+} -+ -+void wsrep_recover() -+{ -+ if (!memcmp(&local_uuid, &WSREP_UUID_UNDEFINED, sizeof(wsrep_uuid_t)) && -+ local_seqno == -2) -+ { -+ char uuid_str[40]; -+ wsrep_uuid_print(&local_uuid, uuid_str, sizeof(uuid_str)); -+ WSREP_INFO("Position %s:%lld given at startup, skipping position recovery", -+ uuid_str, (long long)local_seqno); -+ return; -+ } -+ XID xid; -+ memset(&xid, 0, sizeof(xid)); -+ xid.formatID= -1; -+ wsrep_get_SE_checkpoint(&xid); -+ char uuid_str[40]; -+ wsrep_uuid_print(wsrep_xid_uuid(&xid), uuid_str, sizeof(uuid_str)); -+ WSREP_INFO("Recovered position: %s:%lld", uuid_str, -+ (long long)wsrep_xid_seqno(&xid)); -+} -+ -+ -+void wsrep_stop_replication(THD *thd) -+{ -+ WSREP_INFO("Stop replication"); -+ if (!wsrep) -+ { -+ WSREP_INFO("Provider was not loaded, in stop replication"); -+ return; -+ } -+ -+ /* disconnect from group first to get wsrep_ready == FALSE */ -+ WSREP_DEBUG("Provider disconnect"); -+ wsrep->disconnect(wsrep); -+ -+ wsrep_connected= FALSE; -+ -+ wsrep_close_client_connections(TRUE); -+ -+ /* wait until appliers have stopped */ -+ wsrep_wait_appliers_close(thd); -+ -+ return; -+} -+ -+/* This one is set to true when --wsrep-new-cluster is found in the command -+ * line arguments */ -+static my_bool wsrep_new_cluster= FALSE; -+#define WSREP_NEW_CLUSTER "--wsrep-new-cluster" -+/* Finds and hides --wsrep-new-cluster from the arguments list -+ * by moving it to the end of the list and decrementing argument count */ -+void wsrep_filter_new_cluster (int* argc, char* argv[]) -+{ -+ int i; -+ for (i= *argc - 1; i > 0; i--) -+ { -+ /* make a copy of the argument to convert possible underscores to hyphens. -+ * the copy need not to be longer than WSREP_NEW_CLUSTER option */ -+ char arg[sizeof(WSREP_NEW_CLUSTER) + 1]= { 0, }; -+ strncpy(arg, argv[i], sizeof(arg) - 1); -+ char* underscore(arg); -+ while (NULL != (underscore= strchr(underscore, '_'))) *underscore= '-'; -+ -+ if (!strcmp(arg, WSREP_NEW_CLUSTER)) -+ { -+ wsrep_new_cluster= TRUE; -+ *argc -= 1; -+ /* preserve the order of remaining arguments AND -+ * preserve the original argument pointers - just in case */ -+ char* wnc= argv[i]; -+ memmove(&argv[i], &argv[i + 1], (*argc - i)*sizeof(argv[i])); -+ argv[*argc]= wnc; /* this will be invisible to the rest of the program */ -+ } -+ } -+} -+ -+bool wsrep_start_replication() -+{ -+ wsrep_status_t rcode; -+ -+ /* -+ if provider is trivial, don't even try to connect, -+ but resume local node operation -+ */ -+ if (strlen(wsrep_provider)== 0 || -+ !strcmp(wsrep_provider, WSREP_NONE)) -+ { -+ // enable normal operation in case no provider is specified -+ wsrep_ready_set(TRUE); -+ return true; -+ } -+ -+ if (!wsrep_cluster_address || strlen(wsrep_cluster_address)== 0) -+ { -+ // if provider is non-trivial, but no address is specified, wait for address -+ wsrep_ready_set(FALSE); -+ return true; -+ } -+ -+ bool const bootstrap(TRUE == wsrep_new_cluster); -+ wsrep_new_cluster= FALSE; -+ -+ WSREP_INFO("Start replication"); -+ -+ if ((rcode = wsrep->connect(wsrep, -+ wsrep_cluster_name, -+ wsrep_cluster_address, -+ wsrep_sst_donor, -+ bootstrap))) -+ { -+ if (-ESOCKTNOSUPPORT == rcode) -+ { -+ DBUG_PRINT("wsrep",("unrecognized cluster address: '%s', rcode: %d", -+ wsrep_cluster_address, rcode)); -+ WSREP_ERROR("unrecognized cluster address: '%s', rcode: %d", -+ wsrep_cluster_address, rcode); -+ } -+ else -+ { -+ DBUG_PRINT("wsrep",("wsrep->connect() failed: %d", rcode)); -+ WSREP_ERROR("wsrep::connect() failed: %d", rcode); -+ } -+ -+ return false; -+ } -+ else -+ { -+ wsrep_connected= TRUE; -+ -+ char* opts= wsrep->options_get(wsrep); -+ if (opts) -+ { -+ wsrep_provider_options_init(opts); -+ free(opts); -+ } -+ else -+ { -+ WSREP_WARN("Failed to get wsrep options"); -+ } -+ } -+ -+ return true; -+} -+ -+bool wsrep_sync_wait (THD* thd, uint mask) -+{ -+ if ((thd->variables.wsrep_sync_wait & mask) && -+ thd->variables.wsrep_on && -+ !thd->in_active_multi_stmt_transaction() && -+ thd->wsrep_conflict_state != REPLAYING) -+ { -+ WSREP_DEBUG("wsrep_sync_wait: thd->variables.wsrep_sync_wait = %u, mask = %u", -+ thd->variables.wsrep_sync_wait, mask); -+ // This allows autocommit SELECTs and a first SELECT after SET AUTOCOMMIT=0 -+ // TODO: modify to check if thd has locked any rows. -+ wsrep_gtid_t gtid; -+ wsrep_status_t ret= wsrep->causal_read (wsrep, >id); -+ -+ if (unlikely(WSREP_OK != ret)) -+ { -+ const char* msg; -+ int err; -+ -+ // Possibly relevant error codes: -+ // ER_CHECKREAD, ER_ERROR_ON_READ, ER_INVALID_DEFAULT, ER_EMPTY_QUERY, -+ // ER_FUNCTION_NOT_DEFINED, ER_NOT_ALLOWED_COMMAND, ER_NOT_SUPPORTED_YET, -+ // ER_FEATURE_DISABLED, ER_QUERY_INTERRUPTED -+ -+ switch (ret) -+ { -+ case WSREP_NOT_IMPLEMENTED: -+ msg= "synchronous reads by wsrep backend. " -+ "Please unset wsrep_causal_reads variable."; -+ err= ER_NOT_SUPPORTED_YET; -+ break; -+ default: -+ msg= "Synchronous wait failed."; -+ err= ER_LOCK_WAIT_TIMEOUT; // NOTE: the above msg won't be displayed -+ // with ER_LOCK_WAIT_TIMEOUT -+ } -+ -+ my_error(err, MYF(0), msg); -+ -+ return true; -+ } -+ } -+ -+ return false; -+} -+ -+/* -+ * Helpers to deal with TOI key arrays -+ */ -+typedef struct wsrep_key_arr -+{ -+ wsrep_key_t* keys; -+ size_t keys_len; -+} wsrep_key_arr_t; -+ -+ -+static void wsrep_keys_free(wsrep_key_arr_t* key_arr) -+{ -+ for (size_t i= 0; i < key_arr->keys_len; ++i) -+ { -+ my_free((void*)key_arr->keys[i].key_parts); -+ } -+ my_free(key_arr->keys); -+ key_arr->keys= 0; -+ key_arr->keys_len= 0; -+} -+ -+ -+/*! -+ * @param db Database string -+ * @param table Table string -+ * @param key Array of wsrep_key_t -+ * @param key_len In: number of elements in key array, Out: number of -+ * elements populated -+ * -+ * @return true if preparation was successful, otherwise false. -+ */ -+ -+static bool wsrep_prepare_key_for_isolation(const char* db, -+ const char* table, -+ wsrep_buf_t* key, -+ size_t* key_len) -+{ -+ if (*key_len < 2) return false; -+ -+ switch (wsrep_protocol_version) -+ { -+ case 0: -+ *key_len= 0; -+ break; -+ case 1: -+ case 2: -+ case 3: -+ { -+ *key_len= 0; -+ if (db) -+ { -+ // sql_print_information("%s.%s", db, table); -+ if (db) -+ { -+ key[*key_len].ptr= db; -+ key[*key_len].len= strlen(db); -+ ++(*key_len); -+ if (table) -+ { -+ key[*key_len].ptr= table; -+ key[*key_len].len= strlen(table); -+ ++(*key_len); -+ } -+ } -+ } -+ break; -+ } -+ default: -+ return false; -+ } -+ -+ return true; -+} -+ -+/* Prepare key list from db/table and table_list */ -+static bool wsrep_prepare_keys_for_isolation(THD* thd, -+ const char* db, -+ const char* table, -+ const TABLE_LIST* table_list, -+ wsrep_key_arr_t* ka) -+{ -+ ka->keys= 0; -+ ka->keys_len= 0; -+ -+ extern TABLE* find_temporary_table(THD*, const TABLE_LIST*); -+ -+ if (db || table) -+ { -+ TABLE_LIST tmp_table; -+ MDL_request mdl_request; -+ -+ memset(&tmp_table, 0, sizeof(tmp_table)); -+ tmp_table.table_name= (char*)table; -+ tmp_table.db= (char*)db; -+ tmp_table.mdl_request.init(MDL_key::GLOBAL, (db) ? db : "", -+ (table) ? table : "", -+ MDL_INTENTION_EXCLUSIVE, MDL_STATEMENT); -+ -+ if (!table || !find_temporary_table(thd, &tmp_table)) -+ { -+ if (!(ka->keys= (wsrep_key_t*)my_malloc(sizeof(wsrep_key_t), MYF(0)))) -+ { -+ WSREP_ERROR("Can't allocate memory for key_array"); -+ goto err; -+ } -+ ka->keys_len= 1; -+ if (!(ka->keys[0].key_parts= (wsrep_buf_t*) -+ my_malloc(sizeof(wsrep_buf_t)*2, MYF(0)))) -+ { -+ WSREP_ERROR("Can't allocate memory for key_parts"); -+ goto err; -+ } -+ ka->keys[0].key_parts_num= 2; -+ if (!wsrep_prepare_key_for_isolation( -+ db, table, -+ (wsrep_buf_t*)ka->keys[0].key_parts, -+ &ka->keys[0].key_parts_num)) -+ { -+ WSREP_ERROR("Preparing keys for isolation failed"); -+ goto err; -+ } -+ } -+ } -+ -+ for (const TABLE_LIST* table= table_list; table; table= table->next_global) -+ { -+ if (!find_temporary_table(thd, table)) -+ { -+ wsrep_key_t* tmp; -+ tmp= (wsrep_key_t*)my_realloc( -+ ka->keys, (ka->keys_len + 1) * sizeof(wsrep_key_t), MYF(0)); -+ if (!tmp) -+ { -+ WSREP_ERROR("Can't allocate memory for key_array"); -+ goto err; -+ } -+ ka->keys= tmp; -+ if (!(ka->keys[ka->keys_len].key_parts= (wsrep_buf_t*) -+ my_malloc(sizeof(wsrep_buf_t)*2, MYF(0)))) -+ { -+ WSREP_ERROR("Can't allocate memory for key_parts"); -+ goto err; -+ } -+ ka->keys[ka->keys_len].key_parts_num= 2; -+ ++ka->keys_len; -+ if (!wsrep_prepare_key_for_isolation( -+ table->db, table->table_name, -+ (wsrep_buf_t*)ka->keys[ka->keys_len - 1].key_parts, -+ &ka->keys[ka->keys_len - 1].key_parts_num)) -+ { -+ WSREP_ERROR("Preparing keys for isolation failed"); -+ goto err; -+ } -+ } -+ } -+ return true; -+err: -+ wsrep_keys_free(ka); -+ return false; -+} -+ -+ -+bool wsrep_prepare_key_for_innodb(const uchar* cache_key, -+ size_t cache_key_len, -+ const uchar* row_id, -+ size_t row_id_len, -+ wsrep_buf_t* key, -+ size_t* key_len) -+{ -+ if (*key_len < 3) return false; -+ -+ *key_len= 0; -+ switch (wsrep_protocol_version) -+ { -+ case 0: -+ { -+ key[0].ptr = cache_key; -+ key[0].len = cache_key_len; -+ -+ *key_len = 1; -+ break; -+ } -+ case 1: -+ case 2: -+ case 3: -+ { -+ key[0].ptr = cache_key; -+ key[0].len = strlen( (char*)cache_key ); -+ -+ key[1].ptr = cache_key + strlen( (char*)cache_key ) + 1; -+ key[1].len = strlen( (char*)(key[1].ptr) ); -+ -+ *key_len = 2; -+ break; -+ } -+ default: -+ return false; -+ } -+ -+ key[*key_len].ptr = row_id; -+ key[*key_len].len = row_id_len; -+ ++(*key_len); -+ -+ return true; -+} -+ -+ -+/* -+ * Construct Query_log_Event from thd query and serialize it -+ * into buffer. -+ * -+ * Return 0 in case of success, 1 in case of error. -+ */ -+int wsrep_to_buf_helper( -+ THD* thd, const char *query, uint query_len, uchar** buf, size_t* buf_len) -+{ -+ IO_CACHE tmp_io_cache; -+ if (open_cached_file(&tmp_io_cache, mysql_tmpdir, TEMP_PREFIX, -+ 65536, MYF(MY_WME))) -+ return 1; -+ int ret(0); -+ -+ if (thd->variables.gtid_next.type == GTID_GROUP) -+ { -+ Gtid_log_event gtid_ev(thd, FALSE, &thd->variables.gtid_next); -+ if (!gtid_ev.is_valid()) ret= 0; -+ if (!ret && gtid_ev.write(&tmp_io_cache)) ret= 1; -+ } -+ -+ /* if there is prepare query, add event for it */ -+ if (!ret && thd->wsrep_TOI_pre_query) -+ { -+ Query_log_event ev(thd, thd->wsrep_TOI_pre_query, -+ thd->wsrep_TOI_pre_query_len, -+ FALSE, FALSE, FALSE, 0); -+ if (ev.write(&tmp_io_cache)) ret= 1; -+ } -+ -+ /* continue to append the actual query */ -+ Query_log_event ev(thd, query, query_len, FALSE, FALSE, FALSE, 0); -+ if (!ret && ev.write(&tmp_io_cache)) ret= 1; -+ if (!ret && wsrep_write_cache_buf(&tmp_io_cache, buf, buf_len)) ret= 1; -+ close_cached_file(&tmp_io_cache); -+ return ret; -+} -+ -+#include "sql_show.h" -+static int -+create_view_query(THD *thd, uchar** buf, size_t* buf_len) -+{ -+ LEX *lex= thd->lex; -+ SELECT_LEX *select_lex= &lex->select_lex; -+ TABLE_LIST *first_table= select_lex->table_list.first; -+ TABLE_LIST *views = first_table; -+ -+ String buff; -+ const LEX_STRING command[3]= -+ {{ C_STRING_WITH_LEN("CREATE ") }, -+ { C_STRING_WITH_LEN("ALTER ") }, -+ { C_STRING_WITH_LEN("CREATE OR REPLACE ") }}; -+ -+ buff.append(command[thd->lex->create_view_mode].str, -+ command[thd->lex->create_view_mode].length); -+ -+ if (!lex->definer) -+ { -+ /* -+ DEFINER-clause is missing; we have to create default definer in -+ persistent arena to be PS/SP friendly. -+ If this is an ALTER VIEW then the current user should be set as -+ the definer. -+ */ -+ -+ if (!(lex->definer= create_default_definer(thd))) -+ { -+ WSREP_WARN("view default definer issue"); -+ } -+ } -+ -+ views->algorithm = lex->create_view_algorithm; -+ views->definer.user = lex->definer->user; -+ views->definer.host = lex->definer->host; -+ views->view_suid = lex->create_view_suid; -+ views->with_check = lex->create_view_check; -+ -+ view_store_options(thd, views, &buff); -+ buff.append(STRING_WITH_LEN("VIEW ")); -+ /* Test if user supplied a db (ie: we did not use thd->db) */ -+ if (views->db && views->db[0] && -+ (thd->db == NULL || strcmp(views->db, thd->db))) -+ { -+ append_identifier(thd, &buff, views->db, -+ views->db_length); -+ buff.append('.'); -+ } -+ append_identifier(thd, &buff, views->table_name, -+ views->table_name_length); -+ if (lex->view_list.elements) -+ { -+ List_iterator_fast names(lex->view_list); -+ LEX_STRING *name; -+ int i; -+ -+ for (i= 0; (name= names++); i++) -+ { -+ buff.append(i ? ", " : "("); -+ append_identifier(thd, &buff, name->str, name->length); -+ } -+ buff.append(')'); -+ } -+ buff.append(STRING_WITH_LEN(" AS ")); -+ //buff.append(views->source.str, views->source.length); -+ buff.append(thd->lex->create_view_select.str, -+ thd->lex->create_view_select.length); -+ //int errcode= query_error_code(thd, TRUE); -+ //if (thd->binlog_query(THD::STMT_QUERY_TYPE, -+ // buff.ptr(), buff.length(), FALSE, FALSE, FALSE, errcod -+ return wsrep_to_buf_helper(thd, buff.ptr(), buff.length(), buf, buf_len); -+} -+ -+/* -+ returns: -+ 0: statement was replicated as TOI -+ 1: TOI replication was skipped -+ -1: TOI replication failed -+ */ -+static int wsrep_TOI_begin(THD *thd, char *db_, char *table_, -+ const TABLE_LIST* table_list) -+{ -+ wsrep_status_t ret(WSREP_WARNING); -+ uchar* buf(0); -+ size_t buf_len(0); -+ int buf_err; -+ -+ WSREP_DEBUG("TO BEGIN: %lld, %d : %s", (long long)wsrep_thd_trx_seqno(thd), -+ thd->wsrep_exec_mode, thd->query() ); -+ switch (thd->lex->sql_command) -+ { -+ case SQLCOM_CREATE_VIEW: -+ buf_err= create_view_query(thd, &buf, &buf_len); -+ break; -+ case SQLCOM_CREATE_PROCEDURE: -+ case SQLCOM_CREATE_SPFUNCTION: -+ buf_err= wsrep_create_sp(thd, &buf, &buf_len); -+ break; -+ case SQLCOM_CREATE_TRIGGER: -+ buf_err= wsrep_create_trigger_query(thd, &buf, &buf_len); -+ break; -+ case SQLCOM_CREATE_EVENT: -+ buf_err= wsrep_create_event_query(thd, &buf, &buf_len); -+ break; -+ case SQLCOM_ALTER_EVENT: -+ buf_err= wsrep_alter_event_query(thd, &buf, &buf_len); -+ break; -+ default: -+ buf_err= wsrep_to_buf_helper(thd, thd->query(), thd->query_length(), &buf, -+ &buf_len); -+ break; -+ } -+ -+ wsrep_key_arr_t key_arr= {0, 0}; -+ struct wsrep_buf buff = { buf, buf_len }; -+ if (!buf_err && -+ wsrep_prepare_keys_for_isolation(thd, db_, table_, table_list, &key_arr)&& -+ key_arr.keys_len > 0 && -+ WSREP_OK == (ret = wsrep->to_execute_start(wsrep, thd->thread_id, -+ key_arr.keys, key_arr.keys_len, -+ &buff, 1, -+ &thd->wsrep_trx_meta))) -+ { -+ thd->wsrep_exec_mode= TOTAL_ORDER; -+ wsrep_to_isolation++; -+ if (buf) my_free(buf); -+ wsrep_keys_free(&key_arr); -+ WSREP_DEBUG("TO BEGIN: %lld, %d",(long long)wsrep_thd_trx_seqno(thd), -+ thd->wsrep_exec_mode); -+ } -+ else if (key_arr.keys_len > 0) { -+ /* jump to error handler in mysql_execute_command() */ -+ WSREP_WARN("TO isolation failed for: %d, sql: %s. Check wsrep " -+ "connection state and retry the query.", -+ ret, (thd->query()) ? thd->query() : "void"); -+ my_error(ER_LOCK_DEADLOCK, MYF(0), "WSREP replication failed. Check " -+ "your wsrep connection state and retry the query."); -+ if (buf) my_free(buf); -+ wsrep_keys_free(&key_arr); -+ return -1; -+ } -+ else { -+ /* non replicated DDL, affecting temporary tables only */ -+ WSREP_DEBUG("TO isolation skipped for: %d, sql: %s." -+ "Only temporary tables affected.", -+ ret, (thd->query()) ? thd->query() : "void"); -+ return 1; -+ } -+ return 0; -+} -+ -+static void wsrep_TOI_end(THD *thd) { -+ wsrep_status_t ret; -+ wsrep_to_isolation--; -+ -+ WSREP_DEBUG("TO END: %lld, %d : %s", (long long)wsrep_thd_trx_seqno(thd), -+ thd->wsrep_exec_mode, (thd->query()) ? thd->query() : "void"); -+ -+ XID xid; -+ wsrep_xid_init(&xid, &thd->wsrep_trx_meta.gtid.uuid, -+ thd->wsrep_trx_meta.gtid.seqno); -+ wsrep_set_SE_checkpoint(&xid); -+ WSREP_DEBUG("TO END: %lld, update seqno", -+ (long long)wsrep_thd_trx_seqno(thd)); -+ -+ if (WSREP_OK == (ret = wsrep->to_execute_end(wsrep, thd->thread_id))) { -+ WSREP_DEBUG("TO END: %lld", (long long)wsrep_thd_trx_seqno(thd)); -+ } -+ else { -+ WSREP_WARN("TO isolation end failed for: %d, sql: %s", -+ ret, (thd->query()) ? thd->query() : "void"); -+ } -+} -+ -+static int wsrep_RSU_begin(THD *thd, char *db_, char *table_) -+{ -+ wsrep_status_t ret(WSREP_WARNING); -+ WSREP_DEBUG("RSU BEGIN: %lld, %d : %s", (long long)wsrep_thd_trx_seqno(thd), -+ thd->wsrep_exec_mode, thd->query() ); -+ -+ ret = wsrep->desync(wsrep); -+ if (ret != WSREP_OK) -+ { -+ WSREP_WARN("RSU desync failed %d for %s", ret, thd->query()); -+ my_error(ER_LOCK_DEADLOCK, MYF(0)); -+ return(ret); -+ } -+ mysql_mutex_lock(&LOCK_wsrep_replaying); -+ wsrep_replaying++; -+ mysql_mutex_unlock(&LOCK_wsrep_replaying); -+ -+ if (wsrep_wait_committing_connections_close(5000)) -+ { -+ /* no can do, bail out from DDL */ -+ WSREP_WARN("RSU failed due to pending transactions, %s", thd->query()); -+ mysql_mutex_lock(&LOCK_wsrep_replaying); -+ wsrep_replaying--; -+ mysql_mutex_unlock(&LOCK_wsrep_replaying); -+ -+ ret = wsrep->resync(wsrep); -+ if (ret != WSREP_OK) -+ { -+ WSREP_WARN("resync failed %d for %s", ret, thd->query()); -+ } -+ my_error(ER_LOCK_DEADLOCK, MYF(0)); -+ return(1); -+ } -+ -+ wsrep_seqno_t seqno = wsrep->pause(wsrep); -+ if (seqno == WSREP_SEQNO_UNDEFINED) -+ { -+ WSREP_WARN("pause failed %lld for %s", (long long)seqno, thd->query()); -+ return(1); -+ } -+ WSREP_DEBUG("paused at %lld", (long long)seqno); -+ thd->variables.wsrep_on = 0; -+ return 0; -+} -+ -+static void wsrep_RSU_end(THD *thd) -+{ -+ wsrep_status_t ret(WSREP_WARNING); -+ WSREP_DEBUG("RSU END: %lld, %d : %s", (long long)wsrep_thd_trx_seqno(thd), -+ thd->wsrep_exec_mode, thd->query() ); -+ -+ -+ mysql_mutex_lock(&LOCK_wsrep_replaying); -+ wsrep_replaying--; -+ mysql_mutex_unlock(&LOCK_wsrep_replaying); -+ -+ ret = wsrep->resume(wsrep); -+ if (ret != WSREP_OK) -+ { -+ WSREP_WARN("resume failed %d for %s", ret, thd->query()); -+ } -+ ret = wsrep->resync(wsrep); -+ if (ret != WSREP_OK) -+ { -+ WSREP_WARN("resync failed %d for %s", ret, thd->query()); -+ return; -+ } -+ thd->variables.wsrep_on = 1; -+} -+ -+int wsrep_to_isolation_begin(THD *thd, char *db_, char *table_, -+ const TABLE_LIST* table_list) -+{ -+ -+ /* -+ No isolation for applier or replaying threads. -+ */ -+ if (thd->wsrep_exec_mode == REPL_RECV) return 0; -+ -+ int ret= 0; -+ mysql_mutex_lock(&thd->LOCK_wsrep_thd); -+ -+ if (thd->wsrep_conflict_state == MUST_ABORT) -+ { -+ WSREP_INFO("thread: %lu, %s has been aborted due to multi-master conflict", -+ thd->thread_id, thd->query()); -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ return WSREP_TRX_FAIL; -+ } -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ -+ DBUG_ASSERT(thd->wsrep_exec_mode == LOCAL_STATE); -+ DBUG_ASSERT(thd->wsrep_trx_meta.gtid.seqno == WSREP_SEQNO_UNDEFINED); -+ -+ if (thd->global_read_lock.can_acquire_protection()) -+ { -+ WSREP_DEBUG("Aborting TOI: Global Read-Lock (FTWRL) in place: %s %lu", -+ thd->query(), thd->thread_id); -+ return -1; -+ } -+ -+ if (wsrep_debug && thd->mdl_context.has_locks()) -+ { -+ WSREP_DEBUG("thread holds MDL locks at TI begin: %s %lu", -+ thd->query(), thd->thread_id); -+ } -+ -+ /* -+ It makes sense to set auto_increment_* to defaults in TOI operations. -+ Must be done before wsrep_TOI_begin() since Query_log_event encapsulating -+ TOI statement and auto inc variables for wsrep replication is constructed -+ there. Variables are reset back in THD::reset_for_next_command() before -+ processing of next command. -+ */ -+ if (wsrep_auto_increment_control) -+ { -+ thd->variables.auto_increment_offset = 1; -+ thd->variables.auto_increment_increment = 1; -+ } -+ -+ if (thd->variables.wsrep_on && thd->wsrep_exec_mode==LOCAL_STATE) -+ { -+ switch (wsrep_OSU_method_options) { -+ case WSREP_OSU_TOI: ret = wsrep_TOI_begin(thd, db_, table_, -+ table_list); break; -+ case WSREP_OSU_RSU: ret = wsrep_RSU_begin(thd, db_, table_); break; -+ } -+ switch (ret) { -+ case 0: thd->wsrep_exec_mode= TOTAL_ORDER; break; -+ case 1: -+ /* TOI replication skipped, treat as success */ -+ ret = 0; -+ break; -+ case -1: -+ /* TOI replication failed, treat as error */ -+ break; -+ } -+ } -+ return ret; -+} -+ -+void wsrep_to_isolation_end(THD *thd) -+{ -+ if (thd->wsrep_exec_mode == TOTAL_ORDER) -+ { -+ switch(wsrep_OSU_method_options) -+ { -+ case WSREP_OSU_TOI: wsrep_TOI_end(thd); break; -+ case WSREP_OSU_RSU: wsrep_RSU_end(thd); break; -+ } -+ wsrep_cleanup_transaction(thd); -+ } -+} -+ -+#define WSREP_MDL_LOG(severity, msg, req, gra) \ -+ WSREP_##severity( \ -+ "%s\n" \ -+ "request: (%lu \tseqno %lld \twsrep (%d, %d, %d) cmd %d %d \t%s)\n" \ -+ "granted: (%lu \tseqno %lld \twsrep (%d, %d, %d) cmd %d %d \t%s)", \ -+ msg, \ -+ req->thread_id, (long long)wsrep_thd_trx_seqno(req), \ -+ req->wsrep_exec_mode, req->wsrep_query_state, req->wsrep_conflict_state, \ -+ req->get_command(), req->lex->sql_command, req->query(), \ -+ gra->thread_id, (long long)wsrep_thd_trx_seqno(gra), \ -+ gra->wsrep_exec_mode, gra->wsrep_query_state, gra->wsrep_conflict_state, \ -+ gra->get_command(), gra->lex->sql_command, gra->query()); -+ -+bool -+wsrep_grant_mdl_exception(MDL_context *requestor_ctx, -+ MDL_ticket *ticket -+) { -+ if (!WSREP_ON) return FALSE; -+ -+ THD *request_thd = requestor_ctx->wsrep_get_thd(); -+ THD *granted_thd = ticket->get_ctx()->wsrep_get_thd(); -+ bool ret = FALSE; -+ -+ mysql_mutex_lock(&request_thd->LOCK_wsrep_thd); -+ if (request_thd->wsrep_exec_mode == TOTAL_ORDER || -+ request_thd->wsrep_exec_mode == REPL_RECV) -+ { -+ mysql_mutex_unlock(&request_thd->LOCK_wsrep_thd); -+ WSREP_MDL_LOG(DEBUG, "MDL conflict ", request_thd, granted_thd); -+ ticket->wsrep_report(wsrep_debug); -+ -+ mysql_mutex_lock(&granted_thd->LOCK_wsrep_thd); -+ if (granted_thd->wsrep_exec_mode == TOTAL_ORDER || -+ granted_thd->wsrep_exec_mode == REPL_RECV) -+ { -+ WSREP_MDL_LOG(INFO, "MDL BF-BF conflict", request_thd, granted_thd); -+ ticket->wsrep_report(true); -+ mysql_mutex_unlock(&granted_thd->LOCK_wsrep_thd); -+ ret = TRUE; -+ } -+ else if (granted_thd->lex->sql_command == SQLCOM_FLUSH) -+ { -+ WSREP_DEBUG("mdl granted over FLUSH BF"); -+ ticket->wsrep_report(wsrep_debug); -+ mysql_mutex_unlock(&granted_thd->LOCK_wsrep_thd); -+ ret = TRUE; -+ } -+ else if (request_thd->lex->sql_command == SQLCOM_DROP_TABLE) -+ { -+ WSREP_DEBUG("DROP caused BF abort"); -+ ticket->wsrep_report(wsrep_debug); -+ mysql_mutex_unlock(&granted_thd->LOCK_wsrep_thd); -+ wsrep_abort_thd((void*)request_thd, (void*)granted_thd, 1); -+ ret = FALSE; -+ } -+ else if (granted_thd->wsrep_query_state == QUERY_COMMITTING) -+ { -+ WSREP_DEBUG("mdl granted, but commiting thd abort scheduled"); -+ ticket->wsrep_report(wsrep_debug); -+ mysql_mutex_unlock(&granted_thd->LOCK_wsrep_thd); -+ wsrep_abort_thd((void*)request_thd, (void*)granted_thd, 1); -+ ret = FALSE; -+ } -+ else -+ { -+ WSREP_MDL_LOG(DEBUG, "MDL conflict-> BF abort", request_thd, granted_thd); -+ ticket->wsrep_report(wsrep_debug); -+ mysql_mutex_unlock(&granted_thd->LOCK_wsrep_thd); -+ wsrep_abort_thd((void*)request_thd, (void*)granted_thd, 1); -+ ret = FALSE; -+ } -+ } -+ else -+ { -+ mysql_mutex_unlock(&request_thd->LOCK_wsrep_thd); -+ } -+ return ret; -+} -diff --git a/sql/wsrep_mysqld.h b/sql/wsrep_mysqld.h -new file mode 100644 -index 0000000..3df3911 ---- /dev/null -+++ b/sql/wsrep_mysqld.h -@@ -0,0 +1,321 @@ -+/* Copyright 2008-2013 Codership Oy -+ -+ 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 */ -+ -+#ifndef WSREP_MYSQLD_H -+#define WSREP_MYSQLD_H -+ -+#include "mysqld.h" -+typedef struct st_mysql_show_var SHOW_VAR; -+#include -+#include "rpl_gtid.h" -+#include "../wsrep/wsrep_api.h" -+ -+#define WSREP_UNDEFINED_TRX_ID ULONGLONG_MAX -+ -+class set_var; -+class THD; -+ -+enum wsrep_exec_mode { -+ LOCAL_STATE, -+ REPL_RECV, -+ TOTAL_ORDER, -+ LOCAL_COMMIT -+}; -+ -+enum wsrep_query_state { -+ QUERY_IDLE, -+ QUERY_EXEC, -+ QUERY_COMMITTING, -+ QUERY_EXITING, -+ QUERY_ROLLINGBACK, -+}; -+ -+enum wsrep_conflict_state { -+ NO_CONFLICT, -+ MUST_ABORT, -+ ABORTING, -+ ABORTED, -+ MUST_REPLAY, -+ REPLAYING, -+ RETRY_AUTOCOMMIT, -+ CERT_FAILURE, -+}; -+ -+enum wsrep_consistency_check_mode { -+ NO_CONSISTENCY_CHECK, -+ CONSISTENCY_CHECK_DECLARED, -+ CONSISTENCY_CHECK_RUNNING, -+}; -+ -+ -+// Global wsrep parameters -+extern wsrep_t* wsrep; -+ -+// MySQL wsrep options -+extern const char* wsrep_provider; -+extern const char* wsrep_provider_options; -+extern const char* wsrep_cluster_name; -+extern const char* wsrep_cluster_address; -+extern const char* wsrep_node_name; -+extern const char* wsrep_node_address; -+extern const char* wsrep_node_incoming_address; -+extern const char* wsrep_data_home_dir; -+extern const char* wsrep_dbug_option; -+extern long wsrep_slave_threads; -+extern int wsrep_slave_count_change; -+extern MYSQL_PLUGIN_IMPORT my_bool wsrep_debug; -+extern my_bool wsrep_convert_LOCK_to_trx; -+extern ulong wsrep_retry_autocommit; -+extern my_bool wsrep_auto_increment_control; -+extern my_bool wsrep_drupal_282555_workaround; -+extern my_bool wsrep_incremental_data_collection; -+extern const char* wsrep_start_position; -+extern ulong wsrep_max_ws_size; -+extern ulong wsrep_max_ws_rows; -+extern const char* wsrep_notify_cmd; -+extern my_bool wsrep_certify_nonPK; -+extern long wsrep_max_protocol_version; -+extern long wsrep_protocol_version; -+extern ulong wsrep_forced_binlog_format; -+extern ulong wsrep_OSU_method_options; -+extern my_bool wsrep_desync; -+extern my_bool wsrep_recovery; -+extern my_bool wsrep_replicate_myisam; -+extern my_bool wsrep_log_conflicts; -+extern ulong wsrep_mysql_replication_bundle; -+extern my_bool wsrep_load_data_splitting; -+extern my_bool wsrep_restart_slave; -+extern my_bool wsrep_restart_slave_activated; -+extern my_bool wsrep_slave_FK_checks; -+extern my_bool wsrep_slave_UK_checks; -+ -+enum enum_wsrep_OSU_method { WSREP_OSU_TOI, WSREP_OSU_RSU }; -+enum enum_wsrep_sync_wait { -+ WSREP_SYNC_WAIT_NONE = 0x0, -+ // show, select, begin -+ WSREP_SYNC_WAIT_BEFORE_READ = 0x1, -+ WSREP_SYNC_WAIT_BEFORE_UPDATE_DELETE = 0x2, -+ WSREP_SYNC_WAIT_BEFORE_INSERT_REPLACE = 0x4, -+ WSREP_SYNC_WAIT_MAX = 0x7 -+}; -+ -+// MySQL status variables -+extern my_bool wsrep_connected; -+extern my_bool wsrep_ready; -+extern const char* wsrep_cluster_state_uuid; -+extern long long wsrep_cluster_conf_id; -+extern const char* wsrep_cluster_status; -+extern long wsrep_cluster_size; -+extern long wsrep_local_index; -+extern long long wsrep_local_bf_aborts; -+extern const char* wsrep_provider_name; -+extern const char* wsrep_provider_version; -+extern const char* wsrep_provider_vendor; -+ -+int wsrep_show_status(THD *thd, SHOW_VAR *var, char *buff); -+void wsrep_free_status(THD *thd); -+ -+/* Filters out --wsrep-new-cluster oprtion from argv[] -+ * should be called in the very beginning of main() */ -+void wsrep_filter_new_cluster (int* argc, char* argv[]); -+ -+int wsrep_init(); -+void wsrep_deinit(); -+void wsrep_recover(); -+bool wsrep_before_SE(); // initialize wsrep before storage -+ // engines (true) or after (false) -+/* wsrep initialization sequence at startup -+ * @param before wsrep_before_SE() value */ -+void wsrep_init_startup(bool before); -+ -+ -+extern "C" enum wsrep_exec_mode wsrep_thd_exec_mode(THD *thd); -+extern "C" enum wsrep_conflict_state wsrep_thd_conflict_state(THD *thd); -+extern "C" enum wsrep_query_state wsrep_thd_query_state(THD *thd); -+extern "C" const char * wsrep_thd_exec_mode_str(THD *thd); -+extern "C" const char * wsrep_thd_conflict_state_str(THD *thd); -+extern "C" const char * wsrep_thd_query_state_str(THD *thd); -+extern "C" wsrep_ws_handle_t* wsrep_thd_ws_handle(THD *thd); -+ -+extern "C" void wsrep_thd_set_exec_mode(THD *thd, enum wsrep_exec_mode mode); -+extern "C" void wsrep_thd_set_query_state( -+ THD *thd, enum wsrep_query_state state); -+extern "C" void wsrep_thd_set_conflict_state( -+ THD *thd, enum wsrep_conflict_state state); -+ -+extern "C" void wsrep_thd_set_trx_to_replay(THD *thd, uint64 trx_id); -+ -+extern "C" void wsrep_thd_LOCK(THD *thd); -+extern "C" void wsrep_thd_UNLOCK(THD *thd); -+extern "C" uint32 wsrep_thd_wsrep_rand(THD *thd); -+extern "C" time_t wsrep_thd_query_start(THD *thd); -+extern "C" my_thread_id wsrep_thd_thread_id(THD *thd); -+extern "C" int64_t wsrep_thd_trx_seqno(THD *thd); -+extern "C" query_id_t wsrep_thd_query_id(THD *thd); -+extern "C" char * wsrep_thd_query(THD *thd); -+extern "C" query_id_t wsrep_thd_wsrep_last_query_id(THD *thd); -+extern "C" void wsrep_thd_set_wsrep_last_query_id(THD *thd, query_id_t id); -+extern "C" void wsrep_thd_awake(THD *thd, my_bool signal); -+extern "C" int wsrep_thd_retry_counter(THD *thd); -+ -+ -+extern void wsrep_close_client_connections(my_bool wait_to_end); -+extern int wsrep_wait_committing_connections_close(int wait_time); -+extern void wsrep_close_applier(THD *thd); -+extern void wsrep_wait_appliers_close(THD *thd); -+extern void wsrep_close_applier_threads(int count); -+extern void wsrep_kill_mysql(THD *thd); -+ -+/* new defines */ -+extern void wsrep_stop_replication(THD *thd); -+extern bool wsrep_start_replication(); -+extern bool wsrep_sync_wait (THD* thd, uint mask = WSREP_SYNC_WAIT_BEFORE_READ); -+extern int wsrep_check_opts (int argc, char* const* argv); -+extern void wsrep_prepend_PATH (const char* path); -+/* some inline functions are defined in wsrep_mysqld_inl.h */ -+ -+/* Other global variables */ -+extern wsrep_seqno_t wsrep_locked_seqno; -+ -+#define WSREP_ON \ -+ (global_system_variables.wsrep_on) -+ -+#define WSREP(thd) \ -+ (WSREP_ON && wsrep && (thd && thd->variables.wsrep_on)) -+ -+#define WSREP_CLIENT(thd) \ -+ (WSREP(thd) && thd->wsrep_client_thread) -+ -+#define WSREP_EMULATE_BINLOG(thd) \ -+ (WSREP(thd) && wsrep_emulate_bin_log) -+ -+// MySQL logging functions don't seem to understand long long length modifer. -+// This is a workaround. It also prefixes all messages with "WSREP" -+#define WSREP_LOG(fun, ...) \ -+ { \ -+ char msg[1024] = {'\0'}; \ -+ snprintf(msg, sizeof(msg) - 1, ## __VA_ARGS__); \ -+ fun("WSREP: %s", msg); \ -+ } -+ -+#define WSREP_DEBUG(...) \ -+ if (wsrep_debug) WSREP_LOG(sql_print_information, ##__VA_ARGS__) -+#define WSREP_INFO(...) WSREP_LOG(sql_print_information, ##__VA_ARGS__) -+#define WSREP_WARN(...) WSREP_LOG(sql_print_warning, ##__VA_ARGS__) -+#define WSREP_ERROR(...) WSREP_LOG(sql_print_error, ##__VA_ARGS__) -+ -+#define WSREP_LOG_CONFLICT_THD(thd, role) \ -+ WSREP_LOG(sql_print_information, \ -+ "%s: \n " \ -+ " THD: %lu, mode: %s, state: %s, conflict: %s, seqno: %lld\n " \ -+ " SQL: %s", \ -+ role, wsrep_thd_thread_id(thd), wsrep_thd_exec_mode_str(thd), \ -+ wsrep_thd_query_state_str(thd), \ -+ wsrep_thd_conflict_state_str(thd), (long long)wsrep_thd_trx_seqno(thd), \ -+ wsrep_thd_query(thd) \ -+ ); -+ -+#define WSREP_LOG_CONFLICT(bf_thd, victim_thd, bf_abort) \ -+ if (wsrep_debug || wsrep_log_conflicts) \ -+ { \ -+ WSREP_LOG(sql_print_information, "cluster conflict due to %s for threads:",\ -+ (bf_abort) ? "high priority abort" : "certification failure" \ -+ ); \ -+ if (bf_thd) WSREP_LOG_CONFLICT_THD(bf_thd, "Winning thread"); \ -+ if (victim_thd) WSREP_LOG_CONFLICT_THD(victim_thd, "Victim thread"); \ -+ } -+ -+extern void wsrep_ready_wait(); -+ -+enum wsrep_trx_status { -+ WSREP_TRX_OK, -+ WSREP_TRX_CERT_FAIL, /* certification failure, must abort */ -+ WSREP_TRX_SIZE_EXCEEDED, /* trx size exceeded */ -+ WSREP_TRX_ERROR, /* native mysql error */ -+}; -+ -+extern enum wsrep_trx_status -+wsrep_run_wsrep_commit(THD *thd, handlerton *hton, bool all); -+class Ha_trx_info; -+struct THD_TRANS; -+void wsrep_register_hton(THD* thd, bool all); -+void wsrep_post_commit(THD* thd, bool all); -+void wsrep_brute_force_killer(THD *thd); -+int wsrep_hire_brute_force_killer(THD *thd, uint64_t trx_id); -+ -+extern "C" bool wsrep_consistency_check(void *thd_ptr); -+ -+/* this is visible for client build so that innodb plugin gets this */ -+typedef struct wsrep_aborting_thd { -+ struct wsrep_aborting_thd *next; -+ THD *aborting_thd; -+} *wsrep_aborting_thd_t; -+ -+extern mysql_mutex_t LOCK_wsrep_ready; -+extern mysql_cond_t COND_wsrep_ready; -+extern mysql_mutex_t LOCK_wsrep_sst; -+extern mysql_cond_t COND_wsrep_sst; -+extern mysql_mutex_t LOCK_wsrep_sst_init; -+extern mysql_cond_t COND_wsrep_sst_init; -+extern mysql_mutex_t LOCK_wsrep_rollback; -+extern mysql_cond_t COND_wsrep_rollback; -+extern int wsrep_replaying; -+extern mysql_mutex_t LOCK_wsrep_replaying; -+extern mysql_cond_t COND_wsrep_replaying; -+extern mysql_mutex_t LOCK_wsrep_slave_threads; -+extern mysql_mutex_t LOCK_wsrep_desync; -+extern wsrep_aborting_thd_t wsrep_aborting_thd; -+extern my_bool wsrep_emulate_bin_log; -+extern int wsrep_to_isolation; -+extern rpl_sidno wsrep_sidno; -+extern my_bool wsrep_preordered_opt; -+#ifdef HAVE_PSI_INTERFACE -+extern PSI_mutex_key key_LOCK_wsrep_ready; -+extern PSI_mutex_key key_COND_wsrep_ready; -+extern PSI_mutex_key key_LOCK_wsrep_sst; -+extern PSI_cond_key key_COND_wsrep_sst; -+extern PSI_mutex_key key_LOCK_wsrep_sst_init; -+extern PSI_cond_key key_COND_wsrep_sst_init; -+extern PSI_mutex_key key_LOCK_wsrep_sst_thread; -+extern PSI_cond_key key_COND_wsrep_sst_thread; -+extern PSI_mutex_key key_LOCK_wsrep_rollback; -+extern PSI_cond_key key_COND_wsrep_rollback; -+extern PSI_mutex_key key_LOCK_wsrep_replaying; -+extern PSI_cond_key key_COND_wsrep_replaying; -+extern PSI_mutex_key key_LOCK_wsrep_slave_threads; -+extern PSI_mutex_key key_LOCK_wsrep_desync; -+#endif /* HAVE_PSI_INTERFACE */ -+struct TABLE_LIST; -+int wsrep_to_isolation_begin(THD *thd, char *db_, char *table_, -+ const TABLE_LIST* table_list); -+void wsrep_to_isolation_end(THD *thd); -+void wsrep_cleanup_transaction(THD *thd); -+int wsrep_to_buf_helper( -+ THD* thd, const char *query, uint query_len, uchar** buf, size_t* buf_len); -+int wsrep_create_sp(THD *thd, uchar** buf, size_t* buf_len); -+int wsrep_create_trigger_query(THD *thd, uchar** buf, size_t* buf_len); -+int wsrep_create_event_query(THD *thd, uchar** buf, size_t* buf_len); -+int wsrep_alter_event_query(THD *thd, uchar** buf, size_t* buf_len); -+ -+struct xid_t; -+void wsrep_get_SE_checkpoint(xid_t*); -+void wsrep_set_SE_checkpoint(xid_t*); -+void wsrep_init_sidno(const wsrep_uuid_t&); -+void wsrep_xid_init(xid_t*, const wsrep_uuid_t*, wsrep_seqno_t); -+const wsrep_uuid_t* wsrep_xid_uuid(const xid_t*); -+wsrep_seqno_t wsrep_xid_seqno(const xid_t*); -+int wsrep_is_wsrep_xid(const void* xid); -+ -+#endif /* WSREP_MYSQLD_H */ -diff --git a/sql/wsrep_notify.cc b/sql/wsrep_notify.cc -new file mode 100644 -index 0000000..0fc76f5 ---- /dev/null -+++ b/sql/wsrep_notify.cc -@@ -0,0 +1,111 @@ -+/* Copyright 2010 Codership Oy -+ -+ 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 */ -+ -+#include -+#include "wsrep_priv.h" -+#include "wsrep_utils.h" -+ -+const char* wsrep_notify_cmd=""; -+ -+static const char* _status_str(wsrep_member_status_t status) -+{ -+ switch (status) -+ { -+ case WSREP_MEMBER_UNDEFINED: return "Undefined"; -+ case WSREP_MEMBER_JOINER: return "Joiner"; -+ case WSREP_MEMBER_DONOR: return "Donor"; -+ case WSREP_MEMBER_JOINED: return "Joined"; -+ case WSREP_MEMBER_SYNCED: return "Synced"; -+ default: return "Error(?)"; -+ } -+} -+ -+void wsrep_notify_status (wsrep_member_status_t status, -+ const wsrep_view_info_t* view) -+{ -+ if (!wsrep_notify_cmd || 0 == strlen(wsrep_notify_cmd)) -+ { -+ WSREP_INFO("wsrep_notify_cmd is not defined, skipping notification."); -+ return; -+ } -+ -+ char cmd_buf[1 << 16]; // this can be long -+ long cmd_len = sizeof(cmd_buf) - 1; -+ char* cmd_ptr = cmd_buf; -+ long cmd_off = 0; -+ -+ cmd_off += snprintf (cmd_ptr + cmd_off, cmd_len - cmd_off, "%s", -+ wsrep_notify_cmd); -+ -+ if (status >= WSREP_MEMBER_UNDEFINED && status < WSREP_MEMBER_ERROR) -+ { -+ cmd_off += snprintf (cmd_ptr + cmd_off, cmd_len - cmd_off, " --status %s", -+ _status_str(status)); -+ } -+ else -+ { -+ /* here we preserve provider error codes */ -+ cmd_off += snprintf (cmd_ptr + cmd_off, cmd_len - cmd_off, -+ " --status 'Error(%d)'", status); -+ } -+ -+ if (0 != view) -+ { -+ char uuid_str[40]; -+ -+ wsrep_uuid_print (&view->state_id.uuid, uuid_str, sizeof(uuid_str)); -+ cmd_off += snprintf (cmd_ptr + cmd_off, cmd_len - cmd_off, -+ " --uuid %s", uuid_str); -+ -+ cmd_off += snprintf (cmd_ptr + cmd_off, cmd_len - cmd_off, -+ " --primary %s", view->view >= 0 ? "yes" : "no"); -+ -+ cmd_off += snprintf (cmd_ptr + cmd_off, cmd_len - cmd_off, -+ " --index %d", view->my_idx); -+ -+ if (view->memb_num) -+ { -+ cmd_off += snprintf (cmd_ptr + cmd_off, cmd_len - cmd_off, " --members"); -+ -+ for (int i = 0; i < view->memb_num; i++) -+ { -+ wsrep_uuid_print (&view->members[i].id, uuid_str, sizeof(uuid_str)); -+ cmd_off += snprintf (cmd_ptr + cmd_off, cmd_len - cmd_off, -+ "%c%s/%s/%s", i > 0 ? ',' : ' ', -+ uuid_str, view->members[i].name, -+ view->members[i].incoming); -+ } -+ } -+ } -+ -+ if (cmd_off == cmd_len) -+ { -+ WSREP_ERROR("Notification buffer too short (%ld). Aborting notification.", -+ cmd_len); -+ return; -+ } -+ -+ wsp::process p(cmd_ptr, "r"); -+ -+ p.wait(); -+ int err = p.error(); -+ -+ if (err) -+ { -+ WSREP_ERROR("Notification command failed: %d (%s): \"%s\"", -+ err, strerror(err), cmd_ptr); -+ } -+} -+ -diff --git a/sql/wsrep_priv.h b/sql/wsrep_priv.h -new file mode 100644 -index 0000000..93640fb ---- /dev/null -+++ b/sql/wsrep_priv.h -@@ -0,0 +1,51 @@ -+/* Copyright 2010 Codership Oy -+ -+ 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 -+ */ -+ -+//! @file declares symbols private to wsrep integration layer -+ -+#ifndef WSREP_PRIV_H -+#define WSREP_PRIV_H -+ -+#include "wsrep_mysqld.h" -+#include "../wsrep/wsrep_api.h" -+ -+#include -+#include -+#include -+ -+void wsrep_ready_set (my_bool x); -+ -+ssize_t wsrep_sst_prepare (void** msg); -+wsrep_cb_status wsrep_sst_donate_cb (void* app_ctx, -+ void* recv_ctx, -+ const void* msg, size_t msg_len, -+ const wsrep_gtid_t* state_id, -+ const char* state, size_t state_len, -+ bool bypass); -+ -+extern wsrep_uuid_t local_uuid; -+extern wsrep_seqno_t local_seqno; -+ -+// a helper function -+void wsrep_sst_received(wsrep_t*, const wsrep_uuid_t*, wsrep_seqno_t, -+ const void*, size_t); -+/*! SST thread signals init thread about sst completion */ -+void wsrep_sst_complete(const wsrep_uuid_t*, wsrep_seqno_t, bool); -+ -+void wsrep_notify_status (wsrep_member_status_t new_status, -+ const wsrep_view_info_t* view = 0); -+ -+#endif /* WSREP_PRIV_H */ -diff --git a/sql/wsrep_sst.cc b/sql/wsrep_sst.cc -new file mode 100644 -index 0000000..ed45674 ---- /dev/null -+++ b/sql/wsrep_sst.cc -@@ -0,0 +1,1102 @@ -+/* Copyright 2008-2012 Codership Oy -+ -+ 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 */ -+ -+#include "wsrep_sst.h" -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include "wsrep_priv.h" -+#include "wsrep_utils.h" -+#include -+#include -+ -+extern const char wsrep_defaults_file[]; -+extern const char wsrep_defaults_group_suffix[]; -+ -+#define WSREP_SST_OPT_ROLE "--role" -+#define WSREP_SST_OPT_ADDR "--address" -+#define WSREP_SST_OPT_AUTH "--auth" -+#define WSREP_SST_OPT_DATA "--datadir" -+#define WSREP_SST_OPT_CONF "--defaults-file" -+#define WSREP_SST_OPT_CONF_SUFFIX "--defaults-group-suffix" -+#define WSREP_SST_OPT_PARENT "--parent" -+#define WSREP_SST_OPT_BINLOG "--binlog" -+ -+// mysqldump-specific options -+#define WSREP_SST_OPT_USER "--user" -+#define WSREP_SST_OPT_PSWD "--password" -+#define WSREP_SST_OPT_HOST "--host" -+#define WSREP_SST_OPT_PORT "--port" -+#define WSREP_SST_OPT_LPORT "--local-port" -+ -+// donor-specific -+#define WSREP_SST_OPT_SOCKET "--socket" -+#define WSREP_SST_OPT_GTID "--gtid" -+#define WSREP_SST_OPT_BYPASS "--bypass" -+ -+#define WSREP_SST_MYSQLDUMP "mysqldump" -+#define WSREP_SST_RSYNC "rsync" -+#define WSREP_SST_SKIP "skip" -+#define WSREP_SST_XTRABACKUP "xtrabackup" -+#define WSREP_SST_XTRABACKUP_V2 "xtrabackup-v2" -+#define WSREP_SST_DEFAULT WSREP_SST_RSYNC -+#define WSREP_SST_ADDRESS_AUTO "AUTO" -+#define WSREP_SST_AUTH_MASK "********" -+ -+const char* wsrep_sst_method = WSREP_SST_DEFAULT; -+const char* wsrep_sst_receive_address = WSREP_SST_ADDRESS_AUTO; -+const char* wsrep_sst_donor = ""; -+ char* wsrep_sst_auth = NULL; -+ -+// container for real auth string -+static const char* sst_auth_real = NULL; -+my_bool wsrep_sst_donor_rejects_queries = FALSE; -+ -+bool wsrep_sst_method_check (sys_var *self, THD* thd, set_var* var) -+{ -+ char buff[FN_REFLEN]; -+ String str(buff, sizeof(buff), system_charset_info), *res; -+ const char* c_str = NULL; -+ -+ if ((res = var->value->val_str(&str)) && -+ (c_str = res->c_ptr()) && -+ strlen(c_str) > 0) -+ return 0; -+ -+ my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), "wsrep_sst_method", c_str ? c_str : "NULL"); -+ return 1; -+} -+ -+bool wsrep_sst_method_update (sys_var *self, THD* thd, enum_var_type type) -+{ -+ return 0; -+} -+ -+static bool sst_receive_address_check (const char* str) -+{ -+ if (!strncasecmp(str, "127.0.0.1", strlen("127.0.0.1")) || -+ !strncasecmp(str, "localhost", strlen("localhost"))) -+ { -+ return 1; -+ } -+ -+ return 0; -+} -+ -+bool wsrep_sst_receive_address_check (sys_var *self, THD* thd, set_var* var) -+{ -+ const char* c_str = var->value->str_value.c_ptr(); -+ -+ if (sst_receive_address_check (c_str)) -+ { -+ my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), "wsrep_sst_receive_address", c_str ? c_str : "NULL"); -+ return 1; -+ } -+ -+ return 0; -+} -+ -+bool wsrep_sst_receive_address_update (sys_var *self, THD* thd, -+ enum_var_type type) -+{ -+ return 0; -+} -+ -+bool wsrep_sst_auth_check (sys_var *self, THD* thd, set_var* var) -+{ -+ return 0; -+} -+static bool sst_auth_real_set (const char* value) -+{ -+ const char* v = strdup (value); -+ -+ if (v) -+ { -+ if (sst_auth_real) free (const_cast(sst_auth_real)); -+ sst_auth_real = v; -+ -+ if (strlen(sst_auth_real)) -+ { -+ if (wsrep_sst_auth) -+ { -+ my_free ((void*)wsrep_sst_auth); -+ wsrep_sst_auth = my_strdup(WSREP_SST_AUTH_MASK, MYF(0)); -+ //strncpy (wsrep_sst_auth, WSREP_SST_AUTH_MASK, -+ // sizeof(wsrep_sst_auth) - 1); -+ } -+ else -+ wsrep_sst_auth = my_strdup (WSREP_SST_AUTH_MASK, MYF(0)); -+ } -+ return 0; -+ } -+ -+ return 1; -+} -+ -+bool wsrep_sst_auth_update (sys_var *self, THD* thd, enum_var_type type) -+{ -+ return sst_auth_real_set (wsrep_sst_auth); -+} -+ -+void wsrep_sst_auth_init (const char* value) -+{ -+ if (wsrep_sst_auth == value) wsrep_sst_auth = NULL; -+ if (value) sst_auth_real_set (value); -+} -+ -+bool wsrep_sst_donor_check (sys_var *self, THD* thd, set_var* var) -+{ -+ return 0; -+} -+ -+bool wsrep_sst_donor_update (sys_var *self, THD* thd, enum_var_type type) -+{ -+ return 0; -+} -+ -+static wsrep_uuid_t cluster_uuid = WSREP_UUID_UNDEFINED; -+ -+bool wsrep_before_SE() -+{ -+ return (wsrep_provider != NULL -+ && strcmp (wsrep_provider, WSREP_NONE) -+ && strcmp (wsrep_sst_method, WSREP_SST_SKIP) -+ && strcmp (wsrep_sst_method, WSREP_SST_MYSQLDUMP)); -+} -+ -+static bool sst_complete = false; -+static bool sst_needed = false; -+ -+void wsrep_sst_grab () -+{ -+ WSREP_INFO("wsrep_sst_grab()"); -+ if (mysql_mutex_lock (&LOCK_wsrep_sst)) abort(); -+ sst_complete = false; -+ mysql_mutex_unlock (&LOCK_wsrep_sst); -+} -+ -+// Wait for end of SST -+bool wsrep_sst_wait () -+{ -+ if (mysql_mutex_lock (&LOCK_wsrep_sst)) abort(); -+ while (!sst_complete) -+ { -+ WSREP_INFO("Waiting for SST to complete."); -+ mysql_cond_wait (&COND_wsrep_sst, &LOCK_wsrep_sst); -+ } -+ -+ if (local_seqno >= 0) -+ { -+ WSREP_INFO("SST complete, seqno: %lld", (long long) local_seqno); -+ } -+ else -+ { -+ WSREP_ERROR("SST failed: %d (%s)", -+ int(-local_seqno), strerror(-local_seqno)); -+ } -+ -+ mysql_mutex_unlock (&LOCK_wsrep_sst); -+ -+ return (local_seqno >= 0); -+} -+ -+// Signal end of SST -+void wsrep_sst_complete (const wsrep_uuid_t* sst_uuid, -+ wsrep_seqno_t sst_seqno, -+ bool needed) -+{ -+ if (mysql_mutex_lock (&LOCK_wsrep_sst)) abort(); -+ if (!sst_complete) -+ { -+ sst_complete = true; -+ sst_needed = needed; -+ local_uuid = *sst_uuid; -+ local_seqno = sst_seqno; -+ mysql_cond_signal (&COND_wsrep_sst); -+ } -+ else -+ { -+ /* This can happen when called from wsrep_synced_cb(). -+ At the moment there is no way to check there -+ if main thread is still waiting for signal, -+ so wsrep_sst_complete() is called from there -+ each time wsrep_ready changes from FALSE -> TRUE. -+ */ -+ WSREP_DEBUG("Nobody is waiting for SST."); -+ } -+ mysql_mutex_unlock (&LOCK_wsrep_sst); -+} -+ -+void wsrep_sst_received (wsrep_t* const wsrep, -+ const wsrep_uuid_t* const uuid, -+ wsrep_seqno_t const seqno, -+ const void* const state, -+ size_t const state_len) -+{ -+ int const rcode(seqno < 0 ? seqno : 0); -+ wsrep_gtid_t const state_id = { -+ *uuid, (rcode ? WSREP_SEQNO_UNDEFINED : seqno) -+ }; -+ wsrep_init_sidno(state_id.uuid); -+ wsrep->sst_received(wsrep, &state_id, state, state_len, rcode); -+} -+ -+// Let applier threads to continue -+void wsrep_sst_continue () -+{ -+ if (sst_needed) -+ { -+ WSREP_INFO("Signalling provider to continue."); -+ wsrep_sst_received (wsrep, &local_uuid, local_seqno, NULL, 0); -+ } -+} -+ -+struct sst_thread_arg -+{ -+ const char* cmd; -+ int err; -+ char* ret_str; -+ mysql_mutex_t lock; -+ mysql_cond_t cond; -+ -+ sst_thread_arg (const char* c) : cmd(c), err(-1), ret_str(0) -+ { -+ mysql_mutex_init(key_LOCK_wsrep_sst_thread, &lock, MY_MUTEX_INIT_FAST); -+ mysql_cond_init(key_COND_wsrep_sst_thread, &cond, NULL); -+ } -+ -+ ~sst_thread_arg() -+ { -+ mysql_cond_destroy (&cond); -+ mysql_mutex_unlock (&lock); -+ mysql_mutex_destroy (&lock); -+ } -+}; -+ -+static int sst_scan_uuid_seqno (const char* str, -+ wsrep_uuid_t* uuid, wsrep_seqno_t* seqno) -+{ -+ int offt = wsrep_uuid_scan (str, strlen(str), uuid); -+ if (offt > 0 && strlen(str) > (unsigned int)offt && ':' == str[offt]) -+ { -+ *seqno = strtoll (str + offt + 1, NULL, 10); -+ if (*seqno != LLONG_MAX || errno != ERANGE) -+ { -+ return 0; -+ } -+ } -+ -+ WSREP_ERROR("Failed to parse uuid:seqno pair: '%s'", str); -+ return EINVAL; -+} -+ -+// get rid of trailing \n -+static char* my_fgets (char* buf, size_t buf_len, FILE* stream) -+{ -+ char* ret= fgets (buf, buf_len, stream); -+ -+ if (ret) -+ { -+ size_t len = strlen(ret); -+ if (len > 0 && ret[len - 1] == '\n') ret[len - 1] = '\0'; -+ } -+ -+ return ret; -+} -+ -+/* -+ Generate opt_binlog_opt_val for sst_donate_other(), sst_prepare_other(). -+ -+ Returns zero on success, negative error code otherwise. -+ -+ String containing binlog name is stored in param ret if binlog is enabled -+ and GTID mode is on, otherwise empty string. Returned string should be -+ freed with my_free(). -+ */ -+static int generate_binlog_opt_val(char** ret) -+{ -+ DBUG_ASSERT(ret); -+ *ret= NULL; -+ if (opt_bin_log && gtid_mode > 0) -+ { -+ assert(opt_bin_logname); -+ *ret= strcmp(opt_bin_logname, "0") ? -+ my_strdup(opt_bin_logname, MYF(0)) : my_strdup("", MYF(0)); -+ } -+ else -+ { -+ *ret= my_strdup("", MYF(0)); -+ } -+ if (!*ret) return -ENOMEM; -+ return 0; -+} -+ -+static void* sst_joiner_thread (void* a) -+{ -+ sst_thread_arg* arg= (sst_thread_arg*) a; -+ int err= 1; -+ -+ { -+ const char magic[] = "ready"; -+ const size_t magic_len = sizeof(magic) - 1; -+ const size_t out_len = 512; -+ char out[out_len]; -+ -+ WSREP_INFO("Running: '%s'", arg->cmd); -+ -+ wsp::process proc (arg->cmd, "r"); -+ -+ if (proc.pipe() && !proc.error()) -+ { -+ const char* tmp= my_fgets (out, out_len, proc.pipe()); -+ -+ if (!tmp || strlen(tmp) < (magic_len + 2) || -+ strncasecmp (tmp, magic, magic_len)) -+ { -+ WSREP_ERROR("Failed to read '%s ' from: %s\n\tRead: '%s'", -+ magic, arg->cmd, tmp); -+ proc.wait(); -+ if (proc.error()) err = proc.error(); -+ } -+ else -+ { -+ err = 0; -+ } -+ } -+ else -+ { -+ err = proc.error(); -+ WSREP_ERROR("Failed to execute: %s : %d (%s)", -+ arg->cmd, err, strerror(err)); -+ } -+ -+ // signal sst_prepare thread with ret code, -+ // it will go on sending SST request -+ mysql_mutex_lock (&arg->lock); -+ if (!err) -+ { -+ arg->ret_str = strdup (out + magic_len + 1); -+ if (!arg->ret_str) err = ENOMEM; -+ } -+ arg->err = -err; -+ mysql_cond_signal (&arg->cond); -+ mysql_mutex_unlock (&arg->lock); //! @note arg is unusable after that. -+ -+ if (err) return NULL; /* lp:808417 - return immediately, don't signal -+ * initializer thread to ensure single thread of -+ * shutdown. */ -+ -+ wsrep_uuid_t ret_uuid = WSREP_UUID_UNDEFINED; -+ wsrep_seqno_t ret_seqno = WSREP_SEQNO_UNDEFINED; -+ -+ // in case of successfull receiver start, wait for SST completion/end -+ char* tmp = my_fgets (out, out_len, proc.pipe()); -+ -+ proc.wait(); -+ err= EINVAL; -+ -+ if (!tmp) -+ { -+ WSREP_ERROR("Failed to read uuid:seqno from joiner script."); -+ if (proc.error()) err = proc.error(); -+ } -+ else -+ { -+ err= sst_scan_uuid_seqno (out, &ret_uuid, &ret_seqno); -+ } -+ -+ if (err) -+ { -+ ret_uuid= WSREP_UUID_UNDEFINED; -+ ret_seqno= -err; -+ } -+ -+ // Tell initializer thread that SST is complete -+ wsrep_sst_complete (&ret_uuid, ret_seqno, true); -+ } -+ -+ return NULL; -+} -+ -+static ssize_t sst_prepare_other (const char* method, -+ const char* addr_in, -+ const char** addr_out) -+{ -+ ssize_t cmd_len= 1024; -+ char cmd_str[1024]; -+ const char* sst_dir= mysql_real_data_home; -+ const char* binlog_opt= ""; -+ char* binlog_opt_val= NULL; -+ -+ int ret; -+ if ((ret= generate_binlog_opt_val(&binlog_opt_val))) -+ { -+ WSREP_ERROR("sst_prepare_other(): generate_binlog_opt_val() failed: %d", -+ ret); -+ return ret; -+ } -+ if (strlen(binlog_opt_val)) binlog_opt= WSREP_SST_OPT_BINLOG; -+ -+ -+ ret= snprintf (cmd_str, cmd_len, -+ "wsrep_sst_%s " -+ WSREP_SST_OPT_ROLE" 'joiner' " -+ WSREP_SST_OPT_ADDR" '%s' " -+ WSREP_SST_OPT_AUTH" '%s' " -+ WSREP_SST_OPT_DATA" '%s' " -+ WSREP_SST_OPT_CONF" '%s' " -+ WSREP_SST_OPT_CONF_SUFFIX" '%s' " -+ WSREP_SST_OPT_PARENT" '%d'" -+ " %s '%s' ", -+ method, addr_in, (sst_auth_real) ? sst_auth_real : "", -+ sst_dir, wsrep_defaults_file, wsrep_defaults_group_suffix, (int)getpid(), -+ binlog_opt, binlog_opt_val); -+ my_free(binlog_opt_val); -+ -+ if (ret < 0 || ret >= cmd_len) -+ { -+ WSREP_ERROR("sst_prepare_other(): snprintf() failed: %d", ret); -+ return (ret < 0 ? ret : -EMSGSIZE); -+ } -+ -+ pthread_t tmp; -+ sst_thread_arg arg(cmd_str); -+ mysql_mutex_lock (&arg.lock); -+ ret = pthread_create (&tmp, NULL, sst_joiner_thread, &arg); -+ if (ret) -+ { -+ WSREP_ERROR("sst_prepare_other(): pthread_create() failed: %d (%s)", -+ ret, strerror(ret)); -+ return ret; -+ } -+ mysql_cond_wait (&arg.cond, &arg.lock); -+ -+ *addr_out= arg.ret_str; -+ -+ if (!arg.err) -+ ret = strlen(*addr_out); -+ else -+ { -+ assert (arg.err < 0); -+ ret = arg.err; -+ } -+ -+ pthread_detach (tmp); -+ -+ return ret; -+} -+ -+extern uint mysqld_port; -+ -+/*! Just tells donor where to send mysqldump */ -+static ssize_t sst_prepare_mysqldump (const char* addr_in, -+ const char** addr_out) -+{ -+ ssize_t ret = strlen (addr_in); -+ -+ if (!strrchr(addr_in, ':')) -+ { -+ ssize_t s = ret + 7; -+ char* tmp = (char*) malloc (s); -+ -+ if (tmp) -+ { -+ ret= snprintf (tmp, s, "%s:%u", addr_in, mysqld_port); -+ -+ if (ret > 0 && ret < s) -+ { -+ *addr_out= tmp; -+ return ret; -+ } -+ if (ret > 0) /* buffer too short */ ret = -EMSGSIZE; -+ free (tmp); -+ } -+ else { -+ ret= -ENOMEM; -+ } -+ -+ WSREP_ERROR ("Could not prepare state transfer request: " -+ "adding default port failed: %zd.", ret); -+ } -+ else { -+ *addr_out= addr_in; -+ } -+ -+ return ret; -+} -+ -+static bool SE_initialized = false; -+ -+ssize_t wsrep_sst_prepare (void** msg) -+{ -+ const ssize_t ip_max= 256; -+ char ip_buf[ip_max]; -+ const char* addr_in= NULL; -+ const char* addr_out= NULL; -+ -+ if (!strcmp(wsrep_sst_method, WSREP_SST_SKIP)) -+ { -+ ssize_t ret = strlen(WSREP_STATE_TRANSFER_TRIVIAL) + 1; -+ *msg = strdup(WSREP_STATE_TRANSFER_TRIVIAL); -+ if (!msg) -+ { -+ WSREP_ERROR("Could not allocate %zd bytes for state request", ret); -+ unireg_abort(1); -+ } -+ return ret; -+ } -+ -+ // Figure out SST address. Common for all SST methods -+ if (wsrep_sst_receive_address && -+ strcmp (wsrep_sst_receive_address, WSREP_SST_ADDRESS_AUTO)) -+ { -+ addr_in= wsrep_sst_receive_address; -+ } -+ else if (wsrep_node_address && strlen(wsrep_node_address)) -+ { -+ const char* const colon= strchr (wsrep_node_address, ':'); -+ if (colon) -+ { -+ ptrdiff_t const len= colon - wsrep_node_address; -+ strncpy (ip_buf, wsrep_node_address, len); -+ ip_buf[len]= '\0'; -+ addr_in= ip_buf; -+ } -+ else -+ { -+ addr_in= wsrep_node_address; -+ } -+ } -+ else -+ { -+ ssize_t ret= wsrep_guess_ip (ip_buf, ip_max); -+ -+ if (ret && ret < ip_max) -+ { -+ addr_in= ip_buf; -+ } -+ else -+ { -+ WSREP_ERROR("Could not prepare state transfer request: " -+ "failed to guess address to accept state transfer at. " -+ "wsrep_sst_receive_address must be set manually."); -+ unireg_abort(1); -+ } -+ } -+ -+ ssize_t addr_len= -ENOSYS; -+ if (!strcmp(wsrep_sst_method, WSREP_SST_MYSQLDUMP)) -+ { -+ addr_len= sst_prepare_mysqldump (addr_in, &addr_out); -+ if (addr_len < 0) unireg_abort(1); -+ } -+ else -+ { -+ /*! A heuristic workaround until we learn how to stop and start engines */ -+ if (SE_initialized) -+ { -+ // we already did SST at initializaiton, now engines are running -+ // sql_print_information() is here because the message is too long -+ // for WSREP_INFO. -+ sql_print_information ("WSREP: " -+ "You have configured '%s' state snapshot transfer method " -+ "which cannot be performed on a running server. " -+ "Wsrep provider won't be able to fall back to it " -+ "if other means of state transfer are unavailable. " -+ "In that case you will need to restart the server.", -+ wsrep_sst_method); -+ *msg = 0; -+ return 0; -+ } -+ -+ addr_len = sst_prepare_other (wsrep_sst_method, addr_in, &addr_out); -+ if (addr_len < 0) -+ { -+ WSREP_ERROR("Failed to prepare for '%s' SST. Unrecoverable.", -+ wsrep_sst_method); -+ unireg_abort(1); -+ } -+ } -+ -+ size_t const method_len(strlen(wsrep_sst_method)); -+ size_t const msg_len (method_len + addr_len + 2 /* + auth_len + 1*/); -+ -+ *msg = malloc (msg_len); -+ if (NULL != *msg) { -+ char* const method_ptr(reinterpret_cast(*msg)); -+ strcpy (method_ptr, wsrep_sst_method); -+ char* const addr_ptr(method_ptr + method_len + 1); -+ strcpy (addr_ptr, addr_out); -+ -+ WSREP_INFO ("Prepared SST request: %s|%s", method_ptr, addr_ptr); -+ } -+ else { -+ WSREP_ERROR("Failed to allocate SST request of size %zu. Can't continue.", -+ msg_len); -+ unireg_abort(1); -+ } -+ -+ if (addr_out != addr_in) /* malloc'ed */ free ((char*)addr_out); -+ -+ return msg_len; -+} -+ -+// helper method for donors -+static int sst_run_shell (const char* cmd_str, int max_tries) -+{ -+ int ret = 0; -+ -+ for (int tries=1; tries <= max_tries; tries++) -+ { -+ wsp::process proc (cmd_str, "r"); -+ -+ if (NULL != proc.pipe()) -+ { -+ proc.wait(); -+ } -+ -+ if ((ret = proc.error())) -+ { -+ WSREP_ERROR("Try %d/%d: '%s' failed: %d (%s)", -+ tries, max_tries, proc.cmd(), ret, strerror(ret)); -+ sleep (1); -+ } -+ else -+ { -+ WSREP_DEBUG("SST script successfully completed."); -+ break; -+ } -+ } -+ -+ return -ret; -+} -+ -+static void sst_reject_queries(my_bool close_conn) -+{ -+ wsrep_ready_set (FALSE); // this will be resotred when donor becomes synced -+ WSREP_INFO("Rejecting client queries for the duration of SST."); -+ if (TRUE == close_conn) wsrep_close_client_connections(FALSE); -+} -+ -+static int sst_mysqldump_check_addr (const char* user, const char* pswd, -+ const char* host, const char* port) -+{ -+ return 0; -+} -+ -+static int sst_donate_mysqldump (const char* addr, -+ const wsrep_uuid_t* uuid, -+ const char* uuid_str, -+ wsrep_seqno_t seqno, -+ bool bypass) -+{ -+ size_t host_len; -+ const char* port = strchr (addr, ':'); -+ -+ if (port) -+ { -+ port += 1; -+ host_len = port - addr; -+ } -+ else -+ { -+ port = ""; -+ host_len = strlen (addr) + 1; -+ } -+ -+ char *host= (char*) malloc(host_len); -+ -+ strncpy (host, addr, host_len - 1); -+ host[host_len - 1] = '\0'; -+ -+ const char* auth = sst_auth_real; -+ const char* pswd = (auth) ? strchr (auth, ':') : NULL; -+ size_t user_len; -+ -+ if (pswd) -+ { -+ pswd += 1; -+ user_len = pswd - auth; -+ } -+ else -+ { -+ pswd = ""; -+ user_len = (auth) ? strlen (auth) + 1 : 1; -+ } -+ -+ char* user= (char*) malloc(user_len); -+ -+ strncpy (user, (auth) ? auth : "", user_len - 1); -+ user[user_len - 1] = '\0'; -+ -+ int ret = sst_mysqldump_check_addr (user, pswd, host, port); -+ if (!ret) -+ { -+ size_t cmd_len= 1024; -+ char cmd_str[1024]; -+ -+ if (!bypass && wsrep_sst_donor_rejects_queries) sst_reject_queries(TRUE); -+ -+ snprintf (cmd_str, cmd_len, -+ "wsrep_sst_mysqldump " -+ WSREP_SST_OPT_USER" '%s' " -+ WSREP_SST_OPT_PSWD" '%s' " -+ WSREP_SST_OPT_HOST" '%s' " -+ WSREP_SST_OPT_PORT" '%s' " -+ WSREP_SST_OPT_LPORT" '%u' " -+ WSREP_SST_OPT_SOCKET" '%s' " -+ WSREP_SST_OPT_CONF" '%s' " -+ WSREP_SST_OPT_GTID" '%s:%lld'" -+ "%s", -+ user, pswd, host, port, mysqld_port, mysqld_unix_port, -+ wsrep_defaults_file, uuid_str, -+ (long long)seqno, bypass ? " "WSREP_SST_OPT_BYPASS : ""); -+ -+ WSREP_DEBUG("Running: '%s'", cmd_str); -+ -+ ret= sst_run_shell (cmd_str, 3); -+ } -+ -+ wsrep_gtid_t const state_id = { *uuid, (ret ? WSREP_SEQNO_UNDEFINED : seqno)}; -+ -+ wsrep->sst_sent (wsrep, &state_id, ret); -+ -+ free(user); -+ free(host); -+ -+ return ret; -+} -+ -+wsrep_seqno_t wsrep_locked_seqno= WSREP_SEQNO_UNDEFINED; -+ -+static int run_sql_command(THD *thd, const char *query) -+{ -+ thd->set_query((char *)query, strlen(query)); -+ -+ Parser_state ps; -+ if (ps.init(thd, thd->query(), thd->query_length())) -+ { -+ WSREP_ERROR("SST query: %s failed", query); -+ return -1; -+ } -+ -+ mysql_parse(thd, thd->query(), thd->query_length(), &ps); -+ if (thd->is_error()) -+ { -+ int const err= thd->get_stmt_da()->sql_errno(); -+ WSREP_WARN ("error executing '%s': %d (%s)%s", -+ query, err, thd->get_stmt_da()->message(), -+ err == ER_UNKNOWN_SYSTEM_VARIABLE ? -+ ". Was mysqld built with --with-innodb-disallow-writes ?" : ""); -+ thd->clear_error(); -+ return -1; -+ } -+ return 0; -+} -+ -+static int sst_flush_tables(THD* thd) -+{ -+ WSREP_INFO("Flushing tables for SST..."); -+ -+ int err; -+ int not_used; -+ if (run_sql_command(thd, "FLUSH TABLES WITH READ LOCK")) -+ { -+ WSREP_ERROR("Failed to flush and lock tables"); -+ err = -1; -+ } -+ else -+ { -+ /* make sure logs are flushed after global read lock acquired */ -+ err= reload_acl_and_cache(thd, REFRESH_ENGINE_LOG | REFRESH_BINARY_LOG, -+ (TABLE_LIST*) 0, ¬_used); -+ } -+ -+ if (err) -+ { -+ WSREP_ERROR("Failed to flush tables: %d (%s)", err, strerror(err)); -+ } -+ else -+ { -+ WSREP_INFO("Tables flushed."); -+ const char base_name[]= "tables_flushed"; -+ ssize_t const full_len= strlen(mysql_real_data_home) + strlen(base_name)+2; -+ char *real_name = (char*) malloc(full_len); -+ sprintf(real_name, "%s/%s", mysql_real_data_home, base_name); -+ char *tmp_name = (char*) malloc(full_len + 4); -+ sprintf(tmp_name, "%s.tmp", real_name); -+ -+ FILE* file= fopen(tmp_name, "w+"); -+ if (0 == file) -+ { -+ err= errno; -+ WSREP_ERROR("Failed to open '%s': %d (%s)", tmp_name, err,strerror(err)); -+ } -+ else -+ { -+ fprintf(file, "%s:%lld\n", -+ wsrep_cluster_state_uuid, (long long)wsrep_locked_seqno); -+ fsync(fileno(file)); -+ fclose(file); -+ if (rename(tmp_name, real_name) == -1) -+ { -+ err= errno; -+ WSREP_ERROR("Failed to rename '%s' to '%s': %d (%s)", -+ tmp_name, real_name, err,strerror(err)); -+ } -+ } -+ free(real_name); -+ free(tmp_name); -+ } -+ -+ return err; -+} -+ -+static void sst_disallow_writes (THD* thd, bool yes) -+{ -+ char query_str[64] = { 0, }; -+ ssize_t const query_max = sizeof(query_str) - 1; -+ snprintf (query_str, query_max, "SET GLOBAL innodb_disallow_writes=%d", -+ yes ? 1 : 0); -+ -+ if (run_sql_command(thd, query_str)) -+ { -+ WSREP_ERROR("Failed to disallow InnoDB writes"); -+ } -+} -+ -+static void* sst_donor_thread (void* a) -+{ -+ sst_thread_arg* arg= (sst_thread_arg*)a; -+ -+ WSREP_INFO("Running: '%s'", arg->cmd); -+ -+ int err= 1; -+ bool locked= false; -+ -+ const char* out= NULL; -+ const size_t out_len= 128; -+ char out_buf[out_len]; -+ -+ wsrep_uuid_t ret_uuid= WSREP_UUID_UNDEFINED; -+ wsrep_seqno_t ret_seqno= WSREP_SEQNO_UNDEFINED; // seqno of complete SST -+ -+ wsp::thd thd(FALSE); // we turn off wsrep_on for this THD so that it can -+ // operate with wsrep_ready == OFF -+ wsp::process proc(arg->cmd, "r"); -+ -+ err= proc.error(); -+ -+/* Inform server about SST script startup and release TO isolation */ -+ mysql_mutex_lock (&arg->lock); -+ arg->err = -err; -+ mysql_cond_signal (&arg->cond); -+ mysql_mutex_unlock (&arg->lock); //! @note arg is unusable after that. -+ -+ if (proc.pipe() && !err) -+ { -+wait_signal: -+ out= my_fgets (out_buf, out_len, proc.pipe()); -+ -+ if (out) -+ { -+ const char magic_flush[]= "flush tables"; -+ const char magic_cont[]= "continue"; -+ const char magic_done[]= "done"; -+ -+ if (!strcasecmp (out, magic_flush)) -+ { -+ err= sst_flush_tables (thd.ptr); -+ if (!err) -+ { -+ sst_disallow_writes (thd.ptr, true); -+ locked= true; -+ goto wait_signal; -+ } -+ } -+ else if (!strcasecmp (out, magic_cont)) -+ { -+ if (locked) -+ { -+ sst_disallow_writes (thd.ptr, false); -+ thd.ptr->global_read_lock.unlock_global_read_lock (thd.ptr); -+ locked= false; -+ } -+ err= 0; -+ goto wait_signal; -+ } -+ else if (!strncasecmp (out, magic_done, strlen(magic_done))) -+ { -+ err= sst_scan_uuid_seqno (out + strlen(magic_done) + 1, -+ &ret_uuid, &ret_seqno); -+ } -+ else -+ { -+ WSREP_WARN("Received unknown signal: '%s'", out); -+ } -+ } -+ else -+ { -+ WSREP_ERROR("Failed to read from: %s", proc.cmd()); -+ proc.wait(); -+ } -+ if (!err && proc.error()) err= proc.error(); -+ } -+ else -+ { -+ WSREP_ERROR("Failed to execute: %s : %d (%s)", -+ proc.cmd(), err, strerror(err)); -+ } -+ -+ if (locked) // don't forget to unlock server before return -+ { -+ sst_disallow_writes (thd.ptr, false); -+ thd.ptr->global_read_lock.unlock_global_read_lock (thd.ptr); -+ } -+ -+ // signal to donor that SST is over -+ struct wsrep_gtid const state_id = { -+ ret_uuid, err ? WSREP_SEQNO_UNDEFINED : ret_seqno -+ }; -+ wsrep->sst_sent (wsrep, &state_id, -err); -+ proc.wait(); -+ -+ return NULL; -+} -+ -+ -+ -+static int sst_donate_other (const char* method, -+ const char* addr, -+ const char* uuid, -+ wsrep_seqno_t seqno, -+ bool bypass) -+{ -+ ssize_t cmd_len = 4096; -+ char cmd_str[4096]; -+ const char* binlog_opt= ""; -+ char* binlog_opt_val= NULL; -+ -+ int ret; -+ if ((ret= generate_binlog_opt_val(&binlog_opt_val))) -+ { -+ WSREP_ERROR("sst_donate_other(): generate_binlog_opt_val() failed: %d",ret); -+ return ret; -+ } -+ if (strlen(binlog_opt_val)) binlog_opt= WSREP_SST_OPT_BINLOG; -+ -+ ret= snprintf (cmd_str, cmd_len, -+ "wsrep_sst_%s " -+ WSREP_SST_OPT_ROLE" 'donor' " -+ WSREP_SST_OPT_ADDR" '%s' " -+ WSREP_SST_OPT_AUTH" '%s' " -+ WSREP_SST_OPT_SOCKET" '%s' " -+ WSREP_SST_OPT_DATA" '%s' " -+ WSREP_SST_OPT_CONF" '%s' " -+ WSREP_SST_OPT_CONF_SUFFIX" '%s' " -+ " %s '%s' " -+ WSREP_SST_OPT_GTID" '%s:%lld'" -+ "%s", -+ method, addr, sst_auth_real, mysqld_unix_port, -+ mysql_real_data_home, wsrep_defaults_file, wsrep_defaults_group_suffix, -+ binlog_opt, binlog_opt_val, -+ uuid, (long long) seqno, -+ bypass ? " "WSREP_SST_OPT_BYPASS : ""); -+ my_free(binlog_opt_val); -+ -+ if (ret < 0 || ret >= cmd_len) -+ { -+ WSREP_ERROR("sst_donate_other(): snprintf() failed: %d", ret); -+ return (ret < 0 ? ret : -EMSGSIZE); -+ } -+ -+ if (!bypass && wsrep_sst_donor_rejects_queries) sst_reject_queries(FALSE); -+ -+ pthread_t tmp; -+ sst_thread_arg arg(cmd_str); -+ mysql_mutex_lock (&arg.lock); -+ ret = pthread_create (&tmp, NULL, sst_donor_thread, &arg); -+ if (ret) -+ { -+ WSREP_ERROR("sst_donate_other(): pthread_create() failed: %d (%s)", -+ ret, strerror(ret)); -+ return ret; -+ } -+ mysql_cond_wait (&arg.cond, &arg.lock); -+ -+ WSREP_INFO("sst_donor_thread signaled with %d", arg.err); -+ return arg.err; -+} -+ -+wsrep_cb_status_t wsrep_sst_donate_cb (void* app_ctx, void* recv_ctx, -+ const void* msg, size_t msg_len, -+ const wsrep_gtid_t* current_gtid, -+ const char* state, size_t state_len, -+ bool bypass) -+{ -+ /* This will be reset when sync callback is called. -+ * Should we set wsrep_ready to FALSE here too? */ -+// wsrep_notify_status(WSREP_MEMBER_DONOR); -+ local_status.set(WSREP_MEMBER_DONOR); -+ -+ const char* method = (char*)msg; -+ size_t method_len = strlen (method); -+ const char* data = method + method_len + 1; -+ -+ char uuid_str[37]; -+ wsrep_uuid_print (¤t_gtid->uuid, uuid_str, sizeof(uuid_str)); -+ -+ int ret; -+ if (!strcmp (WSREP_SST_MYSQLDUMP, method)) -+ { -+ ret = sst_donate_mysqldump(data, ¤t_gtid->uuid, uuid_str, -+ current_gtid->seqno, bypass); -+ } -+ else -+ { -+ ret = sst_donate_other(method, data, uuid_str, current_gtid->seqno,bypass); -+ } -+ -+ return (ret > 0 ? WSREP_CB_SUCCESS : WSREP_CB_FAILURE); -+} -+ -+void wsrep_SE_init_grab() -+{ -+ if (mysql_mutex_lock (&LOCK_wsrep_sst_init)) abort(); -+} -+ -+void wsrep_SE_init_wait() -+{ -+ while (SE_initialized == false) -+ { -+ mysql_cond_wait (&COND_wsrep_sst_init, &LOCK_wsrep_sst_init); -+ } -+ mysql_mutex_unlock (&LOCK_wsrep_sst_init); -+} -+ -+void wsrep_SE_init_done() -+{ -+ mysql_cond_signal (&COND_wsrep_sst_init); -+ mysql_mutex_unlock (&LOCK_wsrep_sst_init); -+} -+ -+void wsrep_SE_initialized() -+{ -+ SE_initialized = true; -+} -diff --git a/sql/wsrep_sst.h b/sql/wsrep_sst.h -new file mode 100644 -index 0000000..b7f0e26 ---- /dev/null -+++ b/sql/wsrep_sst.h -@@ -0,0 +1,40 @@ -+/* Copyright (C) 2013 Codership Oy -+ -+ 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -+ -+#ifndef WSREP_SST_H -+#define WSREP_SST_H -+ -+#include // my_bool -+ -+/* system variables */ -+extern const char* wsrep_sst_method; -+extern const char* wsrep_sst_receive_address; -+extern const char* wsrep_sst_donor; -+extern char* wsrep_sst_auth; -+extern my_bool wsrep_sst_donor_rejects_queries; -+ -+/*! Synchronizes applier thread start with init thread */ -+extern void wsrep_sst_grab(); -+/*! Init thread waits for SST completion */ -+extern bool wsrep_sst_wait(); -+/*! Signals wsrep that initialization is complete, writesets can be applied */ -+extern void wsrep_sst_continue(); -+ -+extern void wsrep_SE_init_grab(); /*! grab init critical section */ -+extern void wsrep_SE_init_wait(); /*! wait for SE init to complete */ -+extern void wsrep_SE_init_done(); /*! signal that SE init is complte */ -+extern void wsrep_SE_initialized(); /*! mark SE initialization complete */ -+ -+#endif /* WSREP_SST_H */ -diff --git a/sql/wsrep_thd.cc b/sql/wsrep_thd.cc -new file mode 100644 -index 0000000..707a8fe ---- /dev/null -+++ b/sql/wsrep_thd.cc -@@ -0,0 +1,576 @@ -+/* Copyright (C) 2013 Codership Oy -+ -+ 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -+ -+#include "wsrep_thd.h" -+ -+#include "transaction.h" -+#include "rpl_rli.h" -+#include "log_event.h" -+#include "sql_parse.h" -+#include "global_threads.h" // LOCK_thread_count, etc. -+#include "sql_base.h" // close_thread_tables() -+#include "mysqld.h" // start_wsrep_THD(); -+ -+static long long wsrep_bf_aborts_counter = 0; -+ -+int wsrep_show_bf_aborts (THD *thd, SHOW_VAR *var, char *buff) -+{ -+ wsrep_local_bf_aborts = my_atomic_load64(&wsrep_bf_aborts_counter); -+ var->type = SHOW_LONGLONG; -+ var->value = (char*)&wsrep_local_bf_aborts; -+ return 0; -+} -+ -+/* must have (&thd->LOCK_wsrep_thd) */ -+void wsrep_client_rollback(THD *thd) -+{ -+ WSREP_DEBUG("client rollback due to BF abort for (%ld), query: %s", -+ thd->thread_id, thd->query()); -+ -+ my_atomic_add64(&wsrep_bf_aborts_counter, 1); -+ -+ thd->wsrep_conflict_state= ABORTING; -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ trans_rollback(thd); -+ -+ if (thd->locked_tables_mode && thd->lock) -+ { -+ WSREP_DEBUG("unlocking tables for BF abort (%ld)", thd->thread_id); -+ thd->locked_tables_list.unlock_locked_tables(thd); -+ thd->variables.option_bits&= ~(OPTION_TABLE_LOCK); -+ } -+ -+ if (thd->global_read_lock.is_acquired()) -+ { -+ WSREP_DEBUG("unlocking GRL for BF abort (%ld)", thd->thread_id); -+ thd->global_read_lock.unlock_global_read_lock(thd); -+ } -+ -+ /* Release transactional metadata locks. */ -+ thd->mdl_context.release_transactional_locks(); -+ -+ /* release explicit MDL locks */ -+ thd->mdl_context.release_explicit_locks(); -+ -+ if (thd->get_binlog_table_maps()) -+ { -+ WSREP_DEBUG("clearing binlog table map for BF abort (%ld)", thd->thread_id); -+ thd->clear_binlog_table_maps(); -+ } -+ mysql_mutex_lock(&thd->LOCK_wsrep_thd); -+ thd->wsrep_conflict_state= ABORTED; -+} -+ -+#define NUMBER_OF_FIELDS_TO_IDENTIFY_COORDINATOR 1 -+#define NUMBER_OF_FIELDS_TO_IDENTIFY_WORKER 2 -+#include "rpl_info_factory.h" -+ -+static Relay_log_info* wsrep_relay_log_init(const char* log_fname) -+{ -+ uint rli_option = INFO_REPOSITORY_DUMMY; -+ Relay_log_info *rli= NULL; -+ rli = Rpl_info_factory::create_rli(rli_option, false); -+ rli->set_rli_description_event( -+ new Format_description_log_event(BINLOG_VERSION)); -+ -+ return (rli); -+ -+#ifdef REMOVED -+ Rpl_info_handler* handler_src= NULL; -+ Rpl_info_handler* handler_dest= NULL; -+ ulong *key_info_idx= NULL; -+ const char *msg= "Failed to allocate memory for the relay log info " -+ "structure"; -+ -+ DBUG_ENTER("Rpl_info_factory::create_rli"); -+ -+ if (!(rli= new Relay_log_info(false -+#ifdef HAVE_PSI_INTERFACE -+ ,&key_relay_log_info_run_lock, -+ &key_relay_log_info_data_lock, -+ &key_relay_log_info_sleep_lock, -+ &key_relay_log_info_data_cond, -+ &key_relay_log_info_start_cond, -+ &key_relay_log_info_stop_cond, -+ &key_relay_log_info_sleep_cond -+#endif /* HAVE_PSI_INTERFACE */ -+ ))) -+ goto err; -+ -+ if (!(key_info_idx= new ulong[NUMBER_OF_FIELDS_TO_IDENTIFY_COORDINATOR])) -+ goto err; -+ key_info_idx[0]= server_id; -+ rli->set_idx_info(key_info_idx, NUMBER_OF_FIELDS_TO_IDENTIFY_COORDINATOR); -+ -+ if(Rpl_info_factory::init_rli_repositories(rli, rli_option, &handler_src, -+ &handler_dest, &msg)) -+ goto err; -+ -+ if (Rpl_info_factory::decide_repository(rli, rli_option, &handler_src, -+ &handler_dest, &msg)) -+ goto err; -+ -+ DBUG_RETURN(rli); -+err: -+ delete handler_src; -+ delete handler_dest; -+ delete []key_info_idx; -+ if (rli) -+ { -+ /* -+ The handler was previously deleted so we need to remove -+ any reference to it. -+ */ -+ rli->set_idx_info(NULL, 0); -+ rli->set_rpl_info_handler(NULL); -+ rli->set_rpl_info_type(INVALID_INFO_REPOSITORY); -+ delete rli; -+ } -+ WSREP_ERROR("Error creating relay log info: %s.", msg); -+ DBUG_RETURN(NULL); -+#endif /* REMOVED */ -+} -+ -+static void wsrep_prepare_bf_thd(THD *thd, struct wsrep_thd_shadow* shadow) -+{ -+ shadow->options = thd->variables.option_bits; -+ shadow->server_status = thd->server_status; -+ shadow->wsrep_exec_mode = thd->wsrep_exec_mode; -+ shadow->vio = thd->net.vio; -+ -+ if (opt_log_slave_updates) -+ thd->variables.option_bits|= OPTION_BIN_LOG; -+ else -+ thd->variables.option_bits&= ~(OPTION_BIN_LOG); -+ -+ if (!thd->wsrep_rli) thd->wsrep_rli= wsrep_relay_log_init("wsrep_relay"); -+ thd->wsrep_rli->info_thd = thd; -+ -+ thd->wsrep_exec_mode= REPL_RECV; -+ thd->net.vio= 0; -+ thd->clear_error(); -+ -+ shadow->tx_isolation = thd->variables.tx_isolation; -+ thd->variables.tx_isolation = ISO_READ_COMMITTED; -+ thd->tx_isolation = ISO_READ_COMMITTED; -+ -+ shadow->db = thd->db; -+ shadow->db_length = thd->db_length; -+ thd->reset_db(NULL, 0); -+} -+ -+static void wsrep_return_from_bf_mode(THD *thd, struct wsrep_thd_shadow* shadow) -+{ -+ thd->variables.option_bits = shadow->options; -+ thd->server_status = shadow->server_status; -+ thd->wsrep_exec_mode = shadow->wsrep_exec_mode; -+ thd->net.vio = shadow->vio; -+ thd->variables.tx_isolation = shadow->tx_isolation; -+ thd->reset_db(shadow->db, shadow->db_length); -+} -+ -+void wsrep_replay_transaction(THD *thd) -+{ -+ /* checking if BF trx must be replayed */ -+ if (thd->wsrep_conflict_state== MUST_REPLAY) { -+ DBUG_ASSERT(wsrep_thd_trx_seqno(thd)); -+ if (thd->wsrep_exec_mode!= REPL_RECV) { -+ if (thd->get_stmt_da()->is_sent()) -+ { -+ WSREP_ERROR("replay issue, thd has reported status already"); -+ } -+ thd->get_stmt_da()->reset_diagnostics_area(); -+ -+ thd->wsrep_conflict_state= REPLAYING; -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ -+ mysql_reset_thd_for_next_command(thd); -+ thd->killed= THD::NOT_KILLED; -+ close_thread_tables(thd); -+ if (thd->locked_tables_mode && thd->lock) -+ { -+ WSREP_DEBUG("releasing table lock for replaying (%ld)", -+ thd->thread_id); -+ thd->locked_tables_list.unlock_locked_tables(thd); -+ thd->variables.option_bits&= ~(OPTION_TABLE_LOCK); -+ } -+ thd->mdl_context.release_transactional_locks(); -+ /* -+ Replaying will call MYSQL_START_STATEMENT when handling -+ BEGIN Query_log_event so end statement must be called before -+ replaying. -+ */ -+ MYSQL_END_STATEMENT(thd->m_statement_psi, thd->get_stmt_da()); -+ thd->m_statement_psi= NULL; -+ thd_proc_info(thd, "wsrep replaying trx"); -+ WSREP_DEBUG("replay trx: %s %lld", -+ thd->query() ? thd->query() : "void", -+ (long long)wsrep_thd_trx_seqno(thd)); -+ struct wsrep_thd_shadow shadow; -+ wsrep_prepare_bf_thd(thd, &shadow); -+ -+ /* From trans_begin() */ -+ thd->variables.option_bits|= OPTION_BEGIN; -+ thd->server_status|= SERVER_STATUS_IN_TRANS; -+ -+ int rcode = wsrep->replay_trx(wsrep, -+ &thd->wsrep_ws_handle, -+ (void *)thd); -+ -+ wsrep_return_from_bf_mode(thd, &shadow); -+ if (thd->wsrep_conflict_state!= REPLAYING) -+ WSREP_WARN("lost replaying mode: %d", thd->wsrep_conflict_state ); -+ -+ mysql_mutex_lock(&thd->LOCK_wsrep_thd); -+ -+ switch (rcode) -+ { -+ case WSREP_OK: -+ thd->wsrep_conflict_state= NO_CONFLICT; -+ wsrep->post_commit(wsrep, &thd->wsrep_ws_handle); -+ WSREP_DEBUG("trx_replay successful for: %ld %llu", -+ thd->thread_id, (long long)thd->real_id); -+ if (thd->get_stmt_da()->is_sent()) -+ { -+ WSREP_WARN("replay ok, thd has reported status"); -+ } -+ else if (thd->get_stmt_da()->is_set()) -+ { -+ if (thd->get_stmt_da()->status() != Diagnostics_area::DA_OK) -+ { -+ WSREP_WARN("replay ok, thd has error status %d", -+ thd->get_stmt_da()->status()); -+ } -+ } -+ else -+ { -+ my_ok(thd); -+ } -+ break; -+ case WSREP_TRX_FAIL: -+ if (thd->get_stmt_da()->is_sent()) -+ { -+ WSREP_ERROR("replay failed, thd has reported status"); -+ } -+ else -+ { -+ WSREP_DEBUG("replay failed, rolling back"); -+ //my_error(ER_LOCK_DEADLOCK, MYF(0), "wsrep aborted transaction"); -+ } -+ thd->wsrep_conflict_state= ABORTED; -+ wsrep->post_rollback(wsrep, &thd->wsrep_ws_handle); -+ break; -+ default: -+ WSREP_ERROR("trx_replay failed for: %d, query: %s", -+ rcode, thd->query() ? thd->query() : "void"); -+ /* we're now in inconsistent state, must abort */ -+ mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ unireg_abort(1); -+ break; -+ } -+ -+ wsrep_cleanup_transaction(thd); -+ -+ mysql_mutex_lock(&LOCK_wsrep_replaying); -+ wsrep_replaying--; -+ WSREP_DEBUG("replaying decreased: %d, thd: %lu", -+ wsrep_replaying, thd->thread_id); -+ mysql_cond_broadcast(&COND_wsrep_replaying); -+ mysql_mutex_unlock(&LOCK_wsrep_replaying); -+ } -+ } -+} -+ -+static void wsrep_replication_process(THD *thd) -+{ -+ int rcode; -+ DBUG_ENTER("wsrep_replication_process"); -+ -+ struct wsrep_thd_shadow shadow; -+ -+ wsrep_prepare_bf_thd(thd, &shadow); -+ -+ /* From trans_begin() */ -+ thd->variables.option_bits|= OPTION_BEGIN; -+ thd->server_status|= SERVER_STATUS_IN_TRANS; -+ -+ rcode = wsrep->recv(wsrep, (void *)thd); -+ DBUG_PRINT("wsrep",("wsrep_repl returned: %d", rcode)); -+ -+ WSREP_INFO("applier thread exiting (code:%d)", rcode); -+ -+ switch (rcode) { -+ case WSREP_OK: -+ case WSREP_NOT_IMPLEMENTED: -+ case WSREP_CONN_FAIL: -+ /* provider does not support slave operations / disconnected from group, -+ * just close applier thread */ -+ break; -+ case WSREP_NODE_FAIL: -+ /* data inconsistency => SST is needed */ -+ /* Note: we cannot just blindly restart replication here, -+ * SST might require server restart if storage engines must be -+ * initialized after SST */ -+ WSREP_ERROR("node consistency compromised, aborting"); -+ wsrep_kill_mysql(thd); -+ break; -+ case WSREP_WARNING: -+ case WSREP_TRX_FAIL: -+ case WSREP_TRX_MISSING: -+ /* these suggests a bug in provider code */ -+ WSREP_WARN("bad return from recv() call: %d", rcode); -+ /* fall through to node shutdown */ -+ case WSREP_FATAL: -+ /* Cluster connectivity is lost. -+ * -+ * If applier was killed on purpose (KILL_CONNECTION), we -+ * avoid mysql shutdown. This is because the killer will then handle -+ * shutdown processing (or replication restarting) -+ */ -+ if (thd->killed != THD::KILL_CONNECTION) -+ { -+ wsrep_kill_mysql(thd); -+ } -+ break; -+ } -+ -+ mysql_mutex_lock(&LOCK_thread_count); -+ wsrep_close_applier(thd); -+ mysql_cond_broadcast(&COND_thread_count); -+ mysql_mutex_unlock(&LOCK_thread_count); -+ -+ TABLE *tmp; -+ while ((tmp = thd->temporary_tables)) -+ { -+ WSREP_WARN("Applier %lu, has temporary tables at exit: %s.%s", -+ thd->thread_id, -+ (tmp->s) ? tmp->s->db.str : "void", -+ (tmp->s) ? tmp->s->table_name.str : "void"); -+ } -+ wsrep_return_from_bf_mode(thd, &shadow); -+ DBUG_VOID_RETURN; -+} -+ -+void wsrep_create_appliers(long threads) -+{ -+ if (!wsrep_connected) -+ { -+ /* see wsrep_replication_start() for the logic */ -+ if (wsrep_cluster_address && strlen(wsrep_cluster_address) && -+ wsrep_provider && strcasecmp(wsrep_provider, "none")) -+ { -+ WSREP_ERROR("Trying to launch slave threads before creating " -+ "connection at '%s'", wsrep_cluster_address); -+ assert(0); -+ } -+ return; -+ } -+ -+ long wsrep_threads=0; -+ pthread_t hThread; -+ while (wsrep_threads++ < threads) { -+ if (pthread_create( -+ &hThread, &connection_attrib, -+ start_wsrep_THD, (void*)wsrep_replication_process)) -+ WSREP_WARN("Can't create thread to manage wsrep replication"); -+ } -+} -+ -+static void wsrep_rollback_process(THD *thd) -+{ -+ DBUG_ENTER("wsrep_rollback_process"); -+ -+ mysql_mutex_lock(&LOCK_wsrep_rollback); -+ wsrep_aborting_thd= NULL; -+ -+ while (thd->killed == THD::NOT_KILLED) { -+ thd_proc_info(thd, "wsrep aborter idle"); -+ thd->mysys_var->current_mutex= &LOCK_wsrep_rollback; -+ thd->mysys_var->current_cond= &COND_wsrep_rollback; -+ -+ mysql_cond_wait(&COND_wsrep_rollback,&LOCK_wsrep_rollback); -+ -+ WSREP_DEBUG("WSREP rollback thread wakes for signal"); -+ -+ mysql_mutex_lock(&thd->mysys_var->mutex); -+ thd_proc_info(thd, "wsrep aborter active"); -+ thd->mysys_var->current_mutex= 0; -+ thd->mysys_var->current_cond= 0; -+ mysql_mutex_unlock(&thd->mysys_var->mutex); -+ -+ /* check for false alarms */ -+ if (!wsrep_aborting_thd) -+ { -+ WSREP_DEBUG("WSREP rollback thread has empty abort queue"); -+ } -+ /* process all entries in the queue */ -+ while (wsrep_aborting_thd) { -+ THD *aborting; -+ wsrep_aborting_thd_t next = wsrep_aborting_thd->next; -+ aborting = wsrep_aborting_thd->aborting_thd; -+ my_free(wsrep_aborting_thd); -+ wsrep_aborting_thd= next; -+ /* -+ * must release mutex, appliers my want to add more -+ * aborting thds in our work queue, while we rollback -+ */ -+ mysql_mutex_unlock(&LOCK_wsrep_rollback); -+ -+ mysql_mutex_lock(&aborting->LOCK_wsrep_thd); -+ if (aborting->wsrep_conflict_state== ABORTED) -+ { -+ WSREP_DEBUG("WSREP, thd already aborted: %llu state: %d", -+ (long long)aborting->real_id, -+ aborting->wsrep_conflict_state); -+ -+ mysql_mutex_unlock(&aborting->LOCK_wsrep_thd); -+ mysql_mutex_lock(&LOCK_wsrep_rollback); -+ continue; -+ } -+ aborting->wsrep_conflict_state= ABORTING; -+ -+ mysql_mutex_unlock(&aborting->LOCK_wsrep_thd); -+ -+ aborting->store_globals(); -+ -+ mysql_mutex_lock(&aborting->LOCK_wsrep_thd); -+ wsrep_client_rollback(aborting); -+ WSREP_DEBUG("WSREP rollbacker aborted thd: (%lu %llu)", -+ aborting->thread_id, (long long)aborting->real_id); -+ mysql_mutex_unlock(&aborting->LOCK_wsrep_thd); -+ -+ mysql_mutex_lock(&LOCK_wsrep_rollback); -+ } -+ } -+ -+ mysql_mutex_unlock(&LOCK_wsrep_rollback); -+ sql_print_information("WSREP: rollbacker thread exiting"); -+ -+ DBUG_PRINT("wsrep",("wsrep rollbacker thread exiting")); -+ DBUG_VOID_RETURN; -+} -+ -+void wsrep_create_rollbacker() -+{ -+ if (wsrep_provider && strcasecmp(wsrep_provider, "none")) -+ { -+ pthread_t hThread; -+ /* create rollbacker */ -+ if (pthread_create( &hThread, &connection_attrib, -+ start_wsrep_THD, (void*)wsrep_rollback_process)) -+ WSREP_WARN("Can't create thread to manage wsrep rollback"); -+ } -+} -+ -+void wsrep_thd_set_PA_safe(void *thd_ptr, my_bool safe) -+{ -+ if (thd_ptr) -+ { -+ THD* thd = (THD*)thd_ptr; -+ thd->wsrep_PA_safe = safe; -+ } -+} -+ -+int wsrep_thd_conflict_state(void *thd_ptr, my_bool sync) -+{ -+ int state = -1; -+ if (thd_ptr) -+ { -+ THD* thd = (THD*)thd_ptr; -+ if (sync) mysql_mutex_lock(&thd->LOCK_wsrep_thd); -+ -+ state = thd->wsrep_conflict_state; -+ if (sync) mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ } -+ return state; -+} -+ -+my_bool wsrep_thd_is_BF(void *thd_ptr, my_bool sync) -+{ -+ my_bool status = FALSE; -+ if (thd_ptr) -+ { -+ THD* thd = (THD*)thd_ptr; -+ if (sync) mysql_mutex_lock(&thd->LOCK_wsrep_thd); -+ -+ status = ((thd->wsrep_exec_mode == REPL_RECV) || -+ (thd->wsrep_exec_mode == TOTAL_ORDER)); -+ if (sync) mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ } -+ return status; -+} -+ -+extern "C" -+my_bool wsrep_thd_is_BF_or_commit(void *thd_ptr, my_bool sync) -+{ -+ bool status = FALSE; -+ if (thd_ptr) -+ { -+ THD* thd = (THD*)thd_ptr; -+ if (sync) mysql_mutex_lock(&thd->LOCK_wsrep_thd); -+ -+ status = ((thd->wsrep_exec_mode == REPL_RECV) || -+ (thd->wsrep_exec_mode == TOTAL_ORDER) || -+ (thd->wsrep_exec_mode == LOCAL_COMMIT)); -+ if (sync) mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ } -+ return status; -+} -+ -+extern "C" -+my_bool wsrep_thd_is_local(void *thd_ptr, my_bool sync) -+{ -+ bool status = FALSE; -+ if (thd_ptr) -+ { -+ THD* thd = (THD*)thd_ptr; -+ if (sync) mysql_mutex_lock(&thd->LOCK_wsrep_thd); -+ -+ status = (thd->wsrep_exec_mode == LOCAL_STATE); -+ if (sync) mysql_mutex_unlock(&thd->LOCK_wsrep_thd); -+ } -+ return status; -+} -+ -+int wsrep_abort_thd(void *bf_thd_ptr, void *victim_thd_ptr, my_bool signal) -+{ -+ THD *victim_thd = (THD *) victim_thd_ptr; -+ THD *bf_thd = (THD *) bf_thd_ptr; -+ DBUG_ENTER("wsrep_abort_thd"); -+ -+ if ( (WSREP(bf_thd) || -+ ( (WSREP_ON || wsrep_OSU_method_options == WSREP_OSU_RSU) && -+ bf_thd->wsrep_exec_mode == TOTAL_ORDER) ) && -+ victim_thd) -+ { -+ WSREP_DEBUG("wsrep_abort_thd, by: %llu, victim: %llu", (bf_thd) ? -+ (long long)bf_thd->real_id : 0, (long long)victim_thd->real_id); -+ ha_wsrep_abort_transaction(bf_thd, victim_thd, signal); -+ } -+ else -+ { -+ WSREP_DEBUG("wsrep_abort_thd not effective: %p %p", bf_thd, victim_thd); -+ } -+ -+ DBUG_RETURN(1); -+} -+ -+int wsrep_thd_in_locking_session(void *thd_ptr) -+{ -+ if (thd_ptr && ((THD *)thd_ptr)->in_lock_tables) { -+ return 1; -+ } -+ return 0; -+} -diff --git a/sql/wsrep_thd.h b/sql/wsrep_thd.h -new file mode 100644 -index 0000000..cbf03e6 ---- /dev/null -+++ b/sql/wsrep_thd.h -@@ -0,0 +1,38 @@ -+/* Copyright (C) 2013 Codership Oy -+ -+ 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -+ -+#ifndef WSREP_THD_H -+#define WSREP_THD_H -+ -+#include "sql_class.h" -+ -+int wsrep_show_bf_aborts (THD *thd, SHOW_VAR *var, char *buff); -+void wsrep_client_rollback(THD *thd); -+void wsrep_replay_transaction(THD *thd); -+void wsrep_create_appliers(long threads); -+void wsrep_create_rollbacker(); -+ -+int wsrep_abort_thd(void *bf_thd_ptr, void *victim_thd_ptr, -+ my_bool signal); -+ -+extern void wsrep_thd_set_PA_safe(void *thd_ptr, my_bool safe); -+extern my_bool wsrep_thd_is_BF(void *thd_ptr, my_bool sync); -+extern int wsrep_thd_conflict_state(void *thd_ptr, my_bool sync); -+//extern "C" my_bool wsrep_thd_is_BF(void *thd_ptr, my_bool sync); -+extern "C" my_bool wsrep_thd_is_BF_or_commit(void *thd_ptr, my_bool sync); -+extern "C" my_bool wsrep_thd_is_local(void *thd_ptr, my_bool sync); -+int wsrep_thd_in_locking_session(void *thd_ptr); -+ -+#endif /* WSREP_THD_H */ -diff --git a/sql/wsrep_utils.cc b/sql/wsrep_utils.cc -new file mode 100644 -index 0000000..2a073ac ---- /dev/null -+++ b/sql/wsrep_utils.cc -@@ -0,0 +1,524 @@ -+/* Copyright 2010 Codership Oy -+ -+ 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 -+ */ -+ -+//! @file some utility functions and classes not directly related to replication -+ -+#ifndef _GNU_SOURCE -+#define _GNU_SOURCE // POSIX_SPAWN_USEVFORK flag -+#endif -+ -+#include "wsrep_utils.h" -+#include "wsrep_mysqld.h" -+ -+#include -+ -+#include // posix_spawn() -+#include // pipe() -+#include // errno -+#include // strerror() -+#include // waitpid() -+#include -+#include -+#include // getaddrinfo() -+ -+#ifdef HAVE_GETIFADDRS -+#include -+#include -+#endif // HAVE_GETIFADDRS -+ -+extern char** environ; // environment variables -+ -+static wsp::string wsrep_PATH; -+ -+void -+wsrep_prepend_PATH (const char* path) -+{ -+ int count = 0; -+ -+ while (environ[count]) -+ { -+ if (strncmp (environ[count], "PATH=", 5)) -+ { -+ count++; -+ continue; -+ } -+ -+ char* const old_path (environ[count]); -+ -+ if (strstr (old_path, path)) return; // path already there -+ -+ size_t const new_path_len(strlen(old_path) + strlen(":") + -+ strlen(path) + 1); -+ -+ char* const new_path (reinterpret_cast(malloc(new_path_len))); -+ -+ if (new_path) -+ { -+ snprintf (new_path, new_path_len, "PATH=%s:%s", path, -+ old_path + strlen("PATH=")); -+ -+ wsrep_PATH.set (new_path); -+ environ[count] = new_path; -+ } -+ else -+ { -+ WSREP_ERROR ("Failed to allocate 'PATH' environment variable " -+ "buffer of size %zu.", new_path_len); -+ } -+ -+ return; -+ } -+ -+ WSREP_ERROR ("Failed to find 'PATH' environment variable. " -+ "State snapshot transfer may not be working."); -+} -+ -+namespace wsp -+{ -+ -+#define PIPE_READ 0 -+#define PIPE_WRITE 1 -+#define STDIN_FD 0 -+#define STDOUT_FD 1 -+ -+#ifndef POSIX_SPAWN_USEVFORK -+# define POSIX_SPAWN_USEVFORK 0 -+#endif -+ -+process::process (const char* cmd, const char* type) -+ : str_(cmd ? strdup(cmd) : strdup("")), io_(NULL), err_(EINVAL), pid_(0) -+{ -+ if (0 == str_) -+ { -+ WSREP_ERROR ("Can't allocate command line of size: %zu", strlen(cmd)); -+ err_ = ENOMEM; -+ return; -+ } -+ -+ if (0 == strlen(str_)) -+ { -+ WSREP_ERROR ("Can't start a process: null or empty command line."); -+ return; -+ } -+ -+ if (NULL == type || (strcmp (type, "w") && strcmp(type, "r"))) -+ { -+ WSREP_ERROR ("type argument should be either \"r\" or \"w\"."); -+ return; -+ } -+ -+ int pipe_fds[2] = { -1, }; -+ if (::pipe(pipe_fds)) -+ { -+ err_ = errno; -+ WSREP_ERROR ("pipe() failed: %d (%s)", err_, strerror(err_)); -+ return; -+ } -+ -+ // which end of pipe will be returned to parent -+ int const parent_end (strcmp(type,"w") ? PIPE_READ : PIPE_WRITE); -+ int const child_end (parent_end == PIPE_READ ? PIPE_WRITE : PIPE_READ); -+ int const close_fd (parent_end == PIPE_READ ? STDOUT_FD : STDIN_FD); -+ -+ char* const pargv[4] = { strdup("sh"), strdup("-c"), strdup(str_), NULL }; -+ if (!(pargv[0] && pargv[1] && pargv[2])) -+ { -+ err_ = ENOMEM; -+ WSREP_ERROR ("Failed to allocate pargv[] array."); -+ goto cleanup_pipe; -+ } -+ -+ posix_spawnattr_t attr; -+ err_ = posix_spawnattr_init (&attr); -+ if (err_) -+ { -+ WSREP_ERROR ("posix_spawnattr_init() failed: %d (%s)", -+ err_, strerror(err_)); -+ goto cleanup_pipe; -+ } -+ -+ /* make sure that no signlas are masked in child process */ -+ sigset_t sigmask_empty; sigemptyset(&sigmask_empty); -+ err_ = posix_spawnattr_setsigmask(&attr, &sigmask_empty); -+ if (err_) -+ { -+ WSREP_ERROR ("posix_spawnattr_setsigmask() failed: %d (%s)", -+ err_, strerror(err_)); -+ goto cleanup_attr; -+ } -+ -+ /* make sure the following signals are not ignored in child process */ -+ sigset_t default_signals; sigemptyset(&default_signals); -+ sigaddset(&default_signals, SIGHUP); -+ sigaddset(&default_signals, SIGINT); -+ sigaddset(&default_signals, SIGQUIT); -+ sigaddset(&default_signals, SIGPIPE); -+ sigaddset(&default_signals, SIGTERM); -+ sigaddset(&default_signals, SIGCHLD); -+ err_ = posix_spawnattr_setsigdefault(&attr, &default_signals); -+ if (err_) -+ { -+ WSREP_ERROR ("posix_spawnattr_setsigdefault() failed: %d (%s)", -+ err_, strerror(err_)); -+ goto cleanup_attr; -+ } -+ -+ err_ = posix_spawnattr_setflags (&attr, POSIX_SPAWN_SETSIGDEF | -+ POSIX_SPAWN_SETSIGMASK | -+ /* start a new process group */ POSIX_SPAWN_SETPGROUP | -+ POSIX_SPAWN_USEVFORK); -+ if (err_) -+ { -+ WSREP_ERROR ("posix_spawnattr_setflags() failed: %d (%s)", -+ err_, strerror(err_)); -+ goto cleanup_attr; -+ } -+ -+ posix_spawn_file_actions_t fact; -+ err_ = posix_spawn_file_actions_init (&fact); -+ if (err_) -+ { -+ WSREP_ERROR ("posix_spawn_file_actions_init() failed: %d (%s)", -+ err_, strerror(err_)); -+ goto cleanup_attr; -+ } -+ -+ // close child's stdout|stdin depending on what we returning -+ err_ = posix_spawn_file_actions_addclose (&fact, close_fd); -+ if (err_) -+ { -+ WSREP_ERROR ("posix_spawn_file_actions_addclose() failed: %d (%s)", -+ err_, strerror(err_)); -+ goto cleanup_fact; -+ } -+ -+ // substitute our pipe descriptor in place of the closed one -+ err_ = posix_spawn_file_actions_adddup2 (&fact, -+ pipe_fds[child_end], close_fd); -+ if (err_) -+ { -+ WSREP_ERROR ("posix_spawn_file_actions_addup2() failed: %d (%s)", -+ err_, strerror(err_)); -+ goto cleanup_fact; -+ } -+ -+ err_ = posix_spawnp (&pid_, pargv[0], &fact, &attr, pargv, environ); -+ if (err_) -+ { -+ WSREP_ERROR ("posix_spawnp(%s) failed: %d (%s)", -+ pargv[2], err_, strerror(err_)); -+ pid_ = 0; // just to make sure it was not messed up in the call -+ goto cleanup_fact; -+ } -+ -+ io_ = fdopen (pipe_fds[parent_end], type); -+ -+ if (io_) -+ { -+ pipe_fds[parent_end] = -1; // skip close on cleanup -+ } -+ else -+ { -+ err_ = errno; -+ WSREP_ERROR ("fdopen() failed: %d (%s)", err_, strerror(err_)); -+ } -+ -+cleanup_fact: -+ int err; // to preserve err_ code -+ err = posix_spawn_file_actions_destroy (&fact); -+ if (err) -+ { -+ WSREP_ERROR ("posix_spawn_file_actions_destroy() failed: %d (%s)\n", -+ err, strerror(err)); -+ } -+ -+cleanup_attr: -+ err = posix_spawnattr_destroy (&attr); -+ if (err) -+ { -+ WSREP_ERROR ("posix_spawnattr_destroy() failed: %d (%s)", -+ err, strerror(err)); -+ } -+ -+cleanup_pipe: -+ if (pipe_fds[0] >= 0) close (pipe_fds[0]); -+ if (pipe_fds[1] >= 0) close (pipe_fds[1]); -+ -+ free (pargv[0]); -+ free (pargv[1]); -+ free (pargv[2]); -+} -+ -+process::~process () -+{ -+ if (io_) -+ { -+ assert (pid_); -+ assert (str_); -+ -+ WSREP_WARN("Closing pipe to child process: %s, PID(%ld) " -+ "which might still be running.", str_, (long)pid_); -+ -+ if (fclose (io_) == -1) -+ { -+ err_ = errno; -+ WSREP_ERROR("fclose() failed: %d (%s)", err_, strerror(err_)); -+ } -+ } -+ -+ if (str_) free (const_cast(str_)); -+} -+ -+int -+process::wait () -+{ -+ if (pid_) -+ { -+ int status; -+ if (-1 == waitpid(pid_, &status, 0)) -+ { -+ err_ = errno; assert (err_); -+ WSREP_ERROR("Waiting for process failed: %s, PID(%ld): %d (%s)", -+ str_, (long)pid_, err_, strerror (err_)); -+ } -+ else -+ { // command completed, check exit status -+ if (WIFEXITED (status)) { -+ err_ = WEXITSTATUS (status); -+ } -+ else { // command didn't complete with exit() -+ WSREP_ERROR("Process was aborted."); -+ err_ = errno ? errno : ECHILD; -+ } -+ -+ if (err_) { -+ switch (err_) /* Translate error codes to more meaningful */ -+ { -+ case 126: err_ = EACCES; break; /* Permission denied */ -+ case 127: err_ = ENOENT; break; /* No such file or directory */ -+ } -+ WSREP_ERROR("Process completed with error: %s: %d (%s)", -+ str_, err_, strerror(err_)); -+ } -+ -+ pid_ = 0; -+ if (io_) fclose (io_); -+ io_ = NULL; -+ } -+ } -+ else { -+ assert (NULL == io_); -+ WSREP_ERROR("Command did not run: %s", str_); -+ } -+ -+ return err_; -+} -+ -+thd::thd (my_bool won) : init(), ptr(new THD) -+{ -+ if (ptr) -+ { -+ ptr->thread_stack= (char*) &ptr; -+ ptr->store_globals(); -+ ptr->variables.option_bits&= ~OPTION_BIN_LOG; // disable binlog -+ ptr->variables.wsrep_on = won; -+ ptr->security_ctx->master_access= ~(ulong)0; -+ lex_start(ptr); -+ } -+} -+ -+thd::~thd () -+{ -+ if (ptr) -+ { -+ delete ptr; -+ my_pthread_setspecific_ptr (THR_THD, 0); -+ } -+} -+ -+} // namespace wsp -+ -+/* Returns INADDR_NONE, INADDR_ANY, INADDR_LOOPBACK or something else */ -+unsigned int wsrep_check_ip (const char* const addr) -+{ -+ if (addr && 0 == strcasecmp(addr, MY_BIND_ALL_ADDRESSES)) return INADDR_ANY; -+ -+ unsigned int ret = INADDR_NONE; -+ struct addrinfo *res, hints; -+ -+ memset (&hints, 0, sizeof(hints)); -+ hints.ai_flags= AI_PASSIVE/*|AI_ADDRCONFIG*/; -+ hints.ai_socktype= SOCK_STREAM; -+ hints.ai_family= AF_UNSPEC; -+ -+ int gai_ret = getaddrinfo(addr, NULL, &hints, &res); -+ if (0 == gai_ret) -+ { -+ if (AF_INET == res->ai_family) /* IPv4 */ -+ { -+ struct sockaddr_in* a= (struct sockaddr_in*)res->ai_addr; -+ ret= htonl(a->sin_addr.s_addr); -+ } -+ else /* IPv6 */ -+ { -+ struct sockaddr_in6* a= (struct sockaddr_in6*)res->ai_addr; -+ if (IN6_IS_ADDR_UNSPECIFIED(&a->sin6_addr)) -+ ret= INADDR_ANY; -+ else if (IN6_IS_ADDR_LOOPBACK(&a->sin6_addr)) -+ ret= INADDR_LOOPBACK; -+ else -+ ret= 0xdeadbeef; -+ } -+ freeaddrinfo (res); -+ } -+ else { -+ WSREP_ERROR ("getaddrinfo() failed on '%s': %d (%s)", -+ addr, gai_ret, gai_strerror(gai_ret)); -+ } -+ -+ // uint8_t* b= (uint8_t*)&ret; -+ // fprintf (stderr, "########## wsrep_check_ip returning: %hhu.%hhu.%hhu.%hhu\n", -+ // b[0], b[1], b[2], b[3]); -+ -+ return ret; -+} -+ -+size_t wsrep_guess_ip (char* buf, size_t buf_len) -+{ -+ size_t ip_len = 0; -+ -+ if (my_bind_addr_str && my_bind_addr_str[0] != '\0') -+ { -+ unsigned int const ip_type= wsrep_check_ip(my_bind_addr_str); -+ -+ if (INADDR_NONE == ip_type) { -+ WSREP_ERROR("Networking not configured, cannot receive state transfer."); -+ return 0; -+ } -+ -+ if (INADDR_ANY != ip_type) { -+ strncpy (buf, my_bind_addr_str, buf_len); -+ return strlen(buf); -+ } -+ } -+ -+ // mysqld binds to all interfaces - try IP from wsrep_node_address -+ if (wsrep_node_address && wsrep_node_address[0] != '\0') { -+ const char* const colon_ptr = strchr(wsrep_node_address, ':'); -+ -+ if (colon_ptr) -+ ip_len = colon_ptr - wsrep_node_address; -+ else -+ ip_len = strlen(wsrep_node_address); -+ -+ if (ip_len >= buf_len) { -+ WSREP_WARN("default_ip(): buffer too short: %zu <= %zd", buf_len, ip_len); -+ return 0; -+ } -+ -+ memcpy (buf, wsrep_node_address, ip_len); -+ buf[ip_len] = '\0'; -+ return ip_len; -+ } -+ -+ -+// -+// getifaddrs() is avaiable at least on Linux since glib 2.3, FreeBSD -+// MAC OS X, opensolaris, Solaris. -+// -+// On platforms which do not support getifaddrs() this function returns -+// a failure and user is prompted to do manual configuration. -+// -+#if HAVE_GETIFADDRS -+ struct ifaddrs *ifaddr, *ifa; -+ if (getifaddrs(&ifaddr) == 0) -+ { -+ for (ifa= ifaddr; ifa != NULL; ifa = ifa->ifa_next) -+ { -+ if (!ifa->ifa_addr || ifa->ifa_addr->sa_family != AF_INET) // TODO AF_INET6 -+ continue; -+ -+ // Skip loopback interfaces (like lo:127.0.0.1) -+ if (ifa->ifa_flags & IFF_LOOPBACK) -+ continue; -+ -+ if (vio_getnameinfo(ifa->ifa_addr, buf, buf_len, NULL, 0, NI_NUMERICHOST)) -+ continue; -+ -+ freeifaddrs(ifaddr); -+ return strlen(buf); -+ } -+ freeifaddrs(ifaddr); -+ } -+#endif // HAVE_GETIFADDRS -+ -+ return 0; -+} -+ -+/* -+ * WSREPXid -+ */ -+ -+#define WSREP_XID_PREFIX "WSREPXid" -+#define WSREP_XID_PREFIX_LEN MYSQL_XID_PREFIX_LEN -+#define WSREP_XID_UUID_OFFSET 8 -+#define WSREP_XID_SEQNO_OFFSET (WSREP_XID_UUID_OFFSET + sizeof(wsrep_uuid_t)) -+#define WSREP_XID_GTRID_LEN (WSREP_XID_SEQNO_OFFSET + sizeof(wsrep_seqno_t)) -+ -+void wsrep_xid_init(XID* xid, const wsrep_uuid_t* uuid, wsrep_seqno_t seqno) -+{ -+ xid->formatID= 1; -+ xid->gtrid_length= WSREP_XID_GTRID_LEN; -+ xid->bqual_length= 0; -+ memset(xid->data, 0, sizeof(xid->data)); -+ memcpy(xid->data, WSREP_XID_PREFIX, WSREP_XID_PREFIX_LEN); -+ memcpy(xid->data + WSREP_XID_UUID_OFFSET, uuid, sizeof(wsrep_uuid_t)); -+ memcpy(xid->data + WSREP_XID_SEQNO_OFFSET, &seqno, sizeof(wsrep_seqno_t)); -+} -+ -+const wsrep_uuid_t* wsrep_xid_uuid(const XID* xid) -+{ -+ if (wsrep_is_wsrep_xid(xid)) -+ return reinterpret_cast(xid->data -+ + WSREP_XID_UUID_OFFSET); -+ else -+ return &WSREP_UUID_UNDEFINED; -+} -+ -+wsrep_seqno_t wsrep_xid_seqno(const XID* xid) -+{ -+ -+ if (wsrep_is_wsrep_xid(xid)) -+ { -+ wsrep_seqno_t seqno; -+ memcpy(&seqno, xid->data + WSREP_XID_SEQNO_OFFSET, sizeof(wsrep_seqno_t)); -+ return seqno; -+ } -+ else -+ { -+ return WSREP_SEQNO_UNDEFINED; -+ } -+} -+ -+extern -+int wsrep_is_wsrep_xid(const void* xid_ptr) -+{ -+ const XID* xid= reinterpret_cast(xid_ptr); -+ return (xid->formatID == 1 && -+ xid->gtrid_length == WSREP_XID_GTRID_LEN && -+ xid->bqual_length == 0 && -+ !memcmp(xid->data, WSREP_XID_PREFIX, WSREP_XID_PREFIX_LEN)); -+} -diff --git a/sql/wsrep_utils.h b/sql/wsrep_utils.h -new file mode 100644 -index 0000000..dfb68bc ---- /dev/null -+++ b/sql/wsrep_utils.h -@@ -0,0 +1,207 @@ -+/* Copyright (C) 2013 Codership Oy -+ -+ 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -+ -+#ifndef WSREP_UTILS_H -+#define WSREP_UTILS_H -+ -+#include "wsrep_priv.h" -+ -+unsigned int wsrep_check_ip (const char* addr); -+size_t wsrep_guess_ip (char* buf, size_t buf_len); -+ -+namespace wsp { -+class node_status -+{ -+public: -+ node_status() : status(WSREP_MEMBER_UNDEFINED) {} -+ void set(wsrep_member_status_t new_status, -+ const wsrep_view_info_t* view = 0) -+ { -+ if (status != new_status || 0 != view) -+ { -+ wsrep_notify_status(new_status, view); -+ status = new_status; -+ } -+ } -+ wsrep_member_status_t get() const { return status; } -+private: -+ wsrep_member_status_t status; -+}; -+} /* namespace wsp */ -+ -+extern wsp::node_status local_status; -+ -+namespace wsp { -+/* A small class to run external programs. */ -+class process -+{ -+private: -+ const char* const str_; -+ FILE* io_; -+ int err_; -+ pid_t pid_; -+ -+public: -+/*! @arg type is a pointer to a null-terminated string which must contain -+ either the letter 'r' for reading or the letter 'w' for writing. -+ */ -+ process (const char* cmd, const char* type); -+ ~process (); -+ -+ FILE* pipe () { return io_; } -+ int error() { return err_; } -+ int wait (); -+ const char* cmd() { return str_; } -+}; -+ -+class thd -+{ -+ class thd_init -+ { -+ public: -+ thd_init() { my_thread_init(); } -+ ~thd_init() { my_thread_end(); } -+ } -+ init; -+ -+ thd (const thd&); -+ thd& operator= (const thd&); -+ -+public: -+ -+ thd(my_bool wsrep_on); -+ ~thd(); -+ THD* const ptr; -+}; -+ -+class string -+{ -+public: -+ string() : string_(0) {} -+ void set(char* str) { if (string_) free (string_); string_ = str; } -+ ~string() { set (0); } -+private: -+ char* string_; -+}; -+ -+#ifdef REMOVED -+class lock -+{ -+ pthread_mutex_t* const mtx_; -+ -+public: -+ -+ lock (pthread_mutex_t* mtx) : mtx_(mtx) -+ { -+ int err = pthread_mutex_lock (mtx_); -+ -+ if (err) -+ { -+ WSREP_ERROR("Mutex lock failed: %s", strerror(err)); -+ abort(); -+ } -+ } -+ -+ virtual ~lock () -+ { -+ int err = pthread_mutex_unlock (mtx_); -+ -+ if (err) -+ { -+ WSREP_ERROR("Mutex unlock failed: %s", strerror(err)); -+ abort(); -+ } -+ } -+ -+ inline void wait (pthread_cond_t* cond) -+ { -+ pthread_cond_wait (cond, mtx_); -+ } -+ -+private: -+ -+ lock (const lock&); -+ lock& operator=(const lock&); -+ -+}; -+ -+class monitor -+{ -+ int mutable refcnt; -+ pthread_mutex_t mutable mtx; -+ pthread_cond_t mutable cond; -+ -+public: -+ -+ monitor() : refcnt(0) -+ { -+ pthread_mutex_init (&mtx, NULL); -+ pthread_cond_init (&cond, NULL); -+ } -+ -+ ~monitor() -+ { -+ pthread_mutex_destroy (&mtx); -+ pthread_cond_destroy (&cond); -+ } -+ -+ void enter() const -+ { -+ lock l(&mtx); -+ -+ while (refcnt) -+ { -+ l.wait(&cond); -+ } -+ refcnt++; -+ } -+ -+ void leave() const -+ { -+ lock l(&mtx); -+ -+ refcnt--; -+ if (refcnt == 0) -+ { -+ pthread_cond_signal (&cond); -+ } -+ } -+ -+private: -+ -+ monitor (const monitor&); -+ monitor& operator= (const monitor&); -+}; -+ -+class critical -+{ -+ const monitor& mon; -+ -+public: -+ -+ critical(const monitor& m) : mon(m) { mon.enter(); } -+ -+ ~critical() { mon.leave(); } -+ -+private: -+ -+ critical (const critical&); -+ critical& operator= (const critical&); -+}; -+#endif -+ -+} // namespace wsrep -+ -+#endif /* WSREP_UTILS_H */ -diff --git a/sql/wsrep_var.cc b/sql/wsrep_var.cc -new file mode 100644 -index 0000000..0eea405 ---- /dev/null -+++ b/sql/wsrep_var.cc -@@ -0,0 +1,628 @@ -+/* Copyright 2008 Codership Oy -+ -+ 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 */ -+ -+#include "wsrep_var.h" -+ -+#include -+#include -+#include -+#include -+#include -+#include "wsrep_priv.h" -+#include "wsrep_thd.h" -+#include -+#include -+#include -+ -+#define WSREP_START_POSITION_ZERO "00000000-0000-0000-0000-000000000000:-1" -+#define WSREP_CLUSTER_NAME "my_wsrep_cluster" -+ -+const char* wsrep_provider = 0; -+const char* wsrep_provider_options = 0; -+const char* wsrep_cluster_address = 0; -+const char* wsrep_cluster_name = 0; -+const char* wsrep_node_name = 0; -+const char* wsrep_node_address = 0; -+const char* wsrep_node_incoming_address = 0; -+const char* wsrep_start_position = 0; -+ulong wsrep_OSU_method_options; -+ -+int wsrep_init_vars() -+{ -+ wsrep_provider = my_strdup(WSREP_NONE, MYF(MY_WME)); -+ wsrep_provider_options= my_strdup("", MYF(MY_WME)); -+ wsrep_cluster_address = my_strdup("", MYF(MY_WME)); -+ wsrep_cluster_name = my_strdup(WSREP_CLUSTER_NAME, MYF(MY_WME)); -+ wsrep_node_name = my_strdup("", MYF(MY_WME)); -+ wsrep_node_address = my_strdup("", MYF(MY_WME)); -+ wsrep_node_incoming_address= my_strdup(WSREP_NODE_INCOMING_AUTO, MYF(MY_WME)); -+ wsrep_start_position = my_strdup(WSREP_START_POSITION_ZERO, MYF(MY_WME)); -+ -+ global_system_variables.binlog_format=BINLOG_FORMAT_ROW; -+ return 0; -+} -+ -+bool wsrep_on_update (sys_var *self, THD* thd, enum_var_type var_type) -+{ -+ if (var_type == OPT_GLOBAL) { -+ // FIXME: this variable probably should be changed only per session -+ thd->variables.wsrep_on = global_system_variables.wsrep_on; -+ } -+ return false; -+} -+ -+bool wsrep_causal_reads_update (sys_var *self, THD* thd, enum_var_type var_type) -+{ -+ // global setting should not affect session setting. -+ // if (var_type == OPT_GLOBAL) { -+ // thd->variables.wsrep_causal_reads = global_system_variables.wsrep_causal_reads; -+ // } -+ if (thd->variables.wsrep_causal_reads) { -+ thd->variables.wsrep_sync_wait |= WSREP_SYNC_WAIT_BEFORE_READ; -+ } else { -+ thd->variables.wsrep_sync_wait &= ~WSREP_SYNC_WAIT_BEFORE_READ; -+ } -+ -+ // update global settings too. -+ if (global_system_variables.wsrep_causal_reads) { -+ global_system_variables.wsrep_sync_wait |= WSREP_SYNC_WAIT_BEFORE_READ; -+ } else { -+ global_system_variables.wsrep_sync_wait &= ~WSREP_SYNC_WAIT_BEFORE_READ; -+ } -+ return false; -+} -+ -+bool wsrep_sync_wait_update (sys_var* self, THD* thd, enum_var_type var_type) -+{ -+ // global setting should not affect session setting. -+ // if (var_type == OPT_GLOBAL) { -+ // thd->variables.wsrep_sync_wait = global_system_variables.wsrep_sync_wait; -+ // } -+ thd->variables.wsrep_causal_reads = thd->variables.wsrep_sync_wait & -+ WSREP_SYNC_WAIT_BEFORE_READ; -+ -+ // update global settings too -+ global_system_variables.wsrep_causal_reads = global_system_variables.wsrep_sync_wait & -+ WSREP_SYNC_WAIT_BEFORE_READ; -+ return false; -+} -+ -+static int wsrep_start_position_verify (const char* start_str) -+{ -+ size_t start_len; -+ wsrep_uuid_t uuid; -+ ssize_t uuid_len; -+ -+ start_len = strlen (start_str); -+ if (start_len < 34) -+ return 1; -+ -+ uuid_len = wsrep_uuid_scan (start_str, start_len, &uuid); -+ if (uuid_len < 0 || (start_len - uuid_len) < 2) -+ return 1; -+ -+ if (start_str[uuid_len] != ':') // separator should follow UUID -+ return 1; -+ -+ char* endptr; -+ wsrep_seqno_t const seqno __attribute__((unused)) // to avoid GCC warnings -+ (strtoll(&start_str[uuid_len + 1], &endptr, 10)); -+ -+ if (*endptr == '\0') return 0; // remaining string was seqno -+ -+ return 1; -+} -+ -+bool wsrep_start_position_check (sys_var *self, THD* thd, set_var* var) -+{ -+ char buff[FN_REFLEN]; -+ String str(buff, sizeof(buff), system_charset_info), *res; -+ const char* start_str = NULL; -+ -+ if (!(res = var->value->val_str(&str))) goto err; -+ -+ start_str = res->c_ptr(); -+ -+ if (!start_str) goto err; -+ -+ if (!wsrep_start_position_verify(start_str)) return 0; -+ -+err: -+ -+ my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->var->name.str, -+ start_str ? start_str : "NULL"); -+ return 1; -+} -+ -+void wsrep_set_local_position (const char* value) -+{ -+ size_t value_len = strlen (value); -+ size_t uuid_len = wsrep_uuid_scan (value, value_len, &local_uuid); -+ -+ local_seqno = strtoll (value + uuid_len + 1, NULL, 10); -+ -+ XID xid; -+ wsrep_xid_init(&xid, &local_uuid, local_seqno); -+ wsrep_set_SE_checkpoint(&xid); -+ WSREP_INFO ("wsrep_start_position var submitted: '%s'", wsrep_start_position); -+} -+ -+bool wsrep_start_position_update (sys_var *self, THD* thd, enum_var_type type) -+{ -+ // since this value passed wsrep_start_position_check, don't check anything -+ // here -+ wsrep_set_local_position (wsrep_start_position); -+ -+ if (wsrep) { -+ wsrep_sst_received (wsrep, &local_uuid, local_seqno, NULL, 0); -+ } -+ -+ return 0; -+} -+ -+void wsrep_start_position_init (const char* val) -+{ -+ if (NULL == val || wsrep_start_position_verify (val)) -+ { -+ WSREP_ERROR("Bad initial value for wsrep_start_position: %s", -+ (val ? val : "")); -+ return; -+ } -+ -+ wsrep_set_local_position (val); -+} -+ -+static bool refresh_provider_options() -+{ -+ WSREP_DEBUG("refresh_provider_options: %s", -+ (wsrep_provider_options) ? wsrep_provider_options : "null"); -+ char* opts= wsrep->options_get(wsrep); -+ if (opts) -+ { -+ if (wsrep_provider_options) my_free((void *)wsrep_provider_options); -+ wsrep_provider_options = (char*)my_memdup(opts, strlen(opts) + 1, -+ MYF(MY_WME)); -+ } -+ else -+ { -+ WSREP_ERROR("Failed to get provider options"); -+ return true; -+ } -+ return false; -+} -+ -+static int wsrep_provider_verify (const char* provider_str) -+{ -+ MY_STAT f_stat; -+ char path[FN_REFLEN]; -+ -+ if (!provider_str || strlen(provider_str)== 0) -+ return 1; -+ -+ if (!strcmp(provider_str, WSREP_NONE)) -+ return 0; -+ -+ if (!unpack_filename(path, provider_str)) -+ return 1; -+ -+ /* check that provider file exists */ -+ memset(&f_stat, 0, sizeof(MY_STAT)); -+ if (!my_stat(path, &f_stat, MYF(0))) -+ { -+ return 1; -+ } -+ return 0; -+} -+ -+bool wsrep_provider_check (sys_var *self, THD* thd, set_var* var) -+{ -+ char buff[FN_REFLEN]; -+ String str(buff, sizeof(buff), system_charset_info), *res; -+ const char* provider_str = NULL; -+ -+ if (!(res = var->value->val_str(&str))) goto err; -+ -+ provider_str = res->c_ptr(); -+ -+ if (!provider_str) goto err; -+ -+ if (!wsrep_provider_verify(provider_str)) return 0; -+ -+err: -+ -+ my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->var->name.str, -+ provider_str ? provider_str : "NULL"); -+ return 1; -+} -+ -+bool wsrep_provider_update (sys_var *self, THD* thd, enum_var_type type) -+{ -+ bool rcode= false; -+ -+ bool wsrep_on_saved= thd->variables.wsrep_on; -+ thd->variables.wsrep_on= false; -+ -+ WSREP_DEBUG("wsrep_provider_update: %s", wsrep_provider); -+ -+ /* stop replication is heavy operation, and includes closing all client -+ connections. Closing clients may need to get LOCK_global_system_variables -+ at least in MariaDB. -+ -+ Note: releasing LOCK_global_system_variables may cause race condition, if -+ there can be several concurrent clients changing wsrep_provider -+ */ -+ mysql_mutex_unlock(&LOCK_global_system_variables); -+ wsrep_stop_replication(thd); -+ mysql_mutex_lock(&LOCK_global_system_variables); -+ -+ wsrep_deinit(); -+ -+ char* tmp= strdup(wsrep_provider); // wsrep_init() rewrites provider -+ //when fails -+ if (wsrep_init()) -+ { -+ my_error(ER_CANT_OPEN_LIBRARY, MYF(0), tmp); -+ rcode = true; -+ } -+ free(tmp); -+ -+ // we sure don't want to use old address with new provider -+ wsrep_cluster_address_init(NULL); -+ wsrep_provider_options_init(NULL); -+ -+ thd->variables.wsrep_on= wsrep_on_saved; -+ -+ refresh_provider_options(); -+ -+ return rcode; -+} -+ -+void wsrep_provider_init (const char* value) -+{ -+ WSREP_DEBUG("wsrep_provider_init: %s -> %s", -+ (wsrep_provider) ? wsrep_provider : "null", -+ (value) ? value : "null"); -+ if (NULL == value || wsrep_provider_verify (value)) -+ { -+ WSREP_ERROR("Bad initial value for wsrep_provider: %s", -+ (value ? value : "")); -+ return; -+ } -+ -+ if (wsrep_provider) my_free((void *)wsrep_provider); -+ wsrep_provider = my_strdup(value, MYF(0)); -+} -+ -+bool wsrep_provider_options_check(sys_var *self, THD* thd, set_var* var) -+{ -+ return 0; -+} -+ -+bool wsrep_provider_options_update(sys_var *self, THD* thd, enum_var_type type) -+{ -+ wsrep_status_t ret= wsrep->options_set(wsrep, wsrep_provider_options); -+ if (ret != WSREP_OK) -+ { -+ WSREP_ERROR("Set options returned %d", ret); -+ refresh_provider_options(); -+ return true; -+ } -+ return refresh_provider_options(); -+} -+ -+void wsrep_provider_options_init(const char* value) -+{ -+ if (wsrep_provider_options && wsrep_provider_options != value) -+ my_free((void *)wsrep_provider_options); -+ wsrep_provider_options = (value) ? my_strdup(value, MYF(0)) : NULL; -+} -+ -+static int wsrep_cluster_address_verify (const char* cluster_address_str) -+{ -+ /* There is no predefined address format, it depends on provider. */ -+ return 0; -+} -+ -+bool wsrep_cluster_address_check (sys_var *self, THD* thd, set_var* var) -+{ -+ char buff[FN_REFLEN]; -+ String str(buff, sizeof(buff), system_charset_info), *res; -+ const char* cluster_address_str = NULL; -+ -+ if (!(res = var->value->val_str(&str))) goto err; -+ -+ cluster_address_str = res->c_ptr(); -+ -+ if (!wsrep_cluster_address_verify(cluster_address_str)) return 0; -+ -+ err: -+ -+ my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->var->name.str, -+ cluster_address_str ? cluster_address_str : "NULL"); -+ return 1 ; -+} -+ -+bool wsrep_cluster_address_update (sys_var *self, THD* thd, enum_var_type type) -+{ -+ bool wsrep_on_saved= thd->variables.wsrep_on; -+ thd->variables.wsrep_on= false; -+ -+ /* stop replication is heavy operation, and includes closing all client -+ connections. Closing clients may need to get LOCK_global_system_variables -+ at least in MariaDB. -+ -+ Note: releasing LOCK_global_system_variables may cause race condition, if -+ there can be several concurrent clients changing wsrep_provider -+ */ -+ mysql_mutex_unlock(&LOCK_global_system_variables); -+ wsrep_stop_replication(thd); -+ mysql_mutex_lock(&LOCK_global_system_variables); -+ -+ if (wsrep_start_replication()) -+ { -+ wsrep_create_rollbacker(); -+ wsrep_create_appliers(wsrep_slave_threads); -+ } -+ -+ thd->variables.wsrep_on= wsrep_on_saved; -+ -+ return false; -+} -+ -+void wsrep_cluster_address_init (const char* value) -+{ -+ WSREP_DEBUG("wsrep_cluster_address_init: %s -> %s", -+ (wsrep_cluster_address) ? wsrep_cluster_address : "null", -+ (value) ? value : "null"); -+ -+ if (wsrep_cluster_address) my_free ((void*)wsrep_cluster_address); -+ wsrep_cluster_address = (value) ? my_strdup(value, MYF(0)) : NULL; -+} -+ -+bool wsrep_cluster_name_check (sys_var *self, THD* thd, set_var* var) -+{ -+ char buff[FN_REFLEN]; -+ String str(buff, sizeof(buff), system_charset_info), *res; -+ const char* cluster_name_str = NULL; -+ -+ if (!(res = var->value->val_str(&str))) goto err; -+ -+ cluster_name_str = res->c_ptr(); -+ -+ if (!cluster_name_str || strlen(cluster_name_str) == 0) goto err; -+ -+ return 0; -+ -+ err: -+ -+ my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->var->name.str, -+ cluster_name_str ? cluster_name_str : "NULL"); -+ return 1; -+} -+ -+bool wsrep_cluster_name_update (sys_var *self, THD* thd, enum_var_type type) -+{ -+ return 0; -+} -+ -+bool wsrep_node_name_check (sys_var *self, THD* thd, set_var* var) -+{ -+ char buff[FN_REFLEN]; -+ String str(buff, sizeof(buff), system_charset_info), *res; -+ const char* node_name_str = NULL; -+ -+ if (!(res = var->value->val_str(&str))) goto err; -+ -+ node_name_str = res->c_ptr(); -+ -+ if (!node_name_str || strlen(node_name_str) == 0) goto err; -+ -+ return 0; -+ -+ err: -+ -+ my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->var->name.str, -+ node_name_str ? node_name_str : "NULL"); -+ return 1; -+} -+ -+bool wsrep_node_name_update (sys_var *self, THD* thd, enum_var_type type) -+{ -+ return 0; -+} -+ -+// TODO: do something more elaborate, like checking connectivity -+bool wsrep_node_address_check (sys_var *self, THD* thd, set_var* var) -+{ -+ char buff[FN_REFLEN]; -+ String str(buff, sizeof(buff), system_charset_info), *res; -+ const char* node_address_str = NULL; -+ -+ if (!(res = var->value->val_str(&str))) goto err; -+ -+ node_address_str = res->c_ptr(); -+ -+ if (!node_address_str || strlen(node_address_str) == 0) goto err; -+ -+ return 0; -+ -+ err: -+ -+ my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->var->name.str, -+ node_address_str ? node_address_str : "NULL"); -+ return 1; -+} -+ -+bool wsrep_node_address_update (sys_var *self, THD* thd, enum_var_type type) -+{ -+ return 0; -+} -+ -+void wsrep_node_address_init (const char* value) -+{ -+ if (wsrep_node_address && strcmp(wsrep_node_address, value)) -+ my_free ((void*)wsrep_node_address); -+ -+ wsrep_node_address = (value) ? my_strdup(value, MYF(0)) : NULL; -+} -+ -+bool wsrep_slave_threads_check (sys_var *self, THD* thd, set_var* var) -+{ -+ mysql_mutex_lock(&LOCK_wsrep_slave_threads); -+ wsrep_slave_count_change = var->value->val_int() - wsrep_slave_threads; -+ mysql_mutex_unlock(&LOCK_wsrep_slave_threads); -+ -+ return 0; -+} -+ -+bool wsrep_slave_threads_update (sys_var *self, THD* thd, enum_var_type type) -+{ -+ if (wsrep_slave_count_change > 0) -+ { -+ wsrep_create_appliers(wsrep_slave_count_change); -+ wsrep_slave_count_change = 0; -+ } -+ return false; -+} -+ -+bool wsrep_desync_check (sys_var *self, THD* thd, set_var* var) -+{ -+ bool new_wsrep_desync = var->value->val_bool(); -+ if (wsrep_desync == new_wsrep_desync) { -+ if (new_wsrep_desync) { -+ push_warning (thd, Sql_condition::WARN_LEVEL_WARN, -+ ER_WRONG_VALUE_FOR_VAR, -+ "'wsrep_desync' is already ON."); -+ } else { -+ push_warning (thd, Sql_condition::WARN_LEVEL_WARN, -+ ER_WRONG_VALUE_FOR_VAR, -+ "'wsrep_desync' is already OFF."); -+ } -+ } -+ return 0; -+} -+ -+bool wsrep_desync_update (sys_var *self, THD* thd, enum_var_type type) -+{ -+ wsrep_status_t ret(WSREP_WARNING); -+ if (wsrep_desync) { -+ ret = wsrep->desync (wsrep); -+ if (ret != WSREP_OK) { -+ WSREP_WARN ("SET desync failed %d for %s", ret, thd->query()); -+ my_error (ER_CANNOT_USER, MYF(0), "'desync'", thd->query()); -+ return true; -+ } -+ } else { -+ ret = wsrep->resync (wsrep); -+ if (ret != WSREP_OK) { -+ WSREP_WARN ("SET resync failed %d for %s", ret, thd->query()); -+ my_error (ER_CANNOT_USER, MYF(0), "'resync'", thd->query()); -+ return true; -+ } -+ } -+ return false; -+} -+ -+/* -+ * Status variables stuff below -+ */ -+static inline void -+wsrep_assign_to_mysql (SHOW_VAR* mysql, wsrep_stats_var* wsrep) -+{ -+ mysql->name = wsrep->name; -+ switch (wsrep->type) { -+ case WSREP_VAR_INT64: -+ mysql->value = (char*) &wsrep->value._int64; -+ mysql->type = SHOW_LONGLONG; -+ break; -+ case WSREP_VAR_STRING: -+ mysql->value = (char*) &wsrep->value._string; -+ mysql->type = SHOW_CHAR_PTR; -+ break; -+ case WSREP_VAR_DOUBLE: -+ mysql->value = (char*) &wsrep->value._double; -+ mysql->type = SHOW_DOUBLE; -+ break; -+ } -+} -+ -+#if DYNAMIC -+// somehow this mysql status thing works only with statically allocated arrays. -+static SHOW_VAR* mysql_status_vars = NULL; -+static int mysql_status_len = -1; -+#else -+static SHOW_VAR mysql_status_vars[512 + 1]; -+static const int mysql_status_len = 512; -+#endif -+ -+static void export_wsrep_status_to_mysql(THD* thd) -+{ -+ int wsrep_status_len, i; -+ -+ thd->wsrep_status_vars = wsrep->stats_get(wsrep); -+ -+ if (!thd->wsrep_status_vars) { -+ return; -+ } -+ -+ for (wsrep_status_len = 0; -+ thd->wsrep_status_vars[wsrep_status_len].name != NULL; -+ wsrep_status_len++) { -+ /* */ -+ } -+ -+#if DYNAMIC -+ if (wsrep_status_len != mysql_status_len) { -+ void* tmp = realloc (mysql_status_vars, -+ (wsrep_status_len + 1) * sizeof(SHOW_VAR)); -+ if (!tmp) { -+ -+ sql_print_error ("Out of memory for wsrep status variables." -+ "Number of variables: %d", wsrep_status_len); -+ return; -+ } -+ -+ mysql_status_len = wsrep_status_len; -+ mysql_status_vars = (SHOW_VAR*)tmp; -+ } -+ /* @TODO: fix this: */ -+#else -+ if (mysql_status_len < wsrep_status_len) wsrep_status_len= mysql_status_len; -+#endif -+ -+ for (i = 0; i < wsrep_status_len; i++) -+ wsrep_assign_to_mysql (mysql_status_vars + i, thd->wsrep_status_vars + i); -+ -+ mysql_status_vars[wsrep_status_len].name = NullS; -+ mysql_status_vars[wsrep_status_len].value = NullS; -+ mysql_status_vars[wsrep_status_len].type = SHOW_LONG; -+} -+ -+int wsrep_show_status (THD *thd, SHOW_VAR *var, char *buff) -+{ -+ export_wsrep_status_to_mysql(thd); -+ var->type= SHOW_ARRAY; -+ var->value= (char *) &mysql_status_vars; -+ return 0; -+} -+ -+void wsrep_free_status (THD* thd) -+{ -+ if (thd->wsrep_status_vars) -+ { -+ wsrep->stats_free (wsrep, thd->wsrep_status_vars); -+ thd->wsrep_status_vars = 0; -+ } -+} -diff --git a/sql/wsrep_var.h b/sql/wsrep_var.h -new file mode 100644 -index 0000000..d845987 ---- /dev/null -+++ b/sql/wsrep_var.h -@@ -0,0 +1,84 @@ -+/* Copyright (C) 2013 Codership Oy -+ -+ 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -+ -+#ifndef WSREP_VAR_H -+#define WSREP_VAR_H -+ -+#define WSREP_NODE_INCOMING_AUTO "AUTO" -+ -+// MySQL variables funcs -+ -+#include "sql_priv.h" -+class sys_var; -+class set_var; -+class THD; -+ -+int wsrep_init_vars(); -+ -+#define CHECK_ARGS (sys_var *self, THD* thd, set_var *var) -+#define UPDATE_ARGS (sys_var *self, THD* thd, enum_var_type type) -+#define DEFAULT_ARGS (THD* thd, enum_var_type var_type) -+#define INIT_ARGS (const char* opt) -+ -+extern bool wsrep_on_update UPDATE_ARGS; -+extern bool wsrep_causal_reads_update UPDATE_ARGS; -+extern bool wsrep_sync_wait_update UPDATE_ARGS; -+extern bool wsrep_start_position_check CHECK_ARGS; -+extern bool wsrep_start_position_update UPDATE_ARGS; -+extern void wsrep_start_position_init INIT_ARGS; -+ -+extern bool wsrep_provider_check CHECK_ARGS; -+extern bool wsrep_provider_update UPDATE_ARGS; -+extern void wsrep_provider_init INIT_ARGS; -+ -+extern bool wsrep_provider_options_check CHECK_ARGS; -+extern bool wsrep_provider_options_update UPDATE_ARGS; -+extern void wsrep_provider_options_init INIT_ARGS; -+ -+extern bool wsrep_cluster_address_check CHECK_ARGS; -+extern bool wsrep_cluster_address_update UPDATE_ARGS; -+extern void wsrep_cluster_address_init INIT_ARGS; -+ -+extern bool wsrep_cluster_name_check CHECK_ARGS; -+extern bool wsrep_cluster_name_update UPDATE_ARGS; -+ -+extern bool wsrep_node_name_check CHECK_ARGS; -+extern bool wsrep_node_name_update UPDATE_ARGS; -+ -+extern bool wsrep_node_address_check CHECK_ARGS; -+extern bool wsrep_node_address_update UPDATE_ARGS; -+extern void wsrep_node_address_init INIT_ARGS; -+ -+extern bool wsrep_sst_method_check CHECK_ARGS; -+extern bool wsrep_sst_method_update UPDATE_ARGS; -+extern void wsrep_sst_method_init INIT_ARGS; -+ -+extern bool wsrep_sst_receive_address_check CHECK_ARGS; -+extern bool wsrep_sst_receive_address_update UPDATE_ARGS; -+ -+extern bool wsrep_sst_auth_check CHECK_ARGS; -+extern bool wsrep_sst_auth_update UPDATE_ARGS; -+extern void wsrep_sst_auth_init INIT_ARGS; -+ -+extern bool wsrep_sst_donor_check CHECK_ARGS; -+extern bool wsrep_sst_donor_update UPDATE_ARGS; -+ -+extern bool wsrep_slave_threads_check CHECK_ARGS; -+extern bool wsrep_slave_threads_update UPDATE_ARGS; -+ -+extern bool wsrep_desync_check CHECK_ARGS; -+extern bool wsrep_desync_update UPDATE_ARGS; -+ -+#endif /* WSREP_VAR_H */ -diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc -index 1611fb6..392c9e3 100644 ---- a/storage/innobase/btr/btr0cur.cc -+++ b/storage/innobase/btr/btr0cur.cc -@@ -2946,7 +2946,9 @@ btr_cur_del_mark_set_clust_rec( - #endif /* UNIV_DEBUG */ - - ut_ad(dict_index_is_clust(index)); -+#ifndef WITH_WSREP - ut_ad(!rec_get_deleted_flag(rec, rec_offs_comp(offsets))); -+#endif - - err = lock_clust_rec_modify_check_and_lock(BTR_NO_LOCKING_FLAG, block, - rec, index, offsets, thr); -diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc -index 8045389..fb5dcae 100644 ---- a/storage/innobase/dict/dict0dict.cc -+++ b/storage/innobase/dict/dict0dict.cc -@@ -3347,7 +3347,29 @@ dict_foreign_find_index( - - return(NULL); - } -- -+#ifdef WITH_WSREP -+dict_index_t* -+wsrep_dict_foreign_find_index( -+/*====================*/ -+ dict_table_t* table, /*!< in: table */ -+ const char** col_names, /*!< in: column names, or NULL -+ to use table->col_names */ -+ const char** columns,/*!< in: array of column names */ -+ ulint n_cols, /*!< in: number of columns */ -+ dict_index_t* types_idx, /*!< in: NULL or an index to whose types the -+ column types must match */ -+ ibool check_charsets, -+ /*!< in: whether to check charsets. -+ only has an effect if types_idx != NULL */ -+ ulint check_null) -+ /*!< in: nonzero if none of the columns must -+ be declared NOT NULL */ -+{ -+ return dict_foreign_find_index( -+ table, col_names, columns, n_cols, types_idx, check_charsets, -+ check_null); -+} -+#endif /* WITH_WSREP */ - /**********************************************************************//** - Report an error in a foreign key definition. */ - static -diff --git a/storage/innobase/fts/fts0opt.cc b/storage/innobase/fts/fts0opt.cc -index 5891b53..2e2bd06 100644 ---- a/storage/innobase/fts/fts0opt.cc -+++ b/storage/innobase/fts/fts0opt.cc -@@ -2577,6 +2577,8 @@ fts_optimize_add_table( - return; - } - -+ ut_ad(table->cached && table->fts != NULL); -+ - /* Make sure table with FTS index cannot be evicted */ - if (table->can_be_evicted) { - dict_table_move_from_lru_to_non_lru(table); -diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc -index b8f6351..b54ab75 100644 ---- a/storage/innobase/handler/ha_innodb.cc -+++ b/storage/innobase/handler/ha_innodb.cc -@@ -95,6 +95,9 @@ this program; if not, write to the Free Software Foundation, Inc., - #include "fts0priv.h" - #include "page0zip.h" - -+#ifdef WITH_WSREP -+#include "dict0priv.h" -+#endif /* WITH_WSREP */ - enum_tx_isolation thd_get_trx_isolation(const THD* thd); - - #include "ha_innodb.h" -@@ -103,6 +106,35 @@ enum_tx_isolation thd_get_trx_isolation(const THD* thd); - # ifndef MYSQL_PLUGIN_IMPORT - # define MYSQL_PLUGIN_IMPORT /* nothing */ - # endif /* MYSQL_PLUGIN_IMPORT */ -+#ifdef WITH_WSREP -+#include "../storage/innobase/include/ut0byte.h" -+#include -+#include -+extern my_bool wsrep_certify_nonPK; -+class binlog_trx_data; -+extern handlerton *binlog_hton; -+ -+extern MYSQL_PLUGIN_IMPORT mysql_mutex_t LOCK_wsrep_rollback; -+extern MYSQL_PLUGIN_IMPORT mysql_cond_t COND_wsrep_rollback; -+extern MYSQL_PLUGIN_IMPORT wsrep_aborting_thd_t wsrep_aborting_thd; -+ -+static inline wsrep_ws_handle_t* -+wsrep_ws_handle(THD* thd, const trx_t* trx) { -+ return wsrep_ws_handle_for_trx(wsrep_thd_ws_handle(thd), -+ (wsrep_trx_id_t)trx->id); -+} -+ -+extern bool wsrep_prepare_key_for_innodb(const uchar *cache_key, -+ size_t cache_key_len, -+ const uchar* row_id, -+ size_t row_id_len, -+ wsrep_buf_t* key, -+ size_t* key_len); -+ -+extern handlerton * wsrep_hton; -+extern TC_LOG* tc_log; -+extern void wsrep_cleanup_transaction(THD *thd); -+#endif /* WITH_WSREP */ - - /** to protect innobase_open_files */ - static mysql_mutex_t innobase_share_mutex; -@@ -1152,6 +1184,10 @@ innobase_srv_conc_enter_innodb( - /*===========================*/ - trx_t* trx) /*!< in: transaction handle */ - { -+#ifdef WITH_WSREP -+ if (wsrep_on(trx->mysql_thd) && -+ wsrep_thd_is_BF(trx->mysql_thd, FALSE)) return; -+#endif /* WITH_WSREP */ - if (srv_thread_concurrency) { - if (trx->n_tickets_to_enter_innodb > 0) { - -@@ -1186,6 +1222,10 @@ innobase_srv_conc_exit_innodb( - #ifdef UNIV_SYNC_DEBUG - ut_ad(!sync_thread_levels_nonempty_trx(trx->has_search_latch)); - #endif /* UNIV_SYNC_DEBUG */ -+#ifdef WITH_WSREP -+ if (wsrep_on(trx->mysql_thd) && -+ wsrep_thd_is_BF(trx->mysql_thd, FALSE)) return; -+#endif /* WITH_WSREP */ - - /* This is to avoid making an unnecessary function call. */ - if (trx->declared_to_be_inside_innodb -@@ -1306,6 +1346,15 @@ thd_to_trx( - { - return(*(trx_t**) thd_ha_data(thd, innodb_hton_ptr)); - } -+#ifdef WITH_WSREP -+ulonglong -+thd_to_trx_id( -+/*=======*/ -+ THD* thd) /*!< in: MySQL thread */ -+{ -+ return(thd_to_trx(thd)->id); -+} -+#endif - - /********************************************************************//** - Call this function when mysqld passes control to the client. That is to -@@ -1335,6 +1384,15 @@ innobase_release_temporary_latches( - return(0); - } - -+#ifdef WITH_WSREP -+static int -+wsrep_abort_transaction(handlerton* hton, THD *bf_thd, THD *victim_thd, -+ my_bool signal); -+static void -+wsrep_fake_trx_id(handlerton* hton, THD *thd); -+static int innobase_wsrep_set_checkpoint(handlerton* hton, const XID* xid); -+static int innobase_wsrep_get_checkpoint(handlerton* hton, XID* xid); -+#endif - /********************************************************************//** - Increments innobase_active_counter and every INNOBASE_WAKE_INTERVALth - time calls srv_active_wake_master_thread. This function should be used -@@ -1800,6 +1858,9 @@ int - innobase_mysql_tmpfile(void) - /*========================*/ - { -+#ifdef WITH_INNODB_DISALLOW_WRITES -+ os_event_wait(srv_allow_writes_event); -+#endif /* WITH_INNODB_DISALLOW_WRITES */ - int fd2 = -1; - File fd; - -@@ -2844,6 +2905,12 @@ innobase_init( - innobase_release_temporary_latches; - - innobase_hton->data = &innodb_api_cb; -+#ifdef WITH_WSREP -+ innobase_hton->wsrep_abort_transaction=wsrep_abort_transaction; -+ innobase_hton->wsrep_set_checkpoint=innobase_wsrep_set_checkpoint; -+ innobase_hton->wsrep_get_checkpoint=innobase_wsrep_get_checkpoint; -+ innobase_hton->wsrep_fake_trx_id=wsrep_fake_trx_id; -+#endif /* WITH_WSREP */ - - ut_a(DATA_MYSQL_TRUE_VARCHAR == (ulint)MYSQL_TYPE_VARCHAR); - -@@ -3407,10 +3474,30 @@ innobase_commit_low( - /*================*/ - trx_t* trx) /*!< in: transaction handle */ - { -+#ifdef WITH_WSREP -+ THD* thd = (THD*)trx->mysql_thd; -+ const char* tmp = 0; -+ if (wsrep_on((void*)thd)) { -+#ifdef WSREP_PROC_INFO -+ char info[64]; -+ info[sizeof(info) - 1] = '\0'; -+ snprintf(info, sizeof(info) - 1, -+ "innobase_commit_low():trx_commit_for_mysql(%lld)", -+ (long long) wsrep_thd_trx_seqno(thd)); -+ tmp = thd_proc_info(thd, info); -+ -+#else -+ tmp = thd_proc_info(thd, "innobase_commit_low()"); -+#endif /* WSREP_PROC_INFO */ -+ } -+#endif /* WITH_WSREP */ - if (trx_is_started(trx)) { - - trx_commit_for_mysql(trx); - } -+#ifdef WITH_WSREP -+ if (wsrep_on((void*)thd)) { thd_proc_info(thd, tmp); } -+#endif /* WITH_WSREP */ - } - - /*****************************************************************//** -@@ -4063,7 +4150,11 @@ ha_innobase::max_supported_key_length() const - case 8192: - return(1536); - default: -+#ifdef WITH_WSREP -+ return(3500); -+#else - return(3500); -+#endif - } - } - -@@ -5163,6 +5254,112 @@ get_field_offset( - { - return((uint) (field->ptr - table->record[0])); - } -+#ifdef WITH_WSREP -+UNIV_INTERN -+int -+wsrep_innobase_mysql_sort( -+/*===============*/ -+ /* out: str contains sort string */ -+ int mysql_type, /* in: MySQL type */ -+ uint charset_number, /* in: number of the charset */ -+ unsigned char* str, /* in: data field */ -+ unsigned int str_length, /* in: data field length, -+ not UNIV_SQL_NULL */ -+ unsigned int buf_length) /* in: total str buffer length */ -+ -+{ -+ CHARSET_INFO* charset; -+ enum_field_types mysql_tp; -+ int ret_length = str_length; -+ -+ DBUG_ASSERT(str_length != UNIV_SQL_NULL); -+ -+ mysql_tp = (enum_field_types) mysql_type; -+ -+ switch (mysql_tp) { -+ -+ case MYSQL_TYPE_BIT: -+ case MYSQL_TYPE_STRING: -+ case MYSQL_TYPE_VAR_STRING: -+ case MYSQL_TYPE_TINY_BLOB: -+ case MYSQL_TYPE_MEDIUM_BLOB: -+ case MYSQL_TYPE_BLOB: -+ case MYSQL_TYPE_LONG_BLOB: -+ case MYSQL_TYPE_VARCHAR: -+ { -+ uchar tmp_str[REC_VERSION_56_MAX_INDEX_COL_LEN] = {'\0'}; -+ uint tmp_length = REC_VERSION_56_MAX_INDEX_COL_LEN; -+ -+ /* Use the charset number to pick the right charset struct for -+ the comparison. Since the MySQL function get_charset may be -+ slow before Bar removes the mutex operation there, we first -+ look at 2 common charsets directly. */ -+ -+ if (charset_number == default_charset_info->number) { -+ charset = default_charset_info; -+ } else if (charset_number == my_charset_latin1.number) { -+ charset = &my_charset_latin1; -+ } else { -+ charset = get_charset(charset_number, MYF(MY_WME)); -+ -+ if (charset == NULL) { -+ sql_print_error("InnoDB needs charset %lu for doing " -+ "a comparison, but MySQL cannot " -+ "find that charset.", -+ (ulong) charset_number); -+ ut_a(0); -+ } -+ } -+ -+ ut_a(str_length <= tmp_length); -+ memcpy(tmp_str, str, str_length); -+ -+ if (wsrep_protocol_version < 3) { -+ tmp_length = charset->coll->strnxfrm( -+ charset, str, str_length, -+ str_length, tmp_str, tmp_length, 0); -+ DBUG_ASSERT(tmp_length <= str_length); -+ } else { -+ /* strnxfrm will expand the destination string, -+ protocols < 3 truncated the sorted sring -+ protocols >= 3 gets full sorted sring -+ */ -+ tmp_length = charset->coll->strnxfrm( -+ charset, str, buf_length, -+ str_length, tmp_str, str_length, 0); -+ DBUG_ASSERT(tmp_length <= buf_length); -+ ret_length = tmp_length; -+ } -+ -+ break; -+ } -+ case MYSQL_TYPE_DECIMAL : -+ case MYSQL_TYPE_TINY : -+ case MYSQL_TYPE_SHORT : -+ case MYSQL_TYPE_LONG : -+ case MYSQL_TYPE_FLOAT : -+ case MYSQL_TYPE_DOUBLE : -+ case MYSQL_TYPE_NULL : -+ case MYSQL_TYPE_TIMESTAMP : -+ case MYSQL_TYPE_LONGLONG : -+ case MYSQL_TYPE_INT24 : -+ case MYSQL_TYPE_DATE : -+ case MYSQL_TYPE_TIME : -+ case MYSQL_TYPE_DATETIME : -+ case MYSQL_TYPE_YEAR : -+ case MYSQL_TYPE_NEWDATE : -+ case MYSQL_TYPE_NEWDECIMAL : -+ case MYSQL_TYPE_ENUM : -+ case MYSQL_TYPE_SET : -+ case MYSQL_TYPE_GEOMETRY : -+ break; -+ default: -+ break; -+ } -+ -+ return ret_length; -+} -+#endif // WITH_WSREP - - /*************************************************************//** - InnoDB uses this function to compare two data fields for which the data type -@@ -5675,6 +5872,307 @@ innobase_read_from_2_little_endian( - /*******************************************************************//** - Stores a key value for a row to a buffer. - @return key value length as stored in buff */ -+#ifdef WITH_WSREP -+UNIV_INTERN -+uint -+wsrep_store_key_val_for_row( -+/*===============================*/ -+ THD* thd, -+ TABLE* table, -+ uint keynr, /*!< in: key number */ -+ char* buff, /*!< in/out: buffer for the key value (in MySQL -+ format) */ -+ uint buff_len,/*!< in: buffer length */ -+ const uchar* record, -+ ibool* key_is_null)/*!< out: full key was null */ -+{ -+ KEY* key_info = table->key_info + keynr; -+ KEY_PART_INFO* key_part = key_info->key_part; -+ KEY_PART_INFO* end = -+ key_part + key_info->user_defined_key_parts; -+ char* buff_start = buff; -+ enum_field_types mysql_type; -+ Field* field; -+ uint buff_space = buff_len; -+ -+ DBUG_ENTER("wsrep_store_key_val_for_row"); -+ -+ memset(buff, 0, buff_len); -+ *key_is_null = TRUE; -+ -+ for (; key_part != end; key_part++) { -+ -+ uchar sorted[REC_VERSION_56_MAX_INDEX_COL_LEN] = {'\0'}; -+ ibool part_is_null = FALSE; -+ -+ if (key_part->null_bit) { -+ if (buff_space > 0) { -+ if (record[key_part->null_offset] -+ & key_part->null_bit) { -+ *buff = 1; -+ part_is_null = TRUE; -+ } else { -+ *buff = 0; -+ } -+ buff++; -+ buff_space--; -+ } else { -+ fprintf (stderr, "WSREP: key truncated: %s\n", -+ wsrep_thd_query(thd)); -+ } -+ } -+ if (!part_is_null) *key_is_null = FALSE; -+ -+ field = key_part->field; -+ mysql_type = field->type(); -+ -+ if (mysql_type == MYSQL_TYPE_VARCHAR) { -+ /* >= 5.0.3 true VARCHAR */ -+ ulint lenlen; -+ ulint len; -+ const byte* data; -+ ulint key_len; -+ ulint true_len; -+ const CHARSET_INFO* cs; -+ int error=0; -+ -+ key_len = key_part->length; -+ -+ if (part_is_null) { -+ true_len = key_len + 2; -+ if (true_len > buff_space) { -+ fprintf (stderr, -+ "WSREP: key truncated: %s\n", -+ wsrep_thd_query(thd)); -+ true_len = buff_space; -+ } -+ buff += true_len; -+ buff_space -= true_len; -+ continue; -+ } -+ cs = field->charset(); -+ -+ lenlen = (ulint) -+ (((Field_varstring*)field)->length_bytes); -+ -+ data = row_mysql_read_true_varchar(&len, -+ (byte*) (record -+ + (ulint)get_field_offset(table, field)), -+ lenlen); -+ -+ true_len = len; -+ -+ /* For multi byte character sets we need to calculate -+ the true length of the key */ -+ -+ if (len > 0 && cs->mbmaxlen > 1) { -+ true_len = (ulint) cs->cset->well_formed_len(cs, -+ (const char *) data, -+ (const char *) data + len, -+ (uint) (key_len / cs->mbmaxlen), -+ &error); -+ } -+ -+ /* In a column prefix index, we may need to truncate -+ the stored value: */ -+ -+ if (true_len > key_len) { -+ true_len = key_len; -+ } -+ -+ memcpy(sorted, data, true_len); -+ true_len = wsrep_innobase_mysql_sort( -+ mysql_type, cs->number, sorted, true_len, -+ REC_VERSION_56_MAX_INDEX_COL_LEN); -+ -+ if (wsrep_protocol_version > 1) { -+ /* Note that we always reserve the maximum possible -+ length of the true VARCHAR in the key value, though -+ only len first bytes after the 2 length bytes contain -+ actual data. The rest of the space was reset to zero -+ in the bzero() call above. */ -+ if (true_len > buff_space) { -+ fprintf (stderr, -+ "WSREP: key truncated: %s\n", -+ wsrep_thd_query(thd)); -+ true_len = buff_space; -+ } -+ memcpy(buff, sorted, true_len); -+ buff += true_len; -+ buff_space -= true_len; -+ } else { -+ buff += key_len; -+ } -+ } else if (mysql_type == MYSQL_TYPE_TINY_BLOB -+ || mysql_type == MYSQL_TYPE_MEDIUM_BLOB -+ || mysql_type == MYSQL_TYPE_BLOB -+ || mysql_type == MYSQL_TYPE_LONG_BLOB -+ /* MYSQL_TYPE_GEOMETRY data is treated -+ as BLOB data in innodb. */ -+ || mysql_type == MYSQL_TYPE_GEOMETRY) { -+ -+ const CHARSET_INFO* cs; -+ ulint key_len; -+ ulint true_len; -+ int error=0; -+ ulint blob_len; -+ const byte* blob_data; -+ -+ ut_a(key_part->key_part_flag & HA_PART_KEY_SEG); -+ -+ key_len = key_part->length; -+ -+ if (part_is_null) { -+ true_len = key_len + 2; -+ if (true_len > buff_space) { -+ fprintf (stderr, -+ "WSREP: key truncated: %s\n", -+ wsrep_thd_query(thd)); -+ true_len = buff_space; -+ } -+ buff += true_len; -+ buff_space -= true_len; -+ -+ continue; -+ } -+ -+ cs = field->charset(); -+ -+ blob_data = row_mysql_read_blob_ref(&blob_len, -+ (byte*) (record -+ + (ulint)get_field_offset(table, field)), -+ (ulint) field->pack_length()); -+ -+ true_len = blob_len; -+ -+ ut_a(get_field_offset(table, field) -+ == key_part->offset); -+ -+ /* For multi byte character sets we need to calculate -+ the true length of the key */ -+ -+ if (blob_len > 0 && cs->mbmaxlen > 1) { -+ true_len = (ulint) cs->cset->well_formed_len(cs, -+ (const char *) blob_data, -+ (const char *) blob_data -+ + blob_len, -+ (uint) (key_len / cs->mbmaxlen), -+ &error); -+ } -+ -+ /* All indexes on BLOB and TEXT are column prefix -+ indexes, and we may need to truncate the data to be -+ stored in the key value: */ -+ -+ if (true_len > key_len) { -+ true_len = key_len; -+ } -+ -+ memcpy(sorted, blob_data, true_len); -+ true_len = wsrep_innobase_mysql_sort( -+ mysql_type, cs->number, sorted, true_len, -+ REC_VERSION_56_MAX_INDEX_COL_LEN); -+ -+ -+ /* Note that we always reserve the maximum possible -+ length of the BLOB prefix in the key value. */ -+ if (wsrep_protocol_version > 1) { -+ if (true_len > buff_space) { -+ fprintf (stderr, -+ "WSREP: key truncated: %s\n", -+ wsrep_thd_query(thd)); -+ true_len = buff_space; -+ } -+ buff += true_len; -+ buff_space -= true_len; -+ } else { -+ buff += key_len; -+ } -+ memcpy(buff, sorted, true_len); -+ } else { -+ /* Here we handle all other data types except the -+ true VARCHAR, BLOB and TEXT. Note that the column -+ value we store may be also in a column prefix -+ index. */ -+ -+ const CHARSET_INFO* cs = NULL; -+ ulint true_len; -+ ulint key_len; -+ const uchar* src_start; -+ int error=0; -+ enum_field_types real_type; -+ -+ key_len = key_part->length; -+ -+ if (part_is_null) { -+ true_len = key_len; -+ if (true_len > buff_space) { -+ fprintf (stderr, -+ "WSREP: key truncated: %s\n", -+ wsrep_thd_query(thd)); -+ true_len = buff_space; -+ } -+ buff += true_len; -+ buff_space -= true_len; -+ -+ continue; -+ } -+ -+ src_start = record + key_part->offset; -+ real_type = field->real_type(); -+ true_len = key_len; -+ -+ /* Character set for the field is defined only -+ to fields whose type is string and real field -+ type is not enum or set. For these fields check -+ if character set is multi byte. */ -+ -+ if (real_type != MYSQL_TYPE_ENUM -+ && real_type != MYSQL_TYPE_SET -+ && ( mysql_type == MYSQL_TYPE_VAR_STRING -+ || mysql_type == MYSQL_TYPE_STRING)) { -+ -+ cs = field->charset(); -+ -+ /* For multi byte character sets we need to -+ calculate the true length of the key */ -+ -+ if (key_len > 0 && cs->mbmaxlen > 1) { -+ -+ true_len = (ulint) -+ cs->cset->well_formed_len(cs, -+ (const char *)src_start, -+ (const char *)src_start -+ + key_len, -+ (uint) (key_len / -+ cs->mbmaxlen), -+ &error); -+ } -+ memcpy(sorted, src_start, true_len); -+ true_len = wsrep_innobase_mysql_sort( -+ mysql_type, cs->number, sorted, true_len, -+ REC_VERSION_56_MAX_INDEX_COL_LEN); -+ -+ if (true_len > buff_space) { -+ fprintf (stderr, -+ "WSREP: key truncated: %s\n", -+ wsrep_thd_query(thd)); -+ true_len = buff_space; -+ } -+ memcpy(buff, sorted, true_len); -+ } else { -+ memcpy(buff, src_start, true_len); -+ } -+ buff += true_len; -+ buff_space -= true_len; -+ } -+ } -+ -+ ut_a(buff <= buff_start + buff_len); -+ -+ DBUG_RETURN((uint)(buff - buff_start)); -+} -+#endif /* WITH_WSREP */ - UNIV_INTERN - uint - ha_innobase::store_key_val_for_row( -@@ -6502,6 +7000,9 @@ ha_innobase::write_row( - dberr_t error; - int error_result= 0; - ibool auto_inc_used= FALSE; -+#ifdef WITH_WSREP -+ ibool auto_inc_inserted= FALSE; /* if NULL was inserted */ -+#endif - ulint sql_command; - trx_t* trx = thd_to_trx(user_thd); - -@@ -6535,8 +7036,20 @@ ha_innobase::write_row( - if ((sql_command == SQLCOM_ALTER_TABLE - || sql_command == SQLCOM_OPTIMIZE - || sql_command == SQLCOM_CREATE_INDEX -+#ifdef WITH_WSREP -+ || (wsrep_on(user_thd) && wsrep_load_data_splitting && -+ sql_command == SQLCOM_LOAD && -+ !thd_test_options( -+ user_thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) -+#endif /* WITH_WSREP */ - || sql_command == SQLCOM_DROP_INDEX) - && num_write_row >= 10000) { -+#ifdef WITH_WSREP -+ if (wsrep_on(user_thd) && sql_command == SQLCOM_LOAD) { -+ WSREP_DEBUG("forced trx split for LOAD: %s", -+ wsrep_thd_query(user_thd)); -+ } -+#endif /* WITH_WSREP */ - /* ALTER TABLE is COMMITted at every 10000 copied rows. - The IX table lock for the original table has to be re-issued. - As this method will be called on a temporary table where the -@@ -6570,6 +7083,26 @@ no_commit: - */ - ; - } else if (src_table == prebuilt->table) { -+#ifdef WITH_WSREP -+ if (wsrep_on(user_thd) && wsrep_load_data_splitting && -+ sql_command == SQLCOM_LOAD && -+ !thd_test_options( -+ user_thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) -+ { -+ switch (wsrep_run_wsrep_commit(user_thd, wsrep_hton, 1)) -+ { -+ case WSREP_TRX_OK: -+ break; -+ case WSREP_TRX_SIZE_EXCEEDED: -+ case WSREP_TRX_CERT_FAIL: -+ case WSREP_TRX_ERROR: -+ DBUG_RETURN(1); -+ } -+ -+ if (tc_log->commit(user_thd, 1)) DBUG_RETURN(1); -+ wsrep_post_commit(user_thd, TRUE); -+ } -+#endif /* WITH_WSREP */ - /* Source table is not in InnoDB format: - no need to re-acquire locks on it. */ - -@@ -6580,6 +7113,25 @@ no_commit: - /* We will need an IX lock on the destination table. */ - prebuilt->sql_stat_start = TRUE; - } else { -+#ifdef WITH_WSREP -+ if (wsrep_on(user_thd) && wsrep_load_data_splitting && -+ sql_command == SQLCOM_LOAD && -+ !thd_test_options( -+ user_thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) -+ { -+ switch (wsrep_run_wsrep_commit(user_thd, wsrep_hton, 1)) -+ { -+ case WSREP_TRX_OK: -+ break; -+ case WSREP_TRX_SIZE_EXCEEDED: -+ case WSREP_TRX_CERT_FAIL: -+ case WSREP_TRX_ERROR: -+ DBUG_RETURN(1); -+ } -+ if (tc_log->commit(user_thd, 1)) DBUG_RETURN(1); -+ wsrep_post_commit(user_thd, TRUE); -+ } -+#endif /* WITH_WSREP */ - /* Ensure that there are no other table locks than - LOCK_IX and LOCK_AUTO_INC on the destination table. */ - -@@ -6609,6 +7161,9 @@ no_commit: - innobase_get_auto_increment(). */ - prebuilt->autoinc_error = DB_SUCCESS; - -+#ifdef WITH_WSREP -+ auto_inc_inserted= (table->next_number_field->val_int() == 0); -+#endif - if ((error_result = update_auto_increment())) { - /* We don't want to mask autoinc overflow errors. */ - -@@ -6687,6 +7242,40 @@ no_commit: - case SQLCOM_REPLACE_SELECT: - goto set_max_autoinc; - -+#ifdef WITH_WSREP -+ /* workaround for LP bug #355000, retrying the insert */ -+ case SQLCOM_INSERT: -+ -+ WSREP_DEBUG("DUPKEY error for autoinc\n" -+ "THD %ld, value %llu, off %llu inc %llu", -+ wsrep_thd_thread_id(current_thd), -+ auto_inc, -+ prebuilt->autoinc_offset, -+ prebuilt->autoinc_increment); -+ -+ if (wsrep_on(current_thd) && -+ auto_inc_inserted && -+ wsrep_drupal_282555_workaround && -+ wsrep_thd_retry_counter(current_thd) == 0 && -+ !thd_test_options(current_thd, -+ OPTION_NOT_AUTOCOMMIT | -+ OPTION_BEGIN)) { -+ WSREP_DEBUG( -+ "retrying insert: %s", -+ (*wsrep_thd_query(current_thd)) ? -+ wsrep_thd_query(current_thd) : -+ (char *)"void"); -+ error= DB_SUCCESS; -+ wsrep_thd_set_conflict_state( -+ current_thd, MUST_ABORT); -+ innobase_srv_conc_exit_innodb( -+ prebuilt->trx); -+ /* jump straight to func exit over -+ * later wsrep hooks */ -+ goto func_exit; -+ } -+ break; -+#endif - default: - break; - } -@@ -6745,6 +7334,20 @@ report_error: - error_result = convert_error_code_to_mysql(error, - prebuilt->table->flags, - user_thd); -+#ifdef WITH_WSREP -+ if (!error_result && wsrep_thd_exec_mode(user_thd) == LOCAL_STATE && -+ wsrep_on(user_thd) && !wsrep_consistency_check(user_thd) && -+ (sql_command != SQLCOM_LOAD || -+ thd_binlog_format(user_thd) == BINLOG_FORMAT_ROW)) { -+ -+ if (wsrep_append_keys(user_thd, false, record, NULL)) { -+ DBUG_PRINT("wsrep", ("row key failed")); -+ error_result = HA_ERR_INTERNAL_ERROR; -+ goto wsrep_error; -+ } -+ } -+wsrep_error: -+#endif - - if (error_result == HA_FTS_INVALID_DOCID) { - my_error(HA_FTS_INVALID_DOCID, MYF(0)); -@@ -6755,7 +7358,88 @@ func_exit: - - DBUG_RETURN(error_result); - } -+#ifdef WITH_WSREP -+#if defined(HAVE_YASSL) -+#include "my_config.h" -+#include "md5.hpp" -+#elif defined(HAVE_OPENSSL) -+#include -+#endif -+static -+int -+wsrep_calc_row_hash( -+/*================*/ -+ byte* digest, /*!< in/out: md5 sum */ -+ const uchar* row, /*!< in: row in MySQL format */ -+ TABLE* table, /*!< in: table in MySQL data -+ dictionary */ -+ row_prebuilt_t* prebuilt, /*!< in: InnoDB prebuilt struct */ -+ THD* thd) /*!< in: user thread */ -+{ -+ Field* field; -+ enum_field_types field_mysql_type; -+ uint n_fields; -+ ulint len; -+ const byte* ptr; -+ ulint col_type; -+ uint i; - -+ -+ void *ctx = wsrep_md5_init(); -+ -+ n_fields = table->s->fields; -+ -+ for (i = 0; i < n_fields; i++) { -+ byte null_byte=0; -+ byte true_byte=1; -+ -+ field = table->field[i]; -+ -+ ptr = (const byte*) row + get_field_offset(table, field); -+ len = field->pack_length(); -+ -+ field_mysql_type = field->type(); -+ -+ col_type = prebuilt->table->cols[i].mtype; -+ -+ switch (col_type) { -+ -+ case DATA_BLOB: -+ ptr = row_mysql_read_blob_ref(&len, ptr, len); -+ -+ break; -+ -+ case DATA_VARCHAR: -+ case DATA_BINARY: -+ case DATA_VARMYSQL: -+ if (field_mysql_type == MYSQL_TYPE_VARCHAR) { -+ /* This is a >= 5.0.3 type true VARCHAR where -+ the real payload data length is stored in -+ 1 or 2 bytes */ -+ -+ ptr = row_mysql_read_true_varchar( -+ &len, ptr, -+ (ulint) -+ (((Field_varstring*)field)->length_bytes)); -+ -+ } -+ -+ break; -+ default: -+ ; -+ } -+ -+ if (field->is_null_in_record(row)) { -+ wsrep_md5_update(ctx, (char*)&null_byte, 1); -+ } else { -+ wsrep_md5_update(ctx, (char*)&true_byte, 1); -+ wsrep_md5_update(ctx, (char*)ptr, len); -+ } -+ } -+ wsrep_compute_md5_hash((char*)digest, ctx); -+ return(0); -+} -+#endif /* WITH_WSREP */ - /**********************************************************************//** - Checks which fields have changed in a row and stores information - of them to an update vector. -@@ -7164,6 +7848,20 @@ func_exit: - - innobase_active_small(); - -+#ifdef WITH_WSREP -+ if (!err && wsrep_thd_exec_mode(user_thd) == LOCAL_STATE && -+ wsrep_on(user_thd)) { -+ -+ DBUG_PRINT("wsrep", ("update row key")); -+ -+ if (wsrep_append_keys(user_thd, false, old_row, new_row)) { -+ DBUG_PRINT("wsrep", ("row key failed")); -+ err = HA_ERR_INTERNAL_ERROR; -+ goto wsrep_error; -+ } -+ } -+wsrep_error: -+#endif - DBUG_RETURN(err); - } - -@@ -7211,6 +7909,18 @@ ha_innobase::delete_row( - - innobase_active_small(); - -+#ifdef WITH_WSREP -+ if (error == DB_SUCCESS && wsrep_thd_exec_mode(user_thd) == LOCAL_STATE && -+ wsrep_on(user_thd)) { -+ -+ if (wsrep_append_keys(user_thd, false, record, NULL)) { -+ DBUG_PRINT("wsrep", ("delete fail")); -+ error = DB_ERROR; -+ goto wsrep_error; -+ } -+ } -+wsrep_error: -+#endif - DBUG_RETURN(convert_error_code_to_mysql( - error, prebuilt->table->flags, user_thd)); - } -@@ -8198,7 +8908,6 @@ innobase_fts_create_doc_id_key( - dfield_t* dfield = dtuple_get_nth_field(tuple, 0); - - ut_a(dict_index_get_n_unique(index) == 1); -- - dtuple_set_n_fields(tuple, index->n_fields); - dict_index_copy_types(tuple, index, index->n_fields); - -@@ -8371,7 +9080,395 @@ ha_innobase::ft_end() - - rnd_end(); - } -+#ifdef WITH_WSREP -+dict_index_t* -+wsrep_dict_foreign_find_index( -+ dict_table_t* table, -+ const char** col_names, -+ const char** columns, -+ ulint n_cols, -+ dict_index_t* types_idx, -+ ibool check_charsets, -+ ulint check_null); -+ -+extern -+dberr_t -+wsrep_append_foreign_key( -+/*===========================*/ -+ trx_t* trx, /*!< in: trx */ -+ dict_foreign_t* foreign, /*!< in: foreign key constraint */ -+ const rec_t* rec, /*!mysql_thd; -+ int rcode = 0; -+ char cache_key[513] = {'\0'}; -+ int cache_key_len; -+ bool const copy = true; -+ ut_a(trx); - -+ if (!wsrep_on(trx->mysql_thd) || -+ wsrep_thd_exec_mode(thd) != LOCAL_STATE) -+ return DB_SUCCESS; -+ -+ if (!thd || !foreign || -+ (!foreign->referenced_table && !foreign->foreign_table)) -+ { -+ WSREP_INFO("FK: %s missing in: %s", -+ (!thd) ? "thread" : -+ ((!foreign) ? "constraint" : -+ ((!foreign->referenced_table) ? -+ "referenced table" : "foreign table")), -+ (thd && wsrep_thd_query(thd)) ? -+ wsrep_thd_query(thd) : "void"); -+ return DB_ERROR; -+ } -+ -+ if ( !((referenced) ? -+ foreign->referenced_table : foreign->foreign_table)) -+ { -+ WSREP_DEBUG("pulling %s table into cache", -+ (referenced) ? "referenced" : "foreign"); -+ mutex_enter(&(dict_sys->mutex)); -+ if (referenced) -+ { -+ foreign->referenced_table = -+ dict_table_get_low( -+ foreign->referenced_table_name_lookup); -+ if (foreign->referenced_table) -+ { -+ foreign->referenced_index = -+ wsrep_dict_foreign_find_index( -+ foreign->referenced_table, NULL, -+ foreign->referenced_col_names, -+ foreign->n_fields, -+ foreign->foreign_index, -+ TRUE, FALSE); -+ } -+ } -+ else -+ { -+ foreign->foreign_table = -+ dict_table_get_low( -+ foreign->foreign_table_name_lookup); -+ if (foreign->foreign_table) -+ { -+ foreign->foreign_index = -+ wsrep_dict_foreign_find_index( -+ foreign->foreign_table, NULL, -+ foreign->foreign_col_names, -+ foreign->n_fields, -+ foreign->referenced_index, -+ TRUE, FALSE); -+ } -+ } -+ mutex_exit(&(dict_sys->mutex)); -+ } -+ -+ if ( !((referenced) ? -+ foreign->referenced_table : foreign->foreign_table)) -+ { -+ WSREP_WARN("FK: %s missing in query: %s", -+ (!foreign->referenced_table) ? -+ "referenced table" : "foreign table", -+ (wsrep_thd_query(thd)) ? -+ wsrep_thd_query(thd) : "void"); -+ return DB_ERROR; -+ } -+ byte key[WSREP_MAX_SUPPORTED_KEY_LENGTH+1] = {'\0'}; -+ ulint len = WSREP_MAX_SUPPORTED_KEY_LENGTH; -+ -+ dict_index_t *idx_target = (referenced) ? -+ foreign->referenced_index : index; -+ dict_index_t *idx = (referenced) ? -+ UT_LIST_GET_FIRST(foreign->referenced_table->indexes) : -+ UT_LIST_GET_FIRST(foreign->foreign_table->indexes); -+ int i = 0; -+ while (idx != NULL && idx != idx_target) { -+ if (innobase_strcasecmp (idx->name, innobase_index_reserve_name) != 0) { -+ i++; -+ } -+ idx = UT_LIST_GET_NEXT(indexes, idx); -+ } -+ ut_a(idx); -+ key[0] = (char)i; -+ -+ rcode = wsrep_rec_get_foreign_key( -+ &key[1], &len, rec, index, idx, -+ wsrep_protocol_version > 1); -+ if (rcode != DB_SUCCESS) { -+ WSREP_ERROR( -+ "FK key set failed: %d (%lu %lu), index: %s %s, %s", -+ rcode, referenced, shared, -+ (index && index->name) ? index->name : -+ "void index", -+ (index && index->table_name) ? index->table_name : -+ "void table", -+ wsrep_thd_query(thd)); -+ return DB_ERROR; -+ } -+ strncpy(cache_key, -+ (wsrep_protocol_version > 1) ? -+ ((referenced) ? -+ foreign->referenced_table->name : -+ foreign->foreign_table->name) : -+ foreign->foreign_table->name, sizeof(cache_key) - 1); -+ cache_key_len = strlen(cache_key); -+// #define WSREP_DEBUG_PRINT -+#ifdef WSREP_DEBUG_PRINT -+ ulint j; -+ fprintf(stderr, "FK parent key, table: %s %s len: %lu ", -+ cache_key, (shared) ? "shared" : "exclusive", len+1); -+ for (j=0; jreferenced_table->name, -+ foreign->foreign_table->name); -+ } -+ -+ wsrep_buf_t wkey_part[3]; -+ wsrep_key_t wkey = {wkey_part, 3}; -+ if (!wsrep_prepare_key_for_innodb( -+ (const uchar*)cache_key, -+ cache_key_len + 1, -+ (const uchar*)key, len+1, -+ wkey_part, -+ &wkey.key_parts_num)) { -+ WSREP_WARN("key prepare failed for cascaded FK: %s", -+ (wsrep_thd_query(thd)) ? -+ wsrep_thd_query(thd) : "void"); -+ return DB_ERROR; -+ } -+ rcode = wsrep->append_key( -+ wsrep, -+ wsrep_ws_handle(thd, trx), -+ &wkey, -+ 1, -+ shared ? WSREP_KEY_SHARED : WSREP_KEY_EXCLUSIVE, -+ copy); -+ if (rcode) { -+ DBUG_PRINT("wsrep", ("row key failed: %d", rcode)); -+ WSREP_ERROR("Appending cascaded fk row key failed: %s, %d", -+ (wsrep_thd_query(thd)) ? -+ wsrep_thd_query(thd) : "void", rcode); -+ return DB_ERROR; -+ } -+ -+ return DB_SUCCESS; -+} -+ -+static int -+wsrep_append_key( -+/*==================*/ -+ THD *thd, -+ trx_t *trx, -+ TABLE_SHARE *table_share, -+ TABLE *table, -+ const char* key, -+ uint16_t key_len, -+ bool shared -+) -+{ -+ DBUG_ENTER("wsrep_append_key"); -+ bool const copy = true; -+#ifdef WSREP_DEBUG_PRINT -+ fprintf(stderr, "%s conn %ld, trx %llu, keylen %d, table %s\n SQL: %s ", -+ (shared) ? "Shared" : "Exclusive", -+ wsrep_thd_thread_id(thd), (long long)trx->id, key_len, -+ table_share->table_name.str, wsrep_thd_query(thd)); -+ for (int i=0; itable_cache_key.str, -+ table_share->table_cache_key.length, -+ (const uchar*)key, key_len, -+ wkey_part, -+ &wkey.key_parts_num)) { -+ WSREP_WARN("key prepare failed for: %s", -+ (wsrep_thd_query(thd)) ? -+ wsrep_thd_query(thd) : "void"); -+ DBUG_RETURN(-1); -+ } -+ -+ int rcode = wsrep->append_key( -+ wsrep, -+ wsrep_ws_handle(thd, trx), -+ &wkey, -+ 1, -+ shared ? WSREP_KEY_SHARED : WSREP_KEY_EXCLUSIVE, -+ copy); -+ if (rcode) { -+ DBUG_PRINT("wsrep", ("row key failed: %d", rcode)); -+ WSREP_WARN("Appending row key failed: %s, %d", -+ (wsrep_thd_query(thd)) ? -+ wsrep_thd_query(thd) : "void", rcode); -+ DBUG_RETURN(-1); -+ } -+ DBUG_RETURN(0); -+} -+ -+extern void compute_md5_hash(char *digest, const char *buf, int len); -+#define MD5_HASH compute_md5_hash -+ -+int -+ha_innobase::wsrep_append_keys( -+/*==================*/ -+ THD *thd, -+ bool shared, -+ const uchar* record0, /* in: row in MySQL format */ -+ const uchar* record1) /* in: row in MySQL format */ -+{ -+ int rcode; -+ DBUG_ENTER("wsrep_append_keys"); -+ -+ bool key_appended = false; -+ trx_t *trx = thd_to_trx(thd); -+ -+ if (table_share && table_share->tmp_table != NO_TMP_TABLE) { -+ WSREP_DEBUG("skipping tmp table DML: THD: %lu tmp: %d SQL: %s", -+ wsrep_thd_thread_id(thd), -+ table_share->tmp_table, -+ (wsrep_thd_query(thd)) ? -+ wsrep_thd_query(thd) : "void"); -+ DBUG_RETURN(0); -+ } -+ -+ if (wsrep_protocol_version == 0) { -+ uint len; -+ char keyval[WSREP_MAX_SUPPORTED_KEY_LENGTH+1] = {'\0'}; -+ char *key = &keyval[0]; -+ ibool is_null; -+ -+ len = wsrep_store_key_val_for_row( -+ thd, table, 0, key, WSREP_MAX_SUPPORTED_KEY_LENGTH, -+ record0, &is_null); -+ -+ if (!is_null) { -+ rcode = wsrep_append_key( -+ thd, trx, table_share, table, keyval, -+ len, shared); -+ if (rcode) DBUG_RETURN(rcode); -+ } -+ else -+ { -+ WSREP_DEBUG("NULL key skipped (proto 0): %s", -+ wsrep_thd_query(thd)); -+ } -+ } else { -+ ut_a(table->s->keys <= 256); -+ uint i; -+ bool hasPK= false; -+ -+ for (i=0; is->keys; ++i) { -+ KEY* key_info = table->key_info + i; -+ if (key_info->flags & HA_NOSAME) { -+ hasPK = true; -+ } -+ } -+ -+ for (i=0; is->keys; ++i) { -+ uint len; -+ char keyval0[WSREP_MAX_SUPPORTED_KEY_LENGTH+1] = {'\0'}; -+ char keyval1[WSREP_MAX_SUPPORTED_KEY_LENGTH+1] = {'\0'}; -+ char* key0 = &keyval0[1]; -+ char* key1 = &keyval1[1]; -+ KEY* key_info = table->key_info + i; -+ ibool is_null; -+ -+ dict_index_t* idx = innobase_get_index(i); -+ dict_table_t* tab = (idx) ? idx->table : NULL; -+ -+ keyval0[0] = (char)i; -+ keyval1[0] = (char)i; -+ -+ if (!tab) { -+ WSREP_WARN("MySQL-InnoDB key mismatch %s %s", -+ table->s->table_name.str, -+ key_info->name); -+ } -+ /* !hasPK == table with no PK, must append all non-unique keys */ -+ if (!hasPK || key_info->flags & HA_NOSAME || -+ ((tab && -+ dict_table_get_referenced_constraint(tab, idx)) || -+ (!tab && referenced_by_foreign_key()))) { -+ -+ len = wsrep_store_key_val_for_row( -+ thd, table, i, key0, -+ WSREP_MAX_SUPPORTED_KEY_LENGTH, -+ record0, &is_null); -+ if (!is_null) { -+ rcode = wsrep_append_key( -+ thd, trx, table_share, table, -+ keyval0, len+1, shared); -+ if (rcode) DBUG_RETURN(rcode); -+ -+ if (key_info->flags & HA_NOSAME || shared) -+ key_appended = true; -+ } -+ else -+ { -+ WSREP_DEBUG("NULL key skipped: %s", -+ wsrep_thd_query(thd)); -+ } -+ if (record1) { -+ len = wsrep_store_key_val_for_row( -+ thd, table, i, key1, -+ WSREP_MAX_SUPPORTED_KEY_LENGTH, -+ record1, &is_null); -+ if (!is_null && memcmp(key0, key1, len)) { -+ rcode = wsrep_append_key( -+ thd, trx, table_share, -+ table, -+ keyval1, len+1, shared); -+ if (rcode) DBUG_RETURN(rcode); -+ } -+ } -+ } -+ } -+ } -+ -+ /* if no PK, calculate hash of full row, to be the key value */ -+ if (!key_appended && wsrep_certify_nonPK) { -+ uchar digest[16]; -+ int rcode; -+ -+ wsrep_calc_row_hash(digest, record0, table, prebuilt, thd); -+ if ((rcode = wsrep_append_key(thd, trx, table_share, table, -+ (const char*) digest, 16, -+ shared))) { -+ DBUG_RETURN(rcode); -+ } -+ -+ if (record1) { -+ wsrep_calc_row_hash( -+ digest, record1, table, prebuilt, thd); -+ if ((rcode = wsrep_append_key(thd, trx, table_share, -+ table, -+ (const char*) digest, -+ 16, shared))) { -+ DBUG_RETURN(rcode); -+ } -+ } -+ DBUG_RETURN(0); -+ } -+ -+ DBUG_RETURN(0); -+} -+#endif - /*********************************************************************//** - Stores a reference to the current row to 'ref' field of the handle. Note - that in the case where we have generated the clustered index for the -@@ -12128,11 +13225,18 @@ ha_innobase::external_lock( - /* used by test case */ - DBUG_EXECUTE_IF("no_innodb_binlog_errors", skip = true;); - if (!skip) { -+#ifdef WITH_WSREP -+ if (!wsrep_on(thd) || wsrep_thd_exec_mode(thd) == LOCAL_STATE) -+ { -+#endif /* WITH_WSREP */ - my_error(ER_BINLOG_STMT_MODE_AND_ROW_ENGINE, MYF(0), - " InnoDB is limited to row-logging when " - "transaction isolation level is " - "READ COMMITTED or READ UNCOMMITTED."); - DBUG_RETURN(HA_ERR_LOGGING_IMPOSSIBLE); -+#ifdef WITH_WSREP -+ } -+#endif /* WITH_WSREP */ - } - } - -@@ -12163,6 +13267,33 @@ ha_innobase::external_lock( - - } - -+ /* Check for UPDATEs in read-only mode. */ -+ if (srv_read_only_mode -+ && (thd_sql_command(thd) == SQLCOM_UPDATE -+ || thd_sql_command(thd) == SQLCOM_INSERT -+ || thd_sql_command(thd) == SQLCOM_REPLACE -+ || thd_sql_command(thd) == SQLCOM_DROP_TABLE -+ || thd_sql_command(thd) == SQLCOM_ALTER_TABLE -+ || thd_sql_command(thd) == SQLCOM_OPTIMIZE -+ || (thd_sql_command(thd) == SQLCOM_CREATE_TABLE -+ && lock_type == F_WRLCK) -+ || thd_sql_command(thd) == SQLCOM_CREATE_INDEX -+ || thd_sql_command(thd) == SQLCOM_DROP_INDEX -+ || thd_sql_command(thd) == SQLCOM_DELETE)) { -+ -+ if (thd_sql_command(thd) == SQLCOM_CREATE_TABLE) -+ { -+ ib_senderrf(thd, IB_LOG_LEVEL_WARN, -+ ER_INNODB_READ_ONLY); -+ DBUG_RETURN(HA_ERR_INNODB_READ_ONLY); -+ } else { -+ ib_senderrf(thd, IB_LOG_LEVEL_WARN, -+ ER_READ_ONLY_MODE); -+ DBUG_RETURN(HA_ERR_TABLE_READONLY); -+ } -+ -+ } -+ - trx = prebuilt->trx; - - prebuilt->sql_stat_start = TRUE; -@@ -13218,8 +14349,20 @@ ha_innobase::get_auto_increment( - next value in the series. */ - if (prebuilt->autoinc_increment > increment) { - -+#ifdef WITH_WSREP -+ WSREP_DEBUG("autoinc decrease: %llu -> %llu\n" -+ "THD: %ld, current: %llu, autoinc: %llu", -+ prebuilt->autoinc_increment, -+ increment, -+ wsrep_thd_thread_id(ha_thd()), -+ current, autoinc); -+ if (!wsrep_on(ha_thd())) -+ { -+#endif /* WITH_WSREP */ - current = autoinc - prebuilt->autoinc_increment; -- -+#ifdef WITH_WSREP -+ } -+#endif /* WITH_WSREP */ - current = innobase_next_autoinc( - current, 1, increment, 1, col_max_value); - -@@ -13580,6 +14723,9 @@ innobase_xa_prepare( - to the session variable take effect only in the next transaction */ - if (!trx->support_xa) { - -+#ifdef WITH_WSREP -+ thd_get_xid(thd, (MYSQL_XID*) &trx->xid); -+#endif // WITH_WSREP - return(0); - } - -@@ -15648,6 +16794,292 @@ static SHOW_VAR innodb_status_variables_export[]= { - static struct st_mysql_storage_engine innobase_storage_engine= - { MYSQL_HANDLERTON_INTERFACE_VERSION }; - -+#ifdef WITH_WSREP -+void -+wsrep_abort_slave_trx(wsrep_seqno_t bf_seqno, wsrep_seqno_t victim_seqno) -+{ -+ WSREP_ERROR("Trx %lld tries to abort slave trx %lld. This could be " -+ "caused by:\n\t" -+ "1) unsupported configuration options combination, please check documentation.\n\t" -+ "2) a bug in the code.\n\t" -+ "3) a database corruption.\n Node consistency compromized, " -+ "need to abort. Restart the node to resync with cluster.", -+ (long long)bf_seqno, (long long)victim_seqno); -+ abort(); -+} -+ -+int -+wsrep_innobase_kill_one_trx(void * const bf_thd_ptr, -+ const trx_t * const bf_trx, -+ trx_t *victim_trx, ibool signal) -+{ -+ ut_ad(lock_mutex_own()); -+ ut_ad(trx_mutex_own(victim_trx)); -+ ut_ad(bf_thd_ptr); -+ ut_ad(victim_trx); -+ -+ DBUG_ENTER("wsrep_innobase_kill_one_trx"); -+ THD *bf_thd = bf_thd_ptr ? (THD*) bf_thd_ptr : NULL; -+ THD *thd = (THD *) victim_trx->mysql_thd; -+ int64_t bf_seqno = (bf_thd) ? wsrep_thd_trx_seqno(bf_thd) : 0; -+ -+ if (!thd) { -+ DBUG_PRINT("wsrep", ("no thd for conflicting lock")); -+ WSREP_WARN("no THD for trx: %llu", (long long)victim_trx->id); -+ DBUG_RETURN(1); -+ } -+ if (!bf_thd) { -+ DBUG_PRINT("wsrep", ("no BF thd for conflicting lock")); -+ WSREP_WARN("no BF THD for trx: %llu", -+ (bf_trx) ? (long long)bf_trx->id : 0); -+ DBUG_RETURN(1); -+ } -+ -+ WSREP_LOG_CONFLICT(bf_thd, thd, TRUE); -+ -+ WSREP_DEBUG("BF kill (%lu, seqno: %lld), victim: (%llu) trx: %llu", -+ signal, (long long)bf_seqno, -+ (long long)wsrep_thd_thread_id(thd), -+ (long long)victim_trx->id); -+ -+ WSREP_DEBUG("Aborting query: %s", -+ (thd && wsrep_thd_query(thd)) ? wsrep_thd_query(thd) : "void"); -+ -+ wsrep_thd_LOCK(thd); -+ -+ if (wsrep_thd_query_state(thd) == QUERY_EXITING) { -+ WSREP_DEBUG("kill trx EXITING for %llu", -+ (long long)victim_trx->id); -+ wsrep_thd_UNLOCK(thd); -+ DBUG_RETURN(0); -+ } -+ if(wsrep_thd_exec_mode(thd) != LOCAL_STATE) { -+ WSREP_DEBUG("withdraw for BF trx: %llu, state: %d", -+ (long long)victim_trx->id, -+ wsrep_thd_conflict_state(thd)); -+ } -+ -+ switch (wsrep_thd_conflict_state(thd)) { -+ case NO_CONFLICT: -+ wsrep_thd_set_conflict_state(thd, MUST_ABORT); -+ break; -+ case MUST_ABORT: -+ WSREP_DEBUG("victim %llu in MUST ABORT state", -+ (long long)victim_trx->id); -+ wsrep_thd_UNLOCK(thd); -+ wsrep_thd_awake(thd, signal); -+ DBUG_RETURN(0); -+ break; -+ case ABORTED: -+ case ABORTING: // fall through -+ default: -+ WSREP_DEBUG("victim %llu in state %d", -+ (long long)victim_trx->id, -+ wsrep_thd_conflict_state(thd)); -+ wsrep_thd_UNLOCK(thd); -+ DBUG_RETURN(0); -+ break; -+ } -+ -+ switch (wsrep_thd_query_state(thd)) { -+ case QUERY_COMMITTING: -+ enum wsrep_status rcode; -+ -+ WSREP_DEBUG("kill trx QUERY_COMMITTING for %llu", -+ (long long)victim_trx->id); -+ wsrep_thd_awake(thd, signal); -+ -+ if (wsrep_thd_exec_mode(thd) == REPL_RECV) { -+ wsrep_abort_slave_trx(bf_seqno, -+ wsrep_thd_trx_seqno(thd)); -+ } else { -+ rcode = wsrep->abort_pre_commit( -+ wsrep, bf_seqno, -+ (wsrep_trx_id_t)victim_trx->id -+ ); -+ -+ switch (rcode) { -+ case WSREP_WARNING: -+ WSREP_DEBUG("cancel commit warning: %llu", -+ (long long)victim_trx->id); -+ wsrep_thd_UNLOCK(thd); -+ DBUG_RETURN(1); -+ break; -+ case WSREP_OK: -+ break; -+ default: -+ WSREP_ERROR( -+ "cancel commit bad exit: %d %llu", -+ rcode, -+ (long long)victim_trx->id); -+ /* unable to interrupt, must abort */ -+ /* note: kill_mysql() will block, if we cannot. -+ * kill the lock holder first. -+ */ -+ abort(); -+ break; -+ } -+ } -+ break; -+ case QUERY_EXEC: -+ /* it is possible that victim trx is itself waiting for some -+ * other lock. We need to cancel this waiting -+ */ -+ WSREP_DEBUG("kill trx QUERY_EXEC for %llu", (long long)victim_trx->id); -+ -+ victim_trx->lock.was_chosen_as_deadlock_victim= TRUE; -+ if (victim_trx->lock.wait_lock) { -+ WSREP_DEBUG("victim has wait flag: %ld", -+ wsrep_thd_thread_id(thd)); -+ lock_t* wait_lock = victim_trx->lock.wait_lock; -+ if (wait_lock) { -+ WSREP_DEBUG("canceling wait lock"); -+ victim_trx->lock.was_chosen_as_deadlock_victim= TRUE; -+ lock_cancel_waiting_and_release(wait_lock); -+ } -+ -+ wsrep_thd_awake(thd, signal); -+ } else { -+ /* abort currently executing query */ -+ DBUG_PRINT("wsrep",("sending KILL_QUERY to: %ld", -+ wsrep_thd_thread_id(thd))); -+ WSREP_DEBUG("kill query for: %ld", -+ wsrep_thd_thread_id(thd)); -+ wsrep_thd_awake(thd, signal); -+ -+ /* for BF thd, we need to prevent him from committing */ -+ if (wsrep_thd_exec_mode(thd) == REPL_RECV) { -+ wsrep_abort_slave_trx(bf_seqno, -+ wsrep_thd_trx_seqno(thd)); -+ } -+ } -+ break; -+ case QUERY_IDLE: -+ { -+ bool skip_abort= false; -+ wsrep_aborting_thd_t abortees; -+ -+ WSREP_DEBUG("kill IDLE for %llu", (long long)victim_trx->id); -+ -+ if (wsrep_thd_exec_mode(thd) == REPL_RECV) { -+ WSREP_DEBUG("kill BF IDLE, seqno: %lld", -+ (long long)wsrep_thd_trx_seqno(thd)); -+ wsrep_thd_UNLOCK(thd); -+ wsrep_abort_slave_trx(bf_seqno, -+ wsrep_thd_trx_seqno(thd)); -+ DBUG_RETURN(0); -+ } -+ /* This will lock thd from proceeding after net_read() */ -+ wsrep_thd_set_conflict_state(thd, ABORTING); -+ -+ mysql_mutex_lock(&LOCK_wsrep_rollback); -+ -+ abortees = wsrep_aborting_thd; -+ while (abortees && !skip_abort) { -+ /* check if we have a kill message for this already */ -+ if (abortees->aborting_thd == thd) { -+ skip_abort = true; -+ WSREP_WARN("duplicate thd aborter %lu", -+ wsrep_thd_thread_id(thd)); -+ } -+ abortees = abortees->next; -+ } -+ if (!skip_abort) { -+ wsrep_aborting_thd_t aborting = (wsrep_aborting_thd_t) -+ my_malloc(sizeof(struct wsrep_aborting_thd), -+ MYF(0)); -+ aborting->aborting_thd = thd; -+ aborting->next = wsrep_aborting_thd; -+ wsrep_aborting_thd = aborting; -+ DBUG_PRINT("wsrep",("enqueuing trx abort for %lu", -+ wsrep_thd_thread_id(thd))); -+ WSREP_DEBUG("enqueuing trx abort for (%lu)", -+ wsrep_thd_thread_id(thd)); -+ } -+ -+ DBUG_PRINT("wsrep",("signalling wsrep rollbacker")); -+ WSREP_DEBUG("signaling aborter"); -+ mysql_cond_signal(&COND_wsrep_rollback); -+ mysql_mutex_unlock(&LOCK_wsrep_rollback); -+ -+ break; -+ } -+ default: -+ WSREP_WARN("bad wsrep query state: %d", -+ wsrep_thd_query_state(thd)); -+ break; -+ } -+ wsrep_thd_UNLOCK(thd); -+ -+ DBUG_RETURN(0); -+} -+static int -+wsrep_abort_transaction(handlerton* hton, THD *bf_thd, THD *victim_thd, -+ my_bool signal) -+{ -+ DBUG_ENTER("wsrep_innobase_abort_thd"); -+ trx_t* victim_trx = thd_to_trx(victim_thd); -+ trx_t* bf_trx = (bf_thd) ? thd_to_trx(bf_thd) : NULL; -+ WSREP_DEBUG("abort transaction: BF: %s victim: %s", -+ wsrep_thd_query(bf_thd), -+ wsrep_thd_query(victim_thd)); -+ -+ if (victim_trx) -+ { -+ lock_mutex_enter(); -+ trx_mutex_enter(victim_trx); -+ int rcode = wsrep_innobase_kill_one_trx(bf_thd, bf_trx, -+ victim_trx, signal); -+ trx_mutex_exit(victim_trx); -+ lock_mutex_exit(); -+ wsrep_srv_conc_cancel_wait(victim_trx); -+ -+ DBUG_RETURN(rcode); -+ } else { -+ WSREP_DEBUG("victim does not have transaction"); -+ wsrep_thd_LOCK(victim_thd); -+ wsrep_thd_set_conflict_state(victim_thd, MUST_ABORT); -+ wsrep_thd_UNLOCK(victim_thd); -+ wsrep_thd_awake(victim_thd, signal); -+ } -+ DBUG_RETURN(-1); -+} -+ -+static int innobase_wsrep_set_checkpoint(handlerton* hton, const XID* xid) -+{ -+ DBUG_ASSERT(hton == innodb_hton_ptr); -+ if (wsrep_is_wsrep_xid(xid)) { -+ mtr_t mtr; -+ mtr_start(&mtr); -+ trx_sysf_t* sys_header = trx_sysf_get(&mtr); -+ trx_sys_update_wsrep_checkpoint(xid, sys_header, &mtr); -+ mtr_commit(&mtr); -+ innobase_flush_logs(hton); -+ return 0; -+ } else { -+ return 1; -+ } -+} -+ -+static int innobase_wsrep_get_checkpoint(handlerton* hton, XID* xid) -+{ -+ DBUG_ASSERT(hton == innodb_hton_ptr); -+ trx_sys_read_wsrep_checkpoint(xid); -+ return 0; -+} -+ -+static void -+wsrep_fake_trx_id( -+/*==================*/ -+ handlerton *hton, -+ THD *thd) /*!< in: user thread handle */ -+{ -+ trx_id_t trx_id = trx_sys_get_new_trx_id(); -+ -+ (void *)wsrep_ws_handle_for_trx(wsrep_thd_ws_handle(thd), trx_id); -+} -+ -+#endif /* WITH_WSREP */ - /* plugin options */ - - static MYSQL_SYSVAR_ENUM(checksum_algorithm, srv_checksum_algorithm, -@@ -16359,6 +17791,40 @@ static MYSQL_SYSVAR_BOOL(disable_background_merge, - NULL, NULL, FALSE); - #endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */ - -+#ifdef WITH_INNODB_DISALLOW_WRITES -+/******************************************************* -+ * innobase_disallow_writes variable definition * -+ *******************************************************/ -+ -+/* Must always init to FALSE. */ -+static my_bool innobase_disallow_writes = FALSE; -+ -+/************************************************************************** -+An "update" method for innobase_disallow_writes variable. */ -+static -+void -+innobase_disallow_writes_update( -+/*============================*/ -+ THD* thd, /* in: thread handle */ -+ st_mysql_sys_var* var, /* in: pointer to system -+ variable */ -+ void* var_ptr, /* out: pointer to dynamic -+ variable */ -+ const void* save) /* in: temporary storage */ -+{ -+ *(my_bool*)var_ptr = *(my_bool*)save; -+ ut_a(srv_allow_writes_event); -+ if (*(my_bool*)var_ptr) -+ os_event_reset(srv_allow_writes_event); -+ else -+ os_event_set(srv_allow_writes_event); -+} -+ -+static MYSQL_SYSVAR_BOOL(disallow_writes, innobase_disallow_writes, -+ PLUGIN_VAR_NOCMDOPT, -+ "Tell InnoDB to stop any writes to disk", -+ NULL, innobase_disallow_writes_update, FALSE); -+#endif /* WITH_INNODB_DISALLOW_WRITES */ - static MYSQL_SYSVAR_BOOL(random_read_ahead, srv_random_read_ahead, - PLUGIN_VAR_NOCMDARG, - "Whether to use read ahead for random access within an extent.", -@@ -16577,6 +18043,9 @@ static struct st_mysql_sys_var* innobase_system_variables[]= { - MYSQL_SYSVAR(change_buffering_debug), - MYSQL_SYSVAR(disable_background_merge), - #endif /* UNIV_DEBUG || UNIV_IBUF_DEBUG */ -+#ifdef WITH_INNODB_DISALLOW_WRITES -+ MYSQL_SYSVAR(disallow_writes), -+#endif /* WITH_INNODB_DISALLOW_WRITES */ - MYSQL_SYSVAR(random_read_ahead), - MYSQL_SYSVAR(read_ahead_threshold), - MYSQL_SYSVAR(read_only), -diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h -index f735b6f..45b8fd3 100644 ---- a/storage/innobase/handler/ha_innodb.h -+++ b/storage/innobase/handler/ha_innodb.h -@@ -95,6 +95,10 @@ class ha_innobase: public handler - void innobase_initialize_autoinc(); - dict_index_t* innobase_get_index(uint keynr); - -+#ifdef WITH_WSREP -+ int wsrep_append_keys(THD *thd, bool shared, -+ const uchar* record0, const uchar* record1); -+#endif - /* Init values for the class: */ - public: - ha_innobase(handlerton *hton, TABLE_SHARE *table_arg); -@@ -440,6 +444,38 @@ bool thd_is_strict_mode(const MYSQL_THD thd) - __attribute__((nonnull)); - } /* extern "C" */ - -+#ifdef WITH_WSREP -+#include -+extern "C" bool wsrep_thd_is_wsrep_on(THD *thd); -+ -+extern "C" enum wsrep_exec_mode wsrep_thd_exec_mode(THD *thd); -+extern "C" enum wsrep_conflict_state wsrep_thd_conflict_state(THD *thd); -+extern "C" enum wsrep_query_state wsrep_thd_query_state(THD *thd); -+extern "C" const char * wsrep_thd_exec_mode_str(THD *thd); -+extern "C" const char * wsrep_thd_conflict_state_str(THD *thd); -+extern "C" const char * wsrep_thd_query_state_str(THD *thd); -+extern "C" wsrep_ws_handle_t* wsrep_thd_ws_handle(THD *thd); -+ -+extern "C" void wsrep_thd_set_exec_mode(THD *thd, enum wsrep_exec_mode mode); -+extern "C" void wsrep_thd_set_query_state( -+ THD *thd, enum wsrep_query_state state); -+extern "C" void wsrep_thd_set_conflict_state( -+ THD *thd, enum wsrep_conflict_state state); -+ -+extern "C" void wsrep_thd_set_trx_to_replay(THD *thd, uint64 trx_id); -+ -+extern "C"void wsrep_thd_LOCK(THD *thd); -+extern "C"void wsrep_thd_UNLOCK(THD *thd); -+extern "C" uint32 wsrep_thd_wsrep_rand(THD *thd); -+extern "C" time_t wsrep_thd_query_start(THD *thd); -+extern "C" my_thread_id wsrep_thd_thread_id(THD *thd); -+extern "C" int64_t wsrep_thd_trx_seqno(THD *thd); -+extern "C" query_id_t wsrep_thd_query_id(THD *thd); -+extern "C" char * wsrep_thd_query(THD *thd); -+extern "C" query_id_t wsrep_thd_wsrep_last_query_id(THD *thd); -+extern "C" void wsrep_thd_set_wsrep_last_query_id(THD *thd, query_id_t id); -+extern "C" void wsrep_thd_awake(THD *thd, my_bool signal); -+#endif - struct trx_t; - - extern const struct _ft_vft ft_vft_result; -diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc -index 19812ce..4f2c8d4 100644 ---- a/storage/innobase/handler/handler0alter.cc -+++ b/storage/innobase/handler/handler0alter.cc -@@ -46,6 +46,10 @@ Smart ALTER TABLE - #include "srv0mon.h" - #include "fts0priv.h" - #include "pars0pars.h" -+#ifdef WITH_WSREP -+//#include "wsrep_api.h" -+#include // PROCESS_ACL -+#endif - #include "row0sel.h" - #include "ha_innodb.h" - -diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h -index 460a7e1..5b9f052 100644 ---- a/storage/innobase/include/dict0mem.h -+++ b/storage/innobase/include/dict0mem.h -@@ -484,6 +484,9 @@ be REC_VERSION_56_MAX_INDEX_COL_LEN (3072) bytes */ - - /** Defines the maximum fixed length column size */ - #define DICT_MAX_FIXED_COL_LEN DICT_ANTELOPE_MAX_INDEX_COL_LEN -+#ifdef WITH_WSREP -+#define WSREP_MAX_SUPPORTED_KEY_LENGTH 3500 -+#endif /* WITH_WSREP */ - - /** Data structure for a field in an index */ - struct dict_field_t{ -@@ -767,6 +770,23 @@ struct dict_foreign_with_index { - const dict_index_t* m_index; - }; - -+#ifdef WITH_WSREP -+/** A function object to find a foreign key with the given index as the -+foreign index. Return the foreign key with matching criteria or NULL */ -+struct dict_foreign_with_foreign_index { -+ -+ dict_foreign_with_foreign_index(const dict_index_t* index) -+ : m_index(index) -+ {} -+ -+ bool operator()(const dict_foreign_t* foreign) const -+ { -+ return(foreign->foreign_index == m_index); -+ } -+ -+ const dict_index_t* m_index; -+}; -+#endif - /* A function object to check if the foreign constraint is between different - tables. Returns true if foreign key constraint is between different tables, - false otherwise. */ -diff --git a/storage/innobase/include/ha_prototypes.h b/storage/innobase/include/ha_prototypes.h -index fa202aa..330bd3b 100644 ---- a/storage/innobase/include/ha_prototypes.h -+++ b/storage/innobase/include/ha_prototypes.h -@@ -273,6 +273,23 @@ innobase_casedn_str( - /*================*/ - char* a); /*!< in/out: string to put in lower case */ - -+#ifdef WITH_WSREP -+UNIV_INTERN -+int -+wsrep_innobase_kill_one_trx(void *thd_ptr, -+ const trx_t *bf_trx, trx_t *victim_trx, ibool signal); -+my_bool wsrep_thd_set_PA_safe(void *thd_ptr, my_bool safe); -+int wsrep_thd_conflict_state(void *thd_ptr, my_bool sync); -+my_bool wsrep_thd_is_BF(void *thd_ptr, my_bool sync); -+int wsrep_trx_order_before(void *thd1, void *thd2); -+int wsrep_innobase_mysql_sort(int mysql_type, uint charset_number, -+ unsigned char* str, unsigned int str_length, -+ unsigned int buf_length); -+UNIV_INTERN -+int -+wsrep_on(void *thd_ptr); -+int wsrep_is_wsrep_xid(const void*); -+#endif /* WITH_WSREP */ - /**********************************************************************//** - Determines the connection character set. - @return connection character set */ -diff --git a/storage/innobase/include/hash0hash.h b/storage/innobase/include/hash0hash.h -index 6f9a628..9a4077b 100644 ---- a/storage/innobase/include/hash0hash.h -+++ b/storage/innobase/include/hash0hash.h -@@ -144,6 +144,33 @@ do {\ - }\ - } while (0) - -+#ifdef WITH_WSREP -+/*******************************************************************//** -+Inserts a struct to the head of hash table. */ -+ -+#define HASH_PREPEND(TYPE, NAME, TABLE, FOLD, DATA) \ -+do { \ -+ hash_cell_t* cell3333; \ -+ TYPE* struct3333; \ -+ \ -+ HASH_ASSERT_OWN(TABLE, FOLD) \ -+ \ -+ (DATA)->NAME = NULL; \ -+ \ -+ cell3333 = hash_get_nth_cell(TABLE, hash_calc_hash(FOLD, TABLE));\ -+ \ -+ if (cell3333->node == NULL) { \ -+ cell3333->node = DATA; \ -+ DATA->NAME = NULL; \ -+ } else { \ -+ struct3333 = (TYPE*) cell3333->node; \ -+ \ -+ DATA->NAME = struct3333; \ -+ \ -+ cell3333->node = DATA; \ -+ } \ -+} while (0) -+#endif /*WITH_WSREP */ - #ifdef UNIV_HASH_DEBUG - # define HASH_ASSERT_VALID(DATA) ut_a((void*) (DATA) != (void*) -1) - # define HASH_INVALIDATE(DATA, NAME) *(void**) (&DATA->NAME) = (void*) -1 -diff --git a/storage/innobase/include/lock0lock.h b/storage/innobase/include/lock0lock.h -index 6d5ed35..385853b 100644 ---- a/storage/innobase/include/lock0lock.h -+++ b/storage/innobase/include/lock0lock.h -@@ -972,6 +972,16 @@ extern lock_sys_t* lock_sys; - mutex_exit(&lock_sys->wait_mutex); \ - } while (0) - -+#ifdef WITH_WSREP -+/*********************************************************************//** -+Cancels a waiting lock request and releases possible other transactions -+waiting behind it. */ -+UNIV_INTERN -+void -+lock_cancel_waiting_and_release( -+/*============================*/ -+ lock_t* lock); /*!< in/out: waiting lock request */ -+#endif /* WITH_WSREP */ - #ifndef UNIV_NONINL - #include "lock0lock.ic" - #endif -diff --git a/storage/innobase/include/rem0rec.h b/storage/innobase/include/rem0rec.h -index 8e7d5ff..5dc4971 100644 ---- a/storage/innobase/include/rem0rec.h -+++ b/storage/innobase/include/rem0rec.h -@@ -981,6 +981,15 @@ are given in one byte (resp. two byte) format. */ - two upmost bits in a two byte offset for special purposes */ - #define REC_MAX_DATA_SIZE (16 * 1024) - -+#ifdef WITH_WSREP -+dberr_t wsrep_rec_get_foreign_key( -+ byte *buf, /* out: extracted key */ -+ ulint *buf_len, /* in/out: length of buf */ -+ const rec_t* rec, /* in: physical record */ -+ dict_index_t* index_for, /* in: index for foreign table */ -+ dict_index_t* index_ref, /* in: index for referenced table */ -+ ibool new_protocol); /* in: protocol > 1 */ -+#endif /* WITH_WSREP */ - #ifndef UNIV_NONINL - #include "rem0rec.ic" - #endif -diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h -index 7a6c9f9..4b40c36 100644 ---- a/storage/innobase/include/srv0srv.h -+++ b/storage/innobase/include/srv0srv.h -@@ -257,6 +257,10 @@ extern ulong srv_flush_log_at_trx_commit; - extern uint srv_flush_log_at_timeout; - extern char srv_adaptive_flushing; - -+#ifdef WITH_INNODB_DISALLOW_WRITES -+/* When this event is reset we do not allow any file writes to take place. */ -+extern os_event_t srv_allow_writes_event; -+#endif /* WITH_INNODB_DISALLOW_WRITES */ - /* If this flag is TRUE, then we will load the indexes' (and tables') metadata - even if they are marked as "corrupted". Mostly it is for DBA to process - corrupted index and table */ -@@ -884,5 +888,13 @@ struct srv_slot_t{ - # define srv_start_raw_disk_in_use 0 - # define srv_file_per_table 1 - #endif /* !UNIV_HOTBACKUP */ -+#ifdef WITH_WSREP -+UNIV_INTERN -+void -+wsrep_srv_conc_cancel_wait( -+/*==================*/ -+ trx_t* trx); /*!< in: transaction object associated with the -+ thread */ -+#endif /* WITH_WSREP */ - - #endif -diff --git a/storage/innobase/include/sync0sync.ic b/storage/innobase/include/sync0sync.ic -index 616e53d..2a85d2b 100644 ---- a/storage/innobase/include/sync0sync.ic -+++ b/storage/innobase/include/sync0sync.ic -@@ -213,8 +213,10 @@ mutex_enter_func( - ulint line) /*!< in: line where locked */ - { - ut_ad(mutex_validate(mutex)); -+#ifndef WITH_WSREP -+ /* this cannot be be granted when BF trx kills a trx in lock wait state */ - ut_ad(!mutex_own(mutex)); -- -+#endif /* WITH_WSREP */ - /* Note that we do not peek at the value of lock_word before trying - the atomic test_and_set; we could peek, and possibly save time. */ - -diff --git a/storage/innobase/include/trx0sys.h b/storage/innobase/include/trx0sys.h -index 70f214d..28ed5bf 100644 ---- a/storage/innobase/include/trx0sys.h -+++ b/storage/innobase/include/trx0sys.h -@@ -41,6 +41,9 @@ Created 3/26/1996 Heikki Tuuri - #include "ut0bh.h" - #include "read0types.h" - #include "page0types.h" -+#ifdef WITH_WSREP -+#include "trx0xa.h" -+#endif /* WITH_WSREP */ - #include "ut0bh.h" - - typedef UT_LIST_BASE_NODE_T(trx_t) trx_list_t; -@@ -293,6 +296,9 @@ trx_sys_update_mysql_binlog_offset( - ib_int64_t offset, /*!< in: position in that log file */ - ulint field, /*!< in: offset of the MySQL log info field in - the trx sys header */ -+#ifdef WITH_WSREP -+ trx_sysf_t* sys_header, /*!< in: trx sys header */ -+#endif /* WITH_WSREP */ - mtr_t* mtr); /*!< in: mtr */ - /*****************************************************************//** - Prints to stderr the MySQL binlog offset info in the trx system header if -@@ -301,6 +307,19 @@ UNIV_INTERN - void - trx_sys_print_mysql_binlog_offset(void); - /*===================================*/ -+#ifdef WITH_WSREP -+/** Update WSREP checkpoint XID in sys header. */ -+void -+trx_sys_update_wsrep_checkpoint( -+ const XID* xid, /*!< in: WSREP XID */ -+ trx_sysf_t* sys_header, /*!< in: sys_header */ -+ mtr_t* mtr); /*!< in: mtr */ -+ -+void -+/** Read WSREP checkpoint XID from sys header. */ -+trx_sys_read_wsrep_checkpoint( -+ XID* xid); /*!< out: WSREP XID */ -+#endif /* WITH_WSREP */ - /*****************************************************************//** - Prints to stderr the MySQL master log offset info in the trx system header if - the magic number shows it valid. */ -@@ -529,6 +548,20 @@ this contains the same fields as TRX_SYS_MYSQL_LOG_INFO below */ - within that file */ - #define TRX_SYS_MYSQL_LOG_NAME 12 /*!< MySQL log file name */ - -+#ifdef WITH_WSREP -+/* The offset to WSREP XID headers */ -+#define TRX_SYS_WSREP_XID_INFO (UNIV_PAGE_SIZE - 3500) -+#define TRX_SYS_WSREP_XID_MAGIC_N_FLD 0 -+#define TRX_SYS_WSREP_XID_MAGIC_N 0x77737265 -+ -+/* XID field: formatID, gtrid_len, bqual_len, xid_data */ -+#define TRX_SYS_WSREP_XID_LEN (4 + 4 + 4 + XIDDATASIZE) -+#define TRX_SYS_WSREP_XID_FORMAT 4 -+#define TRX_SYS_WSREP_XID_GTRID_LEN 8 -+#define TRX_SYS_WSREP_XID_BQUAL_LEN 12 -+#define TRX_SYS_WSREP_XID_DATA 16 -+#endif /* WITH_WSREP*/ -+ - /** Doublewrite buffer */ - /* @{ */ - /** The offset of the doublewrite buffer header on the trx system header page */ -diff --git a/storage/innobase/include/trx0sys.ic b/storage/innobase/include/trx0sys.ic -index e097e29..7265a97 100644 ---- a/storage/innobase/include/trx0sys.ic -+++ b/storage/innobase/include/trx0sys.ic -@@ -445,7 +445,10 @@ trx_id_t - trx_sys_get_new_trx_id(void) - /*========================*/ - { -+#ifndef WITH_WSREP -+ /* wsrep_fake_trx_id violates this assert */ - ut_ad(mutex_own(&trx_sys->mutex)); -+#endif /* WITH_WSREP */ - - /* VERY important: after the database is started, max_trx_id value is - divisible by TRX_SYS_TRX_ID_WRITE_MARGIN, and the following if -diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h -index 144e180..6adbe2c 100644 ---- a/storage/innobase/include/trx0trx.h -+++ b/storage/innobase/include/trx0trx.h -@@ -1004,6 +1004,9 @@ struct trx_t{ - /*------------------------------*/ - char detailed_error[256]; /*!< detailed error message for last - error, or empty. */ -+#ifdef WITH_WSREP -+ os_event_t wsrep_event; /* event waited for in srv_conc_slot */ -+#endif /* WITH_WSREP */ - }; - - /* Transaction isolation levels (trx->isolation_level) */ -diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc -index bf7ca16..881507a 100644 ---- a/storage/innobase/lock/lock0lock.cc -+++ b/storage/innobase/lock/lock0lock.cc -@@ -50,6 +50,10 @@ Created 5/7/1996 Heikki Tuuri - #include "dict0boot.h" - #include - -+#ifdef WITH_WSREP -+extern my_bool wsrep_debug; -+extern my_bool wsrep_log_conflicts; -+#endif - /* Restricts the length of search we will do in the waits-for - graph of transactions */ - #define LOCK_MAX_N_STEPS_IN_DEADLOCK_CHECK 1000000 -@@ -945,6 +949,9 @@ UNIV_INLINE - ibool - lock_rec_has_to_wait( - /*=================*/ -+#ifdef WITH_WSREP -+ ibool for_locking, /*!< is caller locking or releasing */ -+#endif /* WITH_WSREP */ - const trx_t* trx, /*!< in: trx of new lock */ - ulint type_mode,/*!< in: precise mode of the new lock - to set: LOCK_S or LOCK_X, possibly -@@ -1015,9 +1022,59 @@ lock_rec_has_to_wait( - return(FALSE); - } - -+#ifdef WITH_WSREP -+ /* if BF thread is locking and has conflict with another BF -+ thread, we need to look at trx ordering and lock types */ -+ if (wsrep_thd_is_BF(trx->mysql_thd, FALSE) && -+ wsrep_thd_is_BF(lock2->trx->mysql_thd, TRUE)) { -+ -+ if (wsrep_debug) { -+ fprintf(stderr, -+ "BF-BF lock conflict, locking: %lu\n", -+ for_locking); -+ lock_rec_print(stderr, lock2); -+ } -+ -+ if (wsrep_trx_order_before(trx->mysql_thd, -+ lock2->trx->mysql_thd) && -+ (type_mode & LOCK_MODE_MASK) == LOCK_X && -+ (lock2->type_mode & LOCK_MODE_MASK) == LOCK_X) -+ { -+ if (for_locking || wsrep_debug) { -+ /* exclusive lock conflicts are not -+ accepted */ -+ fprintf(stderr, -+ "BF-BF X lock conflict," -+ "mode: %lu supremum: %lu\n", -+ type_mode, lock_is_on_supremum); -+ fprintf(stderr, -+ "conflicts states: my %d locked %d\n", -+ wsrep_thd_conflict_state(trx->mysql_thd, FALSE), -+ wsrep_thd_conflict_state(lock2->trx->mysql_thd, FALSE) ); -+ lock_rec_print(stderr, lock2); -+ if (for_locking) return FALSE; -+ //abort(); -+ } -+ } else { -+ /* if lock2->index->n_uniq <= -+ lock2->index->n_user_defined_cols -+ operation is on uniq index -+ */ -+ if (wsrep_debug) fprintf(stderr, -+ "BF conflict, modes: %lu %lu, " -+ "idx: %s-%s n_uniq %u n_user %u\n", -+ type_mode, lock2->type_mode, -+ lock2->index->name, -+ lock2->index->table_name, -+ lock2->index->n_uniq, -+ lock2->index->n_user_defined_cols); -+ return FALSE; -+ } -+ } -+#endif /* WITH_WSREP */ - return(TRUE); - } -- -+ - return(FALSE); - } - -@@ -1045,7 +1102,11 @@ lock_has_to_wait( - /* If this lock request is for a supremum record - then the second bit on the lock bitmap is set */ - -+#ifdef WITH_WSREP -+ return(lock_rec_has_to_wait(FALSE, lock1->trx, -+#else - return(lock_rec_has_to_wait(lock1->trx, -+#endif /* WITH_WSREP */ - lock1->type_mode, lock2, - lock_rec_get_nth_bit( - lock1, 1))); -@@ -1514,6 +1575,11 @@ lock_rec_has_expl( - return(NULL); - } - -+#ifdef WITH_WSREP -+static -+void -+lock_rec_discard(lock_t* in_lock); -+#endif - #ifdef UNIV_DEBUG - /*********************************************************************//** - Checks if some other transaction has a lock request in the queue. -@@ -1562,6 +1628,58 @@ lock_rec_other_has_expl_req( - } - #endif /* UNIV_DEBUG */ - -+#ifdef WITH_WSREP -+static void -+wsrep_kill_victim(const trx_t * const trx, const lock_t *lock) { -+ ut_ad(lock_mutex_own()); -+ ut_ad(trx_mutex_own(lock->trx)); -+ my_bool bf_this = wsrep_thd_is_BF(trx->mysql_thd, FALSE); -+ my_bool bf_other = wsrep_thd_is_BF(lock->trx->mysql_thd, TRUE); -+ -+ if ((bf_this && !bf_other) || -+ (bf_this && bf_other && wsrep_trx_order_before( -+ trx->mysql_thd, lock->trx->mysql_thd))) { -+ -+ if (lock->trx->lock.que_state == TRX_QUE_LOCK_WAIT) { -+ if (wsrep_debug) -+ fprintf(stderr, "WSREP: BF victim waiting\n"); -+ /* cannot release lock, until our lock -+ is in the queue*/ -+ } else if (lock->trx != trx) { -+ if (wsrep_log_conflicts) { -+ mutex_enter(&trx_sys->mutex); -+ if (bf_this) -+ fputs("\n*** Priority TRANSACTION:\n", -+ stderr); -+ else -+ fputs("\n*** Victim TRANSACTION:\n", -+ stderr); -+ trx_print_latched(stderr, trx, 3000); -+ -+ if (bf_other) -+ fputs("\n*** Priority TRANSACTION:\n", -+ stderr); -+ else -+ fputs("\n*** Victim TRANSACTION:\n", -+ stderr); -+ trx_print_latched(stderr, lock->trx, 3000); -+ -+ mutex_exit(&trx_sys->mutex); -+ fputs("*** WAITING FOR THIS LOCK TO BE GRANTED:\n", -+ stderr); -+ -+ if (lock_get_type(lock) == LOCK_REC) { -+ lock_rec_print(stderr, lock); -+ } else { -+ lock_table_print(stderr, lock); -+ } -+ } -+ wsrep_innobase_kill_one_trx(trx->mysql_thd, -+ (const trx_t*) trx, lock->trx, TRUE); -+ } -+ } -+} -+#endif - /*********************************************************************//** - Checks if some other transaction has a conflicting explicit lock request - in the queue, so that we have to wait. -@@ -1590,7 +1708,14 @@ lock_rec_other_has_conflicting( - lock != NULL; - lock = lock_rec_get_next_const(heap_no, lock)) { - -+#ifdef WITH_WSREP -+ if (lock_rec_has_to_wait(TRUE, trx, mode, lock, is_supremum)) { -+ trx_mutex_enter(lock->trx); -+ wsrep_kill_victim(trx, lock); -+ trx_mutex_exit(lock->trx); -+#else - if (lock_rec_has_to_wait(trx, mode, lock, is_supremum)) { -+#endif /* WITH_WSREP */ - return(lock); - } - } -@@ -1683,6 +1808,7 @@ lock_sec_rec_some_has_impl( - return(trx_id); - } - -+#ifndef WITH_WSREP - #ifdef UNIV_DEBUG - /*********************************************************************//** - Checks if some transaction, other than given trx_id, has an explicit -@@ -1733,6 +1859,7 @@ lock_rec_other_trx_holds_expl( - return(holds); - } - #endif /* UNIV_DEBUG */ -+#endif /* !WITH_WSREP */ - - /*********************************************************************//** - Return approximate number or record locks (bits set in the bitmap) for -@@ -1770,6 +1897,27 @@ lock_number_of_rows_locked( - } - - /*============== RECORD LOCK CREATION AND QUEUE MANAGEMENT =============*/ -+#ifdef WITH_WSREP -+static -+void -+wsrep_print_wait_locks( -+/*============*/ -+ lock_t* c_lock) /* conflicting lock to print */ -+{ -+ if (wsrep_debug && c_lock->trx->lock.wait_lock != c_lock) { -+ fprintf(stderr, "WSREP: c_lock != wait lock\n"); -+ if (lock_get_type_low(c_lock) & LOCK_TABLE) -+ lock_table_print(stderr, c_lock); -+ else -+ lock_rec_print(stderr, c_lock); -+ -+ if (lock_get_type_low(c_lock->trx->lock.wait_lock) & LOCK_TABLE) -+ lock_table_print(stderr, c_lock->trx->lock.wait_lock); -+ else -+ lock_rec_print(stderr, c_lock->trx->lock.wait_lock); -+ } -+} -+#endif /* WITH_WSREP */ - - /*********************************************************************//** - Creates a new record lock and inserts it to the lock queue. Does NOT check -@@ -1779,6 +1927,10 @@ static - lock_t* - lock_rec_create( - /*============*/ -+#ifdef WITH_WSREP -+ lock_t* const c_lock, /* conflicting lock */ -+ que_thr_t* thr, -+#endif - ulint type_mode,/*!< in: lock mode and wait - flag, type is ignored and - replaced by LOCK_REC */ -@@ -1850,9 +2002,79 @@ lock_rec_create( - - ut_ad(index->table->n_ref_count > 0 || !index->table->can_be_evicted); - -+#ifdef WITH_WSREP -+ -+ if (c_lock && wsrep_thd_is_BF(trx->mysql_thd, FALSE)) { -+ lock_t *hash = (lock_t *)c_lock->hash; -+ lock_t *prev = NULL; -+ -+ while (hash && -+ wsrep_thd_is_BF(((lock_t *)hash)->trx->mysql_thd, TRUE) && -+ wsrep_trx_order_before( -+ ((lock_t *)hash)->trx->mysql_thd, -+ trx->mysql_thd)) { -+ prev = hash; -+ hash = (lock_t *)hash->hash; -+ } -+ lock->hash = hash; -+ if (prev) { -+ prev->hash = lock; -+ } else { -+ c_lock->hash = lock; -+ } -+ /* -+ * delayed conflict resolution '...kill_one_trx' was not called, -+ * if victim was waiting for some other lock -+ */ -+ trx_mutex_enter(c_lock->trx); -+ if (c_lock->trx->lock.que_state == TRX_QUE_LOCK_WAIT) { -+ -+ c_lock->trx->lock.was_chosen_as_deadlock_victim = TRUE; -+ -+ if (wsrep_debug) wsrep_print_wait_locks(c_lock); -+ -+ trx->lock.que_state = TRX_QUE_LOCK_WAIT; -+ lock_set_lock_and_trx_wait(lock, trx); -+ UT_LIST_ADD_LAST(trx_locks, trx->lock.trx_locks, lock); -+ -+ ut_ad(thr != NULL); -+ trx->lock.wait_thr = thr; -+ thr->state = QUE_THR_LOCK_WAIT; -+ -+ /* have to release trx mutex for the duration of -+ victim lock release. This will eventually call -+ lock_grant, which wants to grant trx mutex again -+ */ -+ if (caller_owns_trx_mutex) trx_mutex_exit(trx); -+ lock_cancel_waiting_and_release( -+ c_lock->trx->lock.wait_lock); -+ if (caller_owns_trx_mutex) trx_mutex_enter(trx); -+ -+ /* trx might not wait for c_lock, but some other lock -+ does not matter if wait_lock was released above -+ */ -+ if (c_lock->trx->lock.wait_lock == c_lock) { -+ lock_reset_lock_and_trx_wait(lock); -+ } -+ trx_mutex_exit(c_lock->trx); -+ -+ if (wsrep_debug) fprintf( -+ stderr, -+ "WSREP: c_lock canceled %llu\n", -+ (ulonglong) c_lock->trx->id); -+ -+ /* have to bail out here to avoid lock_set_lock... */ -+ return(lock); -+ } -+ trx_mutex_exit(c_lock->trx); -+ } else { -+ HASH_INSERT(lock_t, hash, lock_sys->rec_hash, -+ lock_rec_fold(space, page_no), lock); -+ } -+#else - HASH_INSERT(lock_t, hash, lock_sys->rec_hash, - lock_rec_fold(space, page_no), lock); -- -+#endif /* WITH_WSREP */ - if (!caller_owns_trx_mutex) { - trx_mutex_enter(trx); - } -@@ -1871,7 +2093,6 @@ lock_rec_create( - - MONITOR_INC(MONITOR_RECLOCK_CREATED); - MONITOR_INC(MONITOR_NUM_RECLOCK); -- - return(lock); - } - -@@ -1886,6 +2107,9 @@ static - dberr_t - lock_rec_enqueue_waiting( - /*=====================*/ -+#ifdef WITH_WSREP -+ lock_t* c_lock, /* conflicting lock */ -+#endif - ulint type_mode,/*!< in: lock mode this - transaction is requesting: - LOCK_S or LOCK_X, possibly -@@ -1942,8 +2166,17 @@ lock_rec_enqueue_waiting( - - /* Enqueue the lock request that will wait to be granted, note that - we already own the trx mutex. */ -+#ifdef WITH_WSREP -+ if (wsrep_on(trx->mysql_thd) && -+ trx->lock.was_chosen_as_deadlock_victim) { -+ return(DB_DEADLOCK); -+ } -+ lock = lock_rec_create(c_lock, thr, -+ type_mode | LOCK_WAIT, block, heap_no, index, trx, TRUE); -+#else - lock = lock_rec_create( - type_mode | LOCK_WAIT, block, heap_no, index, trx, TRUE); -+#endif /* WITH_WSREP */ - - /* Release the mutex to obey the latching order. - This is safe, because lock_deadlock_check_and_resolve() -@@ -2044,7 +2277,19 @@ lock_rec_add_to_queue( - const lock_t* other_lock - = lock_rec_other_has_expl_req(mode, 0, LOCK_WAIT, - block, heap_no, trx); -+#ifdef WITH_WSREP -+ /* this can potentionally assert with wsrep */ -+ if (wsrep_on(trx->mysql_thd)) { -+ if (wsrep_debug && other_lock) { -+ fprintf(stderr, -+ "WSREP: InnoDB assert ignored\n"); -+ } -+ } else { -+ ut_a(!other_lock); -+ } -+#else - ut_a(!other_lock); -+#endif /* WITH_WSREP */ - } - #endif /* UNIV_DEBUG */ - -@@ -2072,7 +2317,16 @@ lock_rec_add_to_queue( - - if (lock_get_wait(lock) - && lock_rec_get_nth_bit(lock, heap_no)) { -- -+#ifdef WITH_WSREP -+ if (wsrep_thd_is_BF(trx->mysql_thd, FALSE)) { -+ if (wsrep_debug) { -+ fprintf(stderr, -+ "BF skipping wait: %lu\n", -+ trx->id); -+ lock_rec_print(stderr, lock); -+ } -+ } else -+#endif - goto somebody_waits; - } - } -@@ -2095,9 +2349,15 @@ lock_rec_add_to_queue( - } - - somebody_waits: -+#ifdef WITH_WSREP -+ return(lock_rec_create(NULL, NULL, -+ type_mode, block, heap_no, index, trx, -+ caller_owns_trx_mutex)); -+#else - return(lock_rec_create( - type_mode, block, heap_no, index, trx, - caller_owns_trx_mutex)); -+#endif - } - - /** Record locking request status */ -@@ -2160,9 +2420,13 @@ lock_rec_lock_fast( - if (lock == NULL) { - if (!impl) { - /* Note that we don't own the trx mutex. */ -+#ifdef WITH_WSREP -+ lock = lock_rec_create(NULL, thr, -+ mode, block, heap_no, index, trx, FALSE); -+#else - lock = lock_rec_create( - mode, block, heap_no, index, trx, FALSE); -- -+#endif - } - status = LOCK_REC_SUCCESS_CREATED; - } else { -@@ -2215,6 +2479,9 @@ lock_rec_lock_slow( - que_thr_t* thr) /*!< in: query thread */ - { - trx_t* trx; -+#ifdef WITH_WSREP -+ lock_t* c_lock(NULL); -+#endif - dberr_t err = DB_SUCCESS; - - ut_ad(lock_mutex_own()); -@@ -2239,18 +2506,30 @@ lock_rec_lock_slow( - /* The trx already has a strong enough lock on rec: do - nothing */ - -+#ifdef WITH_WSREP -+ } else if ((c_lock = (lock_t *)lock_rec_other_has_conflicting( -+ static_cast(mode), -+ block, heap_no, trx))) { -+#else - } else if (lock_rec_other_has_conflicting( - static_cast(mode), - block, heap_no, trx)) { -- -+#endif /* WITH_WSREP */ - /* If another transaction has a non-gap conflicting - request in the queue, as this transaction does not - have a lock strong enough already granted on the - record, we have to wait. */ - -+#ifdef WITH_WSREP -+ /* c_lock is NULL here if jump to enqueue_waiting happened -+ but it's ok because lock is not NULL in that case and c_lock -+ is not used. */ -+ err = lock_rec_enqueue_waiting(c_lock, -+ mode, block, heap_no, index, thr); -+#else - err = lock_rec_enqueue_waiting( - mode, block, heap_no, index, thr); -- -+#endif /* WITH_WSREP */ - } else if (!impl) { - /* Set the requested lock on the record, note that - we already own the transaction mutex. */ -@@ -2355,7 +2634,13 @@ lock_rec_has_to_wait_in_queue( - if (heap_no < lock_rec_get_n_bits(lock) - && (p[bit_offset] & bit_mask) - && lock_has_to_wait(wait_lock, lock)) { -- -+#ifdef WITH_WSREP -+ if (wsrep_thd_is_BF(wait_lock->trx->mysql_thd, FALSE) && -+ wsrep_thd_is_BF(lock->trx->mysql_thd, TRUE)) { -+ /* don't wait for another BF lock */ -+ continue; -+ } -+#endif - return(lock); - } - } -@@ -3739,9 +4024,19 @@ lock_deadlock_select_victim( - /* The joining transaction is 'smaller', - choose it as the victim and roll it back. */ - -+#ifdef WITH_WSREP -+ if (wsrep_thd_is_BF(ctx->start->mysql_thd, TRUE)) -+ return(ctx->wait_lock->trx); -+ else -+#endif /* WITH_WSREP */ - return(ctx->start); - } - -+#ifdef WITH_WSREP -+ if (wsrep_thd_is_BF(ctx->wait_lock->trx->mysql_thd, TRUE)) -+ return(ctx->start); -+ else -+#endif /* WITH_WSREP */ - return(ctx->wait_lock->trx); - } - -@@ -3872,6 +4167,11 @@ lock_deadlock_search( - ctx->too_deep = TRUE; - - /* Select the joining transaction as the victim. */ -+#ifdef WITH_WSREP -+ if (wsrep_thd_is_BF(ctx->start->mysql_thd, TRUE)) -+ return(ctx->wait_lock->trx->id); -+ else -+#endif /* WITH_WSREP */ - return(ctx->start->id); - - } else if (lock->trx->lock.que_state == TRX_QUE_LOCK_WAIT) { -@@ -3889,6 +4189,11 @@ lock_deadlock_search( - - ctx->too_deep = TRUE; - -+#ifdef WITH_WSREP -+ if (wsrep_thd_is_BF(ctx->start->mysql_thd, TRUE)) -+ return(lock->trx->id); -+ else -+#endif /* WITH_WSREP */ - return(ctx->start->id); - } - -@@ -4005,11 +4310,21 @@ lock_deadlock_check_and_resolve( - if (ctx.too_deep) { - - ut_a(trx == ctx.start); -+ -+#ifdef WITH_WSREP -+ if (!wsrep_thd_is_BF(ctx.start->mysql_thd, TRUE)) -+ { -+#endif /* WITH_WSREP */ - ut_a(victim_trx_id == trx->id); - - if (!srv_read_only_mode) { - lock_deadlock_joining_trx_print(trx, lock); - } -+#ifdef WITH_WSREP -+ } else { -+ /* BF processor */; -+ } -+#endif /* WITH_WSREP */ - - MONITOR_INC(MONITOR_DEADLOCK); - -@@ -4047,6 +4362,9 @@ UNIV_INLINE - lock_t* - lock_table_create( - /*==============*/ -+#ifdef WITH_WSREP -+ lock_t* c_lock, /* conflicting lock */ -+#endif - dict_table_t* table, /*!< in/out: database table - in dictionary cache */ - ulint type_mode,/*!< in: lock mode possibly ORed with -@@ -4090,7 +4408,46 @@ lock_table_create( - ut_ad(table->n_ref_count > 0 || !table->can_be_evicted); - - UT_LIST_ADD_LAST(trx_locks, trx->lock.trx_locks, lock); -+#ifdef WITH_WSREP -+ if (c_lock && wsrep_thd_is_BF(trx->mysql_thd, FALSE)) { -+ UT_LIST_INSERT_AFTER( -+ un_member.tab_lock.locks, table->locks, c_lock, lock); -+ } else { -+ UT_LIST_ADD_LAST(un_member.tab_lock.locks, table->locks, lock); -+ } -+ -+ if (c_lock) trx_mutex_enter(c_lock->trx); -+ if (c_lock && c_lock->trx->lock.que_state == TRX_QUE_LOCK_WAIT) { -+ -+ c_lock->trx->lock.was_chosen_as_deadlock_victim = TRUE; -+ -+ if (wsrep_debug) wsrep_print_wait_locks(c_lock); -+ -+ /* have to release trx mutex for the duration of -+ victim lock release. This will eventually call -+ lock_grant, which wants to grant trx mutex again -+ */ -+ /* caller has trx_mutex, have to release for lock cancel */ -+ trx_mutex_exit(trx); -+ lock_cancel_waiting_and_release(c_lock->trx->lock.wait_lock); -+ trx_mutex_enter(trx); -+ -+ /* trx might not wait for c_lock, but some other lock -+ does not matter if wait_lock was released above -+ */ -+ if (c_lock->trx->lock.wait_lock == c_lock) { -+ lock_reset_lock_and_trx_wait(lock); -+ } -+ -+ if (wsrep_debug) { -+ fprintf(stderr, "WSREP: c_lock canceled %llu\n", -+ (ulonglong) c_lock->trx->id); -+ } -+ } -+ if (c_lock) trx_mutex_exit(c_lock->trx); -+#else - UT_LIST_ADD_LAST(un_member.tab_lock.locks, table->locks, lock); -+#endif /* WITH_WSREP */ - - if (UNIV_UNLIKELY(type_mode & LOCK_WAIT)) { - -@@ -4247,12 +4604,15 @@ static - dberr_t - lock_table_enqueue_waiting( - /*=======================*/ -+#ifdef WITH_WSREP -+ lock_t* c_lock, /* conflicting lock */ -+#endif - ulint mode, /*!< in: lock mode this transaction is - requesting */ - dict_table_t* table, /*!< in/out: table */ - que_thr_t* thr) /*!< in: query thread */ - { -- trx_t* trx; -+ trx_t* trx; - lock_t* lock; - trx_id_t victim_trx_id; - -@@ -4291,7 +4651,14 @@ lock_table_enqueue_waiting( - - /* Enqueue the lock request that will wait to be granted */ - -+#ifdef WITH_WSREP -+ if (trx->lock.was_chosen_as_deadlock_victim) { -+ return(DB_DEADLOCK); -+ } -+ lock = lock_table_create(c_lock, table, mode | LOCK_WAIT, trx); -+#else - lock = lock_table_create(table, mode | LOCK_WAIT, trx); -+#endif - - /* Release the mutex to obey the latching order. - This is safe, because lock_deadlock_check_and_resolve() -@@ -4363,6 +4730,13 @@ lock_table_other_has_incompatible( - && !lock_mode_compatible(lock_get_mode(lock), mode) - && (wait || !lock_get_wait(lock))) { - -+#ifdef WITH_WSREP -+ if (wsrep_debug) -+ fprintf(stderr, "WSREP: table lock abort"); -+ trx_mutex_enter(lock->trx); -+ wsrep_kill_victim((trx_t *)trx, (lock_t *)lock); -+ trx_mutex_exit(lock->trx); -+#endif - return(lock); - } - } -@@ -4424,9 +4798,18 @@ lock_table( - mode: this trx may have to wait */ - - if (wait_for != NULL) { -+#ifdef WITH_WSREP -+ err = lock_table_enqueue_waiting((lock_t *)wait_for, -+ mode | flags, table, thr); -+#else - err = lock_table_enqueue_waiting(mode | flags, table, thr); -+#endif /* WITH_WSREP */ - } else { -+#ifdef WITH_WSREP -+ lock_table_create((lock_t *)wait_for, table, mode | flags, trx); -+#else - lock_table_create(table, mode | flags, trx); -+#endif /* WITH_WSREP */ - - ut_a(!flags || mode == LOCK_S || mode == LOCK_X); - -@@ -4464,7 +4847,11 @@ lock_table_ix_resurrect( - trx, LOCK_WAIT, table, LOCK_IX)); - - trx_mutex_enter(trx); -+#ifdef WITH_WSREP -+ lock_table_create(NULL, table, LOCK_IX, trx); -+#else - lock_table_create(table, LOCK_IX, trx); -+#endif /* WITH_WSREP */ - lock_mutex_exit(); - trx_mutex_exit(trx); - } -@@ -5612,6 +5999,7 @@ lock_rec_queue_validate( - - if (!lock_rec_get_gap(lock) && !lock_get_wait(lock)) { - -+#ifndef WITH_WSREP - enum lock_mode mode; - - if (lock_get_mode(lock) == LOCK_S) { -@@ -5621,6 +6009,7 @@ lock_rec_queue_validate( - } - ut_a(!lock_rec_other_has_expl_req( - mode, 0, 0, block, heap_no, lock->trx)); -+#endif /* WITH_WSREP */ - - } else if (lock_get_wait(lock) && !lock_rec_get_gap(lock)) { - -@@ -5924,6 +6313,9 @@ lock_rec_insert_check_and_lock( - lock_t* lock; - dberr_t err; - ulint next_rec_heap_no; -+#ifdef WITH_WSREP -+ lock_t *c_lock; -+#endif - ibool inherit_in = *inherit; - - ut_ad(block->frame == page_align(rec)); -@@ -5981,17 +6373,29 @@ lock_rec_insert_check_and_lock( - had to wait for their insert. Both had waiting gap type lock requests - on the successor, which produced an unnecessary deadlock. */ - -+#ifdef WITH_WSREP -+ if ((c_lock = (lock_t *)lock_rec_other_has_conflicting( -+ static_cast( -+ LOCK_X | LOCK_GAP | LOCK_INSERT_INTENTION), -+ block, next_rec_heap_no, trx))) { -+#else - if (lock_rec_other_has_conflicting( - static_cast( - LOCK_X | LOCK_GAP | LOCK_INSERT_INTENTION), - block, next_rec_heap_no, trx)) { -- -+#endif /* WITH_WSREP */ - /* Note that we may get DB_SUCCESS also here! */ - trx_mutex_enter(trx); - -+#ifdef WITH_WSREP -+ err = lock_rec_enqueue_waiting(c_lock, -+ LOCK_X | LOCK_GAP | LOCK_INSERT_INTENTION, -+ block, next_rec_heap_no, index, thr); -+#else - err = lock_rec_enqueue_waiting( - LOCK_X | LOCK_GAP | LOCK_INSERT_INTENTION, - block, next_rec_heap_no, index, thr); -+#endif /* WITH_WSREP */ - - trx_mutex_exit(trx); - } else { -@@ -6070,8 +6474,10 @@ lock_rec_convert_impl_to_expl( - trx_is_active(trx_id, NULL) check below, because we are not - holding lock_mutex. */ - -+#ifndef WITH_WSREP - ut_ad(!lock_rec_other_trx_holds_expl(LOCK_S | LOCK_REC_NOT_GAP, - trx_id, rec, block)); -+#endif /* WITH_WSREP */ - } - - if (trx_id != 0) { -diff --git a/storage/innobase/lock/lock0wait.cc b/storage/innobase/lock/lock0wait.cc -index a1c35e2..9d1a4da 100644 ---- a/storage/innobase/lock/lock0wait.cc -+++ b/storage/innobase/lock/lock0wait.cc -@@ -184,6 +184,28 @@ lock_wait_table_reserve_slot( - return(NULL); - } - -+#ifdef WITH_WSREP -+/*********************************************************************//** -+check if lock timeout was for priority thread, -+as a side effect trigger lock monitor -+@return false for regular lock timeout */ -+static ibool -+wsrep_is_BF_lock_timeout( -+/*====================*/ -+ trx_t* trx) /* in: trx to check for lock priority */ -+{ -+ if (wsrep_on(trx->mysql_thd) && -+ wsrep_thd_is_BF(trx->mysql_thd, FALSE)) { -+ fprintf(stderr, "WSREP: BF lock wait long\n"); -+ srv_print_innodb_monitor = TRUE; -+ srv_print_innodb_lock_monitor = TRUE; -+ os_event_set(srv_monitor_event); -+ return TRUE; -+ } -+ return FALSE; -+ } -+#endif /* WITH_WSREP */ -+ - /***************************************************************//** - Puts a user OS thread to wait for a lock to be released. If an error - occurs during the wait trx->error_state associated with thr is -@@ -375,9 +397,15 @@ lock_wait_suspend_thread( - - if (lock_wait_timeout < 100000000 - && wait_time > (double) lock_wait_timeout) { -+#ifdef WITH_WSREP -+ if (!wsrep_is_BF_lock_timeout(trx)) { -+#endif /* WITH_WSREP */ - - trx->error_state = DB_LOCK_WAIT_TIMEOUT; - -+#ifdef WITH_WSREP -+ } -+#endif /* WITH_WSREP */ - MONITOR_INC(MONITOR_TIMEOUT); - } - -@@ -461,8 +489,14 @@ lock_wait_check_and_cancel( - if (trx->lock.wait_lock) { - - ut_a(trx->lock.que_state == TRX_QUE_LOCK_WAIT); -+#ifdef WITH_WSREP -+ if (!wsrep_is_BF_lock_timeout(trx)) { -+#endif /* WITH_WSREP */ - - lock_cancel_waiting_and_release(trx->lock.wait_lock); -+#ifdef WITH_WSREP -+ } -+#endif /* WITH_WSREP */ - } - - lock_mutex_exit(); -diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc -index fb7e8ca..41372a8 100644 ---- a/storage/innobase/os/os0file.cc -+++ b/storage/innobase/os/os0file.cc -@@ -87,6 +87,12 @@ UNIV_INTERN os_ib_mutex_t os_file_seek_mutexes[OS_FILE_N_SEEK_MUTEXES]; - /* In simulated aio, merge at most this many consecutive i/os */ - #define OS_AIO_MERGE_N_CONSECUTIVE 64 - -+#ifdef WITH_INNODB_DISALLOW_WRITES -+#define WAIT_ALLOW_WRITES() os_event_wait(srv_allow_writes_event) -+#else -+#define WAIT_ALLOW_WRITES() do { } while (0) -+#endif /* WITH_INNODB_DISALLOW_WRITES */ -+ - /********************************************************************** - - InnoDB AIO Implementation: -@@ -763,7 +769,11 @@ os_file_create_tmpfile(void) - /*========================*/ - { - FILE* file = NULL; -- int fd = innobase_mysql_tmpfile(); -+ int fd; -+ WAIT_ALLOW_WRITES(); -+ fd = innobase_mysql_tmpfile(); -+ -+ ut_ad(!srv_read_only_mode); - - ut_ad(!srv_read_only_mode); - -@@ -1089,6 +1099,7 @@ os_file_create_directory( - return(TRUE); - #else - int rcode; -+ WAIT_ALLOW_WRITES(); - - rcode = mkdir(pathname, 0770); - -@@ -1215,6 +1226,8 @@ os_file_create_simple_func( - - #else /* __WIN__ */ - int create_flag; -+ if (create_mode != OS_FILE_OPEN && create_mode != OS_FILE_OPEN_RAW) -+ WAIT_ALLOW_WRITES(); - - ut_a(!(create_mode & OS_FILE_ON_ERROR_SILENT)); - ut_a(!(create_mode & OS_FILE_ON_ERROR_NO_EXIT)); -@@ -1382,6 +1395,8 @@ os_file_create_simple_no_error_handling_func( - int create_flag; - - ut_a(name); -+ if (create_mode != OS_FILE_OPEN && create_mode != OS_FILE_OPEN_RAW) -+ WAIT_ALLOW_WRITES(); - - ut_a(!(create_mode & OS_FILE_ON_ERROR_SILENT)); - ut_a(!(create_mode & OS_FILE_ON_ERROR_NO_EXIT)); -@@ -1673,6 +1688,8 @@ os_file_create_func( - #else /* __WIN__ */ - int create_flag; - const char* mode_str = NULL; -+ if (create_mode != OS_FILE_OPEN && create_mode != OS_FILE_OPEN_RAW) -+ WAIT_ALLOW_WRITES(); - - on_error_no_exit = create_mode & OS_FILE_ON_ERROR_NO_EXIT - ? TRUE : FALSE; -@@ -1852,6 +1869,7 @@ loop: - goto loop; - #else - int ret; -+ WAIT_ALLOW_WRITES(); - - ret = unlink(name); - -@@ -1916,6 +1934,7 @@ loop: - goto loop; - #else - int ret; -+ WAIT_ALLOW_WRITES(); - - ret = unlink(name); - -@@ -1969,6 +1988,7 @@ os_file_rename_func( - return(FALSE); - #else - int ret; -+ WAIT_ALLOW_WRITES(); - - ret = rename(oldpath, newpath); - -@@ -2180,6 +2200,7 @@ os_file_set_eof( - HANDLE h = (HANDLE) _get_osfhandle(fileno(file)); - return(SetEndOfFile(h)); - #else /* __WIN__ */ -+ WAIT_ALLOW_WRITES(); - return(!ftruncate(fileno(file), ftell(file))); - #endif /* __WIN__ */ - } -@@ -2274,6 +2295,7 @@ os_file_flush_func( - return(FALSE); - #else - int ret; -+ WAIT_ALLOW_WRITES(); - - #if defined(HAVE_DARWIN_THREADS) - # ifndef F_FULLFSYNC -@@ -2969,6 +2991,7 @@ retry: - return(FALSE); - #else - ssize_t ret; -+ WAIT_ALLOW_WRITES(); - - ret = os_file_pwrite(file, buf, n, offset); - -diff --git a/storage/innobase/rem/rem0rec.cc b/storage/innobase/rem/rem0rec.cc -index 0d7b7c1..9540211 100644 ---- a/storage/innobase/rem/rem0rec.cc -+++ b/storage/innobase/rem/rem0rec.cc -@@ -33,6 +33,9 @@ Created 5/30/1994 Heikki Tuuri - #include "mtr0mtr.h" - #include "mtr0log.h" - #include "fts0fts.h" -+#ifdef WITH_WSREP -+#include -+#endif /* WITH_WSREP */ - - /* PHYSICAL RECORD (OLD STYLE) - =========================== -@@ -1961,3 +1964,133 @@ rec_get_trx_id( - } - # endif /* UNIV_DEBUG */ - #endif /* !UNIV_HOTBACKUP */ -+#ifdef WITH_WSREP -+dberr_t -+wsrep_rec_get_foreign_key( -+ byte *buf, /* out: extracted key */ -+ ulint *buf_len, /* in/out: length of buf */ -+ const rec_t* rec, /* in: physical record */ -+ dict_index_t* index_for, /* in: index in foreign table */ -+ dict_index_t* index_ref, /* in: index in referenced table */ -+ ibool new_protocol) /* in: protocol > 1 */ -+{ -+ const byte* data; -+ ulint len; -+ ulint key_len = 0; -+ ulint i; -+ uint key_parts; -+ mem_heap_t* heap = NULL; -+ ulint offsets_[REC_OFFS_NORMAL_SIZE]; -+ const ulint* offsets; -+ -+ ut_ad(index_for); -+ ut_ad(index_ref); -+ -+ rec_offs_init(offsets_); -+ offsets = rec_get_offsets(rec, index_for, offsets_, -+ ULINT_UNDEFINED, &heap); -+ -+ ut_ad(rec_offs_validate(rec, NULL, offsets)); -+ -+ ut_ad(rec); -+ -+ key_parts = dict_index_get_n_unique_in_tree(index_for); -+ for (i = 0; -+ i < key_parts && -+ (index_for->type & DICT_CLUSTERED || i < key_parts - 1); -+ i++) { -+ dict_field_t* field_f = -+ dict_index_get_nth_field(index_for, i); -+ const dict_col_t* col_f = dict_field_get_col(field_f); -+ dict_field_t* field_r = -+ dict_index_get_nth_field(index_ref, i); -+ const dict_col_t* col_r = dict_field_get_col(field_r); -+ -+ data = rec_get_nth_field(rec, offsets, i, &len); -+ if (key_len + ((len != UNIV_SQL_NULL) ? len + 1 : 1) > -+ *buf_len) { -+ fprintf (stderr, -+ "WSREP: FK key len exceeded %lu %lu %lu\n", -+ key_len, len, *buf_len); -+ goto err_out; -+ } -+ -+ if (len == UNIV_SQL_NULL) { -+ ut_a(!(col_f->prtype & DATA_NOT_NULL)); -+ *buf++ = 1; -+ key_len++; -+ } else if (!new_protocol) { -+ if (!(col_r->prtype & DATA_NOT_NULL)) { -+ *buf++ = 0; -+ key_len++; -+ } -+ memcpy(buf, data, len); -+ *buf_len = wsrep_innobase_mysql_sort( -+ (int)(col_f->prtype & DATA_MYSQL_TYPE_MASK), -+ (uint)dtype_get_charset_coll(col_f->prtype), -+ buf, len, *buf_len); -+ } else { /* new protocol */ -+ if (!(col_r->prtype & DATA_NOT_NULL)) { -+ *buf++ = 0; -+ key_len++; -+ } -+ switch (col_f->mtype) { -+ case DATA_INT: { -+ byte* ptr = buf+len; -+ for (;;) { -+ ptr--; -+ *ptr = *data; -+ if (ptr == buf) { -+ break; -+ } -+ data++; -+ } -+ -+ if (!(col_f->prtype & DATA_UNSIGNED)) { -+ buf[len-1] = (byte) (buf[len-1] ^ 128); -+ } -+ -+ break; -+ } -+ case DATA_VARCHAR: -+ case DATA_VARMYSQL: -+ case DATA_CHAR: -+ case DATA_MYSQL: -+ /* Copy the actual data */ -+ ut_memcpy(buf, data, len); -+ len = wsrep_innobase_mysql_sort( -+ (int) -+ (col_f->prtype & DATA_MYSQL_TYPE_MASK), -+ (uint) -+ dtype_get_charset_coll(col_f->prtype), -+ buf, len, *buf_len); -+ break; -+ case DATA_BLOB: -+ case DATA_BINARY: -+ memcpy(buf, data, len); -+ break; -+ default: -+ break; -+ } -+ -+ key_len += len; -+ buf += len; -+ } -+ } -+ -+ rec_validate(rec, offsets); -+ -+ if (UNIV_LIKELY_NULL(heap)) { -+ mem_heap_free(heap); -+ } -+ -+ *buf_len = key_len; -+ return DB_SUCCESS; -+ -+ err_out: -+ if (UNIV_LIKELY_NULL(heap)) { -+ mem_heap_free(heap); -+ } -+ return DB_ERROR; -+} -+#endif // WITH_WSREP -diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc -index e31b447..3c3ccf4 100644 ---- a/storage/innobase/row/row0ins.cc -+++ b/storage/innobase/row/row0ins.cc -@@ -920,6 +920,14 @@ row_ins_invalidate_query_cache( - innobase_invalidate_query_cache(thr_get_trx(thr), buf, len); - mem_free(buf); - } -+#ifdef WITH_WSREP -+dberr_t wsrep_append_foreign_key(trx_t *trx, -+ dict_foreign_t* foreign, -+ const rec_t* clust_rec, -+ dict_index_t* clust_index, -+ ibool referenced, -+ ibool shared); -+#endif /* WITH_WSREP */ - - /*********************************************************************//** - Perform referential actions or checks when a parent row is deleted or updated -@@ -1271,6 +1279,18 @@ row_ins_foreign_check_on_constraint( - - cascade->state = UPD_NODE_UPDATE_CLUSTERED; - -+#ifdef WITH_WSREP -+ err = wsrep_append_foreign_key( -+ thr_get_trx(thr), -+ foreign, -+ clust_rec, -+ clust_index, -+ FALSE, FALSE); -+ if (err != DB_SUCCESS) { -+ fprintf(stderr, -+ "WSREP: foreign key append failed: %d\n", err); -+ } else -+#endif - err = row_update_cascade_for_mysql(thr, cascade, - foreign->foreign_table); - -@@ -1603,7 +1623,14 @@ run_again: - - if (check_ref) { - err = DB_SUCCESS; -- -+#ifdef WITH_WSREP -+ err = wsrep_append_foreign_key( -+ thr_get_trx(thr), -+ foreign, -+ rec, -+ check_index, -+ check_ref, TRUE); -+#endif /* WITH_WSREP */ - goto end_scan; - } else if (foreign->type != 0) { - /* There is an ON UPDATE or ON DELETE -diff --git a/storage/innobase/row/row0upd.cc b/storage/innobase/row/row0upd.cc -index fcd5433..5a8987a 100644 ---- a/storage/innobase/row/row0upd.cc -+++ b/storage/innobase/row/row0upd.cc -@@ -51,6 +51,9 @@ Created 12/27/1996 Heikki Tuuri - #include "pars0sym.h" - #include "eval0eval.h" - #include "buf0lru.h" -+#ifdef WITH_WSREP -+extern my_bool wsrep_debug; -+#endif - #include - - /* What kind of latch and lock can we assume when the control comes to -@@ -162,6 +165,42 @@ row_upd_index_is_referenced( - return(is_referenced); - } - -+#ifdef WITH_WSREP -+static -+ibool -+wsrep_row_upd_index_is_foreign( -+/*========================*/ -+ dict_index_t* index, /*!< in: index */ -+ trx_t* trx) /*!< in: transaction */ -+{ -+ dict_table_t* table = index->table; -+ ibool froze_data_dict = FALSE; -+ ibool is_referenced = FALSE; -+ -+ if (table->foreign_set.empty()) { -+ return(FALSE); -+ } -+ -+ if (trx->dict_operation_lock_mode == 0) { -+ row_mysql_freeze_data_dictionary(trx); -+ froze_data_dict = TRUE; -+ } -+ -+ dict_foreign_set::iterator it -+ = std::find_if(table->foreign_set.begin(), -+ table->foreign_set.end(), -+ dict_foreign_with_foreign_index(index)); -+ -+ is_referenced = (it != table->foreign_set.end()); -+ -+ if (froze_data_dict) { -+ row_mysql_unfreeze_data_dictionary(trx); -+ } -+ -+ return(is_referenced); -+} -+#endif /* WITH_WSREP */ -+ - /*********************************************************************//** - Checks if possible foreign key constraints hold after a delete of the record - under pcur. -@@ -281,7 +320,6 @@ run_again: - } - - err = DB_SUCCESS; -- - func_exit: - if (got_s_lock) { - row_mysql_unfreeze_data_dictionary(trx); -@@ -293,6 +331,127 @@ func_exit: - - return(err); - } -+#ifdef WITH_WSREP -+static -+dberr_t -+wsrep_row_upd_check_foreign_constraints( -+/*=================================*/ -+ upd_node_t* node, /*!< in: row update node */ -+ btr_pcur_t* pcur, /*!< in: cursor positioned on a record; NOTE: the -+ cursor position is lost in this function! */ -+ dict_table_t* table, /*!< in: table in question */ -+ dict_index_t* index, /*!< in: index of the cursor */ -+ ulint* offsets,/*!< in/out: rec_get_offsets(pcur.rec, index) */ -+ que_thr_t* thr, /*!< in: query thread */ -+ mtr_t* mtr) /*!< in: mtr */ -+{ -+ dict_foreign_t* foreign; -+ mem_heap_t* heap; -+ dtuple_t* entry; -+ trx_t* trx; -+ const rec_t* rec; -+ ulint n_ext; -+ dberr_t err; -+ ibool got_s_lock = FALSE; -+ ibool opened = FALSE; -+ -+ if (table->foreign_set.empty()) { -+ return(DB_SUCCESS); -+ } -+ -+ trx = thr_get_trx(thr); -+ -+ /* TODO: make native slave thread bail out here */ -+ -+ rec = btr_pcur_get_rec(pcur); -+ ut_ad(rec_offs_validate(rec, index, offsets)); -+ -+ heap = mem_heap_create(500); -+ -+ entry = row_rec_to_index_entry(rec, index, offsets, -+ &n_ext, heap); -+ -+ mtr_commit(mtr); -+ -+ mtr_start(mtr); -+ -+ if (trx->dict_operation_lock_mode == 0) { -+ got_s_lock = TRUE; -+ -+ row_mysql_freeze_data_dictionary(trx); -+ } -+ -+run_again: -+ -+ for (dict_foreign_set::iterator it = table->foreign_set.begin(); -+ it != table->foreign_set.end(); -+ ++it) { -+ -+ foreign = *it; -+ /* Note that we may have an update which updates the index -+ record, but does NOT update the first fields which are -+ referenced in a foreign key constraint. Then the update does -+ NOT break the constraint. */ -+ -+ if (foreign->foreign_index == index -+ && (node->is_delete -+ || row_upd_changes_first_fields_binary( -+ entry, index, node->update, -+ foreign->n_fields))) { -+ -+ if (foreign->referenced_table == NULL) { -+ foreign->referenced_table = -+ dict_table_open_on_name( -+ foreign->referenced_table_name_lookup, -+ FALSE, FALSE, DICT_ERR_IGNORE_NONE); -+ opened = TRUE; -+ } -+ -+ if (foreign->referenced_table) { -+ os_inc_counter(dict_sys->mutex, -+ foreign->referenced_table -+ ->n_foreign_key_checks_running); -+ } -+ -+ /* NOTE that if the thread ends up waiting for a lock -+ we will release dict_operation_lock temporarily! -+ But the counter on the table protects 'foreign' from -+ being dropped while the check is running. */ -+ -+ err = row_ins_check_foreign_constraint( -+ TRUE, foreign, table, entry, thr); -+ -+ if (foreign->referenced_table) { -+ os_dec_counter(dict_sys->mutex, -+ foreign->referenced_table -+ ->n_foreign_key_checks_running); -+ -+ if (opened == TRUE) { -+ dict_table_close(foreign->referenced_table, TRUE, FALSE); -+ opened = FALSE; -+ } -+ } -+ -+ /* Some table foreign key dropped, try again */ -+ if (err == DB_DICT_CHANGED) { -+ goto run_again; -+ } else if (err != DB_SUCCESS) { -+ goto func_exit; -+ } -+ } -+ } -+ -+ err = DB_SUCCESS; -+func_exit: -+ if (got_s_lock) { -+ row_mysql_unfreeze_data_dictionary(trx); -+ } -+ -+ mem_heap_free(heap); -+ -+ return(err); -+} -+#endif /* WITH_WSREP */ - - /*********************************************************************//** - Creates an update node for a query graph. -@@ -1667,6 +1826,9 @@ row_upd_sec_index_entry( - index = node->index; - - referenced = row_upd_index_is_referenced(index, trx); -+#ifdef WITH_WSREP -+ ibool foreign = wsrep_row_upd_index_is_foreign(index, trx); -+#endif /* WITH_WSREP */ - - heap = mem_heap_create(1024); - -@@ -1794,6 +1956,9 @@ row_upd_sec_index_entry( - row_ins_sec_index_entry() below */ - if (!rec_get_deleted_flag( - rec, dict_table_is_comp(index->table))) { -+#ifdef WITH_WSREP -+ que_node_t *parent = que_node_get_parent(node); -+#endif /* WITH_WSREP */ - err = btr_cur_del_mark_set_sec_rec( - 0, btr_cur, TRUE, thr, &mtr); - -@@ -1811,6 +1976,37 @@ row_upd_sec_index_entry( - node, &pcur, index->table, - index, offsets, thr, &mtr); - } -+#ifdef WITH_WSREP -+ if (err == DB_SUCCESS && !referenced && -+ !(parent && que_node_get_type(parent) == -+ QUE_NODE_UPDATE && -+ ((upd_node_t*)parent)->cascade_node == node) && -+ foreign -+ ) { -+ ulint* offsets = -+ rec_get_offsets( -+ rec, index, NULL, ULINT_UNDEFINED, -+ &heap); -+ err = wsrep_row_upd_check_foreign_constraints( -+ node, &pcur, index->table, -+ index, offsets, thr, &mtr); -+ switch (err) { -+ case DB_SUCCESS: -+ case DB_NO_REFERENCED_ROW: -+ err = DB_SUCCESS; -+ break; -+ case DB_DEADLOCK: -+ if (wsrep_debug) fprintf (stderr, -+ "WSREP: sec index FK check fail for deadlock"); -+ break; -+ default: -+ fprintf (stderr, -+ "WSREP: referenced FK check fail: %d", -+ (int)err); -+ break; -+ } -+ } -+#endif /* WITH_WSREP */ - } - break; - } -@@ -1965,6 +2161,9 @@ row_upd_clust_rec_by_insert( - que_thr_t* thr, /*!< in: query thread */ - ibool referenced,/*!< in: TRUE if index may be referenced in - a foreign key constraint */ -+#ifdef WITH_WSREP -+ ibool foreign, /*!< in: TRUE if index is foreign key index */ -+#endif /* WITH_WSREP */ - mtr_t* mtr) /*!< in/out: mtr; gets committed here */ - { - mem_heap_t* heap; -@@ -1978,6 +2177,9 @@ row_upd_clust_rec_by_insert( - rec_t* rec; - ulint* offsets = NULL; - -+#ifdef WITH_WSREP -+ que_node_t *parent = que_node_get_parent(node); -+#endif /* WITH_WSREP */ - ut_ad(node); - ut_ad(dict_index_is_clust(index)); - -@@ -2060,6 +2262,34 @@ err_exit: - goto err_exit; - } - } -+#ifdef WITH_WSREP -+ if (!referenced && -+ !(parent && que_node_get_type(parent) == QUE_NODE_UPDATE && -+ ((upd_node_t*)parent)->cascade_node == node) && -+ foreign -+ ) { -+ err = wsrep_row_upd_check_foreign_constraints( -+ node, pcur, table, index, offsets, thr, mtr); -+ switch (err) { -+ case DB_SUCCESS: -+ case DB_NO_REFERENCED_ROW: -+ err = DB_SUCCESS; -+ break; -+ case DB_DEADLOCK: -+ if (wsrep_debug) fprintf (stderr, -+ "WSREP: insert FK check fail for deadlock"); -+ break; -+ default: -+ fprintf (stderr, -+ "WSREP: referenced FK check fail: %d", -+ (int)err); -+ break; -+ } -+ if (err != DB_SUCCESS) { -+ goto err_exit; -+ } -+ } -+#endif /* WITH_WSREP */ - } - - mtr_commit(mtr); -@@ -2252,11 +2482,18 @@ row_upd_del_mark_clust_rec( - ibool referenced, - /*!< in: TRUE if index may be referenced in - a foreign key constraint */ -+#ifdef WITH_WSREP -+ ibool foreign,/*!< in: TRUE if index is foreign key index */ -+#endif /* WITH_WSREP */ - mtr_t* mtr) /*!< in: mtr; gets committed here */ - { - btr_pcur_t* pcur; - btr_cur_t* btr_cur; - dberr_t err; -+#ifdef WITH_WSREP -+ rec_t* rec; -+ que_node_t *parent = que_node_get_parent(node); -+#endif /* WITH_WSREP */ - - ut_ad(node); - ut_ad(dict_index_is_clust(index)); -@@ -2273,8 +2510,16 @@ row_upd_del_mark_clust_rec( - /* Mark the clustered index record deleted; we do not have to check - locks, because we assume that we have an x-lock on the record */ - -+#ifdef WITH_WSREP -+ rec = btr_cur_get_rec(btr_cur); -+#endif /* WITH_WSREP */ -+ - err = btr_cur_del_mark_set_clust_rec( -+#ifdef WITH_WSREP -+ btr_cur_get_block(btr_cur), rec, -+#else - btr_cur_get_block(btr_cur), btr_cur_get_rec(btr_cur), -+#endif /* WITH_WSREP */ - index, offsets, thr, mtr); - if (err == DB_SUCCESS && referenced) { - /* NOTE that the following call loses the position of pcur ! */ -@@ -2282,6 +2527,32 @@ row_upd_del_mark_clust_rec( - err = row_upd_check_references_constraints( - node, pcur, index->table, index, offsets, thr, mtr); - } -+#ifdef WITH_WSREP -+ if (err == DB_SUCCESS && !referenced && -+ !(parent && que_node_get_type(parent) == QUE_NODE_UPDATE && -+ ((upd_node_t*)parent)->cascade_node == node) && -+ thr_get_trx(thr) && -+ foreign -+ ) { -+ err = wsrep_row_upd_check_foreign_constraints( -+ node, pcur, index->table, index, offsets, thr, mtr); -+ switch (err) { -+ case DB_SUCCESS: -+ case DB_NO_REFERENCED_ROW: -+ err = DB_SUCCESS; -+ break; -+ case DB_DEADLOCK: -+ if (wsrep_debug) fprintf (stderr, -+ "WSREP: clust rec FK check fail for deadlock"); -+ break; -+ default: -+ fprintf (stderr, -+ "WSREP: clust rec referenced FK check fail: %d", -+ (int)err); -+ break; -+ } -+ } -+#endif /* WITH_WSREP */ - - mtr_commit(mtr); - -@@ -2314,6 +2585,10 @@ row_upd_clust_step( - index = dict_table_get_first_index(node->table); - - referenced = row_upd_index_is_referenced(index, thr_get_trx(thr)); -+#ifdef WITH_WSREP -+ ibool foreign = wsrep_row_upd_index_is_foreign( -+ index, thr_get_trx(thr)); -+#endif /* WITH_WSREP */ - - pcur = node->pcur; - -@@ -2408,7 +2683,11 @@ row_upd_clust_step( - - if (node->is_delete) { - err = row_upd_del_mark_clust_rec( -+#ifdef WITH_WSREP -+ node, index, offsets, thr, referenced, foreign, &mtr); -+#else - node, index, offsets, thr, referenced, &mtr); -+#endif /* WITH_WSREP */ - - if (err == DB_SUCCESS) { - node->state = UPD_NODE_UPDATE_ALL_SEC; -@@ -2453,7 +2732,11 @@ row_upd_clust_step( - externally! */ - - err = row_upd_clust_rec_by_insert( -+#ifdef WITH_WSREP -+ node, index, thr, referenced, foreign, &mtr); -+#else - node, index, thr, referenced, &mtr); -+#endif /* WITH_WSREP */ - - if (err != DB_SUCCESS) { - -diff --git a/storage/innobase/srv/srv0conc.cc b/storage/innobase/srv/srv0conc.cc -index dc3c0b1..fb7fad3 100644 ---- a/storage/innobase/srv/srv0conc.cc -+++ b/storage/innobase/srv/srv0conc.cc -@@ -42,6 +42,10 @@ Created 2011/04/18 Sunny Bains - #include "trx0trx.h" - - #include "mysql/plugin.h" -+#ifdef WITH_WSREP -+extern "C" int wsrep_trx_is_aborting(void *thd_ptr); -+extern my_bool wsrep_debug; -+#endif - - /** Number of times a thread is allowed to enter InnoDB within the same - SQL query after it has once got the ticket. */ -@@ -86,6 +90,9 @@ struct srv_conc_slot_t{ - reserved may still be TRUE at that - point */ - srv_conc_node_t srv_conc_queue; /*!< queue node */ -+#ifdef WITH_WSREP -+ void *thd; /*!< to see priority */ -+#endif - }; - - /** Queue of threads waiting to get in */ -@@ -145,6 +152,9 @@ srv_conc_init(void) - - conc_slot->event = os_event_create(); - ut_a(conc_slot->event); -+#ifdef WITH_WSREP -+ conc_slot->thd = NULL; -+#endif /* WITH_WSREP */ - } - #endif /* !HAVE_ATOMIC_BUILTINS */ - } -@@ -202,6 +212,16 @@ srv_conc_enter_innodb_with_atomics( - - for (;;) { - ulint sleep_in_us; -+#ifdef WITH_WSREP -+ if (wsrep_on(trx->mysql_thd) && -+ wsrep_trx_is_aborting(trx->mysql_thd)) { -+ if (wsrep_debug) -+ fprintf(stderr, -+ "srv_conc_enter due to MUST_ABORT"); -+ srv_conc_force_enter_innodb(trx); -+ return; -+ } -+#endif /* WITH_WSREP */ - - if (srv_conc.n_active < (lint) srv_thread_concurrency) { - ulint n_active; -@@ -319,6 +339,9 @@ srv_conc_exit_innodb_without_atomics( - slot = NULL; - - if (srv_conc.n_active < (lint) srv_thread_concurrency) { -+#ifdef WITH_WSREP -+ srv_conc_slot_t* wsrep_slot; -+#endif - /* Look for a slot where a thread is waiting and no other - thread has yet released the thread */ - -@@ -329,6 +352,19 @@ srv_conc_exit_innodb_without_atomics( - /* No op */ - } - -+#ifdef WITH_WSREP -+ /* look for aborting trx, they must be released asap */ -+ wsrep_slot= slot; -+ while (wsrep_slot && (wsrep_slot->wait_ended == TRUE || -+ !wsrep_trx_is_aborting(wsrep_slot->thd))) { -+ wsrep_slot = UT_LIST_GET_NEXT(srv_conc_queue, wsrep_slot); -+ } -+ if (wsrep_slot) { -+ slot = wsrep_slot; -+ if (wsrep_debug) -+ fprintf(stderr, "WSREP: releasing aborting thd\n"); -+ } -+#endif - if (slot != NULL) { - slot->wait_ended = TRUE; - -@@ -384,6 +420,13 @@ retry: - - return; - } -+#ifdef WITH_WSREP -+ if (wsrep_on(trx->mysql_thd) && -+ wsrep_trx_is_aborting(trx->mysql_thd)) { -+ srv_conc_force_enter_innodb(trx); -+ return; -+ } -+#endif - - /* If the transaction is not holding resources, let it sleep - for srv_thread_sleep_delay microseconds, and try again then */ -@@ -450,6 +493,9 @@ retry: - /* Add to the queue */ - slot->reserved = TRUE; - slot->wait_ended = FALSE; -+#ifdef WITH_WSREP -+ slot->thd = trx->mysql_thd; -+#endif - - UT_LIST_ADD_LAST(srv_conc_queue, srv_conc_queue, slot); - -@@ -457,6 +503,18 @@ retry: - - srv_conc.n_waiting++; - -+#ifdef WITH_WSREP -+ if (wsrep_on(trx->mysql_thd) && -+ wsrep_trx_is_aborting(trx->mysql_thd)) { -+ os_fast_mutex_unlock(&srv_conc_mutex); -+ if (wsrep_debug) -+ fprintf(stderr, "srv_conc_enter due to MUST_ABORT"); -+ trx->declared_to_be_inside_innodb = TRUE; -+ trx->n_tickets_to_enter_innodb = srv_n_free_tickets_to_enter; -+ return; -+ } -+ trx->wsrep_event = slot->event; -+#endif /* WITH_WSREP */ - os_fast_mutex_unlock(&srv_conc_mutex); - - /* Go to wait for the event; when a thread leaves InnoDB it will -@@ -471,6 +529,9 @@ retry: - thd_wait_begin(trx->mysql_thd, THD_WAIT_USER_LOCK); - - os_event_wait(slot->event); -+#ifdef WITH_WSREP -+ trx->wsrep_event = NULL; -+#endif /* WITH_WSREP */ - thd_wait_end(trx->mysql_thd); - - trx->op_info = ""; -@@ -483,6 +544,9 @@ retry: - incremented the thread counter on behalf of this thread */ - - slot->reserved = FALSE; -+#ifdef WITH_WSREP -+ slot->thd = NULL; -+#endif - - UT_LIST_REMOVE(srv_conc_queue, srv_conc_queue, slot); - -@@ -593,5 +657,32 @@ srv_conc_get_active_threads(void) - /*==============================*/ - { - return(srv_conc.n_active); -- } -+} -+ -+#ifdef WITH_WSREP -+UNIV_INTERN -+void -+wsrep_srv_conc_cancel_wait( -+/*==================*/ -+ trx_t* trx) /*!< in: transaction object associated with the -+ thread */ -+{ -+#ifdef HAVE_ATOMIC_BUILTINS -+ /* aborting transactions will enter innodb by force in -+ srv_conc_enter_innodb_with_atomics(). No need to cancel here, -+ thr will wake up after os_sleep and let to enter innodb -+ */ -+ if (wsrep_debug) -+ fprintf(stderr, "WSREP: conc slot cancel, no atomics\n"); -+#else -+ os_fast_mutex_lock(&srv_conc_mutex); -+ if (trx->wsrep_event) { -+ if (wsrep_debug) -+ fprintf(stderr, "WSREP: conc slot cancel\n"); -+ os_event_set(trx->wsrep_event); -+ } -+ os_fast_mutex_unlock(&srv_conc_mutex); -+#endif -+} -+#endif /* WITH_WSREP */ - -diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc -index f4ea889..4404023 100644 ---- a/storage/innobase/srv/srv0srv.cc -+++ b/storage/innobase/srv/srv0srv.cc -@@ -71,6 +71,10 @@ Created 10/8/1995 Heikki Tuuri - #include "mysql/plugin.h" - #include "mysql/service_thd_wait.h" - -+#ifdef WITH_WSREP -+extern int wsrep_debug; -+extern int wsrep_trx_is_aborting(void *thd_ptr); -+#endif - /* The following is the maximum allowed duration of a lock wait. */ - UNIV_INTERN ulint srv_fatal_semaphore_wait_threshold = 600; - -@@ -207,6 +211,10 @@ srv_printf_innodb_monitor() will request mutex acquisition - with mutex_enter(), which will wait until it gets the mutex. */ - #define MUTEX_NOWAIT(mutex_skipped) ((mutex_skipped) < MAX_MUTEX_NOWAIT) - -+#ifdef WITH_INNODB_DISALLOW_WRITES -+UNIV_INTERN os_event_t srv_allow_writes_event; -+#endif /* WITH_INNODB_DISALLOW_WRITES */ -+ - /** The sort order table of the MySQL latin1_swedish_ci character set - collation */ - UNIV_INTERN const byte* srv_latin1_ordering; -@@ -975,6 +983,14 @@ srv_init(void) - - srv_conc_init(); - -+#ifdef WITH_INNODB_DISALLOW_WRITES -+ /* Writes have to be enabled on init or else we hang. Thus, we -+ always set the event here regardless of innobase_disallow_writes. -+ That flag will always be 0 at this point because it isn't settable -+ via my.cnf or command line arg. */ -+ srv_allow_writes_event = os_event_create(); -+ os_event_set(srv_allow_writes_event); -+#endif /* WITH_INNODB_DISALLOW_WRITES */ - /* Initialize some INFORMATION SCHEMA internal structures */ - trx_i_s_cache_init(trx_i_s_cache); - -@@ -1737,7 +1753,20 @@ loop: - - if (sync_array_print_long_waits(&waiter, &sema) - && sema == old_sema && os_thread_eq(waiter, old_waiter)) { -+#if defined(WITH_WSREP) && defined(WITH_INNODB_DISALLOW_WRITES) -+ if (srv_allow_writes_event->is_set) { -+#endif /* WITH_WSREP */ - fatal_cnt++; -+#if defined(WITH_WSREP) && defined(WITH_INNODB_DISALLOW_WRITES) -+ } else { -+ fprintf(stderr, -+ "WSREP: avoiding InnoDB self crash due to long " -+ "semaphore wait of > %lu seconds\n" -+ "Server is processing SST donor operation, " -+ "fatal_cnt now: %lu", -+ (ulong) srv_fatal_semaphore_wait_threshold, fatal_cnt); -+ } -+#endif /* WITH_WSREP */ - if (fatal_cnt > 10) { - - fprintf(stderr, -diff --git a/storage/innobase/trx/trx0roll.cc b/storage/innobase/trx/trx0roll.cc -index bc11f1d..ae9095d 100644 ---- a/storage/innobase/trx/trx0roll.cc -+++ b/storage/innobase/trx/trx0roll.cc -@@ -43,6 +43,9 @@ Created 3/26/1996 Heikki Tuuri - #include "row0mysql.h" - #include "lock0lock.h" - #include "pars0pars.h" -+#ifdef WITH_WSREP -+#include "ha_prototypes.h" -+#endif /* WITH_WSREP */ - #include "srv0mon.h" - #include "trx0sys.h" - -@@ -374,6 +377,11 @@ trx_rollback_to_savepoint_for_mysql_low( - - trx->op_info = ""; - -+#ifdef WITH_WSREP_OUT -+ if (wsrep_on(trx->mysql_thd)) { -+ trx->lock.was_chosen_as_deadlock_victim = FALSE; -+ } -+#endif /* WITH_WSREP */ - return(err); - } - -@@ -1014,6 +1022,11 @@ trx_roll_try_truncate( - if (trx->update_undo) { - trx_undo_truncate_end(trx, trx->update_undo, limit); - } -+#ifdef WITH_WSREP_OUT -+ if (wsrep_on(trx->mysql_thd)) { -+ trx->lock.was_chosen_as_deadlock_victim = FALSE; -+ } -+#endif /* WITH_WSREP */ - } - - /***********************************************************************//** -diff --git a/storage/innobase/trx/trx0sys.cc b/storage/innobase/trx/trx0sys.cc -index 52830a7..816de1c 100644 ---- a/storage/innobase/trx/trx0sys.cc -+++ b/storage/innobase/trx/trx0sys.cc -@@ -44,6 +44,10 @@ Created 3/26/1996 Heikki Tuuri - #include "os0file.h" - #include "read0read.h" - -+#ifdef WITH_WSREP -+#include "ha_prototypes.h" /* wsrep_is_wsrep_xid() */ -+#endif /* */ -+ - /** The file format tag structure with id and name. */ - struct file_format_t { - ulint id; /*!< id of the file format */ -@@ -174,7 +178,12 @@ trx_sys_flush_max_trx_id(void) - mtr_t mtr; - trx_sysf_t* sys_header; - -+#ifndef WITH_WSREP -+ /* wsrep_fake_trx_id violates this assert -+ * Copied from trx_sys_get_new_trx_id -+ */ - ut_ad(mutex_own(&trx_sys->mutex)); -+#endif /* WITH_WSREP */ - - if (!srv_read_only_mode) { - mtr_start(&mtr); -@@ -202,10 +211,14 @@ trx_sys_update_mysql_binlog_offset( - ib_int64_t offset, /*!< in: position in that log file */ - ulint field, /*!< in: offset of the MySQL log info field in - the trx sys header */ -+#ifdef WITH_WSREP -+ trx_sysf_t* sys_header, /*!< in: trx sys header */ -+#endif /* WITH_WSREP */ - mtr_t* mtr) /*!< in: mtr */ - { -+#ifndef WITH_WSREP - trx_sysf_t* sys_header; -- -+#endif /* !WITH_WSREP */ - if (ut_strlen(file_name) >= TRX_SYS_MYSQL_LOG_NAME_LEN) { - - /* We cannot fit the name to the 512 bytes we have reserved */ -@@ -213,7 +226,9 @@ trx_sys_update_mysql_binlog_offset( - return; - } - -+#ifndef WITH_WSREP - sys_header = trx_sysf_get(mtr); -+#endif /* !WITH_WSREP */ - - if (mach_read_from_4(sys_header + field - + TRX_SYS_MYSQL_LOG_MAGIC_N_FLD) -@@ -300,6 +315,125 @@ trx_sys_print_mysql_binlog_offset(void) - mtr_commit(&mtr); - } - -+#ifdef WITH_WSREP -+ -+#ifdef UNIV_DEBUG -+static long long trx_sys_cur_xid_seqno = -1; -+static unsigned char trx_sys_cur_xid_uuid[16]; -+ -+long long read_wsrep_xid_seqno(const XID* xid) -+{ -+ long long seqno; -+ memcpy(&seqno, xid->data + 24, sizeof(long long)); -+ return seqno; -+} -+ -+void read_wsrep_xid_uuid(const XID* xid, unsigned char* buf) -+{ -+ memcpy(buf, xid->data + 8, 16); -+} -+ -+#endif /* UNIV_DEBUG */ -+ -+void -+trx_sys_update_wsrep_checkpoint( -+ const XID* xid, /*!< in: transaction XID */ -+ trx_sysf_t* sys_header, /*!< in: sys_header */ -+ mtr_t* mtr) /*!< in: mtr */ -+{ -+ -+#ifdef UNIV_DEBUG -+ { -+ /* Check that seqno is monotonically increasing */ -+ unsigned char xid_uuid[16]; -+ long long xid_seqno = read_wsrep_xid_seqno(xid); -+ read_wsrep_xid_uuid(xid, xid_uuid); -+ if (!memcmp(xid_uuid, trx_sys_cur_xid_uuid, 8)) -+ { -+ ut_ad(xid_seqno > trx_sys_cur_xid_seqno); -+ trx_sys_cur_xid_seqno = xid_seqno; -+ } -+ else -+ { -+ memcpy(trx_sys_cur_xid_uuid, xid_uuid, 16); -+ } -+ trx_sys_cur_xid_seqno = xid_seqno; -+ } -+#endif /* UNIV_DEBUG */ -+ -+ ut_ad(xid && mtr && sys_header); -+ ut_a(xid->formatID == -1 || wsrep_is_wsrep_xid(xid)); -+ -+ if (mach_read_from_4(sys_header + TRX_SYS_WSREP_XID_INFO -+ + TRX_SYS_WSREP_XID_MAGIC_N_FLD) -+ != TRX_SYS_WSREP_XID_MAGIC_N) { -+ mlog_write_ulint(sys_header + TRX_SYS_WSREP_XID_INFO -+ + TRX_SYS_WSREP_XID_MAGIC_N_FLD, -+ TRX_SYS_WSREP_XID_MAGIC_N, -+ MLOG_4BYTES, mtr); -+ } -+ -+ mlog_write_ulint(sys_header + TRX_SYS_WSREP_XID_INFO -+ + TRX_SYS_WSREP_XID_FORMAT, -+ (int)xid->formatID, -+ MLOG_4BYTES, mtr); -+ mlog_write_ulint(sys_header + TRX_SYS_WSREP_XID_INFO -+ + TRX_SYS_WSREP_XID_GTRID_LEN, -+ (int)xid->gtrid_length, -+ MLOG_4BYTES, mtr); -+ mlog_write_ulint(sys_header + TRX_SYS_WSREP_XID_INFO -+ + TRX_SYS_WSREP_XID_BQUAL_LEN, -+ (int)xid->bqual_length, -+ MLOG_4BYTES, mtr); -+ mlog_write_string(sys_header + TRX_SYS_WSREP_XID_INFO -+ + TRX_SYS_WSREP_XID_DATA, -+ (const unsigned char*) xid->data, -+ XIDDATASIZE, mtr); -+ -+} -+ -+void -+trx_sys_read_wsrep_checkpoint(XID* xid) -+/*===================================*/ -+{ -+ trx_sysf_t* sys_header; -+ mtr_t mtr; -+ ulint magic; -+ -+ ut_ad(xid); -+ -+ mtr_start(&mtr); -+ -+ sys_header = trx_sysf_get(&mtr); -+ -+ if ((magic = mach_read_from_4(sys_header + TRX_SYS_WSREP_XID_INFO -+ + TRX_SYS_WSREP_XID_MAGIC_N_FLD)) -+ != TRX_SYS_WSREP_XID_MAGIC_N) { -+ memset(xid, 0, sizeof(*xid)); -+ xid->formatID = -1; -+ trx_sys_update_wsrep_checkpoint(xid, sys_header, &mtr); -+ mtr_commit(&mtr); -+ return; -+ } -+ -+ xid->formatID = (int)mach_read_from_4( -+ sys_header -+ + TRX_SYS_WSREP_XID_INFO + TRX_SYS_WSREP_XID_FORMAT); -+ xid->gtrid_length = (int)mach_read_from_4( -+ sys_header -+ + TRX_SYS_WSREP_XID_INFO + TRX_SYS_WSREP_XID_GTRID_LEN); -+ xid->bqual_length = (int)mach_read_from_4( -+ sys_header -+ + TRX_SYS_WSREP_XID_INFO + TRX_SYS_WSREP_XID_BQUAL_LEN); -+ ut_memcpy(xid->data, -+ sys_header + TRX_SYS_WSREP_XID_INFO + TRX_SYS_WSREP_XID_DATA, -+ XIDDATASIZE); -+ -+ mtr_commit(&mtr); -+} -+ -+#endif /* WITH_WSREP */ -+ - /*****************************************************************//** - Prints to stderr the MySQL master log offset info in the trx system header if - the magic number shows it valid. */ -diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc -index c2d5c1f..4c530dd 100644 ---- a/storage/innobase/trx/trx0trx.cc -+++ b/storage/innobase/trx/trx0trx.cc -@@ -158,7 +158,10 @@ trx_create(void) - trx->lock.table_locks = ib_vector_create( - heap_alloc, sizeof(void**), 32); - -- return(trx); -+#ifdef WITH_WSREP -+ trx->wsrep_event = NULL; -+#endif /* WITH_WSREP */ -+ return(trx); - } - - /********************************************************************//** -@@ -853,6 +856,11 @@ trx_start_low( - srv_undo_logs, srv_undo_tablespaces); - } - -+#ifdef WITH_WSREP -+ memset(&trx->xid, 0, sizeof(trx->xid)); -+ trx->xid.formatID = -1; -+#endif /* WITH_WSREP */ -+ - /* The initial value for trx->no: TRX_ID_MAX is used in - read_view_open_now: */ - -@@ -967,6 +975,9 @@ trx_write_serialisation_history( - trx_t* trx, /*!< in/out: transaction */ - mtr_t* mtr) /*!< in/out: mini-transaction */ - { -+#ifdef WITH_WSREP -+ trx_sysf_t* sys_header; -+#endif /* WITH_WSREP */ - trx_rseg_t* rseg; - - rseg = trx->rseg; -@@ -1013,6 +1024,15 @@ trx_write_serialisation_history( - - MONITOR_INC(MONITOR_TRX_COMMIT_UNDO); - -+#ifdef WITH_WSREP -+ sys_header = trx_sysf_get(mtr); -+ /* Update latest MySQL wsrep XID in trx sys header. */ -+ if (wsrep_is_wsrep_xid(&trx->xid)) -+ { -+ trx_sys_update_wsrep_checkpoint(&trx->xid, sys_header, mtr); -+ } -+#endif /* WITH_WSREP */ -+ - /* Update the latest MySQL binlog name and offset info - in trx sys header if MySQL binlogging is on or the database - server is a MySQL replication slave */ -@@ -1023,7 +1043,11 @@ trx_write_serialisation_history( - trx_sys_update_mysql_binlog_offset( - trx->mysql_log_file_name, - trx->mysql_log_offset, -+#ifdef WITH_WSREP -+ TRX_SYS_MYSQL_LOG_INFO, sys_header, mtr); -+#else - TRX_SYS_MYSQL_LOG_INFO, mtr); -+#endif /* WITH_WSREP */ - - trx->mysql_log_file_name = NULL; - } -@@ -1318,6 +1342,11 @@ trx_commit_in_memory( - ut_ad(!trx->in_ro_trx_list); - ut_ad(!trx->in_rw_trx_list); - -+#ifdef WITH_WSREP -+ if (wsrep_on(trx->mysql_thd)) { -+ trx->lock.was_chosen_as_deadlock_victim = FALSE; -+ } -+#endif - trx->dict_operation = TRX_DICT_OP_NONE; - - trx->error_state = DB_SUCCESS; -@@ -1502,6 +1531,10 @@ trx_commit_or_rollback_prepare( - - switch (trx->state) { - case TRX_STATE_NOT_STARTED: -+#ifdef WITH_WSREP -+ ut_d(trx->start_file = __FILE__); -+ ut_d(trx->start_line = __LINE__); -+#endif /* WITH_WSREP */ - trx_start_low(trx); - /* fall through */ - case TRX_STATE_ACTIVE: -@@ -2229,6 +2262,10 @@ trx_start_if_not_started_xa_low( - transaction, doesn't. */ - trx->support_xa = thd_supports_xa(trx->mysql_thd); - -+#ifdef WITH_WSREP -+ ut_d(trx->start_file = __FILE__); -+ ut_d(trx->start_line = __LINE__); -+#endif /* WITH_WSREP */ - trx_start_low(trx); - /* fall through */ - case TRX_STATE_ACTIVE: -@@ -2251,6 +2288,10 @@ trx_start_if_not_started_low( - { - switch (trx->state) { - case TRX_STATE_NOT_STARTED: -+#ifdef WITH_WSREP -+ ut_d(trx->start_file = __FILE__); -+ ut_d(trx->start_line = __LINE__); -+#endif /* WITH_WSREP */ - trx_start_low(trx); - /* fall through */ - case TRX_STATE_ACTIVE: -@@ -2284,6 +2325,10 @@ trx_start_for_ddl_low( - trx->will_lock = 1; - - trx->ddl = true; -+#ifdef WITH_WSREP -+ ut_d(trx->start_file = __FILE__); -+ ut_d(trx->start_line = __LINE__); -+#endif /* WITH_WSREP */ - - trx_start_low(trx); - return; -diff --git a/support-files/CMakeLists.txt b/support-files/CMakeLists.txt -index 5afe261..74b1075 100644 ---- a/support-files/CMakeLists.txt -+++ b/support-files/CMakeLists.txt -@@ -93,4 +93,12 @@ IF(UNIX) - DESTINATION ${inst_location} COMPONENT SupportFiles - PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ - GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) -+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/wsrep_notify.sh -+ ${CMAKE_CURRENT_BINARY_DIR}/wsrep_notify @ONLY) -+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/wsrep_notify -+ DESTINATION ${inst_location} COMPONENT SupportFiles -+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ -+ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) -+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/wsrep.cnf.sh -+ ${CMAKE_CURRENT_BINARY_DIR}/wsrep.cnf @ONLY) - ENDIF() -diff --git a/support-files/build-tags b/support-files/build-tags -index c37485e..635940a 100755 ---- a/support-files/build-tags -+++ b/support-files/build-tags -@@ -10,3 +10,7 @@ $list |grep $filter |while read f; - do - etags -o TAGS --append $f - done -+(cd storage/galera && svn ls -R) | grep $filter | while read f; -+do -+ etags -o TAGS --append storage/galera/$f -+done -diff --git a/support-files/cmake-no-wix.patch b/support-files/cmake-no-wix.patch -new file mode 100644 -index 0000000..325d97e ---- /dev/null -+++ b/support-files/cmake-no-wix.patch -@@ -0,0 +1,14 @@ -+diff --git a/CMakeLists.txt b/CMakeLists.txt -+index 9e235ba..15c3414 100644 -+--- a/CMakeLists.txt -++++ b/CMakeLists.txt -+@@ -569,7 +569,8 @@ IF(WIN32) -+ ELSE() -+ SET(CPACK_GENERATOR "TGZ") -+ ENDIF() -+-ADD_SUBDIRECTORY(packaging/WiX) -++# Trouble on SLES 11 due to old cmake ... -++# ADD_SUBDIRECTORY(packaging/WiX) -+ ADD_SUBDIRECTORY(packaging/solaris) -+ -+ # Create a single package with "make package" -diff --git a/support-files/mysql-rpmlintrc b/support-files/mysql-rpmlintrc -new file mode 100644 -index 0000000..72dd6e3 ---- /dev/null -+++ b/support-files/mysql-rpmlintrc -@@ -0,0 +1,64 @@ -+# allow the traditional name "mysql-shared" even with a so-versioned lib -+setBadness('shlib-policy-name-error', 0) -+ -+# Suppress several "false positive" messages which we cannot prevent: -+# Oracle text we must not change: -+addFilter("MySQL.* invalid-license") -+addFilter("mysql.* invalid-license") -+addFilter("MySQL.* name-repeated-in-summary") -+addFilter("mysql.* name-repeated-in-summary") -+addFilter("MySQL.* no-version-in-last-changelog") -+addFilter("mysql.* no-version-in-last-changelog") -+addFilter("MySQL.*src.* invalid-spec-name") -+addFilter("mysql.*src.* invalid-spec-name") -+# Oracle code we must not change: -+addFilter("MySQL.*shared.* shared-lib-calls-exit /usr/lib64/libmysqlclient") -+addFilter("mysql.*shared.* shared-lib-calls-exit /usr/lib64/libmysqlclient") -+addFilter("MySQL.*server.* binary-or-shlib-calls-gethostbyname /usr/bin/resolveip") -+addFilter("mysql.*server.* binary-or-shlib-calls-gethostbyname /usr/bin/resolveip") -+# "obsolete" the Oracle commercial RPMs: -+addFilter("MySQL.* obsolete-not-provided mysql[^ ]*advanced") -+addFilter("mysql.* obsolete-not-provided mysql[^ ]*advanced") -+addFilter("MySQL.* obsolete-not-provided MySQL[^ ]*advanced") -+addFilter("mysql.* obsolete-not-provided MySQL[^ ]*advanced") -+addFilter("MySQL.* obsolete-not-provided MySQL[^ ]*classic") -+addFilter("mysql.* obsolete-not-provided MySQL[^ ]*classic") -+addFilter("MySQL.* obsolete-not-provided MySQL[^ ]*community") -+addFilter("mysql.* obsolete-not-provided MySQL[^ ]*community") -+addFilter("MySQL.* obsolete-not-provided MySQL[^ ]*enterprise") -+addFilter("mysql.* obsolete-not-provided MySQL[^ ]*enterprise") -+addFilter("MySQL.* obsolete-not-provided MySQL[^ ]*pro") -+addFilter("mysql.* obsolete-not-provided MySQL[^ ]*pro") -+addFilter("MySQL.* obsolete-not-provided MySQL[^ ]*standard") -+addFilter("mysql.* obsolete-not-provided MySQL[^ ]*standard") -+# ... and the packages we dropped on intention: -+addFilter("MySQL.*devel.* obsolete-not-provided MySQL-embedded-devel") -+addFilter("mysql.*devel.* obsolete-not-provided MySQL-embedded-devel") -+addFilter("MySQL.*devel.* obsolete-not-provided mysql-embedded-devel") -+addFilter("mysql.*devel.* obsolete-not-provided mysql-embedded-devel") -+addFilter("MySQL.*test.* obsolete-not-provided MySQL-bench") -+addFilter("mysql.*test.* obsolete-not-provided MySQL-bench") -+addFilter("MySQL.*test.* obsolete-not-provided mysql-bench") -+addFilter("mysql.*test.* obsolete-not-provided mysql-bench") -+# Oracle does not strip binaries, and neither will we: -+addFilter("MySQL.* unstripped-binary-or-object /usr/s?bin/.*") -+addFilter("mysql.* unstripped-binary-or-object /usr/s?bin/.*") -+addFilter("MySQL.* unstripped-binary-or-object /usr/lib64/.*") -+addFilter("mysql.* unstripped-binary-or-object /usr/lib64/.*") -+addFilter("MySQL.*test.* unstripped-binary-or-object /usr/share/mysql-test/lib/.*") -+addFilter("mysql.*test.* unstripped-binary-or-object /usr/share/mysql-test/lib/.*") -+# Pre-defined certificates are needed for SSL tests, also a binary: -+addFilter("MySQL.*test.* pem-certificate") -+addFilter("mysql.*test.* pem-certificate") -+addFilter("MySQL.*test.* arch-dependent-file-in-usr-share /usr/share/mysql-test/lib/My/SafeProcess/my_safe_process") -+addFilter("mysql.*test.* arch-dependent-file-in-usr-share /usr/share/mysql-test/lib/My/SafeProcess/my_safe_process") -+# Oracle doesn't have a "check" section (yet): -+addFilter("MySQL.* make-check-outside-check-section") -+addFilter("mysql.* make-check-outside-check-section") -+# Documentation issues: -+addFilter("MySQL.*server.* no-manual-page-for-binary mysqld-debug") -+addFilter("mysql.*server.* no-manual-page-for-binary mysqld-debug") -+# File naming: -+addFilter("MySQL.*server.* incoherent-init-script-name mysql") -+addFilter("mysql.*server.* incoherent-init-script-name mysql") -+# End of the "false positive" messages which we cannot prevent. -diff --git a/support-files/mysql.server.sh b/support-files/mysql.server.sh -index 7487d5a..5c3f2f9 100644 ---- a/support-files/mysql.server.sh -+++ b/support-files/mysql.server.sh -@@ -24,6 +24,11 @@ - # Short-Description: start and stop MySQL - # Description: MySQL is a very fast and reliable SQL database engine. - ### END INIT INFO -+ -+# Prevent OpenSUSE's init scripts from calling systemd, so that -+# both 'bootstrap' and 'start' are handled entirely within this script -+ -+SYSTEMD_NO_WRAP=1 - - # If you install MySQL on some other places than @prefix@, then you - # have to do one of the following things for this script to work: -@@ -329,7 +334,10 @@ case "$mode" in - # Stop the service and regardless of whether it was - # running or not, start it again. - if $0 stop $other_args; then -- $0 start $other_args -+ if ! $0 start $other_args; then -+ log_failure_msg "Failed to restart server." -+ exit 1 -+ fi - else - log_failure_msg "Failed to stop running server, so refusing to try to start." - exit 1 -@@ -379,6 +387,12 @@ case "$mode" in - fi - fi - ;; -+ 'bootstrap') -+ # Bootstrap the cluster, start the first node -+ # that initiate the cluster -+ echo $echo_n "Bootstrapping the cluster" -+ $0 start $other_args --wsrep-new-cluster -+ ;; - *) - # usage - basename=`basename "$0"` -diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh -index c72ca39..9e8ce67 100644 ---- a/support-files/mysql.spec.sh -+++ b/support-files/mysql.spec.sh -@@ -25,13 +25,15 @@ - %global mysql_vendor Oracle and/or its affiliates - - %global mysql_version @VERSION@ -+%global wsrep_version @WSREP_VERSION@ -+%global wsrep_revision @WSREP_REVISION@ - - %global mysqld_user mysql - %global mysqld_group mysql - %global mysqldatadir /var/lib/mysql - --%global release 1 -- -+%global release %{wsrep_version} -+%global short_product_tag 5.6 - - # - # Macros we use which are not available in all supported versions of RPM -@@ -79,9 +81,9 @@ - # Source name - # ---------------------------------------------------------------------------- - %if %{undefined src_base} --%define src_base mysql -+%define src_base mysql-wsrep - %endif --%define src_dir %{src_base}-%{mysql_version} -+%define src_dir %{src_base}-%{mysql_version}-%{wsrep_version} - - # ---------------------------------------------------------------------------- - # Feature set (storage engines, options). Default to community (everything) -@@ -118,95 +120,48 @@ - # ---------------------------------------------------------------------------- - # Distribution support - # ---------------------------------------------------------------------------- --%if %{undefined distro_specific} --%define distro_specific 0 -+ -+# Disable post build checks for time being. -+BuildConflicts: post-build-checks -+ -+BuildRequires: gcc-c++ ncurses-devel perl zlib-devel cmake libaio-devel bison flex -+ -+%if 0%{?rhel} == 6 || 0%{?rhel} == 7 || 0%{?fedora} == 20 || 0%{?fedora} == 21 -+BuildRequires: time - %endif --%if %{distro_specific} -- %if %(test -f /etc/enterprise-release && echo 1 || echo 0) -- %define oelver %(rpm -qf --qf '%%{version}\\n' /etc/enterprise-release | sed -e 's/^\\([0-9]*\\).*/\\1/g') -- %if "%oelver" == "4" -- %define distro_description Oracle Enterprise Linux 4 -- %define distro_releasetag oel4 -- %define distro_buildreq gcc-c++ gperf ncurses-devel perl time zlib-devel cmake libaio-devel -- %define distro_requires chkconfig coreutils grep procps shadow-utils net-tools -- %else -- %if "%oelver" == "5" -- %define distro_description Oracle Enterprise Linux 5 -- %define distro_releasetag oel5 -- %define distro_buildreq gcc-c++ gperf ncurses-devel perl time zlib-devel cmake libaio-devel -- %define distro_requires chkconfig coreutils grep procps shadow-utils net-tools -- %else -- %{error:Oracle Enterprise Linux %{oelver} is unsupported} -- %endif -- %endif -- %else -- %if %(test -f /etc/oracle-release && echo 1 || echo 0) -- %define elver %(rpm -qf --qf '%%{version}\\n' /etc/oracle-release | sed -e 's/^\\([0-9]*\\).*/\\1/g') -- %if "%elver" == "6" || "%elver" == "7" -- %define distro_description Oracle Linux %elver -- %define distro_releasetag el%elver -- %define distro_buildreq gcc-c++ ncurses-devel perl time zlib-devel cmake libaio-devel -- %define distro_requires chkconfig coreutils grep procps shadow-utils net-tools -- %else -- %{error:Oracle Linux %{elver} is unsupported} -- %endif -- %else -- %if %(test -f /etc/redhat-release && echo 1 || echo 0) -- %define rhelver %(rpm -qf --qf '%%{version}\\n' /etc/redhat-release | sed -e 's/^\\([0-9]*\\).*/\\1/g') -- %if "%rhelver" == "4" -- %define distro_description Red Hat Enterprise Linux 4 -- %define distro_releasetag rhel4 -- %define distro_buildreq gcc-c++ gperf ncurses-devel perl time zlib-devel cmake libaio-devel -- %define distro_requires chkconfig coreutils grep procps shadow-utils net-tools -- %else -- %if "%rhelver" == "5" -- %define distro_description Red Hat Enterprise Linux 5 -- %define distro_releasetag rhel5 -- %define distro_buildreq gcc-c++ gperf ncurses-devel perl time zlib-devel cmake libaio-devel -- %define distro_requires chkconfig coreutils grep procps shadow-utils net-tools -- %else -- %if "%rhelver" == "6" -- %define distro_description Red Hat Enterprise Linux 6 -- %define distro_releasetag rhel6 -- %define distro_buildreq gcc-c++ ncurses-devel perl time zlib-devel cmake libaio-devel -- %define distro_requires chkconfig coreutils grep procps shadow-utils net-tools -- %else -- %{error:Red Hat Enterprise Linux %{rhelver} is unsupported} -- %endif -- %endif -- %endif -- %else -- %if %(test -f /etc/SuSE-release && echo 1 || echo 0) -- %define susever %(rpm -qf --qf '%%{version}\\n' /etc/SuSE-release | cut -d. -f1) -- %if "%susever" == "10" -- %define distro_description SUSE Linux Enterprise Server 10 -- %define distro_releasetag sles10 -- %define distro_buildreq gcc-c++ gdbm-devel gperf ncurses-devel openldap2-client zlib-devel cmake libaio-devel -- %define distro_requires aaa_base coreutils grep procps pwdutils -- %else -- %if "%susever" == "11" -- %define distro_description SUSE Linux Enterprise Server 11 -- %define distro_releasetag sles11 -- %define distro_buildreq gcc-c++ gdbm-devel gperf ncurses-devel openldap2-client procps pwdutils zlib-devel cmake libaio-devel -- %define distro_requires aaa_base coreutils grep procps pwdutils -- %else -- %{error:SuSE %{susever} is unsupported} -- %endif -- %endif -- %else -- %{error:Unsupported distribution} -- %endif -- %endif -- %endif -+ -+%if 0%{?suse_version} -+%if 0%{?suse_version} == 1110 -+BuildRequires: gdbm-devel gperf openldap2-client procps pwdutils -+%endif -+%if 0%{?suse_version} == 1310 || 0%{?suse_version} == 1315 || 0%{?suse_version} == 1320 -+BuildRequires: gperf procps time -+%endif -+%endif -+ -+# Define dist tag if not given by platform -+%if %{undefined dist} -+ # For suse versions see: -+ # https://en.opensuse.org/openSUSE:Build_Service_cross_distribution_howto -+ %if 0%{?suse_version} == 1110 -+ %define dist .sle11 -+ %endif -+ %if 0%{?suse_version} == 1310 -+ %define dist .suse13.1 -+ %endif -+ %if 0%{?suse_version} == 1315 -+ %define dist .sle12 -+ %endif -+ %if 0%{?suse_version} == 1320 -+ %define dist .suse13.2 -+ %endif -+ # Still missing? -+ %if %{undefined dist} -+ %define dist .DIST - %endif --%else -- %define glibc_version %(/lib/libc.so.6 | grep stable | cut -d, -f1 | cut -c38-) -- %define distro_description Generic Linux (glibc %{glibc_version}) -- %define distro_releasetag linux_glibc%{glibc_version} -- %define distro_buildreq gcc-c++ gperf ncurses-devel perl time zlib-devel -- %define distro_requires coreutils grep procps /sbin/chkconfig /usr/sbin/useradd /usr/sbin/groupadd - %endif - -+ - # Avoid debuginfo RPMs, leaves binaries unstripped - %define debug_package %{nil} - -@@ -231,7 +186,7 @@ - %define license_files_server %{src_dir}/LICENSE.mysql - %define license_type Commercial - %else --%define license_files_server %{src_dir}/COPYING %{src_dir}/README -+%define license_files_server COPYING README - %define license_type GPL - %endif - -@@ -243,17 +198,20 @@ Name: MySQL%{product_suffix} - Summary: MySQL: a very fast and reliable SQL database server - Group: Applications/Databases - Version: @MYSQL_RPM_VERSION@ --Release: %{release}%{?distro_releasetag:.%{distro_releasetag}} --Distribution: %{distro_description} -+Release: %{release}%{dist} -+# Distribution: %{distro_description} - License: Copyright (c) 2000, @MYSQL_COPYRIGHT_YEAR@, %{mysql_vendor}. All rights reserved. Under %{license_type} license as shown in the Description field. --Source: http://www.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/%{src_dir}.tar.gz -+Source: %{src_dir}.tar.gz -+Source99: mysql-rpmlintrc -+Patch0: cmake-no-wix.patch - URL: http://www.mysql.com/ --Packager: MySQL Release Engineering -+Packager: Codership Oy - Vendor: %{mysql_vendor} --BuildRequires: %{distro_buildreq} -+# BuildRequires: %{distro_buildreq} -+#wsrep_patch_tag - - # Regression tests may take a long time, override the default to skip them --%{!?runselftest:%global runselftest 1} -+%{!?runselftest:%global runselftest 0} - - # Think about what you use here since the first step is to - # run a rm -rf -@@ -282,10 +240,41 @@ documentation and the manual for more information. - # Sub package definition - ############################################################################## - --%package -n MySQL-server%{product_suffix} -+%package -n mysql-wsrep%{product_suffix} -+Summary: MySQL: meta package for a server+client setup -+Group: Applications/Databases -+Requires: mysql-wsrep-server%{product_suffix} -+Requires: mysql-wsrep-client%{product_suffix} -+ -+%description -n mysql-wsrep%{product_suffix} -+This meta package ensures the installation of a MySQL server and the necessary -+client programs for operation and administration. It does not itself -+contain those files but rather causes the installation of the subpackages -+"mysql-wsrep-server%{product_suffix}" and "mysql-wsrep-client%{product_suffix}". -+As indicated in the name, the server is built with the "wsrep" plugin so that -+it can be a node in a MySQL Galera Cluster. -+ -+# ---------------------------------------------------------------------------- -+ -+%package -n mysql-wsrep-server%{product_suffix} - Summary: MySQL: a very fast and reliable SQL database server - Group: Applications/Databases --Requires: %{distro_requires} -+# Distro requirements -+# RedHat -+%if 0%{?fedora} || 0%{?rhel} -+Requires: chkconfig coreutils grep procps shadow-utils net-tools rsync lsof -+%if 0%{?rhel} == 7 || 0%{?fedora} >= 20 -+Requires: perl-Data-Dumper -+%endif -+%endif -+# SUSE -+%if 0%{?suse_version} -+Requires: aaa_base coreutils grep procps rsync lsof -+%if 0%{suse_version} == 1110 -+Requires: pwdutils -+%endif -+%endif -+ - %if 0%{?commercial} - Obsoletes: MySQL-server - %else -@@ -298,7 +287,7 @@ Obsoletes: MySQL-server-advanced-gpl MySQL-server-enterprise-gpl - Provides: mysql-server = %{version}-%{release} - Provides: mysql-server%{?_isa} = %{version}-%{release} - --%description -n MySQL-server%{product_suffix} -+%description -n mysql-wsrep-server%{product_suffix} - The MySQL(TM) software delivers a very fast, multi-threaded, multi-user, - and robust SQL (Structured Query Language) database server. MySQL Server - is intended for mission-critical, heavy-load production systems as well -@@ -319,11 +308,13 @@ and the manual for more information. - This package includes the MySQL server binary as well as related utilities - to run and administer a MySQL server. - -+Built with wsrep patch %{wsrep_version}. -+ - If you want to access and work with the database, you have to install --package "MySQL-client%{product_suffix}" as well! -+package "mysql-wsrep-client%{product_suffix}" as well! - - # ---------------------------------------------------------------------------- --%package -n MySQL-client%{product_suffix} -+%package -n mysql-wsrep-client%{product_suffix} - Summary: MySQL - Client - Group: Applications/Databases - %if 0%{?commercial} -@@ -338,13 +329,13 @@ Obsoletes: MySQL-client-advanced-gpl MySQL-client-enterprise-gpl - Provides: mysql = %{version}-%{release} - Provides: mysql%{?_isa} = %{version}-%{release} - --%description -n MySQL-client%{product_suffix} -+%description -n mysql-wsrep-client%{product_suffix} - This package contains the standard MySQL clients and administration tools. - - For a description of MySQL see the base MySQL RPM or http://www.mysql.com/ - - # ---------------------------------------------------------------------------- --%package -n MySQL-test%{product_suffix} -+%package -n mysql-wsrep-test%{product_suffix} - Summary: MySQL - Test suite - Group: Applications/Databases - %if 0%{?commercial} -@@ -362,13 +353,13 @@ Provides: mysql-test = %{version}-%{release} - Provides: mysql-test%{?_isa} = %{version}-%{release} - AutoReqProv: no - --%description -n MySQL-test%{product_suffix} -+%description -n mysql-wsrep-test%{product_suffix} - This package contains the MySQL regression test suite. - - For a description of MySQL see the base MySQL RPM or http://www.mysql.com/ - - # ---------------------------------------------------------------------------- --%package -n MySQL-devel%{product_suffix} -+%package -n mysql-wsrep-devel%{product_suffix} - Summary: MySQL - Development header files and libraries - Group: Applications/Databases - %if 0%{?commercial} -@@ -383,14 +374,14 @@ Obsoletes: MySQL-devel-advanced-gpl MySQL-devel-enterprise-gpl - Provides: mysql-devel = %{version}-%{release} - Provides: mysql-devel%{?_isa} = %{version}-%{release} - --%description -n MySQL-devel%{product_suffix} -+%description -n mysql-wsrep-devel%{product_suffix} - This package contains the development header files and libraries necessary - to develop MySQL client applications. - - For a description of MySQL see the base MySQL RPM or http://www.mysql.com/ - - # ---------------------------------------------------------------------------- --%package -n MySQL-shared%{product_suffix} -+%package -n mysql-wsrep-shared%{product_suffix} - Summary: MySQL - Shared libraries - Group: Applications/Databases - %if 0%{?commercial} -@@ -404,44 +395,17 @@ Obsoletes: MySQL-shared-pro-gpl-cert - Obsoletes: MySQL-shared-classic MySQL-shared-community MySQL-shared-enterprise - Obsoletes: MySQL-shared-advanced-gpl MySQL-shared-enterprise-gpl - --%description -n MySQL-shared%{product_suffix} -+%description -n mysql-wsrep-shared%{product_suffix} - This package contains the shared libraries (*.so*) which certain languages - and applications need to dynamically load and use MySQL. - --# ---------------------------------------------------------------------------- --%package -n MySQL-embedded%{product_suffix} --Summary: MySQL - Embedded library --Group: Applications/Databases --%if 0%{?commercial} --Requires: MySQL-devel-advanced --Obsoletes: MySQL-embedded --%else --Requires: MySQL-devel --Obsoletes: MySQL-embedded-advanced --%endif --Obsoletes: mysql-embedded < %{version}-%{release} --Obsoletes: mysql-embedded-advanced --Obsoletes: MySQL-embedded-pro --Obsoletes: MySQL-embedded-classic MySQL-embedded-community MySQL-embedded-enterprise --Obsoletes: MySQL-embedded-advanced-gpl MySQL-embedded-enterprise-gpl --Provides: mysql-embedded = %{version}-%{release} --Provides: mysql-emdedded%{?_isa} = %{version}-%{release} -- --%description -n MySQL-embedded%{product_suffix} --This package contains the MySQL server as an embedded library. -- --The embedded MySQL server library makes it possible to run a full-featured --MySQL server inside the client application. The main benefits are increased --speed and more simple management for embedded applications. -- --The API is identical for the embedded MySQL version and the --client/server version. -- --For a description of MySQL see the base MySQL RPM or http://www.mysql.com/ -- - ############################################################################## - %prep --%setup -T -a 0 -c -n %{src_dir} -+%setup -n %{src_dir} -+# That patch is needed with old cmake only, on SLES 11, but it won't do any harm -+# outside Windows, so it may be used in all RPM builds. -+%patch0 -p1 -+#wsrep_apply_patch_tag - ############################################################################## - %build - -@@ -481,7 +445,7 @@ export CFLAGS=${MYSQL_BUILD_CFLAGS:-${CFLAGS:-$RPM_OPT_FLAGS}} - export CXXFLAGS=${MYSQL_BUILD_CXXFLAGS:-${CXXFLAGS:-$RPM_OPT_FLAGS -felide-constructors}} - export LDFLAGS=${MYSQL_BUILD_LDFLAGS:-${LDFLAGS:-}} - export CMAKE=${MYSQL_BUILD_CMAKE:-${CMAKE:-cmake}} --export MAKE_JFLAG=${MYSQL_BUILD_MAKE_JFLAG:-} -+export MAKE_JFLAG=${MYSQL_BUILD_MAKE_JFLAG:--j$(ncpu=$(cat /proc/cpuinfo | grep processor | wc -l) && echo $(($ncpu > 4 ? 4 : $ncpu)))} - - # By default, a build will include the bundeled "yaSSL" library for SSL. - # However, there may be a need to override. -@@ -500,6 +464,7 @@ mkdir debug - CFLAGS=`echo " ${CFLAGS} " | \ - sed -e 's/ -O[0-9]* / /' \ - -e 's/-Wp,-D_FORTIFY_SOURCE=2/ /' \ -+ -e 's/-D_FORTIFY_SOURCE=2/ /' \ - -e 's/ -unroll2 / /' \ - -e 's/ -ip / /' \ - -e 's/^ //' \ -@@ -507,19 +472,23 @@ mkdir debug - CXXFLAGS=`echo " ${CXXFLAGS} " | \ - sed -e 's/ -O[0-9]* / /' \ - -e 's/-Wp,-D_FORTIFY_SOURCE=2/ /' \ -+ -e 's/-D_FORTIFY_SOURCE=2/ /' \ - -e 's/ -unroll2 / /' \ - -e 's/ -ip / /' \ - -e 's/^ //' \ - -e 's/ $//'` - # XXX: MYSQL_UNIX_ADDR should be in cmake/* but mysql_version is included before - # XXX: install_layout so we can't just set it based on INSTALL_LAYOUT=RPM -- ${CMAKE} ../%{src_dir} -DBUILD_CONFIG=mysql_release -DINSTALL_LAYOUT=RPM \ -+ ${CMAKE} ../ -DBUILD_CONFIG=mysql_release -DINSTALL_LAYOUT=RPM \ - -DCMAKE_BUILD_TYPE=Debug \ - -DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \ - -DFEATURE_SET="%{feature_set}" \ - %{ssl_option} \ - -DCOMPILATION_COMMENT="%{compilation_comment_debug}" \ -- -DMYSQL_SERVER_SUFFIX="%{server_suffix}" -+ -DMYSQL_SERVER_SUFFIX="%{server_suffix}" \ -+ -DWITH_WSREP=1 \ -+ -DWSREP_VERSION="%{wsrep_version}" \ -+ -DWSREP_REVISION="%{wsrep_revision}" - echo BEGIN_DEBUG_CONFIG ; egrep '^#define' include/config.h ; echo END_DEBUG_CONFIG - make ${MAKE_JFLAG} VERBOSE=1 - ) -@@ -529,13 +498,16 @@ mkdir release - cd release - # XXX: MYSQL_UNIX_ADDR should be in cmake/* but mysql_version is included before - # XXX: install_layout so we can't just set it based on INSTALL_LAYOUT=RPM -- ${CMAKE} ../%{src_dir} -DBUILD_CONFIG=mysql_release -DINSTALL_LAYOUT=RPM \ -+ ${CMAKE} ../ -DBUILD_CONFIG=mysql_release -DINSTALL_LAYOUT=RPM \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DMYSQL_UNIX_ADDR="%{mysqldatadir}/mysql.sock" \ - -DFEATURE_SET="%{feature_set}" \ - %{ssl_option} \ - -DCOMPILATION_COMMENT="%{compilation_comment_release}" \ -- -DMYSQL_SERVER_SUFFIX="%{server_suffix}" -+ -DMYSQL_SERVER_SUFFIX="%{server_suffix}" \ -+ -DWITH_WSREP=1 \ -+ -DWSREP_VERSION="%{wsrep_version}" \ -+ -DWSREP_REVISION="%{wsrep_revision}" - echo BEGIN_NORMAL_CONFIG ; egrep '^#define' include/config.h ; echo END_NORMAL_CONFIG - make ${MAKE_JFLAG} VERBOSE=1 - ) -@@ -582,14 +554,20 @@ install -m 755 $MBD/release/support-files/mysql.server $RBR%{_sysconfdir}/init.d - - # Create a symlink "rcmysql", pointing to the init.script. SuSE users - # will appreciate that, as all services usually offer this. --ln -s %{_sysconfdir}/init.d/mysql $RBR%{_sbindir}/rcmysql -+ln -sf %{_sysconfdir}/init.d/mysql $RBR%{_sbindir}/rcmysql -+ -+# Create a wsrep_sst_rsync_wan symlink. -+install -d $RBR%{_bindir} -+ln -sf wsrep_sst_rsync $RBR%{_bindir}/wsrep_sst_rsync_wan - - # Touch the place where the my.cnf config file might be located - # Just to make sure it's in the file list and marked as a config file - touch $RBR%{_sysconfdir}/my.cnf -+touch $RBR%{_sysconfdir}/wsrep.cnf -+ - - # Install SELinux files in datadir --install -m 600 $MBD/%{src_dir}/support-files/RHEL4-SElinux/mysql.{fc,te} \ -+install -m 600 $MBD/support-files/RHEL4-SElinux/mysql.{fc,te} \ - $RBR%{_datadir}/mysql/SELinux/RHEL4 - - %if %{WITH_TCMALLOC} -@@ -608,7 +586,7 @@ install -m 644 "%{malloc_lib_source}" \ - # Post processing actions, i.e. when installed - ############################################################################## - --%pre -n MySQL-server%{product_suffix} -+%pre -n mysql-wsrep-server%{product_suffix} - # This is the code running at the beginning of a RPM upgrade action, - # before replacing the old files with the new ones. - -@@ -786,7 +764,7 @@ if [ -x %{_sysconfdir}/init.d/mysql ] ; then - sleep 5 - fi - --%post -n MySQL-server%{product_suffix} -+%post -n mysql-wsrep-server%{product_suffix} - # This is the code running at the end of a RPM install or upgrade action, - # after the (new) files have been written. - -@@ -946,7 +924,7 @@ mv -f $STATUS_FILE ${STATUS_FILE}-LAST # for "triggerpostun" - #scheduled service packs and more. Visit www.mysql.com/enterprise for more - #information." - --%preun -n MySQL-server%{product_suffix} -+%preun -n mysql-wsrep-server%{product_suffix} - - # Which '$1' does this refer to? Fedora docs have info: - # " ... a count of the number of versions of the package that are installed. -@@ -975,7 +953,7 @@ fi - # We do not remove the mysql user since it may still own a lot of - # database files. - --%triggerpostun -n MySQL-server%{product_suffix} --MySQL-server-community -+%triggerpostun -n mysql-wsrep-server%{product_suffix} --MySQL-server-community - - # Setup: We renamed this package, so any existing "server-community" - # package will be removed when this "server" is installed. -@@ -1046,15 +1024,22 @@ echo "=====" >> $STATUS_HISTORY - # Files section - ############################################################################## - --%files -n MySQL-server%{product_suffix} -f release/support-files/plugins.files -+%files -n mysql-wsrep%{product_suffix} -+# Intentionally empty - this is a pure meta package. -+ -+# ---------------------------------------------------------------------------- -+%files -n mysql-wsrep-server%{product_suffix} -f release/support-files/plugins.files - %defattr(-,root,root,0755) - %if %{defined license_files_server} - %doc %{license_files_server} - %endif --%doc %{src_dir}/Docs/ChangeLog --%doc %{src_dir}/Docs/INFO_SRC* -+%doc Docs/ChangeLog -+%doc release/Docs/INFO_SRC* - %doc release/Docs/INFO_BIN* - %doc release/support-files/my-default.cnf -+%doc Docs/README-wsrep -+%doc release/support-files/wsrep.cnf -+%doc release/support-files/wsrep_notify - - %if 0%{?commercial} - %doc %attr(644, root, root) %{_infodir}/mysql.info* -@@ -1090,6 +1075,7 @@ echo "=====" >> $STATUS_HISTORY - %doc %attr(644, root, man) %{_mandir}/man1/resolveip.1* - - %ghost %config(noreplace,missingok) %{_sysconfdir}/my.cnf -+%ghost %config(noreplace,missingok) %{_sysconfdir}/wsrep.cnf - %dir %{_sysconfdir}/my.cnf.d - - %attr(755, root, root) %{_bindir}/innochecksum -@@ -1117,10 +1103,18 @@ echo "=====" >> $STATUS_HISTORY - %attr(755, root, root) %{_bindir}/replace - %attr(755, root, root) %{_bindir}/resolve_stack_dump - %attr(755, root, root) %{_bindir}/resolveip -+%attr(755, root, root) %{_bindir}/wsrep_sst_common -+%attr(755, root, root) %{_bindir}/wsrep_sst_mysqldump -+%attr(755, root, root) %{_bindir}/wsrep_sst_rsync -+%attr(755, root, root) %{_bindir}/wsrep_sst_rsync_wan -+%attr(755, root, root) %{_bindir}/wsrep_sst_xtrabackup -+%attr(755, root, root) %{_bindir}/wsrep_sst_xtrabackup-v2 - - %attr(755, root, root) %{_sbindir}/mysqld - %attr(755, root, root) %{_sbindir}/mysqld-debug - %attr(755, root, root) %{_sbindir}/rcmysql -+%dir %{_libdir}/mysql/plugin -+%dir %{_libdir}/mysql/plugin/debug - %attr(755, root, root) %{_libdir}/mysql/plugin/daemon_example.ini - - %if %{WITH_TCMALLOC} -@@ -1133,7 +1127,8 @@ echo "=====" >> $STATUS_HISTORY - %dir %attr(755, mysql, mysql) /var/lib/mysql - - # ---------------------------------------------------------------------------- --%files -n MySQL-client%{product_suffix} -+%files -n mysql-wsrep-client%{product_suffix} -+ - %defattr(-, root, root, 0755) - %if %{defined license_files_server} - %doc %{license_files_server} -@@ -1169,7 +1164,7 @@ echo "=====" >> $STATUS_HISTORY - %doc %attr(644, root, man) %{_mandir}/man1/mysql_config_editor.1* - - # ---------------------------------------------------------------------------- --%files -n MySQL-devel%{product_suffix} -f optional-files-devel -+%files -n mysql-wsrep-devel%{product_suffix} -f optional-files-devel - %defattr(-, root, root, 0755) - %if %{defined license_files_server} - %doc %{license_files_server} -@@ -1186,7 +1181,7 @@ echo "=====" >> $STATUS_HISTORY - %{_libdir}/mysql/libmysqlservices.a - - # ---------------------------------------------------------------------------- --%files -n MySQL-shared%{product_suffix} -+%files -n mysql-wsrep-shared%{product_suffix} - %defattr(-, root, root, 0755) - %if %{defined license_files_server} - %doc %{license_files_server} -@@ -1194,44 +1189,47 @@ echo "=====" >> $STATUS_HISTORY - # Shared libraries (omit for architectures that don't support them) - %{_libdir}/libmysql*.so* - --%post -n MySQL-shared%{product_suffix} -+%post -n mysql-wsrep-shared%{product_suffix} - /sbin/ldconfig - --%postun -n MySQL-shared%{product_suffix} -+%postun -n mysql-wsrep-shared%{product_suffix} - /sbin/ldconfig - - # ---------------------------------------------------------------------------- --%files -n MySQL-test%{product_suffix} -+%files -n mysql-wsrep-test%{product_suffix} - %defattr(-, root, root, 0755) - %if %{defined license_files_server} - %doc %{license_files_server} - %endif - %attr(-, root, root) %{_datadir}/mysql-test - %attr(755, root, root) %{_bindir}/mysql_client_test --%attr(755, root, root) %{_bindir}/mysql_client_test_embedded --%attr(755, root, root) %{_bindir}/mysqltest_embedded - %doc %attr(644, root, man) %{_mandir}/man1/mysql_client_test.1* - %doc %attr(644, root, man) %{_mandir}/man1/mysql-stress-test.pl.1* - %doc %attr(644, root, man) %{_mandir}/man1/mysql-test-run.pl.1* - %doc %attr(644, root, man) %{_mandir}/man1/mysql_client_test_embedded.1* - %doc %attr(644, root, man) %{_mandir}/man1/mysqltest_embedded.1* - --# ---------------------------------------------------------------------------- --%files -n MySQL-embedded%{product_suffix} --%defattr(-, root, root, 0755) --%if %{defined license_files_server} --%doc %{license_files_server} --%endif --%attr(755, root, root) %{_bindir}/mysql_embedded --%attr(644, root, root) %{_libdir}/mysql/libmysqld.a --%attr(644, root, root) %{_libdir}/mysql/libmysqld-debug.a -- - ############################################################################## - # The spec file changelog only includes changes made to the spec file - # itself - note that they must be ordered by date (important when - # merging BK trees) - ############################################################################## - %changelog -+* Thu Jan 29 2015 Joerg Bruehe -+- Add a meta-package "mysql-wsrep" that requires both "server" and "client". -+- Fix the fall-back definition of "dist", it must start with a period. -+ -+* Mon Jan 26 2015 Joerg Bruehe -+- Allow "rpmlint", but suppress "post-build-checks" (fail on SuSE 12 + 13). -+- Improve handling of undefined "%%{dist}". -+- Fix wrong changelog dates, to get rid of warnings about "bogus date". -+- Escape percent signs in changelog, to get rid of "rpmlint" warnings. -+ -+* Tue Jan 20 2015 Teemu Ollakka -+ -+- Reworked to build wsrep patched packages exclusively -+- OBS compatible -+ - * Mon Oct 06 2014 Balasubramanian Kandasamy - - Add license info in each subpackage - -@@ -1350,7 +1348,7 @@ echo "=====" >> $STATUS_HISTORY - not in an RPM upgrade. - This affects both the "mkdir" and the call of "mysql_install_db". - --* Wed Feb 09 2011 Joerg Bruehe -+* Thu Feb 10 2011 Joerg Bruehe - - - Fix bug#56581: If an installation deviates from the default file locations - ("datadir" and "pid-file"), the mechanism to detect a running server (on upgrade) -@@ -1471,7 +1469,7 @@ echo "=====" >> $STATUS_HISTORY - - Fix some problems with the directives around "tcmalloc" (experimental), - remove erroneous traces of the InnoDB plugin (that is 5.1 only). - --* Tue Oct 06 2009 Magnus Blaudd -+* Fri Oct 09 2009 Magnus Blaudd - - - Removed mysql_fix_privilege_tables - -@@ -1668,7 +1666,7 @@ echo "=====" >> $STATUS_HISTORY - - - Set $LDFLAGS from $MYSQL_BUILD_LDFLAGS - --* Tue Mar 07 2006 Kent Boortz -+* Wed Mar 08 2006 Kent Boortz - - - Changed product name from "Community Edition" to "Community Server" - -@@ -1763,7 +1761,7 @@ echo "=====" >> $STATUS_HISTORY - - * Thu Sep 29 2005 Lenz Grimmer - --- fixed the removing of the RPM_BUILD_ROOT in the %clean section (the -+- fixed the removing of the RPM_BUILD_ROOT in the %%clean section (the - $RBR variable did not get expanded, thus leaving old build roots behind) - - * Thu Aug 04 2005 Lenz Grimmer -@@ -1916,7 +1914,7 @@ echo "=====" >> $STATUS_HISTORY - - - marked /etc/logrotate.d/mysql as a config file (BUG 2156) - --* Sat Dec 13 2003 Lenz Grimmer -+* Fri Dec 12 2003 Lenz Grimmer - - - fixed file permissions (BUG 1672) - -@@ -2058,7 +2056,7 @@ echo "=====" >> $STATUS_HISTORY - - Added separate libmysql_r directory; now both a threaded - and non-threaded library is shipped. - --* Tue Sep 28 1999 David Axmark -+* Wed Sep 29 1999 David Axmark - - - Added the support-files/my-example.cnf to the docs directory. - -diff --git a/support-files/wsrep.cnf b/support-files/wsrep.cnf -new file mode 100644 -index 0000000..756d4f6 ---- /dev/null -+++ b/support-files/wsrep.cnf -@@ -0,0 +1,129 @@ -+# This file contains wsrep-related mysqld options. It should be included -+# in the main MySQL configuration file. -+# -+# Options that need to be customized: -+# - wsrep_provider -+# - wsrep_cluster_address -+# - wsrep_sst_auth -+# The rest of defaults should work out of the box. -+ -+## -+## mysqld options _MANDATORY_ for correct opration of the cluster -+## -+[mysqld] -+ -+# (This must be substituted by wsrep_format) -+binlog_format=ROW -+ -+# Currently only InnoDB storage engine is supported -+default-storage-engine=innodb -+ -+# to avoid issues with 'bulk mode inserts' using autoinc -+innodb_autoinc_lock_mode=2 -+ -+# This is a must for paralell applying -+innodb_locks_unsafe_for_binlog=1 -+ -+# Query Cache is not supported with wsrep -+query_cache_size=0 -+query_cache_type=0 -+ -+# Override bind-address -+# In some systems bind-address defaults to 127.0.0.1, and with mysqldump SST -+# it will have (most likely) disastrous consequences on donor node -+bind-address=0.0.0.0 -+ -+## -+## WSREP options -+## -+ -+# Full path to wsrep provider library or 'none' -+wsrep_provider=none -+ -+# Provider specific configuration options -+#wsrep_provider_options= -+ -+# Logical cluster name. Should be the same for all nodes. -+wsrep_cluster_name="my_wsrep_cluster" -+ -+# Group communication system handle -+#wsrep_cluster_address="dummy://" -+ -+# Human-readable node name (non-unique). Hostname by default. -+#wsrep_node_name= -+ -+# Base replication [:port] of the node. -+# The values supplied will be used as defaults for state transfer receiving, -+# listening ports and so on. Default: address of the first network interface. -+#wsrep_node_address= -+ -+# Address for incoming client connections. Autodetect by default. -+#wsrep_node_incoming_address= -+ -+# How many threads will process writesets from other nodes -+wsrep_slave_threads=1 -+ -+# DBUG options for wsrep provider -+#wsrep_dbug_option -+ -+# Generate fake primary keys for non-PK tables (required for multi-master -+# and parallel applying operation) -+wsrep_certify_nonPK=1 -+ -+# Maximum number of rows in write set -+wsrep_max_ws_rows=131072 -+ -+# Maximum size of write set -+wsrep_max_ws_size=1073741824 -+ -+# to enable debug level logging, set this to 1 -+wsrep_debug=0 -+ -+# convert locking sessions into transactions -+wsrep_convert_LOCK_to_trx=0 -+ -+# how many times to retry deadlocked autocommits -+wsrep_retry_autocommit=1 -+ -+# change auto_increment_increment and auto_increment_offset automatically -+wsrep_auto_increment_control=1 -+ -+# retry autoinc insert, which failed for duplicate key error -+wsrep_drupal_282555_workaround=0 -+ -+# enable "strictly synchronous" semantics for read operations -+wsrep_causal_reads=0 -+ -+# Command to call when node status or cluster membership changes. -+# Will be passed all or some of the following options: -+# --status - new status of this node -+# --uuid - UUID of the cluster -+# --primary - whether the component is primary or not ("yes"/"no") -+# --members - comma-separated list of members -+# --index - index of this node in the list -+wsrep_notify_cmd= -+ -+## -+## WSREP State Transfer options -+## -+ -+# State Snapshot Transfer method -+wsrep_sst_method=rsync -+ -+# Address which donor should send State Snapshot to. -+# Should be the address of THIS node. DON'T SET IT TO DONOR ADDRESS!!! -+# (SST method dependent. Defaults to the first IP of the first interface) -+#wsrep_sst_receive_address= -+ -+# SST authentication string. This will be used to send SST to joining nodes. -+# Depends on SST method. For mysqldump method it is root: -+wsrep_sst_auth=root: -+ -+# Desired SST donor name. -+#wsrep_sst_donor= -+ -+# Reject client queries when donating SST (false) -+#wsrep_sst_donor_rejects_queries=0 -+ -+# Protocol version to use -+# wsrep_protocol_version= -diff --git a/support-files/wsrep.cnf.sh b/support-files/wsrep.cnf.sh -new file mode 100644 -index 0000000..756d4f6 ---- /dev/null -+++ b/support-files/wsrep.cnf.sh -@@ -0,0 +1,129 @@ -+# This file contains wsrep-related mysqld options. It should be included -+# in the main MySQL configuration file. -+# -+# Options that need to be customized: -+# - wsrep_provider -+# - wsrep_cluster_address -+# - wsrep_sst_auth -+# The rest of defaults should work out of the box. -+ -+## -+## mysqld options _MANDATORY_ for correct opration of the cluster -+## -+[mysqld] -+ -+# (This must be substituted by wsrep_format) -+binlog_format=ROW -+ -+# Currently only InnoDB storage engine is supported -+default-storage-engine=innodb -+ -+# to avoid issues with 'bulk mode inserts' using autoinc -+innodb_autoinc_lock_mode=2 -+ -+# This is a must for paralell applying -+innodb_locks_unsafe_for_binlog=1 -+ -+# Query Cache is not supported with wsrep -+query_cache_size=0 -+query_cache_type=0 -+ -+# Override bind-address -+# In some systems bind-address defaults to 127.0.0.1, and with mysqldump SST -+# it will have (most likely) disastrous consequences on donor node -+bind-address=0.0.0.0 -+ -+## -+## WSREP options -+## -+ -+# Full path to wsrep provider library or 'none' -+wsrep_provider=none -+ -+# Provider specific configuration options -+#wsrep_provider_options= -+ -+# Logical cluster name. Should be the same for all nodes. -+wsrep_cluster_name="my_wsrep_cluster" -+ -+# Group communication system handle -+#wsrep_cluster_address="dummy://" -+ -+# Human-readable node name (non-unique). Hostname by default. -+#wsrep_node_name= -+ -+# Base replication [:port] of the node. -+# The values supplied will be used as defaults for state transfer receiving, -+# listening ports and so on. Default: address of the first network interface. -+#wsrep_node_address= -+ -+# Address for incoming client connections. Autodetect by default. -+#wsrep_node_incoming_address= -+ -+# How many threads will process writesets from other nodes -+wsrep_slave_threads=1 -+ -+# DBUG options for wsrep provider -+#wsrep_dbug_option -+ -+# Generate fake primary keys for non-PK tables (required for multi-master -+# and parallel applying operation) -+wsrep_certify_nonPK=1 -+ -+# Maximum number of rows in write set -+wsrep_max_ws_rows=131072 -+ -+# Maximum size of write set -+wsrep_max_ws_size=1073741824 -+ -+# to enable debug level logging, set this to 1 -+wsrep_debug=0 -+ -+# convert locking sessions into transactions -+wsrep_convert_LOCK_to_trx=0 -+ -+# how many times to retry deadlocked autocommits -+wsrep_retry_autocommit=1 -+ -+# change auto_increment_increment and auto_increment_offset automatically -+wsrep_auto_increment_control=1 -+ -+# retry autoinc insert, which failed for duplicate key error -+wsrep_drupal_282555_workaround=0 -+ -+# enable "strictly synchronous" semantics for read operations -+wsrep_causal_reads=0 -+ -+# Command to call when node status or cluster membership changes. -+# Will be passed all or some of the following options: -+# --status - new status of this node -+# --uuid - UUID of the cluster -+# --primary - whether the component is primary or not ("yes"/"no") -+# --members - comma-separated list of members -+# --index - index of this node in the list -+wsrep_notify_cmd= -+ -+## -+## WSREP State Transfer options -+## -+ -+# State Snapshot Transfer method -+wsrep_sst_method=rsync -+ -+# Address which donor should send State Snapshot to. -+# Should be the address of THIS node. DON'T SET IT TO DONOR ADDRESS!!! -+# (SST method dependent. Defaults to the first IP of the first interface) -+#wsrep_sst_receive_address= -+ -+# SST authentication string. This will be used to send SST to joining nodes. -+# Depends on SST method. For mysqldump method it is root: -+wsrep_sst_auth=root: -+ -+# Desired SST donor name. -+#wsrep_sst_donor= -+ -+# Reject client queries when donating SST (false) -+#wsrep_sst_donor_rejects_queries=0 -+ -+# Protocol version to use -+# wsrep_protocol_version= -diff --git a/support-files/wsrep_notify.sh b/support-files/wsrep_notify.sh -new file mode 100644 -index 0000000..bdbe3d1 ---- /dev/null -+++ b/support-files/wsrep_notify.sh -@@ -0,0 +1,102 @@ -+#!/bin/sh -eu -+ -+# This is a simple example of wsrep notification script (wsrep_notify_cmd). -+# It will create 'wsrep' schema and two tables in it: 'membeship' and 'status' -+# and fill them on every membership or node status change. -+# -+# Edit parameters below to specify the address and login to server. -+ -+USER=root -+PSWD=rootpass -+HOST=127.0.0.1 -+PORT=3306 -+ -+SCHEMA="wsrep" -+MEMB_TABLE="$SCHEMA.membership" -+STATUS_TABLE="$SCHEMA.status" -+ -+BEGIN=" -+SET wsrep_on=0; -+DROP SCHEMA IF EXISTS $SCHEMA; CREATE SCHEMA $SCHEMA; -+CREATE TABLE $MEMB_TABLE ( -+ idx INT UNIQUE PRIMARY KEY, -+ uuid CHAR(40) UNIQUE, /* node UUID */ -+ name VARCHAR(32), /* node name */ -+ addr VARCHAR(256) /* node address */ -+) ENGINE=MEMORY; -+CREATE TABLE $STATUS_TABLE ( -+ size INT, /* component size */ -+ idx INT, /* this node index */ -+ status CHAR(16), /* this node status */ -+ uuid CHAR(40), /* cluster UUID */ -+ prim BOOLEAN /* if component is primary */ -+) ENGINE=MEMORY; -+BEGIN; -+DELETE FROM $MEMB_TABLE; -+DELETE FROM $STATUS_TABLE; -+" -+END="COMMIT;" -+ -+configuration_change() -+{ -+ echo "$BEGIN;" -+ -+ local idx=0 -+ -+ for NODE in $(echo $MEMBERS | sed s/,/\ /g) -+ do -+ echo "INSERT INTO $MEMB_TABLE VALUES ( $idx, " -+ # Don't forget to properly quote string values -+ echo "'$NODE'" | sed s/\\//\',\'/g -+ echo ");" -+ idx=$(( $idx + 1 )) -+ done -+ -+ echo "INSERT INTO $STATUS_TABLE VALUES($idx, $INDEX, '$STATUS', '$CLUSTER_UUID', $PRIMARY);" -+ -+ echo "$END" -+} -+ -+status_update() -+{ -+ echo "SET wsrep_on=0; BEGIN; UPDATE $STATUS_TABLE SET status='$STATUS'; COMMIT;" -+} -+ -+COM=status_update # not a configuration change by default -+ -+while [ $# -gt 0 ] -+do -+ case $1 in -+ --status) -+ STATUS=$2 -+ shift -+ ;; -+ --uuid) -+ CLUSTER_UUID=$2 -+ shift -+ ;; -+ --primary) -+ [ "$2" = "yes" ] && PRIMARY="1" || PRIMARY="0" -+ COM=configuration_change -+ shift -+ ;; -+ --index) -+ INDEX=$2 -+ shift -+ ;; -+ --members) -+ MEMBERS=$2 -+ shift -+ ;; -+ esac -+ shift -+done -+ -+# Undefined means node is shutting down -+if [ "$STATUS" != "Undefined" ] -+then -+ $COM | mysql -B -u$USER -p$PSWD -h$HOST -P$PORT -+fi -+ -+exit 0 -+# -diff --git a/vio/viosslfactories.c b/vio/viosslfactories.c -index 4d5ff71..07e05e4 100644 ---- a/vio/viosslfactories.c -+++ b/vio/viosslfactories.c -@@ -1,4 +1,4 @@ --/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. -+/* Copyright (c) 2000, 2013, 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 -diff --git a/wsrep/CMakeLists.txt b/wsrep/CMakeLists.txt -new file mode 100644 -index 0000000..182e458 ---- /dev/null -+++ b/wsrep/CMakeLists.txt -@@ -0,0 +1,24 @@ -+# Copyright (c) 2012, Codership Oy. All rights reserved. -+# -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; version 2 of the License. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program; if not, write to the Free Software -+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -+ -+INCLUDE_DIRECTORIES( "." ) -+ -+SET(WSREP_SOURCES wsrep_gtid.c wsrep_uuid.c wsrep_loader.c wsrep_dummy.c) -+ -+ADD_CONVENIENCE_LIBRARY(wsrep ${WSREP_SOURCES}) -+DTRACE_INSTRUMENT(wsrep) -+ -+#ADD_EXECUTABLE(listener wsrep_listener.c ${WSREP_SOURCES}) -+#TARGET_LINK_LIBRARIES(listener ${LIBDL}) -diff --git a/wsrep/Makefile.am b/wsrep/Makefile.am -new file mode 100644 -index 0000000..a748ece ---- /dev/null -+++ b/wsrep/Makefile.am -@@ -0,0 +1,7 @@ -+noinst_LIBRARIES = libwsrep.a -+libwsrep_a_SOURCES = wsrep_api.h wsrep_loader.c wsrep_dummy.c wsrep_uuid.c wsrep_gtid.c -+noinst_PROGRAMS = wsrep_listener -+wsrep_listener_SOURCES = wsrep_listener.c -+wsrep_listener_LDADD = $(noinst_LIBRARIES) -+wsrep_listener_LDFLAGS = -static -ldl -+ -diff --git a/wsrep/wsrep_api.h b/wsrep/wsrep_api.h -new file mode 100644 -index 0000000..c3304d7 ---- /dev/null -+++ b/wsrep/wsrep_api.h -@@ -0,0 +1,1118 @@ -+/* Copyright (C) 2009-2013 Codership Oy -+ -+ 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. -+ */ -+ -+/*! -+ @file wsrep API declaration. -+ -+ HOW TO READ THIS FILE. -+ -+ Due to C language rules this header layout doesn't lend itself to intuitive -+ reading. So here's the scoop: in the end this header declares two main types: -+ -+ * struct wsrep_init_args -+ -+ and -+ -+ * struct wsrep -+ -+ wsrep_init_args contains initialization parameters for wsrep provider like -+ names, addresses, etc. and pointers to callbacks. The callbacks will be called -+ by provider when it needs to do something application-specific, like log a -+ message or apply a writeset. It should be passed to init() call from -+ wsrep API. It is an application part of wsrep API contract. -+ -+ struct wsrep is the interface to wsrep provider. It contains all wsrep API -+ calls. It is a provider part of wsrep API contract. -+ -+ Finally, wsrep_load() method loads (dlopens) wsrep provider library. It is -+ defined in wsrep_loader.c unit and is part of libwsrep.a (which is not a -+ wsrep provider, but a convenience library). -+ -+ wsrep_unload() does the reverse. -+ -+*/ -+#ifndef WSREP_H -+#define WSREP_H -+ -+#include -+#include -+#include -+#include -+#include -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+/************************************************************************** -+ * * -+ * wsrep replication API * -+ * * -+ **************************************************************************/ -+ -+#define WSREP_INTERFACE_VERSION "25" -+ -+/*! Empty backend spec */ -+#define WSREP_NONE "none" -+ -+ -+/*! -+ * @brief log severity levels, passed as first argument to log handler -+ */ -+typedef enum wsrep_log_level -+{ -+ WSREP_LOG_FATAL, //!< Unrecoverable error, application must quit. -+ WSREP_LOG_ERROR, //!< Operation failed, must be repeated. -+ WSREP_LOG_WARN, //!< Unexpected condition, but no operational failure. -+ WSREP_LOG_INFO, //!< Informational message. -+ WSREP_LOG_DEBUG //!< Debug message. Shows only of compiled with debug. -+} wsrep_log_level_t; -+ -+/*! -+ * @brief error log handler -+ * -+ * All messages from wsrep provider are directed to this -+ * handler, if present. -+ * -+ * @param level log level -+ * @param message log message -+ */ -+typedef void (*wsrep_log_cb_t)(wsrep_log_level_t, const char *); -+ -+ -+/*! -+ * Certain provider capabilities application may want to know about -+ */ -+#define WSREP_CAP_MULTI_MASTER ( 1ULL << 0 ) -+#define WSREP_CAP_CERTIFICATION ( 1ULL << 1 ) -+#define WSREP_CAP_PARALLEL_APPLYING ( 1ULL << 2 ) -+#define WSREP_CAP_TRX_REPLAY ( 1ULL << 3 ) -+#define WSREP_CAP_ISOLATION ( 1ULL << 4 ) -+#define WSREP_CAP_PAUSE ( 1ULL << 5 ) -+#define WSREP_CAP_CAUSAL_READS ( 1ULL << 6 ) -+#define WSREP_CAP_CAUSAL_TRX ( 1ULL << 7 ) -+#define WSREP_CAP_INCREMENTAL_WRITESET ( 1ULL << 8 ) -+#define WSREP_CAP_SESSION_LOCKS ( 1ULL << 9 ) -+#define WSREP_CAP_DISTRIBUTED_LOCKS ( 1ULL << 10 ) -+#define WSREP_CAP_CONSISTENCY_CHECK ( 1ULL << 11 ) -+#define WSREP_CAP_UNORDERED ( 1ULL << 12 ) -+#define WSREP_CAP_ANNOTATION ( 1ULL << 13 ) -+#define WSREP_CAP_PREORDERED ( 1ULL << 14 ) -+ -+ -+/*! -+ * Writeset flags -+ * -+ * COMMIT the writeset and all preceding writesets must be committed -+ * ROLLBACK all preceding writesets in a transaction must be rolled back -+ * ISOLATION the writeset must be applied AND committed in isolation -+ * PA_UNSAFE the writeset cannot be applied in parallel -+ * COMMUTATIVE the order in which the writeset is applied does not matter -+ * NATIVE the writeset contains another writeset in this provider format -+ * -+ * Note that some of the flags are mutually exclusive (e.g. COMMIT and -+ * ROLLBACK). -+ */ -+#define WSREP_FLAG_COMMIT ( 1ULL << 0 ) -+#define WSREP_FLAG_ROLLBACK ( 1ULL << 1 ) -+#define WSREP_FLAG_ISOLATION ( 1ULL << 2 ) -+#define WSREP_FLAG_PA_UNSAFE ( 1ULL << 3 ) -+#define WSREP_FLAG_COMMUTATIVE ( 1ULL << 4 ) -+#define WSREP_FLAG_NATIVE ( 1ULL << 5 ) -+ -+ -+typedef uint64_t wsrep_trx_id_t; //!< application transaction ID -+typedef uint64_t wsrep_conn_id_t; //!< application connection ID -+typedef int64_t wsrep_seqno_t; //!< sequence number of a writeset, etc. -+#ifdef __cplusplus -+typedef bool wsrep_bool_t; -+#else -+typedef _Bool wsrep_bool_t; //!< should be the same as standard (C99) bool -+#endif /* __cplusplus */ -+ -+/*! undefined seqno */ -+#define WSREP_SEQNO_UNDEFINED (-1) -+ -+ -+/*! wsrep provider status codes */ -+typedef enum wsrep_status -+{ -+ WSREP_OK = 0, //!< success -+ WSREP_WARNING, //!< minor warning, error logged -+ WSREP_TRX_MISSING, //!< transaction is not known by wsrep -+ WSREP_TRX_FAIL, //!< transaction aborted, server can continue -+ WSREP_BF_ABORT, //!< trx was victim of brute force abort -+ WSREP_SIZE_EXCEEDED, //!< data exceeded maximum supported size -+ WSREP_CONN_FAIL, //!< error in client connection, must abort -+ WSREP_NODE_FAIL, //!< error in node state, wsrep must reinit -+ WSREP_FATAL, //!< fatal error, server must abort -+ WSREP_NOT_IMPLEMENTED //!< feature not implemented -+} wsrep_status_t; -+ -+ -+/*! wsrep callbacks status codes */ -+typedef enum wsrep_cb_status -+{ -+ WSREP_CB_SUCCESS = 0, //!< success (as in "not critical failure") -+ WSREP_CB_FAILURE //!< critical failure (consistency violation) -+ /* Technically, wsrep provider has no use for specific failure codes since -+ * there is nothing it can do about it but abort execution. Therefore any -+ * positive number shall indicate a critical failure. Optionally that value -+ * may be used by provider to come to a consensus about state consistency -+ * in a group of nodes. */ -+} wsrep_cb_status_t; -+ -+ -+/*! -+ * UUID type - for all unique IDs -+ */ -+typedef struct wsrep_uuid { -+ uint8_t data[16]; -+} wsrep_uuid_t; -+ -+/*! Undefined UUID */ -+static const wsrep_uuid_t WSREP_UUID_UNDEFINED = {{0,}}; -+ -+/*! UUID string representation length, terminating '\0' not included */ -+#define WSREP_UUID_STR_LEN 36 -+ -+/*! -+ * Scan UUID from string -+ * @return length of UUID string representation or negative error code -+ */ -+extern int -+wsrep_uuid_scan (const char* str, size_t str_len, wsrep_uuid_t* uuid); -+ -+/*! -+ * Print UUID to string -+ * @return length of UUID string representation or negative error code -+ */ -+extern int -+wsrep_uuid_print (const wsrep_uuid_t* uuid, char* str, size_t str_len); -+ -+#define WSREP_MEMBER_NAME_LEN 32 //!< maximum logical member name length -+#define WSREP_INCOMING_LEN 256 //!< max Domain Name length + 0x00 -+ -+ -+/*! -+ * Global transaction identifier -+ */ -+typedef struct wsrep_gtid -+{ -+ wsrep_uuid_t uuid; /*!< History UUID */ -+ wsrep_seqno_t seqno; /*!< Sequence number */ -+} wsrep_gtid_t; -+ -+/*! Undefined GTID */ -+static const wsrep_gtid_t WSREP_GTID_UNDEFINED = {{{0, }}, -1}; -+ -+/*! Minimum number of bytes guaranteed to store GTID string representation, -+ * terminating '\0' not included (36 + 1 + 20) */ -+#define WSREP_GTID_STR_LEN 57 -+ -+ -+/*! -+ * Scan GTID from string -+ * @return length of GTID string representation or negative error code -+ */ -+extern int -+wsrep_gtid_scan(const char* str, size_t str_len, wsrep_gtid_t* gtid); -+ -+/*! -+ * Print GTID to string -+ * @return length of GTID string representation or negative error code -+ */ -+extern int -+wsrep_gtid_print(const wsrep_gtid_t* gtid, char* str, size_t str_len); -+ -+ -+/*! -+ * Transaction meta data -+ */ -+typedef struct wsrep_trx_meta -+{ -+ wsrep_gtid_t gtid; /*!< Global transaction identifier */ -+ wsrep_seqno_t depends_on; /*!< Sequence number part of the last transaction -+ this transaction depends on */ -+} wsrep_trx_meta_t; -+ -+ -+/*! -+ * member status -+ */ -+typedef enum wsrep_member_status { -+ WSREP_MEMBER_UNDEFINED, //!< undefined state -+ WSREP_MEMBER_JOINER, //!< incomplete state, requested state transfer -+ WSREP_MEMBER_DONOR, //!< complete state, donates state transfer -+ WSREP_MEMBER_JOINED, //!< complete state -+ WSREP_MEMBER_SYNCED, //!< complete state, synchronized with group -+ WSREP_MEMBER_ERROR, //!< this and above is provider-specific error code -+ WSREP_MEMBER_MAX -+} wsrep_member_status_t; -+ -+/*! -+ * static information about a group member (some fields are tentative yet) -+ */ -+typedef struct wsrep_member_info { -+ wsrep_uuid_t id; //!< group-wide unique member ID -+ char name[WSREP_MEMBER_NAME_LEN]; //!< human-readable name -+ char incoming[WSREP_INCOMING_LEN]; //!< address for client requests -+} wsrep_member_info_t; -+ -+/*! -+ * group status -+ */ -+typedef enum wsrep_view_status { -+ WSREP_VIEW_PRIMARY, //!< primary group configuration (quorum present) -+ WSREP_VIEW_NON_PRIMARY, //!< non-primary group configuration (quorum lost) -+ WSREP_VIEW_DISCONNECTED, //!< not connected to group, retrying. -+ WSREP_VIEW_MAX -+} wsrep_view_status_t; -+ -+/*! -+ * view of the group -+ */ -+typedef struct wsrep_view_info { -+ wsrep_gtid_t state_id; //!< global state ID -+ wsrep_seqno_t view; //!< global view number -+ wsrep_view_status_t status; //!< view status -+ wsrep_bool_t state_gap; //!< gap between global and local states -+ int my_idx; //!< index of this member in the view -+ int memb_num; //!< number of members in the view -+ int proto_ver; //!< application protocol agreed on the view -+ wsrep_member_info_t members[1];//!< array of member information -+} wsrep_view_info_t; -+ -+/*! -+ * Magic string to tell provider to engage into trivial (empty) state transfer. -+ * No data will be passed, but the node shall be considered JOINED. -+ * Should be passed in sst_req parameter of wsrep_view_cb_t. -+ */ -+#define WSREP_STATE_TRANSFER_TRIVIAL "trivial" -+ -+/*! -+ * Magic string to tell provider not to engage in state transfer at all. -+ * The member will stay in WSREP_MEMBER_UNDEFINED state but will keep on -+ * receiving all writesets. -+ * Should be passed in sst_req parameter of wsrep_view_cb_t. -+ */ -+#define WSREP_STATE_TRANSFER_NONE "none" -+ -+/*! -+ * @brief group view handler -+ * -+ * This handler is called in total order corresponding to the group -+ * configuration change. It is to provide a vital information about -+ * new group view. If view info indicates existence of discontinuity -+ * between group and member states, state transfer request message -+ * should be filled in by the callback implementation. -+ * -+ * @note Currently it is assumed that sst_req is allocated using -+ * malloc()/calloc()/realloc() and it will be freed by -+ * wsrep implementation. -+ * -+ * @param app_ctx application context -+ * @param recv_ctx receiver context -+ * @param view new view on the group -+ * @param state current state -+ * @param state_len lenght of current state -+ * @param sst_req location to store SST request -+ * @param sst_req_len location to store SST request length or error code, -+ * value of 0 means no SST. -+ */ -+typedef enum wsrep_cb_status (*wsrep_view_cb_t) ( -+ void* app_ctx, -+ void* recv_ctx, -+ const wsrep_view_info_t* view, -+ const char* state, -+ size_t state_len, -+ void** sst_req, -+ size_t* sst_req_len -+); -+ -+ -+/*! -+ * @brief apply callback -+ * -+ * This handler is called from wsrep library to apply replicated writeset -+ * Must support brute force applying for multi-master operation -+ * -+ * @param recv_ctx receiver context pointer provided by the application -+ * @param data data buffer containing the writeset -+ * @param size data buffer size -+ * @param flags WSREP_FLAG_... flags -+ * @param meta transaction meta data of the writeset to be applied -+ * -+ * @return success code: -+ * @retval WSREP_OK -+ * @retval WSREP_NOT_IMPLEMENTED appl. does not support the writeset format -+ * @retval WSREP_ERROR failed to apply the writeset -+ */ -+typedef enum wsrep_cb_status (*wsrep_apply_cb_t) ( -+ void* recv_ctx, -+ const void* data, -+ size_t size, -+ uint32_t flags, -+ const wsrep_trx_meta_t* meta -+); -+ -+ -+/*! -+ * @brief commit callback -+ * -+ * This handler is called to commit the changes made by apply callback. -+ * -+ * @param recv_ctx receiver context pointer provided by the application -+ * @param flags WSREP_FLAG_... flags -+ * @param meta transaction meta data of the writeset to be committed -+ * @param exit set to true to exit recv loop -+ * @param commit true - commit writeset, false - rollback writeset -+ * -+ * @return success code: -+ * @retval WSREP_OK -+ * @retval WSREP_ERROR call failed -+ */ -+typedef enum wsrep_cb_status (*wsrep_commit_cb_t) ( -+ void* recv_ctx, -+ uint32_t flags, -+ const wsrep_trx_meta_t* meta, -+ wsrep_bool_t* exit, -+ wsrep_bool_t commit -+); -+ -+ -+/*! -+ * @brief unordered callback -+ * -+ * This handler is called to execute unordered actions (actions that need not -+ * to be executed in any particular order) attached to writeset. -+ * -+ * @param recv_ctx receiver context pointer provided by the application -+ * @param data data buffer containing the writeset -+ * @param size data buffer size -+ */ -+typedef enum wsrep_cb_status (*wsrep_unordered_cb_t) ( -+ void* recv_ctx, -+ const void* data, -+ size_t size -+); -+ -+ -+/*! -+ * @brief a callback to donate state snapshot -+ * -+ * This handler is called from wsrep library when it needs this node -+ * to deliver state to a new cluster member. -+ * No state changes will be committed for the duration of this call. -+ * Wsrep implementation may provide internal state to be transmitted -+ * to new cluster member for initial state. -+ * -+ * @param app_ctx application context -+ * @param recv_ctx receiver context -+ * @param msg state transfer request message -+ * @param msg_len state transfer request message length -+ * @param gtid current state ID on this node -+ * @param state current wsrep internal state buffer -+ * @param state_len current wsrep internal state buffer len -+ * @param bypass bypass snapshot transfer, only transfer uuid:seqno pair -+ */ -+typedef enum wsrep_cb_status (*wsrep_sst_donate_cb_t) ( -+ void* app_ctx, -+ void* recv_ctx, -+ const void* msg, -+ size_t msg_len, -+ const wsrep_gtid_t* state_id, -+ const char* state, -+ size_t state_len, -+ wsrep_bool_t bypass -+); -+ -+ -+/*! -+ * @brief a callback to signal application that wsrep state is synced -+ * with cluster -+ * -+ * This callback is called after wsrep library has got in sync with -+ * rest of the cluster. -+ * -+ * @param app_ctx application context -+ */ -+typedef void (*wsrep_synced_cb_t) (void* app_ctx); -+ -+ -+/*! -+ * Initialization parameters for wsrep provider. -+ */ -+struct wsrep_init_args -+{ -+ void* app_ctx; //!< Application context for callbacks -+ -+ /* Configuration parameters */ -+ const char* node_name; //!< Symbolic name of this node (e.g. hostname) -+ const char* node_address; //!< Address to be used by wsrep provider -+ const char* node_incoming; //!< Address for incoming client connections -+ const char* data_dir; //!< Directory where wsrep files are kept if any -+ const char* options; //!< Provider-specific configuration string -+ int proto_ver; //!< Max supported application protocol version -+ -+ /* Application initial state information. */ -+ const wsrep_gtid_t* state_id; //!< Application state GTID -+ const char* state; //!< Initial state for wsrep provider -+ size_t state_len; //!< Length of state buffer -+ -+ /* Application callbacks */ -+ wsrep_log_cb_t logger_cb; //!< logging handler -+ wsrep_view_cb_t view_handler_cb; //!< group view change handler -+ -+ /* Applier callbacks */ -+ wsrep_apply_cb_t apply_cb; //!< apply callback -+ wsrep_commit_cb_t commit_cb; //!< commit callback -+ wsrep_unordered_cb_t unordered_cb; //!< callback for unordered actions -+ -+ /* State Snapshot Transfer callbacks */ -+ wsrep_sst_donate_cb_t sst_donate_cb; //!< starting to donate -+ wsrep_synced_cb_t synced_cb; //!< synced with group -+}; -+ -+ -+/*! Type of the stats variable value in struct wsrep_status_var */ -+typedef enum wsrep_var_type -+{ -+ WSREP_VAR_STRING, //!< pointer to null-terminated string -+ WSREP_VAR_INT64, //!< int64_t -+ WSREP_VAR_DOUBLE //!< double -+} -+wsrep_var_type_t; -+ -+/*! Generalized stats variable representation */ -+struct wsrep_stats_var -+{ -+ const char* name; //!< variable name -+ wsrep_var_type_t type; //!< variable value type -+ union { -+ int64_t _int64; -+ double _double; -+ const char* _string; -+ } value; //!< variable value -+}; -+ -+ -+/*! Abstract data buffer structure */ -+typedef struct wsrep_buf -+{ -+ const void* ptr; /*!< Pointer to data buffer */ -+ size_t len; /*!< Length of buffer */ -+} wsrep_buf_t; -+ -+/*! Key struct used to pass certification keys for transaction handling calls. -+ * A key consists of zero or more key parts. */ -+typedef struct wsrep_key -+{ -+ const wsrep_buf_t* key_parts; /*!< Array of key parts */ -+ size_t key_parts_num; /*!< Number of key parts */ -+} wsrep_key_t; -+ -+/*! Key type: -+ * EXCLUSIVE conflicts with any key type -+ * SEMI reserved. If not supported, should be interpeted as EXCLUSIVE -+ * SHARED conflicts only with EXCLUSIVE keys */ -+typedef enum wsrep_key_type -+{ -+ WSREP_KEY_SHARED = 0, -+ WSREP_KEY_SEMI, -+ WSREP_KEY_EXCLUSIVE -+} wsrep_key_type_t; -+ -+/*! Data type: -+ * ORDERED state modification event that should be applied and committed -+ * in order. -+ * UNORDERED some action that does not modify state and execution of which is -+ * optional and does not need to happen in order. -+ * ANNOTATION (human readable) writeset annotation. */ -+typedef enum wsrep_data_type -+{ -+ WSREP_DATA_ORDERED = 0, -+ WSREP_DATA_UNORDERED, -+ WSREP_DATA_ANNOTATION -+} wsrep_data_type_t; -+ -+ -+/*! Transaction handle struct passed for wsrep transaction handling calls */ -+typedef struct wsrep_ws_handle -+{ -+ wsrep_trx_id_t trx_id; //!< transaction ID -+ void* opaque; //!< opaque provider transaction context data -+} wsrep_ws_handle_t; -+ -+/*! -+ * @brief Helper method to reset trx writeset handle state when trx id changes -+ * -+ * Instead of passing wsrep_ws_handle_t directly to wsrep calls, -+ * wrapping handle with this call offloads bookkeeping from -+ * application. -+ */ -+static inline wsrep_ws_handle_t* wsrep_ws_handle_for_trx( -+ wsrep_ws_handle_t* ws_handle, -+ wsrep_trx_id_t trx_id) -+{ -+ if (ws_handle->trx_id != trx_id) -+ { -+ ws_handle->trx_id = trx_id; -+ ws_handle->opaque = NULL; -+ } -+ return ws_handle; -+} -+ -+ -+/*! -+ * A handle for processing preordered actions. -+ * Must be initialized to WSREP_PO_INITIALIZER before use. -+ */ -+typedef struct wsrep_po_handle { void* opaque; } wsrep_po_handle_t; -+ -+static const wsrep_po_handle_t WSREP_PO_INITIALIZER = { NULL }; -+ -+ -+typedef struct wsrep wsrep_t; -+/*! -+ * wsrep interface for dynamically loadable libraries -+ */ -+struct wsrep { -+ -+ const char *version; //!< interface version string -+ -+ /*! -+ * @brief Initializes wsrep provider -+ * -+ * @param wsrep provider handle -+ * @param args wsrep initialization parameters -+ */ -+ wsrep_status_t (*init) (wsrep_t* wsrep, -+ const struct wsrep_init_args* args); -+ -+ /*! -+ * @brief Returns provider capabilities flag bitmap -+ * -+ * @param wsrep provider handle -+ */ -+ uint64_t (*capabilities) (wsrep_t* wsrep); -+ -+ /*! -+ * @brief Passes provider-specific configuration string to provider. -+ * -+ * @param wsrep provider handle -+ * @param conf configuration string -+ * -+ * @retval WSREP_OK configuration string was parsed successfully -+ * @retval WSREP_WARNING could't not parse conf string, no action taken -+ */ -+ wsrep_status_t (*options_set) (wsrep_t* wsrep, const char* conf); -+ -+ /*! -+ * @brief Returns provider-specific string with current configuration values. -+ * -+ * @param wsrep provider handle -+ * -+ * @return a dynamically allocated string with current configuration -+ * parameter values -+ */ -+ char* (*options_get) (wsrep_t* wsrep); -+ -+ /*! -+ * @brief Opens connection to cluster -+ * -+ * Returns when either node is ready to operate as a part of the clsuter -+ * or fails to reach operating status. -+ * -+ * @param wsrep provider handle -+ * @param cluster_name unique symbolic cluster name -+ * @param cluster_url URL-like cluster address (backend://address) -+ * @param state_donor name of the node to be asked for state transfer. -+ * @param bootstrap a flag to request initialization of a new wsrep -+ * service rather then a connection to the existing one. -+ * clister_url may still carry important initialization -+ * parameters, like backend spec and/or listen address. -+ */ -+ wsrep_status_t (*connect) (wsrep_t* wsrep, -+ const char* cluster_name, -+ const char* cluster_url, -+ const char* state_donor, -+ wsrep_bool_t bootstrap); -+ -+ /*! -+ * @brief Closes connection to cluster. -+ * -+ * If state_uuid and/or state_seqno is not NULL, will store final state -+ * in there. -+ * -+ * @param wsrep this wsrep handler -+ */ -+ wsrep_status_t (*disconnect)(wsrep_t* wsrep); -+ -+ /*! -+ * @brief start receiving replication events -+ * -+ * This function never returns -+ * -+ * @param wsrep provider handle -+ * @param recv_ctx receiver context -+ */ -+ wsrep_status_t (*recv)(wsrep_t* wsrep, void* recv_ctx); -+ -+ /*! -+ * @brief Replicates/logs result of transaction to other nodes and allocates -+ * required resources. -+ * -+ * Must be called before transaction commit. Returns success code, which -+ * caller must check. -+ * In case of WSREP_OK, starts commit critical section, transaction can -+ * commit. Otherwise transaction must rollback. -+ * -+ * @param wsrep provider handle -+ * @param ws_handle writeset of committing transaction -+ * @param conn_id connection ID -+ * @param flags fine tuning the replication WSREP_FLAG_* -+ * @param meta transaction meta data -+ * -+ * @retval WSREP_OK cluster-wide commit succeeded -+ * @retval WSREP_TRX_FAIL must rollback transaction -+ * @retval WSREP_CONN_FAIL must close client connection -+ * @retval WSREP_NODE_FAIL must close all connections and reinit -+ */ -+ wsrep_status_t (*pre_commit)(wsrep_t* wsrep, -+ wsrep_conn_id_t conn_id, -+ wsrep_ws_handle_t* ws_handle, -+ uint32_t flags, -+ wsrep_trx_meta_t* meta); -+ -+ /*! -+ * @brief Releases resources after transaction commit. -+ * -+ * Ends commit critical section. -+ * -+ * @param wsrep provider handle -+ * @param ws_handle writeset of committing transaction -+ * @retval WSREP_OK post_commit succeeded -+ */ -+ wsrep_status_t (*post_commit) (wsrep_t* wsrep, -+ wsrep_ws_handle_t* ws_handle); -+ -+ /*! -+ * @brief Releases resources after transaction rollback. -+ * -+ * @param wsrep provider handle -+ * @param ws_handle writeset of committing transaction -+ * @retval WSREP_OK post_rollback succeeded -+ */ -+ wsrep_status_t (*post_rollback)(wsrep_t* wsrep, -+ wsrep_ws_handle_t* ws_handle); -+ -+ /*! -+ * @brief Replay trx as a slave writeset -+ * -+ * If local trx has been aborted by brute force, and it has already -+ * replicated before this abort, we must try if we can apply it as -+ * slave trx. Note that slave nodes see only trx writesets and certification -+ * test based on write set content can be different to DBMS lock conflicts. -+ * -+ * @param wsrep provider handle -+ * @param ws_handle writeset of committing transaction -+ * @param trx_ctx transaction context -+ * -+ * @retval WSREP_OK cluster commit succeeded -+ * @retval WSREP_TRX_FAIL must rollback transaction -+ * @retval WSREP_BF_ABORT brute force abort happened after trx replicated -+ * must rollback transaction and try to replay -+ * @retval WSREP_CONN_FAIL must close client connection -+ * @retval WSREP_NODE_FAIL must close all connections and reinit -+ */ -+ wsrep_status_t (*replay_trx)(wsrep_t* wsrep, -+ wsrep_ws_handle_t* ws_handle, -+ void* trx_ctx); -+ -+ /*! -+ * @brief Abort pre_commit() call of another thread. -+ * -+ * It is possible, that some high-priority transaction needs to abort -+ * another transaction which is in pre_commit() call waiting for resources. -+ * -+ * The kill routine checks that abort is not attmpted against a transaction -+ * which is front of the caller (in total order). -+ * -+ * @param wsrep provider handle -+ * @param bf_seqno seqno of brute force trx, running this cancel -+ * @param victim_trx transaction to be aborted, and which is committing -+ * -+ * @retval WSREP_OK abort secceded -+ * @retval WSREP_WARNING abort failed -+ */ -+ wsrep_status_t (*abort_pre_commit)(wsrep_t* wsrep, -+ wsrep_seqno_t bf_seqno, -+ wsrep_trx_id_t victim_trx); -+ -+ /*! -+ * @brief Appends a row reference to transaction writeset -+ * -+ * Both copy flag and key_type can be ignored by provider (key type -+ * interpreted as WSREP_KEY_EXCLUSIVE). -+ * -+ * @param wsrep provider handle -+ * @param ws_handle writeset handle -+ * @param keys array of keys -+ * @param count length of the array of keys -+ * @param type type ot the key -+ * @param copy can be set to FALSE if keys persist through commit. -+ */ -+ wsrep_status_t (*append_key)(wsrep_t* wsrep, -+ wsrep_ws_handle_t* ws_handle, -+ const wsrep_key_t* keys, -+ size_t count, -+ enum wsrep_key_type type, -+ wsrep_bool_t copy); -+ -+ /*! -+ * @brief Appends data to transaction writeset -+ * -+ * This method can be called any time before commit and it -+ * appends a number of data buffers to transaction writeset. -+ * -+ * Both copy and unordered flags can be ignored by provider. -+ * -+ * @param wsrep provider handle -+ * @param ws_handle writeset handle -+ * @param data array of data buffers -+ * @param count buffer count -+ * @param type type of data -+ * @param copy can be set to FALSE if data persists through commit. -+ */ -+ wsrep_status_t (*append_data)(wsrep_t* wsrep, -+ wsrep_ws_handle_t* ws_handle, -+ const struct wsrep_buf* data, -+ size_t count, -+ enum wsrep_data_type type, -+ wsrep_bool_t copy); -+ -+ /*! -+ * @brief Get causal ordering for read operation -+ * -+ * This call will block until causal ordering with all possible -+ * preceding writes in the cluster is guaranteed. If pointer to -+ * gtid is non-null, the call stores the global transaction ID -+ * of the last transaction which is guaranteed to be ordered -+ * causally before this call. -+ * -+ * @param wsrep provider handle -+ * @param gtid location to store GTID -+ */ -+ wsrep_status_t (*causal_read)(wsrep_t* wsrep, wsrep_gtid_t* gtid); -+ -+ /*! -+ * @brief Clears allocated connection context. -+ * -+ * Whenever a new connection ID is passed to wsrep provider through -+ * any of the API calls, a connection context is allocated for this -+ * connection. This call is to explicitly notify provider fo connection -+ * closing. -+ * -+ * @param wsrep provider handle -+ * @param conn_id connection ID -+ * @param query the 'set database' query -+ * @param query_len length of query (does not end with 0) -+ */ -+ wsrep_status_t (*free_connection)(wsrep_t* wsrep, -+ wsrep_conn_id_t conn_id); -+ -+ /*! -+ * @brief Replicates a query and starts "total order isolation" section. -+ * -+ * Replicates the action spec and returns success code, which caller must -+ * check. Total order isolation continues until to_execute_end() is called. -+ * -+ * @param wsrep provider handle -+ * @param conn_id connection ID -+ * @param keys array of keys -+ * @param keys_num lenght of the array of keys -+ * @param action action buffer array to be executed -+ * @param count action buffer count -+ * @param meta transaction meta data -+ * -+ * @retval WSREP_OK cluster commit succeeded -+ * @retval WSREP_CONN_FAIL must close client connection -+ * @retval WSREP_NODE_FAIL must close all connections and reinit -+ */ -+ wsrep_status_t (*to_execute_start)(wsrep_t* wsrep, -+ wsrep_conn_id_t conn_id, -+ const wsrep_key_t* keys, -+ size_t keys_num, -+ const struct wsrep_buf* action, -+ size_t count, -+ wsrep_trx_meta_t* meta); -+ -+ /*! -+ * @brief Ends the total order isolation section. -+ * -+ * Marks the end of total order isolation. TO locks are freed -+ * and other transactions are free to commit from this point on. -+ * -+ * @param wsrep provider handle -+ * @param conn_id connection ID -+ * -+ * @retval WSREP_OK cluster commit succeeded -+ * @retval WSREP_CONN_FAIL must close client connection -+ * @retval WSREP_NODE_FAIL must close all connections and reinit -+ */ -+ wsrep_status_t (*to_execute_end)(wsrep_t* wsrep, wsrep_conn_id_t conn_id); -+ -+ /*! -+ * @brief Collects preordered replication events into a writeset. -+ * -+ * @param wsrep wsrep provider handle -+ * @param handle a handle associated with a given writeset -+ * @param data an array of data buffers. -+ * @param count length of data buffer array. -+ * @param copy whether provider needs to make a copy of events. -+ * -+ * @retval WSREP_OK cluster-wide commit succeeded -+ * @retval WSREP_TRX_FAIL operation failed (e.g. trx size exceeded limit) -+ * @retval WSREP_NODE_FAIL must close all connections and reinit -+ */ -+ wsrep_status_t (*preordered_collect) (wsrep_t* wsrep, -+ wsrep_po_handle_t* handle, -+ const struct wsrep_buf* data, -+ size_t count, -+ wsrep_bool_t copy); -+ -+ /*! -+ * @brief "Commits" preordered writeset to cluster. -+ * -+ * The contract is that the writeset will be committed in the same (partial) -+ * order this method was called. Frees resources associated with the writeset -+ * handle and reinitializes the handle. -+ * -+ * @param wsrep wsrep provider handle -+ * @param po_handle a handle associated with a given writeset -+ * @param source_id ID of the event producer, also serves as the partial order -+ * or stream ID - events with different source_ids won't be -+ * ordered with respect to each other. -+ * @param flags WSREP_FLAG_... flags -+ * @param pa_range the number of preceding events this event can be processed -+ * in parallel with. A value of 0 means strict serial -+ * processing. Note: commits always happen in wsrep order. -+ * @param commit 'true' to commit writeset to cluster (replicate) or -+ * 'false' to rollback (cancel) the writeset. -+ * -+ * @retval WSREP_OK cluster-wide commit succeeded -+ * @retval WSREP_TRX_FAIL operation failed (e.g. NON-PRIMARY component) -+ * @retval WSREP_NODE_FAIL must close all connections and reinit -+ */ -+ wsrep_status_t (*preordered_commit) (wsrep_t* wsrep, -+ wsrep_po_handle_t* handle, -+ const wsrep_uuid_t* source_id, -+ uint32_t flags, -+ int pa_range, -+ wsrep_bool_t commit); -+ -+ /*! -+ * @brief Signals to wsrep provider that state snapshot has been sent to -+ * joiner. -+ * -+ * @param wsrep provider handle -+ * @param state_id state ID -+ * @param rcode 0 or negative error code of the operation. -+ */ -+ wsrep_status_t (*sst_sent)(wsrep_t* wsrep, -+ const wsrep_gtid_t* state_id, -+ int rcode); -+ -+ /*! -+ * @brief Signals to wsrep provider that new state snapshot has been received. -+ * May deadlock if called from sst_prepare_cb. -+ * -+ * @param wsrep provider handle -+ * @param state_id state ID -+ * @param state initial state provided by SST donor -+ * @param state_len length of state buffer -+ * @param rcode 0 or negative error code of the operation. -+ */ -+ wsrep_status_t (*sst_received)(wsrep_t* wsrep, -+ const wsrep_gtid_t* state_id, -+ const void* state, -+ size_t state_len, -+ int rcode); -+ -+ -+ /*! -+ * @brief Generate request for consistent snapshot. -+ * -+ * If successfull, this call will generate internally SST request -+ * which in turn triggers calling SST donate callback on the nodes -+ * specified in donor_spec. If donor_spec is null, callback is -+ * called only locally. This call will block until sst_sent is called -+ * from callback. -+ * -+ * @param wsrep provider handle -+ * @param msg context message for SST donate callback -+ * @param msg_len length of context message -+ * @param donor_spec list of snapshot donors -+ */ -+ wsrep_status_t (*snapshot)(wsrep_t* wsrep, -+ const void* msg, -+ size_t msg_len, -+ const char* donor_spec); -+ -+ /*! -+ * @brief Returns an array fo status variables. -+ * Array is terminated by Null variable name. -+ * -+ * @param wsrep provider handle -+ * @return array of struct wsrep_status_var. -+ */ -+ struct wsrep_stats_var* (*stats_get) (wsrep_t* wsrep); -+ -+ /*! -+ * @brief Release resources that might be associated with the array. -+ * -+ * @param wsrep provider handle. -+ * @param var_array array returned by stats_get(). -+ */ -+ void (*stats_free) (wsrep_t* wsrep, struct wsrep_stats_var* var_array); -+ -+ /*! -+ * @brief Reset some stats variables to inital value, provider-dependent. -+ * -+ * @param wsrep provider handle. -+ */ -+ void (*stats_reset) (wsrep_t* wsrep); -+ -+ /*! -+ * @brief Pauses writeset applying/committing. -+ * -+ * @return global sequence number of the paused state or negative error code. -+ */ -+ wsrep_seqno_t (*pause) (wsrep_t* wsrep); -+ -+ /*! -+ * @brief Resumes writeset applying/committing. -+ */ -+ wsrep_status_t (*resume) (wsrep_t* wsrep); -+ -+ /*! -+ * @brief Desynchronize from cluster -+ * -+ * Effectively turns off flow control for this node, allowing it -+ * to fall behind the cluster. -+ */ -+ wsrep_status_t (*desync) (wsrep_t* wsrep); -+ -+ /*! -+ * @brief Request to resynchronize with cluster. -+ * -+ * Effectively turns on flow control. Asynchronous - actual synchronization -+ * event to be deliverred via sync_cb. -+ */ -+ wsrep_status_t (*resync) (wsrep_t* wsrep); -+ -+ /*! -+ * @brief Acquire global named lock -+ * -+ * @param wsrep wsrep provider handle -+ * @param name lock name -+ * @param shared shared or exclusive lock -+ * @param owner 64-bit owner ID -+ * @param tout timeout in nanoseconds. -+ * 0 - return immediately, -1 wait forever. -+ * @return wsrep status or negative error code -+ * @retval -EDEADLK lock was already acquired by this thread -+ * @retval -EBUSY lock was busy -+ */ -+ wsrep_status_t (*lock) (wsrep_t* wsrep, -+ const char* name, wsrep_bool_t shared, -+ uint64_t owner, int64_t tout); -+ -+ /*! -+ * @brief Release global named lock -+ * -+ * @param wsrep wsrep provider handle -+ * @param name lock name -+ * @param owner 64-bit owner ID -+ * @return wsrep status or negative error code -+ * @retval -EPERM lock does not belong to this owner -+ */ -+ wsrep_status_t (*unlock) (wsrep_t* wsrep, const char* name, uint64_t owner); -+ -+ /*! -+ * @brief Check if global named lock is locked -+ * -+ * @param wsrep wsrep provider handle -+ * @param name lock name -+ * @param owner if not NULL will contain 64-bit owner ID -+ * @param node if not NULL will contain owner's node UUID -+ * @return true if lock is locked -+ */ -+ wsrep_bool_t (*is_locked) (wsrep_t* wsrep, const char* name, uint64_t* conn, -+ wsrep_uuid_t* node); -+ -+ /*! -+ * wsrep provider name -+ */ -+ const char* provider_name; -+ -+ /*! -+ * wsrep provider version -+ */ -+ const char* provider_version; -+ -+ /*! -+ * wsrep provider vendor name -+ */ -+ const char* provider_vendor; -+ -+ /*! -+ * @brief Frees allocated resources before unloading the library. -+ * @param wsrep provider handle -+ */ -+ void (*free)(wsrep_t* wsrep); -+ -+ void *dlh; //!< reserved for future use -+ void *ctx; //!< reserved for implemetation private context -+}; -+ -+ -+/*! -+ * -+ * @brief Loads wsrep library -+ * -+ * @param spec path to wsrep library. If NULL or WSREP_NONE initialises dummy -+ * pass-through implementation. -+ * @param hptr wsrep handle -+ * @param log_cb callback to handle loader messages. Otherwise writes to stderr. -+ * -+ * @return zero on success, errno on failure -+ */ -+int wsrep_load(const char* spec, wsrep_t** hptr, wsrep_log_cb_t log_cb); -+ -+/*! -+ * @brief Unloads wsrep library and frees associated resources -+ * -+ * @param hptr wsrep handler pointer -+ */ -+void wsrep_unload(wsrep_t* hptr); -+ -+#ifdef __cplusplus -+} -+#endif -+ -+#endif /* WSREP_H */ -diff --git a/wsrep/wsrep_dummy.c b/wsrep/wsrep_dummy.c -new file mode 100644 -index 0000000..bab5329 ---- /dev/null -+++ b/wsrep/wsrep_dummy.c -@@ -0,0 +1,407 @@ -+/* Copyright (C) 2009-2010 Codership Oy -+ -+ 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 -+ */ -+ -+/*! @file Dummy wsrep API implementation. */ -+ -+#include "wsrep_api.h" -+ -+#include -+#include -+#include -+ -+/*! Dummy backend context. */ -+typedef struct wsrep_dummy -+{ -+ wsrep_log_cb_t log_fn; -+ char* options; -+} wsrep_dummy_t; -+ -+/* Get pointer to wsrep_dummy context from wsrep_t pointer */ -+#define WSREP_DUMMY(_p) ((wsrep_dummy_t *) (_p)->ctx) -+ -+/* Trace function usage a-la DBUG */ -+#define WSREP_DBUG_ENTER(_w) do { \ -+ if (WSREP_DUMMY(_w)) { \ -+ if (WSREP_DUMMY(_w)->log_fn) \ -+ WSREP_DUMMY(_w)->log_fn(WSREP_LOG_DEBUG, __FUNCTION__); \ -+ } \ -+ } while (0) -+ -+ -+static void dummy_free(wsrep_t *w) -+{ -+ WSREP_DBUG_ENTER(w); -+ if (WSREP_DUMMY(w)->options) { -+ free(WSREP_DUMMY(w)->options); -+ WSREP_DUMMY(w)->options = NULL; -+ } -+ free(w->ctx); -+ w->ctx = NULL; -+} -+ -+static wsrep_status_t dummy_init (wsrep_t* w, -+ const struct wsrep_init_args* args) -+{ -+ WSREP_DUMMY(w)->log_fn = args->logger_cb; -+ WSREP_DBUG_ENTER(w); -+ if (args->options) { -+ WSREP_DUMMY(w)->options = strdup(args->options); -+ } -+ return WSREP_OK; -+} -+ -+static uint64_t dummy_capabilities (wsrep_t* w __attribute__((unused))) -+{ -+ return 0; -+} -+ -+static wsrep_status_t dummy_options_set( -+ wsrep_t* w, -+ const char* conf) -+{ -+ WSREP_DBUG_ENTER(w); -+ if (WSREP_DUMMY(w)->options) { -+ free(WSREP_DUMMY(w)->options); -+ WSREP_DUMMY(w)->options = NULL; -+ } -+ if (conf) { -+ WSREP_DUMMY(w)->options = strdup(conf); -+ } -+ return WSREP_OK; -+} -+ -+static char* dummy_options_get (wsrep_t* w) -+{ -+ WSREP_DBUG_ENTER(w); -+ return WSREP_DUMMY(w)->options; -+} -+ -+static wsrep_status_t dummy_connect( -+ wsrep_t* w, -+ const char* name __attribute__((unused)), -+ const char* url __attribute__((unused)), -+ const char* donor __attribute__((unused)), -+ wsrep_bool_t bootstrap __attribute__((unused))) -+{ -+ WSREP_DBUG_ENTER(w); -+ return WSREP_OK; -+} -+ -+static wsrep_status_t dummy_disconnect(wsrep_t* w) -+{ -+ WSREP_DBUG_ENTER(w); -+ return WSREP_OK; -+} -+ -+static wsrep_status_t dummy_recv(wsrep_t* w, -+ void* recv_ctx __attribute__((unused))) -+{ -+ WSREP_DBUG_ENTER(w); -+ return WSREP_OK; -+} -+ -+static wsrep_status_t dummy_pre_commit( -+ wsrep_t* w, -+ const wsrep_conn_id_t conn_id __attribute__((unused)), -+ wsrep_ws_handle_t* ws_handle __attribute__((unused)), -+ uint32_t flags __attribute__((unused)), -+ wsrep_trx_meta_t* meta __attribute__((unused))) -+{ -+ WSREP_DBUG_ENTER(w); -+ return WSREP_OK; -+} -+ -+static wsrep_status_t dummy_post_commit( -+ wsrep_t* w, -+ wsrep_ws_handle_t* ws_handle __attribute__((unused))) -+{ -+ WSREP_DBUG_ENTER(w); -+ return WSREP_OK; -+} -+ -+static wsrep_status_t dummy_post_rollback( -+ wsrep_t* w, -+ wsrep_ws_handle_t* ws_handle __attribute__((unused))) -+{ -+ WSREP_DBUG_ENTER(w); -+ return WSREP_OK; -+} -+ -+static wsrep_status_t dummy_replay_trx( -+ wsrep_t* w, -+ wsrep_ws_handle_t* ws_handle __attribute__((unused)), -+ void* trx_ctx __attribute__((unused))) -+{ -+ WSREP_DBUG_ENTER(w); -+ return WSREP_OK; -+} -+ -+static wsrep_status_t dummy_abort_pre_commit( -+ wsrep_t* w, -+ const wsrep_seqno_t bf_seqno __attribute__((unused)), -+ const wsrep_trx_id_t trx_id __attribute__((unused))) -+{ -+ WSREP_DBUG_ENTER(w); -+ return WSREP_OK; -+} -+ -+static wsrep_status_t dummy_append_key( -+ wsrep_t* w, -+ wsrep_ws_handle_t* ws_handle __attribute__((unused)), -+ const wsrep_key_t* key __attribute__((unused)), -+ const size_t key_num __attribute__((unused)), -+ const wsrep_key_type_t key_type __attribute__((unused)), -+ const bool copy __attribute__((unused))) -+{ -+ WSREP_DBUG_ENTER(w); -+ return WSREP_OK; -+} -+ -+static wsrep_status_t dummy_append_data( -+ wsrep_t* w, -+ wsrep_ws_handle_t* ws_handle __attribute__((unused)), -+ const struct wsrep_buf* data __attribute__((unused)), -+ const size_t count __attribute__((unused)), -+ const wsrep_data_type_t type __attribute__((unused)), -+ const bool copy __attribute__((unused))) -+{ -+ WSREP_DBUG_ENTER(w); -+ return WSREP_OK; -+} -+ -+static wsrep_status_t dummy_causal_read( -+ wsrep_t* w, -+ wsrep_gtid_t* gtid __attribute__((unused))) -+{ -+ WSREP_DBUG_ENTER(w); -+ return WSREP_OK; -+} -+ -+static wsrep_status_t dummy_free_connection( -+ wsrep_t* w, -+ const wsrep_conn_id_t conn_id __attribute__((unused))) -+{ -+ WSREP_DBUG_ENTER(w); -+ return WSREP_OK; -+} -+ -+static wsrep_status_t dummy_to_execute_start( -+ wsrep_t* w, -+ const wsrep_conn_id_t conn_id __attribute__((unused)), -+ const wsrep_key_t* key __attribute__((unused)), -+ const size_t key_num __attribute__((unused)), -+ const struct wsrep_buf* data __attribute__((unused)), -+ const size_t count __attribute__((unused)), -+ wsrep_trx_meta_t* meta __attribute__((unused))) -+{ -+ WSREP_DBUG_ENTER(w); -+ return WSREP_OK; -+} -+ -+static wsrep_status_t dummy_to_execute_end( -+ wsrep_t* w, -+ const wsrep_conn_id_t conn_id __attribute__((unused))) -+{ -+ WSREP_DBUG_ENTER(w); -+ return WSREP_OK; -+} -+ -+static wsrep_status_t dummy_preordered_collect( -+ wsrep_t* w, -+ wsrep_po_handle_t* handle __attribute__((unused)), -+ const struct wsrep_buf* data __attribute__((unused)), -+ size_t count __attribute__((unused)), -+ wsrep_bool_t copy __attribute__((unused))) -+{ -+ WSREP_DBUG_ENTER(w); -+ return WSREP_OK; -+} -+ -+static wsrep_status_t dummy_preordered_commit( -+ wsrep_t* w, -+ wsrep_po_handle_t* handle __attribute__((unused)), -+ const wsrep_uuid_t* source_id __attribute__((unused)), -+ uint32_t flags __attribute__((unused)), -+ int pa_range __attribute__((unused)), -+ wsrep_bool_t commit __attribute__((unused))) -+{ -+ WSREP_DBUG_ENTER(w); -+ return WSREP_OK; -+} -+ -+static wsrep_status_t dummy_sst_sent( -+ wsrep_t* w, -+ const wsrep_gtid_t* state_id __attribute__((unused)), -+ const int rcode __attribute__((unused))) -+{ -+ WSREP_DBUG_ENTER(w); -+ return WSREP_OK; -+} -+ -+static wsrep_status_t dummy_sst_received( -+ wsrep_t* w, -+ const wsrep_gtid_t* state_id __attribute__((unused)), -+ const void* state __attribute__((unused)), -+ const size_t state_len __attribute__((unused)), -+ const int rcode __attribute__((unused))) -+{ -+ WSREP_DBUG_ENTER(w); -+ return WSREP_OK; -+} -+ -+static wsrep_status_t dummy_snapshot( -+ wsrep_t* w, -+ const void* msg __attribute__((unused)), -+ const size_t msg_len __attribute__((unused)), -+ const char* donor_spec __attribute__((unused))) -+{ -+ WSREP_DBUG_ENTER(w); -+ return WSREP_OK; -+} -+ -+static struct wsrep_stats_var dummy_stats[] = { -+ { NULL, WSREP_VAR_STRING, { 0 } } -+}; -+ -+static struct wsrep_stats_var* dummy_stats_get (wsrep_t* w) -+{ -+ WSREP_DBUG_ENTER(w); -+ return dummy_stats; -+} -+ -+static void dummy_stats_free ( -+ wsrep_t* w, -+ struct wsrep_stats_var* stats __attribute__((unused))) -+{ -+ WSREP_DBUG_ENTER(w); -+} -+ -+static void dummy_stats_reset (wsrep_t* w) -+{ -+ WSREP_DBUG_ENTER(w); -+} -+ -+static wsrep_seqno_t dummy_pause (wsrep_t* w) -+{ -+ WSREP_DBUG_ENTER(w); -+ return -ENOSYS; -+} -+ -+static wsrep_status_t dummy_resume (wsrep_t* w) -+{ -+ WSREP_DBUG_ENTER(w); -+ return WSREP_OK; -+} -+ -+static wsrep_status_t dummy_desync (wsrep_t* w) -+{ -+ WSREP_DBUG_ENTER(w); -+ return WSREP_NOT_IMPLEMENTED; -+} -+ -+static wsrep_status_t dummy_resync (wsrep_t* w) -+{ -+ WSREP_DBUG_ENTER(w); -+ return WSREP_OK; -+} -+ -+static wsrep_status_t dummy_lock (wsrep_t* w, -+ const char* s __attribute__((unused)), -+ bool r __attribute__((unused)), -+ uint64_t o __attribute__((unused)), -+ int64_t t __attribute__((unused))) -+{ -+ WSREP_DBUG_ENTER(w); -+ return WSREP_NOT_IMPLEMENTED; -+} -+ -+static wsrep_status_t dummy_unlock (wsrep_t* w, -+ const char* s __attribute__((unused)), -+ uint64_t o __attribute__((unused))) -+{ -+ WSREP_DBUG_ENTER(w); -+ return WSREP_OK; -+} -+ -+static bool dummy_is_locked (wsrep_t* w, -+ const char* s __attribute__((unused)), -+ uint64_t* o __attribute__((unused)), -+ wsrep_uuid_t* t __attribute__((unused))) -+{ -+ WSREP_DBUG_ENTER(w); -+ return false; -+} -+ -+static wsrep_t dummy_iface = { -+ WSREP_INTERFACE_VERSION, -+ &dummy_init, -+ &dummy_capabilities, -+ &dummy_options_set, -+ &dummy_options_get, -+ &dummy_connect, -+ &dummy_disconnect, -+ &dummy_recv, -+ &dummy_pre_commit, -+ &dummy_post_commit, -+ &dummy_post_rollback, -+ &dummy_replay_trx, -+ &dummy_abort_pre_commit, -+ &dummy_append_key, -+ &dummy_append_data, -+ &dummy_causal_read, -+ &dummy_free_connection, -+ &dummy_to_execute_start, -+ &dummy_to_execute_end, -+ &dummy_preordered_collect, -+ &dummy_preordered_commit, -+ &dummy_sst_sent, -+ &dummy_sst_received, -+ &dummy_snapshot, -+ &dummy_stats_get, -+ &dummy_stats_free, -+ &dummy_stats_reset, -+ &dummy_pause, -+ &dummy_resume, -+ &dummy_desync, -+ &dummy_resync, -+ &dummy_lock, -+ &dummy_unlock, -+ &dummy_is_locked, -+ WSREP_NONE, -+ WSREP_INTERFACE_VERSION, -+ "Codership Oy ", -+ &dummy_free, -+ NULL, -+ NULL -+}; -+ -+int wsrep_dummy_loader(wsrep_t* w) -+{ -+ if (!w) -+ return EINVAL; -+ -+ *w = dummy_iface; -+ -+ // allocate private context -+ if (!(w->ctx = malloc(sizeof(wsrep_dummy_t)))) -+ return ENOMEM; -+ -+ // initialize private context -+ WSREP_DUMMY(w)->log_fn = NULL; -+ WSREP_DUMMY(w)->options = NULL; -+ -+ return 0; -+} -diff --git a/wsrep/wsrep_gtid.c b/wsrep/wsrep_gtid.c -new file mode 100644 -index 0000000..e618c5a ---- /dev/null -+++ b/wsrep/wsrep_gtid.c -@@ -0,0 +1,74 @@ -+/* Copyright (C) 2013 Codership Oy -+ -+ 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 -+ */ -+ -+/*! @file Helper functions to deal with GTID string representations */ -+ -+#include -+#include -+#include -+#include -+ -+#include "wsrep_api.h" -+ -+/*! -+ * Read GTID from string -+ * @return length of GTID string representation or -EINVAL in case of error -+ */ -+int -+wsrep_gtid_scan(const char* str, size_t str_len, wsrep_gtid_t* gtid) -+{ -+ unsigned int offset; -+ char* endptr; -+ -+ if ((offset = wsrep_uuid_scan(str, str_len, >id->uuid)) > 0 && -+ offset < str_len && str[offset] == ':') { -+ ++offset; -+ if (offset < str_len) -+ { -+ errno = 0; -+ gtid->seqno = strtoll(str + offset, &endptr, 0); -+ -+ if (errno == 0) { -+ offset = endptr - str; -+ return offset; -+ } -+ } -+ } -+ *gtid = WSREP_GTID_UNDEFINED; -+ return -EINVAL; -+} -+ -+/*! -+ * Write GTID to string -+ * @return length of GTID stirng representation of -EMSGSIZE if string is too -+ * short -+ */ -+int -+wsrep_gtid_print(const wsrep_gtid_t* gtid, char* str, size_t str_len) -+{ -+ unsigned int offset, ret; -+ if ((offset = wsrep_uuid_print(>id->uuid, str, str_len)) > 0) -+ { -+ ret = snprintf(str + offset, str_len - offset, -+ ":%" PRId64, gtid->seqno); -+ if (ret <= str_len - offset) { -+ return (offset + ret); -+ } -+ -+ } -+ -+ return -EMSGSIZE; -+} -diff --git a/wsrep/wsrep_loader.c b/wsrep/wsrep_loader.c -new file mode 100644 -index 0000000..c330c77 ---- /dev/null -+++ b/wsrep/wsrep_loader.c -@@ -0,0 +1,203 @@ -+/* Copyright (C) 2009-2011 Codership Oy -+ -+ 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 -+ */ -+ -+/*! @file wsrep implementation loader */ -+ -+#include -+#include -+#include -+#include -+ -+#include "wsrep_api.h" -+ -+// Logging stuff for the loader -+static const char* log_levels[] = {"FATAL", "ERROR", "WARN", "INFO", "DEBUG"}; -+ -+static void default_logger (wsrep_log_level_t lvl, const char* msg) -+{ -+ fprintf (stderr, "wsrep loader: [%s] %s\n", log_levels[lvl], msg); -+} -+ -+static wsrep_log_cb_t logger = default_logger; -+ -+/************************************************************************** -+ * Library loader -+ **************************************************************************/ -+ -+static int verify(const wsrep_t *wh, const char *iface_ver) -+{ -+ const size_t msg_len = 128; -+ char msg[128]; -+ -+#define VERIFY(_p) if (!(_p)) { \ -+ snprintf(msg, msg_len, "wsrep_load(): verify(): %s\n", # _p); \ -+ logger (WSREP_LOG_ERROR, msg); \ -+ return EINVAL; \ -+ } -+ -+ VERIFY(wh); -+ VERIFY(wh->version); -+ -+ if (strcmp(wh->version, iface_ver)) { -+ snprintf (msg, msg_len, -+ "provider interface version mismatch: need '%s', found '%s'", -+ iface_ver, wh->version); -+ logger (WSREP_LOG_ERROR, msg); -+ return EINVAL; -+ } -+ -+ VERIFY(wh->init); -+ VERIFY(wh->options_set); -+ VERIFY(wh->options_get); -+ VERIFY(wh->connect); -+ VERIFY(wh->disconnect); -+ VERIFY(wh->recv); -+ VERIFY(wh->pre_commit); -+ VERIFY(wh->post_commit); -+ VERIFY(wh->post_rollback); -+ VERIFY(wh->replay_trx); -+ VERIFY(wh->abort_pre_commit); -+ VERIFY(wh->append_key); -+ VERIFY(wh->append_data); -+ VERIFY(wh->free_connection); -+ VERIFY(wh->to_execute_start); -+ VERIFY(wh->to_execute_end); -+ VERIFY(wh->preordered_collect); -+ VERIFY(wh->preordered_commit); -+ VERIFY(wh->sst_sent); -+ VERIFY(wh->sst_received); -+ VERIFY(wh->stats_get); -+ VERIFY(wh->stats_free); -+ VERIFY(wh->stats_reset); -+ VERIFY(wh->pause); -+ VERIFY(wh->resume); -+ VERIFY(wh->desync); -+ VERIFY(wh->resync); -+ VERIFY(wh->lock); -+ VERIFY(wh->unlock); -+ VERIFY(wh->is_locked); -+ VERIFY(wh->provider_name); -+ VERIFY(wh->provider_version); -+ VERIFY(wh->provider_vendor); -+ VERIFY(wh->free); -+ return 0; -+} -+ -+typedef int (*wsrep_loader_fun)(wsrep_t*); -+ -+static wsrep_loader_fun wsrep_dlf(void *dlh, const char *sym) -+{ -+ union { -+ wsrep_loader_fun dlfun; -+ void *obj; -+ } alias; -+ alias.obj = dlsym(dlh, sym); -+ return alias.dlfun; -+} -+ -+extern int wsrep_dummy_loader(wsrep_t *w); -+ -+int wsrep_load(const char *spec, wsrep_t **hptr, wsrep_log_cb_t log_cb) -+{ -+ int ret = 0; -+ void *dlh = NULL; -+ wsrep_loader_fun dlfun; -+ const size_t msg_len = 1024; -+ char msg[1024 + 1]; -+ msg[msg_len] = 0; -+ -+ if (NULL != log_cb) -+ logger = log_cb; -+ -+ if (!(spec && hptr)) -+ return EINVAL; -+ -+ snprintf (msg, msg_len, -+ "wsrep_load(): loading provider library '%s'", spec); -+ logger (WSREP_LOG_INFO, msg); -+ -+ if (!(*hptr = malloc(sizeof(wsrep_t)))) { -+ logger (WSREP_LOG_FATAL, "wsrep_load(): out of memory"); -+ return ENOMEM; -+ } -+ -+ if (!spec || strcmp(spec, WSREP_NONE) == 0) { -+ if ((ret = wsrep_dummy_loader(*hptr)) != 0) { -+ free (*hptr); -+ *hptr = NULL; -+ } -+ return ret; -+ } -+ -+ if (!(dlh = dlopen(spec, RTLD_NOW | RTLD_LOCAL))) { -+ snprintf(msg, msg_len, "wsrep_load(): dlopen(): %s", dlerror()); -+ logger (WSREP_LOG_ERROR, msg); -+ ret = EINVAL; -+ goto out; -+ } -+ -+ if (!(dlfun = wsrep_dlf(dlh, "wsrep_loader"))) { -+ ret = EINVAL; -+ goto out; -+ } -+ -+ if ((ret = (*dlfun)(*hptr)) != 0) { -+ snprintf(msg, msg_len, "wsrep_load(): loader failed: %s", -+ strerror(ret)); -+ logger (WSREP_LOG_ERROR, msg); -+ goto out; -+ } -+ -+ if ((ret = verify(*hptr, WSREP_INTERFACE_VERSION)) != 0) { -+ snprintf (msg, msg_len, -+ "wsrep_load(): interface version mismatch: my version %s, " -+ "provider version %s", WSREP_INTERFACE_VERSION, -+ (*hptr)->version); -+ logger (WSREP_LOG_ERROR, msg); -+ goto out; -+ } -+ -+ (*hptr)->dlh = dlh; -+ -+out: -+ if (ret != 0) { -+ if (dlh) dlclose(dlh); -+ free(*hptr); -+ *hptr = NULL; -+ } else { -+ snprintf (msg, msg_len, -+ "wsrep_load(): %s %s by %s loaded successfully.", -+ (*hptr)->provider_name, (*hptr)->provider_version, -+ (*hptr)->provider_vendor); -+ logger (WSREP_LOG_INFO, msg); -+ } -+ -+ return ret; -+} -+ -+void wsrep_unload(wsrep_t *hptr) -+{ -+ if (!hptr) { -+ logger (WSREP_LOG_WARN, "wsrep_unload(): null pointer."); -+ } else { -+ if (hptr->free) -+ hptr->free(hptr); -+ if (hptr->dlh) -+ dlclose(hptr->dlh); -+ free(hptr); -+ } -+} -+ -diff --git a/wsrep/wsrep_uuid.c b/wsrep/wsrep_uuid.c -new file mode 100644 -index 0000000..baa95b2 ---- /dev/null -+++ b/wsrep/wsrep_uuid.c -@@ -0,0 +1,83 @@ -+/* Copyright (C) 2009 Codership Oy -+ -+ 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 -+ */ -+ -+/*! @file Helper functions to deal with history UUID string representations */ -+ -+#include -+#include -+#include -+ -+#include "wsrep_api.h" -+ -+/*! -+ * Read UUID from string -+ * @return length of UUID string representation or -EINVAL in case of error -+ */ -+int -+wsrep_uuid_scan (const char* str, size_t str_len, wsrep_uuid_t* uuid) -+{ -+ unsigned int uuid_len = 0; -+ unsigned int uuid_offt = 0; -+ -+ while (uuid_len + 1 < str_len) { -+ /* We are skipping potential '-' after uuid_offt == 4, 6, 8, 10 -+ * which means -+ * (uuid_offt >> 1) == 2, 3, 4, 5, -+ * which in turn means -+ * (uuid_offt >> 1) - 2 <= 3 -+ * since it is always >= 0, because uuid_offt is unsigned */ -+ if (((uuid_offt >> 1) - 2) <= 3 && str[uuid_len] == '-') { -+ // skip dashes after 4th, 6th, 8th and 10th positions -+ uuid_len += 1; -+ continue; -+ } -+ -+ if (isxdigit(str[uuid_len]) && isxdigit(str[uuid_len + 1])) { -+ // got hex digit, scan another byte to uuid, increment uuid_offt -+ sscanf (str + uuid_len, "%2hhx", uuid->data + uuid_offt); -+ uuid_len += 2; -+ uuid_offt += 1; -+ if (sizeof (uuid->data) == uuid_offt) -+ return uuid_len; -+ } -+ else { -+ break; -+ } -+ } -+ -+ *uuid = WSREP_UUID_UNDEFINED; -+ return -EINVAL; -+} -+ -+/*! -+ * Write UUID to string -+ * @return length of UUID string representation or -EMSGSIZE if string is too -+ * short -+ */ -+int -+wsrep_uuid_print (const wsrep_uuid_t* uuid, char* str, size_t str_len) -+{ -+ if (str_len > 36) { -+ const unsigned char* u = uuid->data; -+ return snprintf(str, str_len, "%02x%02x%02x%02x-%02x%02x-%02x%02x-" -+ "%02x%02x-%02x%02x%02x%02x%02x%02x", -+ u[ 0], u[ 1], u[ 2], u[ 3], u[ 4], u[ 5], u[ 6], u[ 7], -+ u[ 8], u[ 9], u[10], u[11], u[12], u[13], u[14], u[15]); -+ } -+ else { -+ return -EMSGSIZE; -+ } -+} diff --git a/debian/patches/scripts__mysqld_safe.sh__signals.patch b/debian/patches/scripts__mysqld_safe.sh__signals.patch index de6c8066..984fd8cc 100644 --- a/debian/patches/scripts__mysqld_safe.sh__signals.patch +++ b/debian/patches/scripts__mysqld_safe.sh__signals.patch @@ -29,7 +29,7 @@ Reviewed-by: Nicholas Bamber ;; *) echo "Internal program error (non-fatal):" \ -@@ -740,6 +737,13 @@ mysqld daemon not started" +@@ -815,6 +815,13 @@ mysqld daemon not started" fi # diff --git a/debian/patches/series b/debian/patches/series index eae7eb5e..c92237ff 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,9 +1,5 @@ -fix-man-page-links.patch hurd.patch scripts__mysqld_safe.sh__signals.patch -disable_tests.patch fix_standalone_tests.patch kfreebsd_tests.patch -spelling.patch -mysql-5.6.23_wsrep_25.10.patch -wsrep_sst_mysqldump.patch +fix-mysqlhotcopy-test-failure.patch diff --git a/debian/patches/spelling.patch b/debian/patches/spelling.patch index 4fbf5eb6..7b7b8d18 100644 --- a/debian/patches/spelling.patch +++ b/debian/patches/spelling.patch @@ -97,7 +97,7 @@ Forwarded: no # effects like failing 'sync_slave_with_master', crashes of the slave or --- a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test +++ b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test -@@ -239,7 +239,7 @@ sync_slave_with_master; +@@ -239,7 +239,7 @@ INSERT INTO t1 VALUES (1,'master,slave') UPDATE t1 SET a = 5, b = 'slave' WHERE a = 1; SELECT * FROM t1 ORDER BY a; # since bug#31552/31609 idempotency is not default any longer. In @@ -145,7 +145,7 @@ Forwarded: no --- a/sql/log_event.cc +++ b/sql/log_event.cc -@@ -4607,7 +4607,7 @@ int Query_log_event::do_apply_event(Rela +@@ -4625,7 +4625,7 @@ int Query_log_event::do_apply_event(Rela if ((error= rows_event_stmt_cleanup(const_cast(rli), thd))) { const_cast(rli)->report(ERROR_LEVEL, error, @@ -198,7 +198,7 @@ Forwarded: no @param comma Prepend a comma? --- a/sql/sql_yacc.cc +++ b/sql/sql_yacc.cc -@@ -39064,7 +39064,7 @@ yyreduce: +@@ -35151,7 +35151,7 @@ yyreduce: { /* Not in trigger assigning value to new row, @@ -209,7 +209,7 @@ Forwarded: no MYSQL_YYABORT; --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy -@@ -14559,7 +14559,7 @@ opt_var_ident_type: +@@ -14573,7 +14573,7 @@ opt_var_ident_type: | SESSION_SYM '.' { $$=OPT_SESSION; } ; @@ -218,7 +218,7 @@ Forwarded: no option_value_following_option_type: internal_variable_name equal set_expr_or_default { -@@ -14576,7 +14576,7 @@ option_value_following_option_type: +@@ -14590,7 +14590,7 @@ option_value_following_option_type: { /* Not in trigger assigning value to new row, @@ -227,7 +227,7 @@ Forwarded: no */ my_parse_error(ER(ER_SYNTAX_ERROR)); MYSQL_YYABORT; -@@ -14584,7 +14584,7 @@ option_value_following_option_type: +@@ -14598,7 +14598,7 @@ option_value_following_option_type: } ; diff --git a/debian/patches/wsrep_sst_mysqldump.patch b/debian/patches/wsrep_sst_mysqldump.patch deleted file mode 100644 index 6b970767..00000000 --- a/debian/patches/wsrep_sst_mysqldump.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff --git a/scripts/wsrep_sst_mysqldump.sh b/scripts/wsrep_sst_mysqldump.sh -index 89eb755..c20d9fa 100644 ---- a/scripts/wsrep_sst_mysqldump.sh -+++ b/scripts/wsrep_sst_mysqldump.sh -@@ -53,6 +53,8 @@ then - exit $EINVAL - fi - -+MYSQL_APPS_PREFIX="nice -n 15 ionice -c2 -n7" -+ - # Check client version - CLIENT_MINOR=$(mysql --version | cut -d ' ' -f 6 | cut -d '.' -f 2) - if [ $CLIENT_MINOR -lt "6" ] -@@ -73,7 +75,7 @@ if test -n "$WSREP_SST_OPT_PSWD"; then AUTH="$AUTH -p$WSREP_SST_OPT_PSWD"; fi - STOP_WSREP="SET wsrep_on=OFF;" - - # NOTE: we don't use --routines here because we're dumping mysql.proc table --MYSQLDUMP="$MYSQLDUMP $AUTH -S$WSREP_SST_OPT_SOCKET \ -+MYSQLDUMP="$MYSQL_APPS_PREFIX $MYSQLDUMP $AUTH -S$WSREP_SST_OPT_SOCKET \ - --add-drop-database --add-drop-table --skip-add-locks --create-options \ - --disable-keys --extended-insert --skip-lock-tables --quick --set-charset \ - --skip-comments --flush-privileges --all-databases --events" -@@ -98,7 +100,7 @@ DROP PREPARE stmt;" - - SET_START_POSITION="SET GLOBAL wsrep_start_position='$WSREP_SST_OPT_GTID';" - --MYSQL="$MYSQL_CLIENT $AUTH -h$WSREP_SST_OPT_HOST -P$WSREP_SST_OPT_PORT "\ -+MYSQL="$MYSQL_APPS_PREFIX $MYSQL_CLIENT $AUTH -h$WSREP_SST_OPT_HOST -P$WSREP_SST_OPT_PORT "\ - "--disable-reconnect --connect_timeout=10" - - # need to disable logging when loading the dump diff --git a/debian/rules b/debian/rules index 8cc125f6..9b64bc23 100755 --- a/debian/rules +++ b/debian/rules @@ -1,41 +1,47 @@ #!/usr/bin/make -f export DH_VERBOSE=1 -export DEB_BUILD_HARDENING=1 -PACKAGE:=mysql-5.6 - -TMP:=$(CURDIR)/debian/tmp/ +# enable Debian Hardening +# see: https://wiki.debian.org/Hardening +export DEB_BUILD_MAINT_OPTIONS = hardening=+all,-pie +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/buildflags.mk ARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH) ARCH_OS := $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS) +BUILDDIR := builddir +BUILDDIR_PIC := builddir-pic +builddir = $(if $(findstring -pic,$@),$(BUILDDIR_PIC),$(BUILDDIR)) +DEBVERSION := $(shell dpkg-parsechangelog | awk '/^Version: / { print $$2 }' | sed 's/^.*-//' ) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) -DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_SYSTEM ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_SYSTEM) -DEBVERSION := $(shell dpkg-parsechangelog | awk '/^Version: / { print $$2 }' | sed 's/^.*-//' ) - -ifneq (,$(filter $(ARCH), i386 kfreebsd-i386 hurd-i386)) - TAOCRYPT_OPT="-DTAOCRYPT_DISABLE_X86ASM" -endif - -export MYSQL_BUILD_CC=$(DEB_HOST_GNU_TYPE)-gcc -export MYSQL_BUILD_CXX=$(DEB_HOST_GNU_TYPE)-g++ - +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_SOURCE_PACKAGE ?= $(strip $(shell egrep '^Source: ' debian/control | cut -f 2 -d ':')) DEB_VERSION ?= $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ') DEB_NOEPOCH_VERSION ?= $(shell echo $(DEB_VERSION) | cut -d: -f2-) DEB_UPSTREAM_VERSION ?= $(shell echo $(DEB_NOEPOCH_VERSION) | sed 's/-[^-]*$$//') DEB_UPSTREAM_VERSION_MAJOR_MINOR := $(shell echo $(DEB_UPSTREAM_VERSION) | sed -r -n 's/^([0-9]+\.[0-9]+).*/\1/p') DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) - +DISTRIBUTION := $(shell lsb_release -i -s) EXPORTED_SOURCE_TARBALL := debian/mysql-source-5.6.tar.gz +TESTSUITE_FAIL_CMD:=true +TMP := $(CURDIR)/debian/tmp/ +USE_ASSEMBLER:=--enable-assembler -DISTRIBUTION := $(shell lsb_release -i -s) -MAKE_TEST_TARGET:=test -ifneq ($(findstring fulltest,$(DEB_BUILD_OPTIONS)),) -# make test-bt is the testsuite run by the MySQL build team +export MYSQL_BUILD_CC=$(DEB_HOST_GNU_TYPE)-gcc +export MYSQL_BUILD_CXX=$(DEB_HOST_GNU_TYPE)-g++ + + +ifneq (,$(filter $(ARCH), i386 kfreebsd-i386 hurd-i386)) + TAOCRYPT_OPT="-DTAOCRYPT_DISABLE_X86ASM" +endif + +# make test-bt is the testsuite run by the MySQL build team # before a release, but it is long +MAKE_TEST_TARGET:=test-mtr +ifneq ($(findstring fulltest,$(DEB_BUILD_OPTIONS)),) MAKE_TEST_TARGET:=test-bt endif ifeq ($(ARCH_OS),hurd) @@ -44,17 +50,6 @@ ifeq ($(ARCH_OS),hurd) MAKE_TEST_TARGET:=test endif -USE_ASSEMBLER:=--enable-assembler - -ifneq (,$(filter $(ARCH), amd64 i386 kfreebsd-i386)) - TESTSUITE_FAIL_CMD:=exit 1 -else - TESTSUITE_FAIL_CMD:=true -endif - -BUILDDIR := builddir -BUILDDIR_PIC := builddir-pic -builddir = $(if $(findstring -pic,$@),$(BUILDDIR_PIC),$(BUILDDIR)) # This causes seg11 crashes if LDAP is used for groups in /etc/nsswitch.conf # so it is disabled by default although, according to MySQL, it brings >10% @@ -62,69 +57,57 @@ builddir = $(if $(findstring -pic,$@),$(BUILDDIR_PIC),$(BUILDDIR)) ifeq ($(STATIC_MYSQLD), 1) USE_STATIC_MYSQLD:=--with-mysqld-ldflags=-all-static endif - -# See http://blogs.innodb.com/wp/2010/04/innodb-performance-aio-linux/ -# Also #659565 -ifneq (,$(findstring linux-gnu,$(DEB_HOST_GNU_TYPE))) - USE_LINUX_NATIVE_AIO:=-DLINUX_NATIVE_AIO=ON -endif override_dh_auto_clean: @echo "RULES.$@" - dh_testdir + dh_testdir dh_testroot [ ! -d mysql-test/var ] || rm -rf mysql-test/var - #rm -rf $(BUILDDIR) $(BUILDDIR_PIC) - rm -rf $(BUILDDIR) + rm -rf $(BUILDDIR) $(BUILDDIR_PIC) .pc debconf-updatepo rm -f $(EXPORTED_SOURCE_TARBALL) + rm -f cmake/os/GNU.cmake -override_dh_prep: +override_dh_prep: -#override_dh_auto_configure: configure-stamp configure-pic-stamp override_dh_auto_configure: configure-stamp -#configure-pic-stamp: FORCE_FPIC_CFLAGS=-fPIC -#configure-pic-stamp: FORCE_FPIC=-DWITH_PIC=On +configure-pic-stamp: FORCE_FPIC_CFLAGS=-fPIC +configure-pic-stamp: FORCE_FPIC=-DWITH_PIC=On -#configure-stamp configure-pic-stamp: -configure-stamp: +configure-stamp configure-pic-stamp: @echo "RULES.$@" dh_testdir ( test -d $(builddir) || mkdir $(builddir) ) && cd $(builddir) && \ - sh -c 'PATH=$${MYSQL_BUILD_PATH:-"/bin:/usr/bin"} \ + sh -c 'PATH=$${MYSQL_BUILD_PATH:-"/usr/local/bin:/usr/bin:/bin"} \ CC=$${MYSQL_BUILD_CC:-gcc} \ - CFLAGS=$${MYSQL_BUILD_CFLAGS:-"-O2 -DBIG_JOINS=1 -fno-strict-aliasing ${TAOCRYPT_OPT}"} \ - CXX=$${MYSQL_BUILD_CXX:-g++} \ - CXXFLAGS=$${MYSQL_BUILD_CXXFLAGS:-"-O3 -DBIG_JOINS=1 -felide-constructors -fno-exceptions -fpermissive -fno-rtti -fno-strict-aliasing ${TAOCRYPT_OPT}"} \ + CFLAGS=$${MYSQL_BUILD_CFLAGS:-"-O2 -DBIG_JOINS=1 ${FORCE_FPIC_CFLAGS} -fno-strict-aliasing ${TAOCRYPT_OPT}"} \ + CXX=$${MYSQL_BUILD_CXX:-g++} \ + CXXFLAGS=$${MYSQL_BUILD_CXXFLAGS:-"-O3 -DBIG_JOINS=1 -felide-constructors -fpermissive ${FORCE_FPIC_CFLAGS} -fno-strict-aliasing ${TAOCRYPT_OPT}"} \ cmake -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_VERBOSE_MAKEFILE=ON \ + $(FORCE_FPIC) \ -DMYSQL_UNIX_ADDR=/var/run/mysqld/mysqld.sock \ - -DMYSQL_USER=mysql \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DWITH_WSREP=1 \ -DWITH_LIBWRAP=ON \ - -DWITH_READLINE=OFF \ -DWITH_ZLIB=system \ - -DWITH_LIBEDIT=OFF \ + -DWITH_EDITLINE=system \ $(USE_STATIC_MYSQLD) \ - $(USE_LINUX_NATIVE_AIO) \ - -DWITH_SSL=bundled \ + -DWITH_SSL=system \ -DCOMPILATION_COMMENT="($(DISTRIBUTION))" \ -DMYSQL_SERVER_SUFFIX="-$(DEBVERSION)" \ -DSYSTEM_TYPE="debian-$(DEB_BUILD_GNU_SYSTEM)" \ -DINSTALL_LAYOUT=RPM \ -DINSTALL_LIBDIR=lib/$(DEB_HOST_MULTIARCH) \ -DINSTALL_PLUGINDIR=lib/mysql/plugin \ - -DWITH_EMBEDDED_SERVER=OFF \ - -DHAVE_EMBEDDED_PRIVILEGE_CONTROL=ON \ + -DWITH_EMBEDDED_SERVER=ON \ -DWITH_ARCHIVE_STORAGE_ENGINE=ON \ -DWITH_BLACKHOLE_STORAGE_ENGINE=ON \ -DWITH_FEDERATED_STORAGE_ENGINE=ON \ - -DWITH_WSREP=ON \ -DWITH_EXTRA_CHARSETS=all ..' touch $@ -#override_dh_auto_build: build-stamp build-pic-stamp override_dh_auto_build: build-stamp build-stamp: @@ -135,11 +118,13 @@ build-stamp: cd $(builddir) && $(MAKE) touch $@ -#build-pic-stamp: -# @echo "RULES.$@" -# cd $(builddir) && $(MAKE) -C scripts -# cd $(builddir) && $(MAKE) -C libmysqld -# touch $@ +build-pic-stamp: + # Don't call this section from dh_auto_build as + # linmysqld does not exsist in mysql-wsrep + @echo "RULES.$@" + cd $(builddir) && $(MAKE) -C scripts + cd $(builddir) && $(MAKE) -C libmysqld + touch $@ override_dh_auto_test: @echo "RULES.$@" @@ -148,7 +133,7 @@ ifeq ($(findstring nocheck,$(DEB_BUILD_OPTIONS)),) cp -r mysql-test/* $(builddir)/mysql-test/ cp -r sql/share/* $(builddir)/sql/share/ cp -r scripts/*sql $(builddir)/scripts/ - cd $(builddir) && $(MAKE) $(MAKE_TEST_TARGET) || $(TESTSUITE_FAIL_CMD) ; + cd $(builddir) && $(MAKE) $(MAKE_TEST_TARGET) || $(TESTSUITE_FAIL_CMD) ; endif override_dh_auto_install: auto_install-stamp @@ -159,55 +144,34 @@ auto_install-stamp: dh_testroot # make install (trailing slash needed for innobase) cd $(builddir) && $(MAKE) install DESTDIR=$(TMP)/ - # After installing, remove rpath to make lintian happy. - set +e; \ - find ./debian/tmp/ -type f -print0 \ - | xargs -0 --no-run-if-empty chrpath -k 2>/dev/null \ - | fgrep RPATH= \ - | cut -d: -f 1 \ - | xargs --no-run-if-empty chrpath -d; \ - set -e # install libmysqld built with -FPIC install -d -m 0755 -o root -g root $(TMP)/usr/lib/mysql - #install -m 0644 -o root -g root $(BUILDDIR_PIC)/libmysqld/libmysqld.a $(TMP)/usr/lib/mysql/libmysqld_pic.a - # mysql_config won't report the -fPIC, so give libmysqld-pic users a way to get their flags - #install -m 0755 -o root -g root $(BUILDDIR_PIC)/scripts/mysql_config $(TMP)/usr/bin/mysql_config_pic + # linmysqld does not exsist in mysql-wsrep + # install -m 0644 -o root -g root $(BUILDDIR_PIC)/libmysqld/libmysqld.a $(TMP)/usr/lib/mysql/libmysqld_pic.a + ## mysql_config won't report the -fPIC, so give libmysqld-pic users a way to get their flags + # install -m 0755 -o root -g root $(BUILDDIR_PIC)/scripts/mysql_config $(TMP)/usr/bin/mysql_config_pic mkdir -p $(TMP)/usr/share/doc/mysql-server-5.6 + install -m 0644 Docs/README-wsrep $(TMP)/usr/share/doc/mysql-server-5.6 nm -n $(BUILDDIR)/sql/mysqld |gzip -9 > $(TMP)/usr/share/doc/mysql-server-5.6/mysqld.sym.gz + install -m 0644 support-files/wsrep.cnf $(TMP)/usr/share/mysql # This seems to be the only safe place to fix permissions issues - # not handled by dh_fixperms. + # not handled by dh_fixperms. mkdir -p $(TMP)/etc/mysql/conf.d/ touch $(TMP)/etc/mysql/conf.d/.keepme + install -D -m 0755 $(builddir)/support-files/mysql.server $(TMP)/etc/init.d/mysql install -m 0755 debian/additions/echo_stderr $(TMP)/usr/share/mysql/ install -m 0755 debian/additions/debian-start $(TMP)/etc/mysql/ install -m 0755 debian/additions/debian-start.inc.sh $(TMP)/usr/share/mysql/ - #install -m 0644 debian/additions/mysql_config_pic.1 $(TMP)/usr/share/man/man1 - #install -m 0644 debian/additions/mysql_embedded.1 $(TMP)/usr/share/man/man1 + install -m 0644 debian/additions/mysql_config_pic.1 $(TMP)/usr/share/man/man1 + install -m 0644 debian/additions/mysql_embedded.1 $(TMP)/usr/share/man/man1 install -m 0644 debian/additions/debian_create_root_user.sql $(TMP)/usr/share/mysql/ # install AppArmor profile - #install -D -m 644 debian/apparmor-profile $(TMP)/etc/apparmor.d/usr.sbin.mysqld + install -D -m 644 debian/apparmor-profile $(TMP)/etc/apparmor.d/usr.sbin.mysqld chmod 0755 $(TMP)/usr/share/mysql-test/std_data/checkDBI_DBD-mysql.pl + # install Apport hook + install -D -m 644 debian/mysql-server-5.6.py $(TMP)/usr/share/apport/package-hooks/source_mysql-5.6.py # chmod 0644 $(TMP)/usr/share/mysql/*.ini - chmod 0644 $(TMP)/usr/share/mysql-test/[rt]/* - chmod 0644 $(TMP)/usr/share/mysql-test/collections/default.weekly - chmod 0644 $(TMP)/usr/share/mysql-test/suite/innodb/[rt]/* chmod 0644 $(TMP)/usr/bin/mysqlaccess.conf - # http://bugs.mysql.com/bug.php?id=68517 --- Some test and result files have executable bit set. - # removing execute bit from file permissions - chmod 0644 $(TMP)/usr/share/mysql-test/include/have_QC_Disabled.inc - chmod 0644 $(TMP)/usr/share/mysql-test/include/check_ipv4_mapped.inc - chmod 0644 $(TMP)/usr/share/mysql-test/include/start_mysqld.inc - chmod 0644 $(TMP)/usr/share/mysql-test/include/shutdown_mysqld.inc - chmod 0644 $(TMP)/usr/share/mysql-test/suite/ndb/t/ndb_show_tables_result.inc - chmod 0644 $(TMP)/usr/share/mysql-test/suite/parts/r/partition_exch_innodb.result - chmod 0644 $(TMP)/usr/share/mysql-test/suite/parts/r/partition_exch_myisam*.result - chmod 0644 $(TMP)/usr/share/mysql-test/suite/parts/r/partition_exch_qa*.result - chmod 0644 $(TMP)/usr/share/mysql-test/suite/sys_vars/r/sort_buffer_size_basic_32.result - chmod 0644 $(TMP)/usr/share/mysql/innodb_memcached_config.sql - # removing all redundant library links at debian/tmp/usr/lib/*/*_r* - rm $(TMP)/usr/lib/$(DEB_HOST_MULTIARCH)/*_r* - # getting rid of other extra files - rm -f $(TMP)/etc/mysql/conf.d/.keepme touch $@ # Use the --fail-missing to check for stuff that we should be installing @@ -245,19 +209,19 @@ auto_install-stamp: override_dh_installlogrotate-arch: dh_installlogrotate --name mysql-server - #dh_apparmor -pmysql-server-5.6 --profile-name=usr.sbin.mysqld - -override_dh_installchangelogs: - dh_installchangelogs Docs/ChangeLog + dh_apparmor -pmysql-server-5.6 --profile-name=usr.sbin.mysqld # Start mysql in runlevel 19 before 20 where apache, proftpd etc gets # started which might depend on a running database server. override_dh_installinit-arch: - dh_installinit --name=mysql --no-start -- defaults 19 21 + dh_installinit --name=mysql -- defaults 19 21 override_dh_installcron-arch: dh_installcron --name mysql-server +override_dh_strip: + @echo "Notice: not stripping debug symbols from any binaries" + binary: binary-indep binary-arch get-orig-source: @@ -265,4 +229,3 @@ get-orig-source: %: dh $@ --parallel - diff --git a/debian/tests/control b/debian/tests/control index 43c56510..ba148bb2 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -1,2 +1,3 @@ -Tests: upstream +Tests: smoke upstream Depends: mysql-testsuite-5.6 +Restrictions: allow-stderr needs-root breaks-testbed diff --git a/debian/tests/smoke b/debian/tests/smoke new file mode 100644 index 00000000..58afe8bb --- /dev/null +++ b/debian/tests/smoke @@ -0,0 +1,59 @@ +#!/bin/sh +set -ex + +# dep8 smoke test for mysql-server +# Author: Robie Basak +# +# This test should be declared in debian/tests/control with a dependency +# on the package that provides a configured MySQL server (eg. +# mysql-server-5.6). +# +# This test should be declared in debian/tests/control with the +# following restrictions: +# +# needs-root (needed to reset the root mysql password) +# breaks-testbed (because it resets the root mysql password) +# allow-stderr +# +# This test: +# +# 1) Configures packaged mysql server root password with maintainer +# scripts. +# +# 2) Creates a test database and test user as the root user. +# +# 3) Creates a test table and checks it appears to operate normally +# using the test user and test database. + +debconf-set-selections <&2 + exit 1 +fi + +mysql --user=testuser --password=testpassword testdatabase < $SKIP_TEST_LST << EOF binlog.binlog_server_start_options : Requires writable /usr +main.ctype_uca : Requires writable /usr EOF cd /usr/lib/mysql-testsuite diff --git a/mysql-wsrep-5.6/.gitignore b/mysql-wsrep-5.6/.gitignore deleted file mode 100644 index 8bbfde40..00000000 --- a/mysql-wsrep-5.6/.gitignore +++ /dev/null @@ -1,3139 +0,0 @@ -*-t -*_test -*.Plo -*.Po -*.a -*.bb -*.bbg -*.bin -*.cdf -*.core -*.d -*.da -*.dir -*.dll -*.dylib -*.exe -*.exp -*.gcda -*.gcno -*.gcov -*.idb -*.ilk -*.la -*.lai -*.lib -*.lo -*.manifest -*.map -*.o -*.obj -*.old -*.pch -*.pdb -*.reject -*.res -*.rule -*.sbr -*.so -*.so.* -*.spec -*.user -*.vcproj -*.vcproj.cmake -*.vcxproj -*.vcxproj.filters -*/*.dir/* -Debug -MySql.sdf -Win32 -*/*_pure_*warnings -*/.deps -*/.libs/* -*/.pure -*/debug/* -*/minsizerel/* -*/release/* -RelWithDebInfo -*~ -.*.swp -./CMakeCache.txt -./MySql.ncb -./MySql.sln -./MySql.suo -./README.build-files -./cmakecache.txt -./config.h -./copy_mysql_files.bat -./fix-project-files -./mysql*.ds? -./mysql.ncb -./mysql.sln -./mysql.suo -./prepare -.DS_Store -.defs.mk -.depend -.depend.mk -.deps -.gdb_history -.gdbinit -.libs -.o -.out -.snprj/* -.vimrc -50 -=6 -BUILD/compile-pentium-maintainer -BitKeeper/etc/RESYNC_TREE -BitKeeper/etc/config -BitKeeper/etc/csets -BitKeeper/etc/csets-in -BitKeeper/etc/csets-out -BitKeeper/etc/gone -BitKeeper/etc/level -BitKeeper/etc/pushed -BitKeeper/post-commit -BitKeeper/post-commit-manual -BitKeeper/tmp/* -BitKeeper/tmp/bkr3sAHD -BitKeeper/tmp/gone -CMakeFiles -CMakeFiles/* -CTestTestfile.cmake -COPYING -COPYING.LIB -Docs/#manual.texi# -Docs/INSTALL-BINARY -Docs/Images/myaccess-odbc.txt -Docs/Images/myaccess.txt -Docs/Images/myarchitecture.txt -Docs/Images/mydll-properties.txt -Docs/Images/mydsn-example.txt -Docs/Images/mydsn-icon.txt -Docs/Images/mydsn-options.txt -Docs/Images/mydsn-setup.txt -Docs/Images/mydsn-test-fail.txt -Docs/Images/mydsn-test-success.txt -Docs/Images/mydsn-trace.txt -Docs/Images/mydsn.txt -Docs/Images/myflowchart.txt -Docs/include.texi -Docs/internals.html -Docs/internals.info -Docs/internals.pdf -Docs/internals.txt -Docs/internals_toc.html -Docs/manual.aux -Docs/manual.cp -Docs/manual.cps -Docs/manual.de.log -Docs/manual.dvi -Docs/manual.fn -Docs/manual.fns -Docs/manual.html -Docs/manual.ky -Docs/manual.log -Docs/manual.pdf -Docs/manual.pg -Docs/manual.texi.orig -Docs/manual.texi.rej -Docs/manual.toc -Docs/manual.tp -Docs/manual.txt -Docs/manual.vr -Docs/manual_a4.ps -Docs/manual_letter.ps -Docs/manual_toc.html -Docs/my_sys.doc -Docs/mysql.info -Docs/mysql.xml -Docs/safe-mysql.xml -Docs/tex.fmt -Docs/texi2dvi.out -EXCEPTIONS-CLIENT -INSTALL-SOURCE -INSTALL-WIN-SOURCE -Logs/* -MIRRORS -Makefile -Makefile.in -Makefile.in' -PENDING/* -scripts/scripts -TAGS -VC++Files/client/mysql_amd64.dsp -ac_available_languages_fragment -acinclude.m4 -aclocal.m4 -analyse.test -autom4te-2.53.cache/* -autom4te-2.53.cache/output.0 -autom4te-2.53.cache/requests -autom4te-2.53.cache/traces.0 -autom4te.cache/* -autom4te.cache/output.0 -autom4te.cache/requests -autom4te.cache/traces.0 -bdb/*.ds? -bdb/*.vcproj -bdb/README -bdb/btree/btree_auto.c -bdb/build_unix/* -bdb/build_vxworks/db.h -bdb/build_vxworks/db_int.h -bdb/build_win32/db.h -bdb/build_win32/db_archive.dsp -bdb/build_win32/db_checkpoint.dsp -bdb/build_win32/db_config.h -bdb/build_win32/db_cxx.h -bdb/build_win32/db_deadlock.dsp -bdb/build_win32/db_dll.dsp -bdb/build_win32/db_dump.dsp -bdb/build_win32/db_int.h -bdb/build_win32/db_java.dsp -bdb/build_win32/db_load.dsp -bdb/build_win32/db_perf.dsp -bdb/build_win32/db_printlog.dsp -bdb/build_win32/db_recover.dsp -bdb/build_win32/db_stat.dsp -bdb/build_win32/db_static.dsp -bdb/build_win32/db_tcl.dsp -bdb/build_win32/db_test.dsp -bdb/build_win32/db_upgrade.dsp -bdb/build_win32/db_verify.dsp -bdb/build_win32/ex_access.dsp -bdb/build_win32/ex_btrec.dsp -bdb/build_win32/ex_env.dsp -bdb/build_win32/ex_lock.dsp -bdb/build_win32/ex_mpool.dsp -bdb/build_win32/ex_tpcb.dsp -bdb/build_win32/excxx_access.dsp -bdb/build_win32/excxx_btrec.dsp -bdb/build_win32/excxx_env.dsp -bdb/build_win32/excxx_lock.dsp -bdb/build_win32/excxx_mpool.dsp -bdb/build_win32/excxx_tpcb.dsp -bdb/build_win32/include.tcl -bdb/build_win32/libdb.def -bdb/build_win32/libdb.rc -bdb/db/crdel_auto.c -bdb/db/db_auto.c -bdb/dbinc_auto/*.* -bdb/dbreg/dbreg_auto.c -bdb/dist/autom4te-2.53.cache/* -bdb/dist/autom4te-2.53.cache/output.0 -bdb/dist/autom4te-2.53.cache/requests -bdb/dist/autom4te-2.53.cache/traces.0 -bdb/dist/autom4te.cache/* -bdb/dist/autom4te.cache/output.0 -bdb/dist/autom4te.cache/requests -bdb/dist/autom4te.cache/traces.0 -bdb/dist/config.hin -bdb/dist/configure -bdb/dist/db.h -bdb/dist/db_config.h -bdb/dist/db_cxx.h -bdb/dist/db_int.h -bdb/dist/include.tcl -bdb/dist/tags -bdb/dist/template/db_server_proc -bdb/dist/template/gen_client_ret -bdb/dist/template/rec_btree -bdb/dist/template/rec_crdel -bdb/dist/template/rec_db -bdb/dist/template/rec_dbreg -bdb/dist/template/rec_fileops -bdb/dist/template/rec_hash -bdb/dist/template/rec_log -bdb/dist/template/rec_qam -bdb/dist/template/rec_txn -bdb/examples_c/ex_apprec/ex_apprec_auto.c -bdb/examples_c/ex_apprec/ex_apprec_auto.h -bdb/examples_c/ex_apprec/ex_apprec_template -bdb/examples_java -bdb/fileops/fileops_auto.c -bdb/hash/hash_auto.c -bdb/include/btree_auto.h -bdb/include/btree_ext.h -bdb/include/clib_ext.h -bdb/include/common_ext.h -bdb/include/crdel_auto.h -bdb/include/db_auto.h -bdb/include/db_ext.h -bdb/include/db_server.h -bdb/include/env_ext.h -bdb/include/gen_client_ext.h -bdb/include/gen_server_ext.h -bdb/include/hash_auto.h -bdb/include/hash_ext.h -bdb/include/lock_ext.h -bdb/include/log_auto.h -bdb/include/log_ext.h -bdb/include/mp_ext.h -bdb/include/mutex_ext.h -bdb/include/os_ext.h -bdb/include/qam_auto.h -bdb/include/qam_ext.h -bdb/include/rpc_client_ext.h -bdb/include/rpc_server_ext.h -bdb/include/tcl_ext.h -bdb/include/txn_auto.h -bdb/include/txn_ext.h -bdb/include/xa_ext.h -bdb/java/src/com/sleepycat/db/Db.java -bdb/java/src/com/sleepycat/db/DbBtreeStat.java -bdb/java/src/com/sleepycat/db/DbConstants.java -bdb/java/src/com/sleepycat/db/DbHashStat.java -bdb/java/src/com/sleepycat/db/DbLockStat.java -bdb/java/src/com/sleepycat/db/DbLogStat.java -bdb/java/src/com/sleepycat/db/DbMpoolFStat.java -bdb/java/src/com/sleepycat/db/DbQueueStat.java -bdb/java/src/com/sleepycat/db/DbRepStat.java -bdb/java/src/com/sleepycat/db/DbTxnStat.java -bdb/libdb_java/java_stat_auto.c -bdb/libdb_java/java_stat_auto.h -bdb/log/log_auto.c -bdb/qam/qam_auto.c -bdb/rpc_client/db_server_clnt.c -bdb/rpc_client/gen_client.c -bdb/rpc_server/c/db_server_proc.c -bdb/rpc_server/c/db_server_proc.sed -bdb/rpc_server/c/db_server_svc.c -bdb/rpc_server/c/db_server_xdr.c -bdb/rpc_server/c/gen_db_server.c -bdb/rpc_server/db_server.x -bdb/rpc_server/db_server_proc.sed -bdb/rpc_server/db_server_svc.c -bdb/rpc_server/db_server_xdr.c -bdb/rpc_server/gen_db_server.c -bdb/test/TESTS -bdb/test/include.tcl -bdb/test/logtrack.list -bdb/txn/txn_auto.c -binary/* -bkpull.log -bkpull.log* -bkpull.log.2 -bkpull.log.3 -bkpull.log.4 -bkpull.log.5 -bkpull.log.6 -bkpush.log -bkpush.log* -build.log -build_tags.sh -client/#mysql.cc# -client/*.ds? -client/*.vcproj -client/.deps/base64.Po -client/.deps/completion_hash.Po -client/.deps/dummy.Po -client/.deps/mf_tempdir.Po -client/.deps/my_bit.Po -client/.deps/my_bitmap.Po -client/.deps/my_getsystime.Po -client/.deps/my_new.Po -client/.deps/my_user.Po -client/.deps/my_vle.Po -client/.deps/mysql.Po -client/.deps/mysql_upgrade.Po -client/.deps/mysqladmin.Po -client/.deps/mysqlbinlog.Po -client/.deps/mysqlcheck.Po -client/.deps/mysqldump.Po -client/.deps/mysqlimport.Po -client/.deps/mysqlshow.Po -client/.deps/mysqlslap.Po -client/.deps/mysqltest.Po -client/.deps/readline.Po -client/.deps/sql_string.Po -client/.libs -prune -client/.libs/lt-mysql -client/.libs/lt-mysqladmin -client/.libs/lt-mysqlbinlog -client/.libs/lt-mysqlcheck -client/.libs/lt-mysqldump -client/.libs/lt-mysqlimport -client/.libs/lt-mysqlshow -client/.libs/lt-mysqlslap -client/.libs/lt-mysqltest -client/.libs/mysql -client/.libs/mysql_upgrade -client/.libs/mysqladmin -client/.libs/mysqlbinlog -client/.libs/mysqlcheck -client/.libs/mysqldump -client/.libs/mysqlimport -client/.libs/mysqlshow -client/.libs/mysqlslap -client/.libs/mysqltest -client/completion_hash.cpp -client/decimal.c -client/insert_test -client/link_sources -client/log_event.cc -client/log_event.h -client/log_event_old.cc -client/log_event_old.h -client/mf_iocache.c -client/mf_iocache.cc -client/my_decimal.cc -client/my_decimal.h -client/my_user.c -client/mysql -client/mysql.cpp -client/mysql_config_editor -client/mysql_upgrade -client/mysqladmin -client/mysqladmin.c -client/mysqladmin.cpp -client/mysqlbinlog -client/mysqlbinlog.cpp -client/mysqlcheck -client/mysqldump -client/mysqlimport -client/mysqlmanager-pwgen -client/mysqlmanagerc -client/mysqlshow -client/mysqlslap -client/mysqltest -client/mysqltestmanager-pwgen -client/mysqltestmanagerc -client/mysys_priv.h -client/readline.cpp -client/rpl_constants.h -client/rpl_record_old.cc -client/rpl_record_old.h -client/rpl_tblmap.h -client/rpl_tblmap.cc -client/rpl_utility.h -client/rpl_utility.cc -client/select_test -client/sql_const.h -client/sql_string.cpp -client/ssl_test -client/thimble -client/thread_test -client/tmp.diff -client_debug/* -client_release/* -client_test -cmake_install.cmake -cmd-line-utils/libedit/.deps/chared.Po -cmd-line-utils/libedit/.deps/common.Po -cmd-line-utils/libedit/.deps/el.Po -cmd-line-utils/libedit/.deps/emacs.Po -cmd-line-utils/libedit/.deps/fcns.Po -cmd-line-utils/libedit/.deps/fgetln.Po -cmd-line-utils/libedit/.deps/help.Po -cmd-line-utils/libedit/.deps/hist.Po -cmd-line-utils/libedit/.deps/history.Po -cmd-line-utils/libedit/.deps/key.Po -cmd-line-utils/libedit/.deps/map.Po -cmd-line-utils/libedit/.deps/parse.Po -cmd-line-utils/libedit/.deps/prompt.Po -cmd-line-utils/libedit/.deps/read.Po -cmd-line-utils/libedit/.deps/readline.Po -cmd-line-utils/libedit/.deps/refresh.Po -cmd-line-utils/libedit/.deps/search.Po -cmd-line-utils/libedit/.deps/sig.Po -cmd-line-utils/libedit/.deps/strlcat.Po -cmd-line-utils/libedit/.deps/strlcpy.Po -cmd-line-utils/libedit/.deps/term.Po -cmd-line-utils/libedit/.deps/tokenizer.Po -cmd-line-utils/libedit/.deps/tty.Po -cmd-line-utils/libedit/.deps/unvis.Po -cmd-line-utils/libedit/.deps/vi.Po -cmd-line-utils/libedit/.deps/vis.Po -cmd-line-utils/libedit/common.h -cmd-line-utils/libedit/makelist -cmd-line-utils/readline/.deps/bind.Po -cmd-line-utils/readline/.deps/callback.Po -cmd-line-utils/readline/.deps/compat.Po -cmd-line-utils/readline/.deps/complete.Po -cmd-line-utils/readline/.deps/display.Po -cmd-line-utils/readline/.deps/funmap.Po -cmd-line-utils/readline/.deps/histexpand.Po -cmd-line-utils/readline/.deps/histfile.Po -cmd-line-utils/readline/.deps/history.Po -cmd-line-utils/readline/.deps/histsearch.Po -cmd-line-utils/readline/.deps/input.Po -cmd-line-utils/readline/.deps/isearch.Po -cmd-line-utils/readline/.deps/keymaps.Po -cmd-line-utils/readline/.deps/kill.Po -cmd-line-utils/readline/.deps/macro.Po -cmd-line-utils/readline/.deps/mbutil.Po -cmd-line-utils/readline/.deps/misc.Po -cmd-line-utils/readline/.deps/nls.Po -cmd-line-utils/readline/.deps/parens.Po -cmd-line-utils/readline/.deps/readline.Po -cmd-line-utils/readline/.deps/rltty.Po -cmd-line-utils/readline/.deps/savestring.Po -cmd-line-utils/readline/.deps/search.Po -cmd-line-utils/readline/.deps/shell.Po -cmd-line-utils/readline/.deps/signals.Po -cmd-line-utils/readline/.deps/terminal.Po -cmd-line-utils/readline/.deps/text.Po -cmd-line-utils/readline/.deps/tilde.Po -cmd-line-utils/readline/.deps/undo.Po -cmd-line-utils/readline/.deps/util.Po -cmd-line-utils/readline/.deps/vi_mode.Po -cmd-line-utils/readline/.deps/xmalloc.Po -comon.h -comp_err/*.ds? -comp_err/*.vcproj -compile -config.cache -config.guess -config.h -config.h.in -config.log -config.status -config.sub -configure -configure.lineno -contrib/*.ds? -contrib/*.vcproj -core -core.* -cscope.in.out -cscope.out -cscope.po.out -db-*.*.* -dbug/*.ds? -dbug/*.vcproj -dbug/.deps/dbug.Po -dbug/.deps/dbug_analyze.Po -dbug/.deps/factorial.Po -dbug/.deps/my_main.Po -dbug/.deps/sanity.Po -dbug/dbug_analyze -dbug/example*.r -dbug/factorial -dbug/factorial.r -dbug/main.r -dbug/output*.r -dbug/user.ps -dbug/user.t -debian/control -debian/defs.mk -depcomp -emacs.h -examples/*.ds? -examples/*.vcproj -examples/udf_example/udf_example.def -extra/.deps/comp_err.Po -extra/.deps/innochecksum.Po -extra/.deps/my_print_defaults.Po -extra/.deps/mysql_waitpid.Po -extra/.deps/perror.Po -extra/.deps/replace.Po -extra/.deps/resolve_stack_dump.Po -extra/.deps/resolveip.Po -extra/comp_err -extra/created_include_files -extra/innochecksum -extra/my_print_defaults -extra/mysql_install -extra/mysql_tzinfo_to_sql -extra/mysql_waitpid -extra/mysqld_ername.h -extra/mysqld_error.h -extra/perror -extra/replace -extra/resolve_stack_dump -extra/resolveip -extra/sql_state.h -extra/tztime.cc -extra/yassl/src/.deps/buffer.Plo -extra/yassl/src/.deps/cert_wrapper.Plo -extra/yassl/src/.deps/crypto_wrapper.Plo -extra/yassl/src/.deps/handshake.Plo -extra/yassl/src/.deps/lock.Plo -extra/yassl/src/.deps/log.Plo -extra/yassl/src/.deps/socket_wrapper.Plo -extra/yassl/src/.deps/ssl.Plo -extra/yassl/src/.deps/template_instnt.Plo -extra/yassl/src/.deps/timer.Plo -extra/yassl/src/.deps/yassl_error.Plo -extra/yassl/src/.deps/yassl_imp.Plo -extra/yassl/src/.deps/yassl_int.Plo -extra/yassl/taocrypt/benchmark/.deps/benchmark-benchmark.Po -extra/yassl/taocrypt/benchmark/benchmark -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-aes.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-aestables.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-algebra.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-arc4.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-asn.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-bftables.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-blowfish.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-coding.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-des.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-dh.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-dsa.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-file.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-hash.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-integer.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-md2.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-md4.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-md5.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-misc.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-random.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-ripemd.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-rsa.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-sha.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-template_instnt.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-tftables.Plo -extra/yassl/taocrypt/src/.deps/libtaocrypt_la-twofish.Plo -extra/yassl/taocrypt/test/.deps/test-test.Po -extra/yassl/taocrypt/test/test -extra/yassl/testsuite/.deps/testsuite-client.Po -extra/yassl/testsuite/.deps/testsuite-echoclient.Po -extra/yassl/testsuite/.deps/testsuite-echoserver.Po -extra/yassl/testsuite/.deps/testsuite-server.Po -extra/yassl/testsuite/.deps/testsuite-test.Po -extra/yassl/testsuite/.deps/testsuite-testsuite.Po -extra/yassl/testsuite/testsuite -fcns.c -fcns.h -gdbinit -gmon.out -hardcopy.0 -heap/*.ds? -heap/*.vcproj -heap/hp_test1 -heap/hp_test2 -help -help.c -help.h -include/abi_check -include/check_abi -include/link_sources -include/my_config.h -include/my_global.h -include/mysql_h.ic -include/mysql_version.h -include/mysqld_ername.h -include/mysqld_error.h -include/mysqld_error.h.rule -include/openssl -include/probes_mysql_dtrace.h -include/readline -include/readline/*.h -include/readline/readline.h -include/sql_state.h -include/widec.h -innobase/*.ds? -innobase/*.vcproj -innobase/autom4te-2.53.cache/* -innobase/autom4te-2.53.cache/output.0 -innobase/autom4te-2.53.cache/requests -innobase/autom4te-2.53.cache/traces.0 -innobase/autom4te.cache/* -innobase/autom4te.cache/output.0 -innobase/autom4te.cache/requests -innobase/autom4te.cache/traces.0 -innobase/configure.lineno -innobase/conftest.s1 -innobase/conftest.subs -innobase/ib_config.h -innobase/ib_config.h.in -innobase/mkinstalldirs -innobase/stamp-h1 -insert_test -install -install-sh -isam/*.ds? -isam/*.vcproj -isam/isamchk -isam/isamlog -isam/pack_isam -isam/test1 -isam/test2 -isam/test3 -isamchk/*.ds? -isamchk/*.vcproj -item_xmlfunc.cc -lib_debug/* -lib_release/* -libmysql/*.c -libmysql/*.ds? -libmysql/*.vcproj -libmysql/.deps/array.Plo -libmysql/.deps/bchange.Plo -libmysql/.deps/bcmp.Plo -libmysql/.deps/bmove.Plo -libmysql/.deps/bmove_upp.Plo -libmysql/.deps/charset-def.Plo -libmysql/.deps/charset.Plo -libmysql/.deps/client.Plo -libmysql/.deps/conf_to_src.Po -libmysql/.deps/ctype-big5.Plo -libmysql/.deps/ctype-bin.Plo -libmysql/.deps/ctype-cp932.Plo -libmysql/.deps/ctype-czech.Plo -libmysql/.deps/ctype-euc_kr.Plo -libmysql/.deps/ctype-eucjpms.Plo -libmysql/.deps/ctype-extra.Plo -libmysql/.deps/ctype-gb2312.Plo -libmysql/.deps/ctype-gbk.Plo -libmysql/.deps/ctype-latin1.Plo -libmysql/.deps/ctype-mb.Plo -libmysql/.deps/ctype-simple.Plo -libmysql/.deps/ctype-sjis.Plo -libmysql/.deps/ctype-tis620.Plo -libmysql/.deps/ctype-uca.Plo -libmysql/.deps/ctype-ucs2.Plo -libmysql/.deps/ctype-ujis.Plo -libmysql/.deps/ctype-utf8.Plo -libmysql/.deps/ctype-win1250ch.Plo -libmysql/.deps/ctype.Plo -libmysql/.deps/dbug.Plo -libmysql/.deps/default.Plo -libmysql/.deps/default_modify.Plo -libmysql/.deps/errmsg.Plo -libmysql/.deps/errors.Plo -libmysql/.deps/get_password.Plo -libmysql/.deps/hash.Plo -libmysql/.deps/int2str.Plo -libmysql/.deps/is_prefix.Plo -libmysql/.deps/libmysql.Plo -libmysql/.deps/list.Plo -libmysql/.deps/llstr.Plo -libmysql/.deps/longlong2str.Plo -libmysql/.deps/manager.Plo -libmysql/.deps/md5.Plo -libmysql/.deps/mf_cache.Plo -libmysql/.deps/mf_dirname.Plo -libmysql/.deps/mf_fn_ext.Plo -libmysql/.deps/mf_format.Plo -libmysql/.deps/mf_iocache.Plo -libmysql/.deps/mf_iocache2.Plo -libmysql/.deps/mf_loadpath.Plo -libmysql/.deps/mf_pack.Plo -libmysql/.deps/mf_path.Plo -libmysql/.deps/mf_tempfile.Plo -libmysql/.deps/mf_unixpath.Plo -libmysql/.deps/mf_wcomp.Plo -libmysql/.deps/mulalloc.Plo -libmysql/.deps/my_alloc.Plo -libmysql/.deps/my_chsize.Plo -libmysql/.deps/my_compress.Plo -libmysql/.deps/my_create.Plo -libmysql/.deps/my_delete.Plo -libmysql/.deps/my_div.Plo -libmysql/.deps/my_error.Plo -libmysql/.deps/my_file.Plo -libmysql/.deps/my_fopen.Plo -libmysql/.deps/my_fstream.Plo -libmysql/.deps/my_gethostbyname.Plo -libmysql/.deps/my_getopt.Plo -libmysql/.deps/my_getwd.Plo -libmysql/.deps/my_init.Plo -libmysql/.deps/my_lib.Plo -libmysql/.deps/my_malloc.Plo -libmysql/.deps/my_messnc.Plo -libmysql/.deps/my_net.Plo -libmysql/.deps/my_once.Plo -libmysql/.deps/my_open.Plo -libmysql/.deps/my_port.Plo -libmysql/.deps/my_pread.Plo -libmysql/.deps/my_pthread.Plo -libmysql/.deps/my_read.Plo -libmysql/.deps/my_realloc.Plo -libmysql/.deps/my_rename.Plo -libmysql/.deps/my_seek.Plo -libmysql/.deps/my_sleep.Plo -libmysql/.deps/my_static.Plo -libmysql/.deps/my_strtoll10.Plo -libmysql/.deps/my_symlink.Plo -libmysql/.deps/my_thr_init.Plo -libmysql/.deps/my_time.Plo -libmysql/.deps/my_vsnprintf.Plo -libmysql/.deps/my_write.Plo -libmysql/.deps/net.Plo -libmysql/.deps/pack.Plo -libmysql/.deps/password.Plo -libmysql/.deps/safemalloc.Plo -libmysql/.deps/sha1.Plo -libmysql/.deps/str2int.Plo -libmysql/.deps/str_alloc.Plo -libmysql/.deps/strcend.Plo -libmysql/.deps/strcont.Plo -libmysql/.deps/strend.Plo -libmysql/.deps/strfill.Plo -libmysql/.deps/string.Plo -libmysql/.deps/strinstr.Plo -libmysql/.deps/strmake.Plo -libmysql/.deps/strmov.Plo -libmysql/.deps/strnlen.Plo -libmysql/.deps/strnmov.Plo -libmysql/.deps/strtod.Plo -libmysql/.deps/strtoll.Plo -libmysql/.deps/strtoull.Plo -libmysql/.deps/strxmov.Plo -libmysql/.deps/strxnmov.Plo -libmysql/.deps/thr_mutex.Plo -libmysql/.deps/typelib.Plo -libmysql/.deps/vio.Plo -libmysql/.deps/viosocket.Plo -libmysql/.deps/viossl.Plo -libmysql/.deps/viosslfactories.Plo -libmysql/.deps/xml.Plo -libmysql/.libs/libmysqlclient.lai -libmysql/.libs/libmysqlclient.so.15 -libmysql/.libs/libmysqlclient.so.15.0.0 -libmysql/conf_to_src -libmysql/debug/libmysql.exp -libmysql/libmysql.ver -libmysql/link_sources -libmysql/my_static.h -libmysql/my_time.c -libmysql/mysys_priv.h -libmysql/net.c -libmysql/release/libmysql.exp -libmysql/vio_priv.h -libmysql/viosocket.o.6WmSJk -libmysql_r/*.c -libmysql_r/.deps/array.Plo -libmysql_r/.deps/bchange.Plo -libmysql_r/.deps/bcmp.Plo -libmysql_r/.deps/bmove.Plo -libmysql_r/.deps/bmove_upp.Plo -libmysql_r/.deps/charset-def.Plo -libmysql_r/.deps/charset.Plo -libmysql_r/.deps/client.Plo -libmysql_r/.deps/conf_to_src.Po -libmysql_r/.deps/ctype-big5.Plo -libmysql_r/.deps/ctype-bin.Plo -libmysql_r/.deps/ctype-cp932.Plo -libmysql_r/.deps/ctype-czech.Plo -libmysql_r/.deps/ctype-euc_kr.Plo -libmysql_r/.deps/ctype-eucjpms.Plo -libmysql_r/.deps/ctype-extra.Plo -libmysql_r/.deps/ctype-gb2312.Plo -libmysql_r/.deps/ctype-gbk.Plo -libmysql_r/.deps/ctype-latin1.Plo -libmysql_r/.deps/ctype-mb.Plo -libmysql_r/.deps/ctype-simple.Plo -libmysql_r/.deps/ctype-sjis.Plo -libmysql_r/.deps/ctype-tis620.Plo -libmysql_r/.deps/ctype-uca.Plo -libmysql_r/.deps/ctype-ucs2.Plo -libmysql_r/.deps/ctype-ujis.Plo -libmysql_r/.deps/ctype-utf8.Plo -libmysql_r/.deps/ctype-win1250ch.Plo -libmysql_r/.deps/ctype.Plo -libmysql_r/.deps/dbug.Plo -libmysql_r/.deps/default.Plo -libmysql_r/.deps/default_modify.Plo -libmysql_r/.deps/errmsg.Plo -libmysql_r/.deps/errors.Plo -libmysql_r/.deps/get_password.Plo -libmysql_r/.deps/hash.Plo -libmysql_r/.deps/int2str.Plo -libmysql_r/.deps/is_prefix.Plo -libmysql_r/.deps/libmysql.Plo -libmysql_r/.deps/list.Plo -libmysql_r/.deps/llstr.Plo -libmysql_r/.deps/longlong2str.Plo -libmysql_r/.deps/manager.Plo -libmysql_r/.deps/md5.Plo -libmysql_r/.deps/mf_cache.Plo -libmysql_r/.deps/mf_dirname.Plo -libmysql_r/.deps/mf_fn_ext.Plo -libmysql_r/.deps/mf_format.Plo -libmysql_r/.deps/mf_iocache.Plo -libmysql_r/.deps/mf_iocache2.Plo -libmysql_r/.deps/mf_loadpath.Plo -libmysql_r/.deps/mf_pack.Plo -libmysql_r/.deps/mf_path.Plo -libmysql_r/.deps/mf_tempfile.Plo -libmysql_r/.deps/mf_unixpath.Plo -libmysql_r/.deps/mf_wcomp.Plo -libmysql_r/.deps/mulalloc.Plo -libmysql_r/.deps/my_alloc.Plo -libmysql_r/.deps/my_chsize.Plo -libmysql_r/.deps/my_compress.Plo -libmysql_r/.deps/my_create.Plo -libmysql_r/.deps/my_delete.Plo -libmysql_r/.deps/my_div.Plo -libmysql_r/.deps/my_error.Plo -libmysql_r/.deps/my_file.Plo -libmysql_r/.deps/my_fopen.Plo -libmysql_r/.deps/my_fstream.Plo -libmysql_r/.deps/my_gethostbyname.Plo -libmysql_r/.deps/my_getopt.Plo -libmysql_r/.deps/my_getwd.Plo -libmysql_r/.deps/my_init.Plo -libmysql_r/.deps/my_lib.Plo -libmysql_r/.deps/my_malloc.Plo -libmysql_r/.deps/my_messnc.Plo -libmysql_r/.deps/my_net.Plo -libmysql_r/.deps/my_once.Plo -libmysql_r/.deps/my_open.Plo -libmysql_r/.deps/my_port.Plo -libmysql_r/.deps/my_pread.Plo -libmysql_r/.deps/my_pthread.Plo -libmysql_r/.deps/my_read.Plo -libmysql_r/.deps/my_realloc.Plo -libmysql_r/.deps/my_rename.Plo -libmysql_r/.deps/my_seek.Plo -libmysql_r/.deps/my_sleep.Plo -libmysql_r/.deps/my_static.Plo -libmysql_r/.deps/my_strtoll10.Plo -libmysql_r/.deps/my_symlink.Plo -libmysql_r/.deps/my_thr_init.Plo -libmysql_r/.deps/my_time.Plo -libmysql_r/.deps/my_vsnprintf.Plo -libmysql_r/.deps/my_write.Plo -libmysql_r/.deps/net.Plo -libmysql_r/.deps/pack.Plo -libmysql_r/.deps/password.Plo -libmysql_r/.deps/safemalloc.Plo -libmysql_r/.deps/sha1.Plo -libmysql_r/.deps/str2int.Plo -libmysql_r/.deps/str_alloc.Plo -libmysql_r/.deps/strcend.Plo -libmysql_r/.deps/strcont.Plo -libmysql_r/.deps/strend.Plo -libmysql_r/.deps/strfill.Plo -libmysql_r/.deps/string.Plo -libmysql_r/.deps/strinstr.Plo -libmysql_r/.deps/strmake.Plo -libmysql_r/.deps/strmov.Plo -libmysql_r/.deps/strnlen.Plo -libmysql_r/.deps/strnmov.Plo -libmysql_r/.deps/strtod.Plo -libmysql_r/.deps/strtoll.Plo -libmysql_r/.deps/strtoull.Plo -libmysql_r/.deps/strxmov.Plo -libmysql_r/.deps/strxnmov.Plo -libmysql_r/.deps/thr_mutex.Plo -libmysql_r/.deps/typelib.Plo -libmysql_r/.deps/vio.Plo -libmysql_r/.deps/viosocket.Plo -libmysql_r/.deps/viossl.Plo -libmysql_r/.deps/viosslfactories.Plo -libmysql_r/.deps/xml.Plo -libmysql_r/.libs/libmysqlclient_r.lai -libmysql_r/.libs/libmysqlclient_r.so.15 -libmysql_r/.libs/libmysqlclient_r.so.15.0.0 -libmysql_r/acconfig.h -libmysql_r/client_settings.h -libmysql_r/conf_to_src -libmysql_r/link_sources -libmysql_r/my_static.h -libmysql_r/mysys_priv.h -libmysql_r/vio_priv.h -libmysqld/*.ds? -libmysqld/*.vcproj -libmysqld/.deps/client.Po -libmysqld/.deps/derror.Po -libmysqld/.deps/discover.Po -libmysqld/.deps/emb_qcache.Po -libmysqld/.deps/errmsg.Po -libmysqld/.deps/event_data_objects.Po -libmysqld/.deps/event_db_repository.Po -libmysqld/.deps/event_queue.Po -libmysqld/.deps/event_scheduler.Po -libmysqld/.deps/events.Po -libmysqld/.deps/field.Po -libmysqld/.deps/field_conv.Po -libmysqld/.deps/filesort.Po -libmysqld/.deps/get_password.Po -libmysqld/.deps/gstream.Po -libmysqld/.deps/ha_berkeley.Po -libmysqld/.deps/ha_federated.Po -libmysqld/.deps/ha_heap.Po -libmysqld/.deps/ha_innodb.Po -libmysqld/.deps/ha_myisam.Po -libmysqld/.deps/ha_myisammrg.Po -libmysqld/.deps/ha_ndbcluster.Po -libmysqld/.deps/ha_ndbcluster_binlog.Po -libmysqld/.deps/ha_partition.Po -libmysqld/.deps/handler.Po -libmysqld/.deps/hash_filo.Po -libmysqld/.deps/hostname.Po -libmysqld/.deps/init.Po -libmysqld/.deps/item.Po -libmysqld/.deps/item_buff.Po -libmysqld/.deps/item_cmpfunc.Po -libmysqld/.deps/item_create.Po -libmysqld/.deps/item_func.Po -libmysqld/.deps/item_geofunc.Po -libmysqld/.deps/item_row.Po -libmysqld/.deps/item_strfunc.Po -libmysqld/.deps/item_subselect.Po -libmysqld/.deps/item_sum.Po -libmysqld/.deps/item_timefunc.Po -libmysqld/.deps/item_uniq.Po -libmysqld/.deps/item_xmlfunc.Po -libmysqld/.deps/key.Po -libmysqld/.deps/lib_sql.Po -libmysqld/.deps/libmysql.Po -libmysqld/.deps/libmysqld.Po -libmysqld/.deps/lock.Po -libmysqld/.deps/log.Po -libmysqld/.deps/log_event.Po -libmysqld/.deps/my_decimal.Po -libmysqld/.deps/my_time.Po -libmysqld/.deps/my_user.Po -libmysqld/.deps/net_serv.Po -libmysqld/.deps/opt_range.Po -libmysqld/.deps/opt_sum.Po -libmysqld/.deps/pack.Po -libmysqld/.deps/parse_file.Po -libmysqld/.deps/partition_info.Po -libmysqld/.deps/password.Po -libmysqld/.deps/procedure.Po -libmysqld/.deps/protocol.Po -libmysqld/.deps/records.Po -libmysqld/.deps/rpl_filter.Po -libmysqld/.deps/rpl_injector.Po -libmysqld/.deps/set_var.Po -libmysqld/.deps/sp.Po -libmysqld/.deps/sp_cache.Po -libmysqld/.deps/sp_head.Po -libmysqld/.deps/sp_pcontext.Po -libmysqld/.deps/sp_rcontext.Po -libmysqld/.deps/spatial.Po -libmysqld/.deps/sql_acl.Po -libmysqld/.deps/sql_analyse.Po -libmysqld/.deps/sql_base.Po -libmysqld/.deps/sql_builtin.Po -libmysqld/.deps/sql_cache.Po -libmysqld/.deps/sql_class.Po -libmysqld/.deps/sql_crypt.Po -libmysqld/.deps/sql_cursor.Po -libmysqld/.deps/sql_db.Po -libmysqld/.deps/sql_delete.Po -libmysqld/.deps/sql_truncate.Po -libmysqld/.deps/sql_reload.Po -libmysqld/.deps/datadict.Po -libmysqld/.deps/sql_derived.Po -libmysqld/.deps/sql_do.Po -libmysqld/.deps/sql_error.Po -libmysqld/.deps/sql_handler.Po -libmysqld/.deps/sql_help.Po -libmysqld/.deps/sql_insert.Po -libmysqld/.deps/sql_lex.Po -libmysqld/.deps/sql_list.Po -libmysqld/.deps/sql_load.Po -libmysqld/.deps/sql_manager.Po -libmysqld/.deps/sql_map.Po -libmysqld/.deps/sql_parse.Po -libmysqld/.deps/sql_partition.Po -libmysqld/.deps/sql_plugin.Po -libmysqld/.deps/sql_prepare.Po -libmysqld/.deps/sql_rename.Po -libmysqld/.deps/sql_select.Po -libmysqld/.deps/sql_show.Po -libmysqld/.deps/sql_state.Po -libmysqld/.deps/sql_string.Po -libmysqld/.deps/sql_table.Po -libmysqld/.deps/sql_tablespace.Po -libmysqld/.deps/sql_test.Po -libmysqld/.deps/sql_trigger.Po -libmysqld/.deps/sql_udf.Po -libmysqld/.deps/sql_union.Po -libmysqld/.deps/sql_update.Po -libmysqld/.deps/sql_view.Po -libmysqld/.deps/sql_yacc.Po -libmysqld/.deps/stacktrace.Po -libmysqld/.deps/strfunc.Po -libmysqld/.deps/table.Po -libmysqld/.deps/thr_malloc.Po -libmysqld/.deps/time.Po -libmysqld/.deps/tztime.Po -libmysqld/.deps/uniques.Po -libmysqld/.deps/unireg.Po -libmysqld/backup_dir -libmysqld/client.c -libmysqld/client_settings.h -libmysqld/cmake_dummy.c -libmysqld/convert.cc -libmysqld/derror.cc -libmysqld/discover.cc -libmysqld/emb_qcache.cpp -libmysqld/errmsg.c -libmysqld/event.cc -libmysqld/event_data_objects.cc -libmysqld/event_db_repository.cc -libmysqld/event_executor.cc -libmysqld/event_queue.cc -libmysqld/event_scheduler.cc -libmysqld/event_timed.cc -libmysqld/events.cc -libmysqld/examples/.deps/completion_hash.Po -libmysqld/examples/.deps/mysql.Po -libmysqld/examples/.deps/mysql_client_test.Po -libmysqld/examples/.deps/mysqltest.Po -libmysqld/examples/.deps/readline.Po -libmysqld/examples/client_test.c -libmysqld/examples/client_test.cc -libmysqld/examples/completion_hash.cc -libmysqld/examples/completion_hash.h -libmysqld/examples/link_sources -libmysqld/examples/my_readline.h -libmysqld/examples/mysql -libmysqld/examples/mysql.cc -libmysqld/examples/mysql_client_test.c -libmysqld/examples/mysql_client_test_embedded -libmysqld/examples/mysqltest -libmysqld/examples/mysqltest.c -libmysqld/examples/mysqltest_embedded -libmysqld/examples/readline.cc -libmysqld/examples/sql_string.cc -libmysqld/examples/sql_string.h -libmysqld/examples/test-gdbinit -libmysqld/field.cc -libmysqld/field_conv.cc -libmysqld/filesort.cc -libmysqld/get_password.c -libmysqld/gstream.cc -libmysqld/ha_archive.cc -libmysqld/ha_berkeley.cc -libmysqld/ha_blackhole.cc -libmysqld/ha_example.cc -libmysqld/ha_federated.cc -libmysqld/ha_heap.cc -libmysqld/ha_innobase.cc -libmysqld/ha_innodb.cc -libmysqld/ha_isam.cc -libmysqld/ha_isammrg.cc -libmysqld/ha_myisam.cc -libmysqld/ha_myisammrg.cc -libmysqld/ha_ndbcluster.cc -libmysqld/ha_ndbcluster_binlog.cc -libmysqld/ha_ndbcluster_cond.cc -libmysqld/ha_partition.cc -libmysqld/ha_tina.cc -libmysqld/handler.cc -libmysqld/handlerton.cc -libmysqld/hash_filo.cc -libmysqld/hostname.cc -libmysqld/init.cc -libmysqld/item.cc -libmysqld/item_buff.cc -libmysqld/item_cmpfunc.cc -libmysqld/item_create.cc -libmysqld/item_func.cc -libmysqld/item_geofunc.cc -libmysqld/item_row.cc -libmysqld/item_strfunc.cc -libmysqld/item_subselect.cc -libmysqld/item_sum.cc -libmysqld/item_timefunc.cc -libmysqld/item_uniq.cc -libmysqld/key.cc -libmysqld/lex_hash.h -libmysqld/lib_sql.cpp -libmysqld/libmysql.c -libmysqld/link_sources -libmysqld/lock.cc -libmysqld/log.cc -libmysqld/log_event.cc -libmysqld/log_event_old.cc -libmysqld/md5.c -libmysqld/message.h -libmysqld/message.rc -libmysqld/mf_iocache.cc -libmysqld/mini_client.cc -libmysqld/my_decimal.cc -libmysqld/my_time.c -libmysqld/my_user.c -libmysqld/net_pkg.cc -libmysqld/net_serv.cc -libmysqld/opt_ft.cc -libmysqld/opt_range.cc -libmysqld/opt_sum.cc -libmysqld/pack.c -libmysqld/parse_file.cc -libmysqld/partition_info.cc -libmysqld/password.c -libmysqld/procedure.cc -libmysqld/protocol.cc -libmysqld/protocol_cursor.cc -libmysqld/records.cc -libmysqld/repl_failsafe.cc -libmysqld/rpl_filter.cc -libmysqld/rpl_handler.cc -libmysqld/rpl_injector.cc -libmysqld/rpl_record.cc -libmysqld/rpl_record_old.cc -libmysqld/rpl_utility.cc -libmysqld/scheduler.cc -libmysqld/set_var.cc -libmysqld/sha2.cc -libmysqld/simple-test -libmysqld/slave.cc -libmysqld/sp.cc -libmysqld/sp_cache.cc -libmysqld/sp_head.cc -libmysqld/sp_pcontext.cc -libmysqld/sp_rcontext.cc -libmysqld/spatial.cc -libmysqld/sql_acl.cc -libmysqld/sql_alloc_error_handler.cc -libmysqld/sql_analyse.cc -libmysqld/sql_base.cc -libmysqld/sql_builtin.cc -libmysqld/sql_cache.cc -libmysqld/sql_class.cc -libmysqld/sql_command -libmysqld/sql_connect.cc -libmysqld/sql_crypt.cc -libmysqld/sql_cursor.cc -libmysqld/sql_cursor.h -libmysqld/sql_db.cc -libmysqld/sql_delete.cc -libmysqld/sql_truncate.cc -libmysqld/sql_reload.cc -libmysqld/datadict.cc -libmysqld/sql_derived.cc -libmysqld/sql_do.cc -libmysqld/sql_error.cc -libmysqld/sql_handler.cc -libmysqld/sql_help.cc -libmysqld/sql_insert.cc -libmysqld/sql_lex.cc -libmysqld/sql_list.cc -libmysqld/sql_load.cc -libmysqld/sql_locale.cc -libmysqld/sql_manager.cc -libmysqld/sql_map.cc -libmysqld/sql_olap.cc -libmysqld/sql_parse.cc -libmysqld/sql_partition.cc -libmysqld/sql_plugin.cc -libmysqld/sql_prepare.cc -libmysqld/sql_profile.cc -libmysqld/sql_rename.cc -libmysqld/sql_repl.cc -libmysqld/sql_select.cc -libmysqld/sql_servers.cc -libmysqld/sql_show.cc -libmysqld/sql_state.c -libmysqld/sql_string.cc -libmysqld/sql_table.cc -libmysqld/sql_tablespace.cc -libmysqld/sql_test.cc -libmysqld/sql_trigger.cc -libmysqld/sql_udf.cc -libmysqld/sql_union.cc -libmysqld/sql_unions.cc -libmysqld/sql_update.cc -libmysqld/sql_view.cc -libmysqld/sql_yacc.cc -libmysqld/sql_yacc.cpp -libmysqld/sql_yacc.h -libmysqld/stacktrace.c -libmysqld/strfunc.cc -libmysqld/table.cc -libmysqld/thr_malloc.cc -libmysqld/sql_time.cc -libmysqld/tztime.cc -libmysqld/uniques.cc -libmysqld/unireg.cc -libmysqltest/*.ds? -libmysqltest/*.vcproj -libmysqltest/mytest.c -libtool -linked_client_sources -linked_include_sources -linked_libmysql_r_sources -linked_libmysql_sources -linked_libmysqld_sources -linked_libmysqldex_sources -linked_server_sources -linked_tools_sources -locked -ltmain.sh -man/*.1 -merge/*.ds? -merge/*.vcproj -missing -mit-pthreads/config.flags -mit-pthreads/include/bits -mit-pthreads/include/pthread/machdep.h -mit-pthreads/include/pthread/posix.h -mit-pthreads/include/sys -mit-pthreads/machdep.c -mit-pthreads/pg++ -mit-pthreads/pgcc -mit-pthreads/syscall.S -mkinstalldirs -my_print_defaults/*.ds? -my_print_defaults/*.vcproj -myisam/*.ds? -myisam/*.vcproj -myisam/FT1.MYD -myisam/FT1.MYI -myisam/ft_dump -myisam/ft_eval -myisam/ft_test1 -myisam/ftbench/data -myisam/ftbench/t -myisam/ftbench/var/* -myisam/mi_test1 -myisam/mi_test2 -myisam/mi_test3 -myisam/mi_test_all -myisam/myisam.log -myisam/myisam_ftdump -myisam/myisamchk -myisam/myisamlog -myisam/myisampack -myisam/rt_test -myisam/rt_test.MYD -myisam/rt_test.MYI -myisam/sp_test -myisam/test1.MYD -myisam/test1.MYI -myisam/test2.MYD -myisam/test2.MYI -myisam_ftdump/*.ds? -myisam_ftdump/*.vcproj -myisamchk/*.ds? -myisamchk/*.vcproj -myisamlog/*.ds? -myisamlog/*.vcproj -myisammrg/*.ds? -myisammrg/*.vcproj -myisampack/*.ds? -myisampack/*.vcproj -mysql-4.0.2-alpha-pc-linux-gnu-i686.tar.gz -mysql-4.0.2-alpha.tar.gz -mysql-4.1.8-win-src.zip -mysql-5.0.2-alpha.tar.gz -mysql-max-4.0.2-alpha-pc-linux-gnu-i686.tar.gz -mysql-test/*.ds? -mysql-test/*.vcproj -mysql-test/.DS_Store -mysql-test/collections/default.release -mysql-test/collections/default.release.done -mysql-test/funcs_1.log -mysql-test/funcs_1.tar -mysql-test/gmon.out -mysql-test/install_test_db -mysql-test/lib/My/SafeProcess/my_safe_process -mysql-test/lib/init_db.sql -mysql-test/linux_sys_vars.inc -mysql-test/load_sysvars.inc -mysql-test/mtr -mysql-test/mysql-test-run -mysql-test/mysql-test-gcov.err -mysql-test/mysql-test-gcov.msg -mysql-test/mysql-test-run-shell -mysql-test/mysql-test-run.log -mysql-test/mysql_test_run_new -mysql-test/ndb/ndbcluster -mysql-test/partitions.log -mysql-test/r/*.err -mysql-test/r/*.log -mysql-test/r/*.out -mysql-test/r/*.reject -mysql-test/r/index_merge_load.result -mysql-test/r/max_allowed_packet_func.result -mysql-test/r/rpl000001.eval -mysql-test/r/rpl000002.eval -mysql-test/r/rpl000014.eval -mysql-test/r/rpl000015.eval -mysql-test/r/rpl000016.eval -mysql-test/r/rpl_log.eval -mysql-test/r/slave-running.eval -mysql-test/r/slave-stopped.eval -mysql-test/r/tmp.result -mysql-test/reg.log -mysql-test/rpl.log -mysql-test/share/mysql -mysql-test/std_data/*.pem -mysql-test/suite/funcs_1.tar.gz -mysql-test/suite/funcs_1.tar.zip -mysql-test/suite/funcs_1/r/innodb_trig_03e.warnings -mysql-test/suite/funcs_1/r/innodb_views.warnings -mysql-test/suite/funcs_1/r/memory_trig_03e.warnings -mysql-test/suite/funcs_1/r/memory_views.warnings -mysql-test/suite/funcs_1/r/myisam_trig_03e.warnings -mysql-test/suite/funcs_1/r/myisam_views.warnings -mysql-test/suite/funcs_1/r/ndb_trig_03e.warnings -mysql-test/suite/funcs_1/r/ndb_views.warnings -mysql-test/suite/partitions/r/dif -mysql-test/suite/partitions/r/diff -mysql-test/suite/partitions/r/partition.result -mysql-test/suite/partitions/r/partition_bit_ndb.warnings -mysql-test/suite/partitions/r/partition_special_innodb.warnings -mysql-test/suite/partitions/r/partition_special_myisam.warnings -mysql-test/suite/partitions/r/partition_t55.out -mysql-test/suite/partitions/r/partition_t55.refout -mysql-test/suite/partitions/t/partition.test -mysql-test/t/index_merge.load -mysql-test/t/tmp.test -mysql-test/var -mysql-test/var/* -mysql-test/windows_sys_vars.inc -mysql.kdevprj -mysql.proj -sql_priv.h -mysqlbinlog/*.ds? -mysqlbinlog/*.vcproj -mysqlcheck/*.ds? -mysqlcheck/*.vcproj -mysqld.S -mysqld.sym -mysqldemb/*.ds? -mysqldemb/*.vcproj -mysqlserver/*.ds? -mysqlserver/*.vcproj -mysys/#mf_iocache.c# -mysys/*.ds? -mysys/*.vcproj -mysys/.deps/array.Po -mysys/.deps/base64.Po -mysys/.deps/charset-def.Po -mysys/.deps/charset.Po -mysys/.deps/checksum.Po -mysys/.deps/default.Po -mysys/.deps/default_modify.Po -mysys/.deps/errors.Po -mysys/.deps/hash.Po -mysys/.deps/list.Po -mysys/.deps/md5.Po -mysys/.deps/mf_brkhant.Po -mysys/.deps/mf_cache.Po -mysys/.deps/mf_dirname.Po -mysys/.deps/mf_fn_ext.Po -mysys/.deps/mf_format.Po -mysys/.deps/mf_getdate.Po -mysys/.deps/mf_iocache.Po -mysys/.deps/mf_iocache2.Po -mysys/.deps/mf_keycache.Po -mysys/.deps/mf_keycaches.Po -mysys/.deps/mf_loadpath.Po -mysys/.deps/mf_pack.Po -mysys/.deps/mf_path.Po -mysys/.deps/mf_qsort.Po -mysys/.deps/mf_qsort2.Po -mysys/.deps/mf_radix.Po -mysys/.deps/mf_same.Po -mysys/.deps/mf_sort.Po -mysys/.deps/mf_strip.Po -mysys/.deps/mf_tempdir.Po -mysys/.deps/mf_tempfile.Po -mysys/.deps/mf_unixpath.Po -mysys/.deps/mf_wcomp.Po -mysys/.deps/mf_wfile.Po -mysys/.deps/mulalloc.Po -mysys/.deps/my_access.Po -mysys/.deps/my_aes.Po -mysys/.deps/my_alarm.Po -mysys/.deps/my_alloc.Po -mysys/.deps/my_append.Po -mysys/.deps/my_atomic.Po -mysys/.deps/my_bit.Po -mysys/.deps/my_bitmap.Po -mysys/.deps/my_chsize.Po -mysys/.deps/my_clock.Po -mysys/.deps/my_compress.Po -mysys/.deps/my_copy.Po -mysys/.deps/my_crc32.Po -mysys/.deps/my_create.Po -mysys/.deps/my_delete.Po -mysys/.deps/my_div.Po -mysys/.deps/my_dup.Po -mysys/.deps/my_error.Po -mysys/.deps/my_file.Po -mysys/.deps/my_fopen.Po -mysys/.deps/my_fstream.Po -mysys/.deps/my_gethostbyname.Po -mysys/.deps/my_gethwaddr.Po -mysys/.deps/my_getncpus.Po -mysys/.deps/my_getopt.Po -mysys/.deps/my_getsystime.Po -mysys/.deps/my_getwd.Po -mysys/.deps/my_handler.Po -mysys/.deps/my_init.Po -mysys/.deps/my_largepage.Po -mysys/.deps/my_lib.Po -mysys/.deps/my_libwrap.Po -mysys/.deps/my_lock.Po -mysys/.deps/my_lockmem.Po -mysys/.deps/my_lread.Po -mysys/.deps/my_lwrite.Po -mysys/.deps/my_malloc.Po -mysys/.deps/my_memmem.Po -mysys/.deps/my_messnc.Po -mysys/.deps/my_mkdir.Po -mysys/.deps/my_mmap.Po -mysys/.deps/my_net.Po -mysys/.deps/my_netware.Po -mysys/.deps/my_new.Po -mysys/.deps/my_once.Po -mysys/.deps/my_open.Po -mysys/.deps/my_port.Po -mysys/.deps/my_pread.Po -mysys/.deps/my_pthread.Po -mysys/.deps/my_quick.Po -mysys/.deps/my_read.Po -mysys/.deps/my_realloc.Po -mysys/.deps/my_redel.Po -mysys/.deps/my_rename.Po -mysys/.deps/my_seek.Po -mysys/.deps/my_semaphore.Po -mysys/.deps/my_sleep.Po -mysys/.deps/my_static.Po -mysys/.deps/my_symlink.Po -mysys/.deps/my_symlink2.Po -mysys/.deps/my_sync.Po -mysys/.deps/my_thr_init.Po -mysys/.deps/my_vle.Po -mysys/.deps/my_windac.Po -mysys/.deps/my_write.Po -mysys/.deps/ptr_cmp.Po -mysys/.deps/queues.Po -mysys/.deps/rijndael.Po -mysys/.deps/safemalloc.Po -mysys/.deps/sha1.Po -mysys/.deps/string.Po -mysys/.deps/thr_alarm.Po -mysys/.deps/thr_lock.Po -mysys/.deps/thr_mutex.Po -mysys/.deps/thr_rwlock.Po -mysys/.deps/tree.Po -mysys/.deps/trie.Po -mysys/.deps/typelib.Po -mysys/getopt.c -mysys/getopt1.c -mysys/main.cc -mysys/my_new.cpp -mysys/raid.cpp -mysys/ste5KbMa -mysys/test_atomic -mysys/test_bitmap -mysys/test_charset -mysys/test_dir -mysys/test_gethwaddr -mysys/test_io_cache -mysys/test_thr_alarm -mysys/test_thr_lock -mysys/test_vsnprintf -mysys/testhash -ndb/bin/DbAsyncGenerator -ndb/bin/DbCreate -ndb/bin/acid -ndb/bin/async-lmc-bench-l-p10.sh -ndb/bin/async-lmc-bench-l.sh -ndb/bin/async-lmc-bench-p10.sh -ndb/bin/async-lmc-bench.sh -ndb/bin/atrt -ndb/bin/atrt-analyze-result.sh -ndb/bin/atrt-clear-result.sh -ndb/bin/atrt-gather-result.sh -ndb/bin/atrt-setup.sh -ndb/bin/bankCreator -ndb/bin/bankMakeGL -ndb/bin/bankSumAccounts -ndb/bin/bankTimer -ndb/bin/bankTransactionMaker -ndb/bin/bankValidateAllGLs -ndb/bin/basicTransporterTest -ndb/bin/benchronja -ndb/bin/bulk_copy -ndb/bin/copy_tab -ndb/bin/create_all_tabs -ndb/bin/create_index -ndb/bin/create_tab -ndb/bin/delete_all -ndb/bin/desc -ndb/bin/drop_all_tabs -ndb/bin/drop_index -ndb/bin/drop_tab -ndb/bin/flexAsynch -ndb/bin/flexBench -ndb/bin/flexHammer -ndb/bin/flexScan -ndb/bin/flexTT -ndb/bin/hugoCalculator -ndb/bin/hugoFill -ndb/bin/hugoLoad -ndb/bin/hugoLockRecords -ndb/bin/hugoPkDelete -ndb/bin/hugoPkRead -ndb/bin/hugoPkReadRecord -ndb/bin/hugoPkUpdate -ndb/bin/hugoScanRead -ndb/bin/hugoScanUpdate -ndb/bin/index -ndb/bin/index2 -ndb/bin/initronja -ndb/bin/interpreterInTup -ndb/bin/list_tables -ndb/bin/make-config.sh -ndb/bin/mgmtclient -ndb/bin/mgmtsrvr -ndb/bin/mkconfig -ndb/bin/ndb -ndb/bin/ndb_cpcc -ndb/bin/ndb_cpcd -ndb/bin/ndb_rep -ndb/bin/ndbsql -ndb/bin/newton_basic -ndb/bin/newton_br -ndb/bin/newton_pb -ndb/bin/newton_perf -ndb/bin/perfTransporterTest -ndb/bin/printConfig -ndb/bin/printSchemafile -ndb/bin/printSysfile -ndb/bin/redoLogFileReader -ndb/bin/restart -ndb/bin/restarter -ndb/bin/restarter2 -ndb/bin/restarts -ndb/bin/restore -ndb/bin/select_all -ndb/bin/select_count -ndb/bin/telco -ndb/bin/testBackup -ndb/bin/testBank -ndb/bin/testBasic -ndb/bin/testBasicAsynch -ndb/bin/testCopy -ndb/bin/testDataBuffers -ndb/bin/testDict -ndb/bin/testGrep -ndb/bin/testGrepVerify -ndb/bin/testIndex -ndb/bin/testInterpreter -ndb/bin/testKernelDataBuffer -ndb/bin/testLongSig -ndb/bin/testMgm -ndb/bin/testMgmapi -ndb/bin/testNdbApi -ndb/bin/testNodeRestart -ndb/bin/testOIBasic -ndb/bin/testOdbcDriver -ndb/bin/testOperations -ndb/bin/testRestartGci -ndb/bin/testScan -ndb/bin/testScanInterpreter -ndb/bin/testSimplePropertiesSection -ndb/bin/testSystemRestart -ndb/bin/testTimeout -ndb/bin/testTransactions -ndb/bin/test_cpcd -ndb/bin/test_event -ndb/bin/verify_index -ndb/bin/waiter -ndb/config/autom4te.cache/* -ndb/config/config.mk -ndb/examples/ndbapi_example1/ndbapi_example1 -ndb/examples/ndbapi_example2/ndbapi_example2 -ndb/examples/ndbapi_example3/ndbapi_example3 -ndb/examples/ndbapi_example5/ndbapi_example5 -ndb/examples/select_all/select_all -ndb/include/ndb_global.h -ndb/include/ndb_types.h -ndb/include/ndb_version.h -ndb/lib/libMGM_API.so -ndb/lib/libNDB_API.so -ndb/lib/libNDB_ODBC.so -ndb/lib/libNEWTON_API.so -ndb/lib/libNEWTON_BASICTEST_COMMON.so -ndb/lib/libREP_API.so -ndb/lib/libndbclient.so -ndb/lib/libndbclient_extra.so -ndb/src/common/debugger/libtrace.dsp -ndb/src/common/debugger/signaldata/libsignaldataprint.dsp -ndb/src/common/logger/liblogger.dsp -ndb/src/common/mgmcommon/libmgmsrvcommon.dsp -ndb/src/common/mgmcommon/printConfig/*.d -ndb/src/common/portlib/libportlib.dsp -ndb/src/common/transporter/libtransporter.dsp -ndb/src/common/util/libgeneral.dsp -ndb/src/common/util/testBitmask.cpp -ndb/src/cw/cpcd/ndb_cpcd -ndb/src/dummy.cpp -ndb/src/kernel/blocks/backup/libbackup.dsp -ndb/src/kernel/blocks/backup/restore/ndb_restore -ndb/src/kernel/blocks/cmvmi/libcmvmi.dsp -ndb/src/kernel/blocks/dbacc/libdbacc.dsp -ndb/src/kernel/blocks/dbdict/libdbdict.dsp -ndb/src/kernel/blocks/dbdih/libdbdih.dsp -ndb/src/kernel/blocks/dblqh/libdblqh.dsp -ndb/src/kernel/blocks/dbtc/libdbtc.dsp -ndb/src/kernel/blocks/dbtup/libdbtup.dsp -ndb/src/kernel/blocks/dbtux/libdbtux.dsp -ndb/src/kernel/blocks/dbutil/libdbutil.dsp -ndb/src/kernel/blocks/grep/libgrep.dsp -ndb/src/kernel/blocks/ndbcntr/libndbcntr.dsp -ndb/src/kernel/blocks/ndbfs/libndbfs.dsp -ndb/src/kernel/blocks/qmgr/libqmgr.dsp -ndb/src/kernel/blocks/suma/libsuma.dsp -ndb/src/kernel/blocks/trix/libtrix.dsp -ndb/src/kernel/error/liberror.dsp -ndb/src/kernel/ndbd -ndb/src/kernel/ndbd.dsp -ndb/src/kernel/vm/libkernel.dsp -ndb/src/libndb.ver -ndb/src/libndbclient.dsp -ndb/src/mgmapi/libmgmapi.dsp -ndb/src/mgmclient/libndbmgmclient.dsp -ndb/src/mgmclient/ndb_mgm -ndb/src/mgmclient/ndb_mgm.dsp -ndb/src/mgmclient/test_cpcd/*.d -ndb/src/mgmsrv/ndb_mgmd -ndb/src/mgmsrv/ndb_mgmd.dsp -ndb/src/ndbapi/libndbapi.dsp -ndb/test/ndbapi/bank/bankCreator -ndb/test/ndbapi/bank/bankMakeGL -ndb/test/ndbapi/bank/bankSumAccounts -ndb/test/ndbapi/bank/bankTimer -ndb/test/ndbapi/bank/bankTransactionMaker -ndb/test/ndbapi/bank/bankValidateAllGLs -ndb/test/ndbapi/bank/testBank -ndb/test/ndbapi/create_all_tabs -ndb/test/ndbapi/create_tab -ndb/test/ndbapi/drop_all_tabs -ndb/test/ndbapi/flexAsynch -ndb/test/ndbapi/flexBench -ndb/test/ndbapi/flexBench.dsp -ndb/test/ndbapi/flexHammer -ndb/test/ndbapi/flexTT -ndb/test/ndbapi/testBackup -ndb/test/ndbapi/testBasic -ndb/test/ndbapi/testBasic.dsp -ndb/test/ndbapi/testBasicAsynch -ndb/test/ndbapi/testBlobs -ndb/test/ndbapi/testBlobs.dsp -ndb/test/ndbapi/testDataBuffers -ndb/test/ndbapi/testDeadlock -ndb/test/ndbapi/testDict -ndb/test/ndbapi/testIndex -ndb/test/ndbapi/testMgm -ndb/test/ndbapi/testNdbApi -ndb/test/ndbapi/testNodeRestart -ndb/test/ndbapi/testOIBasic -ndb/test/ndbapi/testOperations -ndb/test/ndbapi/testRestartGci -ndb/test/ndbapi/testSRBank -ndb/test/ndbapi/testScan -ndb/test/ndbapi/testScan.dsp -ndb/test/ndbapi/testScanInterpreter -ndb/test/ndbapi/testScanPerf -ndb/test/ndbapi/testSystemRestart -ndb/test/ndbapi/testTimeout -ndb/test/ndbapi/testTransactions -ndb/test/ndbapi/test_event -ndb/test/run-test/atrt -ndb/test/src/libNDBT.dsp -ndb/test/tools/copy_tab -ndb/test/tools/create_index -ndb/test/tools/hugoCalculator -ndb/test/tools/hugoFill -ndb/test/tools/hugoLoad -ndb/test/tools/hugoLockRecords -ndb/test/tools/hugoPkDelete -ndb/test/tools/hugoPkRead -ndb/test/tools/hugoPkReadRecord -ndb/test/tools/hugoPkUpdate -ndb/test/tools/hugoScanRead -ndb/test/tools/hugoScanUpdate -ndb/test/tools/ndb_cpcc -ndb/test/tools/restart -ndb/test/tools/verify_index -ndb/tools/ndb_config -ndb/tools/ndb_delete_all -ndb/tools/ndb_delete_all.dsp -ndb/tools/ndb_desc -ndb/tools/ndb_desc.dsp -ndb/tools/ndb_drop_index -ndb/tools/ndb_drop_index.dsp -ndb/tools/ndb_drop_table -ndb/tools/ndb_drop_table.dsp -ndb/tools/ndb_restore -ndb/tools/ndb_select_all -ndb/tools/ndb_select_all.dsp -ndb/tools/ndb_select_count -ndb/tools/ndb_select_count.dsp -ndb/tools/ndb_show_tables -ndb/tools/ndb_show_tables.dsp -ndb/tools/ndb_test_platform -ndb/tools/ndb_waiter -ndb/tools/ndb_waiter.dsp -ndbcluster-1186 -ndbcluster-1186/SCCS -ndbcluster-1186/config.ini -ndbcluster-1186/ndb_1.pid -ndbcluster-1186/ndb_1_out.log -ndbcluster-1186/ndb_1_signal.log -ndbcluster-1186/ndb_2.pid -ndbcluster-1186/ndb_2_out.log -ndbcluster-1186/ndb_2_signal.log -ndbcluster-1186/ndb_3.pid -ndbcluster-1186/ndb_3_cluster.log -ndbcluster-1186/ndb_3_out.log -ndbcluster-1186/ndbcluster.pid -netware/.deps/libmysqlmain.Po -netware/.deps/my_manage.Po -netware/.deps/mysql_install_db.Po -netware/.deps/mysql_test_run.Po -netware/.deps/mysqld_safe.Po -netware/init_db.sql -netware/libmysql.imp -netware/test_db.sql -pack_isam/*.ds? -perror/*.ds? -perror/*.vcproj -plugin/fulltext/.deps/mypluglib_la-plugin_example.Plo -plugin/fulltext/.libs/mypluglib.lai -plugin/fulltext/.libs/mypluglib.so.0 -plugin/fulltext/.libs/mypluglib.so.0.0.0 -pstack/.deps/bucomm.Po -pstack/.deps/debug.Po -pstack/.deps/filemode.Po -pstack/.deps/ieee.Po -pstack/.deps/linuxthreads.Po -pstack/.deps/pstack.Po -pstack/.deps/rddbg.Po -pstack/.deps/stabs.Po -pull.log -regex/*.ds? -regex/*.vcproj -regex/.deps/debug.Po -regex/.deps/main.Po -regex/.deps/regcomp.Po -regex/.deps/regerror.Po -regex/.deps/regexec.Po -regex/.deps/regfree.Po -regex/.deps/reginit.Po -regex/.deps/split.Po -regex/re -repl-tests/test-repl-ts/repl-timestamp.master.reject -repl-tests/test-repl/foo-dump-slave.master. -repl-tests/test-repl/sum-wlen-slave.master. -repl-tests/test-repl/sum-wlen-slave.master.re -repl-tests/test-repl/sum-wlen-slave.master.reje -replace/*.ds? -replace/*.vcproj -scripts/comp_sql -scripts/fill_func_tables -scripts/fill_func_tables.sql -scripts/fill_help_tables -scripts/fill_help_tables.sql -scripts/make_binary_distribution -scripts/make_sharedlib_distribution -scripts/make_win_binary_distribution -scripts/make_win_src_distribution -scripts/make_win_src_distribution_old -scripts/msql2mysql -scripts/mysql_config -scripts/mysql_convert_table_format -scripts/mysql_create_system_tables -scripts/mysql_explain_log -scripts/mysql_find_rows -scripts/mysql_fix_extensions -scripts/mysql_fix_privilege_tables -scripts/mysql_fix_privilege_tables.sql -scripts/mysql_fix_privilege_tables.sql.rule -scripts/mysql_fix_privilege_tables_sql.c -scripts/mysql_fix_privilege_tables_sql.c.rule -scripts/mysql_install_db -scripts/mysql_secure_installation -scripts/mysql_setpermission -scripts/mysql_tableinfo -scripts/mysql_upgrade -scripts/mysql_upgrade_shell -scripts/mysql_zap -scripts/mysqlaccess -scripts/mysqlbug -scripts/mysqld_multi -scripts/mysqld_safe -scripts/mysqldumpslow -scripts/mysqlhotcopy -scripts/mysqlhotcopy.sh.rej -scripts/safe_mysqld -select_test -server-tools/instance-manager/.deps/buffer.Po -server-tools/instance-manager/.deps/command.Po -server-tools/instance-manager/.deps/commands.Po -server-tools/instance-manager/.deps/guardian.Po -server-tools/instance-manager/.deps/instance.Po -server-tools/instance-manager/.deps/instance_map.Po -server-tools/instance-manager/.deps/instance_options.Po -server-tools/instance-manager/.deps/liboptions_la-options.Plo -server-tools/instance-manager/.deps/liboptions_la-priv.Plo -server-tools/instance-manager/.deps/listener.Po -server-tools/instance-manager/.deps/log.Po -server-tools/instance-manager/.deps/manager.Po -server-tools/instance-manager/.deps/messages.Po -server-tools/instance-manager/.deps/mysql_connection.Po -server-tools/instance-manager/.deps/mysqlmanager.Po -server-tools/instance-manager/.deps/net_serv.Po -server-tools/instance-manager/.deps/parse.Po -server-tools/instance-manager/.deps/parse_output.Po -server-tools/instance-manager/.deps/protocol.Po -server-tools/instance-manager/.deps/thread_registry.Po -server-tools/instance-manager/.deps/user_management_commands.Po -server-tools/instance-manager/.deps/user_map.Po -server-tools/instance-manager/buffer.cpp -server-tools/instance-manager/client.c -server-tools/instance-manager/client_settings.h -server-tools/instance-manager/command.cpp -server-tools/instance-manager/commands.cpp -server-tools/instance-manager/errmsg.c -server-tools/instance-manager/guardian.cpp -server-tools/instance-manager/instance.cpp -server-tools/instance-manager/instance_map.cpp -server-tools/instance-manager/instance_options.cpp -server-tools/instance-manager/listener.cpp -server-tools/instance-manager/log.cpp -server-tools/instance-manager/manager.cpp -server-tools/instance-manager/messages.cpp -server-tools/instance-manager/mysql_connection.cpp -server-tools/instance-manager/mysqlmanager -server-tools/instance-manager/mysqlmanager.cpp -server-tools/instance-manager/net_serv.cc -server-tools/instance-manager/options.cpp -server-tools/instance-manager/parse.cpp -server-tools/instance-manager/parse_output.cpp -server-tools/instance-manager/priv.cpp -server-tools/instance-manager/protocol.cpp -server-tools/instance-manager/thr_alarm.c -server-tools/instance-manager/thread_registry.cpp -server-tools/instance-manager/user_map.cpp -sql-bench/Results-linux/ATIS-mysql_bdb-Linux_2.2.14_my_SMP_i686 -sql-bench/bench-count-distinct -sql-bench/bench-init.pl -sql-bench/compare-results -sql-bench/compare-results-all -sql-bench/copy-db -sql-bench/crash-me -sql-bench/gif/* -sql-bench/graph-compare-results -sql-bench/innotest1 -sql-bench/innotest1a -sql-bench/innotest1b -sql-bench/innotest2 -sql-bench/innotest2a -sql-bench/innotest2b -sql-bench/output/* -sql-bench/run-all-tests -sql-bench/server-cfg -sql-bench/template.html -sql-bench/test-ATIS -sql-bench/test-alter-table -sql-bench/test-big-tables -sql-bench/test-connect -sql-bench/test-create -sql-bench/test-insert -sql-bench/test-select -sql-bench/test-transactions -sql-bench/test-wisconsin -sql/*.cpp -sql/*.ds? -sql/*.def -sql/*.vcproj -sql/.deps/client.Po -sql/.deps/derror.Po -sql/.deps/des_key_file.Po -sql/.deps/discover.Po -sql/.deps/event_data_objects.Po -sql/.deps/event_db_repository.Po -sql/.deps/event_queue.Po -sql/.deps/event_scheduler.Po -sql/.deps/events.Po -sql/.deps/field.Po -sql/.deps/field_conv.Po -sql/.deps/filesort.Po -sql/.deps/gen_lex_hash.Po -sql/.deps/gstream.Po -sql/.deps/ha_berkeley.Po -sql/.deps/ha_federated.Po -sql/.deps/ha_heap.Po -sql/.deps/ha_innodb.Po -sql/.deps/ha_myisam.Po -sql/.deps/ha_myisammrg.Po -sql/.deps/ha_ndbcluster.Po -sql/.deps/ha_ndbcluster_binlog.Po -sql/.deps/ha_partition.Po -sql/.deps/handler.Po -sql/.deps/hash_filo.Po -sql/.deps/hostname.Po -sql/.deps/init.Po -sql/.deps/item.Po -sql/.deps/item_buff.Po -sql/.deps/item_cmpfunc.Po -sql/.deps/item_create.Po -sql/.deps/item_func.Po -sql/.deps/item_geofunc.Po -sql/.deps/item_row.Po -sql/.deps/item_strfunc.Po -sql/.deps/item_subselect.Po -sql/.deps/item_sum.Po -sql/.deps/item_timefunc.Po -sql/.deps/item_uniq.Po -sql/.deps/item_xmlfunc.Po -sql/.deps/key.Po -sql/.deps/lock.Po -sql/.deps/log.Po -sql/.deps/log_event.Po -sql/.deps/mf_iocache.Po -sql/.deps/mini_client_errors.Po -sql/.deps/my_decimal.Po -sql/.deps/my_lock.Po -sql/.deps/my_time.Po -sql/.deps/my_user.Po -sql/.deps/mysql_tzinfo_to_sql.Po -sql/.deps/mysqld.Po -sql/.deps/net_serv.Po -sql/.deps/opt_range.Po -sql/.deps/opt_sum.Po -sql/.deps/pack.Po -sql/.deps/parse_file.Po -sql/.deps/partition_info.Po -sql/.deps/password.Po -sql/.deps/procedure.Po -sql/.deps/protocol.Po -sql/.deps/records.Po -sql/.deps/repl_failsafe.Po -sql/.deps/rpl_filter.Po -sql/.deps/rpl_injector.Po -sql/.deps/rpl_tblmap.Po -sql/.deps/set_var.Po -sql/.deps/slave.Po -sql/.deps/sp.Po -sql/.deps/sp_cache.Po -sql/.deps/sp_head.Po -sql/.deps/sp_pcontext.Po -sql/.deps/sp_rcontext.Po -sql/.deps/spatial.Po -sql/.deps/sql_acl.Po -sql/.deps/sql_analyse.Po -sql/.deps/sql_base.Po -sql/.deps/sql_binlog.Po -sql/.deps/sql_builtin.Po -sql/.deps/sql_cache.Po -sql/.deps/sql_class.Po -sql/.deps/sql_client.Po -sql/.deps/sql_crypt.Po -sql/.deps/sql_cursor.Po -sql/.deps/sql_db.Po -sql/.deps/sql_delete.Po -sql/.deps/sql_truncate.Po -sql/.deps/sql_reload.Po -sql/.deps/datadict.Po -sql/.deps/sql_derived.Po -sql/.deps/sql_do.Po -sql/.deps/sql_error.Po -sql/.deps/sql_handler.Po -sql/.deps/sql_help.Po -sql/.deps/sql_insert.Po -sql/.deps/sql_lex.Po -sql/.deps/sql_list.Po -sql/.deps/sql_load.Po -sql/.deps/sql_manager.Po -sql/.deps/sql_map.Po -sql/.deps/sql_olap.Po -sql/.deps/sql_parse.Po -sql/.deps/sql_partition.Po -sql/.deps/sql_plugin.Po -sql/.deps/sql_prepare.Po -sql/.deps/sql_rename.Po -sql/.deps/sql_repl.Po -sql/.deps/sql_select.Po -sql/.deps/sql_show.Po -sql/.deps/sql_state.Po -sql/.deps/sql_string.Po -sql/.deps/sql_table.Po -sql/.deps/sql_tablespace.Po -sql/.deps/sql_test.Po -sql/.deps/sql_trigger.Po -sql/.deps/sql_udf.Po -sql/.deps/sql_union.Po -sql/.deps/sql_update.Po -sql/.deps/sql_view.Po -sql/.deps/sql_yacc.Po -sql/.deps/stacktrace.Po -sql/.deps/strfunc.Po -sql/.deps/table.Po -sql/.deps/thr_malloc.Po -sql/.deps/time.Po -sql/.deps/tztime.Po -sql/.deps/udf_example.Plo -sql/.deps/uniques.Po -sql/.deps/unireg.Po -sql/.gdbinit -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/cscope.out -sql/f.c -sql/gen_lex_hash -sql/gmon.out -sql/handlerton.cc -sql/html -sql/latex -sql/lex_hash.h -sql/lex_hash.h.rule -sql/link_sources -sql/max/* -sql/message.h -sql/message.mc -sql/message.rc -sql/mini_client_errors.c -sql/my_time.c -sql/my_user.c -sql/mysql_tzinfo_to_sql -sql/mysql_tzinfo_to_sql.cc -sql/mysql_tzinfo_to_sql_tztime.cc -sql/mysqlbinlog -sql/mysqld -sql/mysqld-purecov -sql/mysqld-purify -sql/mysqld-quantify -sql/new.cc -sql/pack.c -sql/safe_to_cache_query.txt -sql/share/*.sys -sql/share/charsets/gmon.out -sql/share/fixerrmsg.pl -sql/share/gmon.out -sql/share/iso639-2.txt -sql/share/mysql -sql/share/norwegian-ny/errmsg.sys -sql/share/norwegian/errmsg.sys -sql/sql_builtin.cc -sql/sql_select.cc.orig -sql/sql_yacc.cc -sql/sql_yacc.h -sql/sql_yacc.h.rule -sql/sql_yacc.output -sql/sql_yacc.yy.orig -sql/test_time -sql/udf_example.so -sql_error.cc -sql_prepare.cc -stamp-h -stamp-h.in -stamp-h1 -stamp-h1.in -stamp-h2 -stamp-h2.in -stamp-h3 -stamp-h4 -start_mysqld.sh -storage/archive/.deps/archive_test-archive_test.Po -storage/archive/.deps/archive_test-azio.Po -storage/archive/.deps/ha_archive_la-azio.Plo -storage/archive/.deps/ha_archive_la-ha_archive.Plo -storage/archive/.deps/libarchive_a-azio.Po -storage/archive/.deps/libarchive_a-ha_archive.Po -storage/archive/archive_reader -storage/archive/archive_test -storage/bdb/*.ds? -storage/bdb/*.vcproj -storage/bdb/README -storage/bdb/btree/btree_auto.c -storage/bdb/btree/btree_autop.c -storage/bdb/build_unix/* -storage/bdb/build_vxworks/BerkeleyDB20.wpj -storage/bdb/build_vxworks/BerkeleyDB20small.wpj -storage/bdb/build_vxworks/BerkeleyDB22.wpj -storage/bdb/build_vxworks/BerkeleyDB22small.wpj -storage/bdb/build_vxworks/db.h -storage/bdb/build_vxworks/db_config.h -storage/bdb/build_vxworks/db_config_small.h -storage/bdb/build_vxworks/db_deadlock/db_deadlock20.wpj -storage/bdb/build_vxworks/db_deadlock/db_deadlock22.wpj -storage/bdb/build_vxworks/db_int.h -storage/bdb/build_vxworks/dbdemo/dbdemo.c -storage/bdb/build_vxworks/dbdemo/dbdemo20.wpj -storage/bdb/build_vxworks/dbdemo/dbdemo22.wpj -storage/bdb/build_win32/*.dsp -storage/bdb/build_win32/*.h -storage/bdb/build_win32/db.h -storage/bdb/build_win32/db_archive.dsp -storage/bdb/build_win32/db_checkpoint.dsp -storage/bdb/build_win32/db_config.h -storage/bdb/build_win32/db_cxx.h -storage/bdb/build_win32/db_deadlock.dsp -storage/bdb/build_win32/db_dll.dsp -storage/bdb/build_win32/db_dump.dsp -storage/bdb/build_win32/db_int.h -storage/bdb/build_win32/db_java.dsp -storage/bdb/build_win32/db_load.dsp -storage/bdb/build_win32/db_perf.dsp -storage/bdb/build_win32/db_printlog.dsp -storage/bdb/build_win32/db_recover.dsp -storage/bdb/build_win32/db_stat.dsp -storage/bdb/build_win32/db_static.dsp -storage/bdb/build_win32/db_tcl.dsp -storage/bdb/build_win32/db_test.dsp -storage/bdb/build_win32/db_upgrade.dsp -storage/bdb/build_win32/db_verify.dsp -storage/bdb/build_win32/ex_access.dsp -storage/bdb/build_win32/ex_btrec.dsp -storage/bdb/build_win32/ex_env.dsp -storage/bdb/build_win32/ex_lock.dsp -storage/bdb/build_win32/ex_mpool.dsp -storage/bdb/build_win32/ex_tpcb.dsp -storage/bdb/build_win32/excxx_access.dsp -storage/bdb/build_win32/excxx_btrec.dsp -storage/bdb/build_win32/excxx_env.dsp -storage/bdb/build_win32/excxx_lock.dsp -storage/bdb/build_win32/excxx_mpool.dsp -storage/bdb/build_win32/excxx_tpcb.dsp -storage/bdb/build_win32/include.tcl -storage/bdb/build_win32/libdb.def -storage/bdb/build_win32/libdb.rc -storage/bdb/build_win64/*.dsp -storage/bdb/build_win64/*.dsw -storage/bdb/build_win64/*.h -storage/bdb/db/crdel_auto.c -storage/bdb/db/crdel_autop.c -storage/bdb/db/db_auto.c -storage/bdb/db/db_autop.c -storage/bdb/dbinc_auto/*.* -storage/bdb/dbreg/dbreg_auto.c -storage/bdb/dbreg/dbreg_autop.c -storage/bdb/dist/autom4te-2.53.cache/* -storage/bdb/dist/autom4te-2.53.cache/output.0 -storage/bdb/dist/autom4te-2.53.cache/requests -storage/bdb/dist/autom4te-2.53.cache/traces.0 -storage/bdb/dist/autom4te.cache/* -storage/bdb/dist/autom4te.cache/output.0 -storage/bdb/dist/autom4te.cache/requests -storage/bdb/dist/autom4te.cache/traces.0 -storage/bdb/dist/config.hin -storage/bdb/dist/configure -storage/bdb/dist/tags -storage/bdb/dist/template/db_server_proc -storage/bdb/dist/template/gen_client_ret -storage/bdb/dist/template/rec_btree -storage/bdb/dist/template/rec_crdel -storage/bdb/dist/template/rec_db -storage/bdb/dist/template/rec_dbreg -storage/bdb/dist/template/rec_fileops -storage/bdb/dist/template/rec_hash -storage/bdb/dist/template/rec_log -storage/bdb/dist/template/rec_qam -storage/bdb/dist/template/rec_txn -storage/bdb/examples_c/ex_apprec/ex_apprec_auto.c -storage/bdb/examples_c/ex_apprec/ex_apprec_auto.h -storage/bdb/examples_c/ex_apprec/ex_apprec_template -storage/bdb/examples_java -storage/bdb/fileops/fileops_auto.c -storage/bdb/fileops/fileops_autop.c -storage/bdb/hash/hash_auto.c -storage/bdb/hash/hash_autop.c -storage/bdb/include/btree_auto.h -storage/bdb/include/btree_ext.h -storage/bdb/include/clib_ext.h -storage/bdb/include/common_ext.h -storage/bdb/include/crdel_auto.h -storage/bdb/include/db_auto.h -storage/bdb/include/db_ext.h -storage/bdb/include/db_server.h -storage/bdb/include/env_ext.h -storage/bdb/include/gen_client_ext.h -storage/bdb/include/gen_server_ext.h -storage/bdb/include/hash_auto.h -storage/bdb/include/hash_ext.h -storage/bdb/include/lock_ext.h -storage/bdb/include/log_auto.h -storage/bdb/include/log_ext.h -storage/bdb/include/mp_ext.h -storage/bdb/include/mutex_ext.h -storage/bdb/include/os_ext.h -storage/bdb/include/qam_auto.h -storage/bdb/include/qam_ext.h -storage/bdb/include/rpc_client_ext.h -storage/bdb/include/rpc_server_ext.h -storage/bdb/include/tcl_ext.h -storage/bdb/include/txn_auto.h -storage/bdb/include/txn_ext.h -storage/bdb/include/xa_ext.h -storage/bdb/java/src/com/sleepycat/db/Db.java -storage/bdb/java/src/com/sleepycat/db/DbBtreeStat.java -storage/bdb/java/src/com/sleepycat/db/DbConstants.java -storage/bdb/java/src/com/sleepycat/db/DbHashStat.java -storage/bdb/java/src/com/sleepycat/db/DbLockStat.java -storage/bdb/java/src/com/sleepycat/db/DbLogStat.java -storage/bdb/java/src/com/sleepycat/db/DbMpoolFStat.java -storage/bdb/java/src/com/sleepycat/db/DbQueueStat.java -storage/bdb/java/src/com/sleepycat/db/DbRepStat.java -storage/bdb/java/src/com/sleepycat/db/DbTxnStat.java -storage/bdb/libdb_java/java_stat_auto.c -storage/bdb/libdb_java/java_stat_auto.h -storage/bdb/libdb_java/java_util.i -storage/bdb/log/log_auto.c -storage/bdb/qam/qam_auto.c -storage/bdb/qam/qam_autop.c -storage/bdb/rep/rep_auto.c -storage/bdb/rep/rep_autop.c -storage/bdb/rpc_client/db_server_clnt.c -storage/bdb/rpc_client/gen_client.c -storage/bdb/rpc_server/c/db_server_proc.c -storage/bdb/rpc_server/c/db_server_proc.sed -storage/bdb/rpc_server/c/db_server_svc.c -storage/bdb/rpc_server/c/db_server_xdr.c -storage/bdb/rpc_server/c/gen_db_server.c -storage/bdb/rpc_server/db_server.x -storage/bdb/rpc_server/db_server_proc.sed -storage/bdb/rpc_server/db_server_svc.c -storage/bdb/rpc_server/db_server_xdr.c -storage/bdb/rpc_server/gen_db_server.c -storage/bdb/test/TESTS -storage/bdb/test/include.tcl -storage/bdb/test/logtrack.list -storage/bdb/txn/txn_auto.c -storage/bdb/txn/txn_autop.c -storage/blackhole/.deps/ha_blackhole_la-ha_blackhole.Plo -storage/blackhole/.deps/libblackhole_a-ha_blackhole.Po -storage/csv/.deps/ha_csv_la-ha_tina.Plo -storage/csv/.deps/libcsv_a-ha_tina.Po -storage/example/.deps/ha_example_la-ha_example.Plo -storage/example/.deps/libexample_a-ha_example.Po -storage/heap/.deps/_check.Po -storage/heap/.deps/_rectest.Po -storage/heap/.deps/hp_block.Po -storage/heap/.deps/hp_clear.Po -storage/heap/.deps/hp_close.Po -storage/heap/.deps/hp_create.Po -storage/heap/.deps/hp_delete.Po -storage/heap/.deps/hp_extra.Po -storage/heap/.deps/hp_hash.Po -storage/heap/.deps/hp_info.Po -storage/heap/.deps/hp_open.Po -storage/heap/.deps/hp_panic.Po -storage/heap/.deps/hp_rename.Po -storage/heap/.deps/hp_rfirst.Po -storage/heap/.deps/hp_rkey.Po -storage/heap/.deps/hp_rlast.Po -storage/heap/.deps/hp_rnext.Po -storage/heap/.deps/hp_rprev.Po -storage/heap/.deps/hp_rrnd.Po -storage/heap/.deps/hp_rsame.Po -storage/heap/.deps/hp_scan.Po -storage/heap/.deps/hp_static.Po -storage/heap/.deps/hp_test1.Po -storage/heap/.deps/hp_test2.Po -storage/heap/.deps/hp_update.Po -storage/heap/.deps/hp_write.Po -storage/heap/hp_test1 -storage/heap/hp_test2 -storage/innobase/autom4te-2.53.cache/* -storage/innobase/autom4te-2.53.cache/output.0 -storage/innobase/autom4te-2.53.cache/requests -storage/innobase/autom4te-2.53.cache/traces.0 -storage/innobase/autom4te.cache/* -storage/innobase/autom4te.cache/output.0 -storage/innobase/autom4te.cache/requests -storage/innobase/autom4te.cache/traces.0 -storage/innobase/btr/.deps/btr0btr.Po -storage/innobase/btr/.deps/btr0cur.Po -storage/innobase/btr/.deps/btr0pcur.Po -storage/innobase/btr/.deps/btr0sea.Po -storage/innobase/buf/.deps/buf0buf.Po -storage/innobase/buf/.deps/buf0flu.Po -storage/innobase/buf/.deps/buf0lru.Po -storage/innobase/buf/.deps/buf0rea.Po -storage/innobase/configure.lineno -storage/innobase/conftest.s1 -storage/innobase/conftest.subs -storage/innobase/data/.deps/data0data.Po -storage/innobase/data/.deps/data0type.Po -storage/innobase/dict/.deps/dict0boot.Po -storage/innobase/dict/.deps/dict0crea.Po -storage/innobase/dict/.deps/dict0dict.Po -storage/innobase/dict/.deps/dict0load.Po -storage/innobase/dict/.deps/dict0mem.Po -storage/innobase/dyn/.deps/dyn0dyn.Po -storage/innobase/eval/.deps/eval0eval.Po -storage/innobase/eval/.deps/eval0proc.Po -storage/innobase/fil/.deps/fil0fil.Po -storage/innobase/fsp/.deps/fsp0fsp.Po -storage/innobase/fut/.deps/fut0fut.Po -storage/innobase/fut/.deps/fut0lst.Po -storage/innobase/ha/.deps/ha0ha.Po -storage/innobase/ha/.deps/hash0hash.Po -storage/innobase/ib_config.h -storage/innobase/ib_config.h.in -storage/innobase/ibuf/.deps/ibuf0ibuf.Po -storage/innobase/lock/.deps/lock0lock.Po -storage/innobase/log/.deps/log0log.Po -storage/innobase/log/.deps/log0recv.Po -storage/innobase/mach/.deps/mach0data.Po -storage/innobase/mem/.deps/mem0mem.Po -storage/innobase/mem/.deps/mem0pool.Po -storage/innobase/mkinstalldirs -storage/innobase/mtr/.deps/mtr0log.Po -storage/innobase/mtr/.deps/mtr0mtr.Po -storage/innobase/os/.deps/os0file.Po -storage/innobase/os/.deps/os0proc.Po -storage/innobase/os/.deps/os0sync.Po -storage/innobase/os/.deps/os0thread.Po -storage/innobase/page/.deps/page0cur.Po -storage/innobase/page/.deps/page0page.Po -storage/innobase/pars/.deps/lexyy.Po -storage/innobase/pars/.deps/pars0grm.Po -storage/innobase/pars/.deps/pars0opt.Po -storage/innobase/pars/.deps/pars0pars.Po -storage/innobase/pars/.deps/pars0sym.Po -storage/innobase/que/.deps/que0que.Po -storage/innobase/read/.deps/read0read.Po -storage/innobase/rem/.deps/rem0cmp.Po -storage/innobase/rem/.deps/rem0rec.Po -storage/innobase/row/.deps/row0ins.Po -storage/innobase/row/.deps/row0mysql.Po -storage/innobase/row/.deps/row0purge.Po -storage/innobase/row/.deps/row0row.Po -storage/innobase/row/.deps/row0sel.Po -storage/innobase/row/.deps/row0uins.Po -storage/innobase/row/.deps/row0umod.Po -storage/innobase/row/.deps/row0undo.Po -storage/innobase/row/.deps/row0upd.Po -storage/innobase/row/.deps/row0vers.Po -storage/innobase/srv/.deps/srv0que.Po -storage/innobase/srv/.deps/srv0srv.Po -storage/innobase/srv/.deps/srv0start.Po -storage/innobase/stamp-h1 -storage/innobase/sync/.deps/sync0arr.Po -storage/innobase/sync/.deps/sync0rw.Po -storage/innobase/sync/.deps/sync0sync.Po -storage/innobase/thr/.deps/thr0loc.Po -storage/innobase/trx/.deps/trx0purge.Po -storage/innobase/trx/.deps/trx0rec.Po -storage/innobase/trx/.deps/trx0roll.Po -storage/innobase/trx/.deps/trx0rseg.Po -storage/innobase/trx/.deps/trx0sys.Po -storage/innobase/trx/.deps/trx0trx.Po -storage/innobase/trx/.deps/trx0undo.Po -storage/innobase/usr/.deps/usr0sess.Po -storage/innobase/ut/.deps/ut0byte.Po -storage/innobase/ut/.deps/ut0dbg.Po -storage/innobase/ut/.deps/ut0list.Po -storage/innobase/ut/.deps/ut0mem.Po -storage/innobase/ut/.deps/ut0rnd.Po -storage/innobase/ut/.deps/ut0ut.Po -storage/innobase/ut/.deps/ut0vec.Po -storage/innobase/ut/.deps/ut0wqueue.Po -storage/myisam/.deps/ft_boolean_search.Po -storage/myisam/.deps/ft_nlq_search.Po -storage/myisam/.deps/ft_parser.Po -storage/myisam/.deps/ft_static.Po -storage/myisam/.deps/ft_stopwords.Po -storage/myisam/.deps/ft_update.Po -storage/myisam/.deps/mi_cache.Po -storage/myisam/.deps/mi_changed.Po -storage/myisam/.deps/mi_check.Po -storage/myisam/.deps/mi_checksum.Po -storage/myisam/.deps/mi_close.Po -storage/myisam/.deps/mi_create.Po -storage/myisam/.deps/mi_dbug.Po -storage/myisam/.deps/mi_delete.Po -storage/myisam/.deps/mi_delete_all.Po -storage/myisam/.deps/mi_delete_table.Po -storage/myisam/.deps/mi_dynrec.Po -storage/myisam/.deps/mi_extra.Po -storage/myisam/.deps/mi_info.Po -storage/myisam/.deps/mi_key.Po -storage/myisam/.deps/mi_keycache.Po -storage/myisam/.deps/mi_locking.Po -storage/myisam/.deps/mi_log.Po -storage/myisam/.deps/mi_open.Po -storage/myisam/.deps/mi_packrec.Po -storage/myisam/.deps/mi_page.Po -storage/myisam/.deps/mi_panic.Po -storage/myisam/.deps/mi_preload.Po -storage/myisam/.deps/mi_range.Po -storage/myisam/.deps/mi_rename.Po -storage/myisam/.deps/mi_rfirst.Po -storage/myisam/.deps/mi_rkey.Po -storage/myisam/.deps/mi_rlast.Po -storage/myisam/.deps/mi_rnext.Po -storage/myisam/.deps/mi_rnext_same.Po -storage/myisam/.deps/mi_rprev.Po -storage/myisam/.deps/mi_rrnd.Po -storage/myisam/.deps/mi_rsame.Po -storage/myisam/.deps/mi_rsamepos.Po -storage/myisam/.deps/mi_scan.Po -storage/myisam/.deps/mi_search.Po -storage/myisam/.deps/mi_static.Po -storage/myisam/.deps/mi_statrec.Po -storage/myisam/.deps/mi_test1.Po -storage/myisam/.deps/mi_test2.Po -storage/myisam/.deps/mi_test3.Po -storage/myisam/.deps/mi_unique.Po -storage/myisam/.deps/mi_update.Po -storage/myisam/.deps/mi_write.Po -storage/myisam/.deps/myisam_ftdump.Po -storage/myisam/.deps/myisamchk.Po -storage/myisam/.deps/myisamlog.Po -storage/myisam/.deps/myisampack.Po -storage/myisam/.deps/rt_index.Po -storage/myisam/.deps/rt_key.Po -storage/myisam/.deps/rt_mbr.Po -storage/myisam/.deps/rt_split.Po -storage/myisam/.deps/rt_test.Po -storage/myisam/.deps/sort.Po -storage/myisam/.deps/sp_key.Po -storage/myisam/.deps/sp_test.Po -storage/myisam/FT1.MYD -storage/myisam/FT1.MYI -storage/myisam/ft_dump -storage/myisam/ft_eval -storage/myisam/ft_test1 -storage/myisam/ftbench/data -storage/myisam/ftbench/t -storage/myisam/ftbench/var/* -storage/myisam/mi_test1 -storage/myisam/mi_test2 -storage/myisam/mi_test3 -storage/myisam/mi_test_all -storage/myisam/myisam.log -storage/myisam/myisam_ftdump -storage/myisam/myisamchk -storage/myisam/myisamlog -storage/myisam/myisampack -storage/myisam/rt_test -storage/myisam/rt_test.MYD -storage/myisam/rt_test.MYI -storage/myisam/sp_test -storage/myisam/test1.MYD -storage/myisam/test1.MYI -storage/myisam/test2.MYD -storage/myisam/test2.MYI -storage/myisammrg/.deps/myrg_close.Po -storage/myisammrg/.deps/myrg_create.Po -storage/myisammrg/.deps/myrg_delete.Po -storage/myisammrg/.deps/myrg_extra.Po -storage/myisammrg/.deps/myrg_info.Po -storage/myisammrg/.deps/myrg_locking.Po -storage/myisammrg/.deps/myrg_open.Po -storage/myisammrg/.deps/myrg_panic.Po -storage/myisammrg/.deps/myrg_queue.Po -storage/myisammrg/.deps/myrg_range.Po -storage/myisammrg/.deps/myrg_rfirst.Po -storage/myisammrg/.deps/myrg_rkey.Po -storage/myisammrg/.deps/myrg_rlast.Po -storage/myisammrg/.deps/myrg_rnext.Po -storage/myisammrg/.deps/myrg_rnext_same.Po -storage/myisammrg/.deps/myrg_rprev.Po -storage/myisammrg/.deps/myrg_rrnd.Po -storage/myisammrg/.deps/myrg_rsame.Po -storage/myisammrg/.deps/myrg_static.Po -storage/myisammrg/.deps/myrg_update.Po -storage/myisammrg/.deps/myrg_write.Po -storage/ndb/bin/DbAsyncGenerator -storage/ndb/bin/DbCreate -storage/ndb/bin/acid -storage/ndb/bin/async-lmc-bench-l-p10.sh -storage/ndb/bin/async-lmc-bench-l.sh -storage/ndb/bin/async-lmc-bench-p10.sh -storage/ndb/bin/async-lmc-bench.sh -storage/ndb/bin/atrt -storage/ndb/bin/atrt-analyze-result.sh -storage/ndb/bin/atrt-clear-result.sh -storage/ndb/bin/atrt-gather-result.sh -storage/ndb/bin/atrt-setup.sh -storage/ndb/bin/bankCreator -storage/ndb/bin/bankMakeGL -storage/ndb/bin/bankSumAccounts -storage/ndb/bin/bankTimer -storage/ndb/bin/bankTransactionMaker -storage/ndb/bin/bankValidateAllGLs -storage/ndb/bin/basicTransporterTest -storage/ndb/bin/benchronja -storage/ndb/bin/bulk_copy -storage/ndb/bin/copy_tab -storage/ndb/bin/create_all_tabs -storage/ndb/bin/create_index -storage/ndb/bin/create_tab -storage/ndb/bin/delete_all -storage/ndb/bin/desc -storage/ndb/bin/drop_all_tabs -storage/ndb/bin/drop_index -storage/ndb/bin/drop_tab -storage/ndb/bin/flexAsynch -storage/ndb/bin/flexBench -storage/ndb/bin/flexHammer -storage/ndb/bin/flexScan -storage/ndb/bin/flexTT -storage/ndb/bin/hugoCalculator -storage/ndb/bin/hugoFill -storage/ndb/bin/hugoLoad -storage/ndb/bin/hugoLockRecords -storage/ndb/bin/hugoPkDelete -storage/ndb/bin/hugoPkRead -storage/ndb/bin/hugoPkReadRecord -storage/ndb/bin/hugoPkUpdate -storage/ndb/bin/hugoScanRead -storage/ndb/bin/hugoScanUpdate -storage/ndb/bin/index -storage/ndb/bin/index2 -storage/ndb/bin/initronja -storage/ndb/bin/interpreterInTup -storage/ndb/bin/list_tables -storage/ndb/bin/make-config.sh -storage/ndb/bin/mgmtclient -storage/ndb/bin/mgmtsrvr -storage/ndb/bin/mkconfig -storage/ndb/bin/ndb -storage/ndb/bin/ndb_cpcc -storage/ndb/bin/ndb_cpcd -storage/ndb/bin/ndb_rep -storage/ndb/bin/ndbsql -storage/ndb/bin/newton_basic -storage/ndb/bin/newton_br -storage/ndb/bin/newton_pb -storage/ndb/bin/newton_perf -storage/ndb/bin/perfTransporterTest -storage/ndb/bin/printConfig -storage/ndb/bin/printSchemafile -storage/ndb/bin/printSysfile -storage/ndb/bin/redoLogFileReader -storage/ndb/bin/restart -storage/ndb/bin/restarter -storage/ndb/bin/restarter2 -storage/ndb/bin/restarts -storage/ndb/bin/restore -storage/ndb/bin/select_all -storage/ndb/bin/select_count -storage/ndb/bin/telco -storage/ndb/bin/testBackup -storage/ndb/bin/testBank -storage/ndb/bin/testBasic -storage/ndb/bin/testBasicAsynch -storage/ndb/bin/testCopy -storage/ndb/bin/testDataBuffers -storage/ndb/bin/testDict -storage/ndb/bin/testGrep -storage/ndb/bin/testGrepVerify -storage/ndb/bin/testIndex -storage/ndb/bin/testInterpreter -storage/ndb/bin/testKernelDataBuffer -storage/ndb/bin/testLongSig -storage/ndb/bin/testMgm -storage/ndb/bin/testMgmapi -storage/ndb/bin/testNdbApi -storage/ndb/bin/testNodeRestart -storage/ndb/bin/testOIBasic -storage/ndb/bin/testOdbcDriver -storage/ndb/bin/testOperations -storage/ndb/bin/testRestartGci -storage/ndb/bin/testScan -storage/ndb/bin/testScanInterpreter -storage/ndb/bin/testSimplePropertiesSection -storage/ndb/bin/testSystemRestart -storage/ndb/bin/testTimeout -storage/ndb/bin/testTransactions -storage/ndb/bin/test_cpcd -storage/ndb/bin/test_event -storage/ndb/bin/verify_index -storage/ndb/bin/waiter -storage/ndb/config/autom4te.cache/* -storage/ndb/config/config.mk -storage/ndb/examples/ndbapi_example1/ndbapi_example1 -storage/ndb/examples/ndbapi_example2/ndbapi_example2 -storage/ndb/examples/ndbapi_example3/ndbapi_example3 -storage/ndb/examples/ndbapi_example5/ndbapi_example5 -storage/ndb/examples/select_all/select_all -storage/ndb/include/ndb_global.h -storage/ndb/include/ndb_types.h -storage/ndb/include/ndb_version.h -storage/ndb/lib/libMGM_API.so -storage/ndb/lib/libNDB_API.so -storage/ndb/lib/libNDB_ODBC.so -storage/ndb/lib/libNEWTON_API.so -storage/ndb/lib/libNEWTON_BASICTEST_COMMON.so -storage/ndb/lib/libREP_API.so -storage/ndb/lib/libndbclient.so -storage/ndb/lib/libndbclient_extra.so -storage/ndb/ndbapi-examples/mgmapi_logevent/mgmapi_logevent -storage/ndb/ndbapi-examples/mgmapi_logevent2/mgmapi_logevent2 -storage/ndb/ndbapi-examples/ndbapi_async/ndbapi_async -storage/ndb/ndbapi-examples/ndbapi_async1/ndbapi_async1 -storage/ndb/ndbapi-examples/ndbapi_event/ndbapi_event -storage/ndb/ndbapi-examples/ndbapi_retries/ndbapi_retries -storage/ndb/ndbapi-examples/ndbapi_scan/ndbapi_scan -storage/ndb/ndbapi-examples/ndbapi_simple/ndbapi_simple -storage/ndb/ndbapi-examples/ndbapi_simple_dual/ndbapi_simple_dual -storage/ndb/ndbapi-examples/ndbapi_simple_index/ndbapi_simple_index -storage/ndb/src/common/debugger/libtrace.dsp -storage/ndb/src/common/debugger/signaldata/libsignaldataprint.dsp -storage/ndb/src/common/logger/liblogger.dsp -storage/ndb/src/common/mgmcommon/libmgmsrvcommon.dsp -storage/ndb/src/common/mgmcommon/printConfig/*.d -storage/ndb/src/common/portlib/libportlib.dsp -storage/ndb/src/common/transporter/libtransporter.dsp -storage/ndb/src/common/util/libgeneral.dsp -storage/ndb/src/common/util/testBitmask.cpp -storage/ndb/src/cw/cpcd/ndb_cpcd -storage/ndb/src/dummy.cpp -storage/ndb/src/kernel/blocks/backup/libbackup.dsp -storage/ndb/src/kernel/blocks/backup/ndb_print_backup_file -storage/ndb/src/kernel/blocks/backup/restore/ndb_restore -storage/ndb/src/kernel/blocks/cmvmi/libcmvmi.dsp -storage/ndb/src/kernel/blocks/dbacc/libdbacc.dsp -storage/ndb/src/kernel/blocks/dbdict/libdbdict.dsp -storage/ndb/src/kernel/blocks/dbdict/ndb_print_schema_file -storage/ndb/src/kernel/blocks/dbdih/libdbdih.dsp -storage/ndb/src/kernel/blocks/dbdih/ndb_print_sys_file -storage/ndb/src/kernel/blocks/dblqh/libdblqh.dsp -storage/ndb/src/kernel/blocks/dbtc/libdbtc.dsp -storage/ndb/src/kernel/blocks/dbtup/libdbtup.dsp -storage/ndb/src/kernel/blocks/dbtup/test_varpage -storage/ndb/src/kernel/blocks/dbtux/libdbtux.dsp -storage/ndb/src/kernel/blocks/dbutil/libdbutil.dsp -storage/ndb/src/kernel/blocks/grep/libgrep.dsp -storage/ndb/src/kernel/blocks/ndb_print_file -storage/ndb/src/kernel/blocks/ndbcntr/libndbcntr.dsp -storage/ndb/src/kernel/blocks/ndbfs/libndbfs.dsp -storage/ndb/src/kernel/blocks/qmgr/libqmgr.dsp -storage/ndb/src/kernel/blocks/suma/libsuma.dsp -storage/ndb/src/kernel/blocks/trix/libtrix.dsp -storage/ndb/src/kernel/error/liberror.dsp -storage/ndb/src/kernel/ndbd -storage/ndb/src/kernel/ndbd.dsp -storage/ndb/src/kernel/vm/libkernel.dsp -storage/ndb/src/libndb.ver -storage/ndb/src/libndbclient.dsp -storage/ndb/src/mgmapi/libmgmapi.dsp -storage/ndb/src/mgmclient/libndbmgmclient.dsp -storage/ndb/src/mgmclient/ndb_mgm -storage/ndb/src/mgmclient/ndb_mgm.dsp -storage/ndb/src/mgmclient/test_cpcd/*.d -storage/ndb/src/mgmsrv/ndb_mgmd -storage/ndb/src/mgmsrv/ndb_mgmd.dsp -storage/ndb/src/ndbapi/libndbapi.dsp -storage/ndb/src/ndbapi/ndberror_check -storage/ndb/test/ndbapi/DbAsyncGenerator -storage/ndb/test/ndbapi/DbCreate -storage/ndb/test/ndbapi/bank/bankCreator -storage/ndb/test/ndbapi/bank/bankMakeGL -storage/ndb/test/ndbapi/bank/bankSumAccounts -storage/ndb/test/ndbapi/bank/bankTimer -storage/ndb/test/ndbapi/bank/bankTransactionMaker -storage/ndb/test/ndbapi/bank/bankValidateAllGLs -storage/ndb/test/ndbapi/bank/testBank -storage/ndb/test/ndbapi/create_all_tabs -storage/ndb/test/ndbapi/create_tab -storage/ndb/test/ndbapi/drop_all_tabs -storage/ndb/test/ndbapi/flexAsynch -storage/ndb/test/ndbapi/flexBench -storage/ndb/test/ndbapi/flexBench.dsp -storage/ndb/test/ndbapi/flexHammer -storage/ndb/test/ndbapi/flexTT -storage/ndb/test/ndbapi/ndbapi_slow_select -storage/ndb/test/ndbapi/testBackup -storage/ndb/test/ndbapi/testBasic -storage/ndb/test/ndbapi/testBasic.dsp -storage/ndb/test/ndbapi/testBasicAsynch -storage/ndb/test/ndbapi/testBitfield -storage/ndb/test/ndbapi/testBlobs -storage/ndb/test/ndbapi/testBlobs.dsp -storage/ndb/test/ndbapi/testDataBuffers -storage/ndb/test/ndbapi/testDeadlock -storage/ndb/test/ndbapi/testDict -storage/ndb/test/ndbapi/testIndex -storage/ndb/test/ndbapi/testIndexStat -storage/ndb/test/ndbapi/testInterpreter -storage/ndb/test/ndbapi/testLcp -storage/ndb/test/ndbapi/testMgm -storage/ndb/test/ndbapi/testNdbApi -storage/ndb/test/ndbapi/testNodeRestart -storage/ndb/test/ndbapi/testOIBasic -storage/ndb/test/ndbapi/testOperations -storage/ndb/test/ndbapi/testPartitioning -storage/ndb/test/ndbapi/testReadPerf -storage/ndb/test/ndbapi/testRestartGci -storage/ndb/test/ndbapi/testSRBank -storage/ndb/test/ndbapi/testScan -storage/ndb/test/ndbapi/testScan.dsp -storage/ndb/test/ndbapi/testScanInterpreter -storage/ndb/test/ndbapi/testScanPerf -storage/ndb/test/ndbapi/testSystemRestart -storage/ndb/test/ndbapi/testTimeout -storage/ndb/test/ndbapi/testTransactions -storage/ndb/test/ndbapi/test_event -storage/ndb/test/ndbapi/test_event_merge -storage/ndb/test/run-test/atrt -storage/ndb/test/src/libNDBT.dsp -storage/ndb/test/tools/copy_tab -storage/ndb/test/tools/create_index -storage/ndb/test/tools/hugoCalculator -storage/ndb/test/tools/hugoFill -storage/ndb/test/tools/hugoLoad -storage/ndb/test/tools/hugoLockRecords -storage/ndb/test/tools/hugoPkDelete -storage/ndb/test/tools/hugoPkRead -storage/ndb/test/tools/hugoPkReadRecord -storage/ndb/test/tools/hugoPkUpdate -storage/ndb/test/tools/hugoScanRead -storage/ndb/test/tools/hugoScanUpdate -storage/ndb/test/tools/listen_event -storage/ndb/test/tools/ndb_cpcc -storage/ndb/test/tools/rep_latency -storage/ndb/test/tools/restart -storage/ndb/test/tools/verify_index -storage/ndb/tools/ndb_config -storage/ndb/tools/ndb_delete_all -storage/ndb/tools/ndb_delete_all.dsp -storage/ndb/tools/ndb_desc -storage/ndb/tools/ndb_desc.dsp -storage/ndb/tools/ndb_drop_index -storage/ndb/tools/ndb_drop_index.dsp -storage/ndb/tools/ndb_drop_table -storage/ndb/tools/ndb_drop_table.dsp -storage/ndb/tools/ndb_restore -storage/ndb/tools/ndb_select_all -storage/ndb/tools/ndb_select_all.dsp -storage/ndb/tools/ndb_select_count -storage/ndb/tools/ndb_select_count.dsp -storage/ndb/tools/ndb_show_tables -storage/ndb/tools/ndb_show_tables.dsp -storage/ndb/tools/ndb_test_platform -storage/ndb/tools/ndb_waiter -storage/ndb/tools/ndb_waiter.dsp -strings/*.ds? -strings/*.vcproj -strings/.deps/bchange.Po -strings/.deps/bcmp.Po -strings/.deps/bfill.Po -strings/.deps/bmove.Po -strings/.deps/bmove512.Po -strings/.deps/bmove_upp.Po -strings/.deps/conf_to_src.Po -strings/.deps/ctype-big5.Po -strings/.deps/ctype-bin.Po -strings/.deps/ctype-cp932.Po -strings/.deps/ctype-czech.Po -strings/.deps/ctype-euc_kr.Po -strings/.deps/ctype-eucjpms.Po -strings/.deps/ctype-extra.Po -strings/.deps/ctype-gb2312.Po -strings/.deps/ctype-gbk.Po -strings/.deps/ctype-latin1.Po -strings/.deps/ctype-mb.Po -strings/.deps/ctype-simple.Po -strings/.deps/ctype-sjis.Po -strings/.deps/ctype-tis620.Po -strings/.deps/ctype-uca.Po -strings/.deps/ctype-ucs2.Po -strings/.deps/ctype-ujis.Po -strings/.deps/ctype-utf8.Po -strings/.deps/ctype-win1250ch.Po -strings/.deps/ctype.Po -strings/.deps/decimal.Po -strings/.deps/int2str.Po -strings/.deps/is_prefix.Po -strings/.deps/llstr.Po -strings/.deps/longlong2str.Po -strings/.deps/longlong2str_asm.Po -strings/.deps/my_strchr.Po -strings/.deps/my_strtoll10.Po -strings/.deps/my_vsnprintf.Po -strings/.deps/r_strinstr.Po -strings/.deps/str2int.Po -strings/.deps/str_alloc.Po -strings/.deps/strappend.Po -strings/.deps/strcend.Po -strings/.deps/strcont.Po -strings/.deps/strend.Po -strings/.deps/strfill.Po -strings/.deps/strinstr.Po -strings/.deps/strmake.Po -strings/.deps/strmov.Po -strings/.deps/strnlen.Po -strings/.deps/strnmov.Po -strings/.deps/strstr.Po -strings/.deps/strtod.Po -strings/.deps/strtol.Po -strings/.deps/strtoll.Po -strings/.deps/strtoul.Po -strings/.deps/strtoull.Po -strings/.deps/strxmov.Po -strings/.deps/strxnmov.Po -strings/.deps/xml.Po -strings/conf_to_src -strings/ctype_autoconf.c -strings/ctype_extra_sources.c -strings/str_test -strings/test_decimal -support-files/*.ini -support-files/MacOSX/Description.plist -support-files/MacOSX/Info.plist -support-files/MacOSX/ReadMe.txt -support-files/MacOSX/StartupParameters.plist -support-files/MacOSX/postflight -support-files/MacOSX/postinstall -support-files/MacOSX/preflight -support-files/MacOSX/preinstall -support-files/binary-configure -support-files/my-huge.cnf -support-files/my-innodb-heavy-4G.cnf -support-files/my-large.cnf -support-files/my-medium.cnf -support-files/my-small.cnf -support-files/mysql-3.23.25-beta.spec -support-files/mysql-3.23.26-beta.spec -support-files/mysql-3.23.27-beta.spec -support-files/mysql-3.23.28-gamma.spec -support-files/mysql-3.23.29-gamma.spec -support-files/mysql-log-rotate -support-files/mysql.server -support-files/mysql.spec -support-files/mysqld_multi.server -support-files/ndb-config-2-node.ini -tags -test/ndbapi/bank/bankCreator -test/ndbapi/bank/bankMakeGL -test/ndbapi/bank/bankSumAccounts -test/ndbapi/bank/bankTimer -test/ndbapi/bank/bankTransactionMaker -test/ndbapi/bank/bankValidateAllGLs -test/ndbapi/bank/testBank -test/ndbapi/create_all_tabs -test/ndbapi/create_tab -test/ndbapi/drop_all_tabs -test/ndbapi/flexAsynch -test/ndbapi/flexBench -test/ndbapi/flexHammer -test/ndbapi/flexTT -test/ndbapi/testBackup -test/ndbapi/testBasic -test/ndbapi/testBasicAsynch -test/ndbapi/testBlobs -test/ndbapi/testDataBuffers -test/ndbapi/testDeadlock -test/ndbapi/testDict -test/ndbapi/testIndex -test/ndbapi/testMgm -test/ndbapi/testNdbApi -test/ndbapi/testNodeRestart -test/ndbapi/testOIBasic -test/ndbapi/testOperations -test/ndbapi/testRestartGci -test/ndbapi/testScan -test/ndbapi/testScanInterpreter -test/ndbapi/testScanPerf -test/ndbapi/testSystemRestart -test/ndbapi/testTimeout -test/ndbapi/testTransactions -test/ndbapi/test_event -test/run-test/atrt -test/tools/copy_tab -test/tools/create_index -test/tools/hugoCalculator -test/tools/hugoFill -test/tools/hugoLoad -test/tools/hugoLockRecords -test/tools/hugoPkDelete -test/tools/hugoPkRead -test/tools/hugoPkReadRecord -test/tools/hugoPkUpdate -test/tools/hugoScanRead -test/tools/hugoScanUpdate -test/tools/ndb_cpcc -test/tools/restart -test/tools/verify_index -test1/* -test_xml -tests/*.ds? -tests/*.vcproj -tests/.deps/dummy.Po -tests/.deps/insert_test.Po -tests/.deps/mysql_client_test.Po -tests/.deps/select_test.Po -tests/.deps/thread_test.Po -tests/.libs -prune -tests/.libs/lt-mysql_client_test -tests/.libs/mysql_client_test -tests/bug25714 -tests/client_test -tests/connect_test -tests/mysql_client_test -thr_insert_test/* -thr_test/* -thread_test -tmp/* -tools/.libs -prune -tools/my_vsnprintf.c -tools/mysqlmanager -tools/mysqlmngd -tools/mysqltestmanager -tools/mysys_priv.h -unittest/examples/*.t -unittest/examples/.deps/no_plan-t.Po -unittest/examples/.deps/simple-t.Po -unittest/examples/.deps/skip-t.Po -unittest/examples/.deps/skip_all-t.Po -unittest/examples/.deps/todo-t.Po -unittest/gunit/merge_large_tests.cc -unittest/gunit/merge_small_tests.cc -unittest/mysys/*.t -unittest/mysys/.deps/base64-t.Po -unittest/mysys/.deps/my_atomic-t.Po -unittest/mytap/.deps/tap.Po -unittest/mytap/t/*.t -unittest/mytap/t/.deps/basic-t.Po -unittest/unit -vi.h -vio/*.ds? -vio/*.vcproj -vio/.deps/dummy.Po -vio/.deps/test-ssl.Po -vio/.deps/test-sslclient.Po -vio/.deps/test-sslserver.Po -vio/.deps/vio.Po -vio/.deps/viosocket.Po -vio/.deps/viossl.Po -vio/.deps/viosslfactories.Po -vio/test-ssl -vio/test-sslclient -vio/test-sslserver -vio/viotest-ssl -vio/viotest-sslconnect.cpp -vio/viotest.cpp -win/configure.data -win/vs71cache.txt -win/vs8cache.txt -win/nmake_cache.txt -ylwrap -zlib/*.ds? -zlib/*.vcproj -mysql-test/bug36522-64.tar -mysql-test/bug36522.tar -mysql-test/t.log -mysql-test/tps.log -libmysqld/event_parse_data.cc -autom4te.cache -sql/share/czech -sql/share/danish -sql/share/dutch -sql/share/english -sql/share/estonian -sql/share/french -sql/share/german -sql/share/greek -sql/share/hungarian -sql/share/italian -sql/share/japanese -sql/share/japanese-sjis -sql/share/korean -sql/share/norwegian -sql/share/norwegian-ny -sql/share/polish -sql/share/portuguese -sql/share/romanian -sql/share/russian -sql/share/serbian -sql/share/slovak -sql/share/spanish -sql/share/swedish -sql/share/ukrainian -*.jar -*.dylib -*.stamp -storage/ndb/**/*.dir -storage/ndb/**/CMakeFiles -storage/ndb/**/target -storage/ndb/**/*.class -storage/ndb/src/ndbjtie/**/*.sh -storage/ndb/src/ndbjtie/**/*.log -storage/ndb/src/ndbjtie/jtie/test/myapi/myapi_test -storage/ndb/clusterj/**/*MANIFEST.MF -storage/ndb/clusterj/**/*manifest.mf -storage/ndb/test/crund/*.cnf -storage/ndb/test/crund/*.ini* -storage/ndb/test/crund/*.properties -storage/ndb/test/crund/build/ -storage/ndb/test/crund/javadoc/ -storage/ndb/test/crund/lib/ -storage/ndb/test/crund/**/log* -storage/ndb/test/crund/martins_little_helpers/src/utils/Properties_test -storage/ndb/test/crund/martins_little_helpers/src/utils/hrt_stopwatch_test -storage/ndb/test/crund/martins_little_helpers/src/utils/hrt_utils_test -storage/ndb/test/crund/martins_little_helpers/src/utils/utils_HrtStopwatch.h -storage/ndb/test/crund/martins_little_helpers/src/utils/utils_JniInstrumentationTest.h -storage/ndb/test/crund/scripts/ndblog -storage/ndb/test/crund/scripts/results -storage/ndb/test/crund/src/crundndb/NdbApiDriver -storage/ndb/test/crund/src/crundndb/com_mysql_cluster_crund_NdbApiLoad.h -storage/ndb/test/crund/tws/tws_java/build/ -storage/ndb/test/crund/tws/tws_java/nbproject/configs/ -storage/ndb/test/crund/tws/tws_java/nbproject/private/ -storage/ndb/test/crund/tws/tws_java/run.properties -storage/ndb/test/crund/tws/*.properties -storage/ndb/test/crund/tws/tws_cpp/TwsDriver - -libmysqld/examples/mysqltest.cc -libmysqld/sql_signal.cc -libmysqld/debug_sync.cc -dbug/tests -libmysqld/mdl.cc -client/transaction.h -libmysqld/transaction.cc -libmysqld/sys_vars.cc -libmysqld/keycaches.cc -client/dtoa.c -libmysqld/opt_trace.cc -libmysqld/sql_audit.cc -storage/archive/archive_performance -storage/archive/concurrency_test -libmysql_r/client_settings.h -libmysqld/scheduler.cc -libmysqld/sql_connect.cc -libmysqld/sql_tablespace.cc -mysql-test/dump.txt -configure.am -run_collection*.cmake -configure.am -run_collection*.cmake -cmake_install.cmake -CMakeFiles.cmake -CPackConfig.cmake -CPackSourceConfig.cmake -CTestTestfile.cmake -make_dist.cmake -_CPack_Packages -merge_archives*.cmake -libmysqld/des_key_file.cc -CPackConfig.cmake -CPackSourceConfig.cmake -make_dist.cmake -client/echo -libmysql/libmysql_exports_file.cc -libmysql/merge_archives_mysqlclient.cmake -libmysqld/merge_archives_mysqlserver.cmake -libmysqld/mysqlserver_depends.c -libmysqld/examples/mysql_embedded -libmysqld/sql_bootstrap.cc -sql/dummy.bak -mysys/thr_lock -mysys/queues -libmysqld/binlog.cc -libmysqld/sql_alter.cc -libmysqld/sql_partition_admin.cc -generated -doxyerror.log -VERSION.dep -info_macros.cmake -Docs/INFO_BIN -Docs/INFO_SRC -Testing -FilesCopied -source_downloads -client/mysql_plugin -support-files/plugins.files -storage/perfschema/pfs_lex_token.h -storage/perfschema/gen_pfs_lex_token -sql/share/bulgarian diff --git a/mysql-wsrep-5.6/BUILD-CMAKE b/mysql-wsrep-5.6/BUILD-CMAKE deleted file mode 100644 index c293cb3e..00000000 --- a/mysql-wsrep-5.6/BUILD-CMAKE +++ /dev/null @@ -1,4 +0,0 @@ -The latest information about building MySQL with CMake is located on -http://dev.mysql.com/doc/internals/en/cmake.html - -See also BUILD/README diff --git a/mysql-wsrep-5.6/BUILD/README b/mysql-wsrep-5.6/BUILD/README index 711ab0c1..49386c75 100644 --- a/mysql-wsrep-5.6/BUILD/README +++ b/mysql-wsrep-5.6/BUILD/README @@ -24,11 +24,11 @@ Adding -DWITH_DEBUG=1 to the cmake command line gives you a debug build. Building on Windows is slightly different: cd -cmake +cmake -devenv MySQL.sln /build Debug +cmake --build . --config Debug or -devenv MySQL.sln /build RelWithDebInfo +cmake --build . --config RelWithDebInfo If you have special needs, you can disable the defaults by setting @@ -36,3 +36,8 @@ these cmake variables off: WITH_DEFAULT_COMPILER_OPTIONS WITH_DEFAULT_FEATURE_SET + +Note: For building with unit tests, you need to tell cmake where to find +the sources, see ../unittest/gunit/CMakeLists.txt +You should *not* 'make install' googletest/googlemock on your system, +the libraries must be built from source, with the unit tests. diff --git a/mysql-wsrep-5.6/BUILD/compile-pentium-valgrind-max-no-ndb b/mysql-wsrep-5.6/BUILD/compile-pentium-valgrind-max-no-ndb index 7c3e68dc..8da6c8b5 100755 --- a/mysql-wsrep-5.6/BUILD/compile-pentium-valgrind-max-no-ndb +++ b/mysql-wsrep-5.6/BUILD/compile-pentium-valgrind-max-no-ndb @@ -20,5 +20,5 @@ path=`dirname $0` cmake $path/.. -DWITH_DEBUG=1 -DWITH_VALGRIND=1 \ -DCMAKE_C_FLAGS=-DHAVE_purify -DCMAKE_CXX_FLAGS=-DHAVE_purify \ - -DWITH_NDBCLUSTER=0 -make + -DWITH_NDBCLUSTER=0 -DWITH_WSREP=1 +make -j 4 diff --git a/mysql-wsrep-5.6/CMakeLists.txt b/mysql-wsrep-5.6/CMakeLists.txt index 5be5e924..ae62d194 100644 --- a/mysql-wsrep-5.6/CMakeLists.txt +++ b/mysql-wsrep-5.6/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2016, 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 @@ -19,6 +19,11 @@ if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 2.6) CMAKE_POLICY(VERSION 2.8) endif() +# We use CMAKE_SHARED_LIBRARY__FLAGS. See cmake --help-policy CMP0018 +IF(CMAKE_VERSION VERSION_GREATER "2.8.8") + CMAKE_POLICY(SET CMP0018 OLD) +ENDIF() + # We use PROPERTIES LINK_INTERFACE_LIBRARIES. See cmake --help-policy CMP0022 IF(CMAKE_VERSION VERSION_EQUAL "2.8.12" OR CMAKE_VERSION VERSION_GREATER "2.8.12") @@ -176,6 +181,7 @@ IF(WITH_DEFAULT_FEATURE_SET) ENDIF() # Add macros +INCLUDE(wsrep) INCLUDE(character_sets) INCLUDE(cpu_info) INCLUDE(zlib) @@ -324,6 +330,12 @@ OPTION(OPTIMIZER_TRACE "Support tracing of Optimizer" ON) OPTION(INNODB_COMPILER_HINTS "Compile InnoDB with compiler hints" ON) MARK_AS_ADVANCED(INNODB_COMPILER_HINTS) +OPTION(WITH_INNODB_DISALLOW_WRITES "InnoDB freeze writes patch from Google" ${WITH_WSREP}) +IF (WITH_INNODB_DISALLOW_WRITES) + MESSAGE(STATUS "INNODB_DISALLOW_WRITES") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWITH_INNODB_DISALLOW_WRITES") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWITH_INNODB_DISALLOW_WRITES") +ENDIF() OPTION(INNODB_PAGE_ATOMIC_REF_COUNT "Use atomics for the page reference count" ON) MARK_AS_ADVANCED(INNODB_PAGE_ATOMIC_REF_COUNT) @@ -383,9 +395,16 @@ IF(SYSCONFDIR) SET(DEFAULT_SYSCONFDIR "${SYSCONFDIR}") ENDIF() -SET(TMPDIR "P_tmpdir" - CACHE PATH - "PATH to MySQL TMP dir. Defaults to the P_tmpdir macro in ") +IF(WIN32) # P_tmpdir is not defined on Windows as of VS2015. + SET(TMPDIR "" # So we use empty path as default. In practice TMP/TEMP is used + CACHE PATH + "PATH to MySQL TMP dir") +ELSE() + SET(TMPDIR "P_tmpdir" + CACHE PATH + "PATH to MySQL TMP dir. Defaults to the P_tmpdir macro in ") +ENDIF() + IF(TMPDIR STREQUAL "P_tmpdir") # Do not quote it, to refer to the P_tmpdir macro. SET(DEFAULT_TMPDIR "P_tmpdir") @@ -444,6 +463,9 @@ ADD_SUBDIRECTORY(regex) ADD_SUBDIRECTORY(mysys) ADD_SUBDIRECTORY(mysys_ssl) ADD_SUBDIRECTORY(libmysql) +IF(WITH_WSREP) +ADD_SUBDIRECTORY(wsrep) +ENDIF() IF(WITH_UNIT_TESTS) ADD_SUBDIRECTORY(unittest) @@ -495,6 +517,7 @@ IF(NOT WITHOUT_SERVER) ADD_SUBDIRECTORY(packaging/rpm-oel) ADD_SUBDIRECTORY(packaging/rpm-fedora) ADD_SUBDIRECTORY(packaging/rpm-sles) + ADD_SUBDIRECTORY(packaging/rpm-docker) ENDIF() INCLUDE(cmake/abi_check.cmake) @@ -539,7 +562,7 @@ ADD_SUBDIRECTORY(packaging/solaris) # (see http://public.kitware.com/Bug/view.php?id=11452) SET(CPACK_MONOLITHIC_INSTALL 1 CACHE INTERNAL "") -IF(UNIX) +IF(UNIX AND NOT WITH_WSREP) INSTALL(FILES Docs/mysql.info DESTINATION ${INSTALL_INFODIR} OPTIONAL COMPONENT Info) ENDIF() # @@ -553,15 +576,13 @@ IF(NOT INSTALL_LAYOUT MATCHES "RPM") ) INSTALL(FILES README DESTINATION ${INSTALL_DOCREADMEDIR} COMPONENT Readme) INSTALL(FILES ${CMAKE_BINARY_DIR}/Docs/INFO_SRC ${CMAKE_BINARY_DIR}/Docs/INFO_BIN DESTINATION ${INSTALL_DOCDIR}) - IF(UNIX) - INSTALL(FILES Docs/INSTALL-BINARY DESTINATION ${INSTALL_DOCREADMEDIR} COMPONENT Readme) - ENDIF() + INSTALL(FILES Docs/README-wsrep DESTINATION ${INSTALL_DOCREADMEDIR} COMPONENT Readme) # 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 "README-wsrep" EXCLUDE PATTERN "Makefile.*" EXCLUDE PATTERN "glibc*" EXCLUDE PATTERN "linuxthreads.txt" EXCLUDE diff --git a/mysql-wsrep-5.6/CONTRIBUTING.md b/mysql-wsrep-5.6/CONTRIBUTING.md new file mode 100644 index 00000000..76c4ff7f --- /dev/null +++ b/mysql-wsrep-5.6/CONTRIBUTING.md @@ -0,0 +1 @@ +If you would like to contribute code to this repository, please sign the Contributor License Agreement. diff --git a/mysql-wsrep-5.6/Docs/ChangeLog b/mysql-wsrep-5.6/Docs/ChangeLog index 9988db36..e1775d5f 100644 --- a/mysql-wsrep-5.6/Docs/ChangeLog +++ b/mysql-wsrep-5.6/Docs/ChangeLog @@ -1 +1,2 @@ -This is a first release, this file is supposed to be empty +Placeholder + diff --git a/mysql-wsrep-5.6/Docs/INFO_SRC b/mysql-wsrep-5.6/Docs/INFO_SRC deleted file mode 100644 index fbc1a6c3..00000000 --- a/mysql-wsrep-5.6/Docs/INFO_SRC +++ /dev/null @@ -1,7 +0,0 @@ -commit: 19ff9770da1307a8b44be40beaa456c4d1149c2a -date: 2015-01-19 14:26:20 +0100 -build-date: 2015-01-19 14:38:00 +0100 -short: 19ff977 -branch: mysql-5.6.23-release - -MySQL source 5.6.23 diff --git a/mysql-wsrep-5.6/Docs/INSTALL-BINARY b/mysql-wsrep-5.6/Docs/INSTALL-BINARY deleted file mode 100644 index 864415f7..00000000 --- a/mysql-wsrep-5.6/Docs/INSTALL-BINARY +++ /dev/null @@ -1,2513 +0,0 @@ -2.2 Installing MySQL on Unix/Linux Using Generic Binaries - - Oracle provides a set of binary distributions of MySQL. These - include binary distributions in the form of compressed tar - files (files with a .tar.gz extension) for a number of - platforms, as well as binaries in platform-specific package - formats for selected platforms. - - This section covers the installation of MySQL from a - compressed tar file binary distribution. For other - platform-specific package formats, see the other - platform-specific sections. For example, for Windows - distributions, see Section 2.3, "Installing MySQL on - Microsoft Windows." - - To obtain MySQL, see Section 2.1.3, "How to Get MySQL." - - MySQL compressed tar file binary distributions have names of - the form mysql-VERSION-OS.tar.gz, where VERSION is a number - (for example, 5.6.23), and OS indicates the type of operating - system for which the distribution is intended (for example, - pc-linux-i686 or winx64). - - To install MySQL from a compressed tar file binary - distribution, your system must have GNU gunzip to uncompress - the distribution and a reasonable tar to unpack it. If your - tar program supports the z option, it can both uncompress and - unpack the file. - - GNU tar is known to work. The standard tar provided with some - operating systems is not able to unpack the long file names - in the MySQL distribution. You should download and install - GNU tar, or if available, use a preinstalled version of GNU - tar. Usually this is available as gnutar, gtar, or as tar - within a GNU or Free Software directory, such as /usr/sfw/bin - or /usr/local/bin. GNU tar is available from - http://www.gnu.org/software/tar/. - Warning - - If you have previously installed MySQL using your operating - system native package management system, such as yum or - apt-get, you may experience problems installing using a - native binary. Make sure your previous MySQL previous - installation has been removed entirely (using your package - management system), and that any additional files, such as - old versions of your data files, have also been removed. You - should also check the existence of configuration files such - as /etc/my.cnf or the /etc/mysql directory have been deleted. - Warning - - MySQL has a dependency on the libaio library. The - mysql_install_db and subsequent mysqld_safe steps will fail - if this library is not installed locally. If necessary, - install it using the appropriate package manager. For - example, on Yum-based systems: -shell> yum search libaio # search for info -shell> yum install libaio # install library - - Or, on APT-based systems: -shell> apt-cache search libaio # search for info -shell> apt-get install libaio1 # install library - - If you run into problems and need to file a bug report, - please use the instructions in Section 1.7, "How to Report - Bugs or Problems." - - On Unix, to install a compressed tar file binary - distribution, unpack it at the installation location you - choose (typically /usr/local/mysql). This creates the - directories shown in the following table. - - Table 2.3 MySQL Installation Layout for Generic Unix/Linux - Binary Package - Directory Contents of Directory - bin Client programs and the mysqld server - data Log files, databases - docs Manual in Info format - man Unix manual pages - include Include (header) files - lib Libraries - scripts mysql_install_db - share Miscellaneous support files, including error messages, - sample configuration files, SQL for database installation - sql-bench Benchmarks - - Debug versions of the mysqld binary are available as - mysqld-debug. To compile your own debug version of MySQL from - a source distribution, use the appropriate configuration - options to enable debugging support. For more information on - compiling from source, see Section 2.9, "Installing MySQL - from Source." - - To install and use a MySQL binary distribution, the basic - command sequence looks like this: -shell> groupadd mysql -shell> useradd -r -g mysql mysql -shell> cd /usr/local -shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz -shell> ln -s full-path-to-mysql-VERSION-OS mysql -shell> cd mysql -shell> chown -R mysql . -shell> chgrp -R mysql . -shell> scripts/mysql_install_db --user=mysql -shell> chown -R root . -shell> chown -R mysql data -shell> bin/mysqld_safe --user=mysql & -# Next command is optional -shell> cp support-files/mysql.server /etc/init.d/mysql.server - - mysql_install_db creates a default option file named my.cnf - in the base installation directory. This file is created from - a template included in the distribution package named - my-default.cnf. For more information, see Section 5.1.2.2, - "Using a Sample Default Server Configuration File." - - A more detailed version of the preceding description for - installing a binary distribution follows. - Note - - This procedure assumes that you have root (administrator) - access to your system. Alternatively, you can prefix each - command using the sudo (Linux) or pfexec (OpenSolaris) - command. - - The procedure does not set up any passwords for MySQL - accounts. After following the procedure, proceed to Section - 2.10.2, "Securing the Initial MySQL Accounts." - -Create a mysql User and Group - - If your system does not already have a user and group for - mysqld to run as, you may need to create one. The following - commands add the mysql group and the mysql user. You might - want to call the user and group something else instead of - mysql. If so, substitute the appropriate name in the - following instructions. The syntax for useradd and groupadd - may differ slightly on different versions of Unix, or they - may have different names such as adduser and addgroup. -shell> groupadd mysql -shell> useradd -r -g mysql mysql - - Note - - Because the user is required only for ownership purposes, not - login purposes, the useradd command uses the -r option to - create a user that does not have login permissions to your - server host. Omit this option to permit logins for the user - (or if your useradd does not support the option). - -Obtain and Unpack the Distribution - - Pick the directory under which you want to unpack the - distribution and change location into it. The example here - unpacks the distribution under /usr/local. The instructions, - therefore, assume that you have permission to create files - and directories in /usr/local. If that directory is - protected, you must perform the installation as root. -shell> cd /usr/local - - Obtain a distribution file using the instructions in Section - 2.1.3, "How to Get MySQL." For a given release, binary - distributions for all platforms are built from the same MySQL - source distribution. - - Unpack the distribution, which creates the installation - directory. Then create a symbolic link to that directory. tar - can uncompress and unpack the distribution if it has z option - support: -shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz -shell> ln -s full-path-to-mysql-VERSION-OS mysql - - The tar command creates a directory named mysql-VERSION-OS. - The ln command makes a symbolic link to that directory. This - enables you to refer more easily to the installation - directory as /usr/local/mysql. - - If your tar does not have z option support, use gunzip to - unpack the distribution and tar to unpack it. Replace the - preceding tar command with the following alternative command - to uncompress and extract the distribution: -shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf - - -Perform Postinstallation Setup - - The remainder of the installation process involves setting up - the configuration file, creating the core databases, and - starting the MySQL server. For next steps, see Section 2.10, - "Postinstallation Setup and Testing." - Note - - The accounts that are listed in the MySQL grant tables - initially have no passwords. After starting the server, you - should set up passwords for them using the instructions in - Section 2.10.2, "Securing the Initial MySQL Accounts." -2.3 Installing MySQL on Microsoft Windows - - There are several different methods to install MySQL on - Microsoft Windows. - -Simple Installation Method - - The simplest and recommended method is to download MySQL - Installer (for Windows) and let it install and configure all - of the MySQL products on your system. Here is how: - - * Download MySQL Installer from - http://dev.mysql.com/downloads/installer/ and execute it. - Note - Unlike the standard MySQL Installer, the smaller - "web-community" version does not bundle any MySQL - applications but it will download the MySQL products you - choose to install. - - * Choose the appropriate Setup Type for your system. - Typically you will choose Developer Default to install - MySQL server and other MySQL tools related to MySQL - development, helpful tools like MySQL Workbench. Or, - choose the Custom setup type to manually select your - desired MySQL products. - Note - Multiple versions of MySQL server can exist on a single - system. You can choose one or multiple versions. - - * Complete the installation process by following the MySQL - Installation wizard's instructions. This will install - several MySQL products and start the MySQL server. - - * MySQL is now installed. You probably configured MySQL as - a service that will automatically start MySQL server - every time you restart your system. - - Note - - You probably also installed other helpful MySQL products like - MySQL Workbench and MySQL Notifier on your system. Consider - loading Chapter 26, "MySQL Workbench" to check your new MySQL - server connection, and Section 2.3.4, "MySQL Notifier" to - view the connection's status. By default, these two programs - automatically start after installing MySQL. - - This process also installs the MySQL Installer application on - your system, and later you can use MySQL Installer to upgrade - or reconfigure your MySQL products. - -Additional Installation Information - - MySQL is available for Microsoft Windows, for both 32-bit and - 64-bit versions. For supported Windows platform information, - see - http://www.mysql.com/support/supportedplatforms/database.html - . - - It is possible to run MySQL as a standard application or as a - Windows service. By using a service, you can monitor and - control the operation of the server through the standard - Windows service management tools. For more information, see - Section 2.3.5.7, "Starting MySQL as a Windows Service." - - Generally, you should install MySQL on Windows using an - account that has administrator rights. Otherwise, you may - encounter problems with certain operations such as editing - the PATH environment variable or accessing the Service - Control Manager. Once installed, MySQL does not need to be - executed using a user with Administrator privileges. - - For a list of limitations on the use of MySQL on the Windows - platform, see Section D.10.6, "Windows Platform Limitations." - - In addition to the MySQL Server package, you may need or want - additional components to use MySQL with your application or - development environment. These include, but are not limited - to: - - * To connect to the MySQL server using ODBC, you must have - a Connector/ODBC driver. For more information, including - installation and configuration instructions, see MySQL - Connector/ODBC Developer Guide - (http://dev.mysql.com/doc/connector-odbc/en/index.html). - Note - MySQL Installer will install and configure Connector/ODBC - for you. - - * To use MySQL server with .NET applications, you must have - the Connector/Net driver. For more information, including - installation and configuration instructions, see MySQL - Connector/Net Developer Guide - (http://dev.mysql.com/doc/connector-net/en/index.html). - Note - MySQL Installer will install and configure Connector/NET - for you. - - MySQL distributions for Windows can be downloaded from - http://dev.mysql.com/downloads/. See Section 2.1.3, "How to - Get MySQL." - - MySQL for Windows is available in several distribution - formats, detailed below. Generally speaking, you should use - MySQL Installer. It contains more features and MySQL products - than the older MSI, is simpler to use than the ZIP file, and - you need no additional tools to get MySQL up and running. - MySQL Installer automatically installs MySQL Server and - additional MySQL products, creates an options file, starts - the server, and enables you to create default user accounts. - For more information on choosing a package, see Section - 2.3.2, "Choosing An Installation Package." - - * A MySQL Installer distribution includes MySQL Server and - additional MySQL products including MySQL Workbench, - MySQL Notifier, and MySQL for Excel. MySQL Installer can - also be used to upgrade these products in the future. - For instructions on installing MySQL using MySQL - Installer, see Section 2.3.3, "Installing MySQL on - Microsoft Windows Using MySQL Installer." - - * The standard binary distribution (packaged as a Zip file) - contains all of the necessary files that you unpack into - your chosen location. This package contains all of the - files in the full Windows MSI Installer package, but does - not include an installation program. - For instructions on installing MySQL using the Zip file, - see Section 2.3.5, "Installing MySQL on Microsoft Windows - Using a noinstall Zip Archive." - - * The source distribution format contains all the code and - support files for building the executables using the - Visual Studio compiler system. - For instructions on building MySQL from source on - Windows, see Section 2.9, "Installing MySQL from Source." - - MySQL on Windows considerations: - - * Large Table Support - If you need tables with a size larger than 4GB, install - MySQL on an NTFS or newer file system. Do not forget to - use MAX_ROWS and AVG_ROW_LENGTH when you create tables. - See Section 13.1.17, "CREATE TABLE Syntax." - - * MySQL and Virus Checking Software - Virus-scanning software such as Norton/Symantec - Anti-Virus on directories containing MySQL data and - temporary tables can cause issues, both in terms of the - performance of MySQL and the virus-scanning software - misidentifying the contents of the files as containing - spam. This is due to the fingerprinting mechanism used by - the virus-scanning software, and the way in which MySQL - rapidly updates different files, which may be identified - as a potential security risk. - After installing MySQL Server, it is recommended that you - disable virus scanning on the main directory (datadir) - used to store your MySQL table data. There is usually a - system built into the virus-scanning software to enable - specific directories to be ignored. - In addition, by default, MySQL creates temporary files in - the standard Windows temporary directory. To prevent the - temporary files also being scanned, configure a separate - temporary directory for MySQL temporary files and add - this directory to the virus scanning exclusion list. To - do this, add a configuration option for the tmpdir - parameter to your my.ini configuration file. For more - information, see Section 2.3.5.2, "Creating an Option - File." - -2.3.1 MySQL Installation Layout on Microsoft Windows - - For MySQL 5.6 on Windows, the default installation directory - is C:\Program Files\MySQL\MySQL Server 5.6. Some Windows - users prefer to install in C:\mysql, the directory that - formerly was used as the default. However, the layout of the - subdirectories remains the same. - - All of the files are located within this parent directory, - using the structure shown in the following table. - - Table 2.4 Default MySQL Installation Layout for Microsoft - Windows - Directory Contents of Directory Notes - bin Client programs and the mysqld server - %ALLUSERSPROFILE%\MySQL\MySQL Server 5.6\ Log files, - databases (Windows XP, Windows Server 2003) The Windows - system variable %ALLUSERSPROFILE% defaults to C:\Documents - and Settings\All Users\Application Data - %PROGRAMDATA%\MySQL\MySQL Server 5.6\ Log files, databases - (Vista, Windows 7, Windows Server 2008, and newer) The - Windows system variable %PROGRAMDATA% defaults to - C:\ProgramData - examples Example programs and scripts - include Include (header) files - lib Libraries - scripts Utility scripts - share Miscellaneous support files, including error messages, - character set files, sample configuration files, SQL for - database installation - - If you install MySQL using the MySQL Installer, this package - creates and sets up the data directory that the installed - server will use, and also creates a pristine "template" data - directory named data under the installation directory. After - an installation has been performed using this package, the - template data directory can be copied to set up additional - MySQL instances. See Section 5.3, "Running Multiple MySQL - Instances on One Machine." - -2.3.2 Choosing An Installation Package - - For MySQL 5.6, there are installation package formats to - choose from when installing MySQL on Windows: - - * MySQL Installer: This package has a file name similar to - mysql-installer-community-5.6.23.0.msi or - mysql-installer-commercial-5.6.23.0.msi, and utilizes - MSIs to automatically install MySQL server and other - products. It will download and apply updates to itself, - and for each of the installed products. It also - configures the additional non-server products. - The installed products are configurable, and this - includes: documentation with samples and examples, - connectors (such as C, C++, J, NET, and ODBC), MySQL - Workbench, MySQL Notifier, MySQL for Excel, and the MySQL - Server with its components. - MySQL Installer will run on all Windows platforms that - are supported by MySQL (see - http://www.mysql.com/support/supportedplatforms/database. - html). - Note - Because MySQL Installer is not a native component of - Microsoft Windows and depends on .NET, it will not work - on minimal installation options like the "Server Core" - version of Windows Server 2008. - For instructions on installing MySQL using MySQL - Installer, see Section 2.3.3, "Installing MySQL on - Microsoft Windows Using MySQL Installer." - - * The Noinstall Archive: This package has a file name - similar to mysql-5.6.23-win32.zip or - mysql-5.6.23-winx64.zip, and contains all the files found - in the Complete install package, with the exception of - the GUI. This package does not include an automated - installer, and must be manually installed and configured. - - MySQL Installer is recommended for most users. - - Your choice of install package affects the installation - process you must follow. If you choose to use MySQL - Installer, see Section 2.3.3, "Installing MySQL on Microsoft - Windows Using MySQL Installer." If you choose to install a - Noinstall archive, see Section 2.3.5, "Installing MySQL on - Microsoft Windows Using a noinstall Zip Archive." - -2.3.3 Installing MySQL on Microsoft Windows Using MySQL Installer - - MySQL Installer simplifies the installation and updating - process for your MySQL products on Microsoft Windows. From - this central application, you can view, remove, update, and - reconfigure the existing MySQL products on your system. MySQL - Installer can also install plugins, documentation, tutorials, - and example databases. The MySQL Installer is only available - for Microsoft Windows, and includes both GUI and command-line - interfaces. - - The supported products include: - - * MySQL server (http://dev.mysql.com/doc/) (one or multiple - versions) - - * MySQL Workbench - - * MySQL Connectors - (http://dev.mysql.com/doc/index-connectors.html) (.Net / - Python / ODBC / Java / C / C++) - - * MySQL Notifier - - * MySQL for Excel - (http://dev.mysql.com/doc/mysql-for-excel/en/index.html) - - * MySQL for Visual Studio - (http://dev.mysql.com/doc/connector-net/en/connector-net- - visual-studio.html) - - * MySQL Utilities and MySQL Fabric - (http://dev.mysql.com/doc/index-utils-fabric.html) - - * MySQL Samples and Examples - - * MySQL Documentation - - * MySQL Installer is also installed and remains on the - system as its own application - -Installer package types - - - * Full: Bundles all of the MySQL products (including the - MySQL server). The file' size is over 200MB, and its name - has the form mysql-installer-community-VERSION.N.msi - where VERSION is the MySQL Server version number such as - 5.6 and N is the package number, which begins at 0. - - * Web: Only contains the Installer and configuration files, - and it only downloads the MySQL products you choose to - install. The size of this file is about 2MB; the name of - the file has the form - mysql-installer-community-web-VERSION.N.msi where VERSION - is the MySQL Server version number such as 5.6 and N is - the package number, which begins at 0. - -Installer editions - - - * Community edition: Downloadable at - http://dev.mysql.com/downloads/installer/. It installs - the community edition of all MySQL products. - - * Commercial edition: Downloadable at either My Oracle - Support (https://support.oracle.com/) (MOS) or - https://edelivery.oracle.com/. It installs the commercial - version of all MySQL products, including Workbench SE/EE. - It also integrates with your MOS account. - Note - Entering your MOS credentials is optional when installing - bundled MySQL products, but your credentials are required - when choosing non-bundled MySQL products that MySQL - Installer must download. - - For notes detailing the changes in each release of MySQL - Installer, see MySQL Installer Release Notes - (http://dev.mysql.com/doc/relnotes/mysql-installer/en/). - - MySQL Installer is compatible with pre-existing - installations, and adds them to its list of installed - components. While the standard MySQL Installer is bundled - with a specific version of MySQL Server, a single MySQL - Installer instance can install and manage multiple MySQL - Server versions. For example, a single MySQL Installer - instance can install (and update) versions 5.5, 5.6, and 5.7 - on the host. - Note - - A single host can not have both community and commercial - editions of MySQL Server installed. For example, if you want - both MySQL Server 5.5 and 5.6 installed on a single host, - then both must be the same edition. - - MySQL Installer handles the initial configuration and set up - of the applications. For example: - - 1. It creates initial MySQL Server connections in MySQL - Workbench. - - 2. It creates the configuration file (my.ini) that is used - to configure the MySQL Server. The values written to this - file are influenced by choices you make during the - installation process. - - 3. It can optionally import example databases. - - 4. It can optionally create MySQL Server user accounts with - configurable permissions based on general roles, such as - DB Administrator, DB Designer, and Backup Admin. It - optionally creates a Windows user named MysqlSys with - limited privileges, which would then run the MySQL - Server. - User accounts may also be added and configured in MySQL - Workbench. - - 5. If the "Advanced Configuration" option is checked, then - the Logging Options are also configured. This includes - defining file paths for the error log, general log, slow - query log (including the configuration of seconds it - requires to execute a query), and the binary log. - - MySQL Installer can optionally check for updated components - and download them for you. - -2.3.3.1 MySQL Installer GUI - - Installing MySQL Installer adds a link to the Start menu - under the MySQL group. Click Start, All Programs MySQL, MySQL - Installer to reload the MySQL Installer GUI. - Note - - Files that are generated by MySQL Installer grant full - permissions to the user that executes MySQL Installer, - including my.ini. This does not apply to files and - directories for specific products such as the MySQL Server - data directory in %ProgramData% that is owned by SYSTEM. - - The initial execution of MySQL Installer requires you to - accept the license agreement before installing MySQL - products. - - Figure 2.7 MySQL Installer - License Agreement - MySQL Installer - License Agreement - -Installing New Packages - - Choose the appropriate Setup Type for your system. The - selected type determines which MySQL products are installed - on your system, or select Custom to manually choose - individual products. - - * Developer: Install all products needed to develop - applications with MySQL. This is the default option. - - * Server only: Only install the MySQL server. - - * Client only: Only install the MySQL client products, - which does not include the MySQL server. - - * Full: Install all MySQL products. - - * Custom: Manually select the MySQL products to install. - Note - After the initial installation, you may use MySQL - Installer to manually select MySQL products to install or - remove. In other words, MySQL Installer becomes a MySQL - product management system. - - Figure 2.8 MySQL Installer - Choosing a Setup Type - MySQL Installer - Choosing a Setup Type - - After you select a setup type, the MySQL Installer will check - your system for the necessary external requirements for each - of the selected MySQL products. MySQL Installer will either - download and install the missing components onto your system, - or point you to the download location and set Status to - "Manual". - - The next window lists the MySQL products that are scheduled - to be installed: - - Figure 2.9 MySQL Installer - Installation Progress - MySQL Installer - Installation Progress - - As components are installed, their Status changes from a - progress percentage to "Complete". - - After all components are installed, the next step configures - some of the recently installed MySQL products. The - Configuration Overview window displays the progress and then - loads a configuration window, if required. Our example - configures MySQL Server 5.6.x. - -Configuring MySQL Server - - Configuring the MySQL server begins with defining several - Type and Networking options. - - Figure 2.10 MySQL Installer - Configuration Overview - MySQL Installer - Configuration Overview - - Server Configuration Type - - Choose the MySQL server configuration type that describes - your setup. This setting defines the amount of system - resources that will be assigned to your MySQL server - instance. - - * Developer: A machine that will host many other - applications, and typically this is your personal - workstation. This option configures MySQL to use the - least amount of memory. - - * Server: Several other applications will be running on - this machine, such as a web server. This option - configures MySQL to use a medium amount of memory. - - * Dedicated: A machine that is dedicated to running the - MySQL server. Because no other major applications are - running on the server, such as web servers, this option - configures MySQL to use all available memory. - - Connectivity - - Connectivity options control how you will connect to MySQL. - Options include: - - * TCP/IP: You may enable TCP/IP Networking here as - otherwise only localhost connections are allowed. Also - define the Port Number and whether to open the firewall - port for network access. - - * Named Pipe: Enable and define the pipe name, similar to - using the --enable-named-pipe option. - - * Shared Memory: Enable and then define the memory name, - similar to using the --shared-memory option. - - Advanced Configuration - - Checking the "Advanced Configuration" option provides - additional Logging Options to configure. This includes - defining file paths for the error log, general log, slow - query log (including the configuration of seconds it requires - to execute a query), and the binary log. - - Figure 2.11 MySQL Installer - MySQL Server Configuration: - Type and Networking - MySQL Installer- MySQL Server Configuration: Type and - Networking - -Accounts and Roles - - Next, define your MySQL account information. Assigning a root - password is required. - - Optionally, you can add additional MySQL user accounts with - predefined user roles. Each predefined role, such as "DB - Admin", are configured with their own set of privileges. For - example, the "DB Admin" role has more privileges than the "DB - Designer" role. Click the Role dropdown for a list of role - descriptions. - Note - - If the MySQL Server is already installed, then you must also - enter the Current Root Password. - - Figure 2.12 MySQL Installer - MySQL Server Configuration: - User Accounts and Roles - MySQL Installer - MySQL Server Configuration: User Accounts - and Roles - - Figure 2.13 MySQL Installer - MySQL Server Configuration: - User Accounts and Roles: Adding a User - MySQL Installer - MySQL Server Configuration: User Accounts - and Roles: Adding a User - -Windows Service - - Next, configure the Windows Service details. This includes - the service name, whether the MySQL Server should be loaded - at startup, and how the Windows Service for MySQL Server is - executed. - - Figure 2.14 MySQL Installer - MySQL Server Configuration: - Windows Service - MySQL Installer - MySQL Server Configuration: Windows Service - Note - - When configuring Run Windows Services as ... using a Custom - User, the custom user must have privileges to log on to - Microsoft Windows as a service. And the Next button will be - disabled until this user is configured with these user - rights. - - On Microsoft Windows 7, this is configured by loading the - Start Menu, Control Panel, Administrative Tools, Local - Security Policy, Local Policies, User Rights Assignment, then - Log On As A Service. Choose Add User or Group here to add the - custom user, and then OK, OK to save. - -Advanced Options - - The next configuration step is available if the Advanced - Configuration option was checked. This section includes - options that are related to the MySQL log files: - - Figure 2.15 MySQL Installer - MySQL Server Configuration: - Logging Options - MySQL Installer - MySQL Server Configuration: Logging Options - - Click Next to continue on to the final page before all of the - requested changes are applied. This Apply Server - Configuration page details the configuration steps that will - be performed. - - Figure 2.16 MySQL Installer - MySQL Server Configuration: - Apply Server Configuration - MySQL Installer - MySQL Server Configuration: Apply Server - Configuration - - Click Execute to execute the configuration steps. The icon - for each step toggles from white to green on success, or the - process stops on failure. Click the Log tab to view the log. - - After the MySQL Installer configuration process is finished, - MySQL Installer reloads the opening page where you can - execute other installation and configuration related actions. - - MySQL Installer is added to the Microsoft Windows Start menu - under the MySQL group. Opening MySQL Installer loads its - dashboard where installed MySQL products are listed, and - other MySQL Installer actions are available: - - Figure 2.17 MySQL Installer - Main Dashboard - MySQL Installer - Main Dashboard - -Adding MySQL Products - - Click Add to add new products. This loads the Select Products - and Features page: - - Figure 2.18 MySQL Installer - Select Products and Features - MySQL Installer - Select Products and Features - - From here, choose the MySQL products you want to install from - the left Available Products pane, and then click the green - right arrow to queue products for installation. - - Optionally, click Edit to open the product and features - search filter: - - Figure 2.19 MySQL Installer - Select Products and Features - Filter - MySQL Installer - Select Products and Features Filter - - For example, you might choose to include Pre-Release products - in your selections, such as a Beta product that has not yet - reached GA status. - Note - - The ability to install Pre-Release versions of MySQL products - was added in MySQL Installer 1.4.0. - - Select all of the MySQL products you want to install, then - click Next to continue, and then Execute to execute the - installation process to install all of the selected products. - -2.3.3.1.1 MySQL Product Catalog - - MySQL Installer stores a MySQL product catalog. The catalog - can be updated either manually or automatically, and the - catalog change history is also available. - Note - - The MySQL product catalog was added in MySQL Installer 1.4.0. - - Manual updates - - You can update the MySQL product catalog at any time by - clicking Catalog on the Installer dashboard. - - Figure 2.20 MySQL Installer - Open the MySQL Product Catalog - MySQL Installer - Open the MySQL Product Catalog - - From there, click Execute to update the product catalog. - - Automatic updates - - You can configure MySQL Installer to automatically update the - MySQL product catalog once per day. To enable this feature - and set the update time, click the wrench icon on the - Installer dashboard. - - The next window configures the Automatic Catalog Update. - Enable or disable this feature, and also set the hour. - - Figure 2.21 MySQL Installer - Configure the Catalog Scheduler - MySQL Installer - Configure the Catalog Scheduler - - This option uses the Windows Task Scheduler to schedule a - task named "ManifestUpdate". - - Change History - - MySQL Installer tracks the change history for all of the - MySQL products. Click Catalog from the dashboard, optionally - update the catalog (or, toggle the Do not update at this time - checkbox), click Next/Execute, and then view the change - history. - - Figure 2.22 MySQL Installer - Catalog Change History - MySQL Installer - Catalog Change History - -2.3.3.1.2 Remove MySQL Products - - MySQL Installer can also remove MySQL products from your - system. To remove a MySQL product, click Remove from the - Installer dashboard. This opens a window with a list of - installed MySQL products. Select the MySQL products you want - to remove (uninstall), and then click Execute to begin the - removal process. - Note - - To select all MySQL products, click the [ ] checkbox to the - left of the Product label. - - Figure 2.23 MySQL Installer - Removing Products: Select - MySQL Installer - Removing Products: Select - - Figure 2.24 MySQL Installer - Removing Products: Executed - MySQL Installer - Removing Products: Executed - -2.3.3.1.3 Alter MySQL Products - - MySQL Installer offers several options to alter your MySQL - product installations. - -Upgrade - - MySQL products with an available upgrade are highlighted on - the main dashboard. Products with available upgrades will - have an upgrade icon next to their version number. - - Figure 2.25 MySQL Installer - Upgrade a MySQL Product - MySQL Installer - Upgrade a MySQL Product - Note - - Available upgrades are determined by having a current - catalog. For information about keeping your MySQL product - catalog current, see Section 2.3.3.1.1, "MySQL Product - Catalog." - - Click Upgrade to view a list upgradable products. Our example - indicates that MySQL server 5.6.19 can be upgraded to version - 5.6.20. - - Figure 2.26 MySQL Installer - Select Products To Upgrade - MySQL Installer - Select Products To Upgrade - - Select (check) the products to upgrade, and optionally click - the changes link to view the product's release notes in your - browser. Click Next to begin the upgrade process. - - Figure 2.27 MySQL Installer - Apply Updates - MySQL Installer - Apply Updates - - A MySQL server upgrade will also check and upgrade the - server's database. Although optional, this step is - recommended. - - Figure 2.28 MySQL Installer - Check and Upgrade Database - MySQL Installer - Check and Upgrade Database - - Upon completion, your upgraded products will be upgraded and - available to use. A MySQL server upgrade also restarts the - MySQL server. - -Reconfigure - - Some MySQL products, such as the MySQL server, include a - Reconfigure option. It opens the same configuration options - that were set when the MySQL product was installed, and is - pre-populated with the current values. - - To execute, click the Reconfigure link under the Quick Action - column on the main dashboard for the MySQL product that you - want to reconfigure. - - Figure 2.29 MySQL Installer - Reconfigure a MySQL Product - MySQL Installer - Reconfigure a MySQL Product - - In the case of the MySQL server, this opens the familiar - configuration wizard. - - Figure 2.30 MySQL Installer - Reconfiguration Wizard - MySQL Installer - Reconfiguration Wizard - -Modify - - Many MySQL products contain feature components that can be - added or removed. For example, Debug binaries and Client - Programs are subcomponents of the MySQL server. - - The modify the features of a product, click Modify on the - main dashboard. - - Figure 2.31 MySQL Installer - Modify Product Features - MySQL Installer - Modify Product Features - - Click Execute to execute the modification request. - -2.3.3.2 MySQL Installer Console - - MySQLInstallerConsole provides functionality similar to the - GUI version of MySQL Installer, but from the command-line. It - is installed when MySQL Installer is initially executed, and - then available within the MySQL Installer directory. - Typically that is in C:\Program Files (x86)\MySQL\MySQL - Installer\, and the console must be executed with - administrative privileges. - - To use, invoke the Command Prompt with administrative - privileges by choosing Start, Accessories, then right-click - on Command Prompt and choose Run as administrator. And from - the command-line, optionally change the directory to where - MySQLInstallerConsole is located: -C:\> cd "C:\Program Files (x86)\MySQL\MySQL Installer" -C:\> MySQLInstallerConsole.exe help - -C:\Program Files (x86)\MySQL\MySQL Installer for Windows>MySQLInstalle -rConsole.exe help - -The following commands are available: - -Configure - Configures one or more of your installed programs. -Help - Provides list of available commands. -Install - Install and configure one or more available MySQL programs -. -List - Provides an interactive way to list all products available -. -Modify - Modifies the features of installed products. -Remove - Removes one or more products from your system. -Status - Shows the status of all installed products. -Update - Update the current product catalog. -Upgrade - Upgrades one or more of your installed programs. - - MySQLInstallerConsole supports the following options, which - are specified on the command line: - - * configure [product1]:[setting]=[value]; - [product2]:[setting]=[value]; [...] - Configure one or more MySQL products on your system. - Switches include: - - + -showsettings : Displays the available options for - the selected product, by passing in the product name - after -showsettings. - - + -silent : Disable confirmation prompts. -C:\> MySQLInstallerConsole configure -showsettings server -C:\> MySQLInstallerConsole configure server:port=3307 - - - * help [command] - Displays a help message with usage examples, and then - exits. Pass in an additional command to receive help - specific to that command. -C:\> MySQLInstallerConsole help -C:\> MySQLInstallerConsole help install - - - * install [product]:[features]:[config block]:[config - block]:[config block]; [...] - Install one or more MySQL products on your system. - Switches and syntax options include: - - + -type=[SetupType] : Installs a predefined set of - software. The "SetupType" can be one of the - following: - Note - Non-custom setup types can only be chosen if no - other MySQL products are installed. - o Developer: Installs a complete development - environment. - o Server: Installs a single MySQL server - o Client: Installs client programs and libraries - o Full: Installs everything - o Custom: Installs user selected products. This - is the default option. - - + -showsettings : Displays the available options for - the selected product, by passing in the product name - after -showsettings. - - + -silent : Disable confirmation prompts. - - + [config block]: One or more configuration blocks can - be specified. Each configuration block is a - semicolon separated list of key value pairs. A block - can include either a "config" or "user" type key, - where "config" is the default type if one is not - defined. - Only one "config" type block can be defined per - product. A "user" block should be defined for each - user that should be created during the product's - installation. - Note - Adding users is not supported when a product is - being reconfigured. - - + [feature]: The feature block is a semicolon - separated list of features, or '*' to select all - features. -C:\> MySQLInstallerConsole install server;5.6.22:*:port=3307;serverid= -2:type=user;username=foo;password=bar;role=DBManager -C:\> MySQLInstallerConsole install server;5.6.22;x64 -silent - - - * list - Lists an interactive console where all of the available - MySQL products can be searched. Execute - MySQLInstallerConsole list to launch the console, and - enter in a substring to search. -C:\> MySQLInstallerConsole list - - - * modify [product1:-removelist|+addlist] - [product2:-removelist|+addlist] [...] - Modifies or displays features of a previously installed - MySQL product. - - + -silent : Disable confirmation prompts. -C:\> MySQLInstallerConsole modify server -C:\> MySQLInstallerConsole modify server:+documentation -C:\> MySQLInstallerConsole modify server:-debug - - - * remove [product1] [product2] [...] - Removes one ore more products from your system. - - + * : Pass in * to remove all of the MySQL products. - - + -continue : Continue the operation even if an error - occurs. - - + -silent : Disable confirmation prompts. -C:\> MySQLInstallerConsole remove * -C:\> MySQLInstallerConsole remove server - - - * status - Provides a quick overview of the MySQL products that are - installed on the system. Information includes product - name and version, architecture, date installed, and - install location. -C:\> MySQLInstallerConsole status - - - * upgrade [product1:version] [product2:version], [...] - Upgrades one or more products on your system. Syntax - options include: - - + * : Pass in * to upgrade all products to the latest - version, or pass in specific products. - - + ! : Pass in ! as a version number to upgrade the - MySQL product to its latest version. - - + -silent : Disable confirmation prompts. -C:\> MySQLInstallerConsole upgrade * -C:\> MySQLInstallerConsole upgrade workbench:6.2.2 -C:\> MySQLInstallerConsole upgrade workbench:! -C:\> MySQLInstallerConsole upgrade workbench:6.2.2 excel:1.3.2 - - - * update - Downloads the latest MySQL product catalog to your - system. On success, the download catalog will be applied - the next time either MySQLInstaller or - MySQLInstallerConsole is executed. -C:\> MySQLInstallerConsole update - - Note - The Automatic Catalog Update GUI option executes this - command from the Windows Task Scheduler. - -2.3.4 MySQL Notifier - - The MySQL Notifier is a tool that enables you to monitor and - adjust the status of your local and remote MySQL Server - instances through an indicator that resides in the system - tray. The MySQL Notifier also gives quick access to several - MySQL GUI tools (such as MySQL Workbench) through its context - menu. - - The MySQL Notifier is installed by MySQL Installer, and (by - default) will start-up when Microsoft Windows is started. - Note - - To install, download and execute the MySQL Installer - (http://dev.mysql.com/downloads/installer/), be sure the - MySQL Notifier product is selected, then proceed with the - installation. See the MySQL Installer manual for additional - details. - - For notes detailing the changes in each release of MySQL - Notifier, see the MySQL Notifier Release Notes - (http://dev.mysql.com/doc/relnotes/mysql-notifier/en/). - - Visit the MySQL Notifier forum - (http://forums.mysql.com/list.php?173) for additional MySQL - Notifier help and support. - - Features include: - - * Start, Stop, and Restart instances of the MySQL Server. - - * Automatically detects (and adds) new MySQL Server - services. These are listed under Manage Monitored Items, - and may also be configured. - - * The Tray icon changes, depending on the status. It's - green if all monitored MySQL Server instances are - running, or red if at least one service is stopped. The - Update MySQL Notifier tray icon based on service status - option, which dictates this behavior, is enabled by - default for each service. - - * Links to other applications like MySQL Workbench, MySQL - Installer, and the MySQL Utilities. For example, choosing - Configure Instance will load the MySQL Workbench Server - Administration window for that particular instance. - - * If MySQL Workbench is also installed, then the Configure - Instance and SQL Editor options are available for local - (but not remote) MySQL instances. - - * Monitoring of both local and remote MySQL instances. - - Note - - Remote monitoring is available since MySQL Notifier 1.1.0. - - The MySQL Notifier resides in the system tray and provides - visual status information for your MySQL Server instances. A - green icon is displayed at the top left corner of the tray - icon if the current MySQL Server is running, or a red icon if - the service is stopped. - - The MySQL Notifier automatically adds discovered MySQL - Services on the local machine, and each service is saved and - configurable. By default, the Automatically add new services - whose name contains option is enabled and set to mysql. - Related Notifications Options include being notified when new - services are either discovered or experience status changes, - and are also enabled by default. And uninstalling a service - will also remove the service from the MySQL Notifier. - Note - - The Automatically add new services whose name contains option - default changed from ".*mysqld.*" to "mysql" in Notifier - 1.1.0. - - Clicking the system tray icon will reveal several options, as - seen in the screenshots below: - - The Service Instance menu is the main MySQL Notifier window, - and enables you to Stop, Start, and Restart the MySQL Server. - - Figure 2.32 MySQL Notifier Service Instance menu - MySQL Notifier Service Instance menu - - The Actions menu includes several links to external - applications (if they are installed), and a Refresh Status - option to manually refresh the status of all monitored - services (in both local and remote computers) and MySQL - instances. - Note - - The main menu will not show the Actions menu when there are - no services being monitored by MySQL Notifier. - Note - - The Refresh Status feature is available since MySQL Notifier - 1.1.0. - - Figure 2.33 MySQL Notifier Actions menu - MySQL Notifier Actions menu - - The Actions, Options menu configures MySQL Notifier and - includes options to: - - * Use colorful status icons: Enables a colorful style of - icons for the tray of the MySQL Notifier. - - * Run at Windows Startup: Allows the application to be - loaded when Microsoft Windows starts. - - * Automatically Check For Updates Every # Weeks: Checks for - a new version of MySQL Notifier, and runs this check - every # weeks. - - * Automatically add new services whose name contains: The - text used to filter services and add them automatically - to the monitored list of the local computer running MySQL - Notifier, and on remote computers already monitoring - Windows services. monitored services, and also filters - the list of the Microsoft Windows services for the Add - New Service dialog. - Prior to version 1.1.0, this option was named - "Automatically add new services that match this pattern." - - * Notify me when a service is automatically added: Will - display a balloon notification from the taskbar when a - newly discovered service is added to the monitored - services list. - - * Notify me when a service changes status: Will display a - balloon notification from the taskbar when a monitored - service changes its status. - - Figure 2.34 MySQL Notifier Options menu - MySQL Notifier Options menu - - The Actions, Manage Monitored Items menu enables you to - configure the monitored services and MySQL instances. First, - with the Services tab open: - - Figure 2.35 MySQL Notifier Manage Services menu - MySQL Notifier Manage Services menu - - The Instances tab is similar: - - Figure 2.36 MySQL Notifier Manage Instances menu - MySQL Notifier Manage Instances menu - - Adding a service or instance (after clicking Add in the - Manage Monitored Items window) enables you to select a - running Microsoft Windows service or instance connection, and - configure MySQL Notifier to monitor it. Add a new service or - instance by clicking service name from the list, then OK to - accept. Multiple services and instances may be selected. - - Figure 2.37 MySQL Notifier Adding new services - MySQL Notifier Adding new services - - And instances: - - Figure 2.38 MySQL Notifier Adding new instances - MySQL Notifier Adding new instances - Note - - The Instances tab available since MySQL Notifier 1.1.0. - -2.3.4.1 Remote monitoring set up and installation instructions - - The MySQL Notifier uses Windows Management Instrumentation - (WMI) to manage and monitor services in remote computers - running Windows XP or later. This guide explains how it - works, and how to set up your system to monitor remote MySQL - instances. - Note - - Remote monitoring is available since MySQL Notifier 1.1.0. - - In order to configure WMI, it is important to understand that - the underlying Distributed Component Object Model (DCOM) - architecture is doing the WMI work. Specifically, MySQL - Notifier is using asynchronous notification queries on remote - Microsoft Windows hosts as .NET events. These events send an - asynchronous callback to the computer running the MySQL - Notifier so it knows when a service status has changed on the - remote computer. Asynchronous notifications offer the best - performance compared to semisynchronous notifications or - synchronous notifications that use timers. - - Asynchronous notifications requires the remote computer to - send a callback to the client computer (thus opening a - reverse connection), so the Windows Firewall and DCOM - settings must be properly configured for the communication to - function properly. - - Figure 2.39 MySQL Notifier Distributed Component Object Model - (DCOM) - MySQL Notifier Distributed Component Object Model (DCOM) - - Most of the common errors thrown by asynchronous WMI - notifications are related to Windows Firewall blocking the - communication, or to DCOM / WMI settings not being set up - properly. For a list of common errors with solutions, see - Section 2.3.4.1, "." - - The following steps are required to make WMI function. These - steps are divided between two machines. A single host - computer that runs MySQL Notifier (Computer A), and multiple - remote machines that are being monitored (Computer B). - -Computer running MySQL Notifier (Computer A) - - - 1. Allow for remote administration by either editing the - Group Policy Editor, or using NETSH: - Using the Group Policy Editor: - a. Click Start, click Run, type GPEDIT.MSC, and then - click OK. - b. Under the Local Computer Policy heading, - double-click Computer Configuration. - c. Double-click Administrative Templates, then Network, - Network Connections, and then Windows Firewall. - d. If the computer is in the domain, then double-click - Domain Profile; otherwise, double-click Standard - Profile. - e. Click Windows Firewall: Allow inbound remote - administration exception. - f. On the Action menu either select Edit, or - double-click the selection from the previous step. - g. Check the Enabled radio button, and then click OK. - Using the NETSH command: - a. Open a command prompt window with Administrative - rights (you can right-click the Command Prompt icon - and click Run as Administrator). - b. Execute the following command: -NETSH firewall set service RemoteAdmin enable - - - 2. Open the DCOM port TCP 135: - a. Open a command prompt window with Administrative - rights (you can right-click the Command Prompt icon - and click Run as Administrator) . - b. Execute the following command: -NETSH firewall add portopening protocol=tcp port=135 name=DCOM_TCP135 - - - 3. Add the client application which contains the sink for - the callback (MySqlNotifier.exe) to the Windows Firewall - Exceptions List (use either the Windows Firewall - configuration or NETSH): - Using the Windows Firewall configuration: - a. In the Control Panel, double-click Windows Firewall. - b. In the Windows Firewall window's left panel, click - Allow a program or feature through Windows Firewall. - c. In the Allowed Programs window, click Change - Settings. - d. If MySqlNotifier.exe is in the Allowed programs and - features list, make sure it is checked for the type - of networks the computer connects to (Private, - Public or both). - e. If MySqlNotifier.exe is not in the list, click Allow - another program.... - f. In the Add a Program window, select the - MySqlNotifier.exe if it exists in the Programs list, - otherwise click Browse... and go to the directory - where MySqlNotifier.exe was installed to select it, - then click Add. - g. Make sure MySqlNotifier.exe is checked for the type - of networks the computer connects to (Private, - Public or both). - Using the NETSH command: - a. Open a command prompt window with Administrative - rights (you can right-click the Command Prompt icon - and click Run as Administrator). - b. Execute the following command, where you change - "[YOUR_INSTALL_DIRECTORY]": -NETSH firewall add allowedprogram program=[YOUR_INSTALL_DIRECTORY]\MyS -qlNotifier.exe name=MySqlNotifier - - - 4. If Computer B is either a member of WORKGROUP or is in a - different domain that is untrusted by Computer A, then - the callback connection (Connection 2) is created as an - Anonymous connection. To grant Anonymous connections DCOM - Remote Access permissions: - a. Click Start, click Run, type DCOMCNFG, and then - click OK. - b. In the Component Services dialog box, expand - Component Services, expand Computers, and then - right-click My Computer and click Properties. - c. In the My Computer Properties dialog box, click the - COM Security tab. - d. Under Access Permissions, click Edit Limits. - e. In the Access Permission dialog box, select - ANONYMOUS LOGON name in the Group or user names box. - In the Allow column under Permissions for User, - select Remote Access, and then click OK. - -Monitored Remote Computer (Computer B) - - If the user account that is logged into the computer running - the MySQL Notifier (Computer A) is a local administrator on - the remote computer (Computer B), such that the same account - is an administrator on Computer B, you can skip to the "Allow - for remote administration" step. - - Setting DCOM security to allow a non-administrator user to - access a computer remotely: - - 1. Grant "DCOM remote launch" and activation permissions for - a user or group: - a. Click Start, click Run, type DCOMCNFG, and then - click OK. - b. In the Component Services dialog box, expand - Component Services, expand Computers, and then - right-click My Computer and click Properties. - c. In the My Computer Properties dialog box, click the - COM Security tab. - d. Under Access Permissions, click Edit Limits. - e. In the Launch Permission dialog box, follow these - steps if your name or your group does not appear in - the Groups or user names list: - i. In the Launch Permission dialog box, click Add. - ii. In the Select Users, Computers, or Groups - dialog box, add your name and the group in the - "Enter the object names to select" box, and - then click OK. - f. In the Launch Permission dialog box, select your - user and group in the Group or user names box. In - the Allow column under Permissions for User, select - Remote Launch, select Remote Activation, and then - click OK. - Grant DCOM remote access permissions: - a. Click Start, click Run, type DCOMCNFG, and then - click OK. - b. In the Component Services dialog box, expand - Component Services, expand Computers, and then - right-click My Computer and click Properties. - c. In the My Computer Properties dialog box, click the - COM Security tab. - d. Under Access Permissions, click Edit Limits. - e. In the Access Permission dialog box, select - ANONYMOUS LOGON name in the Group or user names box. - In the Allow column under Permissions for User, - select Remote Access, and then click OK. - - 2. Allowing non-administrator users access to a specific WMI - namespace: - a. In the Control Panel, double-click Administrative - Tools. - b. In the Administrative Tools window, double-click - Computer Management. - c. In the Computer Management window, expand the - Services and Applications tree and double-click the - WMI Control. - d. Right-click the WMI Control icon and select - Properties. - e. In the WMI Control Properties window, click the - Security tab. - f. In the Security tab, select the namespace and click - Security. - g. Locate the appropriate account and check Remote - Enable in the Permissions list. - - 3. Allow for remote administration by either editing the - Group Policy Editor or using NETSH: - Using the Group Policy Editor: - a. Click Start, click Run, type GPEDIT.MSC, and then - click OK. - b. Under the Local Computer Policy heading, - double-click Computer Configuration. - c. Double-click Administrative Templates, then Network, - Network Connections, and then Windows Firewall. - d. If the computer is in the domain, then double-click - Domain Profile; otherwise, double-click Standard - Profile. - e. Click Windows Firewall: Allow inbound remote - administration exception. - f. On the Action menu either select Edit, or - double-click the selection from the previous step. - g. Check the Enabled radio button, and then click OK. - Using the NETSH command: - a. Open a command prompt window with Administrative - rights (you can right-click the Command Prompt icon - and click Run as Administrator). - b. Execute the following command: -NETSH firewall set service RemoteAdmin enable - - - 4. Now, be sure the user you are logging in with uses the - Name value and not the Full Name value: - a. In the Control Panel, double-click Administrative - Tools. - b. In the Administrative Tools window, double-click - Computer Management. - c. In the Computer Management window, expand the System - Tools then Local Users and Groups. - d. Click the Users node, and on the right side panel - locate your user and make sure it uses the Name - value to connect, and not the Full Name value. - - 5. If the remote computer is running on Windows XP - Professional, make sure that remote logins are not being - forcefully changed to the guest account user (also known - as ForceGuest), which is enabled by default on computers - that are not attached to a domain. - a. Click Start, click Run, type SECPOL.MSC, and then - click OK. - b. Under the Local Policies node, double-click Security - Options. - c. Select Network Access: Sharing and security model - for local accounts and save. - -Common Errors - - - * 0x80070005 - - + DCOM Security was not configured properly (see - Computer B, the Setting DCOM security... step). - - + The remote computer (Computer B) is a member of - WORKGROUP or is in a domain that is untrusted by the - client computer (Computer A) (see Computer A, the - Grant Anonymous connections DCOM Remote Access - permissions step). - - * 0x8007000E - - + The remote computer (Computer B) is a member of - WORKGROUP or is in a domain that is untrusted by the - client computer (Computer A) (see Computer A, the - Grant Anonymous connections DCOM Remote Access - permissions step). - - * 0x80041003 - - + Access to the remote WMI namespace was not - configured properly (see Computer B, the Allowing - non-administrator users access to a specific WMI - namespace step). - - * 0x800706BA - - + The DCOM port is not open on the client computers - (Computer A) firewall. See the Open the DCOM port - TCP 135 step for Computer A. - - + The remote computer (Computer B) is inaccessible - because its network location is set to Public. Make - sure you can access it through the Windows Explorer. - -2.3.5 Installing MySQL on Microsoft Windows Using a noinstall Zip -Archive - - Users who are installing from the noinstall package can use - the instructions in this section to manually install MySQL. - The process for installing MySQL from a Zip archive is as - follows: - - 1. Extract the archive to the desired install directory - - 2. Create an option file - - 3. Choose a MySQL server type - - 4. Start the MySQL server - - 5. Secure the default user accounts - - This process is described in the sections that follow. - -2.3.5.1 Extracting the Install Archive - - To install MySQL manually, do the following: - - 1. If you are upgrading from a previous version please refer - to Section 2.3.7, "Upgrading MySQL on Windows," before - beginning the upgrade process. - - 2. Make sure that you are logged in as a user with - administrator privileges. - - 3. Choose an installation location. Traditionally, the MySQL - server is installed in C:\mysql. The MySQL Installation - Wizard installs MySQL under C:\Program Files\MySQL. If - you do not install MySQL at C:\mysql, you must specify - the path to the install directory during startup or in an - option file. See Section 2.3.5.2, "Creating an Option - File." - Note - The MySQL Installer installs MySQL under C:\Program - Files\MySQL. - - 4. Extract the install archive to the chosen installation - location using your preferred Zip archive tool. Some - tools may extract the archive to a folder within your - chosen installation location. If this occurs, you can - move the contents of the subfolder into the chosen - installation location. - -2.3.5.2 Creating an Option File - - If you need to specify startup options when you run the - server, you can indicate them on the command line or place - them in an option file. For options that are used every time - the server starts, you may find it most convenient to use an - option file to specify your MySQL configuration. This is - particularly true under the following circumstances: - - * The installation or data directory locations are - different from the default locations (C:\Program - Files\MySQL\MySQL Server 5.6 and C:\Program - Files\MySQL\MySQL Server 5.6\data). - - * You need to tune the server settings, such as memory, - cache, or InnoDB configuration information. - - When the MySQL server starts on Windows, it looks for option - files in several locations, such as the Windows directory, - C:\, and the MySQL installation directory (for the full list - of locations, see Section 4.2.6, "Using Option Files"). The - Windows directory typically is named something like - C:\WINDOWS. You can determine its exact location from the - value of the WINDIR environment variable using the following - command: -C:\> echo %WINDIR% - - MySQL looks for options in each location first in the my.ini - file, and then in the my.cnf file. However, to avoid - confusion, it is best if you use only one file. If your PC - uses a boot loader where C: is not the boot drive, your only - option is to use the my.ini file. Whichever option file you - use, it must be a plain text file. - Note - - When using the MySQL Installer to install MySQL Server, it - will create the my.ini at the default location. And as of - MySQL Server 5.5.27, the user running MySQL Installer is - granted full permissions to this new my.ini. - - In other words, be sure that the MySQL Server user has - permission to read the my.ini file. - - You can also make use of the example option files included - with your MySQL distribution; see Section 5.1.2, "Server - Configuration Defaults." - - An option file can be created and modified with any text - editor, such as Notepad. For example, if MySQL is installed - in E:\mysql and the data directory is in E:\mydata\data, you - can create an option file containing a [mysqld] section to - specify values for the basedir and datadir options: -[mysqld] -# set basedir to your installation path -basedir=E:/mysql -# set datadir to the location of your data directory -datadir=E:/mydata/data - - Microsoft Windows path names are specified in option files - using (forward) slashes rather than backslashes. If you do - use backslashes, double them: -[mysqld] -# set basedir to your installation path -basedir=E:\\mysql -# set datadir to the location of your data directory -datadir=E:\\mydata\\data - - The rules for use of backslash in option file values are - given in Section 4.2.6, "Using Option Files." - - The data directory is located within the AppData directory - for the user running MySQL. - - If you would like to use a data directory in a different - location, you should copy the entire contents of the data - directory to the new location. For example, if you want to - use E:\mydata as the data directory instead, you must do two - things: - - 1. Move the entire data directory and all of its contents - from the default location (for example C:\Program - Files\MySQL\MySQL Server 5.6\data) to E:\mydata. - - 2. Use a --datadir option to specify the new data directory - location each time you start the server. - -2.3.5.3 Selecting a MySQL Server Type - - The following table shows the available servers for Windows - in MySQL 5.6. - Binary Description - mysqld Optimized binary with named-pipe support - mysqld-debug Like mysqld, but compiled with full debugging - and automatic memory allocation checking - - All of the preceding binaries are optimized for modern Intel - processors, but should work on any Intel i386-class or higher - processor. - - Each of the servers in a distribution support the same set of - storage engines. The SHOW ENGINES statement displays which - engines a given server supports. - - All Windows MySQL 5.6 servers have support for symbolic - linking of database directories. - - MySQL supports TCP/IP on all Windows platforms. MySQL servers - on Windows also support named pipes, if you start the server - with the --enable-named-pipe option. It is necessary to use - this option explicitly because some users have experienced - problems with shutting down the MySQL server when named pipes - were used. The default is to use TCP/IP regardless of - platform because named pipes are slower than TCP/IP in many - Windows configurations. - -2.3.5.4 Starting the Server for the First Time - - This section gives a general overview of starting the MySQL - server. The following sections provide more specific - information for starting the MySQL server from the command - line or as a Windows service. - - The information here applies primarily if you installed MySQL - using the Noinstall version, or if you wish to configure and - test MySQL manually rather than with the GUI tools. - Note - - The MySQL server will automatically start after using the - MySQL Installer, and the MySQL Notifier GUI can be used to - start/stop/restart at any time. - - The examples in these sections assume that MySQL is installed - under the default location of C:\Program Files\MySQL\MySQL - Server 5.6. Adjust the path names shown in the examples if - you have MySQL installed in a different location. - - Clients have two options. They can use TCP/IP, or they can - use a named pipe if the server supports named-pipe - connections. - - MySQL for Windows also supports shared-memory connections if - the server is started with the --shared-memory option. - Clients can connect through shared memory by using the - --protocol=MEMORY option. - - For information about which server binary to run, see Section - 2.3.5.3, "Selecting a MySQL Server Type." - - Testing is best done from a command prompt in a console - window (or "DOS window"). In this way you can have the server - display status messages in the window where they are easy to - see. If something is wrong with your configuration, these - messages make it easier for you to identify and fix any - problems. - - To start the server, enter this command: -C:\> "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqld" --console - - For a server that includes InnoDB support, you should see the - messages similar to those following as it starts (the path - names and sizes may differ): -InnoDB: The first specified datafile c:\ibdata\ibdata1 did not exist: -InnoDB: a new database to be created! -InnoDB: Setting file c:\ibdata\ibdata1 size to 209715200 -InnoDB: Database physically writes the file full: wait... -InnoDB: Log file c:\iblogs\ib_logfile0 did not exist: new to be create -d -InnoDB: Setting log file c:\iblogs\ib_logfile0 size to 31457280 -InnoDB: Log file c:\iblogs\ib_logfile1 did not exist: new to be create -d -InnoDB: Setting log file c:\iblogs\ib_logfile1 size to 31457280 -InnoDB: Log file c:\iblogs\ib_logfile2 did not exist: new to be create -d -InnoDB: Setting log file c:\iblogs\ib_logfile2 size to 31457280 -InnoDB: Doublewrite buffer not found: creating new -InnoDB: Doublewrite buffer created -InnoDB: creating foreign key constraint system tables -InnoDB: foreign key constraint system tables created -011024 10:58:25 InnoDB: Started - - When the server finishes its startup sequence, you should see - something like this, which indicates that the server is ready - to service client connections: -mysqld: ready for connections -Version: '5.6.23' socket: '' port: 3306 - - The server continues to write to the console any further - diagnostic output it produces. You can open a new console - window in which to run client programs. - - If you omit the --console option, the server writes - diagnostic output to the error log in the data directory - (C:\Program Files\MySQL\MySQL Server 5.6\data by default). - The error log is the file with the .err extension, and may be - set using the --log-error option. - Note - - The accounts that are listed in the MySQL grant tables - initially have no passwords. After starting the server, you - should set up passwords for them using the instructions in - Section 2.10.2, "Securing the Initial MySQL Accounts." - -2.3.5.5 Starting MySQL from the Windows Command Line - - The MySQL server can be started manually from the command - line. This can be done on any version of Windows. - Note - - The MySQL Notifier GUI can also be used to start/stop/restart - the MySQL server. - - To start the mysqld server from the command line, you should - start a console window (or "DOS window") and enter this - command: -C:\> "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqld" - - The path to mysqld may vary depending on the install location - of MySQL on your system. - - You can stop the MySQL server by executing this command: -C:\> "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqladmin" -u root -shutdown - - Note - - If the MySQL root user account has a password, you need to - invoke mysqladmin with the -p option and supply the password - when prompted. - - This command invokes the MySQL administrative utility - mysqladmin to connect to the server and tell it to shut down. - The command connects as the MySQL root user, which is the - default administrative account in the MySQL grant system. - Note - - Users in the MySQL grant system are wholly independent from - any login users under Microsoft Windows. - - If mysqld doesn't start, check the error log to see whether - the server wrote any messages there to indicate the cause of - the problem. By default, the error log is located in the - C:\Program Files\MySQL\MySQL Server 5.6\data directory. It is - the file with a suffix of .err, or may be specified by - passing in the --log-error option. Alternatively, you can try - to start the server with the --console option; in this case, - the server may display some useful information on the screen - that will help solve the problem. - - The last option is to start mysqld with the --standalone and - --debug options. In this case, mysqld writes a log file - C:\mysqld.trace that should contain the reason why mysqld - doesn't start. See Section 24.4.3, "The DBUG Package." - - Use mysqld --verbose --help to display all the options that - mysqld supports. - -2.3.5.6 Customizing the PATH for MySQL Tools - - To make it easier to invoke MySQL programs, you can add the - path name of the MySQL bin directory to your Windows system - PATH environment variable: - - * On the Windows desktop, right-click the My Computer icon, - and select Properties. - - * Next select the Advanced tab from the System Properties - menu that appears, and click the Environment Variables - button. - - * Under System Variables, select Path, and then click the - Edit button. The Edit System Variable dialogue should - appear. - - * Place your cursor at the end of the text appearing in the - space marked Variable Value. (Use the End key to ensure - that your cursor is positioned at the very end of the - text in this space.) Then enter the complete path name of - your MySQL bin directory (for example, C:\Program - Files\MySQL\MySQL Server 5.6\bin) - Note - There must be a semicolon separating this path from any - values present in this field. - Dismiss this dialogue, and each dialogue in turn, by - clicking OK until all of the dialogues that were opened - have been dismissed. You should now be able to invoke any - MySQL executable program by typing its name at the DOS - prompt from any directory on the system, without having - to supply the path. This includes the servers, the mysql - client, and all MySQL command-line utilities such as - mysqladmin and mysqldump. - You should not add the MySQL bin directory to your - Windows PATH if you are running multiple MySQL servers on - the same machine. - - Warning - - You must exercise great care when editing your system PATH by - hand; accidental deletion or modification of any portion of - the existing PATH value can leave you with a malfunctioning - or even unusable system. - -2.3.5.7 Starting MySQL as a Windows Service - - On Windows, the recommended way to run MySQL is to install it - as a Windows service, so that MySQL starts and stops - automatically when Windows starts and stops. A MySQL server - installed as a service can also be controlled from the - command line using NET commands, or with the graphical - Services utility. Generally, to install MySQL as a Windows - service you should be logged in using an account that has - administrator rights. - Note - - The MySQL Notifier GUI can also be used to monitor the status - of the MySQL service. - - The Services utility (the Windows Service Control Manager) - can be found in the Windows Control Panel (under - Administrative Tools on Windows 2000, XP, Vista, and Server - 2003). To avoid conflicts, it is advisable to close the - Services utility while performing server installation or - removal operations from the command line. - -Installing the service - - Before installing MySQL as a Windows service, you should - first stop the current server if it is running by using the - following command: -C:\> "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqladmin" - -u root shutdown - - Note - - If the MySQL root user account has a password, you need to - invoke mysqladmin with the -p option and supply the password - when prompted. - - This command invokes the MySQL administrative utility - mysqladmin to connect to the server and tell it to shut down. - The command connects as the MySQL root user, which is the - default administrative account in the MySQL grant system. - Note - - Users in the MySQL grant system are wholly independent from - any login users under Windows. - - Install the server as a service using this command: -C:\> "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqld" --install - - The service-installation command does not start the server. - Instructions for that are given later in this section. - - To make it easier to invoke MySQL programs, you can add the - path name of the MySQL bin directory to your Windows system - PATH environment variable: - - * On the Windows desktop, right-click the My Computer icon, - and select Properties. - - * Next select the Advanced tab from the System Properties - menu that appears, and click the Environment Variables - button. - - * Under System Variables, select Path, and then click the - Edit button. The Edit System Variable dialogue should - appear. - - * Place your cursor at the end of the text appearing in the - space marked Variable Value. (Use the End key to ensure - that your cursor is positioned at the very end of the - text in this space.) Then enter the complete path name of - your MySQL bin directory (for example, C:\Program - Files\MySQL\MySQL Server 5.6\bin), and there should be a - semicolon separating this path from any values present in - this field. Dismiss this dialogue, and each dialogue in - turn, by clicking OK until all of the dialogues that were - opened have been dismissed. You should now be able to - invoke any MySQL executable program by typing its name at - the DOS prompt from any directory on the system, without - having to supply the path. This includes the servers, the - mysql client, and all MySQL command-line utilities such - as mysqladmin and mysqldump. - You should not add the MySQL bin directory to your - Windows PATH if you are running multiple MySQL servers on - the same machine. - - Warning - - You must exercise great care when editing your system PATH by - hand; accidental deletion or modification of any portion of - the existing PATH value can leave you with a malfunctioning - or even unusable system. - - The following additional arguments can be used when - installing the service: - - * You can specify a service name immediately following the - --install option. The default service name is MySQL. - - * If a service name is given, it can be followed by a - single option. By convention, this should be - --defaults-file=file_name to specify the name of an - option file from which the server should read options - when it starts. - The use of a single option other than --defaults-file is - possible but discouraged. --defaults-file is more - flexible because it enables you to specify multiple - startup options for the server by placing them in the - named option file. - - * You can also specify a --local-service option following - the service name. This causes the server to run using the - LocalService Windows account that has limited system - privileges. This account is available only for Windows XP - or newer. If both --defaults-file and --local-service are - given following the service name, they can be in any - order. - - For a MySQL server that is installed as a Windows service, - the following rules determine the service name and option - files that the server uses: - - * If the service-installation command specifies no service - name or the default service name (MySQL) following the - --install option, the server uses the a service name of - MySQL and reads options from the [mysqld] group in the - standard option files. - - * If the service-installation command specifies a service - name other than MySQL following the --install option, the - server uses that service name. It reads options from the - [mysqld] group and the group that has the same name as - the service in the standard option files. This enables - you to use the [mysqld] group for options that should be - used by all MySQL services, and an option group with the - service name for use by the server installed with that - service name. - - * If the service-installation command specifies a - --defaults-file option after the service name, the server - reads options the same way as described in the previous - item, except that it reads options only from the named - file and ignores the standard option files. - - As a more complex example, consider the following command: -C:\> "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqld" - --install MySQL --defaults-file=C:\my-opts.cnf - - Here, the default service name (MySQL) is given after the - --install option. If no --defaults-file option had been - given, this command would have the effect of causing the - server to read the [mysqld] group from the standard option - files. However, because the --defaults-file option is - present, the server reads options from the [mysqld] option - group, and only from the named file. - Note - - On Windows, if the server is started with the --defaults-file - and --install options, --install must be first. Otherwise, - mysqld.exe will attempt to start the MySQL server. - - You can also specify options as Start parameters in the - Windows Services utility before you start the MySQL service. - -Starting the service - - Once a MySQL server has been installed as a service, Windows - starts the service automatically whenever Windows starts. The - service also can be started immediately from the Services - utility, or by using a NET START MySQL command. The NET - command is not case sensitive. - - When run as a service, mysqld has no access to a console - window, so no messages can be seen there. If mysqld does not - start, check the error log to see whether the server wrote - any messages there to indicate the cause of the problem. The - error log is located in the MySQL data directory (for - example, C:\Program Files\MySQL\MySQL Server 5.6\data). It is - the file with a suffix of .err. - - When a MySQL server has been installed as a service, and the - service is running, Windows stops the service automatically - when Windows shuts down. The server also can be stopped - manually by using the Services utility, the NET STOP MySQL - command, or the mysqladmin shutdown command. - - You also have the choice of installing the server as a manual - service if you do not wish for the service to be started - automatically during the boot process. To do this, use the - --install-manual option rather than the --install option: -C:\> "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqld" --install-ma -nual - -Removing the service - - To remove a server that is installed as a service, first stop - it if it is running by executing NET STOP MySQL. Then use the - --remove option to remove it: -C:\> "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqld" --remove - - If mysqld is not running as a service, you can start it from - the command line. For instructions, see Section 2.3.5.5, - "Starting MySQL from the Windows Command Line." - - If you encounter difficulties during installation. see - Section 2.3.6, "Troubleshooting a Microsoft Windows MySQL - Server Installation." - -2.3.5.8 Testing The MySQL Installation - - You can test whether the MySQL server is working by executing - any of the following commands: -C:\> "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqlshow" -C:\> "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqlshow" -u root m -ysql -C:\> "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqladmin" version -status proc -C:\> "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysql" test - - If mysqld is slow to respond to TCP/IP connections from - client programs, there is probably a problem with your DNS. - In this case, start mysqld with the --skip-name-resolve - option and use only localhost and IP addresses in the Host - column of the MySQL grant tables. - - You can force a MySQL client to use a named-pipe connection - rather than TCP/IP by specifying the --pipe or - --protocol=PIPE option, or by specifying . (period) as the - host name. Use the --socket option to specify the name of the - pipe if you do not want to use the default pipe name. - - If you have set a password for the root account, deleted the - anonymous account, or created a new user account, then to - connect to the MySQL server you must use the appropriate -u - and -p options with the commands shown previously. See - Section 4.2.2, "Connecting to the MySQL Server." - - For more information about mysqlshow, see Section 4.5.6, - "mysqlshow --- Display Database, Table, and Column - Information." - -2.3.6 Troubleshooting a Microsoft Windows MySQL Server Installation - - When installing and running MySQL for the first time, you may - encounter certain errors that prevent the MySQL server from - starting. This section helps you diagnose and correct some of - these errors. - - Your first resource when troubleshooting server issues is the - error log. The MySQL server uses the error log to record - information relevant to the error that prevents the server - from starting. The error log is located in the data directory - specified in your my.ini file. The default data directory - location is C:\Program Files\MySQL\MySQL Server 5.6\data, or - C:\ProgramData\Mysql on Windows 7 and Windows Server 2008. - The C:\ProgramData directory is hidden by default. You need - to change your folder options to see the directory and - contents. For more information on the error log and - understanding the content, see Section 5.2.2, "The Error - Log." - - For information regarding possible errors, also consult the - console messages displayed when the MySQL service is - starting. Use the NET START MySQL command from the command - line after installing mysqld as a service to see any error - messages regarding the starting of the MySQL server as a - service. See Section 2.3.5.7, "Starting MySQL as a Windows - Service." - - The following examples show other common error messages you - might encounter when installing MySQL and starting the server - for the first time: - - * If the MySQL server cannot find the mysql privileges - database or other critical files, it displays these - messages: -System error 1067 has occurred. -Fatal error: Can't open and lock privilege tables: -Table 'mysql.user' doesn't exist - - These messages often occur when the MySQL base or data - directories are installed in different locations than the - default locations (C:\Program Files\MySQL\MySQL Server - 5.6 and C:\Program Files\MySQL\MySQL Server 5.6\data, - respectively). - This situation can occur when MySQL is upgraded and - installed to a new location, but the configuration file - is not updated to reflect the new location. In addition, - old and new configuration files might conflict. Be sure - to delete or rename any old configuration files when - upgrading MySQL. - If you have installed MySQL to a directory other than - C:\Program Files\MySQL\MySQL Server 5.6, ensure that the - MySQL server is aware of this through the use of a - configuration (my.ini) file. Put the my.ini file in your - Windows directory, typically C:\WINDOWS. To determine its - exact location from the value of the WINDIR environment - variable, issue the following command from the command - prompt: -C:\> echo %WINDIR% - - You can create or modify an option file with any text - editor, such as Notepad. For example, if MySQL is - installed in E:\mysql and the data directory is - D:\MySQLdata, you can create the option file and set up a - [mysqld] section to specify values for the basedir and - datadir options: -[mysqld] -# set basedir to your installation path -basedir=E:/mysql -# set datadir to the location of your data directory -datadir=D:/MySQLdata - - Microsoft Windows path names are specified in option - files using (forward) slashes rather than backslashes. If - you do use backslashes, double them: -[mysqld] -# set basedir to your installation path -basedir=C:\\Program Files\\MySQL\\MySQL Server 5.6 -# set datadir to the location of your data directory -datadir=D:\\MySQLdata - - The rules for use of backslash in option file values are - given in Section 4.2.6, "Using Option Files." - If you change the datadir value in your MySQL - configuration file, you must move the contents of the - existing MySQL data directory before restarting the MySQL - server. - See Section 2.3.5.2, "Creating an Option File." - - * If you reinstall or upgrade MySQL without first stopping - and removing the existing MySQL service and install MySQL - using the MySQL Installer, you might see this error: -Error: Cannot create Windows service for MySql. Error: 0 - - This occurs when the Configuration Wizard tries to - install the service and finds an existing service with - the same name. - One solution to this problem is to choose a service name - other than mysql when using the configuration wizard. - This enables the new service to be installed correctly, - but leaves the outdated service in place. Although this - is harmless, it is best to remove old services that are - no longer in use. - To permanently remove the old mysql service, execute the - following command as a user with administrative - privileges, on the command line: -C:\> sc delete mysql -[SC] DeleteService SUCCESS - - If the sc utility is not available for your version of - Windows, download the delsrv utility from - http://www.microsoft.com/windows2000/techinfo/reskit/tool - s/existing/delsrv-o.asp and use the delsrv mysql syntax. - -2.3.7 Upgrading MySQL on Windows - - To upgrade MySQL on Windows, follow these steps: - - 1. Review Section 2.11.1, "Upgrading MySQL," for additional - information on upgrading MySQL that is not specific to - Windows. - - 2. Always back up your current MySQL installation before - performing an upgrade. See Section 7.2, "Database Backup - Methods." - - 3. Download the latest Windows distribution of MySQL from - http://dev.mysql.com/downloads/. - - 4. Before upgrading MySQL, stop the server. If the server is - installed as a service, stop the service with the - following command from the command prompt: -C:\> NET STOP MySQL - - If you are not running the MySQL server as a service, use - mysqladmin to stop it. For example, before upgrading from - MySQL 5.5 to 5.6, use mysqladmin from MySQL 5.5 as - follows: -C:\> "C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqladmin" -u root -shutdown - - Note - If the MySQL root user account has a password, invoke - mysqladmin with the -p option and enter the password when - prompted. - - 5. Before upgrading to MySQL 5.6 from a version previous to - 4.1.5, or from a version of MySQL installed from a Zip - archive to a version of MySQL installed with the MySQL - Installation Wizard, you must first manually remove the - previous installation and MySQL service (if the server is - installed as a service). - To remove the MySQL service, use the following command: -C:\> C:\mysql\bin\mysqld --remove - - If you do not remove the existing service, the MySQL - Installation Wizard may fail to properly install the new - MySQL service. - - 6. If you are using the MySQL Installer, start it as - described in Section 2.3.3, "Installing MySQL on - Microsoft Windows Using MySQL Installer." - - 7. If you are upgrading MySQL from a Zip archive, extract - the archive. You may either overwrite your existing MySQL - installation (usually located at C:\mysql), or install it - into a different directory, such as C:\mysql5. - Overwriting the existing installation is recommended. - However, for upgrades (as opposed to installing for the - first time), you must remove the data directory from your - existing MySQL installation to avoid replacing your - current data files. To do so, follow these steps: - a. Unzip the Zip archive in some location other than - your current MySQL installation - b. Remove the data directory - c. Rezip the Zip archive - d. Unzip the modified Zip archive on top of your - existing installation - Alternatively: - a. Unzip the Zip archive in some location other than - your current MySQL installation - b. Remove the data directory - c. Move the data directory from the current MySQL - installation to the location of the just-removed - data directory - d. Remove the current MySQL installation - e. Move the unzipped installation to the location of - the just-removed installation - - 8. If you were running MySQL as a Windows service and you - had to remove the service earlier in this procedure, - reinstall the service. (See Section 2.3.5.7, "Starting - MySQL as a Windows Service.") - - 9. Restart the server. For example, use NET START MySQL if - you run MySQL as a service, or invoke mysqld directly - otherwise. - 10. As Administrator, run mysql_upgrade to check your tables, - attempt to repair them if necessary, and update your - grant tables if they have changed so that you can take - advantage of any new capabilities. See Section 4.4.7, - "mysql_upgrade --- Check and Upgrade MySQL Tables." - 11. If you encounter errors, see Section 2.3.6, - "Troubleshooting a Microsoft Windows MySQL Server - Installation." - -2.3.8 Windows Postinstallation Procedures - - GUI tools exist that perform most of the tasks described - below, including: - - * MySQL Installer: Used to install and upgrade MySQL - products. - - * MySQL Workbench: Manages the MySQL server and edits SQL - queries. - - * MySQL Notifier: Starts, stops, or restarts the MySQL - server, and monitors its status. - - * MySQL for Excel - (http://dev.mysql.com/doc/mysql-for-excel/en/index.html): - Edits MySQL data with Microsoft Excel. - - On Windows, you need not create the data directory and the - grant tables. MySQL Windows distributions include the grant - tables with a set of preinitialized accounts in the mysql - database under the data directory. Regarding passwords, if - you installed MySQL using the MySQL Installer, you may have - already assigned passwords to the accounts. (See Section - 2.3.3, "Installing MySQL on Microsoft Windows Using MySQL - Installer.") Otherwise, use the password-assignment procedure - given in Section 2.10.2, "Securing the Initial MySQL - Accounts." - - Before setting up passwords, you might want to try running - some client programs to make sure that you can connect to the - server and that it is operating properly. Make sure that the - server is running (see Section 2.3.5.4, "Starting the Server - for the First Time"), and then issue the following commands - to verify that you can retrieve information from the server. - You may need to specify directory different from C:\mysql\bin - on the command line. If you installed MySQL using MySQL - Installer, the default directory is C:\Program - Files\MySQL\MySQL Server 5.6, and the mysql and mysqlshow - client programs are in C:\Program Files\MySQL\MySQL Server - 5.6\bin. See Section 2.3.3, "Installing MySQL on Microsoft - Windows Using MySQL Installer," for more information. - - Use mysqlshow to see what databases exist: -C:\> C:\mysql\bin\mysqlshow -+--------------------+ -| Databases | -+--------------------+ -| information_schema | -| mysql | -| test | -+--------------------+ - - The list of installed databases may vary, but will always - include the minimum of mysql and information_schema. In most - cases, the test database will also be installed - automatically. - - The preceding command (and commands for other MySQL programs - such as mysql) may not work if the correct MySQL account does - not exist. For example, the program may fail with an error, - or you may not be able to view all databases. If you - installed MySQL using MySQL Installer, then the root user - will have been created automatically with the password you - supplied. In this case, you should use the -u root and -p - options. (You will also need to use the -u root and -p - options if you have already secured the initial MySQL - accounts.) With -p, you will be prompted for the root - password. For example: -C:\> C:\mysql\bin\mysqlshow -u root -p -Enter password: (enter root password here) -+--------------------+ -| Databases | -+--------------------+ -| information_schema | -| mysql | -| test | -+--------------------+ - - If you specify a database name, mysqlshow displays a list of - the tables within the database: -C:\> C:\mysql\bin\mysqlshow mysql -Database: mysql -+---------------------------+ -| Tables | -+---------------------------+ -| columns_priv | -| db | -| event | -| func | -| help_category | -| help_keyword | -| help_relation | -| help_topic | -| host | -| plugin | -| proc | -| procs_priv | -| servers | -| tables_priv | -| time_zone | -| time_zone_leap_second | -| time_zone_name | -| time_zone_transition | -| time_zone_transition_type | -| user | -+---------------------------+ - - Use the mysql program to select information from a table in - the mysql database: -C:\> C:\mysql\bin\mysql -e "SELECT Host,Db,User FROM mysql.db" -+------+--------+------+ -| host | db | user | -+------+--------+------+ -| % | test | | -| % | test_% | | -+------+--------+------+ - - For more information about mysqlshow and mysql, see Section - 4.5.6, "mysqlshow --- Display Database, Table, and Column - Information," and Section 4.5.1, "mysql --- The MySQL - Command-Line Tool." - - If you are running a version of Windows that supports - services, you can set up the MySQL server to run - automatically when Windows starts. See Section 2.3.5.7, - "Starting MySQL as a Windows Service." diff --git a/mysql-wsrep-5.6/Docs/mysql.info b/mysql-wsrep-5.6/Docs/mysql.info new file mode 100644 index 00000000..a812a06e --- /dev/null +++ b/mysql-wsrep-5.6/Docs/mysql.info @@ -0,0 +1,3 @@ + +The MySQL Reference Manual is available in various formats on +http://dev.mysql.com/doc. diff --git a/mysql-wsrep-5.6/INSTALL b/mysql-wsrep-5.6/INSTALL new file mode 100644 index 00000000..3bd68dcd --- /dev/null +++ b/mysql-wsrep-5.6/INSTALL @@ -0,0 +1,11 @@ +Pre-built binaries in different package formats can be found on + + http://www.mysql.com/downloads + +You can find information about how to install from a source distribution at + + http://dev.mysql.com/doc/refman/5.6/en/source-installation.html + +The MySQL 5.6 Reference Manual is available on + + http://dev.mysql.com/doc/refman/5.6/en/ diff --git a/mysql-wsrep-5.6/INSTALL-SOURCE b/mysql-wsrep-5.6/INSTALL-SOURCE deleted file mode 100644 index ac578609..00000000 --- a/mysql-wsrep-5.6/INSTALL-SOURCE +++ /dev/null @@ -1,9474 +0,0 @@ -Chapter 2 Installing and Upgrading MySQL - - This chapter describes how to obtain and install MySQL. A - summary of the procedure follows and later sections provide - the details. If you plan to upgrade an existing version of - MySQL to a newer version rather than install MySQL for the - first time, see Section 2.11.1, "Upgrading MySQL," for - information about upgrade procedures and about issues that - you should consider before upgrading. - - If you are interested in migrating to MySQL from another - database system, you may wish to read Section A.8, "MySQL 5.6 - FAQ: Migration," which contains answers to some common - questions concerning migration issues. - - Installation of MySQL generally follows the steps outlined - here: - - 1. Determine whether MySQL runs and is supported on your - platform. - Please note that not all platforms are equally suitable - for running MySQL, and that not all platforms on which - MySQL is known to run are officially supported by Oracle - Corporation: - - 2. Choose which distribution to install. - Several versions of MySQL are available, and most are - available in several distribution formats. You can choose - from pre-packaged distributions containing binary - (precompiled) programs or source code. When in doubt, use - a binary distribution. We also provide public access to - our current source tree for those who want to see our - most recent developments and help us test new code. To - determine which version and type of distribution you - should use, see Section 2.1.2, "Which MySQL Version and - Distribution to Install." - - 3. Download the distribution that you want to install. - For instructions, see Section 2.1.3, "How to Get MySQL." - To verify the integrity of the distribution, use the - instructions in Section 2.1.4, "Verifying Package - Integrity Using MD5 Checksums or GnuPG." - - 4. Install the distribution. - To install MySQL from a binary distribution, use the - instructions in Section 2.2, "Installing MySQL on - Unix/Linux Using Generic Binaries." - To install MySQL from a source distribution or from the - current development source tree, use the instructions in - Section 2.9, "Installing MySQL from Source." - - 5. Perform any necessary postinstallation setup. - After installing MySQL, see Section 2.10, - "Postinstallation Setup and Testing" for information - about making sure the MySQL server is working properly. - Also refer to the information provided in Section 2.10.2, - "Securing the Initial MySQL Accounts." This section - describes how to secure the initial MySQL user accounts, - which have no passwords until you assign passwords. The - section applies whether you install MySQL using a binary - or source distribution. - - 6. If you want to run the MySQL benchmark scripts, Perl - support for MySQL must be available. See Section 2.13, - "Perl Installation Notes." - - Instructions for installing MySQL on different platforms and - environments is available on a platform by platform basis: - - * Unix, Linux, FreeBSD - For instructions on installing MySQL on most Linux and - Unix platforms using a generic binary (for example, a - .tar.gz package), see Section 2.2, "Installing MySQL on - Unix/Linux Using Generic Binaries." - For information on building MySQL entirely from the - source code distributions or the source code - repositories, see Section 2.9, "Installing MySQL from - Source" - For specific platform help on installation, - configuration, and building from source see the - corresponding platform section: - - + Linux, including notes on distribution specific - methods, see Section 2.5, "Installing MySQL on - Linux." - - + Solaris and OpenSolaris, including PKG and IPS - formats, see Section 2.7, "Installing MySQL on - Solaris and OpenSolaris." - - + IBM AIX, see Section 2.7, "Installing MySQL on - Solaris and OpenSolaris." - - + FreeBSD, see Section 2.8, "Installing MySQL on - FreeBSD." - - * Microsoft Windows - For instructions on installing MySQL on Microsoft - Windows, using either a Zipped binary or an MSI package, - see Section 2.3, "Installing MySQL on Microsoft Windows." - For details and instructions on building MySQL from - source code using Microsoft Visual Studio, see Section - 2.9, "Installing MySQL from Source." - - * OS X - For installation on OS X, including using both the binary - package and native PKG formats, see Section 2.4, - "Installing MySQL on OS X." - For information on making use of the MySQL Startup Item - to automatically start and stop MySQL, see Section 2.4.4, - "Installing the MySQL Startup Item." - For information on the MySQL Preference Pane, see Section - 2.4.5, "Installing and Using the MySQL Preference Pane." - -2.1 General Installation Guidance - - The immediately following sections contain the information - necessary to choose, download, and verify your distribution. - The instructions in later sections of the chapter describe - how to install the distribution that you choose. For binary - distributions, see the instructions at Section 2.2, - "Installing MySQL on Unix/Linux Using Generic Binaries" or - the corresponding section for your platform if available. To - build MySQL from source, use the instructions in Section 2.9, - "Installing MySQL from Source." - -2.1.1 Operating Systems Supported by MySQL Community Server - - MySQL is available on a number of operating systems and - platforms. For information about those platforms that are - officially supported, see - http://www.mysql.com/support/supportedplatforms/database.html - on the MySQL Web site. - -2.1.2 Which MySQL Version and Distribution to Install - - When preparing to install MySQL, you should decide which - version to use, and which distribution format (binary or - source) to use for the installation. - - First, decide if you want to install a development release or - a GA release. Development releases have the newest features, - but are not recommended for production use. GA (General - Availability) releases, also called production or stable - releases, are meant for production use. We recommend to use - the most recent GA release. - - The naming scheme in MySQL 5.6 uses release names that - consist of three numbers and a suffix; for example, - mysql-5.6.1-m1. The numbers within the release name are - interpreted as follows: - - * The first number (5) is the major version and describes - the file format. All MySQL 5 releases have the same file - format. - - * The second number (6) is the release level. Taken - together, the major version and release level constitute - the release series number. - - * The third number (1) is the version number within the - release series. This is incremented for each new release. - Usually you want the latest version for the series you - have chosen. - - For each minor update, the last number in the version string - is incremented. When there are major new features or minor - incompatibilities with previous versions, the second number - in the version string is incremented. When the file format - changes, the first number is increased. - - Release names can also include a suffix that indicates the - stability level of the release. Releases within a series - progress through a set of suffixes to indicate how the - stability level improves. The possible suffixes are: - - * If there is no suffix, it indicates that the release is a - General Availability (GA) or Production release. GA - releases are stable, having successfully passed through - all earlier release stages and are believed to be - reliable, free of serious bugs, and suitable for use in - production systems. Only critical bugfixes are applied to - the release. - - * mN (for example, m1, m2, m3, ...) indicate a milestone - number. MySQL development uses a milestone model, in - which each milestone proceeds through a small number of - versions with a tight focus on a small subset of - thoroughly tested features. Following the releases for - one milestone, development proceeds with another small - number of releases that focuses on the next small set of - features, also thoroughly tested. Features within - milestone releases may be considered to be of - pre-production quality. - - * rc indicates a Release Candidate. Release candidates are - believed to be stable, having passed all of MySQL's - internal testing, and with all known fatal runtime bugs - fixed. However, the release has not been in widespread - use long enough to know for sure that all bugs have been - identified. Only minor fixes are added. - - Once you've chosen which MySQL version to install, you need - to decide which distribution to install for your operating - system. For most use cases, a binary distribution is the - right choice. Binary distributions are available in native - format for many platforms, such as RPM packages for Linux, or - DMG packages for OS X. Distributions are also available in - more generic formats such as Zip archives or compressed tar - files. On Windows, you can use the MySQL Installer to install - a binary distribution. - - Under some circumstances, you may be better off installing - MySQL from a source distribution: - - * You want to install MySQL at some explicit location. The - standard binary distributions are ready to run at any - installation location, but you might require even more - flexibility to place MySQL components where you want. - - * You want to configure mysqld to ensure that features are - available that might not be included in the standard - binary distributions. Here is a list of the most common - extra options that you may want to use to ensure feature - availability: - - + -DWITH_LIBWRAP=1 for TCP wrappers support. - - + -DWITH_ZLIB={system|bundled} for features that - depend on compression - - + -DWITH_DEBUG=1 for debugging support - For additional information, see Section 2.9.4, "MySQL - Source-Configuration Options." - - * You want to configure mysqld without some features that - are included in the standard binary distributions. For - example, distributions normally are compiled with support - for all character sets. If you want a smaller MySQL - server, you can recompile it with support for only the - character sets you need. - - * You want to use the latest sources from one of the Git - repositories to have access to all current bugfixes. For - example, if you have found a bug and reported it to the - MySQL development team, the bugfix is committed to the - source repository and you can access it there. The bugfix - does not appear in a release until a release actually is - issued. - - * You want to read (or modify) the C and C++ code that - makes up MySQL. For this purpose, you should get a source - distribution. - - * Source distributions contain more tests and examples than - binary distributions. - -2.1.3 How to Get MySQL - - Check our downloads page at http://dev.mysql.com/downloads/ - for information about the current version of MySQL and for - downloading instructions. For a complete up-to-date list of - MySQL download mirror sites, see - http://dev.mysql.com/downloads/mirrors.html. You can also - find information there about becoming a MySQL mirror site and - how to report a bad or out-of-date mirror. - - For RPM-based Linux platforms that use Yum as their package - management system, MySQL can be installed using the MySQL Yum - Repository (http://dev.mysql.com/downloads/repo/yum/). See - Section 2.5.1, "Installing MySQL on Linux Using the MySQL Yum - Repository" for details. - - For a number of Debian-based Linux platforms, MySQL can be - installed using the MySQL APT Repository - (http://dev.mysql.com/downloads/repo/apt/). See Section - 2.5.3, "Installing MySQL on Linux Using the MySQL APT - Repository" for details. - - For SUSE Linux Enterprise Server (SLES) platforms, MySQL can - be installed using the MySQL SLES Repository - (http://dev.mysql.com/downloads/repo/suse/). See Section - 2.5.4, "Installing MySQL on Linux Using the MySQL SLES - Repository" for details. - - To obtain the latest development source, see Section 2.9.3, - "Installing MySQL Using a Development Source Tree." - -2.1.4 Verifying Package Integrity Using MD5 Checksums or GnuPG - - After you have downloaded the MySQL package that suits your - needs and before you attempt to install it, you should make - sure that it is intact and has not been tampered with. There - are three means of integrity checking: - - * MD5 checksums - - * Cryptographic signatures using GnuPG, the GNU Privacy - Guard - - * For RPM packages, the built-in RPM integrity verification - mechanism - - The following sections describe how to use these methods. - - If you notice that the MD5 checksum or GPG signatures do not - match, first try to download the respective package one more - time, perhaps from another mirror site. - -2.1.4.1 Verifying the MD5 Checksum - - After you have downloaded a MySQL package, you should make - sure that its MD5 checksum matches the one provided on the - MySQL download pages. Each package has an individual checksum - that you can verify against the package that you downloaded. - The correct MD5 checksum is listed on the downloads page for - each MySQL product, and you will compare it against the MD5 - checksum of the file (product) that you download. - - Each operating system and setup offers its own version of - tools for checking the MD5 checksum. Typically the command is - named md5sum, or it may be named md5, and some operating - systems do not ship it at all. On Linux, it is part of the - GNU Text Utilities package, which is available for a wide - range of platforms. You can also download the source code - from http://www.gnu.org/software/textutils/. If you have - OpenSSL installed, you can use the command openssl md5 - package_name instead. A Windows implementation of the md5 - command line utility is available from - http://www.fourmilab.ch/md5/. winMd5Sum is a graphical MD5 - checking tool that can be obtained from - http://www.nullriver.com/index/products/winmd5sum. Our - Microsoft Windows examples will assume the name md5.exe. - - Linux and Microsoft Windows examples: -shell> md5sum mysql-standard-5.6.23-linux-i686.tar.gz -aaab65abbec64d5e907dcd41b8699945 mysql-standard-5.6.23-linux-i686.tar -.gz - -shell> md5.exe mysql-installer-community-5.6.23.msi -aaab65abbec64d5e907dcd41b8699945 mysql-installer-community-5.6.23.msi - - You should verify that the resulting checksum (the string of - hexadecimal digits) matches the one displayed on the download - page immediately below the respective package. - Note - - Make sure to verify the checksum of the archive file (for - example, the .zip, .tar.gz, or .msi file) and not of the - files that are contained inside of the archive. In other - words, verify the file before extracting its contents. - -2.1.4.2 Signature Checking Using GnuPG - - Another method of verifying the integrity and authenticity of - a package is to use cryptographic signatures. This is more - reliable than using MD5 checksums, but requires more work. - - We sign MySQL downloadable packages with GnuPG (GNU Privacy - Guard). GnuPG is an Open Source alternative to the well-known - Pretty Good Privacy (PGP) by Phil Zimmermann. See - http://www.gnupg.org/ for more information about GnuPG and - how to obtain and install it on your system. Most Linux - distributions ship with GnuPG installed by default. For more - information about GnuPG, see http://www.openpgp.org/. - - To verify the signature for a specific package, you first - need to obtain a copy of our public GPG build key, which you - can download from http://pgp.mit.edu/. The key that you want - to obtain is named mysql-build@oss.oracle.com. Alternatively, - you can cut and paste the key directly from the following - text: ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1.4.9 (SunOS) - -mQGiBD4+owwRBAC14GIfUfCyEDSIePvEW3SAFUdJBtoQHH/nJKZyQT7h9bPlUWC3 -RODjQReyCITRrdwyrKUGku2FmeVGwn2u2WmDMNABLnpprWPkBdCk96+OmSLN9brZ -fw2vOUgCmYv2hW0hyDHuvYlQA/BThQoADgj8AW6/0Lo7V1W9/8VuHP0gQwCgvzV3 -BqOxRznNCRCRxAuAuVztHRcEAJooQK1+iSiunZMYD1WufeXfshc57S/+yeJkegNW -hxwR9pRWVArNYJdDRT+rf2RUe3vpquKNQU/hnEIUHJRQqYHo8gTxvxXNQc7fJYLV -K2HtkrPbP72vwsEKMYhhr0eKCbtLGfls9krjJ6sBgACyP/Vb7hiPwxh6rDZ7ITnE -kYpXBACmWpP8NJTkamEnPCia2ZoOHODANwpUkP43I7jsDmgtobZX9qnrAXw+uNDI -QJEXM6FSbi0LLtZciNlYsafwAPEOMDKpMqAK6IyisNtPvaLd8lH0bPAnWqcyefep -rv0sxxqUEMcM3o7wwgfN83POkDasDbs3pjwPhxvhz6//62zQJ7Q2TXlTUUwgUmVs -ZWFzZSBFbmdpbmVlcmluZyA8bXlzcWwtYnVpbGRAb3NzLm9yYWNsZS5jb20+iGkE -ExECACkCGyMGCwkIBwMCBBUCCAMEFgIDAQIeAQIXgAIZAQUCUwHUZgUJGmbLywAK -CRCMcY07UHLh9V+DAKCjS1gGwgVI/eut+5L+l2v3ybl+ZgCcD7ZoA341HtoroV3U -6xRD09fUgeq0O015U1FMIFBhY2thZ2Ugc2lnbmluZyBrZXkgKHd3dy5teXNxbC5j -b20pIDxidWlsZEBteXNxbC5jb20+iG8EMBECAC8FAk53Pa0oHSBidWlsZEBteXNx -bC5jb20gd2lsbCBzdG9wIHdvcmtpbmcgc29vbgAKCRCMcY07UHLh9bU9AJ9xDK0o -xJFL9vTl9OSZC4lX0K9AzwCcCrS9cnJyz79eaRjL0s2r/CcljdyIZQQTEQIAHQUC -R6yUtAUJDTBYqAULBwoDBAMVAwIDFgIBAheAABIJEIxxjTtQcuH1B2VHUEcAAQGu -kgCffz4GUEjzXkOi71VcwgCxASTgbe0An34LPr1j9fCbrXWXO14msIADfb5piEwE -ExECAAwFAj4+o9EFgwlmALsACgkQSVDhKrJykfIk4QCfWbEeKN+3TRspe+5xKj+k -QJSammIAnjUz0xFWPlVx0f8o38qNG1bq0cU9iEwEExECAAwFAj5CggMFgwliIokA -CgkQtvXNTca6JD+WkQCgiGmnoGjMojynp5ppvMXkyUkfnykAoK79E6h8rwkSDZou -iz7nMRisH8uyiEYEEBECAAYFAj+s468ACgkQr8UjSHiDdA/2lgCg21IhIMMABTYd -p/IBiUsP/JQLiEoAnRzMywEtujQz/E9ono7H1DkebDa4iEYEEBECAAYFAj+0Q3cA -CgkQhZavqzBzTmbGwwCdFqD1frViC7WRt8GKoOS7hzNN32kAnirlbwpnT7a6NOsQ -83nk11a2dePhiEYEEBECAAYFAkNbs+oACgkQi9gubzC5S1x/dACdELKoXQKkwJN0 -gZztsM7kjsIgyFMAnRRMbHQ7V39XC90OIpaPjk3a01tgiEYEExECAAYFAkTxMyYA -CgkQ9knE9GCTUwwKcQCgibak/SwhxWH1ijRhgYCo5GtM4vcAnAhtzL57wcw1Kg1X -m7nVGetUqJ7fiEwEEBECAAwFAkGBywEFgwYi2YsACgkQGFnQH2d7oexCjQCcD8sJ -NDc/mS8m8OGDUOx9VMWcnGkAnj1YWOD+Qhxo3mI/Ul9oEAhNkjcfiEwEEBECAAwF -AkGByzQFgwYi2VgACgkQgcL36+ITtpIiIwCdFVNVUB8xe8mFXoPm4d9Z54PTjpMA -niSPA/ZsfJ3oOMLKar4F0QPPrdrGiEwEEBECAAwFAkGBy2IFgwYi2SoACgkQa3Ds -2V3D9HMJqgCbBYzr5GPXOXgP88jKzmdbjweqXeEAnRss4G2G/3qD7uhTL1SPT1SH -jWUXiEwEEBECAAwFAkHQkyQFgwXUEWgACgkQfSXKCsEpp8JiVQCghvWvkPqowsw8 -w7WSseTcw1tflvkAni+vLHl/DqIly0LkZYn5jzK1dpvfiEwEEBECAAwFAkIrW7oF -gwV5SNIACgkQ5hukiRXruavzEwCgkzL5QkLSypcw9LGHcFSx1ya0VL4An35nXkum -g6cCJ1NP8r2I4NcZWIrqiEwEEhECAAwFAkAqWToFgwd6S1IACgkQPKEfNJT6+GEm -XACcD+A53A5OGM7w750W11ukq4iZ9ckAnRMvndAqn3YTOxxlLPj2UPZiSgSqiEwE -EhECAAwFAkA9+roFgwdmqdIACgkQ8tdcY+OcZZyy3wCgtDcwlaq20w0cNuXFLLNe -EUaFFTwAni6RHN80moSVAdDTRkzZacJU3M5QiEwEEhECAAwFAkEOCoQFgwaWmggA -CgkQOcor9D1qil/83QCeITZ9wIo7XAMjC6y4ZWUL4m+edZsAoMOhRIRi42fmrNFu -vNZbnMGej81viEwEEhECAAwFAkKApTQFgwUj/1gACgkQBA3AhXyDn6jjJACcD1A4 -UtXk84J13JQyoH9+dy24714Aniwlsso/9ndICJOkqs2j5dlHFq6oiEwEExECAAwF -Aj5NTYQFgwlXVwgACgkQLbt2v63UyTMFDACglT5G5NVKf5Mj65bFSlPzb92zk2QA -n1uc2h19/IwwrsbIyK/9POJ+JMP7iEwEExECAAwFAkHXgHYFgwXNJBYACgkQZu/b -yM2C/T4/vACfXe67xiSHB80wkmFZ2krb+oz/gBAAnjR2ucpbaonkQQgnC3GnBqmC -vNaJiEwEExECAAwFAkIYgQ4FgwWMI34ACgkQdsEDHKIxbqGg7gCfQi2HcrHn+yLF -uNlH1oSOh48ZM0oAn3hKV0uIRJphonHaUYiUP1ttWgdBiGUEExECAB0FCwcKAwQD -FQMCAxYCAQIXgAUCS3AvygUJEPPzpwASB2VHUEcAAQEJEIxxjTtQcuH1sNsAniYp -YBGqy/HhMnw3WE8kXahOOR5KAJ4xUmWPGYP4l3hKxyNK9OAUbpDVYIh7BDARAgA7 -BQJCdzX1NB0AT29wcy4uLiBzaG91bGQgaGF2ZSBiZWVuIGxvY2FsISBJJ20gKnNv -KiBzdHVwaWQuLi4ACgkQOcor9D1qil/vRwCdFo08f66oKLiuEAqzlf9iDlPozEEA -n2EgvCYLCCHjfGosrkrU3WK5NFVgiI8EMBECAE8FAkVvAL9IHQBTaG91bGQgaGF2 -ZSBiZWVuIGEgbG9jYWwgc2lnbmF0dXJlLCBvciBzb21ldGhpbmcgLSBXVEYgd2Fz -IEkgdGhpbmtpbmc/AAoJEDnKK/Q9aopfoPsAn3BVqKOalJeF0xPSvLR90PsRlnmG -AJ44oisY7Tl3NJbPgZal8W32fbqgbIkCIgQQAQIADAUCQYHLhQWDBiLZBwAKCRCq -4+bOZqFEaKgvEACCErnaHGyUYa0wETjj6DLEXsqeOiXad4i9aBQxnD35GUgcFofC -/nCY4XcnCMMEnmdQ9ofUuU3OBJ6BNJIbEusAabgLooebP/3KEaiCIiyhHYU5jarp -ZAh+Zopgs3Oc11mQ1tIaS69iJxrGTLodkAsAJAeEUwTPq9fHFFzC1eGBysoyFWg4 -bIjz/zClI+qyTbFA5g6tRoiXTo8ko7QhY2AA5UGEg+83Hdb6akC04Z2QRErxKAqr -phHzj8XpjVOsQAdAi/qVKQeNKROlJ+iq6+YesmcWGfzeb87dGNweVFDJIGA0qY27 -pTb2lExYjsRFN4Cb13NfodAbMTOxcAWZ7jAPCxAPlHUG++mHMrhQXEToZnBFE4nb -nC7vOBNgWdjUgXcpkUCkop4b17BFpR+k8ZtYLSS8p2LLz4uAeCcSm2/msJxT7rC/ -FvoH8428oHincqs2ICo9zO/Ud4HmmO0O+SsZdVKIIjinGyOVWb4OOzkAlnnhEZ3o -6hAHcREIsBgPwEYVTj/9ZdC0AO44Nj9cU7awaqgtrnwwfr/o4V2gl8bLSkltZU27 -/29HeuOeFGjlFe0YrDd/aRNsxbyb2O28H4sG1CVZmC5uK1iQBDiSyA7Q0bbdofCW -oQzm5twlpKWnY8Oe0ub9XP5p/sVfck4FceWFHwv+/PC9RzSl33lQ6vM2wIkCIgQT -AQIADAUCQp8KHAWDBQWacAAKCRDYwgoJWiRXzyE+D/9uc7z6fIsalfOYoLN60ajA -bQbI/uRKBFugyZ5RoaItusn9Z2rAtn61WrFhu4uCSJtFN1ny2RERg40f56pTghKr -D+YEt+Nze6+FKQ5AbGIdFsR/2bUk+ZZRSt83e14Lcb6ii/fJfzkoIox9ltkifQxq -Y7Tvk4noKu4oLSc8O1Wsfc/y0B9sYUUCmUfcnq58DEmGie9ovUslmyt5NPnveXxp -5UeaRc5Rqt9tK2B4A+7/cqENrdZJbAMSunt2+2fkYiRunAFPKPBdJBsY1sxeL/A9 -aKe0viKEXQdAWqdNZKNCi8rd/oOP99/9lMbFudAbX6nL2DSb1OG2Z7NWEqgIAzjm -pwYYPCKeVz5Q8R+if9/fe5+STY/55OaI33fJ2H3v+U435VjYqbrerWe36xJItcJe -qUzW71fQtXi1CTEl3w2ch7VF5oj/QyjabLnAlHgSlkSi6p7By5C2MnbCHlCfPnIi -nPhFoRcRGPjJe9nFwGs+QblvS/Chzc2WX3s/2SWm4gEUKRX4zsAJ5ocyfa/vkxCk -SxK/erWlCPf/J1T70+i5waXDN/E3enSet/WL7h94pQKpjz8OdGL4JSBHuAVGA+a+ -dknqnPF0KMKLhjrgV+L7O84FhbmAP7PXm3xmiMPriXf+el5fZZequQoIagf8rdRH -HhRJxQgI0HNknkaOqs8dtrkCDQQ+PqMdEAgA7+GJfxbMdY4wslPnjH9rF4N2qfWs -EN/lxaZoJYc3a6M02WCnHl6ahT2/tBK2w1QI4YFteR47gCvtgb6O1JHffOo2HfLm -RDRiRjd1DTCHqeyX7CHhcghj/dNRlW2Z0l5QFEcmV9U0Vhp3aFfWC4Ujfs3LU+hk -AWzE7zaD5cH9J7yv/6xuZVw411x0h4UqsTcWMu0iM1BzELqX1DY7LwoPEb/O9Rkb -f4fmLe11EzIaCa4PqARXQZc4dhSinMt6K3X4BrRsKTfozBu74F47D8Ilbf5vSYHb -uE5p/1oIDznkg/p8kW+3FxuWrycciqFTcNz215yyX39LXFnlLzKUb/F5GwADBQf+ -Lwqqa8CGrRfsOAJxim63CHfty5mUc5rUSnTslGYEIOCR1BeQauyPZbPDsDD9MZ1Z -aSafanFvwFG6Llx9xkU7tzq+vKLoWkm4u5xf3vn55VjnSd1aQ9eQnUcXiL4cnBGo -TbOWI39EcyzgslzBdC++MPjcQTcA7p6JUVsP6oAB3FQWg54tuUo0Ec8bsM8b3Ev4 -2LmuQT5NdKHGwHsXTPtl0klk4bQk4OajHsiy1BMahpT27jWjJlMiJc+IWJ0mghkK -Ht926s/ymfdf5HkdQ1cyvsz5tryVI3Fx78XeSYfQvuuwqp2H139pXGEkg0n6KdUO -etdZWhe70YGNPw1yjWJT1IhUBBgRAgAMBQJOdz3tBQkT+wG4ABIHZUdQRwABAQkQ -jHGNO1By4fUUmwCbBYr2+bBEn/L2BOcnw9Z/QFWuhRMAoKVgCFm5fadQ3Afi+UQl -AcOphrnJ -=443I ------END PGP PUBLIC KEY BLOCK----- - - To import the build key into your personal public GPG - keyring, use gpg --import. For example, if you have saved the - key in a file named mysql_pubkey.asc, the import command - looks like this: -shell> gpg --import mysql_pubkey.asc -gpg: key 5072E1F5: public key "MySQL Release Engineering -" imported -gpg: Total number processed: 1 -gpg: imported: 1 -gpg: no ultimately trusted keys found - - You can also download the key from the public keyserver using - the public key id, 5072E1F5: -shell> gpg --recv-keys 5072E1F5 -gpg: requesting key 5072E1F5 from hkp server keys.gnupg.net -gpg: key 5072E1F5: "MySQL Release Engineering " -1 new user ID -gpg: key 5072E1F5: "MySQL Release Engineering " -53 new signatures -gpg: no ultimately trusted keys found -gpg: Total number processed: 1 -gpg: new user IDs: 1 -gpg: new signatures: 53 - - If you want to import the key into your RPM configuration to - validate RPM install packages, you should be able to import - the key directly: -shell> rpm --import mysql_pubkey.asc - - If you experience problems or require RPM specific - information, see Section 2.1.4.4, "Signature Checking Using - RPM." - - After you have downloaded and imported the public build key, - download your desired MySQL package and the corresponding - signature, which also is available from the download page. - The signature file has the same name as the distribution file - with an .asc extension, as shown by the examples in the - following table. - - Table 2.1 MySQL Package and Signature Files for Source files - File Type File Name - Distribution file mysql-standard-5.6.23-linux-i686.tar.gz - Signature file mysql-standard-5.6.23-linux-i686.tar.gz.asc - - Make sure that both files are stored in the same directory - and then run the following command to verify the signature - for the distribution file: -shell> gpg --verify package_name.asc - - If the downloaded package is valid, you will see a "Good - signature" similar to: -shell> gpg --verify mysql-standard-5.6.23-linux-i686.tar.gz.asc -gpg: Signature made Tue 01 Feb 2011 02:38:30 AM CST using DSA key ID 5 -072E1F5 -gpg: Good signature from "MySQL Release Engineering " - - The Good signature message indicates that the file signature - is valid, when compared to the signature listed on our site. - But you might also see warnings, like so: -shell> gpg --verify mysql-standard-5.6.23-linux-i686.tar.gz.asc -gpg: Signature made Wed 23 Jan 2013 02:25:45 AM PST using DSA key ID 5 -072E1F5 -gpg: checking the trustdb -gpg: no ultimately trusted keys found -gpg: Good signature from "MySQL Release Engineering " -gpg: WARNING: This key is not certified with a trusted signature! -gpg: There is no indication that the signature belongs to the - owner. -Primary key fingerprint: A4A9 4068 76FC BD3C 4567 70C8 8C71 8D3B 5072 - E1F5 - - That is normal, as they depend on your setup and - configuration. Here are explanations for these warnings: - - * gpg: no ultimately trusted keys found: This means that - the specific key is not "ultimately trusted" by you or - your web of trust, which is okay for the purposes of - verifying file signatures. - - * WARNING: This key is not certified with a trusted - signature! There is no indication that the signature - belongs to the owner.: This refers to your level of trust - in your belief that you possess our real public key. This - is a personal decision. Ideally, a MySQL developer would - hand you the key in person, but more commonly, you - downloaded it. Was the download tampered with? Probably - not, but this decision is up to you. Setting up a web of - trust is one method for trusting them. - - See the GPG documentation for more information on how to work - with public keys. - -2.1.4.3 Signature Checking Using Gpg4win for Windows - - The Section 2.1.4.2, "Signature Checking Using GnuPG" section - describes how to verify MySQL downloads using GPG. That guide - also applies to Microsoft Windows, but another option is to - use a GUI tool like Gpg4win (http://www.gpg4win.org/). You - may use a different tool but our examples are based on - Gpg4win, and utilize its bundled Kleopatra GUI. - - Download and install Gpg4win, and then load Kleopatra. The - dialog should look similar to: - - Figure 2.1 Initial screen after loading Kleopatra - Initial screen after loading Kleopatra - - Next, add the MySQL Release Engineering certificate. Do this - by clicking File, Lookup Certificates on Server. Type "Mysql - Release Engineering" into the search box and press Search. - - Figure 2.2 Finding the MySQL Release Engineering certificate - Finding the MySQL Release Engineering certificate - - Select the "MySQL Release Engineering" certificate. The - Fingerprint and Key-ID must be "5072E1F5", or choose - Details... to confirm the certificate is valid. Now, import - it by clicking Import. An import dialog will be displayed, - choose Okay, and this certificate will now be listed under - the Imported Certificates tab. - - Next, configure the trust level for our certificate. Select - our certificate, then from the main menu select Certificates, - Change Owner Trust.... We suggest choosing I believe checks - are very accurate for our certificate, as otherwise you might - not be able to verify our signature. Select I believe checks - are very accurate and then press OK. - - Figure 2.3 Changing the Trust level - Changing the Trust level - - Next, verify the downloaded MySQL package file. This requires - files for both the packaged file, and the signature. The - signature file must have the same name as the packaged file - but with an appended .asc extension, as shown by the example - in the following table. The signature is linked to on the - downloads page for each MySQL product. You must create the - .asc file with this signature. - - Table 2.2 MySQL Package and Signature Files for MySQL - Installer for Microsoft Windows - File Type File Name - Distribution file mysql-installer-community-5.6.23.msi - Signature file mysql-installer-community-5.6.23.msi.asc - - Make sure that both files are stored in the same directory - and then run the following command to verify the signature - for the distribution file. Either drag and drop the signature - (.asc) file into Kleopatra, or load the dialog from File, - Decrypt/Verify Files..., and then choose either the .msi or - .asc file. - - Figure 2.4 The Decrypt/Verify Files dialog - The Decrypt/Verify Files dialog - - Click Decrypt/Verify to check the file. The two most common - results will look like the following, and although the yellow - warning looks problematic, the following means that the file - check passed with success. You may now run this installer. - - Figure 2.5 The Decrypt/Verify Results: Good - The Decrypt/Verify Results: Good - - Seeing a red "The signature is bad" error means the file is - invalid. Do not execute the MSI file if you see this error. - - Figure 2.6 The Decrypt/Verify Results: Bad - The Decrypt/Verify Results: Bad - - The Section 2.1.4.2, "Signature Checking Using GnuPG" section - explains why you probably don't see a green Good signature - result. - -2.1.4.4 Signature Checking Using RPM - - For RPM packages, there is no separate signature. RPM - packages have a built-in GPG signature and MD5 checksum. You - can verify a package by running the following command: -shell> rpm --checksig package_name.rpm - - Example: -shell> rpm --checksig MySQL-server-5.6.23-0.linux_glibc2.5.i386.rpm -MySQL-server-5.6.23-0.linux_glibc2.5.i386.rpm: md5 gpg OK - - Note - - If you are using RPM 4.1 and it complains about (GPG) NOT OK - (MISSING KEYS: GPG#5072e1f5), even though you have imported - the MySQL public build key into your own GPG keyring, you - need to import the key into the RPM keyring first. RPM 4.1 no - longer uses your personal GPG keyring (or GPG itself). - Rather, RPM maintains a separate keyring because it is a - system-wide application and a user's GPG public keyring is a - user-specific file. To import the MySQL public key into the - RPM keyring, first obtain the key, then use rpm --import to - import the key. For example: -shell> gpg --export -a 5072e1f5 > 5072e1f5.asc -shell> rpm --import 5072e1f5.asc - - Alternatively, rpm also supports loading the key directly - from a URL, and you can use this manual page: -shell> rpm --import doc/refman/5.6/en/checking-gpg-signature.html - - If you need to obtain the MySQL public key, see Section - 2.1.4.2, "Signature Checking Using GnuPG." - -2.1.5 Installation Layouts - - The installation layout differs for different installation - types (for example, native packages, binary tarballs, and - source tarballs), which can lead to confusion when managing - different systems or using different installation sources. - The individual layouts are given in the corresponding - installation type or platform chapter, as described - following. Note that the layout of installations from vendors - other than Oracle may differ from these layouts. - - * Section 2.3.1, "MySQL Installation Layout on Microsoft - Windows" - - * Section 2.9.1, "MySQL Layout for Source Installation" - - * Section 2.2, "MySQL Installation Layout for Generic - Unix/Linux Binary Package" - - * Section 2.5.5, "MySQL Installation Layout for Linux RPM - Packages from the MySQL Developer Zone" - - * Section 2.4.2, "MySQL Installation Layout on OS X" - -2.1.6 Compiler-Specific Build Characteristics - - In some cases, the compiler used to build MySQL affects the - features available for use. The notes in this section apply - for binary distributions provided by Oracle Corporation or - that you compile yourself from source. - - icc (Intel C++ Compiler) Builds - - A server built with icc has these characteristics: - - * SSL support is not included. - -2.2 Installing MySQL on Unix/Linux Using Generic Binaries - - Oracle provides a set of binary distributions of MySQL. These - include binary distributions in the form of compressed tar - files (files with a .tar.gz extension) for a number of - platforms, as well as binaries in platform-specific package - formats for selected platforms. - - This section covers the installation of MySQL from a - compressed tar file binary distribution. For other - platform-specific package formats, see the other - platform-specific sections. For example, for Windows - distributions, see Section 2.3, "Installing MySQL on - Microsoft Windows." - - To obtain MySQL, see Section 2.1.3, "How to Get MySQL." - - MySQL compressed tar file binary distributions have names of - the form mysql-VERSION-OS.tar.gz, where VERSION is a number - (for example, 5.6.23), and OS indicates the type of operating - system for which the distribution is intended (for example, - pc-linux-i686 or winx64). - - To install MySQL from a compressed tar file binary - distribution, your system must have GNU gunzip to uncompress - the distribution and a reasonable tar to unpack it. If your - tar program supports the z option, it can both uncompress and - unpack the file. - - GNU tar is known to work. The standard tar provided with some - operating systems is not able to unpack the long file names - in the MySQL distribution. You should download and install - GNU tar, or if available, use a preinstalled version of GNU - tar. Usually this is available as gnutar, gtar, or as tar - within a GNU or Free Software directory, such as /usr/sfw/bin - or /usr/local/bin. GNU tar is available from - http://www.gnu.org/software/tar/. - Warning - - If you have previously installed MySQL using your operating - system native package management system, such as yum or - apt-get, you may experience problems installing using a - native binary. Make sure your previous MySQL previous - installation has been removed entirely (using your package - management system), and that any additional files, such as - old versions of your data files, have also been removed. You - should also check the existence of configuration files such - as /etc/my.cnf or the /etc/mysql directory have been deleted. - Warning - - MySQL has a dependency on the libaio library. The - mysql_install_db and subsequent mysqld_safe steps will fail - if this library is not installed locally. If necessary, - install it using the appropriate package manager. For - example, on Yum-based systems: -shell> yum search libaio # search for info -shell> yum install libaio # install library - - Or, on APT-based systems: -shell> apt-cache search libaio # search for info -shell> apt-get install libaio1 # install library - - If you run into problems and need to file a bug report, - please use the instructions in Section 1.7, "How to Report - Bugs or Problems." - - On Unix, to install a compressed tar file binary - distribution, unpack it at the installation location you - choose (typically /usr/local/mysql). This creates the - directories shown in the following table. - - Table 2.3 MySQL Installation Layout for Generic Unix/Linux - Binary Package - Directory Contents of Directory - bin Client programs and the mysqld server - data Log files, databases - docs Manual in Info format - man Unix manual pages - include Include (header) files - lib Libraries - scripts mysql_install_db - share Miscellaneous support files, including error messages, - sample configuration files, SQL for database installation - sql-bench Benchmarks - - Debug versions of the mysqld binary are available as - mysqld-debug. To compile your own debug version of MySQL from - a source distribution, use the appropriate configuration - options to enable debugging support. For more information on - compiling from source, see Section 2.9, "Installing MySQL - from Source." - - To install and use a MySQL binary distribution, the basic - command sequence looks like this: -shell> groupadd mysql -shell> useradd -r -g mysql mysql -shell> cd /usr/local -shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz -shell> ln -s full-path-to-mysql-VERSION-OS mysql -shell> cd mysql -shell> chown -R mysql . -shell> chgrp -R mysql . -shell> scripts/mysql_install_db --user=mysql -shell> chown -R root . -shell> chown -R mysql data -shell> bin/mysqld_safe --user=mysql & -# Next command is optional -shell> cp support-files/mysql.server /etc/init.d/mysql.server - - mysql_install_db creates a default option file named my.cnf - in the base installation directory. This file is created from - a template included in the distribution package named - my-default.cnf. For more information, see Section 5.1.2.2, - "Using a Sample Default Server Configuration File." - - A more detailed version of the preceding description for - installing a binary distribution follows. - Note - - This procedure assumes that you have root (administrator) - access to your system. Alternatively, you can prefix each - command using the sudo (Linux) or pfexec (OpenSolaris) - command. - - The procedure does not set up any passwords for MySQL - accounts. After following the procedure, proceed to Section - 2.10.2, "Securing the Initial MySQL Accounts." - -Create a mysql User and Group - - If your system does not already have a user and group for - mysqld to run as, you may need to create one. The following - commands add the mysql group and the mysql user. You might - want to call the user and group something else instead of - mysql. If so, substitute the appropriate name in the - following instructions. The syntax for useradd and groupadd - may differ slightly on different versions of Unix, or they - may have different names such as adduser and addgroup. -shell> groupadd mysql -shell> useradd -r -g mysql mysql - - Note - - Because the user is required only for ownership purposes, not - login purposes, the useradd command uses the -r option to - create a user that does not have login permissions to your - server host. Omit this option to permit logins for the user - (or if your useradd does not support the option). - -Obtain and Unpack the Distribution - - Pick the directory under which you want to unpack the - distribution and change location into it. The example here - unpacks the distribution under /usr/local. The instructions, - therefore, assume that you have permission to create files - and directories in /usr/local. If that directory is - protected, you must perform the installation as root. -shell> cd /usr/local - - Obtain a distribution file using the instructions in Section - 2.1.3, "How to Get MySQL." For a given release, binary - distributions for all platforms are built from the same MySQL - source distribution. - - Unpack the distribution, which creates the installation - directory. Then create a symbolic link to that directory. tar - can uncompress and unpack the distribution if it has z option - support: -shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz -shell> ln -s full-path-to-mysql-VERSION-OS mysql - - The tar command creates a directory named mysql-VERSION-OS. - The ln command makes a symbolic link to that directory. This - enables you to refer more easily to the installation - directory as /usr/local/mysql. - - If your tar does not have z option support, use gunzip to - unpack the distribution and tar to unpack it. Replace the - preceding tar command with the following alternative command - to uncompress and extract the distribution: -shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf - - -Perform Postinstallation Setup - - The remainder of the installation process involves setting up - the configuration file, creating the core databases, and - starting the MySQL server. For next steps, see Section 2.10, - "Postinstallation Setup and Testing." - Note - - The accounts that are listed in the MySQL grant tables - initially have no passwords. After starting the server, you - should set up passwords for them using the instructions in - Section 2.10.2, "Securing the Initial MySQL Accounts." - -2.3 Installing MySQL on Microsoft Windows - - There are several different methods to install MySQL on - Microsoft Windows. - -Simple Installation Method - - The simplest and recommended method is to download MySQL - Installer (for Windows) and let it install and configure all - of the MySQL products on your system. Here is how: - - * Download MySQL Installer from - http://dev.mysql.com/downloads/installer/ and execute it. - Note - Unlike the standard MySQL Installer, the smaller - "web-community" version does not bundle any MySQL - applications but it will download the MySQL products you - choose to install. - - * Choose the appropriate Setup Type for your system. - Typically you will choose Developer Default to install - MySQL server and other MySQL tools related to MySQL - development, helpful tools like MySQL Workbench. Or, - choose the Custom setup type to manually select your - desired MySQL products. - Note - Multiple versions of MySQL server can exist on a single - system. You can choose one or multiple versions. - - * Complete the installation process by following the MySQL - Installation wizard's instructions. This will install - several MySQL products and start the MySQL server. - - * MySQL is now installed. You probably configured MySQL as - a service that will automatically start MySQL server - every time you restart your system. - - Note - - You probably also installed other helpful MySQL products like - MySQL Workbench and MySQL Notifier on your system. Consider - loading Chapter 26, "MySQL Workbench" to check your new MySQL - server connection, and Section 2.3.4, "MySQL Notifier" to - view the connection's status. By default, these two programs - automatically start after installing MySQL. - - This process also installs the MySQL Installer application on - your system, and later you can use MySQL Installer to upgrade - or reconfigure your MySQL products. - -Additional Installation Information - - MySQL is available for Microsoft Windows, for both 32-bit and - 64-bit versions. For supported Windows platform information, - see - http://www.mysql.com/support/supportedplatforms/database.html - . - - It is possible to run MySQL as a standard application or as a - Windows service. By using a service, you can monitor and - control the operation of the server through the standard - Windows service management tools. For more information, see - Section 2.3.5.7, "Starting MySQL as a Windows Service." - - Generally, you should install MySQL on Windows using an - account that has administrator rights. Otherwise, you may - encounter problems with certain operations such as editing - the PATH environment variable or accessing the Service - Control Manager. Once installed, MySQL does not need to be - executed using a user with Administrator privileges. - - For a list of limitations on the use of MySQL on the Windows - platform, see Section D.10.6, "Windows Platform Limitations." - - In addition to the MySQL Server package, you may need or want - additional components to use MySQL with your application or - development environment. These include, but are not limited - to: - - * To connect to the MySQL server using ODBC, you must have - a Connector/ODBC driver. For more information, including - installation and configuration instructions, see MySQL - Connector/ODBC Developer Guide - (http://dev.mysql.com/doc/connector-odbc/en/index.html). - Note - MySQL Installer will install and configure Connector/ODBC - for you. - - * To use MySQL server with .NET applications, you must have - the Connector/Net driver. For more information, including - installation and configuration instructions, see MySQL - Connector/Net Developer Guide - (http://dev.mysql.com/doc/connector-net/en/index.html). - Note - MySQL Installer will install and configure Connector/NET - for you. - - MySQL distributions for Windows can be downloaded from - http://dev.mysql.com/downloads/. See Section 2.1.3, "How to - Get MySQL." - - MySQL for Windows is available in several distribution - formats, detailed below. Generally speaking, you should use - MySQL Installer. It contains more features and MySQL products - than the older MSI, is simpler to use than the ZIP file, and - you need no additional tools to get MySQL up and running. - MySQL Installer automatically installs MySQL Server and - additional MySQL products, creates an options file, starts - the server, and enables you to create default user accounts. - For more information on choosing a package, see Section - 2.3.2, "Choosing An Installation Package." - - * A MySQL Installer distribution includes MySQL Server and - additional MySQL products including MySQL Workbench, - MySQL Notifier, and MySQL for Excel. MySQL Installer can - also be used to upgrade these products in the future. - For instructions on installing MySQL using MySQL - Installer, see Section 2.3.3, "Installing MySQL on - Microsoft Windows Using MySQL Installer." - - * The standard binary distribution (packaged as a Zip file) - contains all of the necessary files that you unpack into - your chosen location. This package contains all of the - files in the full Windows MSI Installer package, but does - not include an installation program. - For instructions on installing MySQL using the Zip file, - see Section 2.3.5, "Installing MySQL on Microsoft Windows - Using a noinstall Zip Archive." - - * The source distribution format contains all the code and - support files for building the executables using the - Visual Studio compiler system. - For instructions on building MySQL from source on - Windows, see Section 2.9, "Installing MySQL from Source." - - MySQL on Windows considerations: - - * Large Table Support - If you need tables with a size larger than 4GB, install - MySQL on an NTFS or newer file system. Do not forget to - use MAX_ROWS and AVG_ROW_LENGTH when you create tables. - See Section 13.1.17, "CREATE TABLE Syntax." - - * MySQL and Virus Checking Software - Virus-scanning software such as Norton/Symantec - Anti-Virus on directories containing MySQL data and - temporary tables can cause issues, both in terms of the - performance of MySQL and the virus-scanning software - misidentifying the contents of the files as containing - spam. This is due to the fingerprinting mechanism used by - the virus-scanning software, and the way in which MySQL - rapidly updates different files, which may be identified - as a potential security risk. - After installing MySQL Server, it is recommended that you - disable virus scanning on the main directory (datadir) - used to store your MySQL table data. There is usually a - system built into the virus-scanning software to enable - specific directories to be ignored. - In addition, by default, MySQL creates temporary files in - the standard Windows temporary directory. To prevent the - temporary files also being scanned, configure a separate - temporary directory for MySQL temporary files and add - this directory to the virus scanning exclusion list. To - do this, add a configuration option for the tmpdir - parameter to your my.ini configuration file. For more - information, see Section 2.3.5.2, "Creating an Option - File." - -2.3.1 MySQL Installation Layout on Microsoft Windows - - For MySQL 5.6 on Windows, the default installation directory - is C:\Program Files\MySQL\MySQL Server 5.6. Some Windows - users prefer to install in C:\mysql, the directory that - formerly was used as the default. However, the layout of the - subdirectories remains the same. - - All of the files are located within this parent directory, - using the structure shown in the following table. - - Table 2.4 Default MySQL Installation Layout for Microsoft - Windows - Directory Contents of Directory Notes - bin Client programs and the mysqld server - %ALLUSERSPROFILE%\MySQL\MySQL Server 5.6\ Log files, - databases (Windows XP, Windows Server 2003) The Windows - system variable %ALLUSERSPROFILE% defaults to C:\Documents - and Settings\All Users\Application Data - %PROGRAMDATA%\MySQL\MySQL Server 5.6\ Log files, databases - (Vista, Windows 7, Windows Server 2008, and newer) The - Windows system variable %PROGRAMDATA% defaults to - C:\ProgramData - examples Example programs and scripts - include Include (header) files - lib Libraries - scripts Utility scripts - share Miscellaneous support files, including error messages, - character set files, sample configuration files, SQL for - database installation - - If you install MySQL using the MySQL Installer, this package - creates and sets up the data directory that the installed - server will use, and also creates a pristine "template" data - directory named data under the installation directory. After - an installation has been performed using this package, the - template data directory can be copied to set up additional - MySQL instances. See Section 5.3, "Running Multiple MySQL - Instances on One Machine." - -2.3.2 Choosing An Installation Package - - For MySQL 5.6, there are installation package formats to - choose from when installing MySQL on Windows: - - * MySQL Installer: This package has a file name similar to - mysql-installer-community-5.6.23.0.msi or - mysql-installer-commercial-5.6.23.0.msi, and utilizes - MSIs to automatically install MySQL server and other - products. It will download and apply updates to itself, - and for each of the installed products. It also - configures the additional non-server products. - The installed products are configurable, and this - includes: documentation with samples and examples, - connectors (such as C, C++, J, NET, and ODBC), MySQL - Workbench, MySQL Notifier, MySQL for Excel, and the MySQL - Server with its components. - MySQL Installer will run on all Windows platforms that - are supported by MySQL (see - http://www.mysql.com/support/supportedplatforms/database. - html). - Note - Because MySQL Installer is not a native component of - Microsoft Windows and depends on .NET, it will not work - on minimal installation options like the "Server Core" - version of Windows Server 2008. - For instructions on installing MySQL using MySQL - Installer, see Section 2.3.3, "Installing MySQL on - Microsoft Windows Using MySQL Installer." - - * The Noinstall Archive: This package has a file name - similar to mysql-5.6.23-win32.zip or - mysql-5.6.23-winx64.zip, and contains all the files found - in the Complete install package, with the exception of - the GUI. This package does not include an automated - installer, and must be manually installed and configured. - - MySQL Installer is recommended for most users. - - Your choice of install package affects the installation - process you must follow. If you choose to use MySQL - Installer, see Section 2.3.3, "Installing MySQL on Microsoft - Windows Using MySQL Installer." If you choose to install a - Noinstall archive, see Section 2.3.5, "Installing MySQL on - Microsoft Windows Using a noinstall Zip Archive." - -2.3.3 Installing MySQL on Microsoft Windows Using MySQL Installer - - MySQL Installer simplifies the installation and updating - process for your MySQL products on Microsoft Windows. From - this central application, you can view, remove, update, and - reconfigure the existing MySQL products on your system. MySQL - Installer can also install plugins, documentation, tutorials, - and example databases. The MySQL Installer is only available - for Microsoft Windows, and includes both GUI and command-line - interfaces. - - The supported products include: - - * MySQL server (http://dev.mysql.com/doc/) (one or multiple - versions) - - * MySQL Workbench - - * MySQL Connectors - (http://dev.mysql.com/doc/index-connectors.html) (.Net / - Python / ODBC / Java / C / C++) - - * MySQL Notifier - - * MySQL for Excel - (http://dev.mysql.com/doc/mysql-for-excel/en/index.html) - - * MySQL for Visual Studio - (http://dev.mysql.com/doc/connector-net/en/connector-net- - visual-studio.html) - - * MySQL Utilities and MySQL Fabric - (http://dev.mysql.com/doc/index-utils-fabric.html) - - * MySQL Samples and Examples - - * MySQL Documentation - - * MySQL Installer is also installed and remains on the - system as its own application - -Installer package types - - - * Full: Bundles all of the MySQL products (including the - MySQL server). The file' size is over 200MB, and its name - has the form mysql-installer-community-VERSION.N.msi - where VERSION is the MySQL Server version number such as - 5.6 and N is the package number, which begins at 0. - - * Web: Only contains the Installer and configuration files, - and it only downloads the MySQL products you choose to - install. The size of this file is about 2MB; the name of - the file has the form - mysql-installer-community-web-VERSION.N.msi where VERSION - is the MySQL Server version number such as 5.6 and N is - the package number, which begins at 0. - -Installer editions - - - * Community edition: Downloadable at - http://dev.mysql.com/downloads/installer/. It installs - the community edition of all MySQL products. - - * Commercial edition: Downloadable at either My Oracle - Support (https://support.oracle.com/) (MOS) or - https://edelivery.oracle.com/. It installs the commercial - version of all MySQL products, including Workbench SE/EE. - It also integrates with your MOS account. - Note - Entering your MOS credentials is optional when installing - bundled MySQL products, but your credentials are required - when choosing non-bundled MySQL products that MySQL - Installer must download. - - For notes detailing the changes in each release of MySQL - Installer, see MySQL Installer Release Notes - (http://dev.mysql.com/doc/relnotes/mysql-installer/en/). - - MySQL Installer is compatible with pre-existing - installations, and adds them to its list of installed - components. While the standard MySQL Installer is bundled - with a specific version of MySQL Server, a single MySQL - Installer instance can install and manage multiple MySQL - Server versions. For example, a single MySQL Installer - instance can install (and update) versions 5.5, 5.6, and 5.7 - on the host. - Note - - A single host can not have both community and commercial - editions of MySQL Server installed. For example, if you want - both MySQL Server 5.5 and 5.6 installed on a single host, - then both must be the same edition. - - MySQL Installer handles the initial configuration and set up - of the applications. For example: - - 1. It creates initial MySQL Server connections in MySQL - Workbench. - - 2. It creates the configuration file (my.ini) that is used - to configure the MySQL Server. The values written to this - file are influenced by choices you make during the - installation process. - - 3. It can optionally import example databases. - - 4. It can optionally create MySQL Server user accounts with - configurable permissions based on general roles, such as - DB Administrator, DB Designer, and Backup Admin. It - optionally creates a Windows user named MysqlSys with - limited privileges, which would then run the MySQL - Server. - User accounts may also be added and configured in MySQL - Workbench. - - 5. If the "Advanced Configuration" option is checked, then - the Logging Options are also configured. This includes - defining file paths for the error log, general log, slow - query log (including the configuration of seconds it - requires to execute a query), and the binary log. - - MySQL Installer can optionally check for updated components - and download them for you. - -2.3.3.1 MySQL Installer GUI - - Installing MySQL Installer adds a link to the Start menu - under the MySQL group. Click Start, All Programs MySQL, MySQL - Installer to reload the MySQL Installer GUI. - Note - - Files that are generated by MySQL Installer grant full - permissions to the user that executes MySQL Installer, - including my.ini. This does not apply to files and - directories for specific products such as the MySQL Server - data directory in %ProgramData% that is owned by SYSTEM. - - The initial execution of MySQL Installer requires you to - accept the license agreement before installing MySQL - products. - - Figure 2.7 MySQL Installer - License Agreement - MySQL Installer - License Agreement - -Installing New Packages - - Choose the appropriate Setup Type for your system. The - selected type determines which MySQL products are installed - on your system, or select Custom to manually choose - individual products. - - * Developer: Install all products needed to develop - applications with MySQL. This is the default option. - - * Server only: Only install the MySQL server. - - * Client only: Only install the MySQL client products, - which does not include the MySQL server. - - * Full: Install all MySQL products. - - * Custom: Manually select the MySQL products to install. - Note - After the initial installation, you may use MySQL - Installer to manually select MySQL products to install or - remove. In other words, MySQL Installer becomes a MySQL - product management system. - - Figure 2.8 MySQL Installer - Choosing a Setup Type - MySQL Installer - Choosing a Setup Type - - After you select a setup type, the MySQL Installer will check - your system for the necessary external requirements for each - of the selected MySQL products. MySQL Installer will either - download and install the missing components onto your system, - or point you to the download location and set Status to - "Manual". - - The next window lists the MySQL products that are scheduled - to be installed: - - Figure 2.9 MySQL Installer - Installation Progress - MySQL Installer - Installation Progress - - As components are installed, their Status changes from a - progress percentage to "Complete". - - After all components are installed, the next step configures - some of the recently installed MySQL products. The - Configuration Overview window displays the progress and then - loads a configuration window, if required. Our example - configures MySQL Server 5.6.x. - -Configuring MySQL Server - - Configuring the MySQL server begins with defining several - Type and Networking options. - - Figure 2.10 MySQL Installer - Configuration Overview - MySQL Installer - Configuration Overview - - Server Configuration Type - - Choose the MySQL server configuration type that describes - your setup. This setting defines the amount of system - resources that will be assigned to your MySQL server - instance. - - * Developer: A machine that will host many other - applications, and typically this is your personal - workstation. This option configures MySQL to use the - least amount of memory. - - * Server: Several other applications will be running on - this machine, such as a web server. This option - configures MySQL to use a medium amount of memory. - - * Dedicated: A machine that is dedicated to running the - MySQL server. Because no other major applications are - running on the server, such as web servers, this option - configures MySQL to use all available memory. - - Connectivity - - Connectivity options control how you will connect to MySQL. - Options include: - - * TCP/IP: You may enable TCP/IP Networking here as - otherwise only localhost connections are allowed. Also - define the Port Number and whether to open the firewall - port for network access. - - * Named Pipe: Enable and define the pipe name, similar to - using the --enable-named-pipe option. - - * Shared Memory: Enable and then define the memory name, - similar to using the --shared-memory option. - - Advanced Configuration - - Checking the "Advanced Configuration" option provides - additional Logging Options to configure. This includes - defining file paths for the error log, general log, slow - query log (including the configuration of seconds it requires - to execute a query), and the binary log. - - Figure 2.11 MySQL Installer - MySQL Server Configuration: - Type and Networking - MySQL Installer- MySQL Server Configuration: Type and - Networking - -Accounts and Roles - - Next, define your MySQL account information. Assigning a root - password is required. - - Optionally, you can add additional MySQL user accounts with - predefined user roles. Each predefined role, such as "DB - Admin", are configured with their own set of privileges. For - example, the "DB Admin" role has more privileges than the "DB - Designer" role. Click the Role dropdown for a list of role - descriptions. - Note - - If the MySQL Server is already installed, then you must also - enter the Current Root Password. - - Figure 2.12 MySQL Installer - MySQL Server Configuration: - User Accounts and Roles - MySQL Installer - MySQL Server Configuration: User Accounts - and Roles - - Figure 2.13 MySQL Installer - MySQL Server Configuration: - User Accounts and Roles: Adding a User - MySQL Installer - MySQL Server Configuration: User Accounts - and Roles: Adding a User - -Windows Service - - Next, configure the Windows Service details. This includes - the service name, whether the MySQL Server should be loaded - at startup, and how the Windows Service for MySQL Server is - executed. - - Figure 2.14 MySQL Installer - MySQL Server Configuration: - Windows Service - MySQL Installer - MySQL Server Configuration: Windows Service - Note - - When configuring Run Windows Services as ... using a Custom - User, the custom user must have privileges to log on to - Microsoft Windows as a service. And the Next button will be - disabled until this user is configured with these user - rights. - - On Microsoft Windows 7, this is configured by loading the - Start Menu, Control Panel, Administrative Tools, Local - Security Policy, Local Policies, User Rights Assignment, then - Log On As A Service. Choose Add User or Group here to add the - custom user, and then OK, OK to save. - -Advanced Options - - The next configuration step is available if the Advanced - Configuration option was checked. This section includes - options that are related to the MySQL log files: - - Figure 2.15 MySQL Installer - MySQL Server Configuration: - Logging Options - MySQL Installer - MySQL Server Configuration: Logging Options - - Click Next to continue on to the final page before all of the - requested changes are applied. This Apply Server - Configuration page details the configuration steps that will - be performed. - - Figure 2.16 MySQL Installer - MySQL Server Configuration: - Apply Server Configuration - MySQL Installer - MySQL Server Configuration: Apply Server - Configuration - - Click Execute to execute the configuration steps. The icon - for each step toggles from white to green on success, or the - process stops on failure. Click the Log tab to view the log. - - After the MySQL Installer configuration process is finished, - MySQL Installer reloads the opening page where you can - execute other installation and configuration related actions. - - MySQL Installer is added to the Microsoft Windows Start menu - under the MySQL group. Opening MySQL Installer loads its - dashboard where installed MySQL products are listed, and - other MySQL Installer actions are available: - - Figure 2.17 MySQL Installer - Main Dashboard - MySQL Installer - Main Dashboard - -Adding MySQL Products - - Click Add to add new products. This loads the Select Products - and Features page: - - Figure 2.18 MySQL Installer - Select Products and Features - MySQL Installer - Select Products and Features - - From here, choose the MySQL products you want to install from - the left Available Products pane, and then click the green - right arrow to queue products for installation. - - Optionally, click Edit to open the product and features - search filter: - - Figure 2.19 MySQL Installer - Select Products and Features - Filter - MySQL Installer - Select Products and Features Filter - - For example, you might choose to include Pre-Release products - in your selections, such as a Beta product that has not yet - reached GA status. - Note - - The ability to install Pre-Release versions of MySQL products - was added in MySQL Installer 1.4.0. - - Select all of the MySQL products you want to install, then - click Next to continue, and then Execute to execute the - installation process to install all of the selected products. - -2.3.3.1.1 MySQL Product Catalog - - MySQL Installer stores a MySQL product catalog. The catalog - can be updated either manually or automatically, and the - catalog change history is also available. - Note - - The MySQL product catalog was added in MySQL Installer 1.4.0. - - Manual updates - - You can update the MySQL product catalog at any time by - clicking Catalog on the Installer dashboard. - - Figure 2.20 MySQL Installer - Open the MySQL Product Catalog - MySQL Installer - Open the MySQL Product Catalog - - From there, click Execute to update the product catalog. - - Automatic updates - - You can configure MySQL Installer to automatically update the - MySQL product catalog once per day. To enable this feature - and set the update time, click the wrench icon on the - Installer dashboard. - - The next window configures the Automatic Catalog Update. - Enable or disable this feature, and also set the hour. - - Figure 2.21 MySQL Installer - Configure the Catalog Scheduler - MySQL Installer - Configure the Catalog Scheduler - - This option uses the Windows Task Scheduler to schedule a - task named "ManifestUpdate". - - Change History - - MySQL Installer tracks the change history for all of the - MySQL products. Click Catalog from the dashboard, optionally - update the catalog (or, toggle the Do not update at this time - checkbox), click Next/Execute, and then view the change - history. - - Figure 2.22 MySQL Installer - Catalog Change History - MySQL Installer - Catalog Change History - -2.3.3.1.2 Remove MySQL Products - - MySQL Installer can also remove MySQL products from your - system. To remove a MySQL product, click Remove from the - Installer dashboard. This opens a window with a list of - installed MySQL products. Select the MySQL products you want - to remove (uninstall), and then click Execute to begin the - removal process. - Note - - To select all MySQL products, click the [ ] checkbox to the - left of the Product label. - - Figure 2.23 MySQL Installer - Removing Products: Select - MySQL Installer - Removing Products: Select - - Figure 2.24 MySQL Installer - Removing Products: Executed - MySQL Installer - Removing Products: Executed - -2.3.3.1.3 Alter MySQL Products - - MySQL Installer offers several options to alter your MySQL - product installations. - -Upgrade - - MySQL products with an available upgrade are highlighted on - the main dashboard. Products with available upgrades will - have an upgrade icon next to their version number. - - Figure 2.25 MySQL Installer - Upgrade a MySQL Product - MySQL Installer - Upgrade a MySQL Product - Note - - Available upgrades are determined by having a current - catalog. For information about keeping your MySQL product - catalog current, see Section 2.3.3.1.1, "MySQL Product - Catalog." - - Click Upgrade to view a list upgradable products. Our example - indicates that MySQL server 5.6.19 can be upgraded to version - 5.6.20. - - Figure 2.26 MySQL Installer - Select Products To Upgrade - MySQL Installer - Select Products To Upgrade - - Select (check) the products to upgrade, and optionally click - the changes link to view the product's release notes in your - browser. Click Next to begin the upgrade process. - - Figure 2.27 MySQL Installer - Apply Updates - MySQL Installer - Apply Updates - - A MySQL server upgrade will also check and upgrade the - server's database. Although optional, this step is - recommended. - - Figure 2.28 MySQL Installer - Check and Upgrade Database - MySQL Installer - Check and Upgrade Database - - Upon completion, your upgraded products will be upgraded and - available to use. A MySQL server upgrade also restarts the - MySQL server. - -Reconfigure - - Some MySQL products, such as the MySQL server, include a - Reconfigure option. It opens the same configuration options - that were set when the MySQL product was installed, and is - pre-populated with the current values. - - To execute, click the Reconfigure link under the Quick Action - column on the main dashboard for the MySQL product that you - want to reconfigure. - - Figure 2.29 MySQL Installer - Reconfigure a MySQL Product - MySQL Installer - Reconfigure a MySQL Product - - In the case of the MySQL server, this opens the familiar - configuration wizard. - - Figure 2.30 MySQL Installer - Reconfiguration Wizard - MySQL Installer - Reconfiguration Wizard - -Modify - - Many MySQL products contain feature components that can be - added or removed. For example, Debug binaries and Client - Programs are subcomponents of the MySQL server. - - The modify the features of a product, click Modify on the - main dashboard. - - Figure 2.31 MySQL Installer - Modify Product Features - MySQL Installer - Modify Product Features - - Click Execute to execute the modification request. - -2.3.3.2 MySQL Installer Console - - MySQLInstallerConsole provides functionality similar to the - GUI version of MySQL Installer, but from the command-line. It - is installed when MySQL Installer is initially executed, and - then available within the MySQL Installer directory. - Typically that is in C:\Program Files (x86)\MySQL\MySQL - Installer\, and the console must be executed with - administrative privileges. - - To use, invoke the Command Prompt with administrative - privileges by choosing Start, Accessories, then right-click - on Command Prompt and choose Run as administrator. And from - the command-line, optionally change the directory to where - MySQLInstallerConsole is located: -C:\> cd "C:\Program Files (x86)\MySQL\MySQL Installer" -C:\> MySQLInstallerConsole.exe help - -C:\Program Files (x86)\MySQL\MySQL Installer for Windows>MySQLInstalle -rConsole.exe help - -The following commands are available: - -Configure - Configures one or more of your installed programs. -Help - Provides list of available commands. -Install - Install and configure one or more available MySQL programs -. -List - Provides an interactive way to list all products available -. -Modify - Modifies the features of installed products. -Remove - Removes one or more products from your system. -Status - Shows the status of all installed products. -Update - Update the current product catalog. -Upgrade - Upgrades one or more of your installed programs. - - MySQLInstallerConsole supports the following options, which - are specified on the command line: - - * configure [product1]:[setting]=[value]; - [product2]:[setting]=[value]; [...] - Configure one or more MySQL products on your system. - Switches include: - - + -showsettings : Displays the available options for - the selected product, by passing in the product name - after -showsettings. - - + -silent : Disable confirmation prompts. -C:\> MySQLInstallerConsole configure -showsettings server -C:\> MySQLInstallerConsole configure server:port=3307 - - - * help [command] - Displays a help message with usage examples, and then - exits. Pass in an additional command to receive help - specific to that command. -C:\> MySQLInstallerConsole help -C:\> MySQLInstallerConsole help install - - - * install [product]:[features]:[config block]:[config - block]:[config block]; [...] - Install one or more MySQL products on your system. - Switches and syntax options include: - - + -type=[SetupType] : Installs a predefined set of - software. The "SetupType" can be one of the - following: - Note - Non-custom setup types can only be chosen if no - other MySQL products are installed. - o Developer: Installs a complete development - environment. - o Server: Installs a single MySQL server - o Client: Installs client programs and libraries - o Full: Installs everything - o Custom: Installs user selected products. This - is the default option. - - + -showsettings : Displays the available options for - the selected product, by passing in the product name - after -showsettings. - - + -silent : Disable confirmation prompts. - - + [config block]: One or more configuration blocks can - be specified. Each configuration block is a - semicolon separated list of key value pairs. A block - can include either a "config" or "user" type key, - where "config" is the default type if one is not - defined. - Only one "config" type block can be defined per - product. A "user" block should be defined for each - user that should be created during the product's - installation. - Note - Adding users is not supported when a product is - being reconfigured. - - + [feature]: The feature block is a semicolon - separated list of features, or '*' to select all - features. -C:\> MySQLInstallerConsole install server;5.6.22:*:port=3307;serverid= -2:type=user;username=foo;password=bar;role=DBManager -C:\> MySQLInstallerConsole install server;5.6.22;x64 -silent - - - * list - Lists an interactive console where all of the available - MySQL products can be searched. Execute - MySQLInstallerConsole list to launch the console, and - enter in a substring to search. -C:\> MySQLInstallerConsole list - - - * modify [product1:-removelist|+addlist] - [product2:-removelist|+addlist] [...] - Modifies or displays features of a previously installed - MySQL product. - - + -silent : Disable confirmation prompts. -C:\> MySQLInstallerConsole modify server -C:\> MySQLInstallerConsole modify server:+documentation -C:\> MySQLInstallerConsole modify server:-debug - - - * remove [product1] [product2] [...] - Removes one ore more products from your system. - - + * : Pass in * to remove all of the MySQL products. - - + -continue : Continue the operation even if an error - occurs. - - + -silent : Disable confirmation prompts. -C:\> MySQLInstallerConsole remove * -C:\> MySQLInstallerConsole remove server - - - * status - Provides a quick overview of the MySQL products that are - installed on the system. Information includes product - name and version, architecture, date installed, and - install location. -C:\> MySQLInstallerConsole status - - - * upgrade [product1:version] [product2:version], [...] - Upgrades one or more products on your system. Syntax - options include: - - + * : Pass in * to upgrade all products to the latest - version, or pass in specific products. - - + ! : Pass in ! as a version number to upgrade the - MySQL product to its latest version. - - + -silent : Disable confirmation prompts. -C:\> MySQLInstallerConsole upgrade * -C:\> MySQLInstallerConsole upgrade workbench:6.2.2 -C:\> MySQLInstallerConsole upgrade workbench:! -C:\> MySQLInstallerConsole upgrade workbench:6.2.2 excel:1.3.2 - - - * update - Downloads the latest MySQL product catalog to your - system. On success, the download catalog will be applied - the next time either MySQLInstaller or - MySQLInstallerConsole is executed. -C:\> MySQLInstallerConsole update - - Note - The Automatic Catalog Update GUI option executes this - command from the Windows Task Scheduler. - -2.3.4 MySQL Notifier - - The MySQL Notifier is a tool that enables you to monitor and - adjust the status of your local and remote MySQL Server - instances through an indicator that resides in the system - tray. The MySQL Notifier also gives quick access to several - MySQL GUI tools (such as MySQL Workbench) through its context - menu. - - The MySQL Notifier is installed by MySQL Installer, and (by - default) will start-up when Microsoft Windows is started. - Note - - To install, download and execute the MySQL Installer - (http://dev.mysql.com/downloads/installer/), be sure the - MySQL Notifier product is selected, then proceed with the - installation. See the MySQL Installer manual for additional - details. - - For notes detailing the changes in each release of MySQL - Notifier, see the MySQL Notifier Release Notes - (http://dev.mysql.com/doc/relnotes/mysql-notifier/en/). - - Visit the MySQL Notifier forum - (http://forums.mysql.com/list.php?173) for additional MySQL - Notifier help and support. - - Features include: - - * Start, Stop, and Restart instances of the MySQL Server. - - * Automatically detects (and adds) new MySQL Server - services. These are listed under Manage Monitored Items, - and may also be configured. - - * The Tray icon changes, depending on the status. It's - green if all monitored MySQL Server instances are - running, or red if at least one service is stopped. The - Update MySQL Notifier tray icon based on service status - option, which dictates this behavior, is enabled by - default for each service. - - * Links to other applications like MySQL Workbench, MySQL - Installer, and the MySQL Utilities. For example, choosing - Configure Instance will load the MySQL Workbench Server - Administration window for that particular instance. - - * If MySQL Workbench is also installed, then the Configure - Instance and SQL Editor options are available for local - (but not remote) MySQL instances. - - * Monitoring of both local and remote MySQL instances. - - Note - - Remote monitoring is available since MySQL Notifier 1.1.0. - - The MySQL Notifier resides in the system tray and provides - visual status information for your MySQL Server instances. A - green icon is displayed at the top left corner of the tray - icon if the current MySQL Server is running, or a red icon if - the service is stopped. - - The MySQL Notifier automatically adds discovered MySQL - Services on the local machine, and each service is saved and - configurable. By default, the Automatically add new services - whose name contains option is enabled and set to mysql. - Related Notifications Options include being notified when new - services are either discovered or experience status changes, - and are also enabled by default. And uninstalling a service - will also remove the service from the MySQL Notifier. - Note - - The Automatically add new services whose name contains option - default changed from ".*mysqld.*" to "mysql" in Notifier - 1.1.0. - - Clicking the system tray icon will reveal several options, as - seen in the screenshots below: - - The Service Instance menu is the main MySQL Notifier window, - and enables you to Stop, Start, and Restart the MySQL Server. - - Figure 2.32 MySQL Notifier Service Instance menu - MySQL Notifier Service Instance menu - - The Actions menu includes several links to external - applications (if they are installed), and a Refresh Status - option to manually refresh the status of all monitored - services (in both local and remote computers) and MySQL - instances. - Note - - The main menu will not show the Actions menu when there are - no services being monitored by MySQL Notifier. - Note - - The Refresh Status feature is available since MySQL Notifier - 1.1.0. - - Figure 2.33 MySQL Notifier Actions menu - MySQL Notifier Actions menu - - The Actions, Options menu configures MySQL Notifier and - includes options to: - - * Use colorful status icons: Enables a colorful style of - icons for the tray of the MySQL Notifier. - - * Run at Windows Startup: Allows the application to be - loaded when Microsoft Windows starts. - - * Automatically Check For Updates Every # Weeks: Checks for - a new version of MySQL Notifier, and runs this check - every # weeks. - - * Automatically add new services whose name contains: The - text used to filter services and add them automatically - to the monitored list of the local computer running MySQL - Notifier, and on remote computers already monitoring - Windows services. monitored services, and also filters - the list of the Microsoft Windows services for the Add - New Service dialog. - Prior to version 1.1.0, this option was named - "Automatically add new services that match this pattern." - - * Notify me when a service is automatically added: Will - display a balloon notification from the taskbar when a - newly discovered service is added to the monitored - services list. - - * Notify me when a service changes status: Will display a - balloon notification from the taskbar when a monitored - service changes its status. - - Figure 2.34 MySQL Notifier Options menu - MySQL Notifier Options menu - - The Actions, Manage Monitored Items menu enables you to - configure the monitored services and MySQL instances. First, - with the Services tab open: - - Figure 2.35 MySQL Notifier Manage Services menu - MySQL Notifier Manage Services menu - - The Instances tab is similar: - - Figure 2.36 MySQL Notifier Manage Instances menu - MySQL Notifier Manage Instances menu - - Adding a service or instance (after clicking Add in the - Manage Monitored Items window) enables you to select a - running Microsoft Windows service or instance connection, and - configure MySQL Notifier to monitor it. Add a new service or - instance by clicking service name from the list, then OK to - accept. Multiple services and instances may be selected. - - Figure 2.37 MySQL Notifier Adding new services - MySQL Notifier Adding new services - - And instances: - - Figure 2.38 MySQL Notifier Adding new instances - MySQL Notifier Adding new instances - Note - - The Instances tab available since MySQL Notifier 1.1.0. - -2.3.4.1 Remote monitoring set up and installation instructions - - The MySQL Notifier uses Windows Management Instrumentation - (WMI) to manage and monitor services in remote computers - running Windows XP or later. This guide explains how it - works, and how to set up your system to monitor remote MySQL - instances. - Note - - Remote monitoring is available since MySQL Notifier 1.1.0. - - In order to configure WMI, it is important to understand that - the underlying Distributed Component Object Model (DCOM) - architecture is doing the WMI work. Specifically, MySQL - Notifier is using asynchronous notification queries on remote - Microsoft Windows hosts as .NET events. These events send an - asynchronous callback to the computer running the MySQL - Notifier so it knows when a service status has changed on the - remote computer. Asynchronous notifications offer the best - performance compared to semisynchronous notifications or - synchronous notifications that use timers. - - Asynchronous notifications requires the remote computer to - send a callback to the client computer (thus opening a - reverse connection), so the Windows Firewall and DCOM - settings must be properly configured for the communication to - function properly. - - Figure 2.39 MySQL Notifier Distributed Component Object Model - (DCOM) - MySQL Notifier Distributed Component Object Model (DCOM) - - Most of the common errors thrown by asynchronous WMI - notifications are related to Windows Firewall blocking the - communication, or to DCOM / WMI settings not being set up - properly. For a list of common errors with solutions, see - Section 2.3.4.1, "." - - The following steps are required to make WMI function. These - steps are divided between two machines. A single host - computer that runs MySQL Notifier (Computer A), and multiple - remote machines that are being monitored (Computer B). - -Computer running MySQL Notifier (Computer A) - - - 1. Allow for remote administration by either editing the - Group Policy Editor, or using NETSH: - Using the Group Policy Editor: - a. Click Start, click Run, type GPEDIT.MSC, and then - click OK. - b. Under the Local Computer Policy heading, - double-click Computer Configuration. - c. Double-click Administrative Templates, then Network, - Network Connections, and then Windows Firewall. - d. If the computer is in the domain, then double-click - Domain Profile; otherwise, double-click Standard - Profile. - e. Click Windows Firewall: Allow inbound remote - administration exception. - f. On the Action menu either select Edit, or - double-click the selection from the previous step. - g. Check the Enabled radio button, and then click OK. - Using the NETSH command: - a. Open a command prompt window with Administrative - rights (you can right-click the Command Prompt icon - and click Run as Administrator). - b. Execute the following command: -NETSH firewall set service RemoteAdmin enable - - - 2. Open the DCOM port TCP 135: - a. Open a command prompt window with Administrative - rights (you can right-click the Command Prompt icon - and click Run as Administrator) . - b. Execute the following command: -NETSH firewall add portopening protocol=tcp port=135 name=DCOM_TCP135 - - - 3. Add the client application which contains the sink for - the callback (MySqlNotifier.exe) to the Windows Firewall - Exceptions List (use either the Windows Firewall - configuration or NETSH): - Using the Windows Firewall configuration: - a. In the Control Panel, double-click Windows Firewall. - b. In the Windows Firewall window's left panel, click - Allow a program or feature through Windows Firewall. - c. In the Allowed Programs window, click Change - Settings. - d. If MySqlNotifier.exe is in the Allowed programs and - features list, make sure it is checked for the type - of networks the computer connects to (Private, - Public or both). - e. If MySqlNotifier.exe is not in the list, click Allow - another program.... - f. In the Add a Program window, select the - MySqlNotifier.exe if it exists in the Programs list, - otherwise click Browse... and go to the directory - where MySqlNotifier.exe was installed to select it, - then click Add. - g. Make sure MySqlNotifier.exe is checked for the type - of networks the computer connects to (Private, - Public or both). - Using the NETSH command: - a. Open a command prompt window with Administrative - rights (you can right-click the Command Prompt icon - and click Run as Administrator). - b. Execute the following command, where you change - "[YOUR_INSTALL_DIRECTORY]": -NETSH firewall add allowedprogram program=[YOUR_INSTALL_DIRECTORY]\MyS -qlNotifier.exe name=MySqlNotifier - - - 4. If Computer B is either a member of WORKGROUP or is in a - different domain that is untrusted by Computer A, then - the callback connection (Connection 2) is created as an - Anonymous connection. To grant Anonymous connections DCOM - Remote Access permissions: - a. Click Start, click Run, type DCOMCNFG, and then - click OK. - b. In the Component Services dialog box, expand - Component Services, expand Computers, and then - right-click My Computer and click Properties. - c. In the My Computer Properties dialog box, click the - COM Security tab. - d. Under Access Permissions, click Edit Limits. - e. In the Access Permission dialog box, select - ANONYMOUS LOGON name in the Group or user names box. - In the Allow column under Permissions for User, - select Remote Access, and then click OK. - -Monitored Remote Computer (Computer B) - - If the user account that is logged into the computer running - the MySQL Notifier (Computer A) is a local administrator on - the remote computer (Computer B), such that the same account - is an administrator on Computer B, you can skip to the "Allow - for remote administration" step. - - Setting DCOM security to allow a non-administrator user to - access a computer remotely: - - 1. Grant "DCOM remote launch" and activation permissions for - a user or group: - a. Click Start, click Run, type DCOMCNFG, and then - click OK. - b. In the Component Services dialog box, expand - Component Services, expand Computers, and then - right-click My Computer and click Properties. - c. In the My Computer Properties dialog box, click the - COM Security tab. - d. Under Access Permissions, click Edit Limits. - e. In the Launch Permission dialog box, follow these - steps if your name or your group does not appear in - the Groups or user names list: - i. In the Launch Permission dialog box, click Add. - ii. In the Select Users, Computers, or Groups - dialog box, add your name and the group in the - "Enter the object names to select" box, and - then click OK. - f. In the Launch Permission dialog box, select your - user and group in the Group or user names box. In - the Allow column under Permissions for User, select - Remote Launch, select Remote Activation, and then - click OK. - Grant DCOM remote access permissions: - a. Click Start, click Run, type DCOMCNFG, and then - click OK. - b. In the Component Services dialog box, expand - Component Services, expand Computers, and then - right-click My Computer and click Properties. - c. In the My Computer Properties dialog box, click the - COM Security tab. - d. Under Access Permissions, click Edit Limits. - e. In the Access Permission dialog box, select - ANONYMOUS LOGON name in the Group or user names box. - In the Allow column under Permissions for User, - select Remote Access, and then click OK. - - 2. Allowing non-administrator users access to a specific WMI - namespace: - a. In the Control Panel, double-click Administrative - Tools. - b. In the Administrative Tools window, double-click - Computer Management. - c. In the Computer Management window, expand the - Services and Applications tree and double-click the - WMI Control. - d. Right-click the WMI Control icon and select - Properties. - e. In the WMI Control Properties window, click the - Security tab. - f. In the Security tab, select the namespace and click - Security. - g. Locate the appropriate account and check Remote - Enable in the Permissions list. - - 3. Allow for remote administration by either editing the - Group Policy Editor or using NETSH: - Using the Group Policy Editor: - a. Click Start, click Run, type GPEDIT.MSC, and then - click OK. - b. Under the Local Computer Policy heading, - double-click Computer Configuration. - c. Double-click Administrative Templates, then Network, - Network Connections, and then Windows Firewall. - d. If the computer is in the domain, then double-click - Domain Profile; otherwise, double-click Standard - Profile. - e. Click Windows Firewall: Allow inbound remote - administration exception. - f. On the Action menu either select Edit, or - double-click the selection from the previous step. - g. Check the Enabled radio button, and then click OK. - Using the NETSH command: - a. Open a command prompt window with Administrative - rights (you can right-click the Command Prompt icon - and click Run as Administrator). - b. Execute the following command: -NETSH firewall set service RemoteAdmin enable - - - 4. Now, be sure the user you are logging in with uses the - Name value and not the Full Name value: - a. In the Control Panel, double-click Administrative - Tools. - b. In the Administrative Tools window, double-click - Computer Management. - c. In the Computer Management window, expand the System - Tools then Local Users and Groups. - d. Click the Users node, and on the right side panel - locate your user and make sure it uses the Name - value to connect, and not the Full Name value. - - 5. If the remote computer is running on Windows XP - Professional, make sure that remote logins are not being - forcefully changed to the guest account user (also known - as ForceGuest), which is enabled by default on computers - that are not attached to a domain. - a. Click Start, click Run, type SECPOL.MSC, and then - click OK. - b. Under the Local Policies node, double-click Security - Options. - c. Select Network Access: Sharing and security model - for local accounts and save. - -Common Errors - - - * 0x80070005 - - + DCOM Security was not configured properly (see - Computer B, the Setting DCOM security... step). - - + The remote computer (Computer B) is a member of - WORKGROUP or is in a domain that is untrusted by the - client computer (Computer A) (see Computer A, the - Grant Anonymous connections DCOM Remote Access - permissions step). - - * 0x8007000E - - + The remote computer (Computer B) is a member of - WORKGROUP or is in a domain that is untrusted by the - client computer (Computer A) (see Computer A, the - Grant Anonymous connections DCOM Remote Access - permissions step). - - * 0x80041003 - - + Access to the remote WMI namespace was not - configured properly (see Computer B, the Allowing - non-administrator users access to a specific WMI - namespace step). - - * 0x800706BA - - + The DCOM port is not open on the client computers - (Computer A) firewall. See the Open the DCOM port - TCP 135 step for Computer A. - - + The remote computer (Computer B) is inaccessible - because its network location is set to Public. Make - sure you can access it through the Windows Explorer. - -2.3.5 Installing MySQL on Microsoft Windows Using a noinstall Zip -Archive - - Users who are installing from the noinstall package can use - the instructions in this section to manually install MySQL. - The process for installing MySQL from a Zip archive is as - follows: - - 1. Extract the archive to the desired install directory - - 2. Create an option file - - 3. Choose a MySQL server type - - 4. Start the MySQL server - - 5. Secure the default user accounts - - This process is described in the sections that follow. - -2.3.5.1 Extracting the Install Archive - - To install MySQL manually, do the following: - - 1. If you are upgrading from a previous version please refer - to Section 2.3.7, "Upgrading MySQL on Windows," before - beginning the upgrade process. - - 2. Make sure that you are logged in as a user with - administrator privileges. - - 3. Choose an installation location. Traditionally, the MySQL - server is installed in C:\mysql. The MySQL Installation - Wizard installs MySQL under C:\Program Files\MySQL. If - you do not install MySQL at C:\mysql, you must specify - the path to the install directory during startup or in an - option file. See Section 2.3.5.2, "Creating an Option - File." - Note - The MySQL Installer installs MySQL under C:\Program - Files\MySQL. - - 4. Extract the install archive to the chosen installation - location using your preferred Zip archive tool. Some - tools may extract the archive to a folder within your - chosen installation location. If this occurs, you can - move the contents of the subfolder into the chosen - installation location. - -2.3.5.2 Creating an Option File - - If you need to specify startup options when you run the - server, you can indicate them on the command line or place - them in an option file. For options that are used every time - the server starts, you may find it most convenient to use an - option file to specify your MySQL configuration. This is - particularly true under the following circumstances: - - * The installation or data directory locations are - different from the default locations (C:\Program - Files\MySQL\MySQL Server 5.6 and C:\Program - Files\MySQL\MySQL Server 5.6\data). - - * You need to tune the server settings, such as memory, - cache, or InnoDB configuration information. - - When the MySQL server starts on Windows, it looks for option - files in several locations, such as the Windows directory, - C:\, and the MySQL installation directory (for the full list - of locations, see Section 4.2.6, "Using Option Files"). The - Windows directory typically is named something like - C:\WINDOWS. You can determine its exact location from the - value of the WINDIR environment variable using the following - command: -C:\> echo %WINDIR% - - MySQL looks for options in each location first in the my.ini - file, and then in the my.cnf file. However, to avoid - confusion, it is best if you use only one file. If your PC - uses a boot loader where C: is not the boot drive, your only - option is to use the my.ini file. Whichever option file you - use, it must be a plain text file. - Note - - When using the MySQL Installer to install MySQL Server, it - will create the my.ini at the default location. And as of - MySQL Server 5.5.27, the user running MySQL Installer is - granted full permissions to this new my.ini. - - In other words, be sure that the MySQL Server user has - permission to read the my.ini file. - - You can also make use of the example option files included - with your MySQL distribution; see Section 5.1.2, "Server - Configuration Defaults." - - An option file can be created and modified with any text - editor, such as Notepad. For example, if MySQL is installed - in E:\mysql and the data directory is in E:\mydata\data, you - can create an option file containing a [mysqld] section to - specify values for the basedir and datadir options: -[mysqld] -# set basedir to your installation path -basedir=E:/mysql -# set datadir to the location of your data directory -datadir=E:/mydata/data - - Microsoft Windows path names are specified in option files - using (forward) slashes rather than backslashes. If you do - use backslashes, double them: -[mysqld] -# set basedir to your installation path -basedir=E:\\mysql -# set datadir to the location of your data directory -datadir=E:\\mydata\\data - - The rules for use of backslash in option file values are - given in Section 4.2.6, "Using Option Files." - - The data directory is located within the AppData directory - for the user running MySQL. - - If you would like to use a data directory in a different - location, you should copy the entire contents of the data - directory to the new location. For example, if you want to - use E:\mydata as the data directory instead, you must do two - things: - - 1. Move the entire data directory and all of its contents - from the default location (for example C:\Program - Files\MySQL\MySQL Server 5.6\data) to E:\mydata. - - 2. Use a --datadir option to specify the new data directory - location each time you start the server. - -2.3.5.3 Selecting a MySQL Server Type - - The following table shows the available servers for Windows - in MySQL 5.6. - Binary Description - mysqld Optimized binary with named-pipe support - mysqld-debug Like mysqld, but compiled with full debugging - and automatic memory allocation checking - - All of the preceding binaries are optimized for modern Intel - processors, but should work on any Intel i386-class or higher - processor. - - Each of the servers in a distribution support the same set of - storage engines. The SHOW ENGINES statement displays which - engines a given server supports. - - All Windows MySQL 5.6 servers have support for symbolic - linking of database directories. - - MySQL supports TCP/IP on all Windows platforms. MySQL servers - on Windows also support named pipes, if you start the server - with the --enable-named-pipe option. It is necessary to use - this option explicitly because some users have experienced - problems with shutting down the MySQL server when named pipes - were used. The default is to use TCP/IP regardless of - platform because named pipes are slower than TCP/IP in many - Windows configurations. - -2.3.5.4 Starting the Server for the First Time - - This section gives a general overview of starting the MySQL - server. The following sections provide more specific - information for starting the MySQL server from the command - line or as a Windows service. - - The information here applies primarily if you installed MySQL - using the Noinstall version, or if you wish to configure and - test MySQL manually rather than with the GUI tools. - Note - - The MySQL server will automatically start after using the - MySQL Installer, and the MySQL Notifier GUI can be used to - start/stop/restart at any time. - - The examples in these sections assume that MySQL is installed - under the default location of C:\Program Files\MySQL\MySQL - Server 5.6. Adjust the path names shown in the examples if - you have MySQL installed in a different location. - - Clients have two options. They can use TCP/IP, or they can - use a named pipe if the server supports named-pipe - connections. - - MySQL for Windows also supports shared-memory connections if - the server is started with the --shared-memory option. - Clients can connect through shared memory by using the - --protocol=MEMORY option. - - For information about which server binary to run, see Section - 2.3.5.3, "Selecting a MySQL Server Type." - - Testing is best done from a command prompt in a console - window (or "DOS window"). In this way you can have the server - display status messages in the window where they are easy to - see. If something is wrong with your configuration, these - messages make it easier for you to identify and fix any - problems. - - To start the server, enter this command: -C:\> "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqld" --console - - For a server that includes InnoDB support, you should see the - messages similar to those following as it starts (the path - names and sizes may differ): -InnoDB: The first specified datafile c:\ibdata\ibdata1 did not exist: -InnoDB: a new database to be created! -InnoDB: Setting file c:\ibdata\ibdata1 size to 209715200 -InnoDB: Database physically writes the file full: wait... -InnoDB: Log file c:\iblogs\ib_logfile0 did not exist: new to be create -d -InnoDB: Setting log file c:\iblogs\ib_logfile0 size to 31457280 -InnoDB: Log file c:\iblogs\ib_logfile1 did not exist: new to be create -d -InnoDB: Setting log file c:\iblogs\ib_logfile1 size to 31457280 -InnoDB: Log file c:\iblogs\ib_logfile2 did not exist: new to be create -d -InnoDB: Setting log file c:\iblogs\ib_logfile2 size to 31457280 -InnoDB: Doublewrite buffer not found: creating new -InnoDB: Doublewrite buffer created -InnoDB: creating foreign key constraint system tables -InnoDB: foreign key constraint system tables created -011024 10:58:25 InnoDB: Started - - When the server finishes its startup sequence, you should see - something like this, which indicates that the server is ready - to service client connections: -mysqld: ready for connections -Version: '5.6.23' socket: '' port: 3306 - - The server continues to write to the console any further - diagnostic output it produces. You can open a new console - window in which to run client programs. - - If you omit the --console option, the server writes - diagnostic output to the error log in the data directory - (C:\Program Files\MySQL\MySQL Server 5.6\data by default). - The error log is the file with the .err extension, and may be - set using the --log-error option. - Note - - The accounts that are listed in the MySQL grant tables - initially have no passwords. After starting the server, you - should set up passwords for them using the instructions in - Section 2.10.2, "Securing the Initial MySQL Accounts." - -2.3.5.5 Starting MySQL from the Windows Command Line - - The MySQL server can be started manually from the command - line. This can be done on any version of Windows. - Note - - The MySQL Notifier GUI can also be used to start/stop/restart - the MySQL server. - - To start the mysqld server from the command line, you should - start a console window (or "DOS window") and enter this - command: -C:\> "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqld" - - The path to mysqld may vary depending on the install location - of MySQL on your system. - - You can stop the MySQL server by executing this command: -C:\> "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqladmin" -u root -shutdown - - Note - - If the MySQL root user account has a password, you need to - invoke mysqladmin with the -p option and supply the password - when prompted. - - This command invokes the MySQL administrative utility - mysqladmin to connect to the server and tell it to shut down. - The command connects as the MySQL root user, which is the - default administrative account in the MySQL grant system. - Note - - Users in the MySQL grant system are wholly independent from - any login users under Microsoft Windows. - - If mysqld doesn't start, check the error log to see whether - the server wrote any messages there to indicate the cause of - the problem. By default, the error log is located in the - C:\Program Files\MySQL\MySQL Server 5.6\data directory. It is - the file with a suffix of .err, or may be specified by - passing in the --log-error option. Alternatively, you can try - to start the server with the --console option; in this case, - the server may display some useful information on the screen - that will help solve the problem. - - The last option is to start mysqld with the --standalone and - --debug options. In this case, mysqld writes a log file - C:\mysqld.trace that should contain the reason why mysqld - doesn't start. See Section 24.4.3, "The DBUG Package." - - Use mysqld --verbose --help to display all the options that - mysqld supports. - -2.3.5.6 Customizing the PATH for MySQL Tools - - To make it easier to invoke MySQL programs, you can add the - path name of the MySQL bin directory to your Windows system - PATH environment variable: - - * On the Windows desktop, right-click the My Computer icon, - and select Properties. - - * Next select the Advanced tab from the System Properties - menu that appears, and click the Environment Variables - button. - - * Under System Variables, select Path, and then click the - Edit button. The Edit System Variable dialogue should - appear. - - * Place your cursor at the end of the text appearing in the - space marked Variable Value. (Use the End key to ensure - that your cursor is positioned at the very end of the - text in this space.) Then enter the complete path name of - your MySQL bin directory (for example, C:\Program - Files\MySQL\MySQL Server 5.6\bin) - Note - There must be a semicolon separating this path from any - values present in this field. - Dismiss this dialogue, and each dialogue in turn, by - clicking OK until all of the dialogues that were opened - have been dismissed. You should now be able to invoke any - MySQL executable program by typing its name at the DOS - prompt from any directory on the system, without having - to supply the path. This includes the servers, the mysql - client, and all MySQL command-line utilities such as - mysqladmin and mysqldump. - You should not add the MySQL bin directory to your - Windows PATH if you are running multiple MySQL servers on - the same machine. - - Warning - - You must exercise great care when editing your system PATH by - hand; accidental deletion or modification of any portion of - the existing PATH value can leave you with a malfunctioning - or even unusable system. - -2.3.5.7 Starting MySQL as a Windows Service - - On Windows, the recommended way to run MySQL is to install it - as a Windows service, so that MySQL starts and stops - automatically when Windows starts and stops. A MySQL server - installed as a service can also be controlled from the - command line using NET commands, or with the graphical - Services utility. Generally, to install MySQL as a Windows - service you should be logged in using an account that has - administrator rights. - Note - - The MySQL Notifier GUI can also be used to monitor the status - of the MySQL service. - - The Services utility (the Windows Service Control Manager) - can be found in the Windows Control Panel (under - Administrative Tools on Windows 2000, XP, Vista, and Server - 2003). To avoid conflicts, it is advisable to close the - Services utility while performing server installation or - removal operations from the command line. - -Installing the service - - Before installing MySQL as a Windows service, you should - first stop the current server if it is running by using the - following command: -C:\> "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqladmin" - -u root shutdown - - Note - - If the MySQL root user account has a password, you need to - invoke mysqladmin with the -p option and supply the password - when prompted. - - This command invokes the MySQL administrative utility - mysqladmin to connect to the server and tell it to shut down. - The command connects as the MySQL root user, which is the - default administrative account in the MySQL grant system. - Note - - Users in the MySQL grant system are wholly independent from - any login users under Windows. - - Install the server as a service using this command: -C:\> "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqld" --install - - The service-installation command does not start the server. - Instructions for that are given later in this section. - - To make it easier to invoke MySQL programs, you can add the - path name of the MySQL bin directory to your Windows system - PATH environment variable: - - * On the Windows desktop, right-click the My Computer icon, - and select Properties. - - * Next select the Advanced tab from the System Properties - menu that appears, and click the Environment Variables - button. - - * Under System Variables, select Path, and then click the - Edit button. The Edit System Variable dialogue should - appear. - - * Place your cursor at the end of the text appearing in the - space marked Variable Value. (Use the End key to ensure - that your cursor is positioned at the very end of the - text in this space.) Then enter the complete path name of - your MySQL bin directory (for example, C:\Program - Files\MySQL\MySQL Server 5.6\bin), and there should be a - semicolon separating this path from any values present in - this field. Dismiss this dialogue, and each dialogue in - turn, by clicking OK until all of the dialogues that were - opened have been dismissed. You should now be able to - invoke any MySQL executable program by typing its name at - the DOS prompt from any directory on the system, without - having to supply the path. This includes the servers, the - mysql client, and all MySQL command-line utilities such - as mysqladmin and mysqldump. - You should not add the MySQL bin directory to your - Windows PATH if you are running multiple MySQL servers on - the same machine. - - Warning - - You must exercise great care when editing your system PATH by - hand; accidental deletion or modification of any portion of - the existing PATH value can leave you with a malfunctioning - or even unusable system. - - The following additional arguments can be used when - installing the service: - - * You can specify a service name immediately following the - --install option. The default service name is MySQL. - - * If a service name is given, it can be followed by a - single option. By convention, this should be - --defaults-file=file_name to specify the name of an - option file from which the server should read options - when it starts. - The use of a single option other than --defaults-file is - possible but discouraged. --defaults-file is more - flexible because it enables you to specify multiple - startup options for the server by placing them in the - named option file. - - * You can also specify a --local-service option following - the service name. This causes the server to run using the - LocalService Windows account that has limited system - privileges. This account is available only for Windows XP - or newer. If both --defaults-file and --local-service are - given following the service name, they can be in any - order. - - For a MySQL server that is installed as a Windows service, - the following rules determine the service name and option - files that the server uses: - - * If the service-installation command specifies no service - name or the default service name (MySQL) following the - --install option, the server uses the a service name of - MySQL and reads options from the [mysqld] group in the - standard option files. - - * If the service-installation command specifies a service - name other than MySQL following the --install option, the - server uses that service name. It reads options from the - [mysqld] group and the group that has the same name as - the service in the standard option files. This enables - you to use the [mysqld] group for options that should be - used by all MySQL services, and an option group with the - service name for use by the server installed with that - service name. - - * If the service-installation command specifies a - --defaults-file option after the service name, the server - reads options the same way as described in the previous - item, except that it reads options only from the named - file and ignores the standard option files. - - As a more complex example, consider the following command: -C:\> "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqld" - --install MySQL --defaults-file=C:\my-opts.cnf - - Here, the default service name (MySQL) is given after the - --install option. If no --defaults-file option had been - given, this command would have the effect of causing the - server to read the [mysqld] group from the standard option - files. However, because the --defaults-file option is - present, the server reads options from the [mysqld] option - group, and only from the named file. - Note - - On Windows, if the server is started with the --defaults-file - and --install options, --install must be first. Otherwise, - mysqld.exe will attempt to start the MySQL server. - - You can also specify options as Start parameters in the - Windows Services utility before you start the MySQL service. - -Starting the service - - Once a MySQL server has been installed as a service, Windows - starts the service automatically whenever Windows starts. The - service also can be started immediately from the Services - utility, or by using a NET START MySQL command. The NET - command is not case sensitive. - - When run as a service, mysqld has no access to a console - window, so no messages can be seen there. If mysqld does not - start, check the error log to see whether the server wrote - any messages there to indicate the cause of the problem. The - error log is located in the MySQL data directory (for - example, C:\Program Files\MySQL\MySQL Server 5.6\data). It is - the file with a suffix of .err. - - When a MySQL server has been installed as a service, and the - service is running, Windows stops the service automatically - when Windows shuts down. The server also can be stopped - manually by using the Services utility, the NET STOP MySQL - command, or the mysqladmin shutdown command. - - You also have the choice of installing the server as a manual - service if you do not wish for the service to be started - automatically during the boot process. To do this, use the - --install-manual option rather than the --install option: -C:\> "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqld" --install-ma -nual - -Removing the service - - To remove a server that is installed as a service, first stop - it if it is running by executing NET STOP MySQL. Then use the - --remove option to remove it: -C:\> "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqld" --remove - - If mysqld is not running as a service, you can start it from - the command line. For instructions, see Section 2.3.5.5, - "Starting MySQL from the Windows Command Line." - - If you encounter difficulties during installation. see - Section 2.3.6, "Troubleshooting a Microsoft Windows MySQL - Server Installation." - -2.3.5.8 Testing The MySQL Installation - - You can test whether the MySQL server is working by executing - any of the following commands: -C:\> "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqlshow" -C:\> "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqlshow" -u root m -ysql -C:\> "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqladmin" version -status proc -C:\> "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysql" test - - If mysqld is slow to respond to TCP/IP connections from - client programs, there is probably a problem with your DNS. - In this case, start mysqld with the --skip-name-resolve - option and use only localhost and IP addresses in the Host - column of the MySQL grant tables. - - You can force a MySQL client to use a named-pipe connection - rather than TCP/IP by specifying the --pipe or - --protocol=PIPE option, or by specifying . (period) as the - host name. Use the --socket option to specify the name of the - pipe if you do not want to use the default pipe name. - - If you have set a password for the root account, deleted the - anonymous account, or created a new user account, then to - connect to the MySQL server you must use the appropriate -u - and -p options with the commands shown previously. See - Section 4.2.2, "Connecting to the MySQL Server." - - For more information about mysqlshow, see Section 4.5.6, - "mysqlshow --- Display Database, Table, and Column - Information." - -2.3.6 Troubleshooting a Microsoft Windows MySQL Server Installation - - When installing and running MySQL for the first time, you may - encounter certain errors that prevent the MySQL server from - starting. This section helps you diagnose and correct some of - these errors. - - Your first resource when troubleshooting server issues is the - error log. The MySQL server uses the error log to record - information relevant to the error that prevents the server - from starting. The error log is located in the data directory - specified in your my.ini file. The default data directory - location is C:\Program Files\MySQL\MySQL Server 5.6\data, or - C:\ProgramData\Mysql on Windows 7 and Windows Server 2008. - The C:\ProgramData directory is hidden by default. You need - to change your folder options to see the directory and - contents. For more information on the error log and - understanding the content, see Section 5.2.2, "The Error - Log." - - For information regarding possible errors, also consult the - console messages displayed when the MySQL service is - starting. Use the NET START MySQL command from the command - line after installing mysqld as a service to see any error - messages regarding the starting of the MySQL server as a - service. See Section 2.3.5.7, "Starting MySQL as a Windows - Service." - - The following examples show other common error messages you - might encounter when installing MySQL and starting the server - for the first time: - - * If the MySQL server cannot find the mysql privileges - database or other critical files, it displays these - messages: -System error 1067 has occurred. -Fatal error: Can't open and lock privilege tables: -Table 'mysql.user' doesn't exist - - These messages often occur when the MySQL base or data - directories are installed in different locations than the - default locations (C:\Program Files\MySQL\MySQL Server - 5.6 and C:\Program Files\MySQL\MySQL Server 5.6\data, - respectively). - This situation can occur when MySQL is upgraded and - installed to a new location, but the configuration file - is not updated to reflect the new location. In addition, - old and new configuration files might conflict. Be sure - to delete or rename any old configuration files when - upgrading MySQL. - If you have installed MySQL to a directory other than - C:\Program Files\MySQL\MySQL Server 5.6, ensure that the - MySQL server is aware of this through the use of a - configuration (my.ini) file. Put the my.ini file in your - Windows directory, typically C:\WINDOWS. To determine its - exact location from the value of the WINDIR environment - variable, issue the following command from the command - prompt: -C:\> echo %WINDIR% - - You can create or modify an option file with any text - editor, such as Notepad. For example, if MySQL is - installed in E:\mysql and the data directory is - D:\MySQLdata, you can create the option file and set up a - [mysqld] section to specify values for the basedir and - datadir options: -[mysqld] -# set basedir to your installation path -basedir=E:/mysql -# set datadir to the location of your data directory -datadir=D:/MySQLdata - - Microsoft Windows path names are specified in option - files using (forward) slashes rather than backslashes. If - you do use backslashes, double them: -[mysqld] -# set basedir to your installation path -basedir=C:\\Program Files\\MySQL\\MySQL Server 5.6 -# set datadir to the location of your data directory -datadir=D:\\MySQLdata - - The rules for use of backslash in option file values are - given in Section 4.2.6, "Using Option Files." - If you change the datadir value in your MySQL - configuration file, you must move the contents of the - existing MySQL data directory before restarting the MySQL - server. - See Section 2.3.5.2, "Creating an Option File." - - * If you reinstall or upgrade MySQL without first stopping - and removing the existing MySQL service and install MySQL - using the MySQL Installer, you might see this error: -Error: Cannot create Windows service for MySql. Error: 0 - - This occurs when the Configuration Wizard tries to - install the service and finds an existing service with - the same name. - One solution to this problem is to choose a service name - other than mysql when using the configuration wizard. - This enables the new service to be installed correctly, - but leaves the outdated service in place. Although this - is harmless, it is best to remove old services that are - no longer in use. - To permanently remove the old mysql service, execute the - following command as a user with administrative - privileges, on the command line: -C:\> sc delete mysql -[SC] DeleteService SUCCESS - - If the sc utility is not available for your version of - Windows, download the delsrv utility from - http://www.microsoft.com/windows2000/techinfo/reskit/tool - s/existing/delsrv-o.asp and use the delsrv mysql syntax. - -2.3.7 Upgrading MySQL on Windows - - To upgrade MySQL on Windows, follow these steps: - - 1. Review Section 2.11.1, "Upgrading MySQL," for additional - information on upgrading MySQL that is not specific to - Windows. - - 2. Always back up your current MySQL installation before - performing an upgrade. See Section 7.2, "Database Backup - Methods." - - 3. Download the latest Windows distribution of MySQL from - http://dev.mysql.com/downloads/. - - 4. Before upgrading MySQL, stop the server. If the server is - installed as a service, stop the service with the - following command from the command prompt: -C:\> NET STOP MySQL - - If you are not running the MySQL server as a service, use - mysqladmin to stop it. For example, before upgrading from - MySQL 5.5 to 5.6, use mysqladmin from MySQL 5.5 as - follows: -C:\> "C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqladmin" -u root -shutdown - - Note - If the MySQL root user account has a password, invoke - mysqladmin with the -p option and enter the password when - prompted. - - 5. Before upgrading to MySQL 5.6 from a version previous to - 4.1.5, or from a version of MySQL installed from a Zip - archive to a version of MySQL installed with the MySQL - Installation Wizard, you must first manually remove the - previous installation and MySQL service (if the server is - installed as a service). - To remove the MySQL service, use the following command: -C:\> C:\mysql\bin\mysqld --remove - - If you do not remove the existing service, the MySQL - Installation Wizard may fail to properly install the new - MySQL service. - - 6. If you are using the MySQL Installer, start it as - described in Section 2.3.3, "Installing MySQL on - Microsoft Windows Using MySQL Installer." - - 7. If you are upgrading MySQL from a Zip archive, extract - the archive. You may either overwrite your existing MySQL - installation (usually located at C:\mysql), or install it - into a different directory, such as C:\mysql5. - Overwriting the existing installation is recommended. - However, for upgrades (as opposed to installing for the - first time), you must remove the data directory from your - existing MySQL installation to avoid replacing your - current data files. To do so, follow these steps: - a. Unzip the Zip archive in some location other than - your current MySQL installation - b. Remove the data directory - c. Rezip the Zip archive - d. Unzip the modified Zip archive on top of your - existing installation - Alternatively: - a. Unzip the Zip archive in some location other than - your current MySQL installation - b. Remove the data directory - c. Move the data directory from the current MySQL - installation to the location of the just-removed - data directory - d. Remove the current MySQL installation - e. Move the unzipped installation to the location of - the just-removed installation - - 8. If you were running MySQL as a Windows service and you - had to remove the service earlier in this procedure, - reinstall the service. (See Section 2.3.5.7, "Starting - MySQL as a Windows Service.") - - 9. Restart the server. For example, use NET START MySQL if - you run MySQL as a service, or invoke mysqld directly - otherwise. - 10. As Administrator, run mysql_upgrade to check your tables, - attempt to repair them if necessary, and update your - grant tables if they have changed so that you can take - advantage of any new capabilities. See Section 4.4.7, - "mysql_upgrade --- Check and Upgrade MySQL Tables." - 11. If you encounter errors, see Section 2.3.6, - "Troubleshooting a Microsoft Windows MySQL Server - Installation." - -2.3.8 Windows Postinstallation Procedures - - GUI tools exist that perform most of the tasks described - below, including: - - * MySQL Installer: Used to install and upgrade MySQL - products. - - * MySQL Workbench: Manages the MySQL server and edits SQL - queries. - - * MySQL Notifier: Starts, stops, or restarts the MySQL - server, and monitors its status. - - * MySQL for Excel - (http://dev.mysql.com/doc/mysql-for-excel/en/index.html): - Edits MySQL data with Microsoft Excel. - - On Windows, you need not create the data directory and the - grant tables. MySQL Windows distributions include the grant - tables with a set of preinitialized accounts in the mysql - database under the data directory. Regarding passwords, if - you installed MySQL using the MySQL Installer, you may have - already assigned passwords to the accounts. (See Section - 2.3.3, "Installing MySQL on Microsoft Windows Using MySQL - Installer.") Otherwise, use the password-assignment procedure - given in Section 2.10.2, "Securing the Initial MySQL - Accounts." - - Before setting up passwords, you might want to try running - some client programs to make sure that you can connect to the - server and that it is operating properly. Make sure that the - server is running (see Section 2.3.5.4, "Starting the Server - for the First Time"), and then issue the following commands - to verify that you can retrieve information from the server. - You may need to specify directory different from C:\mysql\bin - on the command line. If you installed MySQL using MySQL - Installer, the default directory is C:\Program - Files\MySQL\MySQL Server 5.6, and the mysql and mysqlshow - client programs are in C:\Program Files\MySQL\MySQL Server - 5.6\bin. See Section 2.3.3, "Installing MySQL on Microsoft - Windows Using MySQL Installer," for more information. - - Use mysqlshow to see what databases exist: -C:\> C:\mysql\bin\mysqlshow -+--------------------+ -| Databases | -+--------------------+ -| information_schema | -| mysql | -| test | -+--------------------+ - - The list of installed databases may vary, but will always - include the minimum of mysql and information_schema. In most - cases, the test database will also be installed - automatically. - - The preceding command (and commands for other MySQL programs - such as mysql) may not work if the correct MySQL account does - not exist. For example, the program may fail with an error, - or you may not be able to view all databases. If you - installed MySQL using MySQL Installer, then the root user - will have been created automatically with the password you - supplied. In this case, you should use the -u root and -p - options. (You will also need to use the -u root and -p - options if you have already secured the initial MySQL - accounts.) With -p, you will be prompted for the root - password. For example: -C:\> C:\mysql\bin\mysqlshow -u root -p -Enter password: (enter root password here) -+--------------------+ -| Databases | -+--------------------+ -| information_schema | -| mysql | -| test | -+--------------------+ - - If you specify a database name, mysqlshow displays a list of - the tables within the database: -C:\> C:\mysql\bin\mysqlshow mysql -Database: mysql -+---------------------------+ -| Tables | -+---------------------------+ -| columns_priv | -| db | -| event | -| func | -| help_category | -| help_keyword | -| help_relation | -| help_topic | -| host | -| plugin | -| proc | -| procs_priv | -| servers | -| tables_priv | -| time_zone | -| time_zone_leap_second | -| time_zone_name | -| time_zone_transition | -| time_zone_transition_type | -| user | -+---------------------------+ - - Use the mysql program to select information from a table in - the mysql database: -C:\> C:\mysql\bin\mysql -e "SELECT Host,Db,User FROM mysql.db" -+------+--------+------+ -| host | db | user | -+------+--------+------+ -| % | test | | -| % | test_% | | -+------+--------+------+ - - For more information about mysqlshow and mysql, see Section - 4.5.6, "mysqlshow --- Display Database, Table, and Column - Information," and Section 4.5.1, "mysql --- The MySQL - Command-Line Tool." - - If you are running a version of Windows that supports - services, you can set up the MySQL server to run - automatically when Windows starts. See Section 2.3.5.7, - "Starting MySQL as a Windows Service." - -2.4 Installing MySQL on OS X - - For a list of supported OS X versions that the MySQL server - supports, see - http://www.mysql.com/support/supportedplatforms/database.html - . - - MySQL for OS X is available in a number of different forms: - - * Native Package Installer format, which uses the native OS - X installer (DMG) to walk you through the installation of - MySQL. For more information, see Section 2.4.2, - "Installing MySQL on OS X Using Native Packages." You can - use the package installer with OS X. The user you use to - perform the installation must have administrator - privileges. - - * Tar package format, which uses a file packaged using the - Unix tar and gzip commands. To use this method, you will - need to open a Terminal window. You do not need - administrator privileges using this method, as you can - install the MySQL server anywhere using this method. For - more information on using this method, you can use the - generic instructions for using a tarball, Section 2.2, - "Installing MySQL on Unix/Linux Using Generic Binaries." - In addition to the core installation, the Package - Installer also includes Section 2.4.4, "Installing the - MySQL Startup Item" and Section 2.4.5, "Installing and - Using the MySQL Preference Pane," both of which simplify - the management of your installation. - - For additional information on using MySQL on OS X, see - Section 2.4.1, "General Notes on Installing MySQL on OS X." - -2.4.1 General Notes on Installing MySQL on OS X - - You should keep the following issues and notes in mind: - - * OS X 10.4 deprecated startup items in favor of launchd - daemons, and as of OS X 10.10 (Yosemite), startup items - do not function. For these reasons, using launchd daemons - is preferred over startup items. - - * You may need (or want) to create a specific mysql user to - own the MySQL directory and data. You can do this through - the Directory Utility, and the mysql user should already - exist. For use in single user mode, an entry for _mysql - (note the underscore prefix) should already exist within - the system /etc/passwd file. - - * If you get an "insecure startup item disabled" error when - MySQL launches, use the following procedure. Adjust the - pathnames appropriately for your system. - - 1. Modify the mysql.script using this command (enter it - on a single line): -shell> sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit - /usr/local/mysql/support-files/mysql.server - - - 2. Locate the option file that defines the basedir - value and modify it to contain these lines: -basedir=/usr/local/mysql -datadir=/usr/local/mysql/data - - In the /Library/StartupItems/MySQLCOM/ directory, - make the following group ID changes from staff to - wheel: -shell> sudo chgrp wheel MySQLCOM StartupParameters.plist - - - 3. Start the server from System Preferences or - Terminal.app. - - * Because the MySQL package installer installs the MySQL - contents into a version and platform specific directory, - you can use this to upgrade and migrate your database - between versions. You will need to either copy the data - directory from the old version to the new version, or - alternatively specify an alternative datadir value to set - location of the data directory. By default, the MySQL - directories are installed under /usr/local/. - - * You might want to add aliases to your shell's resource - file to make it easier to access commonly used programs - such as mysql and mysqladmin from the command line. The - syntax for bash is: -alias mysql=/usr/local/mysql/bin/mysql -alias mysqladmin=/usr/local/mysql/bin/mysqladmin - - For tcsh, use: -alias mysql /usr/local/mysql/bin/mysql -alias mysqladmin /usr/local/mysql/bin/mysqladmin - - Even better, add /usr/local/mysql/bin to your PATH - environment variable. You can do this by modifying the - appropriate startup file for your shell. For more - information, see Section 4.2.1, "Invoking MySQL - Programs." - - * After you have copied over the MySQL database files from - the previous installation and have successfully started - the new server, you should consider removing the old - installation files to save disk space. Additionally, you - should also remove older versions of the Package Receipt - directories located in - /Library/Receipts/mysql-VERSION.pkg. - - * Prior to OS X 10.7, MySQL server was bundled with OS X - Server. - -2.4.2 Installing MySQL on OS X Using Native Packages - - The package is located inside a disk image (.dmg) file that - you first need to mount by double-clicking its icon in the - Finder. It should then mount the image and display its - contents. - Note - - Before proceeding with the installation, be sure to stop all - running MySQL server instances by using either the MySQL - Manager Application (on OS X Server) or mysqladmin shutdown - on the command line. - - When installing from the package version, you can also - install the MySQL Preference Pane, which will enable you to - control the startup and execution of your MySQL server from - System Preferences. For more information, see Section 2.4.5, - "Installing and Using the MySQL Preference Pane." - - When installing using the package installer, the files are - installed into a directory within /usr/local matching the - name of the installation version and platform. For example, - the installer file mysql-5.6-osx10.8-x86_64.dmg installs - MySQL into /usr/local/mysql-5.6-osx10.8-x86_64/ . The - following table shows the layout of the installation - directory. - - Table 2.5 MySQL Installation Layout on OS X - Directory Contents of Directory - bin Client programs and the mysqld server - data Log files, databases - docs Helper documents, like the Release Notes and build - information - include Include (header) files - lib Libraries - man Unix manual pages - mysql-test MySQL test suite - scripts mysql_install_db - share Miscellaneous support files, including error messages, - sample configuration files, SQL for database installation - sql-bench Benchmarks - support-files Scripts and sample configuration files - /tmp/mysql.sock Location of the MySQL Unix socket - - During the package installer process, a symbolic link from - /usr/local/mysql to the version/platform specific directory - created during installation will be created automatically. - - 1. Download and open the MySQL package installer, which is - provided on a disk image (.dmg) that includes the main - MySQL installation package file. Double-click the disk - image to open it. - Figure 2.40 MySQL Package Installer: DMG Contents - MySQL Package Installer: DMG Contents - - 2. Double-click the MySQL installer package. It will be - named according to the version of MySQL you have - downloaded. For example, if you have downloaded MySQL - server 5.6.23, double-click - mysql-5.6.23-osx-10.8-x86_64.pkg. - - 3. You will be presented with the opening installer dialog. - Click Continue to begin installation. - Figure 2.41 MySQL Package Installer: Introduction - MySQL Package Installer: Introduction - - 4. If you have downloaded the community version of MySQL, - you will be shown a copy of the relevant GNU General - Public License. Click Continue and then Agree to - continue. - - 5. From the Installation Type page you can either click - Install to execute the installation wizard using all - defaults, click Customize to alter which components to - install (MySQL server, Startup Item, Preference Pane -- - all enabled by default), or click Change Installation - Location to change the type of installation for either - all users, only the user executing the Installer, or - define a custom location. - Figure 2.42 MySQL Package Installer: Installation Type - MySQL Package Installer: Installation Type - Figure 2.43 MySQL Package Installer: Destination Select - (Change Installation Location) - MySQL Package Installer: Destination Select (Change - Installation Location) - Figure 2.44 MySQL Package Installer: Customize - MySQL Package Installer: Customize - - 6. Click Install to begin the installation process. - - 7. Once the installation has been completed successfully, - you will be shown an Install Succeeded message with a - short summary. Now, Close the wizard and begin using the - MySQL server. - Figure 2.45 MySQL Package Installer: Summary - MySQL Package Installer: Summary - - For convenience, you may also want to install a launch daemon - and preference pane. See Section 2.4.3, "Installing a MySQL - Launch Daemon," and Section 2.4.5, "Installing and Using the - MySQL Preference Pane." - -2.4.3 Installing a MySQL Launch Daemon - - OS X uses launch daemons to automatically start, stop, and - manage processes and applications such as MySQL. Using launch - daemons is recommended over startup items on OS X. - Note - - OS X 10.4 deprecated startup items in favor of launchd - daemons, and as of OS X 10.10 (Yosemite), startup items do - not function. For these reasons, using launchd daemons is - preferred over startup items. - - Here is an example launchd file that starts MySQL: - - - - - - KeepAlive - - Label - com.mysql.mysqld - ProgramArguments - - /usr/local/mysql/bin/mysqld_safe - --user=mysql - - - - - - Adjust the ProgramArguments array according to your system, - as for example your path to mysqld_safe might be different. - After making the proper adjustments, do the following: - - * Save the XML as a file named - /Library/LaunchDaemons/com.mysql.mysql.plist - - * Adjust the file permissions using the Apple recommended - owner "root", owning group "wheel", and file permissions - "644" -shell> sudo chown root:wheel /Library/LaunchDaemons/com.mysql.mysql.pl -ist -shell> sudo chmod 644 /Library/LaunchDaemons/com.mysql.mysql.plist - - - * Enable this new MySQL service -shell> sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysql.p -list - - The MySQL daemon is now running, and automatically starts - when your system is rebooted. - -2.4.4 Installing the MySQL Startup Item - - The MySQL Installation Package includes a startup item that - can be used to automatically start and stop MySQL. - Important - - Startup items are deprecated in favor of launchd daemons. For - additional information, see Section 2.4.3, "Installing a - MySQL Launch Daemon." - - To install the MySQL Startup Item: - - 1. Download and open the MySQL package installer, which is - provided on a disk image (.dmg) that includes the main - MySQL installation package. - Note - Previously, the OS X packages included separate - MySQLStartupItem.pkg and MySQL.prefPane files. They have - since been merged into the main package file. - Figure 2.46 MySQL Package Installer: DMG Contents - MySQL Package Installer: DMG Contents - - 2. Go through the process of installing the MySQL server as - described in the documentation at Section 2.4.2, - "Installing MySQL on OS X Using Native Packages." - - 3. Click Customize at the Installation Type step. The - "Startup Item" option is listed there and enabled by - default. - Figure 2.47 MySQL Installer on OS X: Customize - MySQL Installer on OS X: Customize - - 4. Complete the MySQL server installation process. - - The Startup Item for MySQL is installed into - /Library/StartupItems/MySQLCOM. The Startup Item installation - adds a variable MYSQLCOM=-YES- to the system configuration - file /etc/hostconfig. If you want to disable the automatic - startup of MySQL, change this variable to MYSQLCOM=-NO-. - Note - - Deselecting Automatically Start MySQL Server on Startup from - the MySQL Preference Pane sets the MYSQLCOM variable to -NO-. - - After the installation, you can start and stop the MySQL - server from the MySQL Preference Pane (preferred), or by - running the following commands in a terminal window. You must - have administrator privileges to perform these tasks, and you - may be prompted for your password. - - If you have installed the Startup Item, use this command to - start the server: -shell> sudo /Library/StartupItems/MySQLCOM/MySQLCOM start - - If you have installed the Startup Item, use this command to - stop the server: -shell> sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop - -2.4.5 Installing and Using the MySQL Preference Pane - - The MySQL Installation Package includes a MySQL preference - Pane that enables you to start, stop, and control automated - startup during boot of your MySQL installation. - - To install the MySQL Preference Pane: - - 1. Download and open the MySQL package installer, which is - provided on a disk image (.dmg) that includes the main - MySQL installation package. - Note - Previously, the OS X packages included separate - MySQLStartupItem.pkg and MySQL.prefPane files. They have - since been merged into the main package file. - Figure 2.48 MySQL Package Installer: DMG Contents - MySQL Package Installer: DMG Contents - - 2. Go through the process of installing the MySQL server, as - described in the documentation at Section 2.4.2, - "Installing MySQL on OS X Using Native Packages." - - 3. Click Customize at the Installation Type step. The - "Preference Pane" option is listed there and enabled by - default. - Figure 2.49 MySQL Installer on OS X: Customize - MySQL Installer on OS X: Customize - - 4. Complete the MySQL server installation process. - - Note - - The MySQL Preference Pane only starts and stops MySQL - installation installed from the MySQL package installation - that have been installed in the default location. - - Once the MySQL Preference Pane has been installed, you can - control your MySQL server instance using the preference pane. - To use the preference pane, open the System Preferences... - from the Apple menu. Select the MySQL preference pane by - clicking the MySQL logo within the bottom section of the - preference panes list. - - Figure 2.50 MySQL Preference Pane: Location - MySQL Preference Pane: Location - - The MySQL Preference Pane shows the current status of the - MySQL server, showing stopped (in red) if the server is not - running and running (in green) if the server has already been - started. The preference pane also shows the current setting - for whether the MySQL server has been set to start - automatically. - - * To start the MySQL server using the preference pane: - Click Start MySQL Server. You may be prompted for the - username and password of a user with administrator - privileges to start the MySQL server. - - * To stop the MySQL server using the preference pane: - Click Stop MySQL Server. You may be prompted for the - username and password of a user with administrator - privileges to stop the MySQL server. - - * To automatically start the MySQL server when the system - boots: - Check the check box next to Automatically Start MySQL - Server on Startup. - - * To disable automatic MySQL server startup when the system - boots: - Uncheck the check box next to Automatically Start MySQL - Server on Startup. - - You can close the System Preferences... window once you have - completed your settings. - -2.5 Installing MySQL on Linux - - Linux supports a number of different solutions for installing - MySQL. We recommend that you use one of the distributions - from Oracle, for which several methods for installation are - available: - - * Installing with Yum using the MySQL Yum repository - (http://dev.mysql.com/downloads/repo/yum/). For details, - see Section 2.5.1, "Installing MySQL on Linux Using the - MySQL Yum Repository." - - * Installing with APT using the MySQL APT Repository - (http://dev.mysql.com/downloads/repo/apt/). For details, - see Section 2.5.3, "Installing MySQL on Linux Using the - MySQL APT Repository." - - * Installing with Zypper using the MySQL SLES Repository - (http://dev.mysql.com/downloads/repo/suse/). For details, - see Section 2.5.4, "Installing MySQL on Linux Using the - MySQL SLES Repository." - - * Installing using a precompiled RPM package. For more - information, see Section 2.5.5, "Installing MySQL on - Linux Using RPM Packages." - - * Installing using a precompiled Debian package. For more - information, see Section 2.5.6, "Installing MySQL on - Linux Using Debian Packages from Oracle." - - * Installing from a generic binary package in .tar.gz - format. See Section 2.2, "Installing MySQL on Unix/Linux - Using Generic Binaries" for more information. - - * Installing using Oracle's Unbreakable Linux Network - (ULN). For more information, see Section 2.6, "Installing - MySQL Using Unbreakable Linux Network (ULN)." - - * Extracting and compiling MySQL from a source - distribution. For detailed instructions, see Section 2.9, - "Installing MySQL from Source." - - As an alternative, you can use the package manager on your - system to automatically download and install MySQL with - packages from the native software repositories of your Linux - distribution. These native packages are often several - versions behind the currently available release. You will - also normally be unable to install development milestone - releases (DMRs), as these are not usually made available in - the native repositories. For more information on using the - native package installers, see Section 2.5.7, "Installing - MySQL on Linux from the Native Software Repositories." - Note - - For many Linux installations, you will want to set up MySQL - to be started automatically when your machine starts. Many of - the native package installations perform this operation for - you, but for source, binary and RPM solutions you may need to - set this up separately. The required script, mysql.server, - can be found in the support-files directory under the MySQL - installation directory or in a MySQL source tree. You can - install it as /etc/init.d/mysql for automatic MySQL startup - and shutdown. See Section 2.10.1.2, "Starting and Stopping - MySQL Automatically." - -2.5.1 Installing MySQL on Linux Using the MySQL Yum Repository - - MySQL provides a Yum-style software repository for the - following Linux platforms: - - * EL5, EL6, and EL7-based platforms (for example, the - corresponding versions of Red Hat Enterprise Linux, - Oracle Linux, and CentOS) - - * Fedora 20 and 21 - - Currently, the MySQL Yum repository - (http://dev.mysql.com/downloads/repo/yum/) for the - above-mentioned platforms provides RPM packages for - installing the MySQL server, client, MySQL Workbench, MySQL - Utilities (not available for EL5-based platforms), - Connector/ODBC, and Connector/Python (not available for - EL5-based platforms). - -Before You Start - - As a popular, open-source software, MySQL, in its original or - re-packaged form, is widely installed on many systems from - various sources, including different software download sites, - software repositories, and so on. The following instructions - assume that no versions of MySQL (whether distributed by - Oracle or other parties) have already been installed on your - system; if that is not the case, see Section 2.11.1.1, - "Upgrading MySQL with the MySQL Yum Repository" or Section - 2.5.2, "Replacing a Third-Party Distribution of MySQL Using - the MySQL Yum Repository." - -Steps for a Fresh Installation of MySQL - - Follow the steps below to install the latest GA version of - MySQL with the MySQL Yum repository: - - 1. Adding the MySQL Yum Repository - First, add the MySQL Yum repository to your system's - repository list. This is a one-time operation, which can - be performed by installing an RPM provided by MySQL. - Follow these steps: - a. Go to the Download MySQL Yum Repository page - (downloads/repo/yum/ - (http://dev.mysql.com/downloads/repo/yum/)) in the - MySQL Developer Zone. - b. Select and download the release package for your - platform. - c. Install the downloaded release package with the - following command (except for EL5-based systems), - replacing platform-and-version-specific-package-name - with the name of the downloaded RPM package: -shell> sudo yum localinstall platform-and-version-specific-package-nam -e.rpm - - For an EL6-based system, the command is in the form - of: -shell> sudo yum localinstall mysql-community-release-el6-{version-numb -er}.noarch.rpm - - For an EL7-based system: -shell> sudo yum localinstall mysql-community-release-el7-{version-numb -er}.noarch.rpm - - For Fedora 20: -shell> sudo yum localinstall mysql-community-release-fc20-{version-num -ber}.noarch.rpm - - For Fedora 21: -shell> sudo yum localinstall mysql-community-release-fc21-{version-num -ber}.noarch.rpm - - For an EL5-based system, use the following command - instead: -shell> sudo rpm -Uvh mysql-community-release-el5-{version-number}.noar -ch.rpm - - The installation command adds the MySQL Yum - repository to your system's repository list and - downloads the GnuPG key to check the integrity of - the software packages. See Section 2.1.4.2, - "Signature Checking Using GnuPG" for details on - GnuPG key checking. - You can check that the MySQL Yum repository has been - successfully added by the following command: -shell> yum repolist enabled | grep "mysql.*-community.*" - - Note - Once the MySQL Yum repository is enabled on your system, - any system-wide update by the yum update command will - upgrade MySQL packages on your system and also replace - any native third-party packages, if Yum finds - replacements for them in the MySQL Yum repository; see - Section 2.11.1.1, "Upgrading MySQL with the MySQL Yum - Repository" and, for a discussion on some possible - effects of that on your system, see Section 2.11.1.1, "." - - 2. Selecting a Release Series - Note - When using the MySQL Yum repository, the latest GA - release of MySQL is selected for installation by default. - If this is what you want, you can skip to the next step, - Section 2.5.1, "." - Within the MySQL Yum repository, different release series - of the MySQL Community Server are hosted in different - subrepositories. The subrepository for the latest GA - series (currently 5.6) is enabled by default, and the - subrepositories for all other series (for example, the - 5.7 series, currently still in developer milestone - release (DMR) status) are disabled by default. Use this - command to see all the subrepositories in the MySQL Yum - repository, and see which of them are enabled or - disabled: -shell> yum repolist all | grep mysql - - To install the latest release from the latest GA series, - no configuration is needed. To install the latest release - from a specific series other than the latest GA series, - disable the subrepository for the latest GA series and - enable the subrepository for the specific series before - running the installation command. If your platform - supports yum-config-manager, you can do that by issuing - these commands, which disable the subrepository for the - 5.6 series and enable the one for the 5.7 series: -shell> sudo yum-config-manager --disable mysql56-community -shell> sudo yum-config-manager --enable mysql57-community-dmr - - Besides using yum-config-manager, you can also select a - release series by editing manually the - /etc/yum.repos.d/mysql-community.repo file. This is a - typical entry for a release series' subrepository in the - file: -# Enable to use MySQL 5.6 -[mysql56-community] -name=MySQL 5.6 Community Server -baseurl=//repo.mysql.com/yum/mysql-5.6-community/el/5/$basearch/ -enabled=1 -gpgcheck=1 -gpgkey=file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql - Find the entry for the subrepository you want to - configure, and edit the enabled option. Specify enabled=0 - to disable a subrepository, or enabled=1 to enable a - subrepository. For example, to install the latest 5.7 - DMR, make sure you have enabled=0 for the above - subrepository entry for MySQL 5.6, and have enabled=1 for - the entry for the 5.7 series: -# Note: MySQL 5.7 is currently in development. For use at your own ris -k. -# Please read with sub pages: https://dev.mysql.com/doc/relnotes/mysql -/5.7/en/ -[mysql57-community-dmr] -name=MySQL 5.7 Community Server Development Milestone Release -baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/6/$basearch/ -enabled=1 -gpgcheck=1 -gpgkey=file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql - - You should only enable subrepository for one release - series at any time. When subrepositories for more than - one release series are enabled, the latest series will be - used by Yum. - Verify that the correct subrepositories have been enabled - and disabled by running the following command and - checking its output: -shell> yum repolist enabled | grep mysql - - - 3. Installing MySQL with Yum - Install MySQL by the following command: -shell> sudo yum install mysql-community-server - - This installs the package for MySQL server - (mysql-community-server) and also packages for the - components required to run the server, including packages - for the client (mysql-community-client), the common error - messages and character sets for client and server - (mysql-community-common), and the shared client libraries - (mysql-community-libs). - - 4. Starting and Stopping the MySQL Server - Start the MySQL server with the following command: -shell> sudo service mysqld start - This is a sample output of the above command: -Starting mysqld:[ OK ] - You can check the status of the MySQL server with the - following command: -shell> sudo service mysqld status - This is a sample output of the above command: -mysqld (pid 3066) is running. - Stop the MySQL server with the following command: -shell> sudo service mysqld stop - - 5. Securing the MySQL Installation - The program mysql_secure_installation allows you to - perform important operations like setting the root - password, removing anonymous users, and so on. Always run - it to secure your MySQL installation: -shell> mysql_secure_installation - It is important to remember the root password you set. - See Section 4.4.5, "mysql_secure_installation --- Improve - MySQL Installation Security" for details. - - For more information on the postinstallation procedures, see - Section 2.10, "Postinstallation Setup and Testing." - Note - - Compatibility Information for EL7-based platforms: The - following RPM packages from the native software repositories - of the platforms are incompatible with the package from the - MySQL Yum repository that installs the MySQL server. Once you - have installed MySQL using the MySQL Yum repository, you will - not be able to install these packages (and vice versa). - - * akonadi-mysql - - * ocsinventory - -Installing Additional MySQL Products and Components with Yum - - You can use Yum to install and manage individual components - of MySQL. Some of these components are hosted in - sub-repositories of the MySQL Yum repository: for example, - the MySQL Connectors are to be found in the MySQL Connectors - Community sub-repository, and the MySQL Workbench in MySQL - Tools Community. You can use the following command to list - the packages for all the MySQL components available for your - platform from the MySQL Yum repository: -shell> sudo yum --disablerepo=\* --enablerepo='mysql*-community*' list - available - - Install any packages of your choice with the following - command, replacing package-name with name of the package: -shell> sudo yum install package-name - - For example, to install MySQL Workbench: -shell> sudo yum install mysql-workbench-community - - To install the shared client libraries: -shell> sudo yum install mysql-community-libs - -Updating MySQL with Yum - - Besides installation, you can also perform updates for MySQL - products and components using the MySQL Yum repository. See - Section 2.11.1.1, "Upgrading MySQL with the MySQL Yum - Repository" for details. - -2.5.2 Replacing a Third-Party Distribution of MySQL Using the MySQL -Yum Repository - - For supported Yum-based platforms (see Section 2.5.1, - "Installing MySQL on Linux Using the MySQL Yum Repository," - for a list), you can replace a third-party distribution of - MySQL with the latest GA release from MySQL using the MySQL - Yum repository. According to how your third-party - distribution of MySQL was installed, there are different - steps to follow: - -Replacing a Native Third-Party Distribution of MySQL - - If you have installed a third-party distribution of MySQL - from a native software repository (that is, a software - repository provided by your own Linux distribution), follow - these steps: - - 1. Backing Up Your Database - To avoid loss of data, always back up your database - before trying to replace your MySQL installation using - the MySQL Yum repository. See Chapter 7, "Backup and - Recovery," on how to back up your database. - - 2. Adding the MySQL Yum Repository - Add the MySQL Yum repository to your system's repository - list by following the instructions given in Section - 2.5.1, "." - - 3. Replacing the Native Third-Party Distribution by a Yum - Update - By design, the MySQL Yum repository will replace your - native, third-party MySQL when you perform a yum update - command on the system, or a yum update mysql-server. - - After updating MySQL using the Yum repository, applications - compiled with older versions of the shared client libraries - should continue to work. However, if you want to recompile - applications and dynamically link them with the updated - libraries, see Section 2.11.1.1, "," for some special - considerations. - -Replacing a Nonnative Third-Party Distribution of MySQL - - If you have installed a third-party distribution of MySQL - from a nonnative software repository (that is, a software - repository not provided by your own Linux distribution), - follow these steps: - - 1. Backing Up Your Database - To avoid loss of data, always back up your database - before trying to replace your MySQL installation using - the MySQL Yum repository. See Chapter 7, "Backup and - Recovery," on how to back up your database. - - 2. Stopping Yum from Receiving MySQL Packages from - Third-Party, Nonnative Repositories - Before you can use the MySQL Yum repository for - installing MySQL, you must stop your system from - receiving MySQL packages from any third-party, nonnative - Yum repositories. - For example, if you have installed MariaDB using their - own software repository, get a list of the installed - MariaDB packages using the following command: -shell> yum list installed mariadb\* - This is a sample output for the command: -MariaDB-common.i686 10.0.4-1 - @mariadb -MariaDB-compat.i686 10.0.4-1 - @mariadb -MariaDB-server.i686 10.0.4-1 - @mariadb - - From the command output, we can identify the installed - packages (MariaDB-common, MariaDB-compat, and - MariaDB-server) and the source of them (a nonnative - software repository named mariadb). - As another example, if you have installed Percona using - their own software repository, get a list of the - installed Percona packages using the following command: -shell> yum list installed Percona\* - This is a sample output for the command: -Percona-Server-client-55.i686 5.5.39-rel36.0.el6 @percona --release-i386 -Percona-Server-server-55.i686 5.5.39-rel36.0.el6 @percona --release-i386 -Percona-Server-shared-55.i686 5.5.39-rel36.0.el6 @percona --release-i386 -percona-release.noarch 0.1-3 @/percon -a-release-0.1-3.noarch - - From the command output, we can identify the installed - packages (Percona-Server-client, Percona-Server-server, - Percona-Server-shared, and percona-release.noarch) and - the source of them (a nonnative software repository named - percona-release). - If you are not sure which third-party MySQL fork you have - installed, this command should reveal it and list the RPM - packages installed for it, as well as the third-party - repository that supplies the packages: -shell> yum --disablerepo=\* provides mysql\* - The next step is to stop Yum from receiving packages from - the nonnative repository. If the yum-config-manager - utility is supported on your platform, you can, for - example, use this command for MariaDB: -shell> sudo yum-config-manager --disable mariadb - And use this command for Percona: -shell> sudo yum-config-manager --disable percona-release - You can perform the same task by removing the entry for - the software repository existing in one of the repository - files under the /etc/yum.repos.d/ directory. This is how - the entry typically looks like for MariaDB: -[mariadb] name = MariaDB - baseurl = [base URL for repository] - gpgkey = [URL for GPG key] - gpgcheck =1 - The entry is usually found in the file - /etc/yum.repos.d/MariaDB.repo for MariaDB---delete the - file, or remove entry from it (or from the file in which - you find the entry). - Note - This step is not necessary for an installation that was - configured with a Yum repository release package (like - Percona) if you are going to remove the release package - (percona-release.noarch for Percona), as shown in the - uninstall command for Percona in Step 3 below. - - 3. Uninstalling the Nonnative Third-Party MySQL Distribution - of MySQL - The nonnative third-party MySQL distribution must first - be uninstalled before you can use the MySQL Yum - repository to install MySQL. For the MariaDB packages - found in Step 2 above, uninstall them with the following - command: -shell> sudo yum remove MariaDB-common MariaDB-compat MariaDB-server - For the Percona packages we found in Step 2 above: -shell> sudo yum remove Percona-Server-client-55 Percona-Server-server- -55 \ - Percona-Server-shared-55.i686 percona-release - - 4. Installing MySQL with the MySQL Yum Repository - Then, install MySQL with the MySQL Yum repository by - following the instructions given in Section 2.5.1, - "Installing MySQL on Linux Using the MySQL Yum - Repository:" . - Important - - + If you have chosen to replace your third-party MySQL - distribution with a newer version of MySQL from the - MySQL Yum repository, remember to run mysql_upgrade - after the server starts, to check and possibly - resolve any incompatibilities between the old data - and the upgraded software. mysql_upgrade also - performs other functions; see Section 4.4.7, - "mysql_upgrade --- Check and Upgrade MySQL Tables" - for details. - - + For EL7-based platforms: See Section 2.5.1, "." - -2.5.3 Installing MySQL on Linux Using the MySQL APT Repository - - The MySQL APT repository provides deb packages for installing - and managing the MySQL server, client, and other components - on the following Linux platforms: : - - * Debian 7.x ("wheezy") - - * Ubuntu 12.04 LTS ("Precise Pangolin") - - * Ubuntu 14.04 LTS ("Trusty Tahr") - - * Ubuntu 14.10 ("Utopic Unicorn") - - Instructions for using the MySQL APT Repository are available - in A Quick Guide to Using the MySQL APT Repository - (http://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/). - Note - - The MySQL APT Repository is now in development release. We - encourage you to try it and provide us with feedback. Please - report any bugs or inconsistencies you observe to our Bugs - Database (http://bugs.mysql.com). - -2.5.4 Installing MySQL on Linux Using the MySQL SLES Repository - - The MySQL SLES repository provides RPM packages for - installing and managing the MySQL server, client, and other - components on SUSE Enterprise Linux Server. - - Instructions for using the MySQL SLES Repository are - available in A Quick Guide to Using the MySQL SLES Repository - (http://dev.mysql.com/doc/mysql-sles-repo-quick-guide/en/). - Note - - The MySQL SLES Repository is now in development release. We - encourage you to try it and provide us with feedback. Please - report any bugs or inconsistencies you observe to our Bugs - Database (http://bugs.mysql.com). - -2.5.5 Installing MySQL on Linux Using RPM Packages - - Note - - To install or upgrade to MySQL 5.6.11 or later, be sure to - read the special instructions at the end of this section. - - The recommended way to install MySQL on RPM-based Linux - distributions that use glibc is by using the RPM packages - provided by MySQL. There are two sources for obtaining the - Community versions of the RPM packages: - - * From the MySQL software repositories, for the following - platforms: - - + For EL5, EL6, or EL7-based platforms and Fedora 20 - or 21, use the MySQL Yum repository (see Section - 2.5.1, "Installing MySQL on Linux Using the MySQL - Yum Repository" for details). - - + For SUSE Enterprise Linux Server, use the MySQL SLES - repository (see Section 2.5.4, "Installing MySQL on - Linux Using the MySQL SLES Repository" for details). - - * From the MySQL Downloads page - (http://dev.mysql.com/downloads/) in the MySQL Developer - Zone (http://dev.mysql.com/), on which we provide various - RPM packages that work for different platforms. - - The discussions in this section only apply to the RPM - packages directly downloaded from the MySQL Developer Zone. - Installations created with these packages result in files - under the system directories shown in the following table. - - Table 2.6 MySQL Installation Layout for Linux RPM Packages - from the MySQL Developer Zone - Directory Contents of Directory - /usr/bin Client programs and scripts - /usr/sbin The mysqld server - /var/lib/mysql Log files, databases - /usr/share/info Manual in Info format - /usr/share/man Unix manual pages - /usr/include/mysql Include (header) files - /usr/lib/mysql Libraries - /usr/share/mysql Miscellaneous support files, including error - messages, character set files, sample configuration files, - SQL for database installation - /usr/share/sql-bench Benchmarks - Note - - RPM distributions of MySQL are also provided by other - vendors. Be aware that they may differ from those built by us - in features, capabilities, and conventions (including - communication setup), and that the instructions in this - manual do not necessarily apply to installing them. The - vendor's instructions should be consulted instead. Because of - these differences, RPM packages built by us check whether - such RPMs built by other vendors are installed. If so, the - RPM does not install and produces a message explaining this. - - Conflicts can arise when an RPM from another vendor is - already installed, such as when a vendor's convention about - which files belong with the server and which belong with the - client library differ from the breakdown used for Oracle - packages. In such cases, attempts to install an Oracle RPM - with rpm -i may result in messages that files in the RPM to - be installed conflict with files from an installed package - (denoted mysql-libs in the following paragraphs). - - We provide a MySQL-shared-compat package with each MySQL - release. This package is meant to replace mysql-libs and - provides a replacement-compatible client library for older - MySQL series. MySQL-shared-compat is set up to make - mysql-libs obsolete, but rpm explicitly refuses to replace - obsoleted packages when invoked with -i (unlike -U), which is - why installation with rpm -i produces a conflict. - - MySQL-shared-compat can safely be installed alongside - mysql-libs because libraries are installed to different - locations. Therefore, it is possible to install shared-compat - first, then manually remove mysql-libs before continuing with - the installation. After mysql-libs is removed, the dynamic - linker stops looking for the client library in the location - where mysql-libs puts it, and the library provided by the - MySQL-shared-compat package takes over. - - Another alternative is to install packages using yum. In a - directory containing all RPM packages for a MySQL release, - yum install MySQL*rpm installs them in the correct order and - removes mysql-libs in one step without conflicts. - - In most cases, you need to install only the MySQL-server and - MySQL-client packages to get a functional MySQL installation. - The other packages are not required for a standard - installation. - - As of MySQL 5.6.8, new RPM install operations (not upgrades) - invoke mysql_install_db with the --random-passwords option - that provides for more secure MySQL installation. Invoking - mysql_install_db with --random-passwords causes it to assign - a random password to the MySQL root accounts, set the - "password expired" flag for those accounts, and not create - anonymous-user MySQL accounts. It will be necessary after - installation to start the server, connect as root using the - password written to the $HOME/.mysql_secret file, and assign - a new root password. Until this is done, root cannot do - anything else. This must be done for each root account you - intend to use. To change the password, you can use the SET - PASSWORD statement (for example, with the mysql client). You - can also use mysqladmin or mysql_secure_installation. For - additional details, see Section 4.4.3, "mysql_install_db --- - Initialize MySQL Data Directory." (Install operations using - RPMs for Unbreakable Linux Network are unaffected because - they do not use mysql_install_db.) - Important - - RPMs for MySQL Cluster. Standard MySQL server RPMs built by - MySQL do not provide support for the NDBCLUSTER storage - engine. For more information about installing MySQL Cluster - from RPMs, see Section 18.2, "MySQL Cluster Installation." - - When upgrading a MySQL Cluster RPM installation, you must - upgrade all installed RPMs, including the Server and Client - RPMs. - - For upgrades, if your installation was originally produced by - installing multiple RPM packages, it is best to upgrade all - the packages, not just some. For example, if you previously - installed the server and client RPMs, do not upgrade just the - server RPM. - - If the data directory exists at RPM installation time, the - installation process does not modify existing data. This has - the effect, for example, that accounts in the grant tables - are not initialized to the default set of accounts. - - If you get a dependency failure when trying to install MySQL - packages (for example, error: removing these packages would - break dependencies: libmysqlclient.so.10 is needed by ...), - you should also install the MySQL-shared-compat package, - which includes the shared libraries for older releases for - backward compatibility. - - The RPM packages shown in the following list are available. - The names shown here use a suffix of - .linux_glibc2.5.i386.rpm, but particular packages can have - different suffixes, described later. If you plan to install - multiple RPM packages, you may wish to download the RPM - Bundle tar file instead, which contains multiple RPM packages - to that you need not download them separately. - - * MySQL-server-VERSION.linux_glibc2.5.i386.rpm - The MySQL server. You need this unless you only want to - connect to a MySQL server running on another machine. - - * MySQL-client-VERSION.linux_glibc2.5.i386.rpm - The standard MySQL client programs. You probably always - want to install this package. - - * MySQL-devel-VERSION.linux_glibc2.5.i386.rpm - The libraries and include files that are needed if to - compile other MySQL clients, such as the Perl modules. - Install this RPM if you intend to compile C API - applications. - - * MySQL-shared-VERSION.linux_glibc2.5.i386.rpm - This package contains the shared libraries - (libmysqlclient.so*) that certain languages and - applications need to dynamically load and use MySQL. It - contains single-threaded and thread-safe libraries. - Install this RPM if you intend to compile or run C API - applications that depend on the shared client library. - - * MySQL-shared-compat-VERSION.linux_glibc2.5.i386.rpm - This package includes the shared libraries for older - releases, but not the libraries for the current release. - It contains single-threaded and thread-safe libraries. - Install this package if you have applications installed - that are dynamically linked against older versions of - MySQL but you want to upgrade to the current version - without breaking the library dependencies. - As of MySQL 5.6.5, the MySQL-shared-compat RPM package - enables users of Red Hat-provided mysql-*-5.1 RPM - packages to migrate to Oracle-provided MySQL-*-5.5 - packages. MySQL-shared-compat replaces the Red Hat - mysql-libs package by replacing libmysqlclient.so files - of the latter package, thus satisfying dependencies of - other packages on mysql-libs. This change affects only - users of Red Hat (or Red Hat-compatible) RPM packages. - Nothing is different for users of Oracle RPM packages. - - * MySQL-embedded-VERSION.linux_glibc2.5.i386.rpm - The embedded MySQL server library. - - * MySQL-test-VERSION.linux_glibc2.5.i386.rpm - This package includes the MySQL test suite. - - * MySQL-VERSION.src.rpm - This contains the source code for all of the previous - packages. It can also be used to rebuild the RPMs on - other architectures (for example, Alpha or SPARC). - - The suffix of RPM package names (following the VERSION value) - has the following syntax: -.PLATFORM.CPU.rpm - - The PLATFORM and CPU values indicate the type of system for - which the package is built. PLATFORM indicates the platform - and CPU indicates the processor type or family. - - All packages are dynamically linked against glibc 2.5. The - PLATFORM value indicates whether the package is platform - independent or intended for a specific platform, as shown in - the following table. - - Table 2.7 MySQL Linux Installation Packages - PLATFORM Value Intended Use - linux_glibc25 Platform independent, should run on any Linux - distribution that supports glibc 2.5 - rhel5, rhel6 Red Hat Enterprise Linux 5 or 6 - el6, el7 Enterprise Linux 6 or 7 - sles10, sles11 SUSE Linux Enterprise Server 10 or 11 - - In MySQL 5.6, only linux_glibc2.5 packages are available - currently. - - The CPU value indicates the processor type or family for - which the package is built. - - Table 2.8 MySQL Installation Packages for Linux CPU - Identifiers - CPU Value Intended Processor Type or Family - i386, i586, i686 Pentium processor or better, 32 bit - x86_64 64-bit x86 processor - ia64 Itanium (IA-64) processor - - To see all files in an RPM package (for example, a - MySQL-server RPM), run a command like this: -shell> rpm -qpl MySQL-server-VERSION.linux_glibc2.5.i386.rpm - - To perform a standard minimal installation, install the - server and client RPMs: -shell> rpm -i MySQL-server-VERSION.linux_glibc2.5.i386.rpm -shell> rpm -i MySQL-client-VERSION.linux_glibc2.5.i386.rpm - - To install only the client programs, install just the client - RPM: -shell> rpm -i MySQL-client-VERSION.linux_glibc2.5.i386.rpm - - RPM provides a feature to verify the integrity and - authenticity of packages before installing them. To learn - more about this feature, see Section 2.1.4, "Verifying - Package Integrity Using MD5 Checksums or GnuPG." - - The server RPM places data under the /var/lib/mysql - directory. The RPM also creates a login account for a user - named mysql (if one does not exist) to use for running the - MySQL server, and creates the appropriate entries in - /etc/init.d/ to start the server automatically at boot time. - (This means that if you have performed a previous - installation and have made changes to its startup script, you - may want to make a copy of the script so that you do not lose - it when you install a newer RPM.) See Section 2.10.1.2, - "Starting and Stopping MySQL Automatically," for more - information on how MySQL can be started automatically on - system startup. - - In MySQL 5.6, during a new installation, the server boot - scripts are installed, but the MySQL server is not started at - the end of the installation, since the status of the server - during an unattended installation is not known. - - In MySQL 5.6, during an upgrade installation using the RPM - packages, if the MySQL server is running when the upgrade - occurs, the MySQL server is stopped, the upgrade occurs, and - the MySQL server is restarted. If the MySQL server is not - already running when the RPM upgrade occurs, the MySQL server - is not started at the end of the installation. - Note - - If you are upgrading from a community version to a commercial - version of MySQL (which actually requires you to first - uninstall the community version and then install the - commercial version), you must restart the server manually - after the upgrade. - - If something goes wrong, you can find more information in the - binary installation section. See Section 2.2, "Installing - MySQL on Unix/Linux Using Generic Binaries." - Note - - The accounts that are listed in the MySQL grant tables - initially have no passwords. After starting the server, you - should set up passwords for them using the instructions in - Section 2.10, "Postinstallation Setup and Testing." - - During RPM installation, a user named mysql and a group named - mysql are created on the system. This is done using the - useradd, groupadd, and usermod commands. Those commands - require appropriate administrative privileges, which is - required for locally managed users and groups (as listed in - the /etc/passwd and /etc/group files) by the RPM installation - process being run by root. - - If you log in as the mysql user, you may find that MySQL - displays "Invalid (old?) table or database name" errors that - mention .mysqlgui, lost+found, .mysqlgui, .bash_history, - .fonts.cache-1, .lesshst, .mysql_history, .profile, .viminfo, - and similar files created by MySQL or operating system - utilities. You can safely ignore these error messages or - remove the files or directories that cause them if you do not - need them. - - For nonlocal user management (LDAP, NIS, and so forth), the - administrative tools may require additional authentication - (such as a password), and will fail if the installing user - does not provide this authentication. Even if they fail, the - RPM installation will not abort but succeed, and this is - intentional. If they failed, some of the intended transfer of - ownership may be missing, and it is recommended that the - system administrator then manually ensures some appropriate - user and group exists and manually transfers ownership - following the actions in the RPM spec file. - - In MySQL 5.6.11, the RPM spec file has been updated, which - has the following consequences: - - * For a non-upgrade installation (no existing MySQL version - installed), it possible to install MySQL using yum. - - * For upgrades, it is necessary to clean up any earlier - MySQL installations. In effect, the update is performed - by removing the old installations and installing the new - one. - - Additional details follow. - - For a non-upgrade installation of MySQL 5.6.11 or later, it - is possible to install using yum: -shell> yum install MySQL-server-NEWVERSION.linux_glibc2.5.i386.rpm - - For upgrades to MySQL 5.6.11 or later, the upgrade is - performed by removing the old installation and installing the - new one. To do this, use the following procedure: - - 1. Remove the existing 5.6.X installation. OLDVERSION is the - version to remove. -shell> rpm -e MySQL-server-OLDVERSION.linux_glibc2.5.i386.rpm - - Repeat this step for all installed MySQL RPMs. - - 2. Install the new version. NEWVERSION is the version to - install. -shell> rpm -ivh MySQL-server-NEWVERSION.linux_glibc2.5.i386.rpm - - Alternatively, the removal and installation can be done using - yum: -shell> yum remove MySQL-server-OLDVERSION.linux_glibc2.5.i386.rpm -shell> yum install MySQL-server-NEWVERSION.linux_glibc2.5.i386.rpm - -2.5.6 Installing MySQL on Linux Using Debian Packages from Oracle - - Oracle provides Debian packages for installing MySQL on - Debian or Debian-like Linux systems. The packages are - available through two different channels: - - * The MySQL APT Repository - (http://dev.mysql.com/downloads/repo/apt/), supporting - the Debian 7, Ubuntu 12, and Ubuntu 14 platforms. For - details, see Section 2.5.3, "Installing MySQL on Linux - Using the MySQL APT Repository." - - * The MySQL Developer Zone's Download Area - (http://dev.mysql.com/downloads/). For details, see - Section 2.1.3, "How to Get MySQL." The following are some - information on the Debian packages available there and - the instructions for installing them: - - + You may also need to install the libaio library if - it is not already present on your system: -shell> sudo apt-get install libaio1 - - - + For Debian 7, Ubuntu 12, and Ubuntu 14: - o Various Debian packages are provided in the - MySQL Developer Zone for installing different - components of MySQL. The preferred method is to - use the tarball bundle, which contains the - packages needed for a basic setup of MySQL. The - tarball bundles have names in the format of - mysql-server_MVER-DVER_CPU.deb-bundle.tar. MVER - is the MySQL version and DVER is the Linux - distribution version. The CPU value indicates - the processor type or family for which the - package is built, as shown in the following - table: - Table 2.9 MySQL Debian 7 and Ubuntu - Installation Packages CPU Identifiers - - CPU Value Intended Processor Type or Family - i386 Pentium processor or better, 32 bit - amd64 64-bit x86 processor - o After downloading the tarball, unpack it with - the following command: -shell> tar -xvf mysql-server_MVER-DVER_CPU.deb-bundle.tar - - o In general, install the deb packages unpacked - from the tarball with the command (see - explanations below for the extra steps required - for installing the server package): -shell> sudo dpkg -i package-name.deb - There are four packages to install: - # The database common files (install this - package before the other ones): -shell> sudo dpkg -i mysql-common_MVER-DVER_CPU.deb - # The MySQL server: - Install first the package for the database - common files (see the last bullet), and - then pre-configure your server - installation by the following command: -shell> dpkg-preconfigure mysql-community-server_MVER-DVER_CPU.deb - There are then two requests for you: - @ Supply a password for the root user - for your MySQL installation. - Important - Make sure you remember the root - password you set. Users who want to - set a password later can leave the - password field blank in the dialogue - box and just press OK. However, it is - very important that you set the - password soon using the program - mysql_secure_installation, as people - can gain anonymous access to your - MySQL server until you have secured - the database's root account with a - password. - @ Indicate if you want to install the - test database with "Yes" or "No". - Installation of the test database is - not recommended for production - environments. - Next, install the server package with the - following command: -shell> sudo dpkg -i mysql-community-server_MVER-DVER_CPU.deb - # The MySQL client: -shell> sudo dpkg -i mysql-community-client_MVER-DVER_CPU.deb - # The MySQL shared client library: -shell> sudo dpkg -i libmysqlclient18_MVER-DVER_CPU.deb - Here are where the files are installed on the - system: - # All configuration files (like my.cnf) are - under /etc - # All binaries, libraries, headers, etc., - are under /usr - # The data directory is under /var - - + For Debian 6: - o Debian package files directly downloaded from - the MySQL Developer Zone have names in the - mysql-MVER-DVER-CPU.deb format. MVER is the - MySQL version and DVER is the Debian version. - The CPU value indicates the processor type or - family for which the package is built, as shown - in the following table: - Table 2.10 MySQL Debian 6 Installation Package - CPU Identifiers - - CPU Value Intended Processor Type or Family - i686 Pentium processor or better, 32 bit - x86_64 64-bit x86 processor - o After downloading a Debian package, use the - following command to install it; -shell> dpkg -i mysql-MVER-DVER-CPU.deb - - The Debian package installs files under the - /opt/mysql/server-5.6 directory. - - Note - - Debian distributions of MySQL are also provided by other - vendors. Be aware that they may differ from those built by - Oracle in features, capabilities, and conventions (including - communication setup), and that the instructions in this - manual do not necessarily apply to installing them. The - vendor's instructions should be consulted instead. - -2.5.7 Installing MySQL on Linux from the Native Software -Repositories - - Many Linux distributions include a version of the MySQL - server, client tools, and development components in their - native software repositories and can be installed with the - platforms' standard package management systems. This section - provides basic instructions for installing MySQL using those - package management systems. - Important - - Native packages are often several versions behind the - currently available release. You will also normally be unable - to install development milestone releases (DMRs), as these - are not usually made available in the native repositories. - Before proceeding, we recommend that you check out the other - installation options described in Section 2.5, "Installing - MySQL on Linux." - - Distribution specific instructions are shown below: - - * Red Hat Linux, Fedora, CentOS - Note - For EL5, EL6, or EL7-based Linux platforms and Fedora 20 - or 21, you can install MySQL using the MySQL Yum - repository instead of the platform's native software - repository. See Section 2.5.1, "Installing MySQL on Linux - Using the MySQL Yum Repository" for details. - For Red Hat and similar distributions, the MySQL - distribution is divided into a number of separate - packages, mysql for the client tools, mysql-server for - the server and associated tools, and mysql-libs for the - libraries. The libraries are required if you want to - provide connectivity from different languages and - environments such as Perl, Python and others. - To install, use the yum command to specify the packages - that you want to install. For example: -root-shell> yum install mysql mysql-server mysql-libs mysql-server -Loaded plugins: presto, refresh-packagekit -Setting up Install Process -Resolving Dependencies ---> Running transaction check ----> Package mysql.x86_64 0:5.1.48-2.fc13 set to be updated ----> Package mysql-libs.x86_64 0:5.1.48-2.fc13 set to be updated ----> Package mysql-server.x86_64 0:5.1.48-2.fc13 set to be updated ---> Processing Dependency: perl-DBD-MySQL for package: mysql-server-5. -1.48-2.fc13.x86_64 ---> Running transaction check ----> Package perl-DBD-MySQL.x86_64 0:4.017-1.fc13 set to be updated ---> Finished Dependency Resolution - -Dependencies Resolved - -====================================================================== -========== - Package Arch Version Repository - Size -====================================================================== -========== -Installing: - mysql x86_64 5.1.48-2.fc13 updates - 889 k - mysql-libs x86_64 5.1.48-2.fc13 updates - 1.2 M - mysql-server x86_64 5.1.48-2.fc13 updates - 8.1 M -Installing for dependencies: - perl-DBD-MySQL x86_64 4.017-1.fc13 updates - 136 k - -Transaction Summary -====================================================================== -========== -Install 4 Package(s) -Upgrade 0 Package(s) - -Total download size: 10 M -Installed size: 30 M -Is this ok [y/N]: y -Downloading Packages: -Setting up and reading Presto delta metadata -Processing delta metadata -Package(s) data still to download: 10 M -(1/4): mysql-5.1.48-2.fc13.x86_64.rpm | 889 kB -00:04 -(2/4): mysql-libs-5.1.48-2.fc13.x86_64.rpm | 1.2 MB -00:06 -(3/4): mysql-server-5.1.48-2.fc13.x86_64.rpm | 8.1 MB -00:40 -(4/4): perl-DBD-MySQL-4.017-1.fc13.x86_64.rpm | 136 kB -00:00 ----------------------------------------------------------------------- ----------- -Total 201 kB/s | 10 MB -00:52 -Running rpm_check_debug -Running Transaction Test -Transaction Test Succeeded -Running Transaction - Installing : mysql-libs-5.1.48-2.fc13.x86_64 - 1/4 - Installing : mysql-5.1.48-2.fc13.x86_64 - 2/4 - Installing : perl-DBD-MySQL-4.017-1.fc13.x86_64 - 3/4 - Installing : mysql-server-5.1.48-2.fc13.x86_64 - 4/4 - -Installed: - mysql.x86_64 0:5.1.48-2.fc13 mysql-libs.x86_64 0:5.1.48-2 -.fc13 - mysql-server.x86_64 0:5.1.48-2.fc13 - -Dependency Installed: - perl-DBD-MySQL.x86_64 0:4.017-1.fc13 - - -Complete! - - MySQL and the MySQL server should now be installed. A - sample configuration file is installed into /etc/my.cnf. - An init script, to start and stop the server, will have - been installed into /etc/init.d/mysqld. To start the - MySQL server use service: -root-shell> service mysqld start - - To enable the server to be started and stopped - automatically during boot, use chkconfig: -root-shell> chkconfig --levels 235 mysqld on - - Which enables the MySQL server to be started (and - stopped) automatically at the specified the run levels. - The database tables will have been automatically created - for you, if they do not already exist. You should, - however, run mysql_secure_installation to set the root - passwords on your server. - - * Debian, Ubuntu, Kubuntu - Note - For Debian 7, Ubuntu 12, and Ubuntu 14, MySQL can be - installed using the MySQL APT Repository - (http://dev.mysql.com/downloads/repo/apt/) instead of the - platform's native software repository. See Section 2.5.3, - "Installing MySQL on Linux Using the MySQL APT - Repository" for details. - On Debian and related distributions, there are two - packages for MySQL in their software repositories, - mysql-client and mysql-server, for the client and server - components respectively. You should specify an explicit - version, for example mysql-client-5.1, to ensure that you - install the version of MySQL that you want. - To download and install, including any dependencies, use - the apt-get command, specifying the packages that you - want to install. - Note - Before installing, make sure that you update your apt-get - index files to ensure you are downloading the latest - available version. - A sample installation of the MySQL packages might look - like this (some sections trimmed for clarity): -root-shell> apt-get install mysql-client-5.1 mysql-server-5.1 -Reading package lists... Done -Building dependency tree -Reading state information... Done -The following packages were automatically installed and are no longer -required: - linux-headers-2.6.28-11 linux-headers-2.6.28-11-generic -Use 'apt-get autoremove' to remove them. -The following extra packages will be installed: - bsd-mailx libdbd-mysql-perl libdbi-perl libhtml-template-perl - libmysqlclient15off libmysqlclient16 libnet-daemon-perl libplrpc-per -l mailx - mysql-common postfix -Suggested packages: - dbishell libipc-sharedcache-perl tinyca procmail postfix-mysql postf -ix-pgsql - postfix-ldap postfix-pcre sasl2-bin resolvconf postfix-cdb -The following NEW packages will be installed - bsd-mailx libdbd-mysql-perl libdbi-perl libhtml-template-perl - libmysqlclient15off libmysqlclient16 libnet-daemon-perl libplrpc-per -l mailx - mysql-client-5.1 mysql-common mysql-server-5.1 postfix -0 upgraded, 13 newly installed, 0 to remove and 182 not upgraded. -Need to get 1907kB/25.3MB of archives. -After this operation, 59.5MB of additional disk space will be used. -Do you want to continue [Y/n]? Y -Get: 1 http://gb.archive.ubuntu.com jaunty-updates/main mysql-common 5 -.1.30really5.0.75-0ubuntu10.5 [63.6kB] -Get: 2 http://gb.archive.ubuntu.com jaunty-updates/main libmysqlclient -15off 5.1.30really5.0.75-0ubuntu10.5 [1843kB] -Fetched 1907kB in 9s (205kB/s) - -Preconfiguring packages ... -Selecting previously deselected package mysql-common. -(Reading database ... 121260 files and directories currently installed -.) -... -Processing 1 added doc-base file(s)... -Registering documents with scrollkeeper... -Setting up libnet-daemon-perl (0.43-1) ... -Setting up libplrpc-perl (0.2020-1) ... -Setting up libdbi-perl (1.607-1) ... -Setting up libmysqlclient15off (5.1.30really5.0.75-0ubuntu10.5) ... - -Setting up libdbd-mysql-perl (4.008-1) ... -Setting up libmysqlclient16 (5.1.31-1ubuntu2) ... - -Setting up mysql-client-5.1 (5.1.31-1ubuntu2) ... - -Setting up mysql-server-5.1 (5.1.31-1ubuntu2) ... - - * Stopping MySQL database server mysqld - ...done. -100825 11:46:15 InnoDB: Started; log sequence number 0 46409 -100825 11:46:15 InnoDB: Starting shutdown... -100825 11:46:17 InnoDB: Shutdown completed; log sequence number 0 464 -09 -100825 11:46:17 [Warning] Forcing shutdown of 1 plugins - - * Starting MySQL database server mysqld - ...done. - - * Checking for corrupt, not cleanly closed and upgrade needing tables -. -... -Processing triggers for libc6 ... -ldconfig deferred processing now taking place - - Note - The apt-get command will install a number of packages, - including the MySQL server, in order to provide the - typical tools and application environment. This can mean - that you install a large number of packages in addition - to the main MySQL package. - During installation, the initial database will be - created, and you will be prompted for the MySQL root - password (and confirmation). A configuration file will - have been created in /etc/mysql/my.cnf. An init script - will have been created in /etc/init.d/mysql. - The server will already be started. You can manually - start and stop the server using: -root-shell> service mysql [start|stop] - - The service will automatically be added to the 2, 3 and 4 - run levels, with stop scripts in the single, shutdown and - restart levels. - - * Gentoo Linux - As a source-based distribution, installing MySQL on - Gentoo involves downloading the source, patching the - Gentoo specifics, and then compiling the MySQL server and - installing it. This process is handled automatically by - the emerge command. Depending on the version of MySQL - that you want to install, you may need to unmask the - specific version that you want for your chosen platform. - The MySQL server and client tools are provided within a - single package, dev-db/mysql. You can obtain a list of - the versions available to install by looking at the - portage directory for the package: -root-shell> ls /usr/portage/dev-db/mysql/mysql-5.1* -mysql-5.1.39-r1.ebuild -mysql-5.1.44-r1.ebuild -mysql-5.1.44-r2.ebuild -mysql-5.1.44-r3.ebuild -mysql-5.1.44.ebuild -mysql-5.1.45-r1.ebuild -mysql-5.1.45.ebuild -mysql-5.1.46.ebuild - - To install a specific MySQL version, you must specify the - entire atom. For example: -root-shell> emerge =dev-db/mysql-5.1.46 - - A simpler alternative is to use the virtual/mysql-5.1 - package, which will install the latest version: -root-shell> emerge =virtual/mysql-5.1 - - If the package is masked (because it is not tested or - certified for the current platform), use the - ACCEPT_KEYWORDS environment variable. For example: -root-shell> ACCEPT_KEYWORDS="~x86" emerge =virtual/mysql-5.1 - - After installation, you should create a new database - using mysql_install_db, and set the password for the root - user on MySQL. You can use the configuration interface to - set the password and create the initial database: -root-shell> emerge --config =dev-db/mysql-5.1.46 - - A sample configuration file will have been created for - you in /etc/mysql/my.cnf, and an init script will have - been created in /etc/init.d/mysql. - To enable MySQL to start automatically at the normal - (default) run levels, you can use: -root-shell> rc-update add mysql default - -2.6 Installing MySQL Using Unbreakable Linux Network (ULN) - - Linux supports a number of different solutions for installing - MySQL, covered in Section 2.5, "Installing MySQL on Linux." - One of the methods, covered in this section, is installing - from Oracles's Unbreakable Linux Network (ULN). You can find - information about Oracle Linux and ULN under - http://linux.oracle.com/. - - To use ULN, you need to obtain a ULN login and register the - machine used for installation with ULN. This is described in - detail in the ULN FAQ - (https://linux.oracle.com/uln_faq.html). The page also - describes how to install and update packages.The MySQL - packages are in the "MySQL for Oracle Linux 6" and "MySQL for - Oracle Linux 7" channels for your system architecture on ULN. - Note - - At the time of this writing, ULN provides MySQL 5.6 for - Oracle Linux 6 and Oracle Linux 7. - - Once MySQL has been installed using ULN, you can find - information on starting and stopping the server, and more, in - this section, particularly under Section 2.5.5, "Installing - MySQL on Linux Using RPM Packages." - - If you're updating an existing MySQL installation to an - installation using ULN, the recommended procedure is to - export your data using mysqldump, remove the existing - installation, install MySQL from ULN, and load the exported - data into your freshly installed MySQL. - - If the existing MySQL installation you're upgrading from is - from a previous release series (prior to MySQL 5.6), make - sure to read the section on upgrading MySQL, Section 2.11.1, - "Upgrading MySQL." - -2.7 Installing MySQL on Solaris and OpenSolaris - - MySQL on Solaris and OpenSolaris is available in a number of - different formats. - - * For information on installing using the native Solaris - PKG format, see Section 2.7.1, "Installing MySQL on - Solaris Using a Solaris PKG." - - * On OpenSolaris, the standard package repositories include - MySQL packages specially built for OpenSolaris that - include entries for the Service Management Framework - (SMF) to enable control of the installation using the SMF - administration commands. For more information, see - Section 2.7.2, "Installing MySQL on OpenSolaris Using - IPS." - - * To use a standard tar binary installation, use the notes - provided in Section 2.2, "Installing MySQL on Unix/Linux - Using Generic Binaries." Check the notes and hints at the - end of this section for Solaris specific notes that you - may need before or after installation. - - To obtain a binary MySQL distribution for Solaris in tarball - or PKG format, http://dev.mysql.com/downloads/mysql/5.6.html. - - Additional notes to be aware of when installing and using - MySQL on Solaris: - - * If you want to use MySQL with the mysql user and group, - use the groupadd and useradd commands: -groupadd mysql -useradd -g mysql mysql - - - * If you install MySQL using a binary tarball distribution - on Solaris, you may run into trouble even before you get - the MySQL distribution unpacked, as the Solaris tar - cannot handle long file names. This means that you may - see errors when you try to unpack MySQL. - If this occurs, you must use GNU tar (gtar) to unpack the - distribution. In Solaris 10 and OpenSolaris gtar is - normally located in /usr/sfw/bin/gtar, but may not be - included in the default path definition. - - * When using Solaris 10 for x86_64, you should mount any - file systems on which you intend to store InnoDB files - with the forcedirectio option. (By default mounting is - done without this option.) Failing to do so will cause a - significant drop in performance when using the InnoDB - storage engine on this platform. - - * If you would like MySQL to start automatically, you can - copy support-files/mysql.server to /etc/init.d and create - a symbolic link to it named /etc/rc3.d/S99mysql.server. - - * If too many processes try to connect very rapidly to - mysqld, you should see this error in the MySQL log: -Error in accept: Protocol error - - You might try starting the server with the --back_log=50 - option as a workaround for this. - - * To configure the generation of core files on Solaris you - should use the coreadm command. Because of the security - implications of generating a core on a setuid() - application, by default, Solaris does not support core - files on setuid() programs. However, you can modify this - behavior using coreadm. If you enable setuid() core files - for the current user, they will be generated using the - mode 600 and owned by the superuser. - -2.7.1 Installing MySQL on Solaris Using a Solaris PKG - - You can install MySQL on Solaris and OpenSolaris using a - binary package using the native Solaris PKG format instead of - the binary tarball distribution. - - To use this package, download the corresponding - mysql-VERSION-solaris10-PLATFORM.pkg.gz file, then uncompress - it. For example: -shell> gunzip mysql-5.6.23-solaris10-x86_64.pkg.gz - - To install a new package, use pkgadd and follow the onscreen - prompts. You must have root privileges to perform this - operation: -shell> pkgadd -d mysql-5.6.23-solaris10-x86_64.pkg - -The following packages are available: - 1 mysql MySQL Community Server (GPL) - (i86pc) 5.6.23 - -Select package(s) you wish to process (or 'all' to process -all packages). (default: all) [?,??,q]: - - The PKG installer installs all of the files and tools needed, - and then initializes your database if one does not exist. To - complete the installation, you should set the root password - for MySQL as provided in the instructions at the end of the - installation. Alternatively, you can run the - mysql_secure_installation script that comes with the - installation. - - By default, the PKG package installs MySQL under the root - path /opt/mysql. You can change only the installation root - path when using pkgadd, which can be used to install MySQL in - a different Solaris zone. If you need to install in a - specific directory, use a binary tar file distribution. - - The pkg installer copies a suitable startup script for MySQL - into /etc/init.d/mysql. To enable MySQL to startup and - shutdown automatically, you should create a link between this - file and the init script directories. For example, to ensure - safe startup and shutdown of MySQL you could use the - following commands to add the right links: -shell> ln /etc/init.d/mysql /etc/rc3.d/S91mysql -shell> ln /etc/init.d/mysql /etc/rc0.d/K02mysql - - To remove MySQL, the installed package name is mysql. You can - use this in combination with the pkgrm command to remove the - installation. - - To upgrade when using the Solaris package file format, you - must remove the existing installation before installing the - updated package. Removal of the package does not delete the - existing database information, only the server, binaries and - support files. The typical upgrade sequence is therefore: -shell> mysqladmin shutdown -shell> pkgrm mysql -shell> pkgadd -d mysql-5.6.23-solaris10-x86_64.pkg -shell> mysqld_safe & -shell> mysql_upgrade - - You should check the notes in Section 2.11, "Upgrading or - Downgrading MySQL" before performing any upgrade. - -2.7.2 Installing MySQL on OpenSolaris Using IPS - - OpenSolaris includes standard packages for MySQL in the core - repository. The MySQL packages are based on a specific - release of MySQL and updated periodically. For the latest - release you must use either the native Solaris PKG, tar, or - source installations. The native OpenSolaris packages include - SMF files so that you can easily control your MySQL - installation, including automatic startup and recovery, using - the native service management tools. - - To install MySQL on OpenSolaris, use the pkg command. You - will need to be logged in as root, or use the pfexec tool, as - shown in the example below: -shell> pfexec pkg install SUNWmysql56 - - The package set installs three individual packages, - SUNWmysql56lib, which contains the MySQL client libraries; - SUNWmysql56r which contains the root components, including - SMF and configuration files; and SUNWmysql56u which contains - the scripts, binary tools and other files. You can install - these packages individually if you only need the - corresponding components. - - The MySQL files are installed into /usr/mysql which symbolic - links for the sub directories (bin, lib, etc.) to a version - specific directory. For MySQL 5.6, the full installation is - located in /usr/mysql/5.6. The default data directory is - /var/mysql/5.6/data. The configuration file is installed in - /etc/mysql/5.6/my.cnf. This layout permits multiple versions - of MySQL to be installed, without overwriting the data and - binaries from other versions. - - Once installed, you must run mysql_install_db to initialize - the database, and use the mysql_secure_installation to secure - your installation. - -Using SMF to manage your MySQL installation - - Once installed, you can start and stop your MySQL server - using the installed SMF configuration. The service name is - mysql, or if you have multiple versions installed, you should - use the full version name, for example mysql:version_56. To - start and enable MySQL to be started at boot time: -shell> svcadm enable mysql - - To disable MySQL from starting during boot time, and shut the - MySQL server down if it is running, use: -shell> svcadm disable mysql - - To restart MySQL, for example after a configuration file - changes, use the restart option: -shell> svcadm restart mysql - - You can also use SMF to configure the data directory and - enable full 64-bit mode. For example, to set the data - directory used by MySQL: -shell> svccfg -svc:> select mysql:version_56 -svc:/application/database/mysql:version_56> setprop mysql/data=/data0/ -mysql - - By default, the 32-bit binaries are used. To enable the - 64-bit server on 64-bit platforms, set the enable_64bit - parameter. For example: -svc:/application/database/mysql:version_56> setprop mysql/enable_64bit -=1 - - You need to refresh the SMF after settings these options: -shell> svcadm refresh mysql - -2.8 Installing MySQL on FreeBSD - - This section provides information about installing MySQL on - variants of FreeBSD Unix. - - You can install MySQL on FreeBSD by using the binary - distribution provided by Oracle. For more information, see - Section 2.2, "Installing MySQL on Unix/Linux Using Generic - Binaries." - - The easiest (and preferred) way to install MySQL is to use - the mysql-server and mysql-client ports available at - http://www.freebsd.org/. Using these ports gives you the - following benefits: - - * A working MySQL with all optimizations enabled that are - known to work on your version of FreeBSD. - - * Automatic configuration and build. - - * Startup scripts installed in /usr/local/etc/rc.d. - - * The ability to use pkg_info -L to see which files are - installed. - - * The ability to use pkg_delete to remove MySQL if you no - longer want it on your machine. - - The MySQL build process requires GNU make (gmake) to work. If - GNU make is not available, you must install it first before - compiling MySQL. - - To install using the ports system: -# cd /usr/ports/databases/mysql51-server -# make -... -# cd /usr/ports/databases/mysql51-client -# make -... - - The standard port installation places the server into - /usr/local/libexec/mysqld, with the startup script for the - MySQL server placed in /usr/local/etc/rc.d/mysql-server. - - Some additional notes on the BSD implementation: - - * To remove MySQL after installation using the ports - system: -# cd /usr/ports/databases/mysql51-server -# make deinstall -... -# cd /usr/ports/databases/mysql51-client -# make deinstall -... - - - * If you get problems with the current date in MySQL, - setting the TZ variable should help. See Section 2.12, - "Environment Variables." - -2.9 Installing MySQL from Source - - Building MySQL from the source code enables you to customize - build parameters, compiler optimizations, and installation - location. For a list of systems on which MySQL is known to - run, see - http://www.mysql.com/support/supportedplatforms/database.html - . - - Before you proceed with an installation from source, check - whether Oracle produces a precompiled binary distribution for - your platform and whether it works for you. We put a great - deal of effort into ensuring that our binaries are built with - the best possible options for optimal performance. - Instructions for installing binary distributions are - available in Section 2.2, "Installing MySQL on Unix/Linux - Using Generic Binaries." - -Source Installation Methods - - There are two methods for installing MySQL from source: - - * Use a standard MySQL source distribution. To obtain a - standard distribution, see Section 2.1.3, "How to Get - MySQL." For instructions on building from a standard - distribution, see Section 2.9.2, "Installing MySQL Using - a Standard Source Distribution." - Standard distributions are available as compressed tar - files, Zip archives, or RPM packages. Distribution files - have names of the form mysql-VERSION.tar.gz, - mysql-VERSION.zip, or mysql-VERSION.rpm, where VERSION is - a number like 5.6.23. File names for source distributions - can be distinguished from those for precompiled binary - distributions in that source distribution names are - generic and include no platform name, whereas binary - distribution names include a platform name indicating the - type of system for which the distribution is intended - (for example, pc-linux-i686 or winx64). - - * Use a MySQL development tree. For information on building - from one of the development trees, see Section 2.9.3, - "Installing MySQL Using a Development Source Tree." - -Source Installation System Requirements - - Installation of MySQL from source requires several - development tools. Some of these tools are needed no matter - whether you use a standard source distribution or a - development source tree. Other tool requirements depend on - which installation method you use. - - To install MySQL from source, your system must have the - following tools, regardless of installation method: - - * CMake, which is used as the build framework on all - platforms. CMake can be downloaded from - http://www.cmake.org. - - * A good make program. Although some platforms come with - their own make implementations, it is highly recommended - that you use GNU make 3.75 or newer. It may already be - available on your system as gmake. GNU make is available - from http://www.gnu.org/software/make/. - - * A working ANSI C++ compiler. GCC 4.2.1 or later, Sun - Studio 12 or later, Visual Studio 2010 or later, and many - current vendor-supplied compilers are known to work. - - * Perl is needed if you intend to run test scripts. Most - Unix-like systems include Perl. On Windows, you can use a - version such as ActiveState Perl. - - To install MySQL from a standard source distribution, one of - the following tools is required to unpack the distribution - file: - - * For a .tar.gz compressed tar file: GNU gunzip to - uncompress the distribution and a reasonable tar to - unpack it. If your tar program supports the z option, it - can both uncompress and unpack the file. - GNU tar is known to work. The standard tar provided with - some operating systems is not able to unpack the long - file names in the MySQL distribution. You should download - and install GNU tar, or if available, use a preinstalled - version of GNU tar. Usually this is available as gnutar, - gtar, or as tar within a GNU or Free Software directory, - such as /usr/sfw/bin or /usr/local/bin. GNU tar is - available from http://www.gnu.org/software/tar/. - - * For a .zip Zip archive: WinZip or another tool that can - read .zip files. - - * For an .rpm RPM package: The rpmbuild program used to - build the distribution unpacks it. - - To install MySQL from a development source tree, the - following additional tools are required: - - * One of the following revision control systems is required - to obtain the development source code: - - + Git: The GitHub Help (https://help.github.com/) - provides instructions for downloading and installing - Git on different platforms. MySQL officially joined - GitHub in September, 2014. For more information - about MySQL's move to GitHub, refer to the - announcement on the MySQL Release Engineering blog: - MySQL on GitHub - (http://mysqlrelease.com/2014/09/mysql-on-github/) - - + Bazaar: The Bazaar VCS Web site - (http://bazaar-vcs.org) provides instructions for - downloading and installing Bazaar on different - platforms. Bazaar is supported on any platform that - supports Python, and is therefore compatible with - any Linux, Unix, Windows, or OS X host. - - * bison 2.1 or newer, available from - http://www.gnu.org/software/bison/. (Version 1 is no - longer supported.) Use the latest version of bison where - possible; if you experience problems, upgrade to a later - version, rather than revert to an earlier one. - bison is available from - http://www.gnu.org/software/bison/. bison for Windows can - be downloaded from - http://gnuwin32.sourceforge.net/packages/bison.htm. - Download the package labeled "Complete package, excluding - sources". On Windows, the default location for bison is - the C:\Program Files\GnuWin32 directory. Some utilities - may fail to find bison because of the space in the - directory name. Also, Visual Studio may simply hang if - there are spaces in the path. You can resolve these - problems by installing into a directory that does not - contain a space; for example C:\GnuWin32. - - * On OpenSolaris and Solaris Express, m4 must be installed - in addition to bison. m4 is available from - http://www.gnu.org/software/m4/. - - Note - - If you have to install any programs, modify your PATH - environment variable to include any directories in which the - programs are located. See Section 4.2.10, "Setting - Environment Variables." - - If you run into problems and need to file a bug report, - please use the instructions in Section 1.7, "How to Report - Bugs or Problems." - -2.9.1 MySQL Layout for Source Installation - - By default, when you install MySQL after compiling it from - source, the installation step installs files under - /usr/local/mysql. The component locations under the - installation directory are the same as for binary - distributions. See Section 2.2, "MySQL Installation Layout - for Generic Unix/Linux Binary Package," and Section 2.3.1, - "MySQL Installation Layout on Microsoft Windows." To - configure installation locations different from the defaults, - use the options described at Section 2.9.4, "MySQL - Source-Configuration Options." - -2.9.2 Installing MySQL Using a Standard Source Distribution - - To install MySQL from a standard source distribution: - - 1. Verify that your system satisfies the tool requirements - listed at Section 2.9, "Installing MySQL from Source." - - 2. Obtain a distribution file using the instructions in - Section 2.1.3, "How to Get MySQL." - - 3. Configure, build, and install the distribution using the - instructions in this section. - - 4. Perform postinstallation procedures using the - instructions in Section 2.10, "Postinstallation Setup and - Testing." - - In MySQL 5.6, CMake is used as the build framework on all - platforms. The instructions given here should enable you to - produce a working installation. For additional information on - using CMake to build MySQL, see How to Build MySQL Server - with CMake - (http://dev.mysql.com/doc/internals/en/cmake.html). - - If you start from a source RPM, use the following command to - make a binary RPM that you can install. If you do not have - rpmbuild, use rpm instead. -shell> rpmbuild --rebuild --clean MySQL-VERSION.src.rpm - - The result is one or more binary RPM packages that you - install as indicated in Section 2.5.5, "Installing MySQL on - Linux Using RPM Packages." - - The sequence for installation from a compressed tar file or - Zip archive source distribution is similar to the process for - installing from a generic binary distribution (see Section - 2.2, "Installing MySQL on Unix/Linux Using Generic - Binaries"), except that it is used on all platforms and - includes steps to configure and compile the distribution. For - example, with a compressed tar file source distribution on - Unix, the basic installation command sequence looks like - this: -# Preconfiguration setup -shell> groupadd mysql -shell> useradd -r -g mysql mysql -# Beginning of source-build specific instructions -shell> tar zxvf mysql-VERSION.tar.gz -shell> cd mysql-VERSION -shell> cmake . -shell> make -shell> make install -# End of source-build specific instructions -# Postinstallation setup -shell> cd /usr/local/mysql -shell> chown -R mysql . -shell> chgrp -R mysql . -shell> scripts/mysql_install_db --user=mysql -shell> chown -R root . -shell> chown -R mysql data -shell> bin/mysqld_safe --user=mysql & -# Next command is optional -shell> cp support-files/mysql.server /etc/init.d/mysql.server - - mysql_install_db creates a default option file named my.cnf - in the base installation directory. This file is created from - a template included in the distribution package named - my-default.cnf. For more information, see Section 5.1.2.2, - "Using a Sample Default Server Configuration File." - - A more detailed version of the source-build specific - instructions is shown following. - Note - - The procedure shown here does not set up any passwords for - MySQL accounts. After following the procedure, proceed to - Section 2.10, "Postinstallation Setup and Testing," for - postinstallation setup and testing. - -Perform Preconfiguration Setup - - On Unix, set up the mysql user and group that will be used to - run and execute the MySQL server and own the database - directory. For details, see Creating a mysql System User and - Group, in Section 2.2, "Installing MySQL on Unix/Linux Using - Generic Binaries." Then perform the following steps as the - mysql user, except as noted. - -Obtain and Unpack the Distribution - - Pick the directory under which you want to unpack the - distribution and change location into it. - - Obtain a distribution file using the instructions in Section - 2.1.3, "How to Get MySQL." - - Unpack the distribution into the current directory: - - * To unpack a compressed tar file, tar can uncompress and - unpack the distribution if it has z option support: -shell> tar zxvf mysql-VERSION.tar.gz - - If your tar does not have z option support, use gunzip to - unpack the distribution and tar to unpack it: -shell> gunzip < mysql-VERSION.tar.gz | tar xvf - - - Alternatively, CMake can uncompress and unpack the - distribution: -shell> cmake -E tar zxvf mysql-VERSION.tar.gz - - - * To unpack a Zip archive, use WinZip or another tool that - can read .zip files. - - Unpacking the distribution file creates a directory named - mysql-VERSION. - -Configure the Distribution - - Change location into the top-level directory of the unpacked - distribution: -shell> cd mysql-VERSION - - Configure the source directory. The minimum configuration - command includes no options to override configuration - defaults: -shell> cmake . - - On Windows, specify the development environment. For example, - the following commands configure MySQL for 32-bit or 64-bit - builds, respectively: -shell> cmake . -G "Visual Studio 10 2010" -shell> cmake . -G "Visual Studio 10 2010 Win64" - - On OS X, to use the Xcode IDE: -shell> cmake . -G Xcode - - When you run cmake, you might want to add options to the - command line. Here are some examples: - - * -DBUILD_CONFIG=mysql_release: Configure the source with - the same build options used by Oracle to produce binary - distributions for official MySQL releases. - - * -DCMAKE_INSTALL_PREFIX=dir_name: Configure the - distribution for installation under a particular - location. - - * -DCPACK_MONOLITHIC_INSTALL=1: Cause make package to - generate a single installation file rather than multiple - files. - - * -DWITH_DEBUG=1: Build the distribution with debugging - support. - - For a more extensive list of options, see Section 2.9.4, - "MySQL Source-Configuration Options." - - To list the configuration options, use one of the following - commands: -shell> cmake . -L # overview -shell> cmake . -LH # overview with help text -shell> cmake . -LAH # all params with help text -shell> ccmake . # interactive display - - If CMake fails, you might need to reconfigure by running it - again with different options. If you do reconfigure, take - note of the following: - - * If CMake is run after it has previously been run, it may - use information that was gathered during its previous - invocation. This information is stored in CMakeCache.txt. - When CMake starts up, it looks for that file and reads - its contents if it exists, on the assumption that the - information is still correct. That assumption is invalid - when you reconfigure. - - * Each time you run CMake, you must run make again to - recompile. However, you may want to remove old object - files from previous builds first because they were - compiled using different configuration options. - - To prevent old object files or configuration information from - being used, run these commands on Unix before re-running - CMake: -shell> make clean -shell> rm CMakeCache.txt - - Or, on Windows: -shell> devenv MySQL.sln /clean -shell> del CMakeCache.txt - - If you build out of the source tree (as described later), the - CMakeCache.txt file and all built files are in the build - directory, so you can remove that directory to object files - and cached configuration information. - - If you are going to send mail to a MySQL mailing list to ask - for configuration assistance, first check the files in the - CMakeFiles directory for useful information about the - failure. To file a bug report, please use the instructions in - Section 1.7, "How to Report Bugs or Problems." - -Build the Distribution - - On Unix: -shell> make -shell> make VERBOSE=1 - - The second command sets VERBOSE to show the commands for each - compiled source. - - Use gmake instead on systems where you are using GNU make and - it has been installed as gmake. - - On Windows: -shell> devenv MySQL.sln /build RelWithDebInfo - - It is possible to build out of the source tree to keep the - tree clean. If the top-level source directory is named - mysql-src under your current working directory, you can build - in a directory named bld at the same level like this: -shell> mkdir bld -shell> cd bld -shell> cmake ../mysql-src - - The build directory need not actually be outside the source - tree. For example, to build in a directory, you can build in - a directory named bld under the top-level source tree, do - this, starting with mysql-src as your current working - directory: -shell> mkdir bld -shell> cd bld -shell> cmake .. - - If you have multiple source trees at the same level (for - example, to build multiple versions of MySQL), the second - strategy can be advantageous. The first strategy places all - build directories at the same level, which requires that you - choose a unique name for each. With the second strategy, you - can use the same name for the build directory within each - source tree. - - If you have gotten to the compilation stage, but the - distribution does not build, see Section 2.9.5, "Dealing with - Problems Compiling MySQL," for help. If that does not solve - the problem, please enter it into our bugs database using the - instructions given in Section 1.7, "How to Report Bugs or - Problems." If you have installed the latest versions of the - required tools, and they crash trying to process our - configuration files, please report that also. However, if you - get a command not found error or a similar problem for - required tools, do not report it. Instead, make sure that all - the required tools are installed and that your PATH variable - is set correctly so that your shell can find them. - -Install the Distribution - - On Unix: -shell> make install - - This installs the files under the configured installation - directory (by default, /usr/local/mysql). You might need to - run the command as root. - - To install in a specific directory, add a DESTDIR parameter - to the command line: -shell> make install DESTDIR="/opt/mysql" - - Alternatively, generate installation package files that you - can install where you like: -shell> make package - - This operation produces one or more .tar.gz files that can be - installed like generic binary distribution packages. See - Section 2.2, "Installing MySQL on Unix/Linux Using Generic - Binaries." If you run CMake with - -DCPACK_MONOLITHIC_INSTALL=1, the operation produces a single - file. Otherwise, it produces multiple files. - - On Windows, generate the data directory, then create a .zip - archive installation package: -shell> devenv MySQL.sln /build RelWithDebInfo /project initial_databas -e -shell> devenv MySQL.sln /build RelWithDebInfo /project package - - You can install the resulting .zip archive where you like. - See Section 2.3.5, "Installing MySQL on Microsoft Windows - Using a noinstall Zip Archive." - -Perform Postinstallation Setup - - The remainder of the installation process involves setting up - the configuration file, creating the core databases, and - starting the MySQL server. For instructions, see Section - 2.10, "Postinstallation Setup and Testing." - Note - - The accounts that are listed in the MySQL grant tables - initially have no passwords. After starting the server, you - should set up passwords for them using the instructions in - Section 2.10, "Postinstallation Setup and Testing." - -2.9.3 Installing MySQL Using a Development Source Tree - - This section describes how to install MySQL from the latest - development source code, which is currently hosted on both - GitHub (https://github.com/) and Launchpad - (http://launchpad.net/). To obtain the MySQL Server source - code from one of these repository hosting services, you can - set up a local MySQL Git repository or a local MySQL Bazaar - branch. - - * On GitHub (https://github.com/), MySQL Server and other - MySQL projects are found on the MySQL - (https://github.com/mysql) page. The MySQL Server project - is a single repository that contains branches for MySQL - 5.5, 5.6, and 5.7. - MySQL officially joined GitHub in September, 2014. For - more information about MySQL's move to GitHub, refer to - the announcement on the MySQL Release Engineering blog: - MySQL on GitHub - (http://mysqlrelease.com/2014/09/mysql-on-github/) - - * On Launchpad (http://launchpad.net/), MySQL projects, - including MySQL Server, MySQL Workbench, and others are - found on the Oracle/MySQL Engineering - (http://launchpad.net/~mysql) page. For the repositories - related only to MySQL Server, see the MySQL Server - (http://launchpad.net/mysql-server) page. - -Prerequisites for Installing from Development Source - - To install MySQL from a development source tree, your system - must satisfy the tool requirements outlined in Section 2.9, - "Installing MySQL from Source." - -Setting Up a MySQL Git Repository - - To set up a MySQL Git repository on your machine, use this - procedure: - - 1. Clone the MySQL Git repository to your machine. The - following command clones the MySQL Git repository to a - directory named mysql-server. The download size is - approximately 437 MB. The initial download will take some - time to complete, depending on the speed of your - connection. -~$ git clone https://github.com/mysql/mysql-server.git -Cloning into 'mysql-server'... -remote: Counting objects: 1035465, done. -remote: Total 1035465 (delta 0), reused 0 (delta 0) -Receiving objects: 100% (1035465/1035465), 437.48 MiB | 5.10 MiB/s, do -ne. -Resolving deltas: 100% (855607/855607), done. -Checking connectivity... done. -Checking out files: 100% (21902/21902), done. - - 2. When the clone operation completes, the contents of your - local MySQL Git repository appear similar to the - following: -~$ cd mysql-server - -~/mysql-server$ ls -BUILD COPYING libmysqld regex tests -BUILD-CMAKE dbug libservices scripts unitt -est -client Docs man sql VERSI -ON -cmake extra mysql-test sql-bench vio -CMakeLists.txt include mysys sql-common win -cmd-line-utils INSTALL-SOURCE packaging storage zlib -config.h.cmake INSTALL-WIN-SOURCE plugin strings -configure.cmake libmysql README support-files - - 3. Use the git branch -r command to view the remote tracking - branches for the MySQL repository. -~/mysql-server$ git branch -r - origin/5.5 - origin/5.6 - origin/5.7 - origin/HEAD -> origin/5.7 - - 4. To view the branches that are checked out in your local - repository, issue the git branch command. When you cloned - the MySQL Git repository, the MySQL 5.7 branch was - checked out automatically. The asterisk identifies the - 5.7 branch as the active branch. -~/mysql-server$ git branch -* 5.7 - - 5. To check out a different MySQL branch, run the git - checkout command, specifying the branch name. For - example, to checkout the MySQL 5.6 branch: -~/mysql-server$ git checkout 5.6 -Branch 5.6 set up to track remote branch 5.6 from origin. -Switched to a new branch '5.6' - - 6. Run git branch again to verify that the MySQL 5.6 branch - is present. MySQL 5.6, which is the last branch you - checked out, is marked by an asterisk indicating that it - is the active branch. -~/mysql-server$ git branch -* 5.6 - 5.7 - The git checkout command is also used to switch branches. - For example, to make MySQL 5.7 the active branch again, - you would run git checkout 5.7. - - 7. To obtain changes made after your initial setup of the - MySQL Git repository, switch to the branch you want to - update and issue the git pull command: -~/mysql-server$ git checkout 5.6 -~/mysql-server$ git pull - - To examine the commit history, use the git log option: -~/mysql-server$ git log - - You can also browse commit history and source code on the - GitHub MySQL (https://github.com/mysql) site. - If you see changes or code that you have a question - about, send an email to the MySQL internals mailing list. - See Section 1.6.1, "MySQL Mailing Lists." For information - about contributing a patch, see Contributing to MySQL - Server - (http://mysqlserverteam.com/contributing-to-mysql-server/ - ). - - 8. After you have cloned the MySQL Git repository and have - checked out the branch you want to build, you can build - MySQL Server from the source code. Instructions are - provided in Section 2.9.2, "Installing MySQL Using a - Standard Source Distribution," except that you skip the - part about obtaining and unpacking the distribution. - Be careful about installing a build from a distribution - source tree on a production machine. The installation - command may overwrite your live release installation. If - you already have MySQL installed and do not want to - overwrite it, run CMake with values for the - CMAKE_INSTALL_PREFIX, MYSQL_TCP_PORT, and MYSQL_UNIX_ADDR - options different from those used by your production - server. For additional information about preventing - multiple servers from interfering with each other, see - Section 5.3, "Running Multiple MySQL Instances on One - Machine." - Play hard with your new installation. For example, try to - make new features crash. Start by running make test. See - Section 24.1.2, "The MySQL Test Suite." - -Setting Up a MySQL Bazaar Branch - - To setup a MySQL Bazaar branch on your machine, use this - procedure: - - 1. To obtain a copy of the MySQL development source code - hosted on Launchpad (http://launchpad.net/), create a new - Bazaar branch. If you do not already have a Bazaar - repository directory set up, you must initialize a new - directory: -shell> mkdir mysql-server -shell> bzr init-repo --trees mysql-server - - This is a one-time operation. - - 2. Assuming that you have an initialized repository - directory, you can branch from the public MySQL server - repositories to create a local source tree. To create a - branch of a specific version: -shell> cd mysql-server -shell> bzr branch lp:mysql-server/5.6 mysql-5.6 - - This is a one-time operation per source tree. You can - branch the source trees for several versions of MySQL - under the mysql-server directory. - The initial download will take some time to complete, - depending on the speed of your connection. Once you have - downloaded the first tree, additional trees should take - significantly less time to download. - - 3. When building from the Bazaar branch, you may want to - create a copy of your active branch so that you can make - configuration and other changes without affecting the - original branch contents. You can achieve this by - branching from the original branch: -shell> bzr branch mysql-5.6 mysql-5.6-build - - - 4. To obtain changes made after you have set up the branch - initially, update it using the pull option periodically. - Use this command in the top-level directory of the local - copy: -shell> bzr pull - - To examine the changeset comments for the tree, use the - log option to bzr: -shell> bzr log - - You can also browse changesets, comments, and source code - online at the Launchpad MySQL Server - (http://launchpad.net/mysql-server) page. - If you see diffs (changes) or code that you have a - question about, do not hesitate to send email to the - MySQL internals mailing list. See Section 1.6.1, "MySQL - Mailing Lists." For information about contributing at - patch, see Contributing to MySQL Server - (http://mysqlserverteam.com/contributing-to-mysql-server/ - ). - - 5. After you have the local branch, you can build MySQL - server from the source code. Instructions are provided in - Section 2.9.2, "Installing MySQL Using a Standard Source - Distribution," except that you skip the part about - obtaining and unpacking the distribution. - Be careful about installing a build from a distribution - source tree on a production machine. The installation - command may overwrite your live release installation. If - you already have MySQL installed and do not want to - overwrite it, run CMake with values for the - CMAKE_INSTALL_PREFIX, MYSQL_TCP_PORT, and MYSQL_UNIX_ADDR - options different from those used by your production - server. For additional information about preventing - multiple servers from interfering with each other, see - Section 5.3, "Running Multiple MySQL Instances on One - Machine." - Play hard with your new installation. For example, try to - make new features crash. Start by running make test. See - Section 24.1.2, "The MySQL Test Suite." - -2.9.4 MySQL Source-Configuration Options - - The CMake program provides a great deal of control over how - you configure a MySQL source distribution. Typically, you do - this using options on the CMake command line. For information - about options supported by CMake, run either of these - commands in the top-level source directory: -shell> cmake . -LH -shell> ccmake . - - You can also affect CMake using certain environment - variables. See Section 2.12, "Environment Variables." - - The following table shows the available CMake options. In the - Default column, PREFIX stands for the value of the - CMAKE_INSTALL_PREFIX option, which specifies the installation - base directory. This value is used as the parent location for - several of the installation subdirectories. - - Table 2.11 MySQL Source-Configuration Option Reference - (CMake) - Formats Description Default Introduced Removed - BUILD_CONFIG Use same build options as official releases - CMAKE_BUILD_TYPE Type of build to produce RelWithDebInfo - CMAKE_C_FLAGS Flags for C Compiler - CMAKE_CXX_FLAGS Flags for C++ Compiler - CMAKE_INSTALL_PREFIX Installation base directory - /usr/local/mysql - COMPILATION_COMMENT Comment about compilation environment - CPACK_MONOLITHIC_INSTALL Whether package build produces - single file OFF - DEFAULT_CHARSET The default server character set latin1 - DEFAULT_COLLATION The default server collation - latin1_swedish_ci - ENABLE_DEBUG_SYNC Whether to enable Debug Sync support ON - ENABLE_DOWNLOADS Whether to download optional files OFF - ENABLE_DTRACE Whether to include DTrace support - ENABLE_GCOV Whether to include gcov support 5.6.3 - ENABLE_GPROF Enable gprof (optimized Linux builds only) OFF - 5.6.6 - ENABLED_LOCAL_INFILE Whether to enable LOCAL for LOAD DATA - INFILE OFF - ENABLED_PROFILING Whether to enable query profiling code ON - - IGNORE_AIO_CHECK With -DBUILD_CONFIG=mysql_release, ignore - libaio check OFF 5.6.1 - INNODB_PAGE_ATOMIC_REF_COUNT Enable or disable atomic page - reference counting ON 5.6.16 - INSTALL_BINDIR User executables directory PREFIX/bin - INSTALL_DOCDIR Documentation directory PREFIX/docs - INSTALL_DOCREADMEDIR README file directory PREFIX - INSTALL_INCLUDEDIR Header file directory PREFIX/include - INSTALL_INFODIR Info file directory PREFIX/docs - INSTALL_LAYOUT Select predefined installation layout - STANDALONE - INSTALL_LIBDIR Library file directory PREFIX/lib - INSTALL_MANDIR Manual page directory PREFIX/man - INSTALL_MYSQLSHAREDIR Shared data directory PREFIX/share - INSTALL_MYSQLTESTDIR mysql-test directory PREFIX/mysql-test - - INSTALL_PLUGINDIR Plugin directory PREFIX/lib/plugin - INSTALL_SBINDIR Server executable directory PREFIX/bin - INSTALL_SCRIPTDIR Scripts directory PREFIX/scripts - INSTALL_SHAREDIR aclocal/mysql.m4 installation directory - PREFIX/share - INSTALL_SQLBENCHDIR sql-bench directory PREFIX - INSTALL_SUPPORTFILESDIR Extra support files directory - PREFIX/support-files - MEMCACHED_HOME Path to memcached [none] - MYSQL_DATADIR Data directory - MYSQL_MAINTAINER_MODE Whether to enable MySQL - maintainer-specific development environment OFF - MYSQL_PROJECT_NAME Windows/OS X project name 3306 5.6.5 - MYSQL_TCP_PORT TCP/IP port number 3306 - MYSQL_UNIX_ADDR Unix socket file /tmp/mysql.sock - ODBC_INCLUDES ODBC includes directory - ODBC_LIB_DIR ODBC library directory - OPTIMIZER_TRACE Whether to support optimizer tracing 5.6.3 - SUNPRO_CXX_LIBRARY Client link library on Solaris 10+ 5.6.20 - - SYSCONFDIR Option file directory - TMPDIR tmpdir default value 5.6.16 - WITH_ASAN Enable AddressSanitizer OFF 5.6.15 - WITH_BUNDLED_LIBEVENT Use bundled libevent when building - ndbmemcache ON - WITH_BUNDLED_MEMCACHED Use bundled memcached when building - ndbmemcache ON - WITH_CLASSPATH Classpath to use when building MySQL Cluster - Connector for Java. Default is an empty string. - WITH_DEBUG Whether to include debugging support OFF - WITH_DEFAULT_COMPILER_OPTIONS Whether to use default compiler - options ON 5.6.6 - WITH_DEFAULT_FEATURE_SET Whether to use default feature set - ON 5.6.6 - WITH_EDITLINE Which libedit/editline library to use bundled - 5.6.12 - WITH_EMBEDDED_SERVER Whether to build embedded server OFF - WITH_EMBEDDED_SHARED_LIBRARY Whether to build a shared - embedded server library OFF 5.6.17 - WITH_xxx_STORAGE_ENGINE Compile storage engine xxx statically - into server - WITH_ERROR_INSERT Enable error injection in the NDB storage - engine. Should not be used for building binaries intended for - production. OFF - WITH_EXTRA_CHARSETS Which extra character sets to include all - - WITH_INNODB_MEMCACHED Whether to generate memcached shared - libraries. OFF - WITH_LIBEDIT Use bundled libedit library ON 5.6.12 - WITH_LIBEVENT Which libevent library to use bundled 5.6.6 - WITH_LIBWRAP Whether to include libwrap (TCP wrappers) - support OFF - WITH_NDB_BINLOG Enable binary logging by default by mysqld. - ON - WITH_NDB_DEBUG Produce a debug build for testing or - troubleshooting. OFF - WITH_NDB_JAVA Enable building of Java and ClusterJ support. - Enabled by default. Supported in MySQL Cluster only. ON - WITH_NDB_PORT Default port used by a management server built - with this option. If this option was not used to build it, - the management server's default port is 1186. [none] - WITH_NDB_TEST Include NDB API test programs. OFF - WITH_NDBCLUSTER_STORAGE_ENGINE Build the NDB storage engine - ON - WITH_NDBMTD Build multi-threaded data node. ON - WITH_READLINE Use bundled readline library OFF 5.6.5 - WITH_SSL Type of SSL support no - WITH_UNIXODBC Enable unixODBC support OFF - WITH_VALGRIND Whether to compile in Valgrind header files OFF - - WITH_ZLIB Type of zlib support system - WITHOUT_xxx_STORAGE_ENGINE Exclude storage engine xxx from - build - WITHOUT_SERVER Do not build the server OFF - - The following sections provide more information about CMake - options. - - * Section 2.9.4, "" - - * Section 2.9.4, "" - - * Section 2.9.4, "" - - * Section 2.9.4, "" - - * Section 2.9.4, "" - - For boolean options, the value may be specified as 1 or ON to - enable the option, or as 0 or OFF to disable the option. - - Many options configure compile-time defaults that can be - overridden at server startup. For example, the - CMAKE_INSTALL_PREFIX, MYSQL_TCP_PORT, and MYSQL_UNIX_ADDR - options that configure the default installation base - directory location, TCP/IP port number, and Unix socket file - can be changed at server startup with the --basedir, --port, - and --socket options for mysqld. Where applicable, - configuration option descriptions indicate the corresponding - mysqld startup option. - -General Options - - - * -DBUILD_CONFIG=mysql_release - This option configures a source distribution with the - same build options used by Oracle to produce binary - distributions for official MySQL releases. - - * -DCMAKE_BUILD_TYPE=type - The type of build to produce: - - + RelWithDebInfo: Enable optimizations and generate - debugging information. This is the default MySQL - build type. - - + Debug: Disable optimizations and generate debugging - information. This build type is also used if the - WITH_DEBUG option is enabled. That is, - -DWITH_DEBUG=1 has the same effect as - -DCMAKE_BUILD_TYPE=Debug. - - * -DCPACK_MONOLITHIC_INSTALL=bool - This option affects whether the make package operation - produces multiple installation package files or a single - file. If disabled, the operation produces multiple - installation package files, which may be useful if you - want to install only a subset of a full MySQL - installation. If enabled, it produces a single file for - installing everything. - -Installation Layout Options - - The CMAKE_INSTALL_PREFIX option indicates the base - installation directory. Other options with names of the form - INSTALL_xxx that indicate component locations are interpreted - relative to the prefix and their values are relative - pathnames. Their values should not include the prefix. - - * -DCMAKE_INSTALL_PREFIX=dir_name - The installation base directory. - This value can be set at server startup with the - --basedir option. - - * -DINSTALL_BINDIR=dir_name - Where to install user programs. - - * -DINSTALL_DOCDIR=dir_name - Where to install documentation. - - * -DINSTALL_DOCREADMEDIR=dir_name - Where to install README files. - - * -DINSTALL_INCLUDEDIR=dir_name - Where to install header files. - - * -DINSTALL_INFODIR=dir_name - Where to install Info files. - - * -DINSTALL_LAYOUT=name - Select a predefined installation layout: - - + STANDALONE: Same layout as used for .tar.gz and .zip - packages. This is the default. - - + RPM: Layout similar to RPM packages. - - + SVR4: Solaris package layout. - - + DEB: DEB package layout (experimental). - You can select a predefined layout but modify individual - component installation locations by specifying other - options. For example: -shell> cmake . -DINSTALL_LAYOUT=SVR4 -DMYSQL_DATADIR=/var/mysql/data - - - * -DINSTALL_LIBDIR=dir_name - Where to install library files. - - * -DINSTALL_MANDIR=dir_name - Where to install manual pages. - - * -DINSTALL_MYSQLSHAREDIR=dir_name - Where to install shared data files. - - * -DINSTALL_MYSQLTESTDIR=dir_name - Where to install the mysql-test directory. As of MySQL - 5.6.12, to suppress installation of this directory, - explicitly set the option to the empty value - (-DINSTALL_MYSQLTESTDIR=). - - * -DINSTALL_PLUGINDIR=dir_name - The location of the plugin directory. - This value can be set at server startup with the - --plugin_dir option. - - * -DINSTALL_SBINDIR=dir_name - Where to install the mysqld server. - - * -DINSTALL_SCRIPTDIR=dir_name - Where to install mysql_install_db. - - * -DINSTALL_SHAREDIR=dir_name - Where to install aclocal/mysql.m4. - - * -DINSTALL_SQLBENCHDIR=dir_name - Where to install the sql-bench directory. To suppress - installation of this directory, explicitly set the option - to the empty value (-DINSTALL_SQLBENCHDIR=). - - * -DINSTALL_SUPPORTFILESDIR=dir_name - Where to install extra support files. - - * -DMYSQL_DATADIR=dir_name - The location of the MySQL data directory. - This value can be set at server startup with the - --datadir option. - - * -DODBC_INCLUDES=dir_name - The location of the ODBC includes directory, and may be - used while configuring Connector/ODBC. - - * -DODBC_LIB_DIR=dir_name - The location of the ODBC library directory, and may be - used while configuring Connector/ODBC. - - * -DSYSCONFDIR=dir_name - The default my.cnf option file directory. - This location cannot be set at server startup, but you - can start the server with a given option file using the - --defaults-file=file_name option, where file_name is the - full path name to the file. - - * -DTMPDIR=dir_name - The default location to use for the tmpdir system - variable. If unspecified, the value defaults to P_tmpdir - in . This option was added in MySQL 5.6.16. - -Storage Engine Options - - Storage engines are built as plugins. You can build a plugin - as a static module (compiled into the server) or a dynamic - module (built as a dynamic library that must be installed - into the server using the INSTALL PLUGIN statement or the - --plugin-load option before it can be used). Some plugins - might not support static or dynamic building. - - The MyISAM, MERGE, MEMORY, and CSV engines are mandatory - (always compiled into the server) and need not be installed - explicitly. - - To compile a storage engine statically into the server, use - -DWITH_engine_STORAGE_ENGINE=1. Some permissible engine - values are ARCHIVE, BLACKHOLE, EXAMPLE, FEDERATED, INNOBASE - (InnoDB), NDB or NDBCLUSTER (NDB), PARTITION (partitioning - support), and PERFSCHEMA (Performance Schema). Examples: --DWITH_INNOBASE_STORAGE_ENGINE=1 --DWITH_ARCHIVE_STORAGE_ENGINE=1 --DWITH_BLACKHOLE_STORAGE_ENGINE=1 --DWITH_PERFSCHEMA_STORAGE_ENGINE=1 - - Note - - WITH_NDBCLUSTER_STORAGE_ENGINE is supported only when - building MySQL Cluster using the MySQL Cluster sources. It - cannot be used to enable clustering support in other MySQL - source trees or distributions. In MySQL Cluster source - distributions, it is enabled by default. See Section - 18.2.2.3, "Building MySQL Cluster from Source on Linux," and - Section 18.2.3.2, "Compiling and Installing MySQL Cluster - from Source on Windows," for more information. - - To exclude a storage engine from the build, use - -DWITHOUT_engine_STORAGE_ENGINE=1. Examples: --DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 --DWITHOUT_FEDERATED_STORAGE_ENGINE=1 --DWITHOUT_PARTITION_STORAGE_ENGINE=1 - - If neither -DWITH_engine_STORAGE_ENGINE nor - -DWITHOUT_engine_STORAGE_ENGINE are specified for a given - storage engine, the engine is built as a shared module, or - excluded if it cannot be built as a shared module. - -Feature Options - - - * -DCOMPILATION_COMMENT=string - A descriptive comment about the compilation environment. - - * -DDEFAULT_CHARSET=charset_name - The server character set. By default, MySQL uses the - latin1 (cp1252 West European) character set. - charset_name may be one of binary, armscii8, ascii, big5, - cp1250, cp1251, cp1256, cp1257, cp850, cp852, cp866, - cp932, dec8, eucjpms, euckr, gb2312, gbk, geostd8, greek, - hebrew, hp8, keybcs2, koi8r, koi8u, latin1, latin2, - latin5, latin7, macce, macroman, sjis, swe7, tis620, - ucs2, ujis, utf8, utf8mb4, utf16, utf16le, utf32. The - permissible character sets are listed in the - cmake/character_sets.cmake file as the value of - CHARSETS_AVAILABLE. - This value can be set at server startup with the - --character_set_server option. - - * -DDEFAULT_COLLATION=collation_name - The server collation. By default, MySQL uses - latin1_swedish_ci. Use the SHOW COLLATION statement to - determine which collations are available for each - character set. - This value can be set at server startup with the - --collation_server option. - - * -DENABLE_DEBUG_SYNC=bool - Whether to compile the Debug Sync facility into the - server. This facility is used for testing and debugging. - This option is enabled by default, but has no effect - unless MySQL is configured with debugging enabled. If - debugging is enabled and you want to disable Debug Sync, - use -DENABLE_DEBUG_SYNC=0. - When compiled in, Debug Sync is disabled by default at - runtime. To enable it, start mysqld with the - --debug-sync-timeout=N option, where N is a timeout value - greater than 0. (The default value is 0, which disables - Debug Sync.) N becomes the default timeout for individual - synchronization points. - For a description of the Debug Sync facility and how to - use synchronization points, see MySQL Internals: Test - Synchronization - (http://dev.mysql.com/doc/internals/en/test-synchronizati - on.html). - - * -DENABLE_DOWNLOADS=bool - Whether to download optional files. For example, with - this option enabled, CMake downloads the Google Test - distribution that is used by the test suite to run unit - tests. - - * -DENABLE_DTRACE=bool - Whether to include support for DTrace probes. For - information about DTrace, wee Section 5.4, "Tracing - mysqld Using DTrace" - - * -DENABLE_GCOV=bool - Whether to include gcov support (Linux only). - - * -DENABLE_GPROF=bool - Whether to enable gprof (optimized Linux builds only). - This option was added in MySQL 5.6.6. - - * -DENABLED_LOCAL_INFILE=bool - Whether to enable LOCAL capability in the client library - for LOAD DATA INFILE. - This option controls client-side LOCAL capability, but - the capability can be set on the server side at server - startup with the --local-infile option. See Section - 6.1.6, "Security Issues with LOAD DATA LOCAL." - - * -DENABLED_PROFILING=bool - Whether to enable query profiling code (for the SHOW - PROFILE and SHOW PROFILES statements). - - * -DIGNORE_AIO_CHECK=bool - If the -DBUILD_CONFIG=mysql_release option is given on - Linux, the libaio library must be linked in by default. - If you do not have libaio or do not want to install it, - you can suppress the check for it by specifying - -DIGNORE_AIO_CHECK=1. This option was added in MySQL - 5.6.1. - - * -DINNODB_PAGE_ATOMIC_REF_COUNT=bool - Whether to enable or disable atomic page reference - counting. Fetching and releasing pages from the buffer - pool and tracking the page state are expensive and - complex operations. Using a page mutex to track these - operations does not scale well. With - INNODB_PAGE_ATOMIC_REF_COUNT=ON (default), fetch and - release is tracked using atomics where available. For - platforms that do not support atomics, set - INNODB_PAGE_ATOMIC_REF_COUNT=OFF to disable atomic page - reference counting. - When atomic page reference counting is enabled (default), - "[Note] InnoDB: Using atomics to ref count buffer pool - pages" is printed to the error log at server startup. If - atomic page reference counting is disabled, "[Note] - InnoDB: Using mutexes to ref count buffer pool pages" is - printed instead. - INNODB_PAGE_ATOMIC_REF_COUNT was introduced with the fix - for MySQL Bug #68079. The option is removed in MySQL - 5.7.5. Support for atomics is required to build MySQL as - of MySQL 5.7.5, which makes the option obsolete. - - * -DMYSQL_MAINTAINER_MODE=bool - Whether to enable a MySQL maintainer-specific development - environment. If enabled, this option causes compiler - warnings to become errors. - - * -DMYSQL_PROJECT_NAME=name - For Windows or OS X, the project name to incorporate into - the project file name. This option was added in MySQL - 5.6.5. - - * -DMYSQL_TCP_PORT=port_num - The port number on which the server listens for TCP/IP - connections. The default is 3306. - This value can be set at server startup with the --port - option. - - * -DMYSQL_UNIX_ADDR=file_name - The Unix socket file path on which the server listens for - socket connections. This must be an absolute path name. - The default is /tmp/mysql.sock. - This value can be set at server startup with the --socket - option. - - * -DOPTIMIZER_TRACE=bool - Whether to support optimizer tracing. See MySQL - Internals: Tracing the Optimizer - (http://dev.mysql.com/doc/internals/en/optimizer-tracing. - html). This option was added in MySQL 5.6.3. - - * -DWITH_ASAN=bool - Whether to enable AddressSanitizer, for compilers that - support it. The default is off. This option was added in - MySQL 5.6.15. - - * -DWITH_DEBUG=bool - Whether to include debugging support. - Configuring MySQL with debugging support enables you to - use the --debug="d,parser_debug" option when you start - the server. This causes the Bison parser that is used to - process SQL statements to dump a parser trace to the - server's standard error output. Typically, this output is - written to the error log. - - * -DWITH_DEFAULT_FEATURE_SET=bool - Whether to use the flags from - cmake/build_configurations/feature_set.cmake. This option - was added in MySQL 5.6.6. - - * -DWITH_EDITLINE=value - Which libedit/editline library to use. The permitted - values are bundled (the default) and system. - WITH_EDITLINE was added in MySQL 5.6.12. It replaces - WITH_LIBEDIT, which has been removed. - - * -DWITH_EMBEDDED_SERVER=bool - Whether to build the libmysqld embedded server library. - - * -DWITH_EMBEDDED_SHARED_LIBRARY=bool - Whether to build a shared libmysqld embedded server - library. This option was added in MySQL 5.6.17. - - * -DWITH_EXTRA_CHARSETS=name - Which extra character sets to include: - - + all: All character sets. This is the default. - - + complex: Complex character sets. - - + none: No extra character sets. - - * -DWITH_INNODB_MEMCACHED=bool - Whether to generate memcached shared libraries - (libmemcached.so and innodb_engine.so). - - * -DWITH_LIBEVENT=string - Which libevent library to use. Permitted values are - bundled (default), system, and yes. If you specify system - or yes, the system libevent library is used if present. - If the system library is not found, the bundled libevent - library is used. The libevent library is required by - InnoDB memcached. - - * -DWITH_LIBEDIT=bool - Whether to use the libedit library bundled with the - distribution. - WITH_LIBEDIT was removed in MySQL 5.6.12. Use - WITH_EDITLINE instead. - - * -DWITH_LIBWRAP=bool - Whether to include libwrap (TCP wrappers) support. - - * -DWITH_READLINE=bool - Whether to use the readline library bundled with the - distribution. This option was removed in MySQL 5.6.5 - because readline is no longer bundled. - - * -DWITH_SSL={ssl_type|path_name} - - * The type of SSL support to include (if any) or the path - name to the OpenSSL installation to use. - - + ssl_type can be one of the following values: - o no: No SSL support. This is the default before - MySQL 5.6.6. As of 5.6.6, this is no longer a - permitted value and the default is bundled. - o yes: Use the system SSL library if present, - else the library bundled with the distribution. - o bundled: Use the SSL library bundled with the - distribution. This is the default as of MySQL - 5.6.6. - o system: Use the system SSL library. - - + path_name, permitted for MySQL 5.6.7 and after, is - the path name to the OpenSSL installation to use. - Using this can be preferable to using the ssl_type - value of system, for it can prevent CMake from - detecting and using an older or incorrect OpenSSL - version installed on the system. (Another permitted - way to do the same thing is to set the - CMAKE_PREFIX_PATH option to path_name.) - For information about using SSL support, see Section - 6.3.10, "Using SSL for Secure Connections." - - * -DWITH_UNIXODBC=1 - Enables unixODBC support, for Connector/ODBC. - - * -DWITH_VALGRIND=bool - Whether to compile in the Valgrind header files, which - exposes the Valgrind API to MySQL code. The default is - OFF. - To generate a Valgrind-aware debug build, - -DWITH_VALGRIND=1 normally is combined with - -DWITH_DEBUG=1. See Building Debug Configurations - (http://dev.mysql.com/doc/internals/en/debug-configuratio - ns.html). - - * -DWITH_ZLIB=zlib_type - Some features require that the server be built with - compression library support, such as the COMPRESS() and - UNCOMPRESS() functions, and compression of the - client/server protocol. The WITH_ZLIB indicates the - source of zlib support: - - + bundled: Use the zlib library bundled with the - distribution. - - + system: Use the system zlib library. This is the - default. - - * -DWITHOUT_SERVER=bool - Whether to build without the MySQL server. The default is - OFF, which does build the server. - -Compiler Flags - - - * -DCMAKE_C_FLAGS="flags" - Flags for the C Compiler. - - * -DCMAKE_CXX_FLAGS="flags" - Flags for the C++ Compiler. - - * -DWITH_DEFAULT_COMPILER_OPTIONS=bool - Whether to use the flags from - cmake/build_configurations/compiler_options.cmake. This - option was added in MySQL 5.6.6. - Note - All optimization flags were carefully chosen and tested - by the MySQL build team. Overriding them can lead to - unexpected results and is done at your own risk. - - * -DSUNPRO_CXX_LIBRARY="lib_name" - Enable linking against libCstd instead of stlport4 on - Solaris 10 or later. This works only for client code - because the server depends on C++98. Example usage: -cmake -DWITHOUT_SERVER=1 -DSUNPRO_CXX_LIBRARY=Cstd - - This option was added in MySQL 5.6.20. - - To specify your own C and C++ compiler flags, for flags that - do not affect optimization, use the CMAKE_C_FLAGS and - CMAKE_CXX_FLAGS CMake options. - - When providing your own compiler flags, you might want to - specify CMAKE_BUILD_TYPE as well. - - For example, to create a 32-bit release build on a 64-bit - Linux machine, do this: -shell> mkdir bld -shell> cd bld -shell> cmake .. -DCMAKE_C_FLAGS=-m32 \ - -DCMAKE_CXX_FLAGS=-m32 \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo - - If you set flags that affect optimization (-Onumber), you - must set the CMAKE_C_FLAGS_build_type and/or - CMAKE_CXX_FLAGS_build_type options, where build_type - corresponds to the CMAKE_BUILD_TYPE value. To specify a - different optimization for the default build type - (RelWithDebInfo) set the CMAKE_C_FLAGS_RELWITHDEBINFO and - CMAKE_CXX_FLAGS_RELWITHDEBINFO options. For example, to - compile on Linux with -O3 and with debug symbols, do this: -shell> cmake .. -DCMAKE_C_FLAGS_RELWITHDEBINFO="-O3 -g" \ - -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-O3 -g" - -CMake Options for Compiling MySQL Cluster - - The following options are for use when building MySQL Cluster - with the MySQL Cluster sources; they are not currently - supported when using sources from the MySQL 5.6 Server tree. - - * -DMEMCACHED_HOME=path - Perform the build using the memcached (version 1.6 or - later) installed in the system directory indicated by - path. Files from this installation that are used in the - build include the memcached binary, header files, and - libraries, as well as the memcached_utilities library and - the header file engine_testapp.h. - You must leave this option unset when building - ndbmemcache using the bundled memcached sources - (WITH_BUNDLED_MEMCACHED option); in other words, the - bundled sources are used by default). - This option was added in MySQL Cluster NDB 7.2.2. - While additional CMake options---such as for SASL - authorization and for providing dtrace support---are - available for use when compiling memcached from external - sources, these options are currently not enabled for the - memcached sources bundled with MySQL Cluster. - - * -DWITH_BUNDLED_LIBEVENT={ON|OFF} - Use the libevent included in the MySQL Cluster sources - when building MySQL Cluster with ndbmemcached support - (MySQL Cluster NDB 7.2.2 and later). Enabled by default. - OFF causes the system's libevent to be used instead. - - * -DWITH_BUNDLED_MEMCACHED={ON|OFF} - Build the memcached sources included in the MySQL Cluster - source tree (MySQL Cluster NDB 7.2.3 and later), then use - the resulting memcached server when building the - ndbmemcache engine. In this case, make install places the - memcached binary in the installation bin directory, and - the ndbmemcache engine shared object file ndb_engine.so - in the installation lib directory. - This option is ON by default. - - * -DWITH_CLASSPATH=path - Sets the classpath for building MySQL Cluster Connector - for Java. The default is empty. In MySQL Cluster NDB - 7.2.9 and later, this option is ignored if - -DWITH_NDB_JAVA=OFF is used. - - * -DWITH_ERROR_INSERT={ON|OFF} - Enables error injection in the NDB kernel. For testing - only; not intended for use in building production - binaries. The default is OFF. - - * -DWITH_NDBCLUSTER_STORAGE_ENGINE={ON|OFF} - Build and link in support for the NDB (NDBCLUSTER) - storage engine in mysqld. The default is ON. - - * -DWITH_NDBCLUSTER={ON|OFF} - This is an alias for WITH_NDBCLUSTER_STORAGE_ENGINE. - - * -DWITH_NDBMTD={ON|OFF} - Build the multi-threaded data node executable ndbmtd. The - default is ON. - - * -DWITH_NDB_BINLOG={ON|OFF} - Enable binary logging by default in the mysqld built - using this option. ON by default. - - * -DWITH_NDB_DEBUG={ON|OFF} - Enable building the debug versions of the MySQL Cluster - binaries. OFF by default. - - * -DWITH_NDB_JAVA={ON|OFF} - Enable building MySQL Cluster with Java support, - including ClusterJ. - This option was added in MySQL Cluster NDB 7.2.9, and is - ON by default. If you do not wish to compile MySQL - Cluster with Java support, you must disable it explicitly - by specifying -DWITH_NDB_JAVA=OFF when running CMake. - Otherwise, if Java cannot be found, configuration of the - build fails. - - * -DWITH_NDB_PORT=port - Causes the MySQL Cluster management server (ndb_mgmd) - that is built to use this port by default. If this option - is unset, the resulting management server tries to use - port 1186 by default. - - * -DWITH_NDB_TEST={ON|OFF} - If enabled, include a set of NDB API test programs. The - default is OFF. - -2.9.5 Dealing with Problems Compiling MySQL - - The solution to many problems involves reconfiguring. If you - do reconfigure, take note of the following: - - * If CMake is run after it has previously been run, it may - use information that was gathered during its previous - invocation. This information is stored in CMakeCache.txt. - When CMake starts up, it looks for that file and reads - its contents if it exists, on the assumption that the - information is still correct. That assumption is invalid - when you reconfigure. - - * Each time you run CMake, you must run make again to - recompile. However, you may want to remove old object - files from previous builds first because they were - compiled using different configuration options. - - To prevent old object files or configuration information from - being used, run the following commands before re-running - CMake: - - On Unix: -shell> make clean -shell> rm CMakeCache.txt - - On Windows: -shell> devenv MySQL.sln /clean -shell> del CMakeCache.txt - - If you build outside of the source tree, remove and recreate - your build directory before re-running CMake. For - instructions on building outside of the source tree, see How - to Build MySQL Server with CMake - (http://dev.mysql.com/doc/internals/en/cmake.html). - - On some systems, warnings may occur due to differences in - system include files. The following list describes other - problems that have been found to occur most often when - compiling MySQL: - - * To define which C and C++ compilers to use, you can - define the CC and CXX environment variables. For example: -shell> CC=gcc -shell> CXX=g++ -shell> export CC CXX - - To specify your own C and C++ compiler flags, use the - CMAKE_C_FLAGS and CMAKE_CXX_FLAGS CMake options. See - Section 2.9.4, "." - To see what flags you might need to specify, invoke - mysql_config with the --cflags and --cxxflags options. - - * To see what commands are executed during the compile - stage, after using CMake to configure MySQL, run make - VERBOSE=1 rather than just make. - - * If compilation fails, check whether the - MYSQL_MAINTAINER_MODE option is enabled. This mode causes - compiler warnings to become errors, so disabling it may - enable compilation to proceed. - - * If your compile fails with errors such as any of the - following, you must upgrade your version of make to GNU - make: -make: Fatal error in reader: Makefile, line 18: -Badly formed macro assignment - - Or: -make: file `Makefile' line 18: Must be a separator (: - - Or: -pthread.h: No such file or directory - - Solaris and FreeBSD are known to have troublesome make - programs. - GNU make 3.75 is known to work. - - * The sql_yacc.cc file is generated from sql_yacc.yy. - Normally, the build process does not need to create - sql_yacc.cc because MySQL comes with a pregenerated copy. - However, if you do need to re-create it, you might - encounter this error: -"sql_yacc.yy", line xxx fatal: default action causes potential... - - This is a sign that your version of yacc is deficient. - You probably need to install a recent version of bison - (the GNU version of yacc) and use that instead. - Versions of bison older than 1.75 may report this error: -sql_yacc.yy:#####: fatal error: maximum table size (32767) exceeded - - The maximum table size is not actually exceeded; the - error is caused by bugs in older versions of bison. - - For information about acquiring or updating tools, see the - system requirements in Section 2.9, "Installing MySQL from - Source." - -2.9.6 MySQL Configuration and Third-Party Tools - - Third-party tools that need to determine the MySQL version - from the MySQL source can read the VERSION file in the - top-level source directory. The file lists the pieces of the - version separately. For example, if the version is MySQL - 5.7.4-m14, the file looks like this: -MYSQL_VERSION_MAJOR=5 -MYSQL_VERSION_MINOR=7 -MYSQL_VERSION_PATCH=4 -MYSQL_VERSION_EXTRA=-m14 - - If the source is not for a General Availablility (GA) - release, the MYSQL_VERSION_EXTRA value will be nonempty. For - the example, the value corresponds to Milestone 14. - - To construct a five-digit number from the version components, - use this formula: -MYSQL_VERSION_MAJOR*10000 + MYSQL_VERSION_MINOR*100 + MYSQL_VERSION_PA -TCH - -2.10 Postinstallation Setup and Testing - - This section discusses post-installation items for Unix-like - systems. If you are using Windows, see Section 2.3.8, - "Windows Postinstallation Procedures." - - After installing MySQL, there are some items that you should - address. For example: - - * You should initialize the data directory and create the - MySQL grant tables, as describe in Section 2.10.1, - "Postinstallation Procedures for Unix-like Systems." - - * An important security concern is that the initial - accounts in the grant tables have no passwords. You - should assign passwords to prevent unauthorized access to - the MySQL server. For instructions, see Section 2.10.2, - "Securing the Initial MySQL Accounts." - - * Optionally, you can create time zone tables to enable - recognition of named time zones. For instructions, see - Section 4.4.6, "mysql_tzinfo_to_sql --- Load the Time - Zone Tables." - - * If you have trouble getting the server to start, see - Section 2.10.1.3, "Starting and Troubleshooting the MySQL - Server." - - * When you are ready to create additional user accounts, - you can find information on the MySQL access control - system and account management in Section 6.2, "The MySQL - Access Privilege System," and Section 6.3, "MySQL User - Account Management." - -2.10.1 Postinstallation Procedures for Unix-like Systems - - After installing MySQL on a Unix-like system, you must - initialize the grant tables, start the server, and make sure - that the server works satisfactorily. You may also wish to - arrange for the server to be started and stopped - automatically when your system starts and stops. You should - also assign passwords to the accounts in the grant tables. - - On a Unix-like system, the grant tables are set up by the - mysql_install_db program. For some installation methods, this - program is run for you automatically if an existing database - cannot be found. - - * If you install MySQL on Linux using RPM distributions, - the server RPM runs mysql_install_db. - - * Using the native packaging system on many platforms, - including Debian Linux, Ubuntu Linux, Gentoo Linux and - others, the mysql_install_db command is run for you. - - * If you install MySQL on OS X using a DMG distribution, - the installer runs mysql_install_db. - - For other platforms and installation types, including generic - binary and source installs, you will need to run - mysql_install_db yourself. - - The following procedure describes how to initialize the grant - tables (if that has not previously been done) and start the - server. It also suggests some commands that you can use to - test whether the server is accessible and working properly. - For information about starting and stopping the server - automatically, see Section 2.10.1.2, "Starting and Stopping - MySQL Automatically." - - After you complete the procedure and have the server running, - you should assign passwords to the accounts created by - mysql_install_db and perhaps restrict access to test - databases. For instructions, see Section 2.10.2, "Securing - the Initial MySQL Accounts." - - In the examples shown here, the server runs under the user ID - of the mysql login account. This assumes that such an account - exists. Either create the account if it does not exist, or - substitute the name of a different existing login account - that you plan to use for running the server. For information - about creating the account, see Creating a mysql System User - and Group, in Section 2.2, "Installing MySQL on Unix/Linux - Using Generic Binaries." - - 1. Change location into the top-level directory of your - MySQL installation, represented here by BASEDIR: -shell> cd BASEDIR - - BASEDIR is the installation directory for your MySQL - instance. It is likely to be something like - /usr/local/mysql, /usr/local, or /usr/bin (for - installation wtih MySQL Yum repository, or other means). - The following steps assume that you have changed location - to this directory. - You will find several files and subdirectories in the - BASEDIR directory. The most important for installation - purposes are the bin and scripts subdirectories: - - + The bin directory contains client programs and the - server. You should add the full path name of this - directory to your PATH environment variable so that - your shell finds the MySQL programs properly. See - Section 2.12, "Environment Variables." - - + The scripts directory contains the mysql_install_db - program used to initialize the mysql database - containing the grant tables that store the server - access permissions. - - 2. If necessary, ensure that the distribution contents are - accessible to mysql. If you installed the distribution as - mysql, no further action is required. If you installed - the distribution as root, its contents will be owned by - root. Change its ownership to mysql by executing the - following commands as root in the installation directory. - The first command changes the owner attribute of the - files to the mysql user. The second changes the group - attribute to the mysql group. -shell> chown -R mysql . -shell> chgrp -R mysql . - - - 3. If necessary, run the mysql_install_db program to set up - the initial MySQL grant tables containing the privileges - that determine how users are permitted to connect to the - server. You will need to do this if you used a - distribution type for which the installation procedure - does not run the program for you. -shell> scripts/mysql_install_db --user=mysql - - Typically, mysql_install_db needs to be run only the - first time you install MySQL, so you can skip this step - if you are upgrading an existing installation, However, - mysql_install_db does not overwrite any existing - privilege tables, so it should be safe to run in any - circumstances. - It might be necessary to specify other options such as - --basedir or --datadir if mysql_install_db does not - identify the correct locations for the installation - directory or data directory. For example: -shell> scripts/mysql_install_db --user=mysql \ - --basedir=/opt/mysql/mysql \ - --datadir=/opt/mysql/mysql/data - - The mysql_install_db program creates the server's data - directory with mysql as the owner. Under the data - directory, it creates directories for the mysql database - that holds the grant tables and the test database that - you can use to test MySQL. The script also creates - privilege table entries for root and anonymous-user - accounts. The accounts have no passwords initially. - Section 2.10.2, "Securing the Initial MySQL Accounts," - describes the initial privileges. Briefly, these - privileges permit the MySQL root user to do anything, and - permit anybody to create or use databases with a name of - test or starting with test_. See Section 6.2, "The MySQL - Access Privilege System," for a complete listing and - description of the grant tables. - For a more secure installation, invoke mysql_install_db - with the --random-passwords option. This causes it to - assign a random password to the MySQL root accounts, set - the "password expired" flag for those accounts, and - remove the anonymous-user MySQL accounts. For additional - details, see Section 4.4.3, "mysql_install_db --- - Initialize MySQL Data Directory." (Install operations - using RPMs for Unbreakable Linux Network are unaffected - because they do not use mysql_install_db.) - It is important to make sure that the database - directories and files are owned by the mysql login - account so that the server has read and write access to - them when you run it later. To ensure this if you run - mysql_install_db as root, include the --user option as - shown. Otherwise, you should execute the script while - logged in as mysql, in which case you can omit the --user - option from the command. - If you do not want to have the test database, you can - remove it after starting the server, using the - instructions in Section 2.10.2, "Securing the Initial - MySQL Accounts." - If you have trouble with mysql_install_db at this point, - see Section 2.10.1.1, "Problems Running - mysql_install_db." - - 4. Most of the MySQL installation can be owned by root if - you like. The exception is that the data directory must - be owned by mysql. To accomplish this, run the following - commands as root in the installation directory: -shell> chown -R root . -shell> chown -R mysql data - - - 5. If the plugin directory (the directory named by the - plugin_dir system variable) is writable by the server, it - may be possible for a user to write executable code to a - file in the directory using SELECT ... INTO DUMPFILE. - This can be prevented by making plugin_dir read only to - the server or by setting --secure-file-priv to a - directory where SELECT writes can be made safely. - - 6. If you installed MySQL using a source distribution, you - may want to optionally copy one of the provided - configuration files from the support-files directory into - your /etc directory. There are different sample - configuration files for different use cases, server - types, and CPU and RAM configurations. If you want to use - one of these standard files, you should copy it to - /etc/my.cnf, or /etc/mysql/my.cnf and edit and check the - configuration before starting your MySQL server for the - first time. - If you do not copy one of the standard configuration - files, the MySQL server will be started with the default - settings. - If you want MySQL to start automatically when you boot - your machine, you can copy support-files/mysql.server to - the location where your system has its startup files. - More information can be found in the mysql.server script - itself, and in Section 2.10.1.2, "Starting and Stopping - MySQL Automatically." - - 7. Start the MySQL server: -shell> bin/mysqld_safe --user=mysql & - - It is important that the MySQL server be run using an - unprivileged (non-root) login account. To ensure this if - you run mysqld_safe as root, include the --user option as - shown. Otherwise, you should execute the script while - logged in as mysql, in which case you can omit the --user - option from the command. - For further instructions for running MySQL as an - unprivileged user, see Section 6.1.5, "How to Run MySQL - as a Normal User." - If the command fails immediately and prints mysqld ended, - look for information in the error log (which by default - is the host_name.err file in the data directory). - If you neglected to create the grant tables by running - mysql_install_db before proceeding to this step, the - following message appears in the error log file when you - start the server: -mysqld: Can't find file: 'host.frm' - - This error also occurs if you run mysql_install_db as - root without the --user option. Remove the data directory - and run mysql_install_db with the --user option as - described previously. - If you have other problems starting the server, see - Section 2.10.1.3, "Starting and Troubleshooting the MySQL - Server." For more information about mysqld_safe, see - Section 4.3.2, "mysqld_safe --- MySQL Server Startup - Script." - - 8. Use mysqladmin to verify that the server is running. The - following commands provide simple tests to check whether - the server is up and responding to connections: -shell> bin/mysqladmin version -shell> bin/mysqladmin variables - - The output from mysqladmin version varies slightly - depending on your platform and version of MySQL, but - should be similar to that shown here: -shell> bin/mysqladmin version -mysqladmin Ver 14.12 Distrib 5.6.23, for pc-linux-gnu on i686 -... - -Server version 5.6.23 -Protocol version 10 -Connection Localhost via UNIX socket -UNIX socket /var/lib/mysql/mysql.sock -Uptime: 14 days 5 hours 5 min 21 sec - -Threads: 1 Questions: 366 Slow queries: 0 -Opens: 0 Flush tables: 1 Open tables: 19 -Queries per second avg: 0.000 - - To see what else you can do with mysqladmin, invoke it - with the --help option. - - 9. Verify that you can shut down the server: -shell> bin/mysqladmin -u root shutdown - - 10. Verify that you can start the server again. Do this by - using mysqld_safe or by invoking mysqld directly. For - example: -shell> bin/mysqld_safe --user=mysql & - - If mysqld_safe fails, see Section 2.10.1.3, "Starting and - Troubleshooting the MySQL Server." - 11. Run some simple tests to verify that you can retrieve - information from the server. The output should be similar - to what is shown here: -shell> bin/mysqlshow -+--------------------+ -| Databases | -+--------------------+ -| information_schema | -| mysql | -| test | -+--------------------+ - -shell> bin/mysqlshow mysql -Database: mysql -+---------------------------+ -| Tables | -+---------------------------+ -| columns_priv | -| db | -| event | -| func | -| help_category | -| help_keyword | -| help_relation | -| help_topic | -| host | -| plugin | -| proc | -| procs_priv | -| servers | -| tables_priv | -| time_zone | -| time_zone_leap_second | -| time_zone_name | -| time_zone_transition | -| time_zone_transition_type | -| user | -+---------------------------+ - -shell> bin/mysql -e "SELECT Host,Db,User FROM db" mysql -+------+--------+------+ -| host | db | user | -+------+--------+------+ -| % | test | | -| % | test_% | | -+------+--------+------+ - - 12. There is a benchmark suite in the sql-bench directory - (under the MySQL installation directory) that you can use - to compare how MySQL performs on different platforms. The - benchmark suite is written in Perl. It requires the Perl - DBI module that provides a database-independent interface - to the various databases, and some other additional Perl - modules: -DBI -DBD::mysql -Data::Dumper -Data::ShowTable - - These modules can be obtained from CPAN - (http://www.cpan.org/). See also Section 2.13.1, - "Installing Perl on Unix." - The sql-bench/Results directory contains the results from - many runs against different databases and platforms. To - run all tests, execute these commands: -shell> cd sql-bench -shell> perl run-all-tests - - If you do not have the sql-bench directory, you probably - installed MySQL using RPM files other than the source - RPM. (The source RPM includes the sql-bench benchmark - directory.) In this case, you must first install the - benchmark suite before you can use it. There are separate - benchmark RPM files named mysql-bench-VERSION.i386.rpm - that contain benchmark code and data. - If you have a source distribution, there are also tests - in its tests subdirectory that you can run. For example, - to run auto_increment.tst, execute this command from the - top-level directory of your source distribution: -shell> mysql -vvf test < ./tests/auto_increment.tst - - The expected result of the test can be found in the - ./tests/auto_increment.res file. - 13. At this point, you should have the server running. - However, none of the initial MySQL accounts have a - password, and the server permits permissive access to - test databases. To tighten security, follow the - instructions in Section 2.10.2, "Securing the Initial - MySQL Accounts." - - The MySQL 5.6 installation procedure creates time zone tables - in the mysql database but does not populate them. To do so, - use the instructions in Section 10.6, "MySQL Server Time Zone - Support." - - To make it more convenient to invoke programs installed in - the bin directory under the installation directory, you can - add that directory to your PATH environment variable setting. - That enables you to run a program by typing only its name, - not its entire path name. See Section 4.2.10, "Setting - Environment Variables." - -2.10.1.1 Problems Running mysql_install_db - - The purpose of the mysql_install_db program is to generate - new MySQL privilege tables. It does not overwrite existing - MySQL privilege tables, and it does not affect any other - data. - - If you want to re-create your privilege tables, first stop - the mysqld server if it is running. Then rename the mysql - directory under the data directory to save it, and then run - mysql_install_db. Suppose that your current directory is the - MySQL installation directory and that mysql_install_db is - located in the bin directory and the data directory is named - data. To rename the mysql database and re-run - mysql_install_db, use these commands. -shell> mv data/mysql data/mysql.old -shell> scripts/mysql_install_db --user=mysql - - When you run mysql_install_db, you might encounter the - following problems: - - * mysql_install_db fails to install the grant tables - You may find that mysql_install_db fails to install the - grant tables and terminates after displaying the - following messages: -Starting mysqld daemon with databases from XXXXXX -mysqld ended - - In this case, you should examine the error log file very - carefully. The log should be located in the directory - XXXXXX named by the error message and should indicate why - mysqld did not start. If you do not understand what - happened, include the log when you post a bug report. See - Section 1.7, "How to Report Bugs or Problems." - - * There is a mysqld process running - This indicates that the server is running, in which case - the grant tables have probably been created already. If - so, there is no need to run mysql_install_db at all - because it needs to be run only once (when you install - MySQL the first time). - - * Installing a second mysqld server does not work when one - server is running - This can happen when you have an existing MySQL - installation, but want to put a new installation in a - different location. For example, you might have a - production installation, but you want to create a second - installation for testing purposes. Generally the problem - that occurs when you try to run a second server is that - it tries to use a network interface that is in use by the - first server. In this case, you should see one of the - following error messages: -Can't start server: Bind on TCP/IP port: -Address already in use -Can't start server: Bind on unix socket... - - For instructions on setting up multiple servers, see - Section 5.3, "Running Multiple MySQL Instances on One - Machine." - - * You do not have write access to the /tmp directory - If you do not have write access to create temporary files - or a Unix socket file in the default location (the /tmp - directory) or the TMP_DIR environment variable, if it has - been set, an error occurs when you run mysql_install_db - or the mysqld server. - You can specify different locations for the temporary - directory and Unix socket file by executing these - commands prior to starting mysql_install_db or mysqld, - where some_tmp_dir is the full path name to some - directory for which you have write permission: -shell> TMPDIR=/some_tmp_dir/ -shell> MYSQL_UNIX_PORT=/some_tmp_dir/mysql.sock -shell> export TMPDIR MYSQL_UNIX_PORT - - Then you should be able to run mysql_install_db and start - the server with these commands: -shell> scripts/mysql_install_db --user=mysql -shell> bin/mysqld_safe --user=mysql & - - If mysql_install_db is located in the scripts directory, - modify the first command to scripts/mysql_install_db. - See Section B.5.4.5, "How to Protect or Change the MySQL - Unix Socket File," and Section 2.12, "Environment - Variables." - - There are some alternatives to running the mysql_install_db - program provided in the MySQL distribution: - - * If you want the initial privileges to be different from - the standard defaults, you can modify mysql_install_db - before you run it. However, it is preferable to use GRANT - and REVOKE to change the privileges after the grant - tables have been set up. In other words, you can run - mysql_install_db, and then use mysql -u root mysql to - connect to the server as the MySQL root user so that you - can issue the necessary GRANT and REVOKE statements. - If you want to install MySQL on several machines with the - same privileges, you can put the GRANT and REVOKE - statements in a file and execute the file as a script - using mysql after running mysql_install_db. For example: -shell> scripts/mysql_install_db --user=mysql -shell> bin/mysql -u root < your_script_file - - By doing this, you can avoid having to issue the - statements manually on each machine. - - * It is possible to re-create the grant tables completely - after they have previously been created. You might want - to do this if you are just learning how to use GRANT and - REVOKE and have made so many modifications after running - mysql_install_db that you want to wipe out the tables and - start over. - To re-create the grant tables, remove all the .frm, .MYI, - and .MYD files in the mysql database directory. Then run - the mysql_install_db program again. - - * You can start mysqld manually using the - --skip-grant-tables option and add the privilege - information yourself using mysql: -shell> bin/mysqld_safe --user=mysql --skip-grant-tables & -shell> bin/mysql mysql - - From mysql, manually execute the SQL commands contained - in mysql_install_db. Make sure that you run mysqladmin - flush-privileges or mysqladmin reload afterward to tell - the server to reload the grant tables. - Note that by not using mysql_install_db, you not only - have to populate the grant tables manually, you also have - to create them first. - -2.10.1.2 Starting and Stopping MySQL Automatically - - Generally, you start the mysqld server in one of these ways: - - * Invoke mysqld directly. This works on any platform. - - * Invoke mysqld_safe, which tries to determine the proper - options for mysqld and then runs it with those options. - This script is used on Unix and Unix-like systems. See - Section 4.3.2, "mysqld_safe --- MySQL Server Startup - Script." - - * Invoke mysql.server. This script is used primarily at - system startup and shutdown on systems that use System - V-style run directories (that is, /etc/init.d and - run-level specific directories), where it usually is - installed under the name mysql. The mysql.server script - starts the server by invoking mysqld_safe. See Section - 4.3.3, "mysql.server --- MySQL Server Startup Script." - - * On OS X, install a separate MySQL Startup Item package to - enable the automatic startup of MySQL on system startup. - The Startup Item starts the server by invoking - mysql.server. See Section 2.4.4, "Installing the MySQL - Startup Item," for details. A MySQL Preference Pane also - provides control for starting and stopping MySQL through - the System Preferences, see Section 2.4.5, "Installing - and Using the MySQL Preference Pane." - - * Use the Solaris/OpenSolaris service management framework - (SMF) system to initiate and control MySQL startup. For - more information, see Section 2.7.2, "Installing MySQL on - OpenSolaris Using IPS." - - The mysqld_safe and mysql.server scripts, Solaris/OpenSolaris - SMF, and the OS X Startup Item (or MySQL Preference Pane) can - be used to start the server manually, or automatically at - system startup time. mysql.server and the Startup Item also - can be used to stop the server. - - To start or stop the server manually using the mysql.server - script, invoke it with start or stop arguments: -shell> mysql.server start -shell> mysql.server stop - - Before mysql.server starts the server, it changes location to - the MySQL installation directory, and then invokes - mysqld_safe. If you want the server to run as some specific - user, add an appropriate user option to the [mysqld] group of - the /etc/my.cnf option file, as shown later in this section. - (It is possible that you will need to edit mysql.server if - you've installed a binary distribution of MySQL in a - nonstandard location. Modify it to change location into the - proper directory before it runs mysqld_safe. If you do this, - your modified version of mysql.server may be overwritten if - you upgrade MySQL in the future, so you should make a copy of - your edited version that you can reinstall.) - - mysql.server stop stops the server by sending a signal to it. - You can also stop the server manually by executing mysqladmin - shutdown. - - To start and stop MySQL automatically on your server, you - need to add start and stop commands to the appropriate places - in your /etc/rc* files. - - If you use the Linux server RPM package - (MySQL-server-VERSION.rpm), or a native Linux package - installation, the mysql.server script may be installed in the - /etc/init.d directory with the name mysql. See Section 2.5.5, - "Installing MySQL on Linux Using RPM Packages," for more - information on the Linux RPM packages. - - Some vendors provide RPM packages that install a startup - script under a different name such as mysqld. - - If you install MySQL from a source distribution or using a - binary distribution format that does not install mysql.server - automatically, you can install it manually. The script can be - found in the support-files directory under the MySQL - installation directory or in a MySQL source tree. - - To install mysql.server manually, copy it to the /etc/init.d - directory with the name mysql, and then make it executable. - Do this by changing location into the appropriate directory - where mysql.server is located and executing these commands: -shell> cp mysql.server /etc/init.d/mysql -shell> chmod +x /etc/init.d/mysql - - Note - - Older Red Hat systems use the /etc/rc.d/init.d directory - rather than /etc/init.d. Adjust the preceding commands - accordingly. Alternatively, first create /etc/init.d as a - symbolic link that points to /etc/rc.d/init.d: -shell> cd /etc -shell> ln -s rc.d/init.d . - - After installing the script, the commands needed to activate - it to run at system startup depend on your operating system. - On Linux, you can use chkconfig: -shell> chkconfig --add mysql - - On some Linux systems, the following command also seems to be - necessary to fully enable the mysql script: -shell> chkconfig --level 345 mysql on - - On FreeBSD, startup scripts generally should go in - /usr/local/etc/rc.d/. The rc(8) manual page states that - scripts in this directory are executed only if their basename - matches the *.sh shell file name pattern. Any other files or - directories present within the directory are silently - ignored. In other words, on FreeBSD, you should install the - mysql.server script as /usr/local/etc/rc.d/mysql.server.sh to - enable automatic startup. - - As an alternative to the preceding setup, some operating - systems also use /etc/rc.local or /etc/init.d/boot.local to - start additional services on startup. To start up MySQL using - this method, you could append a command like the one - following to the appropriate startup file: -/bin/sh -c 'cd /usr/local/mysql; ./bin/mysqld_safe --user=mysql &' - - For other systems, consult your operating system - documentation to see how to install startup scripts. - - You can add options for mysql.server in a global /etc/my.cnf - file. A typical /etc/my.cnf file might look like this: -[mysqld] -datadir=/usr/local/mysql/var -socket=/var/tmp/mysql.sock -port=3306 -user=mysql - -[mysql.server] -basedir=/usr/local/mysql - - The mysql.server script supports the following options: - basedir, datadir, and pid-file. If specified, they must be - placed in an option file, not on the command line. - mysql.server supports only start and stop as command-line - arguments. - - The following table shows which option groups the server and - each startup script read from option files. - - Table 2.12 MySQL Startup scripts and supported server option - groups - Script Option Groups - mysqld [mysqld], [server], [mysqld-major_version] - mysqld_safe [mysqld], [server], [mysqld_safe] - mysql.server [mysqld], [mysql.server], [server] - - [mysqld-major_version] means that groups with names like - [mysqld-5.5] and [mysqld-5.6] are read by servers having - versions 5.5.x, 5.6.x, and so forth. This feature can be used - to specify options that can be read only by servers within a - given release series. - - For backward compatibility, mysql.server also reads the - [mysql_server] group and mysqld_safe also reads the - [safe_mysqld] group. However, you should update your option - files to use the [mysql.server] and [mysqld_safe] groups - instead when using MySQL 5.6. - - For more information on MySQL configuration files and their - structure and contents, see Section 4.2.6, "Using Option - Files." - -2.10.1.3 Starting and Troubleshooting the MySQL Server - - This section provides troubleshooting suggestions for - problems starting the server on a Unix-like system. If you - are using Windows, see Section 2.3.6, "Troubleshooting a - Microsoft Windows MySQL Server Installation." - - If you have problems starting the server, here are some - things to try: - - * Check the error log to see why the server does not start. - Log files are located in the data directory (typically - C:\Program Files\MySQL\MySQL Server 5.6\data on Windows, - /usr/local/mysql/data for a Unix/Linux binary - distribution, and /usr/local/var for a Unix/Linux source - distribution). Look in the data directory for files with - names of the form host_name.err and host_name.log, where - host_name is the name of your server host. Then examine - the last few lines of these files. Use tail to display - them: -shell> tail host_name.err -shell> tail host_name.log - - - * Specify any special options needed by the storage engines - you are using. You can create a my.cnf file and specify - startup options for the engines that you plan to use. If - you are going to use storage engines that support - transactional tables (InnoDB, NDB), be sure that you have - them configured the way you want before starting the - server. If you are using InnoDB tables, see Section 14.3, - "InnoDB Configuration" for guidelines and Section 14.12, - "InnoDB Startup Options and System Variables" for option - syntax. - Although storage engines use default values for options - that you omit, Oracle recommends that you review the - available options and specify explicit values for any - options whose defaults are not appropriate for your - installation. - - * Make sure that the server knows where to find the data - directory. The mysqld server uses this directory as its - current directory. This is where it expects to find - databases and where it expects to write log files. The - server also writes the pid (process ID) file in the data - directory. - The default data directory location is hardcoded when the - server is compiled. To determine what the default path - settings are, invoke mysqld with the --verbose and --help - options. If the data directory is located somewhere else - on your system, specify that location with the --datadir - option to mysqld or mysqld_safe, on the command line or - in an option file. Otherwise, the server will not work - properly. As an alternative to the --datadir option, you - can specify mysqld the location of the base directory - under which MySQL is installed with the --basedir, and - mysqld looks for the data directory there. - To check the effect of specifying path options, invoke - mysqld with those options followed by the --verbose and - --help options. For example, if you change location into - the directory where mysqld is installed and then run the - following command, it shows the effect of starting the - server with a base directory of /usr/local: -shell> ./mysqld --basedir=/usr/local --verbose --help - - You can specify other options such as --datadir as well, - but --verbose and --help must be the last options. - Once you determine the path settings you want, start the - server without --verbose and --help. - If mysqld is currently running, you can find out what - path settings it is using by executing this command: -shell> mysqladmin variables - - Or: -shell> mysqladmin -h host_name variables - - host_name is the name of the MySQL server host. - - * Make sure that the server can access the data directory. - The ownership and permissions of the data directory and - its contents must allow the server to read and modify - them. - If you get Errcode 13 (which means Permission denied) - when starting mysqld, this means that the privileges of - the data directory or its contents do not permit server - access. In this case, you change the permissions for the - involved files and directories so that the server has the - right to use them. You can also start the server as root, - but this raises security issues and should be avoided. - Change location into the data directory and check the - ownership of the data directory and its contents to make - sure the server has access. For example, if the data - directory is /usr/local/mysql/var, use this command: -shell> ls -la /usr/local/mysql/var - - If the data directory or its files or subdirectories are - not owned by the login account that you use for running - the server, change their ownership to that account. If - the account is named mysql, use these commands: -shell> chown -R mysql /usr/local/mysql/var -shell> chgrp -R mysql /usr/local/mysql/var - - Even with correct ownership, MySQL might fail to start up - if there is other security software running on your - system that manages application access to various parts - of the file system. In this case, reconfigure that - software to enable mysqld to access the directories it - uses during normal operation. - - * Verify that the network interfaces the server wants to - use are available. - If either of the following errors occur, it means that - some other program (perhaps another mysqld server) is - using the TCP/IP port or Unix socket file that mysqld is - trying to use: -Can't start server: Bind on TCP/IP port: Address already in use -Can't start server: Bind on unix socket... - - Use ps to determine whether you have another mysqld - server running. If so, shut down the server before - starting mysqld again. (If another server is running, and - you really want to run multiple servers, you can find - information about how to do so in Section 5.3, "Running - Multiple MySQL Instances on One Machine.") - If no other server is running, execute the command telnet - your_host_name tcp_ip_port_number. (The default MySQL - port number is 3306.) Then press Enter a couple of times. - If you do not get an error message like telnet: Unable to - connect to remote host: Connection refused, some other - program is using the TCP/IP port that mysqld is trying to - use. Track down what program this is and disable it, or - tell mysqld to listen to a different port with the --port - option. In this case, specify the same non-default port - number for client programs when connecting to the server - using TCP/IP. - Another reason the port might be inaccessible is that you - have a firewall running that blocks connections to it. If - so, modify the firewall settings to permit access to the - port. - If the server starts but you cannot connect to it, make - sure that you have an entry in /etc/hosts that looks like - this: -127.0.0.1 localhost - - - * If you cannot get mysqld to start, try to make a trace - file to find the problem by using the --debug option. See - Section 24.4.3, "The DBUG Package." - -2.10.2 Securing the Initial MySQL Accounts - - Part of the MySQL installation process is to set up the mysql - database that contains the grant tables: - - * Windows distributions contain preinitialized grant - tables. - - * On Unix, the mysql_install_db program populates the grant - tables. Some installation methods run this program for - you. Others require that you execute it manually. For - details, see Section 2.10.1, "Postinstallation Procedures - for Unix-like Systems." - - The mysql.user grant table defines the initial MySQL user - accounts and their access privileges: - - * Some accounts have the user name root. These are - superuser accounts that have all privileges and can do - anything. The initial root account passwords are empty, - so anyone can connect to the MySQL server as root without - a password and be granted all privileges. - - + On Windows, root accounts are created that permit - connections from the local host only. Connections - can be made by specifying the host name localhost, - the IP address 127.0.0.1, or the IPv6 address ::1. - If the user selects the Enable root access from - remote machines option during installation, the - Windows installer creates another root account that - permits connections from any host. - - + On Unix, each root account permits connections from - the local host. Connections can be made by - specifying the host name localhost, the IP address - 127.0.0.1, the IPv6 address ::1, or the actual host - name or IP address. - An attempt to connect to the host 127.0.0.1 normally - resolves to the localhost account. However, this fails if - the server is run with the --skip-name-resolve option, so - the 127.0.0.1 account is useful in that case. The ::1 - account is used for IPv6 connections. - - * Some accounts are for anonymous users. These have an - empty user name. The anonymous accounts have no password, - so anyone can use them to connect to the MySQL server. - - + On Windows, there is one anonymous account that - permits connections from the local host. Connections - can be made by specifying a host name of localhost. - - + On Unix, each anonymous account permits connections - from the local host. Connections can be made by - specifying a host name of localhost for one of the - accounts, or the actual host name or IP address for - the other. - - To display which accounts exist in the mysql.user table and - check whether their passwords are empty, use the following - statement: -mysql> SELECT User, Host, Password FROM mysql.user; -+------+--------------------+----------+ -| User | Host | Password | -+------+--------------------+----------+ -| root | localhost | | -| root | myhost.example.com | | -| root | 127.0.0.1 | | -| root | ::1 | | -| | localhost | | -| | myhost.example.com | | -+------+--------------------+----------+ - - This output indicates that there are several root and - anonymous-user accounts, none of which have passwords. The - output might differ on your system, but the presence of - accounts with empty passwords means that your MySQL - installation is unprotected until you do something about it: - - * You should assign a password to each MySQL root account. - - * If you want to prevent clients from connecting as - anonymous users without a password, you should either - assign a password to each anonymous account or else - remove the accounts. - - In addition, the mysql.db table contains rows that permit all - accounts to access the test database and other databases with - names that start with test_. This is true even for accounts - that otherwise have no special privileges such as the default - anonymous accounts. This is convenient for testing but - inadvisable on production servers. Administrators who want - database access restricted only to accounts that have - permissions granted explicitly for that purpose should remove - these mysql.db table rows. - - The following instructions describe how to set up passwords - for the initial MySQL accounts, first for the root accounts, - then for the anonymous accounts. The instructions also cover - how to remove the anonymous accounts, should you prefer not - to permit anonymous access at all, and describe how to remove - permissive access to test databases. Replace newpwd in the - examples with the password that you want to use. Replace - host_name with the name of the server host. You can determine - this name from the output of the preceding SELECT statement. - For the output shown, host_name is myhost.example.com. - Note - - For additional information about setting passwords, see - Section 6.3.5, "Assigning Account Passwords." If you forget - your root password after setting it, see Section B.5.4.1, - "How to Reset the Root Password." - - You might want to defer setting the passwords until later, to - avoid the need to specify them while you perform additional - setup or testing. However, be sure to set them before using - your installation for production purposes. - - To set up additional accounts, see Section 6.3.2, "Adding - User Accounts." - -Assigning root Account Passwords - - The root account passwords can be set several ways. The - following discussion demonstrates three methods: - - * Use the SET PASSWORD statement - - * Use the UPDATE statement - - * Use the mysqladmin command-line client program - - To assign passwords using SET PASSWORD, connect to the server - as root and issue a SET PASSWORD statement for each root - account listed in the mysql.user table. Be sure to encrypt - the password using the PASSWORD() function. - - For Windows, do this: -shell> mysql -u root -mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpwd'); -mysql> SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('newpwd'); -mysql> SET PASSWORD FOR 'root'@'::1' = PASSWORD('newpwd'); -mysql> SET PASSWORD FOR 'root'@'%' = PASSWORD('newpwd'); - - The last statement is unnecessary if the mysql.user table has - no root account with a host value of %. - - For Unix, do this: -shell> mysql -u root -mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpwd'); -mysql> SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('newpwd'); -mysql> SET PASSWORD FOR 'root'@'::1' = PASSWORD('newpwd'); -mysql> SET PASSWORD FOR 'root'@'host_name' = PASSWORD('newpwd'); - - You can also use a single statement that assigns a password - to all root accounts by using UPDATE to modify the mysql.user - table directly. This method works on any platform: -shell> mysql -u root -mysql> UPDATE mysql.user SET Password = PASSWORD('newpwd') - -> WHERE User = 'root'; -mysql> FLUSH PRIVILEGES; - - The FLUSH statement causes the server to reread the grant - tables. Without it, the password change remains unnoticed by - the server until you restart it. - - To assign passwords to the root accounts using mysqladmin, - execute the following commands: -shell> mysqladmin -u root password "newpwd" -shell> mysqladmin -u root -h host_name password "newpwd" - - Those commands apply both to Windows and to Unix. The double - quotation marks around the password are not always necessary, - but you should use them if the password contains spaces or - other characters that are special to your command - interpreter. - - The mysqladmin method of setting the root account passwords - does not work for the 'root'@'127.0.0.1' or 'root'@'::1' - account. Use the SET PASSWORD method shown earlier. - - After the root passwords have been set, you must supply the - appropriate password whenever you connect as root to the - server. For example, to shut down the server with mysqladmin, - use this command: -shell> mysqladmin -u root -p shutdown -Enter password: (enter root password here) - -Assigning Anonymous Account Passwords - - The mysql commands in the following instructions include a -p - option based on the assumption that you have set the root - account passwords using the preceding instructions and must - specify that password when connecting to the server. - - To assign passwords to the anonymous accounts, connect to the - server as root, then use either SET PASSWORD or UPDATE. Be - sure to encrypt the password using the PASSWORD() function. - - To use SET PASSWORD on Windows, do this: -shell> mysql -u root -p -Enter password: (enter root password here) -mysql> SET PASSWORD FOR ''@'localhost' = PASSWORD('newpwd'); - - To use SET PASSWORD on Unix, do this: -shell> mysql -u root -p -Enter password: (enter root password here) -mysql> SET PASSWORD FOR ''@'localhost' = PASSWORD('newpwd'); -mysql> SET PASSWORD FOR ''@'host_name' = PASSWORD('newpwd'); - - To set the anonymous-user account passwords with a single - UPDATE statement, do this (on any platform): -shell> mysql -u root -p -Enter password: (enter root password here) -mysql> UPDATE mysql.user SET Password = PASSWORD('newpwd') - -> WHERE User = ''; -mysql> FLUSH PRIVILEGES; - - The FLUSH statement causes the server to reread the grant - tables. Without it, the password change remains unnoticed by - the server until you restart it. - -Removing Anonymous Accounts - - If you prefer to remove any anonymous accounts rather than - assigning them passwords, do so as follows on Windows: -shell> mysql -u root -p -Enter password: (enter root password here) -mysql> DROP USER ''@'localhost'; - - On Unix, remove the anonymous accounts like this: -shell> mysql -u root -p -Enter password: (enter root password here) -mysql> DROP USER ''@'localhost'; -mysql> DROP USER ''@'host_name'; - -Securing Test Databases - - By default, the mysql.db table contains rows that permit - access by any user to the test database and other databases - with names that start with test_. (These rows have an empty - User column value, which for access-checking purposes matches - any user name.) This means that such databases can be used - even by accounts that otherwise possess no privileges. If you - want to remove any-user access to test databases, do so as - follows: -shell> mysql -u root -p -Enter password: (enter root password here) -mysql> DELETE FROM mysql.db WHERE Db LIKE 'test%'; -mysql> FLUSH PRIVILEGES; - - The FLUSH statement causes the server to reread the grant - tables. Without it, the privilege change remains unnoticed by - the server until you restart it. - - With the preceding change, only users who have global - database privileges or privileges granted explicitly for the - test database can use it. However, if you do not want the - database to exist at all, drop it: -mysql> DROP DATABASE test; - - Note - - On Windows, you can also perform the process described in - this section during installation with MySQL Installer (see - Section 2.3.3, "Installing MySQL on Microsoft Windows Using - MySQL Installer"). On all platforms, the MySQL distribution - includes mysql_secure_installation, a command-line utility - that automates much of the process of securing a MySQL - installation. And MySQL Workbench is available on all - platforms, and also offers the ability to manage user - accounts (see Chapter 26, "MySQL Workbench" ). - -2.11 Upgrading or Downgrading MySQL - - This section describes the steps to upgrade or downgrade a - MySQL installation. - - Upgrading is a common procedure, as you pick up bug fixes - within the same MySQL release series or significant features - between major MySQL releases. You perform this procedure - first on some test systems to make sure everything works - smoothly, and then on the production systems. - - Downgrading is less common. Typically, you undo an upgrade - because of some compatibility or performance issue that - occurs on a production system, and was not uncovered during - initial upgrade verification on the test systems. As with the - upgrade procedure, perform and verify the downgrade procedure - on some test systems first, before using it on a production - system. - -2.11.1 Upgrading MySQL - - As a general rule, to upgrade from one release series to - another, go to the next series rather than skipping a series. - To upgrade from a release series previous to MySQL 5.5, - upgrade to each successive release series in turn until you - have reached MySQL 5.5, and then proceed with the upgrade to - MySQL 5.6. For example, if you currently are running MySQL - 5.1 and wish to upgrade to a newer series, upgrade to MySQL - 5.5 first before upgrading to 5.6, and so forth. For - information on upgrading to MySQL 5.5, see the MySQL 5.5 - Reference Manual. - - To upgrade to MySQL 5.6, use the items in the following - checklist as a guide: - - * Before any upgrade, back up your databases, including the - mysql database that contains the grant tables. See - Section 7.2, "Database Backup Methods." - - * Read all the notes in Section 2.11.1.3, "Upgrading from - MySQL 5.5 to 5.6." These notes enable you to identify - upgrade issues that apply to your current MySQL - installation. Some incompatibilities discussed in that - section require your attention before upgrading. Others - require some action after upgrading. - - * Read the Release Notes - (http://dev.mysql.com/doc/relnotes/mysql/5.6/en/) as - well, which provide information about features that are - new in MySQL 5.6 or differ from those found in earlier - MySQL releases. - - * After upgrading to a new version of MySQL, run - mysql_upgrade (see Section 4.4.7, "mysql_upgrade --- - Check and Upgrade MySQL Tables"). This program checks - your tables, and attempts to repair them if necessary. It - also updates your grant tables to make sure that they - have the current structure so that you can take advantage - of any new capabilities. (Some releases of MySQL - introduce changes to the structure of the grant tables to - add new privileges or features.) - mysql_upgrade does not upgrade the contents of the help - tables. For upgrade instructions, see Section 5.1.10, - "Server-Side Help." - mysql_upgrade should not be used when the server is - running with --gtid-mode=ON, since it may make changes in - nontransactional system tables in the mysql database, - many of which are MyISAM and cannot be changed to use a - different storage engine. See Section 17.1.3.4, "GTID - mode and mysql_upgrade." - - * If you run MySQL Server on Windows, see Section 2.3.7, - "Upgrading MySQL on Windows." - - * If you use replication, see Section 17.4.3, "Upgrading a - Replication Setup," for information on upgrading your - replication setup. - - * If you use InnoDB, consider setting innodb_fast_shutdown - to 0 before shutting down and upgrading your server. When - you set innodb_fast_shutdown to 0, InnoDB does a slow - shutdown, a full purge and an insert buffer merge before - shutting down, which ensures that all data files are - fully prepared in case the upgrade process modifies the - file format. - - * If you upgrade an installation originally produced by - installing multiple RPM packages, it is best to upgrade - all the packages, not just some. For example, if you - previously installed the server and client RPMs, do not - upgrade just the server RPM. - - * If you have created a user-defined function (UDF) with a - given name and upgrade MySQL to a version that implements - a new built-in function with the same name, the UDF - becomes inaccessible. To correct this, use DROP FUNCTION - to drop the UDF, and then use CREATE FUNCTION to - re-create the UDF with a different nonconflicting name. - The same is true if the new version of MySQL implements a - built-in function with the same name as an existing - stored function. See Section 9.2.4, "Function Name - Parsing and Resolution," for the rules describing how the - server interprets references to different kinds of - functions. - - For EL5, EL6, or EL7-based Linux platforms and Fedora 20 or - 21, you can perform an in-place upgrade of MySQL and its - components with the MySQL Yum repository. See Section - 2.11.1.1, "Upgrading MySQL with the MySQL Yum Repository." - - On Debian 7, Ubuntu 12, and Ubuntu 14, you can perform an - in-place upgrade of MySQL and its components with the MySQL - APT repository. See Section 2.11.1.2, "Upgrading MySQL with - the MySQL APT Repository." - - For upgrades between versions of a MySQL release series that - has reached General Availability status, you can move the - MySQL format files and data files between different versions - on systems with the same architecture. For upgrades to a - version of a MySQL release series that is in development - status, that is not necessarily true. Use of development - releases is at your own risk. - - If you are cautious about using new versions, you can always - rename your old mysqld before installing a newer one. For - example, if you are using a version of MySQL 5.5 and want to - upgrade to 5.6, rename your current server from mysqld to - mysqld-5.5. If your new mysqld then does something - unexpected, you can simply shut it down and restart with your - old mysqld. - - If problems occur, such as that the new mysqld server does - not start or that you cannot connect without a password, - verify that you do not have an old my.cnf file from your - previous installation. You can check this with the - --print-defaults option (for example, mysqld - --print-defaults). If this command displays anything other - than the program name, you have an active my.cnf file that - affects server or client operation. - - If, after an upgrade, you experience problems with compiled - client programs, such as Commands out of sync or unexpected - core dumps, you probably have used old header or library - files when compiling your programs. In this case, check the - date for your mysql.h file and libmysqlclient.a library to - verify that they are from the new MySQL distribution. If not, - recompile your programs with the new headers and libraries. - Recompilation might also be necessary for programs compiled - against the shared client library if the library major - version number has changed (for example from - libmysqlclient.so.15 to libmysqlclient.so.16. - - If your MySQL installation contains a large amount of data - that might take a long time to convert after an in-place - upgrade, you might find it useful to create a "dummy" - database instance for assessing what conversions might be - needed and the work involved to perform them. Make a copy of - your MySQL instance that contains a full copy of the mysql - database, plus all other databases without data. Run your - upgrade procedure on this dummy instance to see what actions - might be needed so that you can better evaluate the work - involved when performing actual data conversion on your - original database instance. - - It is a good idea to rebuild and reinstall the Perl - DBD::mysql module whenever you install a new release of - MySQL. The same applies to other MySQL interfaces as well, - such as PHP mysql extensions and the Python MySQLdb module. - -2.11.1.1 Upgrading MySQL with the MySQL Yum Repository - - For supported Yum-based platforms (see Section 2.5.1, - "Installing MySQL on Linux Using the MySQL Yum Repository," - for a list), you can perform an in-place upgrade for MySQL - (that is, replacing the old version and then running the new - version off the old data files) with the MySQL Yum - repository. - Notes - - * Before performing any update to MySQL, follow carefully - the instructions in Section 2.11.1, "Upgrading MySQL." - Among other instructions discussed there, it is - especially important to back up your database before the - update. - - * The following instructions assume you have installed - MySQL with the MySQL Yum repository; if that is not the - case, follow the instructions in Section 2.5.2, - "Replacing a Third-Party Distribution of MySQL Using the - MySQL Yum Repository." - - - 1. Selecting a Target Series - By default, the MySQL Yum repository updates MySQL to the - latest version in the release series you have chosen - during installation (see Section 2.5.1, "" for details), - which means, for example, a 5.6.x installation will NOT - be updated to a 5.7.x release automatically. To update to - another release series, you need to first disable the - subrepository for the series that has been selected (by - default, or by yourself) and enable the subrepository for - your target series. To do that, follow the steps - explained in Section 2.5.1, "" for editing the - subrepository entries in - the/etc/yum.repos.d/mysql-community.repo file. - As a general rule, to upgrade from one release series to - another, go to the next series rather than skipping a - series. For example, if you are currently running MySQL - 5.5 and wish to upgrade to 5.7, upgrade to MySQL 5.6 - first before upgrading to 5.7. - Important - For important information about upgrading from MySQL 5.6 - to 5.7, see Upgrading from MySQL 5.6 to 5.7 - (http://dev.mysql.com/doc/refman/5.7/en/upgrading-from-pr - evious-series.html). - - 2. Upgrading MySQL - Upgrade MySQL and its components by the following - command: -shell> sudo yum update mysql-server - Alternatively, you can update MySQL by telling Yum to - update everything on your system (this might take - considerably more time): -shell> sudo yum update - - 3. Restarting MySQL - The MySQL server always restarts after an update by Yum. - Once the server restarts, run mysql_upgrade to check and - possibly resolve any incompatibilities between the old - data and the upgraded software. mysql_upgrade also - performs other functions; see Section 4.4.7, - "mysql_upgrade --- Check and Upgrade MySQL Tables" for - details. - - You can also update only a specific component. Use the - following command to list all the installed packages for the - MySQL components: -shell> sudo yum list installed | grep "^mysql" - - After identifying the package name of the component of your - choice, update the package with the following command, - replacing package-name with the name of the package: -shell> sudo yum update package-name - -Upgrading the Shared Client Libraries - - After updating MySQL using the Yum repository, applications - compiled with older versions of the shared client libraries - should continue to work. - - If you recompile applications and dynamically link them with - the updated libraries: As typical with new versions of shared - libraries where there are differences or additions in symbol - versioning between the newer and older libraries (for - example, between the newer, standard 5.6 shared client - libraries and some older---prior or variant---versions of the - shared libraries shipped natively by the Linux distributions' - software repositories, or from some other sources), any - applications compiled using the updated, newer shared - libraries will require those updated libraries on systems - where the applications are deployed. And, as expected, if - those libraries are not in place, the applications requiring - the shared libraries will fail. So, be sure to deploy the - packages for the shared libraries from MySQL on those - systems. You can do this by adding the MySQL Yum repository - to the systems (see Section 2.5.1, "") and install the latest - shared libraries using the instructions given in Section - 2.5.1, "." - -2.11.1.2 Upgrading MySQL with the MySQL APT Repository - - On Debian 7, Ubuntu 12, and Ubuntu 14, you can perform an - in-place upgrade of MySQL and its components with the MySQL - APT repository. See Upgrading MySQL with the MySQL APT - Repository - (http://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/index - .html#repo-qg-apt-upgrading) in A Quick Guide to Using the - MySQL APT Repository - (http://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/). - -2.11.1.3 Upgrading from MySQL 5.5 to 5.6 - - Note - - Beginning with MySQL 5.6.6, several MySQL Server parameters - have defaults that differ from previous releases. See the - notes regarding these changes later in this section, - particularly regarding overriding them to preserve backward - compatibility if that is a concern. - Note - - It is good practice to back up your data before installing - any new version of software. Although MySQL works very hard - to ensure a high level of quality, protect your data by - making a backup. - - To upgrade to 5.6 from any previous version, MySQL recommends - that you dump your tables with mysqldump before upgrading and - reload the dump file after upgrading. Use the --all-databases - option to include all databases in the dump. If your - databases include stored programs, use the --routines and - --events options as well. - - In general, do the following when upgrading from MySQL 5.5 to - 5.6: - - * Read all the items in these sections to see whether any - of them might affect your applications: - - + Section 2.11.1, "Upgrading MySQL," has general - update information. - - + The items in the change lists provided later in this - section enable you to identify upgrade issues that - apply to your current MySQL installation. Some - incompatibilities discussed there require your - attention before upgrading. Others should be dealt - with after upgrading. - - + The MySQL 5.6 Release Notes - (http://dev.mysql.com/doc/relnotes/mysql/5.6/en/) - describe significant new features you can use in 5.6 - or that differ from those found in earlier MySQL - releases. Some of these changes may result in - incompatibilities. - Note particularly any changes that are marked Known issue - or Incompatible change. These incompatibilities with - earlier versions of MySQL may require your attention - before you upgrade. Our aim is to avoid these changes, - but occasionally they are necessary to correct problems - that would be worse than an incompatibility between - releases. If any upgrade issue applicable to your - installation involves an incompatibility that requires - special handling, follow the instructions given in the - incompatibility description. Sometimes this involves - dumping and reloading tables, or use of a statement such - as CHECK TABLE or REPAIR TABLE. - For dump and reload instructions, see Section 2.11.4, - "Rebuilding or Repairing Tables or Indexes." Any - procedure that involves REPAIR TABLE with the USE_FRM - option must be done before upgrading. Use of this - statement with a version of MySQL different from the one - used to create the table (that is, using it after - upgrading) may damage the table. See Section 13.7.2.5, - "REPAIR TABLE Syntax." - - * Before upgrading to a new version of MySQL, Section - 2.11.3, "Checking Whether Tables or Indexes Must Be - Rebuilt," to see whether changes to table formats or to - character sets or collations were made between your - current version of MySQL and the version to which you are - upgrading. If so and these changes result in an - incompatibility between MySQL versions, you will need to - upgrade the affected tables using the instructions in - Section 2.11.4, "Rebuilding or Repairing Tables or - Indexes." - - * After upgrading to a new version of MySQL, run - mysql_upgrade (see Section 4.4.7, "mysql_upgrade --- - Check and Upgrade MySQL Tables"). This program checks - your tables, and attempts to repair them if necessary. It - also updates your grant tables to make sure that they - have the current structure so that you can take advantage - of any new capabilities. (Some releases of MySQL - introduce changes to the structure of the grant tables to - add new privileges or features.) - mysql_upgrade does not upgrade the contents of the help - tables. For upgrade instructions, see Section 5.1.10, - "Server-Side Help." - - * If you run MySQL Server on Windows, see Section 2.3.7, - "Upgrading MySQL on Windows." - - * If you use replication, see Section 17.4.3, "Upgrading a - Replication Setup," for information on upgrading your - replication setup. - - If your MySQL installation contains a large amount of data - that might take a long time to convert after an in-place - upgrade, you might find it useful to create a "dummy" - database instance for assessing what conversions might be - needed and the work involved to perform them. Make a copy of - your MySQL instance that contains a full copy of the mysql - database, plus all other databases without data. Run your - upgrade procedure on this dummy instance to see what actions - might be needed so that you can better evaluate the work - involved when performing actual data conversion on your - original database instance. - - Read all the items in the following sections to see whether - any of them might affect your applications: - -Configuration Changes - - - * Beginning with MySQL 5.6.6, several MySQL Server - parameters have defaults that differ from previous - releases. The motivation for these changes is to provide - better out-of-box performance and to reduce the need for - the database administrator to change settings manually. - These changes are subject to possible revision in future - releases as we gain feedback. - In some cases, a parameter has a different static default - value. In other cases, the server autosizes a parameter - at startup using a formula based on other related - parameters or server host configuration, rather than - using a static value. For example, the setting for - back_log now is its previous default of 50, adjusted up - by an amount proportional to the value of - max_connections. The idea behind autosizing is that when - the server has information available to make a decision - about a parameter setting likely to be better than a - fixed default, it will. - The following table summarizes changes to defaults. Any - of these can be overridden by specifying an explicit - value at server startup. - - Parameter Old Default New Default - back_log 50 Autosized using max_connections - binlog_checksum NONE CRC32 - --binlog-row-event-max-size 1024 8192 - flush_time 1800 (on Windows) 0 - innodb_autoextend_increment 8 64 - innodb_buffer_pool_instances 1 8 (platform dependent) - innodb_checksum_algorithm INNODB CRC32 - innodb_concurrency_tickets 500 5000 - innodb_file_per_table 0 1 - innodb_old_blocks_time 0 1000 - innodb_open_files 300 Autosized using innodb_file_per_table, - table_open_cache - innodb_stats_on_metadata ON OFF - join_buffer_size 128KB 256KB - max_allowed_packet 1MB 4MB - max_connect_errors 10 100 - sync_master_info 0 10000 - sync_relay_log 0 10000 - sync_relay_log_info 0 10000 - With regard to compatibility with previous releases, the - most important changes are: - - + innodb_file_per_table is enabled (previously - disabled). - - + innodb_checksum_algorithm is CRC32 (previously - INNODB). - - + binlog_checksum is CRC32 (previously NONE). - Therefore, if you are upgrading an existing MySQL - installation, have not already changed the values of - these parameters from their previous defaults, and - backward compatibility is a concern, you may want to - explicitly set these parameters to their previous - defaults. For example, put these lines in the server - option file: -[mysqld] -innodb_file_per_table=0 -innodb_checksum_algorithm=INNODB -binlog_checksum=NONE - - Those settings preserve compatibility as follows: - - + With the new default of innodb_file_per_table - enabled, ALTER TABLE operations following an upgrade - will move InnoDB tables that are in the system - tablespace to individual .ibd files. Using - innodb_file_per_table=0 will prevent this from - happening. - - + Setting innodb_checksum_algorithm=INNODB permits - binary downgrades after upgrading to this release. - With a setting of CRC32, InnoDB would use - checksumming that older MySQL versions cannot use. - - + With binlog_checksum=NONE, the server can be used as - a replication master without causing failure of - older slaves that do not understand binary log - checksums. - - * As of MySQL 5.6.5, pre-4.1 passwords and the - mysql_old_password authentication plugin are deprecated. - Passwords stored in the older hash format used before - MySQL 4.1 are less secure than passwords that use the - native password hashing method and should be avoided. To - prevent connections using accounts that have pre-4.1 - password hashes, the secure_auth system variable is now - enabled by default. (To permit connections for accounts - that have such password hashes, start the server with - --secure_auth=0.) - DBAs are advised to convert accounts that use the - mysql_old_password authentication plugin to use - mysql_native_password instead. For account upgrade - instructions, see Section 6.3.8.3, "Migrating Away from - Pre-4.1 Password Hashing and the mysql_old_password - Plugin." - Known issue: In some early development versions of MySQL - 5.6 (5.6.6 to 5.6.10), the server could create accounts - with a mismatched password hash and authentication - plugin. For example, if the default authentication plugin - is mysql_native_password, this sequence of statements - results in an account with a plugin of - mysql_native_password but a pre-4.1 password hash (the - format used by mysql_old_password): -SET old_passwords = 1; -CREATE USER 'jeffrey'@'localhost' IDENTIFIED BY 'mypass'; - - The mismatch produces symptoms such as being unable to - connect to the MySQL server and being unable to use SET - PASSWORD with OLD_PASSWORD() or with old_passwords=1. - As of MySQL 5.6.11, this mismatch no longer occurs. - Instead, the server produces an error: -mysql> SET old_passwords = 1; -mysql> CREATE USER 'jeffrey'@'localhost' IDENTIFIED BY 'mypass'; -ERROR 1827 (HY000): The password hash doesn't have the expected -format. Check if the correct password algorithm is being used with -the PASSWORD() function. - - To deal with an account affected by a mismatch, the DBA - can modify either the plugin or Password column in the - account's mysql.user table row to be consistent with the - other column: - - + Set old_passwords to 0, then assign a new password - to the account using SET PASSWORD and PASSWORD(). - This sets the Password column to have a 4.1 password - hash, consistent with the mysql_native_password - plugin. This is the preferred method of fixing the - account. - - + Alternatively, the DBA can change the plugin to - mysql_old_password to make the plugin match the - password hash format, then flush the privileges. - This is not recommended because the - mysql_old_password plugin and pre-4.1 password - hashing are deprecated and support for them will be - removed in a future version of MySQL. - -Server Changes - - - * Incompatible change: It is possible for a column DEFAULT - value to be valid for the sql_mode value at - table-creation time but invalid for the sql_mode value - when rows are inserted or updated. Example: -SET sql_mode = ''; -CREATE TABLE t (d DATE DEFAULT 0); -SET sql_mode = 'NO_ZERO_DATE,STRICT_ALL_TABLES'; -INSERT INTO t (d) VALUES(DEFAULT); - - In this case, 0 should be accepted for the CREATE TABLE - but rejected for the INSERT. However, the server did not - evaluate DEFAULT values used for inserts or updates - against the current sql_mode. In the example, the INSERT - succeeds and inserts '0000-00-00' into the DATE column. - As of MySQL 5.6.13, the server applies the proper - sql_mode checks to generate a warning or error at insert - or update time. - A resulting incompatibility for replication if you use - statement-based logging (binlog_format=STATEMENT) is that - if a slave is upgraded, a nonupgraded master will execute - the preceding example without error, whereas the INSERT - will fail on the slave and replication will stop. - To deal with this, stop all new statements on the master - and wait until the slaves catch up. Then upgrade the - slaves followed by the master. Alternatively, if you - cannot stop new statements, temporarily change to - row-based logging on the master (binlog_format=ROW) and - wait until all slaves have processed all binary logs - produced up to the point of this change. Then upgrade the - slaves followed by the master and change the master back - to statement-based logging. - - * Incompatible change: MySQL 5.6.11 and later supports - CREATE TABLE ... [SUB]PARTITION BY ALGORITHM=n [LINEAR] - KEY (...), which can be used to create a table whose KEY - partitioning is compatible with a MySQL 5.1 server (n=1). - (Bug #14521864, Bug #66462) This syntax is not accepted - by MySQL 5.6.10 and earlier, although it is supported in - MySQL 5.5 beginning with MySQL 5.5.31. mysqldump in MySQL - 5.5.31 and later MySQL 5.5 releases includes the - ALGORITHM option when dumping tables using this option, - but surrounds it with conditional comments, like this: -CREATE TABLE t1 (a INT) -/*!50100 PARTITION BY KEY */ /*!50531 ALGORITHM = 1 */ /*!50100 () - PARTITIONS 3 */ - - When importing a dump containing such CREATE TABLE - statements into a MySQL 5.6.10 or earlier MySQL 5.6 - server, the versioned comment is not ignored, which - causes a syntax error. Therefore, prior to importing such - a dump file, you must either change the comments so that - the MySQL 5.6 server ignores them (by removing the string - !50531 or replacing it with !50611, wherever it occurs), - or remove them. - This is not an issue with dump files made using MySQL - 5.6.11 or later, where the ALGORITHM option is written - using /*!50611 ... */. - - * Incompatible change: For TIME, DATETIME, and TIMESTAMP - columns, the storage required for tables created before - MySQL 5.6.4 differs from storage required for tables - created in 5.6.4 and later. This is due to a change in - 5.6.4 that permits these temporal types to have a - fractional part. After upgrading from MySQL 5.5 to MySQL - 5.6.4 or later, it is recommended that you also upgrade - from MySQL 5.5 to MySQL 5.6 TIME, DATETIME, and TIMESTAMP - types. ALTER TABLE currently allows the creation of - tables containing temporal columns in both MySQL 5.5 and - MySQL 5.6.4 (or later) binary format but this makes it - more difficult to recreate tables in cases where .frm - files are not available. Additionally, as of MySQL 5.6.4, - the aforementioned temporal types are more space - efficient. For more information about changes to temporal - types in MySQL 5.6.4, see Section 11.7, "." - As of MySQL 5.6.16, ALTER TABLE upgrades old temporal - columns to 5.6 format for ADD COLUMN, CHANGE COLUMN, - MODIFY COLUMN, ADD INDEX, and FORCE operations. Hence, - the following statement upgrades a table containing - columns in the old format: -ALTER TABLE tbl_name FORCE; - - This conversion cannot be done using the INPLACE - algorithm because the table must be rebuilt, so - specifying ALGORITHM=INPLACE in these cases results in an - error. Specify ALGORITHM=COPY if necessary. - When ALTER TABLE does produce a temporal-format - conversion, it generates a message that can be displayed - with SHOW WARNINGS: TIME/TIMESTAMP/DATETIME columns of - old format have been upgraded to the new format. - - * Due to the temporal type changes described in the - previous incompatible change item above, importing - pre-MySQL 5.6.4 tables that contain DATETIME and - TIMESTAMP types into MySQL 5.6.4 (or later) fails. - Importing a MySQL 5.5 table with these temporal types - into MySQL 5.6.4 (or later) is the mostly likely scenario - for this problem to occur. - The following procedures describe workarounds that use - the original pre-MySQL 5.6.4 .frm file to recreate a - table with a row structure that is compatible with 5.6.4 - (or later). The procedures involve changing the original - pre-MySQL 5.6.4 .frm file to use the Memory storage - engine instead of InnoDB, copying the .frm file to the - data directory of the destination instance, and using - ALTER TABLE to change the table's storage engine type - back to InnoDB. Use the first procedure if your tables do - not have foreign keys. Use the second procedure, which - has additional steps, if your table includes foreign - keys. - If the table does not have foreign keys: - - 1. Copy the table's original .frm file to the data - directory on the server where you want to import the - tablespace. - - 2. Modify the table's .frm file to use the Memory - storage engine instead of the InnoDB storage engine. - This modification requires changing 7 bytes in the - .frm file that define the table's storage engine - type. Using a hexidecimal editing tool: - o Change the byte at offset position 0003, which - is the legacy_db_type, from "0c" (for InnoDB) - to "06" (for Memory), as shown below: -00000000 fe 01 09 06 03 00 00 10 01 00 00 30 00 00 10 00 - - o The remaining 6 bytes do not have a fixed - offset. Search the .frm file for "InnoDB" to - locate the line with the other 6 bytes. The - line appears as shown below: -00001010 ff 00 00 00 00 00 00 06 00 49 6e 6e 6f 44 42 00 |......... -InnoDB.| - - o Modify the bytes so that the line appears as - follows: -00001010 ff 00 00 00 00 00 00 06 00 4d 45 4d 4f 52 59 00 - - - 3. Run ALTER TABLE ... ENGINE=INNODB to add the table - definition to the InnoDB data dictionary. This - creates the InnoDB table with the temporal data - types in the new format. For the ALTER TABLE - operation to complete successfully, the .frm file - must correspond to the tablespace. - - 4. Import the table using ALTER TABLE ... IMPORT - TABLESPACE. - If table has foreign keys: - - 1. Recreate the tables with foreign keys using table - definitions from SHOW CREATE TABLE output. The - incorrect temporal column formats do not matter at - this point. - - 2. Dump all foreign key definitions to a text file by - selecting the foreign key information from - INFORMATION_SCHEMA.TABLE_CONSTRAINTS and - INFORMATION_SCHEMA.KEY_COLUMN_USAGE. - - 3. Drop all tables and complete the table import - process described in steps 1 to 4 in the procedure - described above for tables without foreign keys. - - 4. After the import operation is complete, add the - foreign keys from foreign key definitions that you - saved to a text file. - - * Incompatible change: As of MySQL 5.6, the full-text - stopword file is loaded and searched using latin1 if - character_set_server is ucs2, utf16, utf16le, or utf32. - If any table was created with FULLTEXT indexes while the - server character set was ucs2, utf16, utf16le, or utf32, - repair it using this statement: -REPAIR TABLE tbl_name QUICK; - - - * Incompatible change: In MySQL 5.6.20, the patch for Bug - #69477 limits the size of redo log BLOB writes to 10% of - the redo log file size. As a result of this new limit, - innodb_log_file_size should be set to a value greater - than 10 times the largest BLOB data size found in the - rows of your tables. No action is required if your - innodb_log_file_size setting is already 10 times the - largest BLOB data size or your tables contain no BLOB - data. - In MySQL 5.6.22, the redo log BLOB write limit is relaxed - to 10% of the total redo log size (innodb_log_file_size * - innodb_log_files_in_group). (Bug #19498877) - -SQL Changes - - - * Some keywords may be reserved in MySQL 5.6 that were not - reserved in MySQL 5.5. See Section 9.3, "Reserved Words." - - * The YEAR(2) data type has certain issues that you should - consider before choosing to use it. As of MySQL 5.6.6, - YEAR(2) is deprecated. YEAR(2) columns in existing tables - are treated as before, but YEAR(2) in new or altered - tables are converted to YEAR(4). For more information, - see Section 11.3.4, "YEAR(2) Limitations and Migrating to - YEAR(4)." - - * As of MySQL 5.6.6, it is explicitly disallowed to assign - the value DEFAULT to stored procedure or function - parameters or stored program local variables (for example - with a SET var_name = DEFAULT statement). This was not - previously supported, or documented as permitted, but is - flagged as an incompatible change in case existing code - inadvertently used this construct. It remains permissible - to assign DEFAULT to system variables, as before, but - assigning DEFAULT to parameters or local variables now - results in a syntax error. - After an upgrade to MySQL 5.6.6 or later, existing stored - programs that use this construct produce a syntax error - when invoked. If a mysqldump file from 5.6.5 or earlier - is loaded into 5.6.6 or later, the load operation fails - and affected stored program definitions must be changed. - - * In MySQL, the TIMESTAMP data type differs in nonstandard - ways from other data types: - - + TIMESTAMP columns not explicitly declared with the - NULL attribute are assigned the NOT NULL attribute. - (Columns of other data types, if not explicitly - declared as NOT NULL, permit NULL values.) Setting - such a column to NULL sets it to the current - timestamp. - - + The first TIMESTAMP column in a table, if not - declared with the NULL attribute or an explicit - DEFAULT or ON UPDATE clause, is automatically - assigned the DEFAULT CURRENT_TIMESTAMP and ON UPDATE - CURRENT_TIMESTAMP attributes. - - + TIMESTAMP columns following the first one, if not - declared with the NULL attribute or an explicit - DEFAULT clause, are automatically assigned DEFAULT - '0000-00-00 00:00:00' (the "zero" timestamp). For - inserted rows that specify no explicit value for - such a column, the column is assigned '0000-00-00 - 00:00:00' and no warning occurs. - Those nonstandard behaviors remain the default for - TIMESTAMP but as of MySQL 5.6.6 are deprecated and this - warning appears at startup: -[Warning] TIMESTAMP with implicit DEFAULT value is deprecated. -Please use --explicit_defaults_for_timestamp server option (see -documentation for more details). - - As indicated by the warning, to turn off the nonstandard - behaviors, enable the new explicit_defaults_for_timestamp - system variable at server startup. With this variable - enabled, the server handles TIMESTAMP as follows instead: - - + TIMESTAMP columns not explicitly declared as NOT - NULL permit NULL values. Setting such a column to - NULL sets it to NULL, not the current timestamp. - - + No TIMESTAMP column is assigned the DEFAULT - CURRENT_TIMESTAMP or ON UPDATE CURRENT_TIMESTAMP - attributes automatically. Those attributes must be - explicitly specified. - - + TIMESTAMP columns declared as NOT NULL and without - an explicit DEFAULT clause are treated as having no - default value. For inserted rows that specify no - explicit value for such a column, the result depends - on the SQL mode. If strict SQL mode is enabled, an - error occurs. If strict SQL mode is not enabled, the - column is assigned the implicit default of - '0000-00-00 00:00:00' and a warning occurs. This is - similar to how MySQL treats other temporal types - such as DATETIME. - To upgrade servers used for replication, upgrade the - slaves first, then the master. Replication between the - master and its slaves should work provided that all use - the same value of explicit_defaults_for_timestamp: - - 1. Bring down the slaves, upgrade them, configure them - with the desired value of - explicit_defaults_for_timestamp, and bring them back - up. - The slaves will recognize from the format of the - binary logs received from the master that the master - is older (predates the introduction of - explicit_defaults_for_timestamp) and that operations - on TIMESTAMP columns coming from the master use the - old TIMESTAMP behavior. - - 2. Bring down the master, upgrade it, and configure it - with the same explicit_defaults_for_timestamp value - used on the slaves, and bring it back up. - -2.11.2 Downgrading MySQL - - This section describes what to do to downgrade to an older - MySQL version, in the unlikely case that the previous version - worked better than the new one. - - It is always a good idea to make a backup beforehand, in case - a downgrade fails and leaves the instance in an unusable - state. - - To downgrade between General Availability (GA) status - versions within the same release series, typically you just - install the new binaries on top of the old ones and do not - make any changes to the databases. - - Downgrades between milestone releases (or from a GA release - to a milestone release) within the same release series are - not supported and you may encounter issues. - - The following items form a checklist of things to do whenever - you perform a downgrade: - - * Read the upgrading section for the release series from - which you are downgrading to be sure that it does not - have any features you really need. See Section 2.11.1, - "Upgrading MySQL." - - * If there is a downgrading section for that version, read - that as well. - - * To see which new features were added between the version - to which you are downgrading and your current version, - see the Release Notes - (http://dev.mysql.com/doc/relnotes/mysql/5.6/en/). - - * Check Section 2.11.3, "Checking Whether Tables or Indexes - Must Be Rebuilt," to see whether changes to table formats - or to character sets or collations were made between your - current version of MySQL and the version to which you are - downgrading. If so and these changes result in an - incompatibility between MySQL versions, you will need to - downgrade the affected tables using the instructions in - Section 2.11.4, "Rebuilding or Repairing Tables or - Indexes." - - In most cases, you can move the MySQL format files and data - files between different GA versions on the same architecture - as long as you stay within versions for the same release - series of MySQL. - - If you downgrade from one release series to another, there - may be incompatibilities in table storage formats. In this - case, use mysqldump to dump your tables before downgrading. - After downgrading, reload the dump file using mysql or - mysqlimport to re-create your tables. For examples, see - Section 2.11.5, "Copying MySQL Databases to Another Machine." - - A typical symptom of a downward-incompatible table format - change when you downgrade is that you cannot open tables. In - that case, use the following procedure: - - 1. Stop the older MySQL server that you are downgrading to. - - 2. Restart the newer MySQL server you are downgrading from. - - 3. Dump any tables that were inaccessible to the older - server by using mysqldump to create a dump file. - - 4. Stop the newer MySQL server and restart the older one. - - 5. Reload the dump file into the older server. Your tables - should be accessible. - - If system tables in the mysql database changed, downgrading - might introduce some loss of functionality or require some - adjustments. Here are some examples: - - * Trigger creation requires the TRIGGER privilege as of - MySQL 5.1. In MySQL 5.0, there is no TRIGGER privilege - and SUPER is required instead. If you downgrade from - MySQL 5.1 to 5.0, you will need to give the SUPER - privilege to those accounts that had the TRIGGER - privilege in 5.1. - - * Triggers were added in MySQL 5.0, so if you downgrade - from 5.0 to 4.1, you cannot use triggers at all. - - * The mysql.proc.comment column definition changed between - MySQL 5.1 and 5.5. After a downgrade from 5.5 to 5.1, - this table is seen as corrupt and in need of repair. To - workaround this problem, execute mysql_upgrade from the - version of MySQL to which you downgraded. - -2.11.2.1 Downgrading to MySQL 5.5 - - When downgrading to MySQL 5.5 from MySQL 5.6, keep in mind - the following issues relating to behavior or features in - MySQL 5.6 that differ in MySQL 5.5: - -System Tables - - - * The mysql.user table in MySQL 5.6 has a password_expired - column. The mysql.user table in MySQL 5.5 does not. This - means that an account with an expired password in MySQL - 5.6 will work normally in MySQL 5.5. - -Data Types - - - * For TIME, DATETIME, and TIMESTAMP columns, the storage - required for tables created before MySQL 5.6.4 differs - from storage required for tables created in 5.6.4 and - later. This is due to a change in 5.6.4 that permits - these temporal types to have a fractional part. To - downgrade to a version older than 5.6.4, dump affected - tables with mysqldump before downgrading, and reload the - tables after downgrading. - -InnoDB - - - * InnoDB search indexes (with a type of FULLTEXT), - introduced in MySQL 5.6.4, are not compatible with - earlier versions of MySQL, including earlier releases in - the 5.6 series. Drop such indexes before performing a - downgrade. - - * InnoDB small page sizes specified by the innodb_page_size - configuration option, introduced in MySQL 5.6.4, are not - compatible with earlier versions of MySQL, including - earlier releases in the 5.6 series. Dump all InnoDB - tables in instances that use a smaller InnoDB page size, - drop the tables, and re-create and reload them after the - downgrade. - -Replication - - - * As of MySQL 5.6, the relay-log.info file contains a line - count and a replication delay value, so the file format - differs from that in older versions. See Section - 17.2.2.2, "Slave Status Logs." If you downgrade a slave - server to a version older than MySQL 5.6, the older - server will not read the file correctly. To address this, - modify the file in a text editor to delete the initial - line containing the number of lines. - - * Beginning with MySQL 5.6.6, the MySQL Server employs - Version 2 binary log events when writing the binary log. - Binary logs written using Version 2 log events cannot by - read by earlier versions of MySQL Server. To generate a - binary log that is written using Version 1 log events - readable by older servers, start the MySQL 5.6.6 or later - server using --log-bin-use-v1-row-events=1, which forces - the server to employ Version 1 events when writing the - binary log. - -2.11.3 Checking Whether Tables or Indexes Must Be Rebuilt - - A binary upgrade or downgrade is one that installs one - version of MySQL "in place" over an existing version, without - dumping and reloading tables: - - 1. Stop the server for the existing version if it is - running. - - 2. Install a different version of MySQL. This is an upgrade - if the new version is higher than the original version, a - downgrade if the version is lower. - - 3. Start the server for the new version. - - In many cases, the tables from the previous version of MySQL - can be used without problem by the new version. However, - sometimes changes occur that require tables or table indexes - to be rebuilt, as described in this section. If you have - tables that are affected by any of the issues described here, - rebuild the tables or indexes as necessary using the - instructions given in Section 2.11.4, "Rebuilding or - Repairing Tables or Indexes." - -Table Incompatibilities - - After a binary upgrade to MySQL 5.1 from a MySQL 5.0 - installation that contains ARCHIVE tables, accessing those - tables causes the server to crash, even if you have run - mysql_upgrade or CHECK TABLE ... FOR UPGRADE. To work around - this problem, use mysqldump to dump all ARCHIVE tables before - upgrading, and reload them into MySQL 5.1 after upgrading. - The same problem occurs for binary downgrades from MySQL 5.1 - to 5.0. - - The upgrade problem is fixed in MySQL 5.6.4: The server can - open ARCHIVE tables created in MySQL 5.0. However, it remains - the recommended upgrade procedure to dump 5.0 ARCHIVE tables - before upgrading and reload them after upgrading. - -Index Incompatibilities - - In MySQL 5.6.3, the length limit for index prefix keys is - increased from 767 bytes to 3072 bytes, for InnoDB tables - using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED. See - Section 14.6.7, "Limits on InnoDB Tables" for details. This - change is also backported to MySQL 5.5.14. If you downgrade - from one of these releases or higher, to an earlier release - with a lower length limit, the index prefix keys could be - truncated at 767 bytes or the downgrade could fail. This - issue could only occur if the configuration option - innodb_large_prefix was enabled on the server being - downgraded. - - If you perform a binary upgrade without dumping and reloading - tables, you cannot upgrade directly from MySQL 4.1 to 5.1 or - higher. This occurs due to an incompatible change in the - MyISAM table index format in MySQL 5.0. Upgrade from MySQL - 4.1 to 5.0 and repair all MyISAM tables. Then upgrade from - MySQL 5.0 to 5.1 and check and repair your tables. - - Modifications to the handling of character sets or collations - might change the character sort order, which causes the - ordering of entries in any index that uses an affected - character set or collation to be incorrect. Such changes - result in several possible problems: - - * Comparison results that differ from previous results - - * Inability to find some index values due to misordered - index entries - - * Misordered ORDER BY results - - * Tables that CHECK TABLE reports as being in need of - repair - - The solution to these problems is to rebuild any indexes that - use an affected character set or collation, either by - dropping and re-creating the indexes, or by dumping and - reloading the entire table. In some cases, it is possible to - alter affected columns to use a different collation. For - information about rebuilding indexes, see Section 2.11.4, - "Rebuilding or Repairing Tables or Indexes." - - To check whether a table has indexes that must be rebuilt, - consult the following list. It indicates which versions of - MySQL introduced character set or collation changes that - require indexes to be rebuilt. Each entry indicates the - version in which the change occurred and the character sets - or collations that the change affects. If the change is - associated with a particular bug report, the bug number is - given. - - The list applies both for binary upgrades and downgrades. For - example, Bug #27877 was fixed in MySQL 5.1.24, so it applies - to upgrades from versions older than 5.1.24 to 5.1.24 or - newer, and to downgrades from 5.1.24 or newer to versions - older than 5.1.24. - - In many cases, you can use CHECK TABLE ... FOR UPGRADE to - identify tables for which index rebuilding is required. It - will report this message: -Table upgrade required. -Please do "REPAIR TABLE `tbl_name`" or dump/reload to fix it! - - In these cases, you can also use mysqlcheck --check-upgrade - or mysql_upgrade, which execute CHECK TABLE. However, the use - of CHECK TABLE applies only after upgrades, not downgrades. - Also, CHECK TABLE is not applicable to all storage engines. - For details about which storage engines CHECK TABLE supports, - see Section 13.7.2.2, "CHECK TABLE Syntax." - - These changes cause index rebuilding to be necessary: - - * MySQL 5.1.24 (Bug #27877) - Affects indexes that use the utf8_general_ci or - ucs2_general_ci collation for columns that contain 'ß' - LATIN SMALL LETTER SHARP S (German). The bug fix - corrected an error in the original collations but - introduced an incompatibility such that 'ß' compares - equal to characters with which it previously compared - different. - Affected tables can be detected by CHECK TABLE ... FOR - UPGRADE as of MySQL 5.1.30 (see Bug #40053). - A workaround for this issue is implemented as of MySQL - 5.1.62, 5.5.21, and 5.6.5. The workaround involves - altering affected columns to use the - utf8_general_mysql500_ci and ucs2_general_mysql500_ci - collations, which preserve the original pre-5.1.24 - ordering of utf8_general_ci and ucs2_general_ci. - - * MySQL 5.0.48, 5.1.23 (Bug #27562) - Affects indexes that use the ascii_general_ci collation - for columns that contain any of these characters: '`' - GRAVE ACCENT, '[' LEFT SQUARE BRACKET, '\' REVERSE - SOLIDUS, ']' RIGHT SQUARE BRACKET, '~' TILDE - Affected tables can be detected by CHECK TABLE ... FOR - UPGRADE as of MySQL 5.1.29 (see Bug #39585). - - * MySQL 5.0.48, 5.1.21 (Bug #29461) - Affects indexes for columns that use any of these - character sets: eucjpms, euc_kr, gb2312, latin7, macce, - ujis - Affected tables can be detected by CHECK TABLE ... FOR - UPGRADE as of MySQL 5.1.29 (see Bug #39585). - -2.11.4 Rebuilding or Repairing Tables or Indexes - - This section describes how to rebuild a table, following - changes to MySQL such as how data types or character sets are - handled. For example, an error in a collation might have been - corrected, requiring a table rebuild to update the indexes - for character columns that use the collation. (For examples, - see Section 2.11.3, "Checking Whether Tables or Indexes Must - Be Rebuilt.") You might also need to repair or upgrade a - table, as indicated by a table check operation such as that - performed by CHECK TABLE, mysqlcheck, or mysql_upgrade. - - Methods for rebuilding a table include dumping and reloading - it, or using ALTER TABLE or REPAIR TABLE. REPAIR TABLE only - applies to MyISAM, ARCHIVE, and CSV tables. - Note - - If you are rebuilding tables because a different version of - MySQL will not handle them after a binary (in-place) upgrade - or downgrade, you must use the dump-and-reload method. Dump - the tables before upgrading or downgrading using your - original version of MySQL. Then reload the tables after - upgrading or downgrading. - - If you use the dump-and-reload method of rebuilding tables - only for the purpose of rebuilding indexes, you can perform - the dump either before or after upgrading or downgrading. - Reloading still must be done afterward. - - To rebuild a table by dumping and reloading it, use mysqldump - to create a dump file and mysql to reload the file: -shell> mysqldump db_name t1 > dump.sql -shell> mysql db_name < dump.sql - - To rebuild all the tables in a single database, specify the - database name without any following table name: -shell> mysqldump db_name > dump.sql -shell> mysql db_name < dump.sql - - To rebuild all tables in all databases, use the - --all-databases option: -shell> mysqldump --all-databases > dump.sql -shell> mysql < dump.sql - - To rebuild a table with ALTER TABLE, use a "null" alteration; - that is, an ALTER TABLE statement that "changes" the table to - use the storage engine that it already has. For example, if - t1 is an InnoDB table, use this statement: -mysql> ALTER TABLE t1 ENGINE = InnoDB; - - If you are not sure which storage engine to specify in the - ALTER TABLE statement, use SHOW CREATE TABLE to display the - table definition. - - If you need to rebuild an InnoDB table because a CHECK TABLE - operation indicates that a table upgrade is required, use - mysqldump to create a dump file and mysql to reload the file, - as described earlier. If the CHECK TABLE operation indicates - that there is a corruption or causes InnoDB to fail, refer to - Section 14.19.2, "Forcing InnoDB Recovery" for information - about using the innodb_force_recovery option to restart - InnoDB. To understand the type of problem that CHECK TABLE - may be encountering, refer to the InnoDB notes in Section - 13.7.2.2, "CHECK TABLE Syntax." - - For MyISAM, ARCHIVE, or CSV tables, you can use REPAIR TABLE - if the table checking operation indicates that there is a - corruption or that an upgrade is required. For example, to - repair a MyISAM table, use this statement: -mysql> REPAIR TABLE t1; - - mysqlcheck --repair provides command-line access to the - REPAIR TABLE statement. This can be a more convenient means - of repairing tables because you can use the --databases or - --all-databases option to repair all tables in specific - databases or all databases, respectively: -shell> mysqlcheck --repair --databases db_name ... -shell> mysqlcheck --repair --all-databases - - For incompatibilities introduced in MySQL 5.1.24 by the fix - for Bug #27877 that corrected the utf8_general_ci and - ucs2_general_ci collations, a workaround is implemented as of - MySQL 5.1.62, 5.5.21, and 5.6.5. Upgrade to one of those - versions, then convert each affected table using one of the - following methods. In each case, the workaround altering - affected columns to use the utf8_general_mysql500_ci and - ucs2_general_mysql500_ci collations, which preserve the - original pre-5.1.24 ordering of utf8_general_ci and - ucs2_general_ci. - - * To convert an affected table after a binary upgrade that - leaves the table files in place, alter the table to use - the new collation. Suppose that the table t1 contains one - or more problematic utf8 columns. To convert the table at - the table level, use a statement like this: -ALTER TABLE t1 -CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci; - - To apply the change on a column-specific basis, use a - statement like this (be sure to repeat the column - definition as originally specified except for the COLLATE - clause): -ALTER TABLE t1 -MODIFY c1 CHAR(N) CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci; - - - * To upgrade the table using a dump and reload procedure, - dump the table using mysqldump, modify the CREATE TABLE - statement in the dump file to use the new collation, and - reload the table. - - After making the appropriate changes, CHECK TABLE should - report no error. - -2.11.5 Copying MySQL Databases to Another Machine - - In cases where you need to transfer databases between - different architectures, you can use mysqldump to create a - file containing SQL statements. You can then transfer the - file to the other machine and feed it as input to the mysql - client. - Note - - You can copy the .frm, .MYI, and .MYD files for MyISAM tables - between different architectures that support the same - floating-point format. (MySQL takes care of any byte-swapping - issues.) See Section 15.2, "The MyISAM Storage Engine." - - Use mysqldump --help to see what options are available. - - The easiest (although not the fastest) way to move a database - between two machines is to run the following commands on the - machine on which the database is located: -shell> mysqladmin -h 'other_hostname' create db_name -shell> mysqldump db_name | mysql -h 'other_hostname' db_name - - If you want to copy a database from a remote machine over a - slow network, you can use these commands: -shell> mysqladmin create db_name -shell> mysqldump -h 'other_hostname' --compress db_name | mysql db_nam -e - - You can also store the dump in a file, transfer the file to - the target machine, and then load the file into the database - there. For example, you can dump a database to a compressed - file on the source machine like this: -shell> mysqldump --quick db_name | gzip > db_name.gz - - Transfer the file containing the database contents to the - target machine and run these commands there: -shell> mysqladmin create db_name -shell> gunzip < db_name.gz | mysql db_name - - You can also use mysqldump and mysqlimport to transfer the - database. For large tables, this is much faster than simply - using mysqldump. In the following commands, DUMPDIR - represents the full path name of the directory you use to - store the output from mysqldump. - - First, create the directory for the output files and dump the - database: -shell> mkdir DUMPDIR -shell> mysqldump --tab=DUMPDIR db_name - - Then transfer the files in the DUMPDIR directory to some - corresponding directory on the target machine and load the - files into MySQL there: -shell> mysqladmin create db_name # create database -shell> cat DUMPDIR/*.sql | mysql db_name # create tables in database -shell> mysqlimport db_name DUMPDIR/*.txt # load data into tables - - Do not forget to copy the mysql database because that is - where the grant tables are stored. You might have to run - commands as the MySQL root user on the new machine until you - have the mysql database in place. - - After you import the mysql database on the new machine, - execute mysqladmin flush-privileges so that the server - reloads the grant table information. - -2.12 Environment Variables - - This section lists all the environment variables that are - used directly or indirectly by MySQL. Most of these can also - be found in other places in this manual. - - Note that any options on the command line take precedence - over values specified in option files and environment - variables, and values in option files take precedence over - values in environment variables. - - In many cases, it is preferable to use an option file instead - of environment variables to modify the behavior of MySQL. See - Section 4.2.6, "Using Option Files." - Variable Description - CXX The name of your C++ compiler (for running CMake). - CC The name of your C compiler (for running CMake). - DBI_USER The default user name for Perl DBI. - DBI_TRACE Trace options for Perl DBI. - HOME The default path for the mysql history file is - $HOME/.mysql_history. - LD_RUN_PATH Used to specify the location of - libmysqlclient.so. - LIBMYSQL_ENABLE_CLEARTEXT_PLUGIN Enable mysql_clear_password - authentication plugin; see Section 6.3.8.7, "The Cleartext - Client-Side Authentication Plugin." - LIBMYSQL_PLUGIN_DIR Directory in which to look for client - plugins. - LIBMYSQL_PLUGINS Client plugins to preload. - MYSQL_DEBUG Debug trace options when debugging. - MYSQL_GROUP_SUFFIX Option group suffix value (like specifying - --defaults-group-suffix). - MYSQL_HISTFILE The path to the mysql history file. If this - variable is set, its value overrides the default for - $HOME/.mysql_history. - MYSQL_HISTIGNORE Patterns specifying statements not to log to - $HOME/.mysql_history. - MYSQL_HOME The path to the directory in which the - server-specific my.cnf file resides. - MYSQL_HOST The default host name used by the mysql - command-line client. - MYSQL_PS1 The command prompt to use in the mysql command-line - client. - MYSQL_PWD The default password when connecting to mysqld. - Note that using this is insecure. See Section 6.1.2.1, - "End-User Guidelines for Password Security." - MYSQL_TCP_PORT The default TCP/IP port number. - MYSQL_TEST_LOGIN_FILE The name of the .mylogin.cnf login - file. - MYSQL_UNIX_PORT The default Unix socket file name; used for - connections to localhost. - PATH Used by the shell to find MySQL programs. - TMPDIR The directory where temporary files are created. - TZ This should be set to your local time zone. See Section - B.5.4.6, "Time Zone Problems." - UMASK The user-file creation mode when creating files. See - note following table. - UMASK_DIR The user-directory creation mode when creating - directories. See note following table. - USER The default user name on Windows when connecting to - mysqld. - - For information about the mysql history file, see Section - 4.5.1.3, "mysql Logging." - - MYSQL_TEST_LOGIN_FILE is the path name of the login file (the - file created by mysql_config_editor). If not set, the default - value is %APPDATA%\MySQL\.mylogin.cnf directory on Windows - and $HOME/.mylogin.cnf on non-Windows systems. See Section - 4.6.6, "mysql_config_editor --- MySQL Configuration Utility." - - The UMASK and UMASK_DIR variables, despite their names, are - used as modes, not masks: - - * If UMASK is set, mysqld uses ($UMASK | 0600) as the mode - for file creation, so that newly created files have a - mode in the range from 0600 to 0666 (all values octal). - - * If UMASK_DIR is set, mysqld uses ($UMASK_DIR | 0700) as - the base mode for directory creation, which then is - AND-ed with ~(~$UMASK & 0666), so that newly created - directories have a mode in the range from 0700 to 0777 - (all values octal). The AND operation may remove read and - write permissions from the directory mode, but not - execute permissions. - - MySQL assumes that the value for UMASK or UMASK_DIR is in - octal if it starts with a zero. - -2.13 Perl Installation Notes - - The Perl DBI module provides a generic interface for database - access. You can write a DBI script that works with many - different database engines without change. To use DBI, you - must install the DBI module, as well as a DataBase Driver - (DBD) module for each type of database server you want to - access. For MySQL, this driver is the DBD::mysql module. - - Perl, and the DBD::MySQL module for DBI must be installed if - you want to run the MySQL benchmark scripts; see Section - 8.12.2, "The MySQL Benchmark Suite." - Note - - Perl support is not included with MySQL distributions. You - can obtain the necessary modules from http://search.cpan.org - for Unix, or by using the ActiveState ppm program on Windows. - The following sections describe how to do this. - - The DBI/DBD interface requires Perl 5.6.0, and 5.6.1 or later - is preferred. DBI does not work if you have an older version - of Perl. You should use DBD::mysql 4.009 or higher. Although - earlier versions are available, they do not support the full - functionality of MySQL 5.6. - -2.13.1 Installing Perl on Unix - - MySQL Perl support requires that you have installed MySQL - client programming support (libraries and header files). Most - installation methods install the necessary files. If you - install MySQL from RPM files on Linux, be sure to install the - developer RPM as well. The client programs are in the client - RPM, but client programming support is in the developer RPM. - - The files you need for Perl support can be obtained from the - CPAN (Comprehensive Perl Archive Network) at - http://search.cpan.org. - - The easiest way to install Perl modules on Unix is to use the - CPAN module. For example: -shell> perl -MCPAN -e shell -cpan> install DBI -cpan> install DBD::mysql - - The DBD::mysql installation runs a number of tests. These - tests attempt to connect to the local MySQL server using the - default user name and password. (The default user name is - your login name on Unix, and ODBC on Windows. The default - password is "no password.") If you cannot connect to the - server with those values (for example, if your account has a - password), the tests fail. You can use force install - DBD::mysql to ignore the failed tests. - - DBI requires the Data::Dumper module. It may be installed; if - not, you should install it before installing DBI. - - It is also possible to download the module distributions in - the form of compressed tar archives and build the modules - manually. For example, to unpack and build a DBI - distribution, use a procedure such as this: - - 1. Unpack the distribution into the current directory: -shell> gunzip < DBI-VERSION.tar.gz | tar xvf - - - This command creates a directory named DBI-VERSION. - - 2. Change location into the top-level directory of the - unpacked distribution: -shell> cd DBI-VERSION - - - 3. Build the distribution and compile everything: -shell> perl Makefile.PL -shell> make -shell> make test -shell> make install - - The make test command is important because it verifies that - the module is working. Note that when you run that command - during the DBD::mysql installation to exercise the interface - code, the MySQL server must be running or the test fails. - - It is a good idea to rebuild and reinstall the DBD::mysql - distribution whenever you install a new release of MySQL. - This ensures that the latest versions of the MySQL client - libraries are installed correctly. - - If you do not have access rights to install Perl modules in - the system directory or if you want to install local Perl - modules, the following reference may be useful: - http://learn.perl.org/faq/perlfaq8.html#How-do-I-keep-my-own- - module-library-directory- - -2.13.2 Installing ActiveState Perl on Windows - - On Windows, you should do the following to install the MySQL - DBD module with ActiveState Perl: - - 1. Get ActiveState Perl from - http://www.activestate.com/Products/ActivePerl/ and - install it. - - 2. Open a console window. - - 3. If necessary, set the HTTP_proxy variable. For example, - you might try a setting like this: -C:\> set HTTP_proxy=my.proxy.com:3128 - - - 4. Start the PPM program: -C:\> C:\perl\bin\ppm.pl - - - 5. If you have not previously done so, install DBI: -ppm> install DBI - - - 6. If this succeeds, run the following command: -ppm> install DBD-mysql - - This procedure should work with ActiveState Perl 5.6 or - newer. - - If you cannot get the procedure to work, you should install - the ODBC driver instead and connect to the MySQL server - through ODBC: -use DBI; -$dbh= DBI->connect("DBI:ODBC:$dsn",$user,$password) || - die "Got error $DBI::errstr when connecting to $dsn\n"; - -2.13.3 Problems Using the Perl DBI/DBD Interface - - If Perl reports that it cannot find the ../mysql/mysql.so - module, the problem is probably that Perl cannot locate the - libmysqlclient.so shared library. You should be able to fix - this problem by one of the following methods: - - * Copy libmysqlclient.so to the directory where your other - shared libraries are located (probably /usr/lib or /lib). - - * Modify the -L options used to compile DBD::mysql to - reflect the actual location of libmysqlclient.so. - - * On Linux, you can add the path name of the directory - where libmysqlclient.so is located to the /etc/ld.so.conf - file. - - * Add the path name of the directory where - libmysqlclient.so is located to the LD_RUN_PATH - environment variable. Some systems use LD_LIBRARY_PATH - instead. - - Note that you may also need to modify the -L options if there - are other libraries that the linker fails to find. For - example, if the linker cannot find libc because it is in /lib - and the link command specifies -L/usr/lib, change the -L - option to -L/lib or add -L/lib to the existing link command. - - If you get the following errors from DBD::mysql, you are - probably using gcc (or using an old binary compiled with - gcc): -/usr/bin/perl: can't resolve symbol '__moddi3' -/usr/bin/perl: can't resolve symbol '__divdi3' - - Add -L/usr/lib/gcc-lib/... -lgcc to the link command when the - mysql.so library gets built (check the output from make for - mysql.so when you compile the Perl client). The -L option - should specify the path name of the directory where libgcc.a - is located on your system. - - Another cause of this problem may be that Perl and MySQL are - not both compiled with gcc. In this case, you can solve the - mismatch by compiling both with gcc. diff --git a/mysql-wsrep-5.6/INSTALL-WIN-SOURCE b/mysql-wsrep-5.6/INSTALL-WIN-SOURCE deleted file mode 100644 index 26161d96..00000000 --- a/mysql-wsrep-5.6/INSTALL-WIN-SOURCE +++ /dev/null @@ -1,8 +0,0 @@ - -You can find information about how to install from a Windows source -distributions at - - http://dev.mysql.com/doc/refman/5.5/en/source-installation.html - -The MySQL Reference Manual is also available in various formats on -http://dev.mysql.com/doc. diff --git a/mysql-wsrep-5.6/README b/mysql-wsrep-5.6/README index d7ae7e1c..108364d0 100644 --- a/mysql-wsrep-5.6/README +++ b/mysql-wsrep-5.6/README @@ -5,7 +5,7 @@ For the avoidance of doubt, this particular copy of the software is released under the version 2 of the GNU General Public License. MySQL is brought to you by Oracle. -Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. License information can be found in the COPYING file. diff --git a/mysql-wsrep-5.6/VERSION b/mysql-wsrep-5.6/VERSION index f84d42f3..373e0b2d 100644 --- a/mysql-wsrep-5.6/VERSION +++ b/mysql-wsrep-5.6/VERSION @@ -1,4 +1,4 @@ MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MINOR=6 -MYSQL_VERSION_PATCH=23 +MYSQL_VERSION_PATCH=30 MYSQL_VERSION_EXTRA= diff --git a/mysql-wsrep-5.6/client/CMakeLists.txt b/mysql-wsrep-5.6/client/CMakeLists.txt index abf09a95..d24555a5 100644 --- a/mysql-wsrep-5.6/client/CMakeLists.txt +++ b/mysql-wsrep-5.6/client/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2015, 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 @@ -49,6 +49,7 @@ MYSQL_ADD_EXECUTABLE(mysqldump mysqldump.c ../sql-common/my_user.c) TARGET_LINK_LIBRARIES(mysqldump mysqlclient) MYSQL_ADD_EXECUTABLE(mysqlimport mysqlimport.c) +SET_SOURCE_FILES_PROPERTIES(mysqlimport.c PROPERTIES COMPILE_FLAGS "-DTHREADS") TARGET_LINK_LIBRARIES(mysqlimport mysqlclient) MYSQL_ADD_EXECUTABLE(mysql_upgrade mysql_upgrade.c) diff --git a/mysql-wsrep-5.6/client/client_priv.h b/mysql-wsrep-5.6/client/client_priv.h index bd7f0111..fbe60f4f 100644 --- a/mysql-wsrep-5.6/client/client_priv.h +++ b/mysql-wsrep-5.6/client/client_priv.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2001, 2016, 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 @@ -100,6 +100,7 @@ enum options_client OPT_SERVER_PUBLIC_KEY, OPT_ENABLE_CLEARTEXT_PLUGIN, OPT_CONNECTION_SERVER_ID, + OPT_SSL_MODE, OPT_MAX_CLIENT_OPTION }; @@ -123,3 +124,36 @@ enum options_client */ #define PERFORMANCE_SCHEMA_DB_NAME "performance_schema" +/** + Wrapper for mysql_real_connect() that checks if SSL connection is establised. + + The function calls mysql_real_connect() first, then if given ssl_required==TRUE + argument (i.e. --ssl-mode=REQUIRED option used) checks current SSL chiper to + ensure that SSL is used for current connection. + Otherwise it returns NULL and sets errno to CR_SSL_CONNECTION_ERROR. + + All clients (except mysqlbinlog which disregards SSL options) use this function + instead of mysql_real_connect() to handle --ssl-mode=REQUIRED option. +*/ +MYSQL *mysql_connect_ssl_check(MYSQL *mysql_arg, const char *host, + const char *user, const char *passwd, + const char *db, uint port, + const char *unix_socket, ulong client_flag, + my_bool ssl_required __attribute__((unused))) +{ + MYSQL *mysql= mysql_real_connect(mysql_arg, host, user, passwd, db, port, + unix_socket, client_flag); +#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) + if (mysql && /* connection established. */ + ssl_required && /* --ssl-mode=REQUIRED. */ + !mysql_get_ssl_cipher(mysql)) /* non-SSL connection. */ + { + NET *net= &mysql->net; + net->last_errno= CR_SSL_CONNECTION_ERROR; + strmov(net->last_error, "--ssl-mode=REQUIRED option forbids non SSL connections"); + strmov(net->sqlstate, "HY000"); + return NULL; + } +#endif + return mysql; +} diff --git a/mysql-wsrep-5.6/client/mysql.cc b/mysql-wsrep-5.6/client/mysql.cc index 450bda04..af0af9d1 100644 --- a/mysql-wsrep-5.6/client/mysql.cc +++ b/mysql-wsrep-5.6/client/mysql.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2016, 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 @@ -1486,8 +1486,9 @@ sig_handler handle_kill_signal(int sig) mysql_options(kill_mysql, MYSQL_OPT_CONNECT_ATTR_RESET, 0); mysql_options4(kill_mysql, MYSQL_OPT_CONNECT_ATTR_ADD, "program_name", "mysql"); - if (!mysql_real_connect(kill_mysql,current_host, current_user, opt_password, - "", opt_mysql_port, opt_mysql_unix_port,0)) + if (!mysql_connect_ssl_check(kill_mysql, current_host, current_user, + opt_password, "", opt_mysql_port, + opt_mysql_unix_port, 0, opt_ssl_required)) { tee_fprintf(stdout, "%s -- sorry, cannot connect to server to kill query, giving up ...\n", reason); goto err; @@ -4815,9 +4816,10 @@ sql_real_connect(char *host,char *database,char *user,char *password, "program_name", "mysql"); mysql_options(&mysql, MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS, &handle_expired); - if (!mysql_real_connect(&mysql, host, user, password, - database, opt_mysql_port, opt_mysql_unix_port, - connect_flag | CLIENT_MULTI_STATEMENTS)) + if (!mysql_connect_ssl_check(&mysql, host, user, password, + database, opt_mysql_port, opt_mysql_unix_port, + connect_flag | CLIENT_MULTI_STATEMENTS, + opt_ssl_required)) { if (!silent || (mysql_errno(&mysql) != CR_CONN_HOST_ERROR && diff --git a/mysql-wsrep-5.6/client/mysql_config_editor.cc b/mysql-wsrep-5.6/client/mysql_config_editor.cc index 5997e63a..51a4d09c 100644 --- a/mysql-wsrep-5.6/client/mysql_config_editor.cc +++ b/mysql-wsrep-5.6/client/mysql_config_editor.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2012, 2015, 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 @@ -70,7 +70,7 @@ static my_bool check_and_create_login_file(void); static void mask_password_and_print(char *buf); static int reset_login_file(bool gen_key); -static int encrypt_buffer(const char *plain, int plain_len, char cipher[]); +static int encrypt_buffer(const char *plain, int plain_len, char cipher[], const int aes_len); static int decrypt_buffer(const char *cipher, int cipher_len, char plain[]); static int encrypt_and_write_file(DYNAMIC_STRING *file_buf); static int read_and_decrypt_file(DYNAMIC_STRING *file_buf); @@ -1203,15 +1203,21 @@ static int encrypt_and_write_file(DYNAMIC_STRING *file_buf) if (done) break; - if ((enc_len= encrypt_buffer(&file_buf->str[bytes_read], - ++ len, cipher + MAX_CIPHER_STORE_LEN)) < 0) + if ((enc_len= my_aes_get_size(len + 1, my_aes_128_ecb)) > + (MY_LINE_MAX - (int)MAX_CIPHER_STORE_LEN)) + { + my_perror("A parameter to mysql_config_editor exceeds the maximum " + "accepted length. Please review the data you've supplied " + "and try to shorten them permissible length.\n"); goto error; + } - bytes_read += len; - - if (enc_len > MY_LINE_MAX) + if (encrypt_buffer(&file_buf->str[bytes_read], ++len, + cipher + MAX_CIPHER_STORE_LEN, enc_len) < 0) goto error; + bytes_read += len; + /* Store cipher length first. */ int4store(cipher, enc_len); @@ -1297,12 +1303,9 @@ error: length encrypted, otherwise. */ -static int encrypt_buffer(const char *plain, int plain_len, char cipher[]) +static int encrypt_buffer(const char *plain, int plain_len, char cipher[], const int aes_len) { DBUG_ENTER("encrypt_buffer"); - int aes_len; - - aes_len= my_aes_get_size(plain_len, my_aes_128_ecb); if (my_aes_encrypt((const unsigned char *) plain, plain_len, (unsigned char *) cipher, diff --git a/mysql-wsrep-5.6/client/mysql_plugin.c b/mysql-wsrep-5.6/client/mysql_plugin.c index d959280c..ab7ee098 100644 --- a/mysql-wsrep-5.6/client/mysql_plugin.c +++ b/mysql-wsrep-5.6/client/mysql_plugin.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2011, 2015, 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 @@ -406,7 +406,7 @@ exit: static void usage(void) { PRINT_VERSION; - puts("Copyright (c) 2011, Oracle and/or its affiliates. " + puts("Copyright (c) 2011, 2015, Oracle and/or its affiliates. " "All rights reserved.\n"); puts("Enable or disable plugins."); printf("\nUsage: %s [options] ENABLE|DISABLE\n\nOptions:\n", @@ -793,6 +793,11 @@ static int check_options(int argc, char **argv, char *operation) /* read the plugin config file and check for match against argument */ else { + if (strlen(argv[i]) + 4 + 1 > FN_REFLEN) + { + fprintf(stderr, "ERROR: argument is too long.\n"); + return 1; + } strcpy(plugin_name, argv[i]); strcpy(config_file, argv[i]); strcat(config_file, ".ini"); @@ -884,6 +889,7 @@ static int process_options(int argc, char *argv[], char *operation) if (opt_basedir[i-1] != FN_LIBCHAR || opt_basedir[i-1] != FN_LIBCHAR2) { char buff[FN_REFLEN]; + memset(buff, 0, sizeof(buff)); strncpy(buff, opt_basedir, sizeof(buff) - 1); #ifdef __WIN__ diff --git a/mysql-wsrep-5.6/client/mysql_upgrade.c b/mysql-wsrep-5.6/client/mysql_upgrade.c index 929d8be6..f8df0cd4 100644 --- a/mysql-wsrep-5.6/client/mysql_upgrade.c +++ b/mysql-wsrep-5.6/client/mysql_upgrade.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2006, 2016, 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 @@ -310,6 +310,7 @@ get_one_option(int optid, const struct my_option *opt, case OPT_DEFAULT_AUTH: /* --default-auth */ add_one_option(&conn_args, opt, argument); break; +#include } if (add_option) @@ -400,6 +401,10 @@ static int run_tool(char *tool_path, DYNAMIC_STRING *ds_res, ...) va_end(args); + /* If given --ssl-mode=REQUIRED propagate it to the tool. */ + if (opt_ssl_required) + dynstr_append(&ds_cmdline, "--ssl-mode=REQUIRED"); + #ifdef __WIN__ dynstr_append(&ds_cmdline, "\""); #endif @@ -763,7 +768,7 @@ static int run_mysqlcheck_mysql_db_upgrade(void) } -/** performs the same operation as mysqlcheck_upgrade, but on the mysql db */ +/** performs the same operation as mysqlcheck_fixnames, but on the mysql db */ static int run_mysqlcheck_mysql_db_fixnames(void) { print_conn_args("mysqlcheck"); @@ -929,10 +934,16 @@ static int check_version_match(void) if (init_dynamic_string(&ds_version, NULL, NAME_CHAR_LEN, NAME_CHAR_LEN)) die("Out of memory"); - if (run_query("show variables like 'version'", - &ds_version, FALSE) || - extract_variable_from_show(&ds_version, version_str)) + if (run_query("show variables like 'version'", &ds_version, FALSE)) + { + fprintf(stderr, "Error: Failed while fetching Server version! Could be" + " due to unauthorized access.\n"); + dynstr_free(&ds_version); + return 1; /* Query failed */ + } + if (extract_variable_from_show(&ds_version, version_str)) { + fprintf(stderr, "Error: Failed while extracting Server version!\n"); dynstr_free(&ds_version); return 1; /* Query failed */ } @@ -1027,17 +1038,37 @@ int main(int argc, char **argv) Then do the upgrade. And then run mysqlcheck on all tables. */ - if ((!opt_systables_only && - (run_mysqlcheck_mysql_db_fixnames() || run_mysqlcheck_mysql_db_upgrade())) || - run_sql_fix_privilege_tables() || - (!opt_systables_only && - (run_mysqlcheck_fixnames() || run_mysqlcheck_upgrade()))) + if (!opt_systables_only) { - /* - The upgrade failed to complete in some way or another, - significant error message should have been printed to the screen - */ - die("Upgrade failed" ); + if (run_mysqlcheck_mysql_db_fixnames()) + { + die("Error during call to mysql_check for fixing the db/tables names on " + "mysql db"); + } + if (run_mysqlcheck_mysql_db_upgrade()) + { + die("Error during call to mysql_check for upgrading the tables names on " + "mysql db"); + } + } + if (run_sql_fix_privilege_tables()) + { + /* Specific error msg (if present) would be printed in the function call + * above */ + die("Upgrade failed"); + } + if (!opt_systables_only) + { + if (run_mysqlcheck_fixnames()) + { + die("Error during call to mysql_check for fixing the db/tables names on " + "all db(s) except mysql"); + } + if (run_mysqlcheck_upgrade()) + { + die("Error during call to mysql_check for upgrading the tables names on " + "all db(s) except mysql"); + } } verbose("OK"); diff --git a/mysql-wsrep-5.6/client/mysqladmin.cc b/mysql-wsrep-5.6/client/mysqladmin.cc index 4d3f6749..ab959c71 100644 --- a/mysql-wsrep-5.6/client/mysqladmin.cc +++ b/mysql-wsrep-5.6/client/mysqladmin.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2016, 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 @@ -334,8 +334,6 @@ int main(int argc,char *argv[]) free_defaults(save_argv); exit(ho_error); } - temp_argv= mask_password(argc, &argv); - temp_argc= argc; if (debug_info_flag) my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO; @@ -347,6 +345,10 @@ int main(int argc,char *argv[]) usage(); exit(1); } + + temp_argv= mask_password(argc, &argv); + temp_argc= argc; + commands = temp_argv; if (tty_password) opt_password = get_tty_password(NullS); @@ -549,8 +551,9 @@ static my_bool sql_connect(MYSQL *mysql, uint wait) for (;;) { - if (mysql_real_connect(mysql,host,user,opt_password,NullS,tcp_port, - unix_port, CLIENT_REMEMBER_OPTIONS)) + if (mysql_connect_ssl_check(mysql, host, user, opt_password, NullS, + tcp_port, unix_port, + CLIENT_REMEMBER_OPTIONS, opt_ssl_required)) { mysql->reconnect= 1; if (info) @@ -963,11 +966,12 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) case ADMIN_OLD_PASSWORD: case ADMIN_PASSWORD: { - char buff[128],crypted_pw[64]; + char crypted_pw[64]; time_t start_time; - char *typed_password= NULL, *verified= NULL; + char *buffer= NULL, *typed_password= NULL, *verified= NULL; bool log_off= true, err= false; int retry_count= 0; /* Attempts to SET PASSWORD */ + unsigned long version= 0; bool old= (option == ADMIN_OLD_PASSWORD); @@ -975,11 +979,19 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) start_time=time((time_t*) 0); randominit(&rand_st,(ulong) start_time,(ulong) start_time/2); + version = mysql_get_server_version(mysql); + if (argc < 1) { my_printf_error(0, "Too few arguments to change password", error_flags); return 1; } + else if (version >= 50700 && old) + { + my_printf_error(0, "old-password command is not supported by the " + "server version 5.7 and above", error_flags); + return 1; + } else if (argc == 1) { /* prompt for password */ @@ -998,6 +1010,18 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) typed_password= argv[1]; } + /* Allocate a buffer containing a query and a password (char * 2). */ + buffer= (char *)my_malloc(strlen(typed_password) * 2 + 64, MYF(MY_WME)); + + if (!buffer) + { + err= true; + goto error; + } + + /* Default set password query if no password is provided. */ + sprintf(buffer, "set password=''"); + if (typed_password[0]) { #ifdef __WIN__ @@ -1064,16 +1088,38 @@ retry: we will give one more try with old format. */ if (old) + { make_scrambled_password_323(crypted_pw, typed_password); - else + sprintf(buffer, "set password='%s'", crypted_pw); + } + else if (version < 50700) + { make_scrambled_password(crypted_pw, typed_password); - } - else - crypted_pw[0]=0; /* No password */ + sprintf(buffer, "set password='%s'", crypted_pw); + } + else + { + printf("Warning: Server version is 5.7 or greater. " + "The password will be sent to server in plain text. " + "Upgrade the mysqladmin to a version " + "that matches the server's version.\n"); + + int offset= sprintf(buffer, "ALTER USER USER() IDENTIFIED BY '"); + int length= (int)mysql_real_escape_string(mysql, buffer + offset, + typed_password, + strlen(typed_password)); + if (length == -1) + { + /* Should never fail. Buffer should be long enough.*/ + err= true; + goto error; + } - sprintf(buff, "set password='%s'", crypted_pw); + sprintf(buffer + offset + length, "'"); + } + } - if (mysql_query(mysql,buff)) + if (mysql_query(mysql,buffer)) { if ((mysql_errno(mysql) == ER_PASSWD_LENGTH) && !(option == ADMIN_OLD_PASSWORD) && !retry_count) @@ -1114,6 +1160,9 @@ retry: fprintf(stderr, "Note: Can't turn on logging; '%s'", mysql_error(mysql)); } error: + + my_free(buffer); + /* free up memory from prompted password */ if (typed_password != argv[1]) { diff --git a/mysql-wsrep-5.6/client/mysqlbinlog.cc b/mysql-wsrep-5.6/client/mysqlbinlog.cc index 711f9b3e..e305de00 100644 --- a/mysql-wsrep-5.6/client/mysqlbinlog.cc +++ b/mysql-wsrep-5.6/client/mysqlbinlog.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2015, 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 @@ -15,7 +15,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -/* +/* TODO: print the catalog (some USE catalog.db ????). @@ -1087,9 +1087,66 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev, case FORMAT_DESCRIPTION_EVENT: delete glob_description_event; glob_description_event= (Format_description_log_event*) ev; + /* + The first FD event in log is always generated + from the local server. So if it is first FD event to be + processed (i.e., if server_id_from_fd_event is 0), + get server_id from the FD event and keep it in + server_id_from_fd_event to differentiate between FDs + (originated from local server vs another server). + */ + if (print_event_info->server_id_from_fd_event == 0) + print_event_info->server_id_from_fd_event= ev->server_id; + print_event_info->common_header_len= glob_description_event->common_header_len; ev->print(result_file, print_event_info); + /* + At this point, if we are in transaction that means + we are reading a relay log file (transaction cannot + spawn across two binary log files, they are writen + at once in binlog). When AUTO_POSITION is enabled + and if IO thread stopped in between the GTID transaction, + upon IO thread restart, Master will send the GTID events + again from the begin of the transaction. Hence, we should + rollback the old transaction. + + If you are reading FD event that came from Master + (first FD event is from the server that owns the relaylog + and second one is from Master) and if it's log_pos is > 0 + then it represents the begin of a master's binary log + (any unfinished transaction will not be finished) or that + auto_position is enabled (any partial transaction left will + not be finished but will be fully retrieved again). On both + cases, the next transaction in the relay log will start from the + beginning and we must rollback any unfinished transaction + */ + if (ev->server_id !=0 && + ev->server_id != print_event_info->server_id_from_fd_event && + ev->log_pos > 0) + { + if (in_transaction) + { + my_b_printf(&print_event_info->head_cache, + "ROLLBACK /* added by mysqlbinlog */ %s\n", + print_event_info->delimiter); + } + else if (print_event_info->is_gtid_next_set && + print_event_info->is_gtid_next_valid) + { + /* + If we are here, then we have seen only GTID_LOG_EVENT + of a transaction and did not see even a BEGIN event + (in_transaction flag is false). So generate BEGIN event + also along with ROLLBACK event. + */ + my_b_printf(&print_event_info->head_cache, + "BEGIN /*added by mysqlbinlog */ %s\n" + "ROLLBACK /* added by mysqlbinlog */ %s\n", + print_event_info->delimiter, + print_event_info->delimiter); + } + } if (head->error == -1) goto err; if (opt_remote_proto == BINLOG_LOCAL) @@ -1331,7 +1388,21 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev, Fake rotate events have 'when' set to zero. @c fake_rotate_event(...). */ bool is_fake= (rev->when.tv_sec == 0); - if (!in_transaction && !is_fake) + /* + 'in_transaction' flag is not set to true even after GTID_LOG_EVENT + of a transaction is seen. ('mysqlbinlog' tool assumes that there + is only one event per DDL transaction other than BEGIN and COMMIT + events. Using 'in_transaction' flag and 'starts_group', 'ends_group' + flags, DDL transaction generation is handled. Hence 'in_transaction' + cannot be set to true after seeing GTID_LOG_EVENT). So in order to + see if we are out of a transaction or not, we should check that + 'in_transaction' is false and we have not seen GTID_LOG_EVENT. + To see if a GTID_LOG_EVENT of a transaction is seen or not, + we should check is_gtid_next_valid flag is false. + */ + if (!is_fake && !in_transaction && + print_event_info->is_gtid_next_set && + !print_event_info->is_gtid_next_valid) { /* If processing multiple files, we must reset this flag, diff --git a/mysql-wsrep-5.6/client/mysqlcheck.c b/mysql-wsrep-5.6/client/mysqlcheck.c index e40fb75a..6c3f4064 100644 --- a/mysql-wsrep-5.6/client/mysqlcheck.c +++ b/mysql-wsrep-5.6/client/mysqlcheck.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2001, 2016, 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 @@ -43,6 +43,8 @@ static my_bool opt_alldbs = 0, opt_check_only_changed = 0, opt_extended = 0, opt_fix_table_names= 0, opt_fix_db_names= 0, opt_upgrade= 0, opt_write_binlog= 1, opt_secure_auth=TRUE; static uint verbose = 0, opt_mysql_port=0; +static uint opt_enable_cleartext_plugin= 0; +static my_bool using_opt_enable_cleartext_plugin= 0; static int my_end_arg; static char * opt_mysql_unix_port = 0; static char *opt_password = 0, *current_user = 0, @@ -116,6 +118,10 @@ static struct my_option my_long_options[] = "Default authentication client-side plugin to use.", &opt_default_auth, &opt_default_auth, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"enable_cleartext_plugin", OPT_ENABLE_CLEARTEXT_PLUGIN, + "Enable/disable the clear text authentication plugin.", + &opt_enable_cleartext_plugin, &opt_enable_cleartext_plugin, + 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"fast",'F', "Check only tables that haven't been closed properly.", &opt_fast, &opt_fast, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, @@ -338,6 +344,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), verbose++; break; case 'V': print_version(); exit(0); + case OPT_ENABLE_CLEARTEXT_PLUGIN: + using_opt_enable_cleartext_plugin= TRUE; + break; case OPT_MYSQL_PROTOCOL: opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib, opt->name); @@ -907,12 +916,18 @@ static int dbConnect(char *host, char *user, char *passwd) if (opt_default_auth && *opt_default_auth) mysql_options(&mysql_connection, MYSQL_DEFAULT_AUTH, opt_default_auth); + if (using_opt_enable_cleartext_plugin) + mysql_options(&mysql_connection, MYSQL_ENABLE_CLEARTEXT_PLUGIN, + (char *) &opt_enable_cleartext_plugin); + mysql_options(&mysql_connection, MYSQL_SET_CHARSET_NAME, default_charset); mysql_options(&mysql_connection, MYSQL_OPT_CONNECT_ATTR_RESET, 0); mysql_options4(&mysql_connection, MYSQL_OPT_CONNECT_ATTR_ADD, "program_name", "mysqlcheck"); - if (!(sock = mysql_real_connect(&mysql_connection, host, user, passwd, - NULL, opt_mysql_port, opt_mysql_unix_port, 0))) + if (!(sock = mysql_connect_ssl_check(&mysql_connection, host, user, passwd, + NULL, opt_mysql_port, + opt_mysql_unix_port, 0, + opt_ssl_required))) { DBerror(&mysql_connection, "when trying to connect"); DBUG_RETURN(1); diff --git a/mysql-wsrep-5.6/client/mysqldump.c b/mysql-wsrep-5.6/client/mysqldump.c index b440ccfe..f7d72412 100644 --- a/mysql-wsrep-5.6/client/mysqldump.c +++ b/mysql-wsrep-5.6/client/mysqldump.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2016, 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 @@ -131,6 +131,8 @@ static ulong opt_compatible_mode= 0; #define MYSQL_OPT_MASTER_DATA_COMMENTED_SQL 2 #define MYSQL_OPT_SLAVE_DATA_EFFECTIVE_SQL 1 #define MYSQL_OPT_SLAVE_DATA_COMMENTED_SQL 2 +static uint opt_enable_cleartext_plugin= 0; +static my_bool using_opt_enable_cleartext_plugin= 0; static uint opt_mysql_port= 0, opt_master_data; static uint opt_slave_data; static uint my_end_arg; @@ -546,6 +548,10 @@ static struct my_option my_long_options[] = "Default authentication client-side plugin to use.", &opt_default_auth, &opt_default_auth, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"enable_cleartext_plugin", OPT_ENABLE_CLEARTEXT_PLUGIN, + "Enable/disable the clear text authentication plugin.", + &opt_enable_cleartext_plugin, &opt_enable_cleartext_plugin, + 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; @@ -916,6 +922,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), default_charset= (char*) MYSQL_DEFAULT_CHARSET_NAME; break; } + case (int) OPT_ENABLE_CLEARTEXT_PLUGIN: + using_opt_enable_cleartext_plugin= TRUE; + break; case (int) OPT_MYSQL_PROTOCOL: opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib, opt->name); @@ -1537,12 +1546,17 @@ static int connect_to_db(char *host, char *user,char *passwd) if (opt_default_auth && *opt_default_auth) mysql_options(&mysql_connection, MYSQL_DEFAULT_AUTH, opt_default_auth); + if (using_opt_enable_cleartext_plugin) + mysql_options(&mysql_connection, MYSQL_ENABLE_CLEARTEXT_PLUGIN, + (char *) &opt_enable_cleartext_plugin); + mysql_options(&mysql_connection, MYSQL_OPT_CONNECT_ATTR_RESET, 0); mysql_options4(&mysql_connection, MYSQL_OPT_CONNECT_ATTR_ADD, "program_name", "mysqldump"); - if (!(mysql= mysql_real_connect(&mysql_connection,host,user,passwd, - NULL,opt_mysql_port,opt_mysql_unix_port, - 0))) + if (!(mysql= mysql_connect_ssl_check(&mysql_connection, host, user, + passwd, NULL, opt_mysql_port, + opt_mysql_unix_port, 0, + opt_ssl_required))) { DB_error(&mysql_connection, "when trying to connect"); DBUG_RETURN(1); @@ -1907,7 +1921,7 @@ static void print_xml_row(FILE *xml_file, const char *row_name, const char *str_create) { uint i; - my_bool body_found= 0; + my_bool body_found __attribute__((unused)) = 0; char *create_stmt_ptr= NULL; ulong create_stmt_len= 0; MYSQL_FIELD *field; diff --git a/mysql-wsrep-5.6/client/mysqlimport.c b/mysql-wsrep-5.6/client/mysqlimport.c index 94a1d711..487fcfc6 100644 --- a/mysql-wsrep-5.6/client/mysqlimport.c +++ b/mysql-wsrep-5.6/client/mysqlimport.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,19 +25,14 @@ #include "client_priv.h" #include "my_default.h" #include "mysql_version.h" -#ifdef HAVE_LIBPTHREAD -#include -#endif #include /* ORACLE_WELCOME_COPYRIGHT_NOTICE */ /* Global Thread counter */ uint counter; -#ifdef HAVE_LIBPTHREAD pthread_mutex_t counter_mutex; pthread_cond_t count_threshhold; -#endif static void db_error_with_table(MYSQL *mysql, char *table); static void db_error(MYSQL *mysql); @@ -55,6 +50,8 @@ static char *opt_password=0, *current_user=0, *lines_terminated=0, *enclosed=0, *opt_enclosed=0, *escaped=0, *opt_columns=0, *default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME; +static uint opt_enable_cleartext_plugin= 0; +static my_bool using_opt_enable_cleartext_plugin= 0; static uint opt_mysql_port= 0, opt_protocol= 0; static char *opt_bind_addr = NULL; static char * opt_mysql_unix_port=0; @@ -98,6 +95,10 @@ static struct my_option my_long_options[] = GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"delete", 'd', "First delete all rows from table.", &opt_delete, &opt_delete, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"enable_cleartext_plugin", OPT_ENABLE_CLEARTEXT_PLUGIN, + "Enable/disable the clear text authentication plugin.", + &opt_enable_cleartext_plugin, &opt_enable_cleartext_plugin, + 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"fields-terminated-by", OPT_FTB, "Fields in the input file are terminated by the given string.", &fields_terminated, &fields_terminated, 0, @@ -247,6 +248,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), opt_local_file=1; break; #endif + case OPT_ENABLE_CLEARTEXT_PLUGIN: + using_opt_enable_cleartext_plugin= TRUE; + break; case OPT_MYSQL_PROTOCOL: opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib, opt->name); @@ -456,13 +460,17 @@ static MYSQL *db_connect(char *host, char *database, if (opt_default_auth && *opt_default_auth) mysql_options(mysql, MYSQL_DEFAULT_AUTH, opt_default_auth); + if (using_opt_enable_cleartext_plugin) + mysql_options(mysql, MYSQL_ENABLE_CLEARTEXT_PLUGIN, + (char*)&opt_enable_cleartext_plugin); + mysql_options(mysql, MYSQL_SET_CHARSET_NAME, default_charset); mysql_options(mysql, MYSQL_OPT_CONNECT_ATTR_RESET, 0); mysql_options4(mysql, MYSQL_OPT_CONNECT_ATTR_ADD, "program_name", "mysqlimport"); - if (!(mysql_real_connect(mysql,host,user,passwd, - database,opt_mysql_port,opt_mysql_unix_port, - 0))) + if (!(mysql_connect_ssl_check(mysql, host, user, passwd, database, + opt_mysql_port, opt_mysql_unix_port, + 0, opt_ssl_required))) { ignore_errors=0; /* NO RETURN FROM db_error */ db_error(mysql); @@ -567,7 +575,6 @@ static char *field_escape(char *to,const char *from,uint length) int exitcode= 0; -#ifdef HAVE_LIBPTHREAD pthread_handler_t worker_thread(void *arg) { int error; @@ -607,7 +614,6 @@ error: return 0; } -#endif int main(int argc, char **argv) @@ -629,7 +635,6 @@ int main(int argc, char **argv) return(1); } -#ifdef HAVE_LIBPTHREAD if (opt_use_threads && !lock_tables) { pthread_t mainthread; /* Thread descriptor */ @@ -683,7 +688,6 @@ int main(int argc, char **argv) pthread_attr_destroy(&attr); } else -#endif { MYSQL *mysql= 0; if (!(mysql= db_connect(current_host,current_db,current_user,opt_password))) diff --git a/mysql-wsrep-5.6/client/mysqlshow.c b/mysql-wsrep-5.6/client/mysqlshow.c index 755ef31d..aeaa05e5 100644 --- a/mysql-wsrep-5.6/client/mysqlshow.c +++ b/mysql-wsrep-5.6/client/mysqlshow.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2016, 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 @@ -38,6 +38,8 @@ static uint my_end_arg= 0; static uint opt_verbose=0; static char *default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME; static char *opt_plugin_dir= 0, *opt_default_auth= 0; +static uint opt_enable_cleartext_plugin= 0; +static my_bool using_opt_enable_cleartext_plugin= 0; static my_bool opt_secure_auth= TRUE; #ifdef HAVE_SMEM @@ -147,13 +149,17 @@ int main(int argc, char **argv) if (opt_default_auth && *opt_default_auth) mysql_options(&mysql, MYSQL_DEFAULT_AUTH, opt_default_auth); + if (using_opt_enable_cleartext_plugin) + mysql_options(&mysql, MYSQL_ENABLE_CLEARTEXT_PLUGIN, + (char*)&opt_enable_cleartext_plugin); + mysql_options(&mysql, MYSQL_OPT_CONNECT_ATTR_RESET, 0); mysql_options4(&mysql, MYSQL_OPT_CONNECT_ATTR_ADD, "program_name", "mysqlshow"); - if (!(mysql_real_connect(&mysql,host,user,opt_password, - (first_argument_uses_wildcards) ? "" : - argv[0],opt_mysql_port,opt_mysql_unix_port, - 0))) + if (!(mysql_connect_ssl_check(&mysql, host, user, opt_password, + (first_argument_uses_wildcards) ? "" : + argv[0], opt_mysql_port, opt_mysql_unix_port, + 0, opt_ssl_required))) { fprintf(stderr,"%s: %s\n",my_progname,mysql_error(&mysql)); exit(1); @@ -215,6 +221,10 @@ static struct my_option my_long_options[] = "Default authentication client-side plugin to use.", &opt_default_auth, &opt_default_auth, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"enable_cleartext_plugin", OPT_ENABLE_CLEARTEXT_PLUGIN, + "Enable/disable the clear text authentication plugin.", + &opt_enable_cleartext_plugin, &opt_enable_cleartext_plugin, + 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"host", 'h', "Connect to host.", &host, &host, 0, GET_STR, @@ -332,6 +342,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), opt_protocol = MYSQL_PROTOCOL_PIPE; #endif break; + case (int) OPT_ENABLE_CLEARTEXT_PLUGIN: + using_opt_enable_cleartext_plugin= TRUE; + break; case OPT_MYSQL_PROTOCOL: opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib, opt->name); @@ -387,7 +400,7 @@ list_dbs(MYSQL *mysql,const char *wild) uint length, counter = 0; ulong rowcount = 0L; char tables[NAME_LEN+1], rows[NAME_LEN+1]; - char query[255]; + char query[NAME_LEN + 100]; MYSQL_FIELD *field; MYSQL_RES *result; MYSQL_ROW row= NULL, rrow; @@ -454,7 +467,8 @@ list_dbs(MYSQL *mysql,const char *wild) MYSQL_ROW trow; while ((trow = mysql_fetch_row(tresult))) { - sprintf(query,"SELECT COUNT(*) FROM `%s`",trow[0]); + my_snprintf(query, sizeof(query), + "SELECT COUNT(*) FROM `%s`", trow[0]); if (!(mysql_query(mysql,query))) { MYSQL_RES *rresult; @@ -510,7 +524,7 @@ list_tables(MYSQL *mysql,const char *db,const char *table) { const char *header; uint head_length, counter = 0; - char query[255], rows[NAME_LEN], fields[16]; + char query[NAME_LEN + 100], rows[NAME_LEN], fields[16]; MYSQL_FIELD *field; MYSQL_RES *result; MYSQL_ROW row, rrow; @@ -595,7 +609,8 @@ list_tables(MYSQL *mysql,const char *db,const char *table) if (opt_verbose > 1) { /* Print the count of rows for each table */ - sprintf(query,"SELECT COUNT(*) FROM `%s`",row[0]); + my_snprintf(query, sizeof(query), "SELECT COUNT(*) FROM `%s`", + row[0]); if (!(mysql_query(mysql,query))) { if ((rresult = mysql_store_result(mysql))) @@ -655,13 +670,15 @@ list_tables(MYSQL *mysql,const char *db,const char *table) static int list_table_status(MYSQL *mysql,const char *db,const char *wild) { - char query[1024],*end; + char query[NAME_LEN + 100]; + int len; MYSQL_RES *result; MYSQL_ROW row; - end=strxmov(query,"show table status from `",db,"`",NullS); - if (wild && wild[0]) - strxmov(end," like '",wild,"'",NullS); + len= sizeof(query); + len-= my_snprintf(query, len, "show table status from `%s`", db); + if (wild && wild[0] && len) + strxnmov(query + strlen(query), len, " like '", wild, "'", NullS); if (mysql_query(mysql,query) || !(result=mysql_store_result(mysql))) { fprintf(stderr,"%s: Cannot get status for db: %s, table: %s: %s\n", @@ -693,7 +710,8 @@ static int list_fields(MYSQL *mysql,const char *db,const char *table, const char *wild) { - char query[1024],*end; + char query[NAME_LEN + 100]; + int len; MYSQL_RES *result; MYSQL_ROW row; ulong UNINIT_VAR(rows); @@ -707,7 +725,7 @@ list_fields(MYSQL *mysql,const char *db,const char *table, if (opt_count) { - sprintf(query,"select count(*) from `%s`", table); + my_snprintf(query, sizeof(query), "select count(*) from `%s`", table); if (mysql_query(mysql,query) || !(result=mysql_store_result(mysql))) { fprintf(stderr,"%s: Cannot get record count for db: %s, table: %s: %s\n", @@ -719,9 +737,11 @@ list_fields(MYSQL *mysql,const char *db,const char *table, mysql_free_result(result); } - end=strmov(strmov(strmov(query,"show /*!32332 FULL */ columns from `"),table),"`"); - if (wild && wild[0]) - strxmov(end," like '",wild,"'",NullS); + len= sizeof(query); + len-= my_snprintf(query, len, "show /*!32332 FULL */ columns from `%s`", + table); + if (wild && wild[0] && len) + strxnmov(query + strlen(query), len, " like '", wild, "'", NullS); if (mysql_query(mysql,query) || !(result=mysql_store_result(mysql))) { fprintf(stderr,"%s: Cannot list columns in db: %s, table: %s: %s\n", @@ -742,7 +762,7 @@ list_fields(MYSQL *mysql,const char *db,const char *table, print_res_top(result); if (opt_show_keys) { - end=strmov(strmov(strmov(query,"show keys from `"),table),"`"); + my_snprintf(query, sizeof(query), "show keys from `%s`", table); if (mysql_query(mysql,query) || !(result=mysql_store_result(mysql))) { fprintf(stderr,"%s: Cannot list keys in db: %s, table: %s: %s\n", diff --git a/mysql-wsrep-5.6/client/mysqlslap.c b/mysql-wsrep-5.6/client/mysqlslap.c index 54585034..6ef47367 100644 --- a/mysql-wsrep-5.6/client/mysqlslap.c +++ b/mysql-wsrep-5.6/client/mysqlslap.c @@ -1,5 +1,5 @@ /* - Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2005, 2016, 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 @@ -145,8 +145,8 @@ static my_bool opt_compress= FALSE, tty_password= FALSE, const char *auto_generate_sql_type= "mixed"; static unsigned long connect_flags= CLIENT_MULTI_RESULTS | - CLIENT_MULTI_STATEMENTS | - CLIENT_REMEMBER_OPTIONS; + CLIENT_MULTI_STATEMENTS | + CLIENT_REMEMBER_OPTIONS; static int verbose, delimiter_length; @@ -247,7 +247,7 @@ void print_conclusions_csv(conclusions *con); void generate_stats(conclusions *con, option_string *eng, stats *sptr); uint parse_comma(const char *string, uint **range); uint parse_delimiter(const char *script, statement **stmt, char delm); -uint parse_option(const char *origin, option_string **stmt, char delm); +int parse_option(const char *origin, option_string **stmt, char delm); static int drop_schema(MYSQL *mysql, const char *db); uint get_random_string(char *buf); static statement *build_table_string(void); @@ -369,9 +369,9 @@ int main(int argc, char **argv) (char*) &opt_enable_cleartext_plugin); if (!opt_only_print) { - if (!(mysql_real_connect(&mysql, host, user, opt_password, - NULL, opt_mysql_port, - opt_mysql_unix_port, connect_flags))) + if (!(mysql_connect_ssl_check(&mysql, host, user, opt_password, + NULL, opt_mysql_port, opt_mysql_unix_port, + connect_flags, opt_ssl_required))) { fprintf(stderr,"%s: Error when connecting to server: %s\n", my_progname,mysql_error(&mysql)); @@ -1259,7 +1259,13 @@ get_options(int *argc,char ***argv) if (num_int_cols_opt) { option_string *str; - parse_option(num_int_cols_opt, &str, ','); + if(parse_option(num_int_cols_opt, &str, ',') == -1) + { + fprintf(stderr, "Invalid value specified for the option " + "'number-int-cols'\n"); + option_cleanup(str); + return 1; + } num_int_cols= atoi(str->string); if (str->option) num_int_cols_index= atoi(str->option); @@ -1269,7 +1275,13 @@ get_options(int *argc,char ***argv) if (num_char_cols_opt) { option_string *str; - parse_option(num_char_cols_opt, &str, ','); + if(parse_option(num_char_cols_opt, &str, ',') == -1) + { + fprintf(stderr, "Invalid value specified for the option " + "'number-char-cols'\n"); + option_cleanup(str); + return 1; + } num_char_cols= atoi(str->string); if (str->option) num_char_cols_index= atoi(str->option); @@ -1505,7 +1517,13 @@ get_options(int *argc,char ***argv) printf("Parsing engines to use.\n"); if (default_engine) - parse_option(default_engine, &engine_options, ','); + { + if(parse_option(default_engine, &engine_options, ',') == -1) + { + fprintf(stderr, "Invalid value specified for the option 'engine'\n"); + return 1; + } + } if (tty_password) opt_password= get_tty_password(NullS); @@ -1978,7 +1996,7 @@ end: DBUG_RETURN(0); } -uint +int parse_option(const char *origin, option_string **stmt, char delm) { char *retstr; @@ -1998,6 +2016,13 @@ parse_option(const char *origin, option_string **stmt, char delm) char buffer[HUGE_STRING_LENGTH]; char *buffer_ptr; + /* + Return an error if the length of the any of the comma seprated value + exceeds HUGE_STRING_LENGTH. + */ + if ((size_t)(retstr - ptr) > HUGE_STRING_LENGTH) + return -1; + count++; strncpy(buffer, ptr, (size_t)(retstr - ptr)); if ((buffer_ptr= strchr(buffer, ':'))) @@ -2030,6 +2055,13 @@ parse_option(const char *origin, option_string **stmt, char delm) { char *origin_ptr; + /* + Return an error if the length of the any of the comma seprated value + exceeds HUGE_STRING_LENGTH. + */ + if (strlen(ptr) > HUGE_STRING_LENGTH) + return -1; + if ((origin_ptr= strchr(ptr, ':'))) { char *option_ptr; @@ -2040,13 +2072,13 @@ parse_option(const char *origin, option_string **stmt, char delm) option_ptr= (char *)ptr + 1 + tmp->length; /* Move past the : and the first string */ - tmp->option_length= (size_t)((ptr + length) - option_ptr); + tmp->option_length= strlen(option_ptr); tmp->option= my_strndup(option_ptr, tmp->option_length, MYF(MY_FAE)); } else { - tmp->length= (size_t)((ptr + length) - ptr); + tmp->length= strlen(ptr); tmp->string= my_strndup(ptr, tmp->length, MYF(MY_FAE)); } diff --git a/mysql-wsrep-5.6/client/mysqltest.cc b/mysql-wsrep-5.6/client/mysqltest.cc index 2def9bdd..0ac93bb0 100644 --- a/mysql-wsrep-5.6/client/mysqltest.cc +++ b/mysql-wsrep-5.6/client/mysqltest.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2016, 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 @@ -496,7 +496,7 @@ struct st_match_err struct st_expected_errors { - struct st_match_err err[10]; + struct st_match_err err[20]; uint count; }; static struct st_expected_errors saved_expected_errors; @@ -5315,8 +5315,9 @@ void safe_connect(MYSQL* mysql, const char *name, const char *host, "program_name", "mysqltest"); mysql_options(mysql, MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS, &can_handle_expired_passwords); - while(!mysql_real_connect(mysql, host,user, pass, db, port, sock, - CLIENT_MULTI_STATEMENTS | CLIENT_REMEMBER_OPTIONS)) + while(!mysql_connect_ssl_check(mysql, host,user, pass, db, port, sock, + CLIENT_MULTI_STATEMENTS | CLIENT_REMEMBER_OPTIONS, + opt_ssl_required)) { /* Connect failed @@ -5420,8 +5421,9 @@ int connect_n_handle_errors(struct st_command *command, mysql_options4(con, MYSQL_OPT_CONNECT_ATTR_ADD, "program_name", "mysqltest"); mysql_options(con, MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS, &can_handle_expired_passwords); - while (!mysql_real_connect(con, host, user, pass, db, port, sock ? sock: 0, - CLIENT_MULTI_STATEMENTS)) + while (!mysql_connect_ssl_check(con, host, user, pass, db, port, + sock ? sock: 0, CLIENT_MULTI_STATEMENTS, + opt_ssl_required)) { /* If we have used up all our connections check whether this @@ -8392,6 +8394,13 @@ void get_command_type(struct st_command* command) "use # if you intended to write a comment"); } } + DBUG_VOID_RETURN; +} + + +void update_expected_errors(struct st_command* command) +{ + DBUG_ENTER("update_expected_errors"); /* Set expected error on command */ memcpy(&command->expected_errors, &saved_expected_errors, @@ -8771,6 +8780,9 @@ int main(int argc, char **argv) if (command->type == Q_UNKNOWN || command->type == Q_COMMENT_WITH_COMMAND) get_command_type(command); + if(saved_expected_errors.count > 0) + update_expected_errors(command); + if (parsing_disabled && command->type != Q_ENABLE_PARSING && command->type != Q_DISABLE_PARSING) diff --git a/mysql-wsrep-5.6/client/sql_string.cc b/mysql-wsrep-5.6/client/sql_string.cc index 98c9d72a..decd776d 100644 --- a/mysql-wsrep-5.6/client/sql_string.cc +++ b/mysql-wsrep-5.6/client/sql_string.cc @@ -1,5 +1,5 @@ /* - Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2015, 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 @@ -59,12 +59,19 @@ bool String::real_alloc(uint32 length) ** (for C functions) */ -bool String::realloc(uint32 alloc_length) +bool String::realloc(uint32 alloc_length, bool force_on_heap) { uint32 len=ALIGN_SIZE(alloc_length+1); DBUG_ASSERT(len > alloc_length); if (len <= alloc_length) return TRUE; /* Overflow */ + + if (force_on_heap && !alloced) + { + /* Bytes will be allocated on the heap.*/ + Alloced_length= 0; + } + if (Alloced_length < len) { char *new_ptr; @@ -690,14 +697,14 @@ int stringcmp(const String *s,const String *t) String *copy_if_not_alloced(String *to,String *from,uint32 from_length) { - if (from->Alloced_length >= from_length) + if (from->alloced && from->Alloced_length >= from_length) return from; if ((from->alloced && (from->Alloced_length != 0)) || !to || from == to) { - (void) from->realloc(from_length); + (void) from->realloc(from_length, true); return from; } - if (to->realloc(from_length)) + if (to->realloc(from_length, true)) return from; // Actually an error if ((to->str_length=min(from->str_length,from_length))) memcpy(to->Ptr,from->Ptr,to->str_length); diff --git a/mysql-wsrep-5.6/client/sql_string.h b/mysql-wsrep-5.6/client/sql_string.h index 71842f82..866f6bc7 100644 --- a/mysql-wsrep-5.6/client/sql_string.h +++ b/mysql-wsrep-5.6/client/sql_string.h @@ -1,7 +1,7 @@ #ifndef CLIENT_SQL_STRING_INCLUDED #define CLIENT_SQL_STRING_INCLUDED -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2015, 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 @@ -197,7 +197,7 @@ public: return real_alloc(arg_length); } bool real_alloc(uint32 arg_length); // Empties old string - bool realloc(uint32 arg_length); + bool realloc(uint32 arg_length, bool force_on_heap= false); // Shrink the buffer, but only if it is allocated on the heap. inline void shrink(uint32 arg_length) diff --git a/mysql-wsrep-5.6/cmake/compile_flags.cmake b/mysql-wsrep-5.6/cmake/compile_flags.cmake index 5e872f98..b39bf7b7 100644 --- a/mysql-wsrep-5.6/cmake/compile_flags.cmake +++ b/mysql-wsrep-5.6/cmake/compile_flags.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2014, 2015, 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 @@ -18,11 +18,11 @@ MACRO(ADD_COMPILE_FLAGS) SET(FILES "") SET(FLAGS "") - SET(COMPILE_FLAGS) + SET(COMPILE_FLAGS_SEEN) FOREACH(ARG ${ARGV}) IF(ARG STREQUAL "COMPILE_FLAGS") - SET(COMPILE_FLAGS "COMPILE_FLAGS") - ELSEIF(COMPILE_FLAGS) + SET(COMPILE_FLAGS_SEEN 1) + ELSEIF(COMPILE_FLAGS_SEEN) LIST(APPEND FLAGS ${ARG}) ELSE() LIST(APPEND FILES ${ARG}) diff --git a/mysql-wsrep-5.6/cmake/configure.pl b/mysql-wsrep-5.6/cmake/configure.pl index 22c13291..0a6a3cf6 100644 --- a/mysql-wsrep-5.6/cmake/configure.pl +++ b/mysql-wsrep-5.6/cmake/configure.pl @@ -223,6 +223,16 @@ foreach my $option (@ARGV) $cmakeargs = $cmakeargs." \"-DWITH_COMMENT=".substr($option,13)."\""; next; } + if ($option =~ /layout=/) + { + $cmakeargs = $cmakeargs." -DINSTALL_LAYOUT=".substr($option,7); + next; + } + if ($option =~ /with-unix-socket-path=/) + { + $cmakeargs = $cmakeargs." -DMYSQL_UNIX_ADDR=".substr($option,22); + next; + } if ($option =~ /mysql-maintainer-mode/) { $cmakeargs = $cmakeargs." -DMYSQL_MAINTAINER_MODE=" . diff --git a/mysql-wsrep-5.6/cmake/install_layout.cmake b/mysql-wsrep-5.6/cmake/install_layout.cmake index 4adda0b6..5cd47af0 100644 --- a/mysql-wsrep-5.6/cmake/install_layout.cmake +++ b/mysql-wsrep-5.6/cmake/install_layout.cmake @@ -146,7 +146,10 @@ SET(INSTALL_BINDIR_RPM "bin") SET(INSTALL_SBINDIR_RPM "sbin") SET(INSTALL_SCRIPTDIR_RPM "bin") # -IF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") +# Deciding via system processor may give wrong answer in +# virtual environments that see host CPU directly. +# IF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") +IF(64BIT) SET(INSTALL_LIBDIR_RPM "lib64") SET(INSTALL_PLUGINDIR_RPM "lib64/mysql/plugin") ELSE() diff --git a/mysql-wsrep-5.6/cmake/install_macros.cmake b/mysql-wsrep-5.6/cmake/install_macros.cmake index 83bd6bd0..4f660083 100644 --- a/mysql-wsrep-5.6/cmake/install_macros.cmake +++ b/mysql-wsrep-5.6/cmake/install_macros.cmake @@ -13,8 +13,34 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +if(APPLE) + LIST(APPEND CMAKE_CXX_LINK_EXECUTABLE "dsymutil ") + LIST(APPEND CMAKE_C_LINK_EXECUTABLE "dsymutil ") + LIST(APPEND CMAKE_CXX_CREATE_SHARED_LIBRARY "dsymutil ") + LIST(APPEND CMAKE_C_CREATE_SHARED_LIBRARY "dsymutil ") + LIST(APPEND CMAKE_CXX_CREATE_SHARED_MODULE "dsymutil ") + LIST(APPEND CMAKE_C_CREATE_SHARED_MODULE "dsymutil ") +ENDIF() + GET_FILENAME_COMPONENT(MYSQL_CMAKE_SCRIPT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH) INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake) +MACRO (INSTALL_DSYM_DIRECTORIES targets) + IF(APPLE) + FOREACH(target ${targets}) + GET_TARGET_PROPERTY(location ${target} LOCATION) + GET_TARGET_PROPERTY(type ${target} TYPE) + # It's a dirty hack, but cmake too stupid and mysql cmake files too buggy */ + STRING(REGEX REPLACE "/liblibmysql.dylib$" "/libmysqlclient.${SHARED_LIB_MAJOR_VERSION}.dylib" location ${location}) + IF(DEBUG_EXTNAME) + STRING(REGEX REPLACE "/mysqld$" "/mysqld-debug" location ${location}) + ENDIF() + IF(type MATCHES "EXECUTABLE" OR type MATCHES "MODULE" OR type MATCHES "SHARED_LIBRARY") + INSTALL(DIRECTORY "${location}.dSYM" DESTINATION ${INSTALL_LOCATION} COMPONENT Debuginfo) + ENDIF() + ENDFOREACH() + ENDIF() +ENDMACRO() + MACRO (INSTALL_DEBUG_SYMBOLS targets) IF(MSVC) FOREACH(target ${targets}) @@ -241,6 +267,7 @@ FUNCTION(MYSQL_INSTALL_TARGETS) INSTALL(TARGETS ${TARGETS} DESTINATION ${ARG_DESTINATION} ${COMP}) SET(INSTALL_LOCATION ${ARG_DESTINATION} ) INSTALL_DEBUG_SYMBOLS("${TARGETS}") + INSTALL_DSYM_DIRECTORIES("${TARGETS}") SET(INSTALL_LOCATION) ENDFUNCTION() diff --git a/mysql-wsrep-5.6/cmake/make_dist.cmake.in b/mysql-wsrep-5.6/cmake/make_dist.cmake.in index 8b845b92..768e0874 100644 --- a/mysql-wsrep-5.6/cmake/make_dist.cmake.in +++ b/mysql-wsrep-5.6/cmake/make_dist.cmake.in @@ -1,4 +1,4 @@ -# Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2015, 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 @@ -93,9 +93,9 @@ IF(NOT GIT_EXECUTABLE) # Save bison output first. CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql/sql_yacc.cc - ${CMAKE_BINARY_DIR}/sql_yacc.cc COPY_ONLY) + ${CMAKE_BINARY_DIR}/sql_yacc.cc COPYONLY) CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql/sql_yacc.h - ${CMAKE_BINARY_DIR}/sql_yacc.h COPY_ONLY) + ${CMAKE_BINARY_DIR}/sql_yacc.h COPYONLY) IF(CMAKE_GENERATOR MATCHES "Makefiles") # make clean @@ -107,9 +107,9 @@ IF(NOT GIT_EXECUTABLE) # Restore bison output CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql_yacc.cc - ${CMAKE_BINARY_DIR}/sql/sql_yacc.cc COPY_ONLY) + ${CMAKE_BINARY_DIR}/sql/sql_yacc.cc COPYONLY) CONFIGURE_FILE(${CMAKE_BINARY_DIR}/sql_yacc.h - ${CMAKE_BINARY_DIR}/sql/sql_yacc.h COPY_ONLY) + ${CMAKE_BINARY_DIR}/sql/sql_yacc.h COPYONLY) FILE(REMOVE ${CMAKE_BINARY_DIR}/sql_yacc.cc) FILE(REMOVE ${CMAKE_BINARY_DIR}/sql_yacc.h) ENDIF() diff --git a/mysql-wsrep-5.6/cmake/mysql_add_executable.cmake b/mysql-wsrep-5.6/cmake/mysql_add_executable.cmake index 0c93fb17..b1e1d312 100644 --- a/mysql-wsrep-5.6/cmake/mysql_add_executable.cmake +++ b/mysql-wsrep-5.6/cmake/mysql_add_executable.cmake @@ -1,48 +1,48 @@ -# Copyright (c) 2009, 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 - -# Add executable plus some additional MySQL specific stuff -# Usage (same as for standard CMake's ADD_EXECUTABLE) -# -# MYSQL_ADD_EXECUTABLE(target source1...sourceN) -# -# MySQL specifics: -# - instruct CPack to install executable under ${CMAKE_INSTALL_PREFIX}/bin directory -# On Windows : -# - add version resource -# - instruct CPack to do autenticode signing if SIGNCODE is set - -INCLUDE(cmake_parse_arguments) - -FUNCTION (MYSQL_ADD_EXECUTABLE) - # Pass-through arguments for ADD_EXECUTABLE - MYSQL_PARSE_ARGUMENTS(ARG - "WIN32;MACOSX_BUNDLE;EXCLUDE_FROM_ALL;DESTINATION;COMPONENT" - "" - ${ARGN} - ) - LIST(GET ARG_DEFAULT_ARGS 0 target) - 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) - IF(NOT ARG_DESTINATION) - SET(ARG_DESTINATION ${INSTALL_BINDIR}) +# Copyright (c) 2009, 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 + +# Add executable plus some additional MySQL specific stuff +# Usage (same as for standard CMake's ADD_EXECUTABLE) +# +# MYSQL_ADD_EXECUTABLE(target source1...sourceN) +# +# MySQL specifics: +# - instruct CPack to install executable under ${CMAKE_INSTALL_PREFIX}/bin directory +# On Windows : +# - add version resource +# - instruct CPack to do autenticode signing if SIGNCODE is set + +INCLUDE(cmake_parse_arguments) + +FUNCTION (MYSQL_ADD_EXECUTABLE) + # Pass-through arguments for ADD_EXECUTABLE + MYSQL_PARSE_ARGUMENTS(ARG + "WIN32;MACOSX_BUNDLE;EXCLUDE_FROM_ALL;DESTINATION;COMPONENT" + "" + ${ARGN} + ) + LIST(GET ARG_DEFAULT_ARGS 0 target) + 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) + IF(NOT ARG_DESTINATION) + SET(ARG_DESTINATION ${INSTALL_BINDIR}) ENDIF() IF(ARG_COMPONENT) SET(COMP COMPONENT ${ARG_COMPONENT}) @@ -50,7 +50,7 @@ FUNCTION (MYSQL_ADD_EXECUTABLE) SET(COMP COMPONENT ${MYSQL_INSTALL_COMPONENT}) ELSE() SET(COMP COMPONENT Client) - ENDIF() - MYSQL_INSTALL_TARGETS(${target} DESTINATION ${ARG_DESTINATION} ${COMP}) - ENDIF() + ENDIF() + MYSQL_INSTALL_TARGETS(${target} DESTINATION ${ARG_DESTINATION} ${COMP}) + ENDIF() ENDFUNCTION() diff --git a/mysql-wsrep-5.6/cmake/os/FreeBSD.cmake b/mysql-wsrep-5.6/cmake/os/FreeBSD.cmake index e0959294..bd72a58c 100644 --- a/mysql-wsrep-5.6/cmake/os/FreeBSD.cmake +++ b/mysql-wsrep-5.6/cmake/os/FreeBSD.cmake @@ -22,3 +22,5 @@ # The below was used for really old versions of FreeBSD, roughly: before 5.1.9 # ADD_DEFINITIONS(-DHAVE_BROKEN_REALPATH) + +SET(HAVE_SYS_TIMEB_H CACHE INTERNAL "") diff --git a/mysql-wsrep-5.6/cmake/os/Windows.cmake b/mysql-wsrep-5.6/cmake/os/Windows.cmake index d320bf3b..188982a8 100644 --- a/mysql-wsrep-5.6/cmake/os/Windows.cmake +++ b/mysql-wsrep-5.6/cmake/os/Windows.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -51,10 +51,12 @@ IF(CMAKE_C_COMPILER MATCHES "icl") SET(MSVC TRUE) ENDIF() -ADD_DEFINITIONS("-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE") -ADD_DEFINITIONS("-D_WIN32_WINNT=0x0501") +ADD_DEFINITIONS(-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE) +ADD_DEFINITIONS(-D_WIN32_WINNT=0x0501) +# We do not want the windows.h macros min/max +ADD_DEFINITIONS(-DNOMINMAX) # Speed up build process excluding unused header files -ADD_DEFINITIONS("-DWIN32_LEAN_AND_MEAN") +ADD_DEFINITIONS(-DWIN32_LEAN_AND_MEAN) # Adjust compiler and linker flags IF(MINGW AND CMAKE_SIZEOF_VOID_P EQUAL 4) @@ -184,12 +186,13 @@ CHECK_SYMBOL_REPLACEMENT(SIGQUIT SIGTERM signal.h) CHECK_SYMBOL_REPLACEMENT(SIGPIPE SIGINT signal.h) CHECK_SYMBOL_REPLACEMENT(isnan _isnan float.h) CHECK_SYMBOL_REPLACEMENT(finite _finite float.h) +CHECK_SYMBOL_REPLACEMENT(tzname _tzname time.h) +CHECK_SYMBOL_REPLACEMENT(snprintf _snprintf stdio.h) CHECK_FUNCTION_REPLACEMENT(popen _popen) CHECK_FUNCTION_REPLACEMENT(pclose _pclose) CHECK_FUNCTION_REPLACEMENT(access _access) CHECK_FUNCTION_REPLACEMENT(strcasecmp _stricmp) CHECK_FUNCTION_REPLACEMENT(strncasecmp _strnicmp) -CHECK_FUNCTION_REPLACEMENT(snprintf _snprintf) CHECK_FUNCTION_REPLACEMENT(strtok_r strtok_s) CHECK_FUNCTION_REPLACEMENT(strtoll _strtoi64) CHECK_FUNCTION_REPLACEMENT(strtoull _strtoui64) diff --git a/mysql-wsrep-5.6/cmake/os/WindowsCache.cmake b/mysql-wsrep-5.6/cmake/os/WindowsCache.cmake index a1764ad7..7b60a268 100644 --- a/mysql-wsrep-5.6/cmake/os/WindowsCache.cmake +++ b/mysql-wsrep-5.6/cmake/os/WindowsCache.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010, 2016, 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 @@ -74,6 +74,7 @@ SET(HAVE_FSYNC CACHE INTERNAL "") SET(HAVE_FTIME 1 CACHE INTERNAL "") SET(HAVE_FTRUNCATE CACHE INTERNAL "") SET(HAVE_GETADDRINFO 1 CACHE INTERNAL "") +SET(HAVE_GETIFADDRS CACHE INTERNAL "") SET(HAVE_GETCWD 1 CACHE INTERNAL "") SET(HAVE_GETHOSTBYADDR_R CACHE INTERNAL "") SET(HAVE_GETHRTIME CACHE INTERNAL "") @@ -231,7 +232,6 @@ SET(HAVE_SIZEOF_ULONG FALSE CACHE INTERNAL "") SET(HAVE_SIZEOF_U_INT32_T FALSE CACHE INTERNAL "") SET(HAVE_SIZE_OF_SSIZE_T FALSE CACHE INTERNAL "") SET(HAVE_SLEEP CACHE INTERNAL "") -SET(HAVE_SNPRINTF CACHE INTERNAL "") SET(HAVE_SOCKADDR_IN_SIN_LEN CACHE INTERNAL "") SET(HAVE_SOCKADDR_IN6_SIN6_LEN CACHE INTERNAL "") SET(HAVE_SOCKADDR_STORAGE_SS_FAMILY 1 CACHE INTERNAL "") @@ -306,7 +306,6 @@ SET(HAVE_TIME 1 CACHE INTERNAL "") SET(HAVE_TIMES CACHE INTERNAL "") SET(HAVE_TIMESPEC_TS_SEC CACHE INTERNAL "") SET(HAVE_TIME_H 1 CACHE INTERNAL "") -SET(HAVE_TZNAME 1 CACHE INTERNAL "") SET(HAVE_UNISTD_H CACHE INTERNAL "") SET(HAVE_UTIME_H CACHE INTERNAL "") SET(HAVE_VALLOC CACHE INTERNAL "") @@ -333,6 +332,7 @@ SET(HAVE__strtoui64 1 CACHE INTERNAL "") IF(MSVC_VERSION GREATER 1310) SET(HAVE_strtok_s 1 CACHE INTERNAL "") ENDIF() +SET(HAVE__tzname 1 CACHE INTERNAL "") SET(STDC_HEADERS CACHE 1 INTERNAL "") SET(STRUCT_DIRENT_HAS_D_INO CACHE INTERNAL "") SET(STRUCT_DIRENT_HAS_D_INO CACHE INTERNAL "") diff --git a/mysql-wsrep-5.6/cmake/package_name.cmake b/mysql-wsrep-5.6/cmake/package_name.cmake index 4cb5c954..882259c1 100644 --- a/mysql-wsrep-5.6/cmake/package_name.cmake +++ b/mysql-wsrep-5.6/cmake/package_name.cmake @@ -27,6 +27,8 @@ IF(NOT VERSION) SET(DEFAULT_MACHINE ${CMAKE_SYSTEM_PROCESSOR}) IF(SIZEOF_VOIDP EQUAL 8) SET(64BIT 1) + ELSE() + SET(64BIT 0) ENDIF() IF(CMAKE_SYSTEM_NAME MATCHES "Windows") @@ -127,7 +129,14 @@ IF(NOT VERSION) STRING(REGEX REPLACE "^.*-ndb-" "" NDBVERSION "${VERSION}") SET(package_name "mysql-cluster${PRODUCT_TAG}-${NDBVERSION}-${SYSTEM_NAME_AND_PROCESSOR}") ELSE() - SET(package_name "mysql${PRODUCT_TAG}-${VERSION}-${SYSTEM_NAME_AND_PROCESSOR}") + IF(WITH_WSREP) + IF(NOT WSREP_VERSION) + MESSAGE(FATAL_ERROR "Variable WSREP_VERSION must be set") + ENDIF() + SET(package_name "mysql-wsrep${PRODUCT_TAG}-${VERSION}-${WSREP_VERSION}-${SYSTEM_NAME_AND_PROCESSOR}") + ELSE() + SET(package_name "mysql${PRODUCT_TAG}-${VERSION}-${SYSTEM_NAME_AND_PROCESSOR}") + ENDIF() ENDIF() MESSAGE(STATUS "Packaging as: ${package_name}") diff --git a/mysql-wsrep-5.6/cmake/plugin.cmake b/mysql-wsrep-5.6/cmake/plugin.cmake index e946f0ff..51e86108 100644 --- a/mysql-wsrep-5.6/cmake/plugin.cmake +++ b/mysql-wsrep-5.6/cmake/plugin.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2015, 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 @@ -175,6 +175,15 @@ MACRO(MYSQL_ADD_PLUGIN) COMPILE_DEFINITIONS "MYSQL_DYNAMIC_PLUGIN") TARGET_LINK_LIBRARIES (${target} mysqlservices) + GET_TARGET_PROPERTY(LINK_FLAGS ${target} LINK_FLAGS) + IF(NOT LINK_FLAGS) + # Avoid LINK_FLAGS-NOTFOUND + SET(LINK_FLAGS) + ENDIF() + SET_TARGET_PROPERTIES(${target} PROPERTIES + LINK_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS} ${LINK_FLAGS} " + ) + # Plugin uses symbols defined in mysqld executable. # Some operating systems like Windows and OSX and are pretty strict about # unresolved symbols. Others are less strict and allow unresolved symbols diff --git a/mysql-wsrep-5.6/cmake/ssl.cmake b/mysql-wsrep-5.6/cmake/ssl.cmake index 81719d2e..8108f904 100644 --- a/mysql-wsrep-5.6/cmake/ssl.cmake +++ b/mysql-wsrep-5.6/cmake/ssl.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2015, 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 @@ -166,7 +166,7 @@ MACRO (MYSQL_CHECK_SSL) # Encoded as MNNFFPPS: major minor fix patch status FILE(STRINGS "${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h" OPENSSL_VERSION_NUMBER - REGEX "^#define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x[0-9].*" + REGEX "^#[ ]*define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x[0-9].*" ) STRING(REGEX REPLACE "^.*OPENSSL_VERSION_NUMBER[\t ]+0x([0-9]).*$" "\\1" @@ -230,14 +230,29 @@ MACRO (MYSQL_CHECK_SSL) SET(SSL_INTERNAL_INCLUDE_DIRS "") SET(SSL_DEFINES "-DHAVE_OPENSSL") ELSE() - IF(WITH_SSL STREQUAL "system") - MESSAGE(SEND_ERROR "Cannot find appropriate system libraries for SSL. Use WITH_SSL=bundled to enable SSL support") - ENDIF() - MYSQL_USE_BUNDLED_SSL() + + UNSET(WITH_SSL_PATH) + UNSET(WITH_SSL_PATH CACHE) + UNSET(OPENSSL_ROOT_DIR) + UNSET(OPENSSL_ROOT_DIR CACHE) + UNSET(OPENSSL_INCLUDE_DIR) + UNSET(OPENSSL_INCLUDE_DIR CACHE) + UNSET(OPENSSL_APPLINK_C) + UNSET(OPENSSL_APPLINK_C CACHE) + UNSET(OPENSSL_LIBRARY) + UNSET(OPENSSL_LIBRARY CACHE) + UNSET(CRYPTO_LIBRARY) + UNSET(CRYPTO_LIBRARY CACHE) + + MESSAGE(SEND_ERROR + "Cannot find appropriate system libraries for SSL. " + "Make sure you've specified a supported SSL version. " + "Consult the documentation for WITH_SSL alternatives") ENDIF() ELSE() MESSAGE(SEND_ERROR - "Wrong option for WITH_SSL. Valid values are : ${WITH_SSL_DOC}") + "Wrong option or path for WITH_SSL. " + "Valid options are : ${WITH_SSL_DOC}") ENDIF() ENDMACRO() diff --git a/mysql-wsrep-5.6/cmake/versioninfo.rc.in b/mysql-wsrep-5.6/cmake/versioninfo.rc.in index 6daf7403..f849a9fc 100644 --- a/mysql-wsrep-5.6/cmake/versioninfo.rc.in +++ b/mysql-wsrep-5.6/cmake/versioninfo.rc.in @@ -1,38 +1,38 @@ -// Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; version 2 of the License. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -#include -VS_VERSION_INFO VERSIONINFO -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 -FILETYPE @FILETYPE@ -FILESUBTYPE VFT2_UNKNOWN -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904E4" - BEGIN - VALUE "FileVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@.0\0" - VALUE "ProductVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@.0\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1252 - END -END +// Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; version 2 of the License. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +#include +VS_VERSION_INFO VERSIONINFO +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 +FILETYPE @FILETYPE@ +FILESUBTYPE VFT2_UNKNOWN +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904E4" + BEGIN + VALUE "FileVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@.0\0" + VALUE "ProductVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@.0\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END diff --git a/mysql-wsrep-5.6/cmake/wsrep.cmake b/mysql-wsrep-5.6/cmake/wsrep.cmake new file mode 100644 index 00000000..1f5eebb4 --- /dev/null +++ b/mysql-wsrep-5.6/cmake/wsrep.cmake @@ -0,0 +1,52 @@ +# Copyright (c) 2011, Codership Oy . +# +# 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 + +# We need to generate a proper spec file even without --with-wsrep flag, +# so WSREP_VERSION is produced regardless + +# Set the patch version +SET(WSREP_PATCH_VERSION "15") + +# Obtain patch revision number +SET(WSREP_REVISION $ENV{WSREP_REV}) +IF(NOT WSREP_REVISION) + SET(WSREP_REVISION "XXXX" CACHE STRING "WSREP revision") +ENDIF() + + +# Obtain wsrep API version +EXECUTE_PROCESS( + COMMAND sh -c "grep WSREP_INTERFACE_VERSION ${MySQL_SOURCE_DIR}/wsrep/wsrep_api.h | cut -d '\"' -f 2" + OUTPUT_VARIABLE WSREP_API_VERSION + RESULT_VARIABLE RESULT +) +#FILE(WRITE "wsrep_config" "Debug: WSREP_API_VERSION result: ${RESULT}\n") +STRING(REGEX REPLACE "(\r?\n)+$" "" WSREP_API_VERSION "${WSREP_API_VERSION}") + +SET(WSREP_VERSION "${WSREP_API_VERSION}.${WSREP_PATCH_VERSION}" + CACHE STRING "WSREP version") + +OPTION(WITH_WSREP "WSREP replication API (to use, e.g. Galera Replication library)" OFF) +IF (WITH_WSREP) + SET(WSREP_C_FLAGS "-DWITH_WSREP -DWSREP_PROC_INFO -DMYSQL_MAX_VARIABLE_VALUE_LEN=2048") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WSREP_C_FLAGS}") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WSREP_C_FLAGS}") + SET(COMPILATION_COMMENT "${COMPILATION_COMMENT}, wsrep_${WSREP_VERSION}") + SET(WITH_EMBEDDED_SERVER OFF) + SET(WITH_INNODB_DISALLOW_WRITES ON) + SET(WITH_INNODB_MEMCACHED ON) +ENDIF() + +# diff --git a/mysql-wsrep-5.6/cmd-line-utils/libedit/el_terminal.h b/mysql-wsrep-5.6/cmd-line-utils/libedit/el_terminal.h index 807c6517..db0bb94f 100644 --- a/mysql-wsrep-5.6/cmd-line-utils/libedit/el_terminal.h +++ b/mysql-wsrep-5.6/cmd-line-utils/libedit/el_terminal.h @@ -1,7 +1,7 @@ /* $NetBSD: terminal.h,v 1.3 2011/07/29 23:44:45 christos Exp $ */ /*- - * Copyright (c) 1992, 1993 + * Copyright (c) 1992, 2015 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by @@ -103,7 +103,7 @@ protected int terminal_settc(EditLine *, int, const Char **); protected int terminal_gettc(EditLine *, int, char **); protected int terminal_telltc(EditLine *, int, const Char **); protected int terminal_echotc(EditLine *, int, const Char **); -protected void terminal_writec(EditLine *, Int); +protected int terminal_writec(EditLine *, Int); protected int terminal__putc(EditLine *, Int); protected void terminal__flush(EditLine *); diff --git a/mysql-wsrep-5.6/cmd-line-utils/libedit/emacs.c b/mysql-wsrep-5.6/cmd-line-utils/libedit/emacs.c index 554d3970..1f1033a1 100644 --- a/mysql-wsrep-5.6/cmd-line-utils/libedit/emacs.c +++ b/mysql-wsrep-5.6/cmd-line-utils/libedit/emacs.c @@ -1,7 +1,7 @@ /* $NetBSD: emacs.c,v 1.25 2011/07/29 15:16:33 christos Exp $ */ /*- - * Copyright (c) 1992, 1993 + * Copyright (c) 1992, 2015 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by @@ -58,8 +58,10 @@ em_delete_or_list(EditLine *el, Int c) /* if I'm at the end */ if (el->el_line.cursor == el->el_line.buffer) { /* and the beginning */ - terminal_writec(el, c); /* then do an EOF */ - return CC_EOF; + if(!(terminal_writec(el, c))) /* then do an EOF */ + return CC_EOF; + else + return CC_ERROR; } else { /* * Here we could list completions, but it is an diff --git a/mysql-wsrep-5.6/cmd-line-utils/libedit/terminal.c b/mysql-wsrep-5.6/cmd-line-utils/libedit/terminal.c index 8cfbeac7..e1f45ca1 100644 --- a/mysql-wsrep-5.6/cmd-line-utils/libedit/terminal.c +++ b/mysql-wsrep-5.6/cmd-line-utils/libedit/terminal.c @@ -1,7 +1,7 @@ /* $NetBSD: terminal.c,v 1.10 2011/10/04 15:27:04 christos Exp $ */ /*- - * Copyright (c) 1992, 1993 + * Copyright (c) 1992, 2015 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by @@ -1271,14 +1271,19 @@ terminal__flush(EditLine *el) /* terminal_writec(): * Write the given character out, in a human readable form */ -protected void +protected int terminal_writec(EditLine *el, Int c) { Char visbuf[VISUAL_WIDTH_MAX +1]; ssize_t vcnt = ct_visual_char(visbuf, VISUAL_WIDTH_MAX, c); - visbuf[vcnt] = '\0'; - terminal_overwrite(el, visbuf, (size_t)vcnt); - terminal__flush(el); + if(vcnt == -1) + return 1; /* Error due to insufficient space */ + else { + visbuf[vcnt] = '\0'; + terminal_overwrite(el, visbuf, (size_t)vcnt); + terminal__flush(el); + return 0; + } } diff --git a/mysql-wsrep-5.6/cmd-line-utils/libedit/vi.c b/mysql-wsrep-5.6/cmd-line-utils/libedit/vi.c index 732a1a65..a35716f6 100644 --- a/mysql-wsrep-5.6/cmd-line-utils/libedit/vi.c +++ b/mysql-wsrep-5.6/cmd-line-utils/libedit/vi.c @@ -1,7 +1,7 @@ /* $NetBSD: vi.c,v 1.41 2011/10/04 15:27:04 christos Exp $ */ /*- - * Copyright (c) 1992, 1993 + * Copyright (c) 1992, 2015 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by @@ -607,8 +607,10 @@ vi_list_or_eof(EditLine *el, Int c) if (el->el_line.cursor == el->el_line.lastchar) { if (el->el_line.cursor == el->el_line.buffer) { - terminal_writec(el, c); /* then do a EOF */ - return CC_EOF; + if(!(terminal_writec(el, c))) /* then do a EOF */ + return CC_EOF; + else + return CC_ERROR; } else { /* * Here we could list completions, but it is an diff --git a/mysql-wsrep-5.6/config.h.cmake b/mysql-wsrep-5.6/config.h.cmake index 987be271..e9d795e9 100644 --- a/mysql-wsrep-5.6/config.h.cmake +++ b/mysql-wsrep-5.6/config.h.cmake @@ -1,4 +1,4 @@ -/* Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2009, 2016, 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 @@ -155,6 +155,7 @@ #cmakedefine HAVE_FSYNC 1 #cmakedefine HAVE_FTIME 1 #cmakedefine HAVE_GETADDRINFO 1 +#cmakedefine HAVE_GETIFADDRS 1 #cmakedefine HAVE_GETCWD 1 #cmakedefine HAVE_GETHOSTBYADDR_R 1 #cmakedefine HAVE_GETHRTIME 1 @@ -395,6 +396,7 @@ #cmakedefine HAVE_UINT64 1 #cmakedefine SIZEOF_BOOL @SIZEOF_BOOL@ #cmakedefine HAVE_BOOL 1 +#cmakedefine HAVE_STRUCT_TIMESPEC #cmakedefine SOCKET_SIZE_TYPE @SOCKET_SIZE_TYPE@ @@ -517,15 +519,12 @@ #cmakedefine strtok_r @strtok_r@ #cmakedefine strtoll @strtoll@ #cmakedefine strtoull @strtoull@ +#cmakedefine tzname @tzname@ #cmakedefine vsnprintf @vsnprintf@ #if (_MSC_VER > 1310) # define HAVE_SETENV #define setenv(a,b,c) _putenv_s(a,b) #endif -/* We don't want the min/max macros */ -#ifdef __WIN__ -#define NOMINMAX -#endif /* Memcached config options @@ -664,5 +663,6 @@ /* CPU information */ #cmakedefine CPU_LEVEL1_DCACHE_LINESIZE @CPU_LEVEL1_DCACHE_LINESIZE@ +#cmakedefine HAVE_LIBNUMA 1 #endif diff --git a/mysql-wsrep-5.6/configure.cmake b/mysql-wsrep-5.6/configure.cmake index e1c17936..f94b0000 100644 --- a/mysql-wsrep-5.6/configure.cmake +++ b/mysql-wsrep-5.6/configure.cmake @@ -1,4 +1,4 @@ -# Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2016, 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 @@ -43,6 +43,13 @@ IF(UNIX) ENDIF() +IF(CMAKE_SYSTEM_NAME MATCHES "SunOS" AND CMAKE_COMPILER_IS_GNUCXX) + ## We will be using gcc to generate .so files + ## Add C flags (e.g. -m64) to CMAKE_SHARED_LIBRARY_C_FLAGS + SET(CMAKE_SHARED_LIBRARY_C_FLAGS + "${CMAKE_SHARED_LIBRARY_C_FLAGS} ${CMAKE_C_FLAGS}") +ENDIF() + # System type affects version_compile_os variable IF(NOT SYSTEM_TYPE) @@ -65,6 +72,10 @@ IF(CMAKE_SYSTEM_NAME MATCHES "SunOS") IF(CMAKE_CXX_COMPILER_ID MATCHES "SunPro") IF(SUNPRO_CXX_LIBRARY) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -library=${SUNPRO_CXX_LIBRARY}") + IF(SUNPRO_CXX_LIBRARY STREQUAL "stdcxx4") + ADD_DEFINITIONS(-D__MATHERR_RENAME_EXCEPTION) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -template=extdef") + ENDIF() ELSE() SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -library=stlport4") ENDIF() @@ -88,45 +99,109 @@ MACRO(DIRNAME IN OUT) GET_FILENAME_COMPONENT(${OUT} ${IN} PATH) ENDMACRO() +MACRO(FIND_REAL_LIBRARY SOFTLINK_NAME REALNAME) + # We re-distribute libstlport.so/libstdc++.so which are both symlinks. + # There is no 'readlink' on solaris, so we use perl to follow links: + SET(PERLSCRIPT + "my $link= $ARGV[0]; use Cwd qw(abs_path); my $file = abs_path($link); print $file;") + EXECUTE_PROCESS( + COMMAND perl -e "${PERLSCRIPT}" ${SOFTLINK_NAME} + RESULT_VARIABLE result + OUTPUT_VARIABLE real_library + ) + SET(REALNAME ${real_library}) +ENDMACRO() + +MACRO(EXTEND_CXX_LINK_FLAGS LIBRARY_PATH) + # Using the $ORIGIN token with the -R option to locate the libraries + # on a path relative to the executable: + # We need an extra backslash to pass $ORIGIN to the mysql_config script... + SET(QUOTED_CMAKE_CXX_LINK_FLAGS + "${CMAKE_CXX_LINK_FLAGS} -R'\\$ORIGIN/../lib' -R${LIBRARY_PATH}") + SET(CMAKE_CXX_LINK_FLAGS + "${CMAKE_CXX_LINK_FLAGS} -R'\$ORIGIN/../lib' -R${LIBRARY_PATH}") + MESSAGE(STATUS "CMAKE_CXX_LINK_FLAGS ${CMAKE_CXX_LINK_FLAGS}") +ENDMACRO() + +MACRO(EXTEND_C_LINK_FLAGS LIBRARY_PATH) + SET(QUOTED_CMAKE_C_LINK_FLAGS + "${CMAKE_C_LINK_FLAGS} -R'\\$ORIGIN/../lib' -R${LIBRARY_PATH}") + SET(CMAKE_C_LINK_FLAGS + "${CMAKE_C_LINK_FLAGS} -R'\$ORIGIN/../lib' -R${LIBRARY_PATH}") + MESSAGE(STATUS "CMAKE_C_LINK_FLAGS ${CMAKE_C_LINK_FLAGS}") + SET(CMAKE_SHARED_LIBRARY_C_FLAGS + "${CMAKE_SHARED_LIBRARY_C_FLAGS} -R'\$ORIGIN/..' -R'\$ORIGIN/../lib' -R${LIBRARY_PATH}") +ENDMACRO() + IF(CMAKE_SYSTEM_NAME MATCHES "SunOS" AND CMAKE_C_COMPILER_ID MATCHES "SunPro" AND CMAKE_CXX_FLAGS MATCHES "stlport4") DIRNAME(${CMAKE_CXX_COMPILER} CXX_PATH) - SET(STLPORT_SUFFIX "lib/stlport4") - IF(CMAKE_SIZEOF_VOID_P EQUAL 8 AND CMAKE_SYSTEM_PROCESSOR MATCHES "sparc") - SET(STLPORT_SUFFIX "lib/stlport4/v9") + # Also extract real path to the compiler(which is normally + # in /prod/bin) and try to find the + # stlport libs relative to that location as well. + GET_FILENAME_COMPONENT(CXX_REALPATH ${CMAKE_CXX_COMPILER} REALPATH) + + # CC -V yields + # CC: Sun C++ 5.13 SunOS_sparc Beta 2014/03/11 + # CC: Sun C++ 5.11 SunOS_sparc 2010/08/13 + + EXECUTE_PROCESS( + COMMAND ${CMAKE_CXX_COMPILER} "-V" + OUTPUT_VARIABLE stdout + ERROR_VARIABLE stderr + RESULT_VARIABLE result + ) + IF(result) + MESSAGE(FATAL_ERROR "Failed to execute ${CMAKE_CXX_COMPILER} -V") ENDIF() - IF(CMAKE_SIZEOF_VOID_P EQUAL 8 AND CMAKE_SYSTEM_PROCESSOR MATCHES "i386") - SET(STLPORT_SUFFIX "lib/stlport4/amd64") + + STRING(REGEX MATCH "CC: Sun C\\+\\+ 5\\.([0-9]+)" VERSION_STRING ${stderr}) + SET(CC_MINOR_VERSION ${CMAKE_MATCH_1}) + + IF(${CC_MINOR_VERSION} EQUAL 13) + SET(STLPORT_SUFFIX "lib/compilers/stlport4") + IF(SIZEOF_VOIDP EQUAL 8 AND CMAKE_SYSTEM_PROCESSOR MATCHES "sparc") + SET(STLPORT_SUFFIX "lib/compilers/stlport4/sparcv9") + ENDIF() + IF(SIZEOF_VOIDP EQUAL 8 AND CMAKE_SYSTEM_PROCESSOR MATCHES "i386") + SET(STLPORT_SUFFIX "lib/compilers/stlport4/amd64") + ENDIF() + ELSE() + SET(STLPORT_SUFFIX "lib/stlport4") + IF(SIZEOF_VOIDP EQUAL 8 AND CMAKE_SYSTEM_PROCESSOR MATCHES "sparc") + SET(STLPORT_SUFFIX "lib/stlport4/v9") + ENDIF() + IF(SIZEOF_VOIDP EQUAL 8 AND CMAKE_SYSTEM_PROCESSOR MATCHES "i386") + SET(STLPORT_SUFFIX "lib/stlport4/amd64") + ENDIF() ENDIF() FIND_LIBRARY(STL_LIBRARY_NAME NAMES "stlport" PATHS ${CXX_PATH}/../${STLPORT_SUFFIX} + ${CXX_REALPATH}/../../${STLPORT_SUFFIX} ) MESSAGE(STATUS "STL_LIBRARY_NAME ${STL_LIBRARY_NAME}") IF(STL_LIBRARY_NAME) DIRNAME(${STL_LIBRARY_NAME} STLPORT_PATH) - # We re-distribute libstlport.so which is a symlink to libstlport.so.1 - # There is no 'readlink' on solaris, so we use perl to follow links: - SET(PERLSCRIPT - "my $link= $ARGV[0]; use Cwd qw(abs_path); my $file = abs_path($link); print $file;") - EXECUTE_PROCESS( - COMMAND perl -e "${PERLSCRIPT}" ${STL_LIBRARY_NAME} - RESULT_VARIABLE result - OUTPUT_VARIABLE real_library - ) + FIND_REAL_LIBRARY(${STL_LIBRARY_NAME} real_library) MESSAGE(STATUS "INSTALL ${STL_LIBRARY_NAME} ${real_library}") INSTALL(FILES ${STL_LIBRARY_NAME} ${real_library} - DESTINATION ${INSTALL_LIBDIR} COMPONENT Development) - # Using the $ORIGIN token with the -R option to locate the libraries - # on a path relative to the executable: - # We need an extra backslash to pass $ORIGIN to the mysql_config script... - SET(QUOTED_CMAKE_CXX_LINK_FLAGS - "${CMAKE_CXX_LINK_FLAGS} -R'\\$ORIGIN/../lib' -R${STLPORT_PATH}") - SET(CMAKE_CXX_LINK_FLAGS - "${CMAKE_CXX_LINK_FLAGS} -R'\$ORIGIN/../lib' -R${STLPORT_PATH}") - MESSAGE(STATUS "CMAKE_CXX_LINK_FLAGS ${CMAKE_CXX_LINK_FLAGS}") + DESTINATION ${INSTALL_LIBDIR} COMPONENT SharedLibraries) + EXTEND_C_LINK_FLAGS(${STLPORT_PATH}) + EXTEND_CXX_LINK_FLAGS(${STLPORT_PATH}) + ELSE() + MESSAGE(STATUS "Failed to find the required stlport library, print some" + "variables to help debugging and bail out") + MESSAGE(STATUS "CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER}") + MESSAGE(STATUS "CXX_PATH ${CXX_PATH}") + MESSAGE(STATUS "CXX_REALPATH ${CXX_REALPATH}") + MESSAGE(STATUS "STLPORT_SUFFIX ${STLPORT_SUFFIX}") + MESSAGE(STATUS "PATH: ${CXX_PATH}/../${STLPORT_SUFFIX}") + MESSAGE(STATUS "PATH: ${CXX_REALPATH}/../../${STLPORT_SUFFIX}") + MESSAGE(FATAL_ERROR + "Could not find the required stlport library.") ENDIF() ENDIF() @@ -433,6 +508,7 @@ CHECK_FUNCTION_EXISTS (getpassphrase HAVE_GETPASSPHRASE) CHECK_FUNCTION_EXISTS (getpwnam HAVE_GETPWNAM) CHECK_FUNCTION_EXISTS (getpwuid HAVE_GETPWUID) CHECK_FUNCTION_EXISTS (getrlimit HAVE_GETRLIMIT) +CHECK_FUNCTION_EXISTS (getifaddrs HAVE_GETIFADDRS) CHECK_FUNCTION_EXISTS (getrusage HAVE_GETRUSAGE) CHECK_FUNCTION_EXISTS (getwd HAVE_GETWD) CHECK_FUNCTION_EXISTS (gmtime_r HAVE_GMTIME_R) @@ -666,7 +742,7 @@ MY_CHECK_TYPE_SIZE(char CHAR) MY_CHECK_TYPE_SIZE(short SHORT) MY_CHECK_TYPE_SIZE(int INT) MY_CHECK_TYPE_SIZE("long long" LONG_LONG) -SET(CMAKE_EXTRA_INCLUDE_FILES stdio.h sys/types.h) +SET(CMAKE_EXTRA_INCLUDE_FILES stdio.h sys/types.h time.h) MY_CHECK_TYPE_SIZE(off_t OFF_T) MY_CHECK_TYPE_SIZE(uchar UCHAR) MY_CHECK_TYPE_SIZE(uint UINT) @@ -681,6 +757,7 @@ MY_CHECK_TYPE_SIZE(u_int32_t U_INT32_T) MY_CHECK_TYPE_SIZE(int64 INT64) MY_CHECK_TYPE_SIZE(uint64 UINT64) MY_CHECK_TYPE_SIZE(time_t TIME_T) +MY_CHECK_TYPE_SIZE("struct timespec" STRUCT_TIMESPEC) SET (CMAKE_EXTRA_INCLUDE_FILES sys/types.h) MY_CHECK_TYPE_SIZE(bool BOOL) SET(CMAKE_EXTRA_INCLUDE_FILES) @@ -1138,3 +1215,22 @@ SET(CMAKE_EXTRA_INCLUDE_FILES) CHECK_STRUCT_HAS_MEMBER("struct dirent" d_ino "dirent.h" STRUCT_DIRENT_HAS_D_INO) CHECK_STRUCT_HAS_MEMBER("struct dirent" d_namlen "dirent.h" STRUCT_DIRENT_HAS_D_NAMLEN) SET(SPRINTF_RETURNS_INT 1) + +CHECK_INCLUDE_FILES (numaif.h HAVE_NUMAIF_H) +OPTION(WITH_NUMA "Explicitly set NUMA memory allocation policy" ON) +IF(HAVE_NUMAIF_H AND WITH_NUMA) + SET(SAVE_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) + SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} numa) + CHECK_C_SOURCE_COMPILES( + " + #include + #include + int main() + { + struct bitmask *all_nodes= numa_all_nodes_ptr; + set_mempolicy(MPOL_DEFAULT, 0, 0); + return all_nodes != NULL; + }" + HAVE_LIBNUMA) + SET(CMAKE_REQUIRED_LIBRARIES ${SAVE_CMAKE_REQUIRED_LIBRARIES}) +ENDIF() diff --git a/mysql-wsrep-5.6/extra/CMakeLists.txt b/mysql-wsrep-5.6/extra/CMakeLists.txt index b6656077..886691a0 100644 --- a/mysql-wsrep-5.6/extra/CMakeLists.txt +++ b/mysql-wsrep-5.6/extra/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2015, 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 @@ -98,9 +98,8 @@ IF(WITH_INNOBASE_STORAGE_ENGINE) ENDIF() IF(UNIX) - MYSQL_ADD_EXECUTABLE(resolve_stack_dump resolve_stack_dump.c) + MYSQL_ADD_EXECUTABLE(resolve_stack_dump resolve_stack_dump.cc) TARGET_LINK_LIBRARIES(resolve_stack_dump mysys mysys_ssl) - SET_TARGET_PROPERTIES(resolve_stack_dump PROPERTIES LINKER_LANGUAGE CXX) MYSQL_ADD_EXECUTABLE(mysql_waitpid mysql_waitpid.c) TARGET_LINK_LIBRARIES(mysql_waitpid mysys mysys_ssl) diff --git a/mysql-wsrep-5.6/extra/charset2html.c b/mysql-wsrep-5.6/extra/charset2html.c deleted file mode 100644 index 3800b87d..00000000 --- a/mysql-wsrep-5.6/extra/charset2html.c +++ /dev/null @@ -1,179 +0,0 @@ -/* Copyright (c) 2000, 2002-2004, 2007, 2008 MySQL AB - Use is subject to license terms - - 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 Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -/* - Written by Alexander Barkov to check what - a charset is in your favorite web browser -*/ - -#include -#include -#include -#include - -#include - -typedef struct char_info_st -{ - int cod; - int srt; - int uni; - int low; - int upp; - int ctp; -} MY_CH; - -static int chcmp(const void *vf, const void *vs) -{ - const MY_CH *f=vf; - const MY_CH *s=vs; - - return f->srt-s->srt ? f->srt-s->srt : f->uni-s->uni; -} - -static void print_cs(CHARSET_INFO *cs) -{ - uint i; - int srt; - int clr=0; - MY_CH ch[256]; - - printf("\n"); - printf("\n"); - printf("\n"); - printf("
\n");
-  printf("Charset %s\n",cs->name);
-
-  printf("\n");
-  printf("");
-  
-  for (i=0; i<256; i++)
-  {
-    ch[i].cod=i;
-    ch[i].srt=cs->sort_order ? cs->sort_order[i] : i;
-    ch[i].uni=cs->tab_to_uni[i];
-    ch[i].low=cs->tab_to_uni[cs->to_lower[i]];
-    ch[i].upp=cs->tab_to_uni[cs->to_upper[i]];
-    ch[i].ctp=cs->ctype[i+1];
-  }
-  
-  qsort(ch,256,sizeof(MY_CH),&chcmp);
-  srt=ch[0].srt;
-  
-  for (i=0; i<256; i++)
-  {
-    clr = (srt!=ch[i].srt) ? !clr : clr;
-    
-    printf("",clr ? "DDDDDD" : "EEEE99");
-    printf("\n");
-    srt=ch[i].srt;
-  }
-  printf("
CodeUniSortCtypeChLoUp
%02X",ch[i].cod); - printf("%04X",ch[i].uni); - printf("%02X",ch[i].srt); - - printf("%s%s%s%s%s%s%s%s", - ch[i].ctp & _MY_U ? "U" : "", - ch[i].ctp & _MY_L ? "L" : "", - ch[i].ctp & _MY_NMR ? "N" : "", - ch[i].ctp & _MY_SPC ? "S" : "", - ch[i].ctp & _MY_PNT ? "P" : "", - ch[i].ctp & _MY_CTR ? "C" : "", - ch[i].ctp & _MY_B ? "B" : "", - ch[i].ctp & _MY_X ? "X" : ""); - - if ((ch[i].uni >= 0x80) && (ch[i].uni <= 0x9F)) - { - /* - Control characters 0x0080..0x009F are dysplayed by some - browers as if they were letters. Don't print them to - avoid confusion. - */ - printf("ctrlctrlctrl"); - } - else - { - printf("&#%d;",ch[i].uni); - printf("&#%d;",ch[i].low); - printf("&#%d;",ch[i].upp); - } - printf("
\n"); - printf("
\n"); - printf("\n"); -} - -static void print_index() -{ - CHARSET_INFO **cs; - int clr=0; - - get_charset_by_name("",MYF(0)); /* To execute init_available_charsets */ - - printf("All charsets\n"); - printf("\n"); - printf("
IDCharsetCollationDefBinComComment\n"); - for (cs=all_charsets ; cs < all_charsets+256; cs++) - { - if (!cs[0]) - continue; - printf("
%d%s%s%s%s%s%s\n", - (clr= !clr) ? "DDDDDD" : "EEEE99", - cs[0]->name,cs[0]->number,cs[0]->csname, - cs[0]->name, - (cs[0]->state & MY_CS_PRIMARY) ? "def " : " ", - (cs[0]->state & MY_CS_BINSORT) ? "bin " : " ", - (cs[0]->state & MY_CS_COMPILED) ? "com " : " ", - cs[0]->comment); - } - printf("
\n"); -} - -int main(int argc, char **argv) { - const char *the_set = NULL; - int argcnt = 1; - CHARSET_INFO *cs; - - if (getenv("SCRIPT_NAME")) - { - printf("Content-Type: text/html\r\n\r\n"); - } - my_init(); - - if (argc > argcnt && argv[argcnt][0] == '-' && argv[argcnt][1] == '#') - { - DBUG_PUSH(argv[argcnt++]+2); - } - - if (argc > argcnt) - the_set = argv[argcnt++]; - - if (argc > argcnt) - charsets_dir = argv[argcnt++]; - - if (!the_set) - { - print_index(); - return 0; - } - - if (!(cs= get_charset_by_name(the_set, MYF(MY_WME)))) - return 1; - - print_cs(cs); - - return 0; -} diff --git a/mysql-wsrep-5.6/extra/my_print_defaults.c b/mysql-wsrep-5.6/extra/my_print_defaults.c index 72e1f8eb..9587077d 100644 --- a/mysql-wsrep-5.6/extra/my_print_defaults.c +++ b/mysql-wsrep-5.6/extra/my_print_defaults.c @@ -1,6 +1,6 @@ /* - Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -32,6 +32,7 @@ const char *config_file="my"; /* Default config file */ static char *my_login_path; +static my_bool *show_passwords; uint verbose= 0, opt_defaults_file_used= 0; const char *default_dbug_option="d:t:o,/tmp/my_print_defaults.trace"; @@ -87,6 +88,9 @@ static struct my_option my_long_options[] = {"login-path", 'l', "Path to be read from under the login file.", &my_login_path, &my_login_path, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"show", 's', "Show passwords in plain text.", + &show_passwords, &show_passwords, 0, GET_BOOL, NO_ARG, + 0, 0, 0, 0, 0, 0}, {"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"verbose", 'v', "Increase the output level", @@ -203,7 +207,12 @@ int main(int argc, char **argv) for (argument= arguments+1 ; *argument ; argument++) if (!my_getopt_is_args_separator(*argument)) /* skip arguments separator */ - puts(*argument); + { + if (!(show_passwords) && strncmp(*argument, "--password", 10) == 0) + puts("--password=*****"); + else + puts(*argument); + } my_free(load_default_groups); free_defaults(arguments); diff --git a/mysql-wsrep-5.6/extra/resolve_stack_dump.c b/mysql-wsrep-5.6/extra/resolve_stack_dump.cc similarity index 79% rename from mysql-wsrep-5.6/extra/resolve_stack_dump.c rename to mysql-wsrep-5.6/extra/resolve_stack_dump.cc index c261c954..c94a1bbe 100644 --- a/mysql-wsrep-5.6/extra/resolve_stack_dump.c +++ b/mysql-wsrep-5.6/extra/resolve_stack_dump.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,6 +17,11 @@ versions into symbolic names. By Sasha Pachev */ +#include +#include // Needed on SunOS 5.10 +#include +#include + #include #include #include @@ -24,11 +29,11 @@ #include #include #include +#include /* ORACLE_WELCOME_COPYRIGHT_NOTICE */ + +const int initial_symbol_table_size= 4096; -#define INIT_SYM_TABLE 4096 -#define INC_SYM_TABLE 4096 -#define MAX_SYM_SIZE 128 -#define DUMP_VERSION "1.4" +#define DUMP_VERSION "1.5" #define HEX_INVALID (uchar)255 typedef ulong my_long_addr_t ; /* at some point, we need to fix configure @@ -37,14 +42,16 @@ typedef ulong my_long_addr_t ; /* at some point, we need to fix configure typedef struct sym_entry { - char symbol[MAX_SYM_SIZE]; + std::string symbol; uchar* addr; } SYM_ENTRY; static char* dump_fname = 0, *sym_fname = 0; -static DYNAMIC_ARRAY sym_table; /* how do you like this , static DYNAMIC ? */ +static std::vector sym_table; static FILE* fp_dump, *fp_sym = 0, *fp_out; +static void die(const char* fmt, ...) + __attribute__((noreturn)) __attribute__((format(printf, 1, 2))); static struct my_option my_long_options[] = { @@ -74,8 +81,7 @@ static void print_version(void) static void usage() { print_version(); - printf("MySQL AB, by Sasha Pachev\n"); - printf("This software comes with ABSOLUTELY NO WARRANTY\n\n"); + puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2001")); printf("Resolve numeric stack strace dump into symbols.\n\n"); printf("Usage: %s [OPTIONS] symbols-file [numeric-dump-file]\n", my_progname); @@ -197,7 +203,7 @@ static my_long_addr_t read_addr(char** buf) static int init_sym_entry(SYM_ENTRY* se, char* buf) { - char* p, *p_end; + char* p; se->addr = (uchar*)read_addr(&buf); if (!se->addr) @@ -209,29 +215,45 @@ static int init_sym_entry(SYM_ENTRY* se, char* buf) /* empty - skip more space */; --buf; /* now we are on the symbol */ - for (p = se->symbol, p_end = se->symbol + sizeof(se->symbol) - 1; - *buf != '\n' && *buf && p < p_end; ++buf,++p) - *p = *buf; - *p = 0; - if (!strcmp(se->symbol, "gcc2_compiled.")) - return -1; + for (p =buf; *buf != '\n' && *buf; ++buf) + ; + try { + se->symbol.assign(p, buf - p); + } + catch (...) + { + die("failed to allocate space for symbol %.*s", (int) (buf - p), p); + } + return 0; } static void init_sym_table() { - char buf[512]; - if (my_init_dynamic_array(&sym_table, sizeof(SYM_ENTRY), INIT_SYM_TABLE, - INC_SYM_TABLE)) - die("Failed in my_init_dynamic_array() -- looks like out of memory problem"); - + /* + A buffer of 100Kb should be big enough to hold any single line output from + 'nm --demangle' + */ + static char buf[1024 * 100]; + try { + sym_table.reserve(initial_symbol_table_size); + } + catch (...) + { + die("Failed in std::vector.reserve() -- looks like out of memory problem"); + } while (fgets(buf, sizeof(buf), fp_sym)) { SYM_ENTRY se; if (init_sym_entry(&se, buf)) continue; - if (insert_dynamic(&sym_table, &se)) - die("insert_dynamic() failed - looks like we are out of memory"); + try { + sym_table.push_back(se); + } + catch (...) + { + die("std::vector.push_back() failed - looks like we are out of memory"); + } } verify_sort(); @@ -239,7 +261,6 @@ static void init_sym_table() static void clean_up() { - delete_dynamic(&sym_table); } static void verify_sort() @@ -247,13 +268,13 @@ static void verify_sort() uint i; uchar* last = 0; - for (i = 0; i < sym_table.elements; i++) + for (i = 0; i < sym_table.size(); i++) { - SYM_ENTRY se; - get_dynamic(&sym_table, (uchar*)&se, i); + SYM_ENTRY se= sym_table[i]; if (se.addr < last) - die("sym table does not appear to be sorted, did you forget \ ---numeric-sort arg to nm? trouble addr = %p, last = %p", se.addr, last); + die("sym table does not appear to be sorted, did you forget " + "--numeric-sort arg to nm? trouble addr = %p, last = %p", + se.addr, last); last = se.addr; } } @@ -262,16 +283,16 @@ static void verify_sort() static SYM_ENTRY* resolve_addr(uchar* addr, SYM_ENTRY* se) { uint i; - get_dynamic(&sym_table, (uchar*)se, 0); + *se= sym_table[0]; if (addr < se->addr) return 0; - for (i = 1; i < sym_table.elements; i++) + for (i = 1; i < sym_table.size(); i++) { - get_dynamic(&sym_table, (uchar*)se, i); + *se= sym_table[i]; if (addr < se->addr) { - get_dynamic(&sym_table, (uchar*)se, i - 1); + *se= sym_table[i - 1]; return se; } } @@ -282,7 +303,7 @@ static SYM_ENTRY* resolve_addr(uchar* addr, SYM_ENTRY* se) static void do_resolve() { - char buf[1024], *p; + char buf[1024 * 8], *p; while (fgets(buf, sizeof(buf), fp_dump)) { /* skip bracket */ @@ -296,7 +317,7 @@ static void do_resolve() SYM_ENTRY se ; uchar* addr = (uchar*)read_addr(&p); if (resolve_addr(addr, &se)) - fprintf(fp_out, "%p %s + %d\n", addr, se.symbol, + fprintf(fp_out, "%p %s + %d\n", addr, se.symbol.c_str(), (int) (addr - se.addr)); else fprintf(fp_out, "%p (?)\n", addr); diff --git a/mysql-wsrep-5.6/extra/yassl/README b/mysql-wsrep-5.6/extra/yassl/README index da399c3d..b5eb8882 100644 --- a/mysql-wsrep-5.6/extra/yassl/README +++ b/mysql-wsrep-5.6/extra/yassl/README @@ -12,6 +12,52 @@ before calling SSL_new(); *** end Note *** +yaSSL Release notes, version 2.3.9b (2/03/2016) + This release of yaSSL fixes the OpenSSL compatibility function + X509_NAME_get_index_by_NID() to use the actual index of the common name + instead of searching on the format prefix. Thanks for the report from + yashwant.sahu@oracle.com . Anyone using this function should update. + +yaSSL Release notes, version 2.3.9 (12/01/2015) + This release of yaSSL fixes two client side Diffie-Hellman problems. + yaSSL was only handling the cases of zero or one leading zeros for the key + agreement instead of potentially any number. This caused about 1 in 50,000 + connections to fail when using DHE cipher suites. The second problem was + the case where a server would send a public value shorter than the prime + value, causing about 1 in 128 client connections to fail, and also + caused the yaSSL client to read off the end of memory. All client side + DHE cipher suite users should update. + Thanks to Adam Langely (agl@imperialviolet.org) for the detailed report! + +yaSSL Release notes, version 2.3.8 (9/17/2015) + This release of yaSSL fixes a high security vulnerability. All users + SHOULD update. If using yaSSL for TLS on the server side with private + RSA keys allowing ephemeral key exchange you MUST update and regenerate + the RSA private keys. This report is detailed in: + https://people.redhat.com/~fweimer/rsa-crt-leaks.pdf + yaSSL now detects RSA signature faults and returns an error. + +yaSSL Patch notes, version 2.3.7e (6/26/2015) + This release of yaSSL includes a fix for Date less than comparison. + Previously yaSSL would return true on less than comparisons if the Dates + were equal. Reported by Oracle. No security problem, but if a cert was + generated right now, a server started using it in the same second, and a + client tried to verify it in the same second it would report not yet valid. + +yaSSL Patch notes, version 2.3.7d (6/22/2015) + This release of yaSSL includes a fix for input_buffer set_current with + index 0. SSL_peek() at front of waiting data could trigger. Robert + Golebiowski of Oracle identified and suggested a fix, thanks! + +yaSSL Patch notes, version 2.3.7c (6/12/2015) + This release of yaSSL does certificate DATE comparisons to the second + instead of to the minute, helpful when using freshly generated certs. + Though keep in mind that time sync differences could still show up. + +yaSSL Patch notes, version 2.3.7b (3/18/2015) + This release of yaSSL fixes a potential crash with corrupted private keys. + Also detects bad keys earlier for user. + yaSSL Release notes, version 2.3.7 (12/10/2014) This release of yaSSL fixes the potential to process duplicate handshake messages by explicitly marking/checking received handshake messages. diff --git a/mysql-wsrep-5.6/extra/yassl/certs/dsa512.der b/mysql-wsrep-5.6/extra/yassl/certs/dsa512.der deleted file mode 100644 index fe79ccb6..00000000 Binary files a/mysql-wsrep-5.6/extra/yassl/certs/dsa512.der and /dev/null differ diff --git a/mysql-wsrep-5.6/extra/yassl/certs/dsa512.pem b/mysql-wsrep-5.6/extra/yassl/certs/dsa512.pem deleted file mode 100644 index 04a3dd94..00000000 --- a/mysql-wsrep-5.6/extra/yassl/certs/dsa512.pem +++ /dev/null @@ -1,8 +0,0 @@ ------BEGIN DSA PRIVATE KEY----- -MIH3AgEAAkEAmSlpgMk8mGhFqYL+Z+uViMW0DNYmRZUZLKAgW37faencww/zYQol -m/IhAWrNqow358pm21b0D3160Ri5Qv0bEQIVAK0lKasKnwkcwa0DIHZ/prfdTQMJ -AkASiJna59ALk5vm7jwhf5yztI2ljOI3gD8X0YFPvfBxtjIIVN2/AeKzdwZkdYoE -1nk5sQIDA8YGdOWQBQoQRhkxAkAEhKAmMXIM6E9dUxdisYDKwBZfwx7qxdmYOPm+ -VlNHaM4IIlccuw13kc9bNu3zJIKQis2QfNt3+Rctc3Pvu7mCAhQjg+e+aqykxwwc -E2V27tjDFY02uA== ------END DSA PRIVATE KEY----- diff --git a/mysql-wsrep-5.6/extra/yassl/include/crypto_wrapper.hpp b/mysql-wsrep-5.6/extra/yassl/include/crypto_wrapper.hpp index db9136c5..c0395cb2 100644 --- a/mysql-wsrep-5.6/extra/yassl/include/crypto_wrapper.hpp +++ b/mysql-wsrep-5.6/extra/yassl/include/crypto_wrapper.hpp @@ -377,6 +377,7 @@ public: uint get_agreedKeyLength() const; const byte* get_agreedKey() const; + uint get_publicKeyLength() const; const byte* get_publicKey() const; void makeAgreement(const byte*, unsigned int); diff --git a/mysql-wsrep-5.6/extra/yassl/include/openssl/crypto.h b/mysql-wsrep-5.6/extra/yassl/include/openssl/crypto.h index 103fcbb0..fc2971ab 100644 --- a/mysql-wsrep-5.6/extra/yassl/include/openssl/crypto.h +++ b/mysql-wsrep-5.6/extra/yassl/include/openssl/crypto.h @@ -1,6 +1,4 @@ -/* - Copyright (C) 2005, 2007 MySQL AB - Use is subject to license terms +/* Copyright (c) 2005, 2015, 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 @@ -12,14 +10,12 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, - MA 02110-1301 USA. -*/ + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* crypto.h for openSSL */ -#ifndef ysSSL_crypto_h__ +#ifndef yaSSL_crypto_h__ #define yaSSL_crypto_h__ #ifdef YASSL_PREFIX diff --git a/mysql-wsrep-5.6/extra/yassl/include/openssl/ssl.h b/mysql-wsrep-5.6/extra/yassl/include/openssl/ssl.h index a6ef8232..b74a289e 100644 --- a/mysql-wsrep-5.6/extra/yassl/include/openssl/ssl.h +++ b/mysql-wsrep-5.6/extra/yassl/include/openssl/ssl.h @@ -34,7 +34,7 @@ #include "rsa.h" -#define YASSL_VERSION "2.3.7" +#define YASSL_VERSION "2.3.9b" #if defined(__cplusplus) diff --git a/mysql-wsrep-5.6/extra/yassl/include/yassl_error.hpp b/mysql-wsrep-5.6/extra/yassl/include/yassl_error.hpp index beba7b0b..d63244dc 100644 --- a/mysql-wsrep-5.6/extra/yassl/include/yassl_error.hpp +++ b/mysql-wsrep-5.6/extra/yassl/include/yassl_error.hpp @@ -53,7 +53,8 @@ enum YasslError { compress_error = 118, decompress_error = 119, pms_version_error = 120, - sanityCipher_error = 121 + sanityCipher_error = 121, + rsaSignFault_error = 122 // !!!! add error message to .cpp !!!! diff --git a/mysql-wsrep-5.6/extra/yassl/include/yassl_int.hpp b/mysql-wsrep-5.6/extra/yassl/include/yassl_int.hpp index 3735827b..986e5b0c 100644 --- a/mysql-wsrep-5.6/extra/yassl/include/yassl_int.hpp +++ b/mysql-wsrep-5.6/extra/yassl/include/yassl_int.hpp @@ -191,14 +191,19 @@ private: class X509_NAME { char* name_; size_t sz_; + int cnPosition_; // start of common name, -1 is none + int cnLen_; // length of above ASN1_STRING entry_; public: - X509_NAME(const char*, size_t sz); + X509_NAME(const char*, size_t sz, int pos, int len); ~X509_NAME(); const char* GetName() const; ASN1_STRING* GetEntry(int i); size_t GetLength() const; + int GetCnPosition() const { return cnPosition_; } + int GetCnLength() const { return cnLen_; } + private: X509_NAME(const X509_NAME&); // hide copy X509_NAME& operator=(const X509_NAME&); // and assign @@ -226,7 +231,7 @@ class X509 { StringHolder afterDate_; // not valid after public: X509(const char* i, size_t, const char* s, size_t, - ASN1_STRING *b, ASN1_STRING *a); + ASN1_STRING *b, ASN1_STRING *a, int, int, int, int); ~X509() {} X509_NAME* GetIssuer(); diff --git a/mysql-wsrep-5.6/extra/yassl/src/buffer.cpp b/mysql-wsrep-5.6/extra/yassl/src/buffer.cpp index 231e0aec..954fdb52 100644 --- a/mysql-wsrep-5.6/extra/yassl/src/buffer.cpp +++ b/mysql-wsrep-5.6/extra/yassl/src/buffer.cpp @@ -164,7 +164,7 @@ void input_buffer::set_error() void input_buffer::set_current(uint i) { - if (error_ == 0 && i && check(i - 1, size_) == 0) + if (error_ == 0 && check(i ? i - 1 : 0, size_) == 0) current_ = i; else error_ = -1; diff --git a/mysql-wsrep-5.6/extra/yassl/src/cert_wrapper.cpp b/mysql-wsrep-5.6/extra/yassl/src/cert_wrapper.cpp index af94f5bc..1092e428 100644 --- a/mysql-wsrep-5.6/extra/yassl/src/cert_wrapper.cpp +++ b/mysql-wsrep-5.6/extra/yassl/src/cert_wrapper.cpp @@ -304,7 +304,10 @@ int CertManager::Validate() afterDate.type= cert.GetAfterDateType(); afterDate.length= strlen((char *) afterDate.data) + 1; peerX509_ = NEW_YS X509(cert.GetIssuer(), iSz, cert.GetCommonName(), - sSz, &beforeDate, &afterDate); + sSz, &beforeDate, &afterDate, + cert.GetIssuerCnStart(), cert.GetIssuerCnLength(), + cert.GetSubjectCnStart(), cert.GetSubjectCnLength() + ); if (err == TaoCrypt::SIG_OTHER_E && verifyCallback_) { X509_STORE_CTX store; @@ -350,7 +353,9 @@ int CertManager::SetPrivateKey(const x509& key) afterDate.type= cd.GetAfterDateType(); afterDate.length= strlen((char *) afterDate.data) + 1; selfX509_ = NEW_YS X509(cd.GetIssuer(), iSz, cd.GetCommonName(), - sSz, &beforeDate, &afterDate); + sSz, &beforeDate, &afterDate, + cd.GetIssuerCnStart(), cd.GetIssuerCnLength(), + cd.GetSubjectCnStart(), cd.GetSubjectCnLength()); } return 0; } @@ -367,7 +372,9 @@ void CertManager::setPeerX509(X509* x) ASN1_STRING* after = x->GetAfter(); peerX509_ = NEW_YS X509(issuer->GetName(), issuer->GetLength(), - subject->GetName(), subject->GetLength(), before, after); + subject->GetName(), subject->GetLength(), before, after, + issuer->GetCnPosition(), issuer->GetCnLength(), + subject->GetCnPosition(), subject->GetCnLength()); } diff --git a/mysql-wsrep-5.6/extra/yassl/src/crypto_wrapper.cpp b/mysql-wsrep-5.6/extra/yassl/src/crypto_wrapper.cpp index 52994364..12f956e6 100644 --- a/mysql-wsrep-5.6/extra/yassl/src/crypto_wrapper.cpp +++ b/mysql-wsrep-5.6/extra/yassl/src/crypto_wrapper.cpp @@ -748,9 +748,10 @@ struct DiffieHellman::DHImpl { byte* publicKey_; byte* privateKey_; byte* agreedKey_; + uint pubKeyLength_; DHImpl(TaoCrypt::RandomNumberGenerator& r) : ranPool_(r), publicKey_(0), - privateKey_(0), agreedKey_(0) {} + privateKey_(0), agreedKey_(0), pubKeyLength_(0) {} ~DHImpl() { ysArrayDelete(agreedKey_); @@ -759,7 +760,7 @@ struct DiffieHellman::DHImpl { } DHImpl(const DHImpl& that) : dh_(that.dh_), ranPool_(that.ranPool_), - publicKey_(0), privateKey_(0), agreedKey_(0) + publicKey_(0), privateKey_(0), agreedKey_(0), pubKeyLength_(0) { uint length = dh_.GetByteLength(); AllocKeys(length, length, length); @@ -807,7 +808,7 @@ DiffieHellman::DiffieHellman(const byte* p, unsigned int pSz, const byte* g, using TaoCrypt::Integer; pimpl_->dh_.Initialize(Integer(p, pSz).Ref(), Integer(g, gSz).Ref()); - pimpl_->publicKey_ = NEW_YS opaque[pubSz]; + pimpl_->publicKey_ = NEW_YS opaque[pimpl_->pubKeyLength_ = pubSz]; memcpy(pimpl_->publicKey_, pub, pubSz); } @@ -866,6 +867,10 @@ const byte* DiffieHellman::get_agreedKey() const return pimpl_->agreedKey_; } +uint DiffieHellman::get_publicKeyLength() const +{ + return pimpl_->pubKeyLength_; +} const byte* DiffieHellman::get_publicKey() const { diff --git a/mysql-wsrep-5.6/extra/yassl/src/handshake.cpp b/mysql-wsrep-5.6/extra/yassl/src/handshake.cpp index e63d69e9..29815882 100644 --- a/mysql-wsrep-5.6/extra/yassl/src/handshake.cpp +++ b/mysql-wsrep-5.6/extra/yassl/src/handshake.cpp @@ -1168,6 +1168,8 @@ void sendCertificateVerify(SSL& ssl, BufferOutput buffer) CertificateVerify verify; verify.Build(ssl); + if (ssl.GetError()) return; + RecordLayerHeader rlHeader; HandShakeHeader hsHeader; mySTL::auto_ptr out(NEW_YS output_buffer); diff --git a/mysql-wsrep-5.6/extra/yassl/src/ssl.cpp b/mysql-wsrep-5.6/extra/yassl/src/ssl.cpp index 028e0fa4..ad79002a 100644 --- a/mysql-wsrep-5.6/extra/yassl/src/ssl.cpp +++ b/mysql-wsrep-5.6/extra/yassl/src/ssl.cpp @@ -37,6 +37,8 @@ #include "file.hpp" // for TaoCrypt Source #include "coding.hpp" // HexDecoder #include "helpers.hpp" // for placement new hack +#include "rsa.hpp" // for TaoCrypt RSA key decode +#include "dsa.hpp" // for TaoCrypt DSA key decode #include #ifdef _WIN32 @@ -54,6 +56,8 @@ namespace yaSSL { int read_file(SSL_CTX* ctx, const char* file, int format, CertType type) { + int ret = SSL_SUCCESS; + if (format != SSL_FILETYPE_ASN1 && format != SSL_FILETYPE_PEM) return SSL_BAD_FILETYPE; @@ -141,8 +145,31 @@ int read_file(SSL_CTX* ctx, const char* file, int format, CertType type) } } } + + if (type == PrivateKey && ctx->privateKey_) { + // see if key is valid early + TaoCrypt::Source rsaSource(ctx->privateKey_->get_buffer(), + ctx->privateKey_->get_length()); + TaoCrypt::RSA_PrivateKey rsaKey; + rsaKey.Initialize(rsaSource); + + if (rsaSource.GetError().What()) { + // rsa failed see if DSA works + + TaoCrypt::Source dsaSource(ctx->privateKey_->get_buffer(), + ctx->privateKey_->get_length()); + TaoCrypt::DSA_PrivateKey dsaKey; + dsaKey.Initialize(dsaSource); + + if (rsaSource.GetError().What()) { + // neither worked + ret = SSL_FAILURE; + } + } + } + fclose(input); - return SSL_SUCCESS; + return ret; } @@ -1323,16 +1350,14 @@ int ASN1_STRING_type(ASN1_STRING *x) int X509_NAME_get_index_by_NID(X509_NAME* name,int nid, int lastpos) { int idx = -1; // not found - const char* start = &name->GetName()[lastpos + 1]; + int cnPos = -1; switch (nid) { case NID_commonName: - const char* found = strstr(start, "/CN="); - if (found) { - found += 4; // advance to str - idx = found - start + lastpos + 1; - } - break; + cnPos = name->GetCnPosition(); + if (lastpos < cnPos) + idx = cnPos; + break; } return idx; diff --git a/mysql-wsrep-5.6/extra/yassl/src/yassl_error.cpp b/mysql-wsrep-5.6/extra/yassl/src/yassl_error.cpp index e5d69367..5169b7dd 100644 --- a/mysql-wsrep-5.6/extra/yassl/src/yassl_error.cpp +++ b/mysql-wsrep-5.6/extra/yassl/src/yassl_error.cpp @@ -148,6 +148,10 @@ void SetErrorString(YasslError error, char* buffer) strncpy(buffer, "sanity check on cipher text size error", max); break; + case rsaSignFault_error: + strncpy(buffer, "rsa signature fault error", max); + break; + // openssl errors case SSL_ERROR_WANT_READ : strncpy(buffer, "the read operation would block", max); diff --git a/mysql-wsrep-5.6/extra/yassl/src/yassl_imp.cpp b/mysql-wsrep-5.6/extra/yassl/src/yassl_imp.cpp index 69ba469b..f1907616 100644 --- a/mysql-wsrep-5.6/extra/yassl/src/yassl_imp.cpp +++ b/mysql-wsrep-5.6/extra/yassl/src/yassl_imp.cpp @@ -109,15 +109,12 @@ void ClientDiffieHellmanPublic::build(SSL& ssl) uint keyLength = dhClient.get_agreedKeyLength(); // pub and agree same alloc(keyLength, true); - dhClient.makeAgreement(dhServer.get_publicKey(), keyLength); + dhClient.makeAgreement(dhServer.get_publicKey(), + dhServer.get_publicKeyLength()); c16toa(keyLength, Yc_); memcpy(Yc_ + KEY_OFFSET, dhClient.get_publicKey(), keyLength); - // because of encoding first byte might be zero, don't use it for preMaster - if (*dhClient.get_agreedKey() == 0) - ssl.set_preMaster(dhClient.get_agreedKey() + 1, keyLength - 1); - else - ssl.set_preMaster(dhClient.get_agreedKey(), keyLength); + ssl.set_preMaster(dhClient.get_agreedKey(), keyLength); } @@ -196,9 +193,16 @@ void DH_Server::build(SSL& ssl) sha.update(tmp.get_buffer(), tmp.get_size()); sha.get_digest(&hash[MD5_LEN]); - if (ssl.getSecurity().get_parms().sig_algo_ == rsa_sa_algo) + if (ssl.getSecurity().get_parms().sig_algo_ == rsa_sa_algo) { auth->sign(signature_, hash, sizeof(hash), ssl.getCrypto().get_random()); + // check for rsa signautre fault + if (!auth->verify(hash, sizeof(hash), signature_, + auth->get_signatureLength())) { + ssl.SetError(rsaSignFault_error); + return; + } + } else { auth->sign(signature_, &hash[MD5_LEN], SHA_LEN, ssl.getCrypto().get_random()); @@ -314,11 +318,7 @@ void ClientDiffieHellmanPublic::read(SSL& ssl, input_buffer& input) } dh.makeAgreement(Yc_, keyLength); - // because of encoding, first byte might be 0, don't use for preMaster - if (*dh.get_agreedKey() == 0) - ssl.set_preMaster(dh.get_agreedKey() + 1, dh.get_agreedKeyLength() - 1); - else - ssl.set_preMaster(dh.get_agreedKey(), dh.get_agreedKeyLength()); + ssl.set_preMaster(dh.get_agreedKey(), dh.get_agreedKeyLength()); ssl.makeMasterSecret(); } @@ -2159,6 +2159,12 @@ void CertificateVerify::Build(SSL& ssl) memcpy(sig.get(), len, VERIFY_HEADER); rsa.sign(sig.get() + VERIFY_HEADER, hashes_.md5_, sizeof(Hashes), ssl.getCrypto().get_random()); + // check for rsa signautre fault + if (!rsa.verify(hashes_.md5_, sizeof(Hashes), sig.get() + VERIFY_HEADER, + rsa.get_cipherLength())) { + ssl.SetError(rsaSignFault_error); + return; + } } else { // DSA DSS dss(cert.get_privateKey(), cert.get_privateKeyLength(), false); diff --git a/mysql-wsrep-5.6/extra/yassl/src/yassl_int.cpp b/mysql-wsrep-5.6/extra/yassl/src/yassl_int.cpp index 16858a6e..17d68989 100644 --- a/mysql-wsrep-5.6/extra/yassl/src/yassl_int.cpp +++ b/mysql-wsrep-5.6/extra/yassl/src/yassl_int.cpp @@ -859,6 +859,19 @@ void SSL::set_random(const opaque* random, ConnectionEnd sender) // store client pre master secret void SSL::set_preMaster(const opaque* pre, uint sz) { + uint i(0); // trim leading zeros + uint fullSz(sz); + + while (i++ < fullSz && *pre == 0) { + sz--; + pre++; + } + + if (sz == 0) { + SetError(bad_input); + return; + } + secure_.use_connection().AllocPreSecret(sz); memcpy(secure_.use_connection().pre_master_secret_, pre, sz); } @@ -976,6 +989,8 @@ void SSL::order_error() // Create and store the master secret see page 32, 6.1 void SSL::makeMasterSecret() { + if (GetError()) return; + if (isTLS()) makeTLSMasterSecret(); else { @@ -1592,7 +1607,9 @@ void SSL_SESSION::CopyX509(X509* x) peerX509_ = NEW_YS X509(issuer->GetName(), issuer->GetLength(), subject->GetName(), subject->GetLength(), - before, after); + before, after, + issuer->GetCnPosition(), issuer->GetCnLength(), + subject->GetCnPosition(), subject->GetCnLength()); } @@ -2560,8 +2577,8 @@ void Security::set_resuming(bool b) } -X509_NAME::X509_NAME(const char* n, size_t sz) - : name_(0), sz_(sz) +X509_NAME::X509_NAME(const char* n, size_t sz, int pos, int len) + : name_(0), sz_(sz), cnPosition_(pos), cnLen_(len) { if (sz) { name_ = NEW_YS char[sz]; @@ -2591,8 +2608,10 @@ size_t X509_NAME::GetLength() const X509::X509(const char* i, size_t iSz, const char* s, size_t sSz, - ASN1_STRING *b, ASN1_STRING *a) - : issuer_(i, iSz), subject_(s, sSz), + ASN1_STRING *b, ASN1_STRING *a, + int issPos, int issLen, + int subPos, int subLen) + : issuer_(i, iSz, issPos, issLen), subject_(s, sSz, subPos, subLen), beforeDate_((char *) b->data, b->length, b->type), afterDate_((char *) a->data, a->length, a->type) {} @@ -2627,19 +2646,20 @@ ASN1_STRING* X509_NAME::GetEntry(int i) if (i < 0 || i >= int(sz_)) return 0; + if (i != cnPosition_ || cnLen_ <= 0) // only entry currently supported + return 0; + + if (cnLen_ > int(sz_-i)) // make sure there's room in read buffer + return 0; + if (entry_.data) ysArrayDelete(entry_.data); - entry_.data = NEW_YS byte[sz_]; // max size; + entry_.data = NEW_YS byte[cnLen_+1]; // max size; - memcpy(entry_.data, &name_[i], sz_ - i); - if (entry_.data[sz_ -i - 1]) { - entry_.data[sz_ - i] = 0; - entry_.length = int(sz_) - i; - } - else - entry_.length = int(sz_) - i - 1; + memcpy(entry_.data, &name_[i], cnLen_); + entry_.data[cnLen_] = 0; + entry_.length = cnLen_; entry_.type = 0; - return &entry_; } diff --git a/mysql-wsrep-5.6/extra/yassl/taocrypt/include/asn.hpp b/mysql-wsrep-5.6/extra/yassl/taocrypt/include/asn.hpp index bc3eebe6..28c7c8f5 100644 --- a/mysql-wsrep-5.6/extra/yassl/taocrypt/include/asn.hpp +++ b/mysql-wsrep-5.6/extra/yassl/taocrypt/include/asn.hpp @@ -286,7 +286,10 @@ public: byte GetBeforeDateType() const { return beforeDateType_; } const char* GetAfterDate() const { return afterDate_; } byte GetAfterDateType() const { return afterDateType_; } - + int GetSubjectCnStart() const { return subCnPos_; } + int GetIssuerCnStart() const { return issCnPos_; } + int GetSubjectCnLength() const { return subCnLen_; } + int GetIssuerCnLength() const { return issCnLen_; } void DecodeToKey(); private: PublicKey key_; @@ -295,6 +298,10 @@ private: word32 sigLength_; // length of signature word32 signatureOID_; // sum of algorithm object id word32 keyOID_; // sum of key algo object id + int subCnPos_; // subject common name start, -1 is none + int subCnLen_; // length of above + int issCnPos_; // issuer common name start, -1 is none + int issCnLen_; // length of above byte subjectHash_[SHA_SIZE]; // hash of all Names byte issuerHash_[SHA_SIZE]; // hash of all Names byte* signature_; diff --git a/mysql-wsrep-5.6/extra/yassl/taocrypt/src/asn.cpp b/mysql-wsrep-5.6/extra/yassl/taocrypt/src/asn.cpp index 7c9e91e1..24f76648 100644 --- a/mysql-wsrep-5.6/extra/yassl/taocrypt/src/asn.cpp +++ b/mysql-wsrep-5.6/extra/yassl/taocrypt/src/asn.cpp @@ -87,7 +87,7 @@ bool ASN1_TIME_extract(const unsigned char* date, unsigned char format, namespace { // locals -// to the minute +// to the second bool operator>(tm& a, tm& b) { if (a.tm_year > b.tm_year) @@ -108,13 +108,18 @@ bool operator>(tm& a, tm& b) a.tm_min > b.tm_min) return true; + if (a.tm_year == b.tm_year && a.tm_mon == b.tm_mon && + a.tm_mday == b.tm_mday && a.tm_hour == b.tm_hour && + a.tm_min == b.tm_min && a.tm_sec > b.tm_sec) + return true; + return false; } bool operator<(tm& a, tm&b) { - return !(a>b); + return (b>a); } @@ -482,8 +487,9 @@ void DH_Decoder::Decode(DH& key) CertDecoder::CertDecoder(Source& s, bool decode, SignerList* signers, bool noVerify, CertType ct) - : BER_Decoder(s), certBegin_(0), sigIndex_(0), sigLength_(0), - signature_(0), verify_(!noVerify) + : BER_Decoder(s), certBegin_(0), sigIndex_(0), sigLength_(0), subCnPos_(-1), + subCnLen_(0), issCnPos_(-1), issCnLen_(0), signature_(0), + verify_(!noVerify) { issuer_[0] = 0; subject_[0] = 0; @@ -804,6 +810,13 @@ void CertDecoder::GetName(NameType nt) case COMMON_NAME: if (!(ptr = AddTag(ptr, buf_end, "/CN=", 4, strLen))) return; + if (nt == ISSUER) { + issCnPos_ = (int)(ptr - strLen - issuer_); + issCnLen_ = (int)strLen; + } else { + subCnPos_ = (int)(ptr - strLen - subject_); + subCnLen_ = (int)strLen; + } break; case SUR_NAME: if (!(ptr = AddTag(ptr, buf_end, "/SN=", 4, strLen))) diff --git a/mysql-wsrep-5.6/extra/yassl/taocrypt/src/rsa.cpp b/mysql-wsrep-5.6/extra/yassl/taocrypt/src/rsa.cpp index 79a8a8f1..73f678e2 100644 --- a/mysql-wsrep-5.6/extra/yassl/taocrypt/src/rsa.cpp +++ b/mysql-wsrep-5.6/extra/yassl/taocrypt/src/rsa.cpp @@ -140,6 +140,10 @@ word32 RSA_BlockType2::UnPad(const byte *pkcsBlock, unsigned int pkcsBlockLen, void RSA_BlockType1::Pad(const byte* input, word32 inputLen, byte* pkcsBlock, word32 pkcsBlockLen, RandomNumberGenerator&) const { + // sanity checks + if (input == NULL || pkcsBlock == NULL) + return; + // convert from bit length to byte length if (pkcsBlockLen % 8 != 0) { diff --git a/mysql-wsrep-5.6/extra/yassl/testsuite/cipher-test.sh b/mysql-wsrep-5.6/extra/yassl/testsuite/cipher-test.sh index 5ce29459..d3e69146 100644 --- a/mysql-wsrep-5.6/extra/yassl/testsuite/cipher-test.sh +++ b/mysql-wsrep-5.6/extra/yassl/testsuite/cipher-test.sh @@ -4,6 +4,7 @@ # +no_pid=-1 server_pid=$no_pid diff --git a/mysql-wsrep-5.6/extra/yassl/testsuite/test.hpp b/mysql-wsrep-5.6/extra/yassl/testsuite/test.hpp index 3e15ce81..94ab24fd 100644 --- a/mysql-wsrep-5.6/extra/yassl/testsuite/test.hpp +++ b/mysql-wsrep-5.6/extra/yassl/testsuite/test.hpp @@ -469,9 +469,24 @@ inline void showPeer(SSL* ssl) if (peer) { char* issuer = X509_NAME_oneline(X509_get_issuer_name(peer), 0, 0); char* subject = X509_NAME_oneline(X509_get_subject_name(peer), 0, 0); + X509_NAME_ENTRY* se = NULL; + ASN1_STRING* sd = NULL; + char* subCN = NULL; + X509_NAME* sub = X509_get_subject_name(peer); + int lastpos = -1; + if (sub) + lastpos = X509_NAME_get_index_by_NID(sub, NID_commonName, lastpos); + if (lastpos >= 0) { + se = X509_NAME_get_entry(sub, lastpos); + if (se) + sd = X509_NAME_ENTRY_get_data(se); + if (sd) + subCN = (char*)ASN1_STRING_data(sd); + } + + printf("peer's cert info:\n issuer : %s\n subject: %s\n" + " subject cn: %s\n", issuer, subject, subCN); - printf("peer's cert info:\n issuer : %s\n subject: %s\n", issuer, - subject); free(subject); free(issuer); } diff --git a/mysql-wsrep-5.6/include/base64.h b/mysql-wsrep-5.6/include/base64.h index 5fb2e9b8..64068080 100644 --- a/mysql-wsrep-5.6/include/base64.h +++ b/mysql-wsrep-5.6/include/base64.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2003, 2015, 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 @@ -23,22 +23,22 @@ extern "C" { /* Calculate how much memory needed for dst of base64_encode() */ -int base64_needed_encoded_length(int length_of_data); +uint64 base64_needed_encoded_length(uint64 length_of_data); /* Maximum length base64_encode_needed_length() can accept with no overflow. */ -int base64_encode_max_arg_length(void); +uint64 base64_encode_max_arg_length(void); /* Calculate how much memory needed for dst of base64_decode() */ -int base64_needed_decoded_length(int length_of_encoded_data); +uint64 base64_needed_decoded_length(uint64 length_of_encoded_data); /* Maximum length base64_decode_needed_length() can accept with no overflow. */ -int base64_decode_max_arg_length(); +uint64 base64_decode_max_arg_length(); /* Encode data as a base64 string @@ -48,7 +48,7 @@ int base64_encode(const void *src, size_t src_len, char *dst); /* Decode a base64 string into data */ -int base64_decode(const char *src, size_t src_len, +int64 base64_decode(const char *src, size_t src_len, void *dst, const char **end_ptr, int flags); /* Allow multuple chunks 'AAA= AA== AA==', binlog uses this */ diff --git a/mysql-wsrep-5.6/include/ft_global.h b/mysql-wsrep-5.6/include/ft_global.h index 06ef4ecd..1ff70cef 100644 --- a/mysql-wsrep-5.6/include/ft_global.h +++ b/mysql-wsrep-5.6/include/ft_global.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,8 +25,8 @@ extern "C" { #endif -#define HA_FT_MAXBYTELEN 254 -#define HA_FT_MAXCHARLEN (HA_FT_MAXBYTELEN/3) +#define HA_FT_MAXBYTELEN 336 +#define HA_FT_MAXCHARLEN (HA_FT_MAXBYTELEN/4) #define DEFAULT_FTB_SYNTAX "+ -><()~*:\"\"&|" diff --git a/mysql-wsrep-5.6/include/lf.h b/mysql-wsrep-5.6/include/lf.h index 44c8279f..d807b216 100644 --- a/mysql-wsrep-5.6/include/lf.h +++ b/mysql-wsrep-5.6/include/lf.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2007, 2015, 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 @@ -244,6 +244,9 @@ void lf_hash_destroy(LF_HASH *hash); int lf_hash_insert(LF_HASH *hash, LF_PINS *pins, const void *data); void *lf_hash_search(LF_HASH *hash, LF_PINS *pins, const void *key, uint keylen); int lf_hash_delete(LF_HASH *hash, LF_PINS *pins, const void *key, uint keylen); +typedef int lf_hash_match_func(const uchar *el); +void *lf_hash_random_match(LF_HASH *hash, LF_PINS *pins, + lf_hash_match_func *match, uint rand_val); /* shortcut macros to access underlying pinbox functions from an LF_HASH see _lf_pinbox_get_pins() and _lf_pinbox_put_pins() diff --git a/mysql-wsrep-5.6/include/my_md5.h b/mysql-wsrep-5.6/include/my_md5.h index 452676e4..4f891059 100644 --- a/mysql-wsrep-5.6/include/my_md5.h +++ b/mysql-wsrep-5.6/include/my_md5.h @@ -43,7 +43,11 @@ static inline void array_to_hex(char *to, const unsigned char *str, uint len) *to++= _dig_vec_lower[((uchar) *str) & 0x0F]; } } - +#ifdef WITH_WSREP +void *wsrep_md5_init(); +void wsrep_md5_update(void *ctx, char* buf, int len); + void wsrep_compute_md5_hash(char *digest, void *ctx); +#endif #ifdef __cplusplus } #endif diff --git a/mysql-wsrep-5.6/include/my_pthread.h b/mysql-wsrep-5.6/include/my_pthread.h index 4e099c70..6463ceea 100644 --- a/mysql-wsrep-5.6/include/my_pthread.h +++ b/mysql-wsrep-5.6/include/my_pthread.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2016, 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 @@ -90,6 +90,7 @@ typedef volatile LONG my_pthread_once_t; windows implementation of pthread_cond_timedwait */ +#ifndef HAVE_STRUCT_TIMESPEC /* Declare a union to make sure FILETIME is properly aligned so it can be used directly as a 64 bit value. The value @@ -131,6 +132,8 @@ struct timespec { #define diff_timespec(TS1, TS2) \ ((TS1.tv.i64 - TS2.tv.i64) * 100) +#endif + int win_pthread_mutex_trylock(pthread_mutex_t *mutex); int pthread_create(pthread_t *, const pthread_attr_t *, pthread_handler, void *); int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr); diff --git a/mysql-wsrep-5.6/include/mysql/psi/mysql_statement.h b/mysql-wsrep-5.6/include/mysql/psi/mysql_statement.h index d7a76ee2..3d5943fa 100644 --- a/mysql-wsrep-5.6/include/mysql/psi/mysql_statement.h +++ b/mysql-wsrep-5.6/include/mysql/psi/mysql_statement.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2015, 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 @@ -41,7 +41,6 @@ do {} while (0) #endif -#ifdef HAVE_PSI_STATEMENT_INTERFACE #ifdef HAVE_PSI_STATEMENT_DIGEST_INTERFACE #define MYSQL_DIGEST_START(LOCKER) \ inline_mysql_digest_start(LOCKER) @@ -49,17 +48,13 @@ #define MYSQL_DIGEST_START(LOCKER) \ NULL #endif -#else - #define MYSQL_DIGEST_START(LOCKER) \ - NULL -#endif #ifdef HAVE_PSI_STATEMENT_DIGEST_INTERFACE - #define MYSQL_ADD_TOKEN(LOCKER, T, Y) \ - inline_mysql_add_token(LOCKER, T, Y) + #define MYSQL_DIGEST_END(LOCKER, DIGEST) \ + inline_mysql_digest_end(LOCKER, DIGEST) #else - #define MYSQL_ADD_TOKEN(LOCKER, T, Y) \ - NULL + #define MYSQL_DIGEST_END(LOCKER, DIGEST) \ + do {} while (0) #endif #ifdef HAVE_PSI_STATEMENT_INTERFACE @@ -132,20 +127,17 @@ inline_mysql_digest_start(PSI_statement_locker *locker) PSI_digest_locker* digest_locker= NULL; if (likely(locker != NULL)) - digest_locker= PSI_STATEMENT_CALL(digest_start)(locker); + digest_locker= PSI_DIGEST_CALL(digest_start)(locker); return digest_locker; } #endif #ifdef HAVE_PSI_STATEMENT_DIGEST_INTERFACE -static inline struct PSI_digest_locker * -inline_mysql_add_token(PSI_digest_locker *locker, uint token, - void *yylval) +static inline void +inline_mysql_digest_end(PSI_digest_locker *locker, const sql_digest_storage *digest) { if (likely(locker != NULL)) - locker= PSI_STATEMENT_CALL(digest_add_token)(locker, token, - (OPAQUE_LEX_YYSTYPE*)yylval); - return locker; + PSI_DIGEST_CALL(digest_end)(locker, digest); } #endif diff --git a/mysql-wsrep-5.6/include/mysql/psi/psi.h b/mysql-wsrep-5.6/include/mysql/psi/psi.h index 30f2709b..7fcff89c 100644 --- a/mysql-wsrep-5.6/include/mysql/psi/psi.h +++ b/mysql-wsrep-5.6/include/mysql/psi/psi.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2015, 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 @@ -43,18 +43,8 @@ C_MODE_START struct TABLE_SHARE; -/* - There are 3 known bison parsers in the server: - - (1) the SQL parser itself, sql/sql_yacc.yy - - (2) storage/innobase/fts/fts0pars.y - - (3) storage/innobase/pars/pars0grm.y - What is instrumented here are the tokens from the SQL query text (1), - to make digests. - Now, to avoid name pollution and conflicts with different YYSTYPE definitions, - an opaque structure is used here. - The real type to use when invoking the digest api is LEX_YYSTYPE. -*/ -struct OPAQUE_LEX_YYSTYPE; + +struct sql_digest_storage; /** @file mysql/psi/psi.h @@ -952,29 +942,6 @@ struct PSI_table_locker_state_v1 uint m_index; }; -#define PSI_MAX_DIGEST_STORAGE_SIZE 1024 - -/** - Structure to store token count/array for a statement - on which digest is to be calculated. -*/ -struct PSI_digest_storage -{ - my_bool m_full; - int m_byte_count; - /** Character set number. */ - uint m_charset_number; - unsigned char m_token_array[PSI_MAX_DIGEST_STORAGE_SIZE]; -}; -typedef struct PSI_digest_storage PSI_digest_storage; - -struct PSI_digest_locker_state -{ - int m_last_id_index; - PSI_digest_storage m_digest_storage; -}; -typedef struct PSI_digest_locker_state PSI_digest_locker_state; - /* Duplicate of NAME_LEN, to avoid dependency on mysql_com.h */ #define PSI_SCHEMA_NAME_LEN (64 * 3) @@ -1037,11 +1004,13 @@ struct PSI_statement_locker_state_v1 /** Metric, number of sort scans. */ ulong m_sort_scan; /** Statement digest. */ - PSI_digest_locker_state m_digest_state; + const struct sql_digest_storage *m_digest; /** Current schema name. */ char m_schema_name[PSI_SCHEMA_NAME_LEN]; /** Length in bytes of @c m_schema_name. */ uint m_schema_name_length; + /** Statement character set number. */ + uint m_cs_number; }; /** @@ -1902,11 +1871,15 @@ typedef void (*set_socket_info_v1_t)(struct PSI_socket *socket, */ typedef void (*set_socket_thread_owner_v1_t)(struct PSI_socket *socket); +/** + Get a digest locker for the current statement. + @param locker a statement locker for the running thread +*/ typedef struct PSI_digest_locker * (*digest_start_v1_t) (struct PSI_statement_locker *locker); -typedef struct PSI_digest_locker* (*digest_add_token_v1_t) - (struct PSI_digest_locker *locker, uint token, struct OPAQUE_LEX_YYSTYPE *yylval); +typedef void (*digest_end_v1_t) + (struct PSI_digest_locker *locker, const struct sql_digest_storage *digest); /** Stores an array of connection attributes @@ -2118,8 +2091,8 @@ struct PSI_v1 set_socket_thread_owner_v1_t set_socket_thread_owner; /** @sa digest_start_v1_t. */ digest_start_v1_t digest_start; - /** @sa digest_add_token_v1_t. */ - digest_add_token_v1_t digest_add_token; + /** @sa digest_end_v1_t. */ + digest_end_v1_t digest_end; /** @sa set_thread_connect_attrs_v1_t. */ set_thread_connect_attrs_v1_t set_thread_connect_attrs; }; @@ -2414,6 +2387,10 @@ extern MYSQL_PLUGIN_IMPORT PSI *PSI_server; #define PSI_STATEMENT_CALL(M) PSI_DYNAMIC_CALL(M) #endif +#ifndef PSI_DIGEST_CALL +#define PSI_DIGEST_CALL(M) PSI_DYNAMIC_CALL(M) +#endif + #ifndef PSI_TABLE_CALL #define PSI_TABLE_CALL(M) PSI_DYNAMIC_CALL(M) #endif diff --git a/mysql-wsrep-5.6/include/mysql/psi/psi_abi_v0.h.pp b/mysql-wsrep-5.6/include/mysql/psi/psi_abi_v0.h.pp index b46b38ed..17d61016 100644 --- a/mysql-wsrep-5.6/include/mysql/psi/psi_abi_v0.h.pp +++ b/mysql-wsrep-5.6/include/mysql/psi/psi_abi_v0.h.pp @@ -1,7 +1,7 @@ #include "mysql/psi/psi.h" C_MODE_START struct TABLE_SHARE; -struct OPAQUE_LEX_YYSTYPE; +struct sql_digest_storage; struct PSI_mutex; typedef struct PSI_mutex PSI_mutex; struct PSI_rwlock; diff --git a/mysql-wsrep-5.6/include/mysql/psi/psi_abi_v1.h.pp b/mysql-wsrep-5.6/include/mysql/psi/psi_abi_v1.h.pp index fa2bf724..2e2d7a79 100644 --- a/mysql-wsrep-5.6/include/mysql/psi/psi_abi_v1.h.pp +++ b/mysql-wsrep-5.6/include/mysql/psi/psi_abi_v1.h.pp @@ -1,7 +1,7 @@ #include "mysql/psi/psi.h" C_MODE_START struct TABLE_SHARE; -struct OPAQUE_LEX_YYSTYPE; +struct sql_digest_storage; struct PSI_mutex; typedef struct PSI_mutex PSI_mutex; struct PSI_rwlock; @@ -241,20 +241,6 @@ struct PSI_table_locker_state_v1 void *m_wait; uint m_index; }; -struct PSI_digest_storage -{ - my_bool m_full; - int m_byte_count; - uint m_charset_number; - unsigned char m_token_array[1024]; -}; -typedef struct PSI_digest_storage PSI_digest_storage; -struct PSI_digest_locker_state -{ - int m_last_id_index; - PSI_digest_storage m_digest_storage; -}; -typedef struct PSI_digest_locker_state PSI_digest_locker_state; struct PSI_statement_locker_state_v1 { my_bool m_discarded; @@ -280,9 +266,10 @@ struct PSI_statement_locker_state_v1 ulong m_sort_range; ulong m_sort_rows; ulong m_sort_scan; - PSI_digest_locker_state m_digest_state; + const struct sql_digest_storage *m_digest; char m_schema_name[(64 * 3)]; uint m_schema_name_length; + uint m_cs_number; }; struct PSI_socket_locker_state_v1 { @@ -508,8 +495,8 @@ typedef void (*set_socket_info_v1_t)(struct PSI_socket *socket, typedef void (*set_socket_thread_owner_v1_t)(struct PSI_socket *socket); typedef struct PSI_digest_locker * (*digest_start_v1_t) (struct PSI_statement_locker *locker); -typedef struct PSI_digest_locker* (*digest_add_token_v1_t) - (struct PSI_digest_locker *locker, uint token, struct OPAQUE_LEX_YYSTYPE *yylval); +typedef void (*digest_end_v1_t) + (struct PSI_digest_locker *locker, const struct sql_digest_storage *digest); typedef int (*set_thread_connect_attrs_v1_t)(const char *buffer, uint length, const void *from_cs); struct PSI_v1 @@ -610,7 +597,7 @@ struct PSI_v1 set_socket_info_v1_t set_socket_info; set_socket_thread_owner_v1_t set_socket_thread_owner; digest_start_v1_t digest_start; - digest_add_token_v1_t digest_add_token; + digest_end_v1_t digest_end; set_thread_connect_attrs_v1_t set_thread_connect_attrs; }; typedef struct PSI_v1 PSI; diff --git a/mysql-wsrep-5.6/include/mysql/psi/psi_abi_v2.h.pp b/mysql-wsrep-5.6/include/mysql/psi/psi_abi_v2.h.pp index 458013b4..c3dba0a9 100644 --- a/mysql-wsrep-5.6/include/mysql/psi/psi_abi_v2.h.pp +++ b/mysql-wsrep-5.6/include/mysql/psi/psi_abi_v2.h.pp @@ -1,7 +1,7 @@ #include "mysql/psi/psi.h" C_MODE_START struct TABLE_SHARE; -struct OPAQUE_LEX_YYSTYPE; +struct sql_digest_storage; struct PSI_mutex; typedef struct PSI_mutex PSI_mutex; struct PSI_rwlock; diff --git a/mysql-wsrep-5.6/include/mysql/thread_pool_priv.h b/mysql-wsrep-5.6/include/mysql/thread_pool_priv.h index d5d12ef1..ee197709 100644 --- a/mysql-wsrep-5.6/include/mysql/thread_pool_priv.h +++ b/mysql-wsrep-5.6/include/mysql/thread_pool_priv.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -35,6 +35,7 @@ #include #include #include +#include "field.h" #include typedef std::set::iterator Thread_iterator; diff --git a/mysql-wsrep-5.6/include/sslopt-case.h b/mysql-wsrep-5.6/include/sslopt-case.h index 25817587..bf9cc039 100644 --- a/mysql-wsrep-5.6/include/sslopt-case.h +++ b/mysql-wsrep-5.6/include/sslopt-case.h @@ -1,7 +1,7 @@ #ifndef SSLOPT_CASE_INCLUDED #define SSLOPT_CASE_INCLUDED -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -35,5 +35,18 @@ opt_ssl_crlpath= NULL; #endif break; +#ifdef MYSQL_CLIENT + case OPT_SSL_MODE: + if (my_strcasecmp(&my_charset_latin1, argument, "required")) + { + fprintf(stderr, + "Unknown value to --ssl-mode: '%s'. Use --ssl-mode=REQUIRED\n", + argument); + exit(1); + } + else + opt_ssl_required= 1; + break; +#endif /* MYSQL_CLIENT */ #endif #endif /* SSLOPT_CASE_INCLUDED */ diff --git a/mysql-wsrep-5.6/include/sslopt-longopts.h b/mysql-wsrep-5.6/include/sslopt-longopts.h index 8280f3b8..f21d28f4 100644 --- a/mysql-wsrep-5.6/include/sslopt-longopts.h +++ b/mysql-wsrep-5.6/include/sslopt-longopts.h @@ -1,7 +1,7 @@ #ifndef SSLOPT_LONGOPTS_INCLUDED #define SSLOPT_LONGOPTS_INCLUDED -/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -51,6 +51,9 @@ "when connecting. This option is disabled by default.", &opt_ssl_verify_server_cert, &opt_ssl_verify_server_cert, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0}, + {"ssl-mode", OPT_SSL_MODE, + "SSL connection mode.", + 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif #endif /* HAVE_OPENSSL */ #endif /* SSLOPT_LONGOPTS_INCLUDED */ diff --git a/mysql-wsrep-5.6/include/sslopt-vars.h b/mysql-wsrep-5.6/include/sslopt-vars.h index 6da4dfd8..e840edce 100644 --- a/mysql-wsrep-5.6/include/sslopt-vars.h +++ b/mysql-wsrep-5.6/include/sslopt-vars.h @@ -1,7 +1,7 @@ #ifndef SSLOPT_VARS_INCLUDED #define SSLOPT_VARS_INCLUDED -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2016, 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 @@ -30,8 +30,13 @@ SSL_STATIC char *opt_ssl_cipher = 0; SSL_STATIC char *opt_ssl_key = 0; SSL_STATIC char *opt_ssl_crl = 0; SSL_STATIC char *opt_ssl_crlpath = 0; + #ifdef MYSQL_CLIENT SSL_STATIC my_bool opt_ssl_verify_server_cert= 0; -#endif -#endif +SSL_STATIC my_bool opt_ssl_required= 0; +#endif /* MYSQL_CLIENT */ +#else /* HAVE_OPENSSL */ +#define opt_ssl_required 0 +#endif /* HAVE_OPENSSL */ + #endif /* SSLOPT_VARS_INCLUDED */ diff --git a/mysql-wsrep-5.6/include/thr_lock.h b/mysql-wsrep-5.6/include/thr_lock.h index c5638ec2..6b0741f1 100644 --- a/mysql-wsrep-5.6/include/thr_lock.h +++ b/mysql-wsrep-5.6/include/thr_lock.h @@ -20,6 +20,15 @@ #ifdef __cplusplus extern "C" { #endif +#ifdef WITH_WSREP +#include + typedef my_bool (* wsrep_thd_is_brute_force_fun)(void *, my_bool); + typedef int (* wsrep_abort_thd_fun)(void *, void *, my_bool); + typedef int (* wsrep_on_fun)(void *); + void wsrep_thr_lock_init( + wsrep_thd_is_brute_force_fun bf_fun, wsrep_abort_thd_fun abort_fun, + my_bool debug, my_bool convert_LOCK_to_trx, wsrep_on_fun on_fun); +#endif #include #include @@ -89,6 +98,10 @@ typedef struct st_thr_lock_info { pthread_t thread; my_thread_id thread_id; +#ifdef WITH_WSREP + void *mysql_thd; // THD pointer + my_bool in_lock_tables; // true, if inside locking session +#endif } THR_LOCK_INFO; diff --git a/mysql-wsrep-5.6/include/violite.h b/mysql-wsrep-5.6/include/violite.h index 00e26e8a..1cd9c879 100644 --- a/mysql-wsrep-5.6/include/violite.h +++ b/mysql-wsrep-5.6/include/violite.h @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2015, 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 @@ -147,7 +148,7 @@ enum enum_ssl_init_error { SSL_INITERR_NOERROR= 0, SSL_INITERR_CERT, SSL_INITERR_KEY, SSL_INITERR_NOMATCH, SSL_INITERR_BAD_PATHS, SSL_INITERR_CIPHERS, - SSL_INITERR_MEMFAIL, SSL_INITERR_LASTERR + SSL_INITERR_MEMFAIL, SSL_INITERR_DHFAIL, SSL_INITERR_LASTERR }; const char* sslGetErrString(enum enum_ssl_init_error err); diff --git a/mysql-wsrep-5.6/include/welcome_copyright_notice.h b/mysql-wsrep-5.6/include/welcome_copyright_notice.h index eb2bf260..7b6c28c2 100644 --- a/mysql-wsrep-5.6/include/welcome_copyright_notice.h +++ b/mysql-wsrep-5.6/include/welcome_copyright_notice.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2010, 2016, 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 @@ -16,7 +16,7 @@ #ifndef _welcome_copyright_notice_h_ #define _welcome_copyright_notice_h_ -#define COPYRIGHT_NOTICE_CURRENT_YEAR "2015" +#define COPYRIGHT_NOTICE_CURRENT_YEAR "2016" /* This define specifies copyright notice which is displayed by every MySQL diff --git a/mysql-wsrep-5.6/libevent/WIN32-Prj/libevent.dsp b/mysql-wsrep-5.6/libevent/WIN32-Prj/libevent.dsp index 61e9bc84..e9848f7f 100644 --- a/mysql-wsrep-5.6/libevent/WIN32-Prj/libevent.dsp +++ b/mysql-wsrep-5.6/libevent/WIN32-Prj/libevent.dsp @@ -1,128 +1,128 @@ -# Microsoft Developer Studio Project File - Name="libevent" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Static Library" 0x0104 - -CFG=libevent - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "libevent.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "libevent.mak" CFG="libevent - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "libevent - Win32 Release" (based on "Win32 (x86) Static Library") -!MESSAGE "libevent - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe - -!IF "$(CFG)" == "libevent - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "..\\" /I "..\WIN32-Code" /I "..\compat" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ELSEIF "$(CFG)" == "libevent - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\\" /I "..\WIN32-Code" /I "..\compat" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo -# ADD LIB32 /nologo - -!ENDIF - -# Begin Target - -# Name "libevent - Win32 Release" -# Name "libevent - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\log.c -# End Source File -# Begin Source File - -SOURCE=..\event.c -# End Source File -# Begin Source File - -SOURCE="..\WIN32-Code\misc.c" -# End Source File -# Begin Source File - -SOURCE="..\WIN32-Code\win32.c" -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\acconfig.h -# End Source File -# Begin Source File - -SOURCE="..\WIN32-Code\config.h" -# End Source File -# Begin Source File - -SOURCE=..\compat\err.h -# End Source File -# Begin Source File - -SOURCE=..\event.h -# End Source File -# Begin Source File - -SOURCE="..\WIN32-Code\misc.h" -# End Source File -# End Group -# End Target -# End Project +# Microsoft Developer Studio Project File - Name="libevent" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=libevent - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "libevent.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "libevent.mak" CFG="libevent - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "libevent - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "libevent - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "libevent - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /I "..\\" /I "..\WIN32-Code" /I "..\compat" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "libevent - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\\" /I "..\WIN32-Code" /I "..\compat" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "libevent - Win32 Release" +# Name "libevent - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\log.c +# End Source File +# Begin Source File + +SOURCE=..\event.c +# End Source File +# Begin Source File + +SOURCE="..\WIN32-Code\misc.c" +# End Source File +# Begin Source File + +SOURCE="..\WIN32-Code\win32.c" +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\acconfig.h +# End Source File +# Begin Source File + +SOURCE="..\WIN32-Code\config.h" +# End Source File +# Begin Source File + +SOURCE=..\compat\err.h +# End Source File +# Begin Source File + +SOURCE=..\event.h +# End Source File +# Begin Source File + +SOURCE="..\WIN32-Code\misc.h" +# End Source File +# End Group +# End Target +# End Project diff --git a/mysql-wsrep-5.6/libevent/WIN32-Prj/libevent.dsw b/mysql-wsrep-5.6/libevent/WIN32-Prj/libevent.dsw index 99a00cdf..fb05451c 100644 --- a/mysql-wsrep-5.6/libevent/WIN32-Prj/libevent.dsw +++ b/mysql-wsrep-5.6/libevent/WIN32-Prj/libevent.dsw @@ -1,74 +1,74 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "event_test"=".\event_test\event_test.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name libevent - End Project Dependency -}}} - -############################################################################### - -Project: "libevent"=".\libevent.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Project: "signal_test"=".\signal_test\signal_test.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name libevent - End Project Dependency -}}} - -############################################################################### - -Project: "time_test"=".\time_test\time_test.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name libevent - End Project Dependency -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "event_test"=".\event_test\event_test.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name libevent + End Project Dependency +}}} + +############################################################################### + +Project: "libevent"=".\libevent.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "signal_test"=".\signal_test\signal_test.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name libevent + End Project Dependency +}}} + +############################################################################### + +Project: "time_test"=".\time_test\time_test.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name libevent + End Project Dependency +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/mysql-wsrep-5.6/libevent/WIN32-Prj/libevent.sln b/mysql-wsrep-5.6/libevent/WIN32-Prj/libevent.sln index 3036ad78..17e0c98b 100644 --- a/mysql-wsrep-5.6/libevent/WIN32-Prj/libevent.sln +++ b/mysql-wsrep-5.6/libevent/WIN32-Prj/libevent.sln @@ -1,53 +1,53 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "event_test", "event_test\event_test.vcproj", "{52099A8B-455B-4BE9-8E61-A3D6E8A4338D}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libevent", "libevent.vcproj", "{B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "signal_test", "signal_test\signal_test.vcproj", "{768DB9DD-2694-4274-89B8-74106E8F7786}" - ProjectSection(ProjectDependencies) = postProject - {B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9} = {B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "time_test", "time_test\time_test.vcproj", "{D4BE29FB-E45C-4177-9647-74BBAFDC1257}" - ProjectSection(ProjectDependencies) = postProject - {B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9} = {B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "regress", "regress\regress.vcproj", "{F7C26008-6066-4AD3-8543-452EFE58BD2E}" - ProjectSection(ProjectDependencies) = postProject - {B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9} = {B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9} - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {52099A8B-455B-4BE9-8E61-A3D6E8A4338D}.Debug|Win32.ActiveCfg = Debug|Win32 - {52099A8B-455B-4BE9-8E61-A3D6E8A4338D}.Debug|Win32.Build.0 = Debug|Win32 - {52099A8B-455B-4BE9-8E61-A3D6E8A4338D}.Release|Win32.ActiveCfg = Release|Win32 - {52099A8B-455B-4BE9-8E61-A3D6E8A4338D}.Release|Win32.Build.0 = Release|Win32 - {B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9}.Debug|Win32.ActiveCfg = Debug|Win32 - {B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9}.Debug|Win32.Build.0 = Debug|Win32 - {B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9}.Release|Win32.ActiveCfg = Release|Win32 - {B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9}.Release|Win32.Build.0 = Release|Win32 - {768DB9DD-2694-4274-89B8-74106E8F7786}.Debug|Win32.ActiveCfg = Debug|Win32 - {768DB9DD-2694-4274-89B8-74106E8F7786}.Debug|Win32.Build.0 = Debug|Win32 - {768DB9DD-2694-4274-89B8-74106E8F7786}.Release|Win32.ActiveCfg = Release|Win32 - {768DB9DD-2694-4274-89B8-74106E8F7786}.Release|Win32.Build.0 = Release|Win32 - {D4BE29FB-E45C-4177-9647-74BBAFDC1257}.Debug|Win32.ActiveCfg = Debug|Win32 - {D4BE29FB-E45C-4177-9647-74BBAFDC1257}.Debug|Win32.Build.0 = Debug|Win32 - {D4BE29FB-E45C-4177-9647-74BBAFDC1257}.Release|Win32.ActiveCfg = Release|Win32 - {D4BE29FB-E45C-4177-9647-74BBAFDC1257}.Release|Win32.Build.0 = Release|Win32 - {F7C26008-6066-4AD3-8543-452EFE58BD2E}.Debug|Win32.ActiveCfg = Debug|Win32 - {F7C26008-6066-4AD3-8543-452EFE58BD2E}.Debug|Win32.Build.0 = Debug|Win32 - {F7C26008-6066-4AD3-8543-452EFE58BD2E}.Release|Win32.ActiveCfg = Release|Win32 - {F7C26008-6066-4AD3-8543-452EFE58BD2E}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "event_test", "event_test\event_test.vcproj", "{52099A8B-455B-4BE9-8E61-A3D6E8A4338D}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libevent", "libevent.vcproj", "{B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "signal_test", "signal_test\signal_test.vcproj", "{768DB9DD-2694-4274-89B8-74106E8F7786}" + ProjectSection(ProjectDependencies) = postProject + {B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9} = {B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "time_test", "time_test\time_test.vcproj", "{D4BE29FB-E45C-4177-9647-74BBAFDC1257}" + ProjectSection(ProjectDependencies) = postProject + {B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9} = {B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "regress", "regress\regress.vcproj", "{F7C26008-6066-4AD3-8543-452EFE58BD2E}" + ProjectSection(ProjectDependencies) = postProject + {B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9} = {B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9} + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {52099A8B-455B-4BE9-8E61-A3D6E8A4338D}.Debug|Win32.ActiveCfg = Debug|Win32 + {52099A8B-455B-4BE9-8E61-A3D6E8A4338D}.Debug|Win32.Build.0 = Debug|Win32 + {52099A8B-455B-4BE9-8E61-A3D6E8A4338D}.Release|Win32.ActiveCfg = Release|Win32 + {52099A8B-455B-4BE9-8E61-A3D6E8A4338D}.Release|Win32.Build.0 = Release|Win32 + {B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9}.Debug|Win32.ActiveCfg = Debug|Win32 + {B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9}.Debug|Win32.Build.0 = Debug|Win32 + {B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9}.Release|Win32.ActiveCfg = Release|Win32 + {B98ABFCE-24D4-4B70-94DE-EF7F1E0662F9}.Release|Win32.Build.0 = Release|Win32 + {768DB9DD-2694-4274-89B8-74106E8F7786}.Debug|Win32.ActiveCfg = Debug|Win32 + {768DB9DD-2694-4274-89B8-74106E8F7786}.Debug|Win32.Build.0 = Debug|Win32 + {768DB9DD-2694-4274-89B8-74106E8F7786}.Release|Win32.ActiveCfg = Release|Win32 + {768DB9DD-2694-4274-89B8-74106E8F7786}.Release|Win32.Build.0 = Release|Win32 + {D4BE29FB-E45C-4177-9647-74BBAFDC1257}.Debug|Win32.ActiveCfg = Debug|Win32 + {D4BE29FB-E45C-4177-9647-74BBAFDC1257}.Debug|Win32.Build.0 = Debug|Win32 + {D4BE29FB-E45C-4177-9647-74BBAFDC1257}.Release|Win32.ActiveCfg = Release|Win32 + {D4BE29FB-E45C-4177-9647-74BBAFDC1257}.Release|Win32.Build.0 = Release|Win32 + {F7C26008-6066-4AD3-8543-452EFE58BD2E}.Debug|Win32.ActiveCfg = Debug|Win32 + {F7C26008-6066-4AD3-8543-452EFE58BD2E}.Debug|Win32.Build.0 = Debug|Win32 + {F7C26008-6066-4AD3-8543-452EFE58BD2E}.Release|Win32.ActiveCfg = Release|Win32 + {F7C26008-6066-4AD3-8543-452EFE58BD2E}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/mysql-wsrep-5.6/libevent/http.c b/mysql-wsrep-5.6/libevent/http.c index 871bc2e4..3687698d 100644 --- a/mysql-wsrep-5.6/libevent/http.c +++ b/mysql-wsrep-5.6/libevent/http.c @@ -1,6 +1,9 @@ /* * Copyright (c) 2002-2006 Niels Provos * All rights reserved. + * This file was modified by Oracle on 28-08-2015. + * Modifications copyright (c) 2015, Oracle and/or its affiliates. + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -105,6 +108,7 @@ #define NI_NUMERICHOST 1 #define NI_NUMERICSERV 2 +#define INNODB_CHANGED static int fake_getnameinfo(const struct sockaddr *sa, size_t salen, char *host, @@ -2400,6 +2404,14 @@ evhttp_set_cb(struct evhttp *http, const char *uri, event_err(1, "%s: calloc", __func__); http_cb->what = strdup(uri); + +#ifdef INNODB_CHANGED + if (http_cb->what == NULL) { + free(http_cb); + event_err(1, "%s: strdup",__func__); + } +#endif + http_cb->cb = cb; http_cb->cbarg = cbarg; diff --git a/mysql-wsrep-5.6/libevent/test/regress_http.c b/mysql-wsrep-5.6/libevent/test/regress_http.c index 1e2a1eb0..f9eba921 100644 --- a/mysql-wsrep-5.6/libevent/test/regress_http.c +++ b/mysql-wsrep-5.6/libevent/test/regress_http.c @@ -1,6 +1,9 @@ /* * Copyright (c) 2003-2006 Niels Provos * All rights reserved. + * This file was modified by Oracle on 28-08-2015. + * Modifications copyright (c) 2015, Oracle and/or its affiliates. + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -57,6 +60,8 @@ #include "log.h" #include "http-internal.h" +#define INNODB_CHANGED + extern int pair[]; extern int test_ok; @@ -278,6 +283,15 @@ http_chunked_cb(struct evhttp_request *req, void *arg) { struct timeval when = { 0, 0 }; struct chunk_req_state *state = malloc(sizeof(struct chunk_req_state)); + +#ifdef INNODB_CHANGED + if (!state) { + fprintf(stderr, "Unable to allocate memory in" + "http_chunked_cb...\n"); + exit (1); + } +#endif + event_debug(("%s: called\n", __func__)); memset(state, 0, sizeof(struct chunk_req_state)); diff --git a/mysql-wsrep-5.6/libmysql/CMakeLists.txt b/mysql-wsrep-5.6/libmysql/CMakeLists.txt index 16a6a5e1..790888b5 100644 --- a/mysql-wsrep-5.6/libmysql/CMakeLists.txt +++ b/mysql-wsrep-5.6/libmysql/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2016, 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 @@ -235,11 +235,17 @@ IF(NOT DISABLE_SHARED) VERSION "${OS_SHARED_LIB_VERSION}" SOVERSION "${SHARED_LIB_MAJOR_VERSION}") CONFIGURE_FILE(libmysql.ver.in ${CMAKE_CURRENT_BINARY_DIR}/libmysql.ver) + + GET_TARGET_PROPERTY(libmysql_link_flags libmysql LINK_FLAGS) + IF(NOT libmysql_link_flag) + SET(libmysql_link_flags) + ENDIF() + SET(libmysql_link_flags + "${CMAKE_SHARED_LIBRARY_C_FLAGS} ${libmysql_link_flags}") + SET_TARGET_PROPERTIES(libmysql + PROPERTIES LINK_FLAGS "${libmysql_link_flags}") + IF(LINK_FLAG_NO_UNDEFINED) - GET_TARGET_PROPERTY(libmysql_link_flags libmysql LINK_FLAGS) - IF(NOT libmysql_link_flag) - SET(libmysql_link_flags) - ENDIF() SET(libmysql_link_flags "${libmysql_link_flags} ${LINK_FLAG_NO_UNDEFINED}") SET(libmysql_link_flags diff --git a/mysql-wsrep-5.6/libmysql/conf_to_src.c b/mysql-wsrep-5.6/libmysql/conf_to_src.c index 7f2ebe06..4209a834 100644 --- a/mysql-wsrep-5.6/libmysql/conf_to_src.c +++ b/mysql-wsrep-5.6/libmysql/conf_to_src.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2015, 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 @@ -118,7 +118,7 @@ print_arrays_for(char *set) { FILE *f; - sprintf(buf, "%s.conf", set); + snprintf(buf, sizeof(buf), "%s.conf", set); if ((f = fopen(buf, "r")) == NULL) { fprintf(stderr, "%s: can't read conf file for charset %s\n", prog, set); diff --git a/mysql-wsrep-5.6/libmysqld/lib_sql.cc b/mysql-wsrep-5.6/libmysqld/lib_sql.cc index 33b50ea8..4cdb5ec9 100644 --- a/mysql-wsrep-5.6/libmysqld/lib_sql.cc +++ b/mysql-wsrep-5.6/libmysqld/lib_sql.cc @@ -2,7 +2,7 @@ * Copyright (c) 2000 * SWsoft company * - * Modifications copyright (c) 2001, 2014. Oracle and/or its affiliates. + * Modifications copyright (c) 2001, 2015. Oracle and/or its affiliates. * All rights reserved. * * This material is provided "as is", with absolutely no warranty expressed @@ -327,15 +327,26 @@ static my_bool emb_read_query_result(MYSQL *mysql) return 0; } +#define HEADER_SIZE 9 static int emb_stmt_execute(MYSQL_STMT *stmt) { DBUG_ENTER("emb_stmt_execute"); - uchar header[5]; + /* + Header size is made similar to non-embedded library. + It should be consistent across embedded and non-embedded + libraries. + */ + uchar header[HEADER_SIZE]; THD *thd; my_bool res; int4store(header, stmt->stmt_id); header[4]= (uchar) stmt->flags; + /* + Dummy value is stored in the last 4 bytes of the header + to make it consistent with non-embedded library. + */ + int4store(header + 5, 1); thd= (THD*)stmt->mysql->thd; thd->client_param_count= stmt->param_count; thd->client_params= stmt->params; @@ -1276,6 +1287,14 @@ bool net_send_error_packet(THD *thd, uint sql_errno, const char *err, return FALSE; } +void Protocol_binary::prepare_for_resend() +{ + MYSQL_DATA *data= thd->cur_data; + next_mysql_field= data->embedded_info->fields_list; + packet->length(bit_fields + 1); + memset(const_cast(packet->ptr()), 0, 1 + bit_fields); + field_pos= 0; +} void Protocol_text::prepare_for_resend() { @@ -1312,6 +1331,78 @@ bool Protocol_text::store_null() return false; } +bool Protocol_binary::net_store_data(const uchar *from, size_t length) +{ + if (!thd->mysql) // bootstrap file handling + return 0; + + ulong packet_length= packet->length(); + /* + The +9 comes from that strings of length longer than 16M require + 9 bytes to be stored (see net_store_length). + */ + if (packet_length + 9 + length > packet->alloced_length() && + packet->realloc(packet_length + 9 + length)) + return 1; + uchar *to= net_store_length((uchar*)packet->ptr() + packet_length, length); + memcpy(to, from, length); + packet->length((uint)(to + length - (uchar*)packet->ptr())); + if (next_mysql_field->max_length < length) + next_mysql_field->max_length= length; + ++next_mysql_field; + return 0; +} + +bool Protocol_binary::net_store_data(const uchar *from, size_t length, + const CHARSET_INFO *from_cs, + const CHARSET_INFO *to_cs) +{ + uint dummy_errors; + /* Calculate maxumum possible result length */ + uint conv_length= to_cs->mbmaxlen * length / from_cs->mbminlen; + + if (!thd->mysql) // bootstrap file handling + return 0; + + if (conv_length > 250) + { + /* + For strings with conv_length greater than 250 bytes + we don't know how many bytes we will need to store length: one or two, + because we don't know result length until conversion is done. + For example, when converting from utf8 (mbmaxlen=3) to latin1, + conv_length=300 means that the result length can vary between 100 to 300. + length=100 needs one byte, length=300 needs to bytes. + + Thus conversion directly to "packet" is not worthy. + Let's use "convert" as a temporary buffer. + */ + return (convert->copy((const char*)from, length, from_cs, + to_cs, &dummy_errors) || + net_store_data((const uchar*)convert->ptr(), convert->length())); + } + + ulong packet_length= packet->length(); + ulong new_length= packet_length + conv_length + 1; + + if (new_length > packet->alloced_length() && packet->realloc(new_length)) + return 1; + + char *length_pos= (char*) packet->ptr() + packet_length; + char *to= length_pos + 1; + + to+= length= copy_and_convert(to, conv_length, to_cs, + (const char*)from, length, from_cs, + &dummy_errors); + + net_store_length((uchar*)length_pos, to - length_pos - 1); + packet->length((uint)(to - packet->ptr())); + if (next_mysql_field->max_length < length) + next_mysql_field->max_length= length; + ++next_mysql_field; + return 0; +} + bool Protocol::net_store_data(const uchar *from, size_t length) { char *field_buf; diff --git a/mysql-wsrep-5.6/man/comp_err.1 b/mysql-wsrep-5.6/man/comp_err.1 index 7d311abe..be76ce5b 100644 --- a/mysql-wsrep-5.6/man/comp_err.1 +++ b/mysql-wsrep-5.6/man/comp_err.1 @@ -2,12 +2,12 @@ .\" Title: \fBcomp_err\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBCOMP_ERR\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBCOMP_ERR\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -44,7 +44,7 @@ to determine the error messages to display for different error codes\&. \fBcomp_err\fR normally is run automatically when MySQL is built\&. It compiles the errmsg\&.sys -file from the plaintext file located at +file from the text file located at sql/share/errmsg\&.txt in MySQL source distributions\&. .PP @@ -101,8 +101,8 @@ Display a help message and exit\&. .\} .\" comp_err: charset option .\" charset option: comp_err -\fB\-\-charset=\fR\fB\fIpath\fR\fR, -\fB\-C \fR\fB\fIpath\fR\fR +\fB\-\-charset=\fR\fB\fIdir_name\fR\fR, +\fB\-C \fR\fB\fIdir_name\fR\fR .sp The character set directory\&. The default is \&.\&./sql/share/charsets\&. @@ -205,8 +205,8 @@ mysqld_ername\&.h\&. .\} .\" comp_err: out_dir option .\" out_dir option: comp_err -\fB\-\-out_dir=\fR\fB\fIpath\fR\fR, -\fB\-D \fR\fB\fIpath\fR\fR +\fB\-\-out_dir=\fR\fB\fIdir_name\fR\fR, +\fB\-D \fR\fB\fIdir_name\fR\fR .sp The name of the output base directory\&. The default is \&.\&./sql/share/\&. @@ -264,7 +264,7 @@ Display version information and exit\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/innochecksum.1 b/mysql-wsrep-5.6/man/innochecksum.1 index bf8a4e3b..91804062 100644 --- a/mysql-wsrep-5.6/man/innochecksum.1 +++ b/mysql-wsrep-5.6/man/innochecksum.1 @@ -2,12 +2,12 @@ .\" Title: \fBinnochecksum\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBINNOCHECKSUM\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBINNOCHECKSUM\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -154,7 +154,7 @@ Verbose mode; print a progress indicator every five seconds\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/msql2mysql.1 b/mysql-wsrep-5.6/man/msql2mysql.1 index 472e2e64..8fcf9554 100644 --- a/mysql-wsrep-5.6/man/msql2mysql.1 +++ b/mysql-wsrep-5.6/man/msql2mysql.1 @@ -2,12 +2,12 @@ .\" Title: \fBmsql2mysql\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMSQL2MYSQL\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMSQL2MYSQL\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -85,7 +85,7 @@ utility to make the function name substitutions\&. See .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/my_print_defaults.1 b/mysql-wsrep-5.6/man/my_print_defaults.1 index 83b5f960..f1ab6e5a 100644 --- a/mysql-wsrep-5.6/man/my_print_defaults.1 +++ b/mysql-wsrep-5.6/man/my_print_defaults.1 @@ -2,12 +2,12 @@ .\" Title: \fBmy_print_defaults\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMY_PRINT_DEFAULTS" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMY_PRINT_DEFAULTS" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -168,12 +168,9 @@ In addition to the groups named on the command line, read groups that have the g .sp Read options from the named login path in the \&.mylogin\&.cnf -login file\&. A +login path file\&. A \(lqlogin path\(rq -is an option group that permits only a limited set of options: -\fBhost\fR, -\fBuser\fR, and -\fBpassword\fR\&. Think of a login path as a set of values that indicate the server host and the credentials for authenticating with the server\&. To create the login path file, use the +is an option group containing options that specify which MySQL server to connect to and which account to authenticate as\&. To create or modify a login path file, use the \fBmysql_config_editor\fR utility\&. See \fBmysql_config_editor\fR(1)\&. This option was added in MySQL 5\&.6\&.6\&. @@ -203,6 +200,24 @@ Return an empty string\&. .sp -1 .IP \(bu 2.3 .\} +.\" my_print_defaults: show option +.\" show option: my_print_defaults +\fB\-\-show\fR, +\fB\-s\fR +.sp +As of MySQL 5\&.6\&.25, +\fBmy_print_defaults\fR +masks passwords by default\&. Use this option to display passwords in cleartext\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" my_print_defaults: verbose option .\" verbose option: my_print_defaults \fB\-\-verbose\fR, @@ -229,7 +244,7 @@ Display version information and exit\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/myisam_ftdump.1 b/mysql-wsrep-5.6/man/myisam_ftdump.1 index d08a4f6f..5bfada68 100644 --- a/mysql-wsrep-5.6/man/myisam_ftdump.1 +++ b/mysql-wsrep-5.6/man/myisam_ftdump.1 @@ -2,12 +2,12 @@ .\" Title: \fBmyisam_ftdump\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYISAM_FTDUMP\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYISAM_FTDUMP\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -251,7 +251,7 @@ Verbose mode\&. Print more output about what the program does\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/myisamchk.1 b/mysql-wsrep-5.6/man/myisamchk.1 index 7d383979..b7fa9bd6 100644 --- a/mysql-wsrep-5.6/man/myisamchk.1 +++ b/mysql-wsrep-5.6/man/myisamchk.1 @@ -2,12 +2,12 @@ .\" Title: \fBmyisamchk\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYISAMCHK\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYISAMCHK\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -960,7 +960,7 @@ file as .\} .\" myisamchk: character-sets-dir option .\" character-sets-dir option: myisamchk -\fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR +\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR .sp The directory where character sets are installed\&. See Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&. @@ -1191,23 +1191,6 @@ key_buffer_size\&. .sp -1 .IP \(bu 2.3 .\} -.\" myisamchk: set-character-set option -.\" set-character-set option: myisamchk -\fB\-\-set\-character\-set=\fR\fB\fIname\fR\fR -.sp -Change the character set used by the table indexes\&. This option was replaced by -\fB\-\-set\-collation\fR -in MySQL 5\&.0\&.3\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} .\" myisamchk: set-collation option .\" set-collation option: myisamchk \fB\-\-set\-collation=\fR\fB\fIname\fR\fR @@ -1243,8 +1226,8 @@ to use sorting to resolve the keys even if the temporary files would be very lar .\} .\" myisamchk: tmpdir option .\" tmpdir option: myisamchk -\fB\-\-tmpdir=\fR\fB\fIpath\fR\fR, -\fB\-t \fR\fB\fIpath\fR\fR +\fB\-\-tmpdir=\fR\fB\fIdir_name\fR\fR, +\fB\-t \fR\fB\fIdir_name\fR\fR .sp The path of the directory to be used for storing temporary files\&. If this is not set, \fBmyisamchk\fR @@ -1642,7 +1625,7 @@ File\-version .sp Version of MyISAM -format\&. Currently always 1\&. +format\&. Always 1\&. .RE .sp .RS 4 @@ -2502,7 +2485,7 @@ TMPDIR points to a memory file system, out of memory errors can easily occur\&. If this happens, run \fBmyisamchk\fR with the -\fB\-\-tmpdir=\fR\fB\fIpath\fR\fR +\fB\-\-tmpdir=\fR\fB\fIdir_name\fR\fR option to specify a directory located on a file system that has more space\&. .PP When performing repair operations, @@ -2549,7 +2532,7 @@ or \fB\-\-safe\-recover\fR), you need space on disk for sorting\&. This space is allocated in the temporary directory (specified by TMPDIR or -\fB\-\-tmpdir=\fR\fB\fIpath\fR\fR)\&. The following formula yields the amount of space required: +\fB\-\-tmpdir=\fR\fB\fIdir_name\fR\fR)\&. The following formula yields the amount of space required: .sp .if n \{\ .RS 4 @@ -2592,7 +2575,7 @@ instead of .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/myisamlog.1 b/mysql-wsrep-5.6/man/myisamlog.1 index 393dfb28..d8d223ed 100644 --- a/mysql-wsrep-5.6/man/myisamlog.1 +++ b/mysql-wsrep-5.6/man/myisamlog.1 @@ -2,12 +2,12 @@ .\" Title: \fBmyisamlog\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYISAMLOG\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYISAMLOG\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -228,7 +228,7 @@ Display version information\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/myisampack.1 b/mysql-wsrep-5.6/man/myisampack.1 index 2dad2da5..294e20ee 100644 --- a/mysql-wsrep-5.6/man/myisampack.1 +++ b/mysql-wsrep-5.6/man/myisampack.1 @@ -2,12 +2,12 @@ .\" Title: \fBmyisampack\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYISAMPACK\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYISAMPACK\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -115,7 +115,7 @@ Each file name argument should be the name of an index (\&.MYI) file\&. If you a extension\&. .PP After you compress a table with -\fBmyisampack\fR, you should use +\fBmyisampack\fR, use \fBmyisamchk \-rq\fR to rebuild its indexes\&. \fBmyisamchk\fR(1)\&. @@ -167,7 +167,7 @@ Make a backup of each table\*(Aqs data file using the name .\} .\" myisampack: character-sets-dir option .\" character-sets-dir option: myisampack -\fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR +\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR .sp The directory where character sets are installed\&. See Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&. @@ -245,13 +245,7 @@ have identical structure (same column names and types, same indexes, and so fort \fIbig_tbl_name\fR must not exist prior to the join operation\&. All source tables named on the command line to be merged into \fIbig_tbl_name\fR -must exist\&. The source tables are read for the join operation but not modified\&. The join operation does not create a -\&.frm -file for -\fIbig_tbl_name\fR, so after the join operation finishes, copy the -\&.frm -file from one of the source tables and name it -\fIbig_tbl_name\fR\&.frm\&. +must exist\&. The source tables are read for the join operation but not modified\&. .RE .sp .RS 4 @@ -296,8 +290,8 @@ Do not actually pack the table, just test packing it\&. .\} .\" myisampack: tmpdir option .\" tmpdir option: myisampack -\fB\-\-tmpdir=\fR\fB\fIpath\fR\fR, -\fB\-T \fR\fB\fIpath\fR\fR +\fB\-\-tmpdir=\fR\fB\fIdir_name\fR\fR, +\fB\-T \fR\fB\fIdir_name\fR\fR .sp Use the named directory as the location where \fBmyisampack\fR @@ -449,6 +443,13 @@ Original trees: 57 After join: 17 \- Compressing file 87\&.14% Remember to run myisamchk \-rq on compressed tables +shell> \fBmyisamchk \-rq station\fR +\- check record delete\-chain +\- recovering (with sort) MyISAM\-table \*(Aqstation\*(Aq +Data records: 1192 +\- Fixing index 1 +\- Fixing index 2 +shell> \fBmysqladmin \-uroot flush\-tables\fR shell> \fBls \-l station\&.*\fR \-rw\-rw\-r\-\- 1 monty my 127874 Apr 17 19:00 station\&.MYD \-rw\-rw\-r\-\- 1 monty my 55296 Apr 17 19:04 station\&.MYI @@ -826,7 +827,7 @@ The number of bits used in the Huffman tree\&. .RE .PP After you run -\fBmyisampack\fR, you must run +\fBmyisampack\fR, use \fBmyisamchk\fR to re\-create any indexes\&. At this time, you can also sort the index blocks and create statistics needed for the MySQL optimizer to work more efficiently: .sp @@ -853,7 +854,7 @@ option to .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/mysql-stress-test.pl.1 b/mysql-wsrep-5.6/man/mysql-stress-test.pl.1 index 9fc64e78..029040dd 100644 --- a/mysql-wsrep-5.6/man/mysql-stress-test.pl.1 +++ b/mysql-wsrep-5.6/man/mysql-stress-test.pl.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql-stress-test.pl\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/15/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL .\" Language: English .\" -.TH "\FBMYSQL\-STRESS\-TE" "1" "01/15/2015" "MySQL" "MySQL Database System" +.TH "\FBMYSQL\-STRESS\-TE" "1" "03/02/2016" "MySQL" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -37,7 +37,7 @@ mysql-stress-test.pl \- server stress test program .PP The \fBmysql\-stress\-test\&.pl\fR -Perl script performs stress\-testing of the MySQL server\&. (MySQL 5\&.0 and up only) +Perl script performs stress\-testing of the MySQL server\&. .PP \fBmysql\-stress\-test\&.pl\fR requires a version of Perl that has been built with threads support\&. @@ -498,7 +498,7 @@ Verbose mode\&. Print more information about what the program does\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 2006, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 2006, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/mysql-test-run.pl.1 b/mysql-wsrep-5.6/man/mysql-test-run.pl.1 index a4d880d4..856c0a66 100644 --- a/mysql-wsrep-5.6/man/mysql-test-run.pl.1 +++ b/mysql-wsrep-5.6/man/mysql-test-run.pl.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql-test-run.pl\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/15/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL .\" Language: English .\" -.TH "\FBMYSQL\-TEST\-RUN\" "1" "01/15/2015" "MySQL" "MySQL Database System" +.TH "\FBMYSQL\-TEST\-RUN\" "1" "03/02/2016" "MySQL" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -167,6 +167,14 @@ testa with anything in between\&. In the latter case, the pattern match is not anchored to the beginning of the test name, so it also matches names such as xmainytesta\&. .PP +From MySQL 5\&.7 it is possible to put a list of test names in a file and have +\fBmysql\-test\-run\&.pl\fR +run those tests, using the option +\fB\-\-do\-test\-list=\fR\fB\fIfile\fR\fR\&. The tests should be listed one per line in the file, using the fully qualified name +\fIsuite\fR\&.\fItest\fR\&. A space may be used in place of the period\&. A line beginning with +# +indicates a comment and is ignored\&. +.PP To perform setup prior to running tests, \fBmysql\-test\-run\&.pl\fR needs to invoke @@ -175,9 +183,7 @@ with the \fB\-\-bootstrap\fR and \fB\-\-skip\-grant\-tables\fR -options\&. If MySQL was configured with the -\fB\-\-disable\-grant\-options\fR -option (only MySQL 5\&.1) or with the compiler flag +options\&. If MySQL was built with the compiler flag \fB\-DDISABLE_GRANT_OPTIONS\fR, then \fB\-\-bootstrap\fR, \fB\-\-skip\-grant\-tables\fR, and @@ -225,6 +231,44 @@ uses several environment variables\&. Some of them are listed in the following t \fBmysql\-test\-run\&.pl\fR, others are set by \fBmysql\-test\-run\&.pl\fR instead, and may be referred to in tests\&. +.\" MTR_MEM environment variable +.\" environment variable: MTR_MEM +.\" MTR_PARALLEL environment variable +.\" environment variable: MTR_PARALLEL +.\" MTR_BUILD_THREAD environment variable +.\" environment variable: MTR_BUILD_THREAD +.\" MTR_PORT_BASE environment variable +.\" environment variable: MTR_PORT_BASE +.\" MTR_TESTCASE_TIMEOUT environment variable +.\" environment variable: MTR_TESTCASE_TIMEOUT +.\" MTR_SUITE_TIMEOUT environment variable +.\" environment variable: MTR_SUITE_TIMEOUT +.\" MTR_START_TIMEOUT environment variable +.\" environment variable: MTR_START_TIMEOUT +.\" MTR_SHUTDOWN_TIMEOUT environment variable +.\" environment variable: MTR_SHUTDOWN_TIMEOUT +.\" MTR_CTEST_TIMEOUT environment variable +.\" environment variable: MTR_CTEST_TIMEOUT +.\" MYSQL_CONFIG_EDITOR environment variable +.\" environment variable: MYSQL_CONFIG_EDITOR +.\" MYSQL_TEST environment variable +.\" environment variable: MYSQL_TEST +.\" MYSQL_TEST_LOGIN_FILE environment variable +.\" environment variable: MYSQL_TEST_LOGIN_FILE +.\" MYSQLD_BOOTSTRAP environment variable +.\" environment variable: MYSQLD_BOOTSTRAP +.\" MYSQLD_BOOTSTRAP_CMD environment variable +.\" environment variable: MYSQLD_BOOTSTRAP_CMD +.\" MYSQLD environment variable +.\" environment variable: MYSQLD +.\" MYSQLD_CMD environment variable +.\" environment variable: MYSQLD_CMD +.\" MYSQLTEST_VARDIR environment variable +.\" environment variable: MYSQLTEST_VARDIR +.\" MYSQL_TEST_DIR environment variable +.\" environment variable: MYSQL_TEST_DIR +.\" MYSQL_TMP_DIR environment variable +.\" environment variable: MYSQL_TMP_DIR .TS allbox tab(:); lB lB. @@ -248,17 +292,8 @@ l l l l l l l l -l l l l. T{ -MTR_VERSION -T}:T{ -If set to 1, will run the older version 1 of - \fBmysql\-test\-run\&.pl\fR\&. This will affect - what functionailty is available and what command line - options are supported\&. -T} -T{ MTR_MEM T}:T{ If set to anything, will run tests with files in "memory" using tmpfs or @@ -289,9 +324,11 @@ Setting of a timeout in minutes or seconds, corresponding to command \fB\-\-\fR\fB\fIname\fR\fR\fB\-timeout\fR\&. Avaliable timeout names are TESTCASE, SUITE (both in minutes) and - START, SHUTDOWN - (both in seconds)\&. These variables are supported from - MySQL 5\&.1\&.44\&. + START, SHUTDOWN, + CTEST (all in seconds)\&. + MTR_CTEST_TIMEOUT is for + \fBctest\fR unit tests; it was added in + MySQL 5\&.8\&.0\&. T} T{ MYSQL_CONFIG_EDITOR @@ -357,7 +394,7 @@ T} .PP The variable MTR_PORT_BASE -was added in MySQL 5\&.1\&.45 as a more logical replacement for +is a more logical replacement for the original variable MTR_BUILD_THREAD\&. It gives the actual port number directly (will be rounded down to a multiple of 10)\&. If you use MTR_BUILD_THREAD, the port number is found by multiplying this by 10 and adding 10000\&. .PP @@ -378,14 +415,6 @@ will include any server options added with the option to \fBmysql\-test\-run\&.pl\fR, but will not include server options added specifically for the currently running test\&. .PP -If you are running -\fBmysql\-test\-run\&.pl\fR -version 1 by setting -MTR_VERSION, note that this only affects the test driver, not the test client (and its language) or the tests themselves\&. -.PP -A few tests might not run with version 1 because they depend on some feature of version 2\&. You may have those tests skipped by adding the test name to the file -lib/v1/incompatible\&.tests\&. This feature is available from MySQL 5\&.1\&.40\&. -.PP \fBmysql\-test\-run\&.pl\fR supports the options in the following list\&. An argument of \fB\-\-\fR @@ -510,9 +539,9 @@ auto) can also be set with the MTR_BUILD_THREAD environment variable\&. .sp -From MySQL 5\&.1\&.45, the more logical +This option is kept for backward compatibility\&. The more logical \fB\-\-port\-base\fR -is supported as an alternative\&. +is recommended instead\&. .RE .sp .RS 4 @@ -564,10 +593,6 @@ Clean up the var directory with logs and test results etc\&. after the test run, but only if there were no test failures\&. This option only has effect if also running with option \fB\-\-mem\fR\&. The intent is to alleviate the problem of using up memory for test results, in cases where many different test runs are being done on the same host\&. -.sp -The -\fB\-\-clean\-vardir\fR -option is available from MySQL 5\&.5\&. .RE .sp .RS 4 @@ -836,6 +861,25 @@ using the named debugger\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysql-test-run.pl: debug-common option +.\" debug-common option: mysql-test-run.pl +\fB\-\-debug\-common\fR +.sp +This option works similar to +\-\-debug +but turns on debug only for the debug macro keywords +query, info, error, enter, exit +which are considered the most commonly used\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysql-test-run.pl: debug-server option .\" debug-server option: mysql-test-run.pl \fB\-\-debug\-server\fR @@ -850,10 +894,6 @@ debug under the directory where it\*(Aqs normally located\&. This option does not turn on trace output and is independent of the \fBdebug\fR option\&. -.sp -The -\fBdebug\-server\fR -option was added in MySQL 5\&.1\&.56 and 5\&.5\&.10\&. .RE .sp .RS 4 @@ -866,13 +906,13 @@ option was added in MySQL 5\&.1\&.56 and 5\&.5\&.10\&. .\} .\" mysql-test-run.pl: debug-sync-timeout option .\" debug-sync-timeout option: mysql-test-run.pl -\fB\-\-debug\-sync\-timeout=\fR\fB\fIN\fR\fR +\fB\-\-debug\-sync\-timeout=\fR\fB\fIseconds\fR\fR .sp Controls whether the Debug Sync facility for testing and debugging is enabled\&. The option value is a timeout in seconds\&. The default value is 300\&. A value of 0 disables Debug Sync\&. The value of this option also becomes the default timeout for individual synchronization points\&. .sp \fBmysql\-test\-run\&.pl\fR passes -\fB\-\-loose\-debug\-sync\-timeout=\fR\fB\fIN\fR\fR +\fB\-\-loose\-debug\-sync\-timeout=\fR\fB\fIseconds\fR\fR to \fBmysqld\fR\&. The \fB\-\-loose\fR @@ -882,8 +922,6 @@ does not fail if Debug Sync is not compiled in\&. .sp For information about using the Debug Sync facility for testing, see Section\ \&4.14, \(lqThread Synchronization in Test Cases\(rq\&. -.sp -This option was added in MySQL 5\&.1\&.41\&. .RE .sp .RS 4 @@ -898,7 +936,7 @@ This option was added in MySQL 5\&.1\&.41\&. .\" default-myisam option: mysql-test-run.pl \fB\-\-default\-myisam\fR .sp -Use MyISAM as default engine for all except InnoDB\-specific tests\&. This option was added in MySQL 5\&.5 and is on by default\&. It may be changed to off by default in a later release\&. See also +Use MyISAM as default engine for all except InnoDB\-specific tests\&. This option is on by default in MySQL 5\&.5 and 5\&.6 but it off by default from MySQL 5\&.7\&. See also \fB\-\-nodefault\-myisam\fR\&. .RE .sp @@ -976,6 +1014,30 @@ xmainytestz\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysql-test-run.pl: do-test-list option +.\" do-test-list option: mysql-test-run.pl +\fB\-\-do\-testlist=\fR\fB\fIfile\fR\fR +.sp +Run all tests listed in the file +\fIfile\fR\&. In this file, tests should be listed one per line in the form +\fIsuite\fR\&.\fItest\fR +or alternatively, with a space instead of the period\&. A line beginning with +# +will be ignored and can be used for comments\&. +.sp +The +\fB\-\-do\-test\-list\fR +option is available from MySQL 5\&.7\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysql-test-run.pl: embedded-server option .\" embedded-server option: mysql-test-run.pl \fB\-\-embedded\-server\fR @@ -1018,12 +1080,12 @@ Specify a file that contains a list of test cases that should be displayed with [ exp\-fail ] code rather than [ fail ] -if they fail\&. This option was added in MySQL 5\&.1\&.33\&. +if they fail\&. .sp For an example of a file that might be specified using this option, see mysql\-test/collections/default\&.experimental\&. .sp -From MySQL 5\&.1\&.51, it\*(Aqs possible to supply more than one +It is also possible to supply more than one \fB\-\-experimental\fR, test cases listed in all the files will be treated as experimental\&. .RE .sp @@ -1035,6 +1097,23 @@ From MySQL 5\&.1\&.51, it\*(Aqs possible to supply more than one .sp -1 .IP \(bu 2.3 .\} +.\" mysql-test-run.pl: explain-protocol option +.\" explain-protocol option: mysql-test-run.pl +\fB\-\-explain\-protocol\fR, +.sp +Run +EXPLAIN EXTENDED +on all SELECT, INSERT, REPLACE, UPDATE and DELETE queries\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysql-test-run.pl: extern option .\" extern option: mysql-test-run.pl \fB\-\-extern\fR @@ -1111,10 +1190,6 @@ causes execution to continue regardless of test case failure\&. \fB\-\-force\-restart\fR .sp Always restart the server(s) between each tast case, whether it\*(Aqs needed or not\&. Will also restart between repeated runs of the same test case\&. This may be useful e\&.g\&. when looking for the source of a memory leak, as there will only have been one test run before the server exits\&. -.sp -The -\fB\-\-force\-restart\fR -option was added in MySQL version 5\&.1\&.52\&. .RE .sp .RS 4 @@ -1168,8 +1243,6 @@ debugger\&. Run tests with the \fBgprof\fR profiling tool\&. -\fB\-\-gprof\fR -was added in 5\&.1\&.45\&. .RE .sp .RS 4 @@ -1187,7 +1260,26 @@ was added in 5\&.1\&.45\&. .\" include-ndb option: mysql-test-run.pl \fB\-\-include\-ndb\fR .sp -Run also tests that need Cluster\&. This is the default behavior up to MySQL 5\&.1\&.51\&. From MySQL 5\&.1\&.52 this option has been added to re\-enable running Cluster tests\&. +Run also tests that need Cluster\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql-test-run.pl: json-explain-protocol option +.\" json-explain-protocol option: mysql-test-run.pl +\fB\-\-json\-explain\-protocol\fR, +.sp +Run +EXPLAIN FORMAT=JSON +on all SELECT, INSERT, REPLACE, UPDATE and DELETE queries\&. The +json\-explain\-protocol +option is available from MySQL 5\&.6\&. .RE .sp .RS 4 @@ -1286,8 +1378,6 @@ var/log/\fItestname\fR\&.progress\&. .sp The maximum number of simultaneous server connections that may be used per test\&. If not set, the maximum is 128\&. Minimum allowed limit is 8, maximum is 5120\&. Corresponds to the same option for \fBmysqltest\fR\&. -.sp -This option is available from MySQL 5\&.1\&.45\&. .RE .sp .RS 4 @@ -1414,10 +1504,24 @@ will normally also be propagated to \fBmysqld\fR, but there may be cases where you want a setting just for a single run, or you may not want the setting to affect other programs\&. You may use additional \fB\-\-mysqld\-env\fR options to set more than one variable\&. +.RE .sp -The -\fB\-\-mysqld\-env\fR -option is available from MySQL 5\&.5\&.10\&. +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +.\" mysql-test-run.pl: mysqltest option +.\" mysqltest option: mysql-test-run.pl +\fB\-\-mysqltest=\fR\fB\fIoptions\fR\fR +.sp +Extra options to pass to +\fBmysqltest\fR\&. +.sp +This option was added in MySQL 5\&.8\&.0\&. .RE .sp .RS 4 @@ -1468,7 +1572,9 @@ for a description\&. .\" nodefault-myisam option: mysql-test-run.pl \fB\-\-nodefault\-myisam\fR .sp -Do not override the build\-in default engine to use MyISAM instead for non\-InnoDB tests\&. This option was added in MySQL 5\&.5\&. Since the existing collection of tests were originally adapted for MyISAM as default, many tests will fail when this option is used, because the test behaves differently or produces different output when the engine switches to InnoDB\&. +For MySQL 5\&.5 or 5\&.6, do not override the build\-in default engine to use MyISAM instead for non\-InnoDB tests\&. Since the existing collection of tests were originally adapted for MyISAM as default, many tests will fail when this option is used, because the test behaves differently or produces different output when the engine switches to InnoDB\&. +.sp +From MySQL 5\&.7, the default engine for tests has been changed to InnoDB and this option will have no effect\&. .RE .sp .RS 4 @@ -1515,7 +1621,7 @@ not to generate a timing file\&. The effect of this is that the report from each .\" nounit-tests option: mysql-test-run.pl \fB\-\-nounit\-tests\fR .sp -Do not run unit tests, overriding default behaviour or setting of the +Do not run unit tests, overriding default behavior or setting of the MTR_UNIT_TESTS variable\&. .sp @@ -1554,7 +1660,7 @@ Run tests using parallel threads\&. By default, 1 thread is used\&. Use \fB\-\-parallel=auto\fR for auto\-setting of -\fIN\fR\&. The auto value was added in MySQL 5\&.1\&.36\&. +\fIN\fR\&. .RE .sp .RS 4 @@ -1762,7 +1868,7 @@ Allow a failed and retried test to fail more than the default 2 times before giv .\} .\" mysql-test-run.pl: shutdown-timeout option .\" shutdown-timeout option: mysql-test-run.pl -\fB\-\-shutdown\-timeout=\fR\fB\fISECONDS\fR\fR +\fB\-\-shutdown\-timeout=\fR\fB\fIseconds\fR\fR .sp Max number of seconds to wait for servers to do controlled shutdown before killing them\&. Default is 10\&. .RE @@ -1797,7 +1903,7 @@ Do not apply combinations; ignore combinations file or option\&. .\" skip-ndb option: mysql-test-run.pl \fB\-\-skip\-ndb\fR .sp -Do not start NDB Cluster; skip Cluster test cases\&. From MySQL 5\&.1\&.52, this is the default and so this option does not do anything but is kept for backward compatibility\&. +Do not start NDB Cluster; skip Cluster test cases\&. This option only has effect if you do have NDB, if not it will have no effect as it cannot run those tests anyway\&. .RE .sp .RS 4 @@ -2020,14 +2126,6 @@ This is similar to \fB\-\-start\fR, but \fBmysql\-test\-run\&.pl\fR terminates once the server has been started, leaving just the server process running\&. -.sp -Tha -\fB\-\-start\-and\-exit\fR -was available with version 1 of -\fBmysql\-test\-run\&.pl\fR -(unlike -\fB\-\-start\fR -which came with version 2), and is again supported in version 2 from MySQL 5\&.1\&.51\&. .RE .sp .RS 4 @@ -2167,7 +2265,7 @@ directory)\&. .\" suite-timeout option: mysql-test-run.pl \fB\-\-suite\-timeout=\fR\fB\fIminutes\fR\fR .sp -Specify the maximum test suite runtime\&. +Specify the maximum test suite runtime in minutes\&. .RE .sp .RS 4 @@ -2180,9 +2278,9 @@ Specify the maximum test suite runtime\&. .\} .\" mysql-test-run.pl: testcase-timeout option .\" testcase-timeout option: mysql-test-run.pl -\fB\-\-testcase\-timeout\fR +\fB\-\-testcase\-timeout=\fR\fB\fIminutes\fR\fR .sp -Specify the maximum test case runtime\&. +Specify the maximum test case runtime in minutes\&. .RE .sp .RS 4 @@ -2264,7 +2362,7 @@ will be set to the path for this directory, whether it has the default value or .\" unit-tests option: mysql-test-run.pl \fB\-\-unit\-tests\fR .sp -Force running of unit tests, overriding default behaviour or setting of the +Force running of unit tests, overriding default behavior or setting of the MTR_UNIT_TESTS variable\&. .sp @@ -2279,6 +2377,25 @@ Running of unit tests was enabled from MySQL 5\&.5\&.11\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysql-test-run.pl: unit-tests-report option +.\" unit-tests-report option: mysql-test-run.pl +\fB\-\-unit\-tests\-report\fR +.sp +Extend the unit test run by also outputting the log from the test run, independently of whether it succeeded or not\&. This option implies +\fB\-\-unit\-tests\fR +so it is not necessary to specify both\&. The +\fB\-\-unit\-tests\-report\fR +option is available in MySQL 5\&.5 from version 5\&.5\&.44, in 5\&.6 from version 5\&.6\&.25 as well as in MySQL 5\&.7\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysql-test-run.pl: user option .\" user option: mysql-test-run.pl \fB\-\-user=\fR\fB\fIuser_name\fR\fR @@ -2307,10 +2424,6 @@ arguemnts, if any\&. Only works in combination with \fB\-\-start\-and\-exit\fR or \fB\-\-start\-dirty\fR, and only if no test name is given\&. -.sp -The -\fB\-\-user\-args\fR -option was added in MySQL 5\&.1\&.51\&. .RE .sp .RS 4 @@ -2336,7 +2449,7 @@ options require that the executables have been build with \fBvalgrind\fR support\&. .sp -When the server is run with valgrind, an extra pass over the server log file(s) will be performed after all tests are run, and any report with problems that have been reported at server shutdown will be extracted and printed\&. The most common warnings are memory leaks\&. With each report will also be listed all tests that were run since previous server restart; one of these is likely to have caused the problem\&. This reporting was added in MySQL 5\&.1\&.45\&. +When the server is run with valgrind, an extra pass over the server log file(s) will be performed after all tests are run, and any report with problems that have been reported at server shutdown will be extracted and printed\&. The most common warnings are memory leaks\&. With each report will also be listed all tests that were run since previous server restart; one of these is likely to have caused the problem\&. .sp From MySQL 5\&.5\&.13, a final "pseudo" test named valgrind_report @@ -2351,6 +2464,29 @@ is added to the list of tests when the server is run in valgrind\&. This test is .sp -1 .IP \(bu 2.3 .\} +.\" mysql-test-run.pl: valgrind-clients option +.\" valgrind-clients option: mysql-test-run.pl +\fB\-\-valgrind\-clients\fR +.sp +Run all clients started by +\&.test +files with +\fBvalgrind\fR\&. This option requires +\fBvalgrind\fR +3\&.9 or later\&. +.sp +\fB\-\-valgrind\-clients\fR +was added in MySQL 5\&.7\&.9\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysql-test-run.pl: valgrind-mysqld option .\" valgrind-mysqld option: mysql-test-run.pl \fB\-\-valgrind\-mysqld\fR @@ -2512,8 +2648,6 @@ If or \fB\-\-start\-dirty\fR is used, wait for all servers to exit before termination\&. Otherise, it will terminate if one (of several) servers is restarted\&. -.sp -This option was added in MySQL 5\&.1\&.36\&. .RE .sp .RS 4 @@ -2548,10 +2682,26 @@ Run only test cases that have ndb in their name\&. .RE +.if n \{\ +.sp +.\} +.RS 4 +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBNote\fR +.ps -1 +.br +.PP +The hostname resolves to 127\&.0\&.0\&.1 and not to the actual IP address\&. +.sp .5v +.RE .SH "COPYRIGHT" .br .PP -Copyright \(co 2006, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 2006, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/mysql.1 b/mysql-wsrep-5.6/man/mysql.1 index 4cef6582..9c253951 100644 --- a/mysql-wsrep-5.6/man/mysql.1 +++ b/mysql-wsrep-5.6/man/mysql.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -294,7 +294,7 @@ This option is supported beginning with MySQL 5\&.6\&.1\&. .\} .\" mysql: character-sets-dir option .\" character-sets-dir option: mysql -\fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR +\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR .sp The directory where character sets are installed\&. See Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&. @@ -325,8 +325,7 @@ Write column names in results\&. .\} .\" mysql: column-type-info option .\" column-type-info option: mysql -\fB\-\-column\-type\-info\fR, -\fB\-m\fR +\fB\-\-column\-type\-info\fR .sp Display result set metadata\&. .RE @@ -375,7 +374,7 @@ Compress all information sent between the client and the server if both support .\" connect-expired-password option: mysql \fB\-\-connect\-expired\-password\fR .sp -Indicate to the server that the client is can handle sandbox mode if the account used to connect has an expired password\&. This can be useful for noninteractive invocations of +Indicate to the server that the client can handle sandbox mode if the account used to connect has an expired password\&. This can be useful for noninteractive invocations of \fBmysql\fR because normally the server disconnects noninteractive clients that attempt to connect using an account with an expired password\&. (See Section\ \&6.3.6, \(lqPassword Expiration and Sandbox Mode\(rq\&.) This option was added in MySQL 5\&.6\&.12\&. @@ -415,6 +414,11 @@ Write a debugging log\&. A typical string is d:t:o,\fIfile_name\fR\&. The default is d:t:o,/tmp/mysql\&.trace\&. +.sp +This option is available only if MySQL was built using +\fBWITH_DEBUG\fR\&. MySQL release binaries provided by Oracle are +\fInot\fR +built using this option\&. .RE .sp .RS 4 @@ -460,7 +464,7 @@ Print debugging information and memory and CPU usage statistics when the program .\" default-auth option: mysql \fB\-\-default\-auth=\fR\fB\fIplugin\fR\fR .sp -The client\-side authentication plugin to use\&. See +A hint about the client\-side authentication plugin to use\&. See Section\ \&6.3.7, \(lqPluggable Authentication\(rq\&. .RE .sp @@ -608,7 +612,7 @@ the section called \(lqMYSQL COMMANDS\(rq\&. Enable the mysql_clear_password cleartext authentication plugin\&. (See -Section\ \&6.3.8.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) This option was added in MySQL 5\&.6\&.7\&. +Section\ \&6.4.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) This option was added in MySQL 5\&.6\&.7\&. .RE .sp .RS 4 @@ -785,12 +789,9 @@ has no effect if the server does not also support it\&. .sp Read options from the named login path in the \&.mylogin\&.cnf -login file\&. A +login path file\&. A \(lqlogin path\(rq -is an option group that permits only a limited set of options: -\fBhost\fR, -\fBuser\fR, and -\fBpassword\fR\&. Think of a login path as a set of values that indicate the server host and the credentials for authenticating with the server\&. To create the login path file, use the +is an option group containing options that specify which MySQL server to connect to and which account to authenticate as\&. To create or modify a login path file, use the \fBmysql_config_editor\fR utility\&. See \fBmysql_config_editor\fR(1)\&. This option was added in MySQL 5\&.6\&.6\&. @@ -1063,9 +1064,9 @@ On Windows, connect to the server using a named pipe\&. This option applies only .\} .\" mysql: plugin-dir option .\" plugin-dir option: mysql -\fB\-\-plugin\-dir=\fR\fB\fIpath\fR\fR +\fB\-\-plugin\-dir=\fR\fB\fIdir_name\fR\fR .sp -The directory in which to look for plugins\&. It may be necessary to specify this option if the +The directory in which to look for plugins\&. Specify this option if the \fB\-\-default\-auth\fR option is used to specify an authentication plugin but \fBmysql\fR @@ -1281,7 +1282,7 @@ to disable it\&. .ps -1 .br Passwords that use the pre\-4\&.1 hashing method are less secure than passwords that use the native password hashing method and should be avoided\&. Pre\-4\&.1 passwords are deprecated and support for them will be removed in a future MySQL release\&. For account upgrade instructions, see -Section\ \&6.3.8.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&. +Section\ \&6.4.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&. .sp .5v .RE .RE @@ -1307,7 +1308,7 @@ The server sends the public key to the client as needed, so it is not necessary For additional discussion regarding use of the sha256_password plugin, including how to get the RSA public key, see -Section\ \&6.3.8.4, \(lqThe SHA-256 Authentication Plugin\(rq\&. +Section\ \&6.4.1.4, \(lqThe SHA-256 Authentication Plugin\(rq\&. .sp This option is available only if MySQL was built using OpenSSL\&. It was added in MySQL 5\&.6\&.6 under the name \fB\-\-server\-public\-key\fR @@ -1452,7 +1453,7 @@ localhost, the Unix socket file to use, or, on Windows, the name of the named pi Options that begin with \fB\-\-ssl\fR specify whether to connect to the server using SSL and indicate where to find SSL keys and certificates\&. See -Section\ \&6.3.10.4, \(lqSSL Command Options\(rq\&. +Section\ \&6.3.9.5, \(lqCommand Options for Secure Connections\(rq\&. .RE .sp .RS 4 @@ -1803,7 +1804,7 @@ command)\&. .PP Each command has both a long and short form\&. The long form is not case sensitive; the short form is\&. The long form can be followed by an optional semicolon terminator, but the short form should not\&. .PP -The use of short\-form commands within multi\-line +The use of short\-form commands within multiple\-line /* \&.\&.\&. */ comments is not supported\&. .sp @@ -2867,7 +2868,7 @@ Consequently, an input statement that spans multiple lines can be logged twice\& mysql> \fBSELECT\fR \-> \fB\*(AqToday is\*(Aq\fR \-> \fB,\fR - \-> \fBCONCAT()\fR + \-> \fBCURDATE()\fR \-> \fB;\fR .fi .if n \{\ @@ -2880,7 +2881,7 @@ logs the \(lqSELECT\(rq, \(lq\*(AqToday is\*(Aq\(rq, \(lq,\(rq, -\(lqCONCAT()\(rq, and +\(lqCURDATE()\(rq, and \(lq;\(rq lines as it reads them\&. It also logs the complete statement, after mapping SELECT\en\*(AqToday is\*(Aq\en,\enCURDATE() @@ -3266,7 +3267,7 @@ left\-arrow and right\-arrow keys move horizontally within the current input line, and the -up\-arror +up\-arrow and down\-arrow keys move up and down through the set of previously entered lines\&. @@ -3599,7 +3600,7 @@ Section\ \&23.8.16, \(lqControlling Automatic Reconnection Behavior\(rq\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/mysql.server.1 b/mysql-wsrep-5.6/man/mysql.server.1 index 8fe9b922..a31ebd9d 100644 --- a/mysql-wsrep-5.6/man/mysql.server.1 +++ b/mysql-wsrep-5.6/man/mysql.server.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql.server\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL\&.SERVER\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL\&.SERVER\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -36,28 +36,172 @@ mysql.server \- MySQL server startup script .SH "DESCRIPTION" .PP MySQL distributions on Unix include a script named -\fBmysql\&.server\fR\&. It can be used on systems such as Linux and Solaris that use System V\-style run directories to start and stop system services\&. It is also used by the OS X Startup Item for MySQL\&. +\fBmysql\&.server\fR, which starts the server using +\fBmysqld_safe\fR\&. It can be used on systems such as Linux and Solaris that use System V\-style run directories to start and stop system services\&. It is also used by the OS X Startup Item for MySQL\&. .PP +To start or stop the server manually using the \fBmysql\&.server\fR -can be found in the -support\-files -directory under your MySQL installation directory or in a MySQL source distribution\&. +script, invoke it with +start +or +stop +arguments: +.sp +.if n \{\ +.RS 4 +.\} +.nf +shell> \fBmysql\&.server start\fR +shell> \fBmysql\&.server stop\fR +.fi +.if n \{\ +.RE +.\} +.PP +Before +\fBmysql\&.server\fR +starts the server, it changes location to the MySQL installation directory, and then invokes +\fBmysqld_safe\fR\&. To run the server as some specific user, add an appropriate +user +option to the +[mysqld] +group of the +/etc/my\&.cnf +option file, as shown later in this section\&. (It is possible that you must edit +\fBmysql\&.server\fR +if you\*(Aqve installed a binary distribution of MySQL in a nonstandard location\&. Modify it to change location into the proper directory before it runs +\fBmysqld_safe\fR\&. If you do this, your modified version of +\fBmysql\&.server\fR +may be overwritten if you upgrade MySQL in the future, so you should make a copy of your edited version that you can reinstall\&.) +.PP +\fBmysql\&.server stop\fR +stops the server by sending a signal to it\&. You can also stop the server manually by executing +\fBmysqladmin shutdown\fR\&. +.PP +To start and stop MySQL automatically on your server, you must add start and stop commands to the appropriate places in your +/etc/rc* +files\&. .PP -If you use the Linux server RPM package (MySQL\-server\-\fIVERSION\fR\&.rpm), the +If you use the Linux server RPM package (MySQL\-server\-\fIVERSION\fR\&.rpm), or a native Linux package installation, the \fBmysql\&.server\fR -script will be installed in the +script may be installed in the /etc/init\&.d directory with the name -mysql\&. You need not install it manually\&. See -Section\ \&2.5.5, \(lqInstalling MySQL on Linux Using RPM Packages\(rq, for more information on the Linux RPM packages\&. +mysql\&. See +Section\ \&2.5.5, \(lqInstalling MySQL on Linux Using RPM Packages from Oracle\(rq, for more information on the Linux RPM packages\&. .PP Some vendors provide RPM packages that install a startup script under a different name such as \fBmysqld\fR\&. .PP If you install MySQL from a source distribution or using a binary distribution format that does not install \fBmysql\&.server\fR -automatically, you can install it manually\&. Instructions are provided in -Section\ \&2.10.1.2, \(lqStarting and Stopping MySQL Automatically\(rq\&. +automatically, you can install it manually\&. The script can be found in the +support\-files +directory under the MySQL installation directory or in a MySQL source tree\&. Copy it to the +/etc/init\&.d +directory with the name +\fBmysql\fR, and then make it executable: +.sp +.if n \{\ +.RS 4 +.\} +.nf +shell> \fBcp mysql\&.server /etc/init\&.d/mysql\fR +shell> \fBchmod +x /etc/init\&.d/mysql\fR +.fi +.if n \{\ +.RE +.\} +.sp +.if n \{\ +.sp +.\} +.RS 4 +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBNote\fR +.ps -1 +.br +.PP +Older Red Hat systems use the +/etc/rc\&.d/init\&.d +directory rather than +/etc/init\&.d\&. Adjust the preceding commands accordingly\&. Alternatively, first create +/etc/init\&.d +as a symbolic link that points to +/etc/rc\&.d/init\&.d: +.sp .5v +.RE +.sp +.if n \{\ +.RS 4 +.\} +.nf +shell> \fBcd /etc\fR +shell> \fBln \-s rc\&.d/init\&.d \&.\fR +.fi +.if n \{\ +.RE +.\} +.PP +After installing the script, the commands needed to activate it to run at system startup depend on your operating system\&. On Linux, you can use +\fBchkconfig\fR: +.sp +.if n \{\ +.RS 4 +.\} +.nf +shell> \fBchkconfig \-\-add mysql\fR +.fi +.if n \{\ +.RE +.\} +.PP +On some Linux systems, the following command also seems to be necessary to fully enable the +\fBmysql\fR +script: +.sp +.if n \{\ +.RS 4 +.\} +.nf +shell> \fBchkconfig \-\-level 345 mysql on\fR +.fi +.if n \{\ +.RE +.\} +.PP +On FreeBSD, startup scripts generally should go in +/usr/local/etc/rc\&.d/\&. The +rc(8) +manual page states that scripts in this directory are executed only if their base name matches the +*\&.sh +shell file name pattern\&. Any other files or directories present within the directory are silently ignored\&. In other words, on FreeBSD, you should install the +mysql\&.server +script as +/usr/local/etc/rc\&.d/mysql\&.server\&.sh +to enable automatic startup\&. +.PP +As an alternative to the preceding setup, some operating systems also use +/etc/rc\&.local +or +/etc/init\&.d/boot\&.local +to start additional services on startup\&. To start up MySQL using this method, append a command like the one following to the appropriate startup file: +.sp +.if n \{\ +.RS 4 +.\} +.nf +/bin/sh \-c \*(Aqcd /usr/local/mysql; \&./bin/mysqld_safe \-\-user=mysql &\*(Aq +.fi +.if n \{\ +.RE +.\} +.PP +For other systems, consult your operating system documentation to see how to install startup scripts\&. .PP \fBmysql\&.server\fR reads options from the @@ -66,12 +210,45 @@ and [mysqld] sections of option files\&. For backward compatibility, it also reads [mysql_server] -sections, although you should rename such sections to +sections, but to be current you should rename such sections to +[mysql\&.server]\&. +.\" changing: socket location +.PP +You can add options for +\fBmysql\&.server\fR +in a global +/etc/my\&.cnf +file\&. A typical +/etc/my\&.cnf +file might look like this: +.sp +.if n \{\ +.RS 4 +.\} +.nf +[mysqld] +datadir=/usr/local/mysql/var +socket=/var/tmp/mysql\&.sock +port=3306 +user=mysql [mysql\&.server] -when using MySQL 5\&.6\&. +basedir=/usr/local/mysql +.fi +.if n \{\ +.RE +.\} .PP +The +\fBmysql\&.server\fR +script supports the following options\&. If specified, they +\fImust\fR +be placed in an option file, not on the command line\&. \fBmysql\&.server\fR -supports the following options\&. +supports only +start +and +stop +as command\-line arguments\&. .sp .RS 4 .ie n \{\ @@ -83,7 +260,7 @@ supports the following options\&. .\} .\" mysql.server: basedir option .\" basedir option: mysql.server -\fB\-\-basedir=\fR\fB\fIpath\fR\fR +\fB\-\-basedir=\fR\fB\fIdir_name\fR\fR .sp The path to the MySQL installation directory\&. .RE @@ -98,7 +275,7 @@ The path to the MySQL installation directory\&. .\} .\" mysql.server: datadir option .\" datadir option: mysql.server -\fB\-\-datadir=\fR\fB\fIpath\fR\fR +\fB\-\-datadir=\fR\fB\fIdir_name\fR\fR .sp The path to the MySQL data directory\&. .RE @@ -116,6 +293,31 @@ The path to the MySQL data directory\&. \fB\-\-pid\-file=\fR\fB\fIfile_name\fR\fR .sp The path name of the file in which the server should write its process ID\&. +.sp +If this option is not given, +\fBmysql\&.server\fR +uses a default value of +\fIhost_name\fR\&.pid\&. The PID file value passed to +\fBmysqld_safe\fR +overrides any value specified in the +[mysqld_safe] +option file group\&. Because +\fBmysql\&.server\fR +reads the +[mysqld] +option file group but not the +[mysqld_safe] +group, you can ensure that +\fBmysqld_safe\fR +gets the same value when invoke using +\fBmysql\&.server\fR +as when invoked manually by putting the same +pid\-file +setting in both the +[mysqld_safe] +and +[mysqld] +groups\&. .RE .sp .RS 4 @@ -134,43 +336,10 @@ How long in seconds to wait for confirmation of server startup\&. If the server \fBmysql\&.server\fR exits with an error\&. The default value is 900\&. A value of 0 means not to wait at all for startup\&. Negative values mean to wait forever (no timeout)\&. .RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" mysql.server: use-mysqld_safe option -.\" use-mysqld_safe option: mysql.server -\fB\-\-use\-mysqld_safe\fR -.sp -Use -\fBmysqld_safe\fR -to start the server\&. This is the default\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" mysql.server: user option -.\" user option: mysql.server -\fB\-\-user=\fR\fB\fIuser_name\fR\fR -.sp -The login user name to use for running -\fBmysqld\fR\&. -.RE .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/mysql_client_test.1 b/mysql-wsrep-5.6/man/mysql_client_test.1 index 5b590540..1c6a0288 100644 --- a/mysql-wsrep-5.6/man/mysql_client_test.1 +++ b/mysql-wsrep-5.6/man/mysql_client_test.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_client_test\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/15/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL .\" Language: English .\" -.TH "\FBMYSQL_CLIENT_TEST" "1" "01/15/2015" "MySQL" "MySQL Database System" +.TH "\FBMYSQL_CLIENT_TEST" "1" "03/02/2016" "MySQL" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -335,7 +335,7 @@ mysql\-test/var\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 2006, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 2006, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/mysql_config.1 b/mysql-wsrep-5.6/man/mysql_config.1 index 1d33b086..b9978958 100644 --- a/mysql-wsrep-5.6/man/mysql_config.1 +++ b/mysql-wsrep-5.6/man/mysql_config.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_config\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_CONFIG\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_CONFIG\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -195,6 +195,29 @@ The default Unix socket file, defined when configuring MySQL\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysql_config: variable option +.\" variable option: mysql_config +\fB\-\-variable=\fR\fB\fIvar_name\fR\fR +.sp +Display the value of the named configuration variable\&. Permitted +\fIvar_name\fR +values are +pkgincludedir +(the header file directory), +pkglibdir +(the library directory), and +plugindir +(the plugin directory)\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysql_config: version option .\" version option: mysql_config \fB\-\-version\fR @@ -214,16 +237,22 @@ shell> \fBmysql_config\fR Usage: /usr/local/mysql/bin/mysql_config [options] Options: \-\-cflags [\-I/usr/local/mysql/include/mysql \-mcpu=pentiumpro] + \-\-cxxflags [\-I/usr/local/mysql/include/mysql \-mcpu=pentiumpro] \-\-include [\-I/usr/local/mysql/include/mysql] \-\-libs [\-L/usr/local/mysql/lib/mysql \-lmysqlclient \-lpthread \-lm \-lrt \-lssl \-lcrypto \-ldl] \-\-libs_r [\-L/usr/local/mysql/lib/mysql \-lmysqlclient_r \-lpthread \-lm \-lrt \-lssl \-lcrypto \-ldl] + \-\-plugindir [/usr/local/mysql/lib/plugin] \-\-socket [/tmp/mysql\&.sock] \-\-port [3306] \-\-version [5\&.6\&.11] \-\-libmysqld\-libs [\-L/usr/local/mysql/lib/mysql \-lmysqld \-lpthread \-lm \-lrt \-lssl \-lcrypto \-ldl \-lcrypt] + \-\-variable=VAR VAR is one of: + pkgincludedir [/usr/local/mysql/include] + pkglibdir [/usr/local/mysql/lib] + plugindir [/usr/local/mysql/lib/plugin] .fi .if n \{\ .RE @@ -231,7 +260,7 @@ Options: .PP You can use \fBmysql_config\fR -within a command line using backticks to include the output that it produces for a particular option\&. For example, to compile and link a MySQL client program, use +within a command line using backticks to include the output that it produces for particular options\&. For example, to compile and link a MySQL client program, use \fBmysql_config\fR as follows: .sp @@ -239,8 +268,8 @@ as follows: .RS 4 .\} .nf -shell> \fBgcc \-c `mysql_config \-\-cflags` progname\&.c\fR -shell> \fBgcc \-o progname progname\&.o `mysql_config \-\-libs`\fR +gcc \-c `mysql_config \-\-cflags` progname\&.c +gcc \-o progname progname\&.o `mysql_config \-\-libs` .fi .if n \{\ .RE @@ -248,7 +277,7 @@ shell> \fBgcc \-o progname progname\&.o `mysql_config \-\-libs`\fR .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/mysql_config_editor.1 b/mysql-wsrep-5.6/man/mysql_config_editor.1 index 2c45bc34..b3131eda 100644 --- a/mysql-wsrep-5.6/man/mysql_config_editor.1 +++ b/mysql-wsrep-5.6/man/mysql_config_editor.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_config_editor\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_CONFIG_EDIT" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_CONFIG_EDIT" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -38,108 +38,245 @@ mysql_config_editor \- configure authentication information for connecting to My .PP The \fBmysql_config_editor\fR -utility (available as of MySQL 5\&.6\&.6) enables you to store authentication credentials in an encrypted login file named +utility (available as of MySQL 5\&.6\&.6) enables you to store authentication credentials in an encrypted login path file named \&.mylogin\&.cnf\&. The file location is the %APPDATA%\eMySQL directory on Windows and the current user\*(Aqs home directory on non\-Windows systems\&. The file can be read later by MySQL client programs to obtain authentication credentials for connecting to MySQL Server\&. .PP -To specify an alternate file name, set the +The unencrypted format of the +\&.mylogin\&.cnf +login path file consists of option groups, similar to other option files\&. Each option group in +\&.mylogin\&.cnf +is called a +\(lqlogin path,\(rq +which is a group that permits only certain options: +\fBhost\fR, +\fBuser\fR, +\fBpassword\fR, +\fBport\fR +and +\fBsocket\fR\&. Think of a login path option group as a set of options that specify which MySQL server to connect to and which account to authenticate as\&. Here is an unencrypted example: +.sp +.if n \{\ +.RS 4 +.\} +.nf +[client] +user = mydefaultname +password = mydefaultpass +host = 127\&.0\&.0\&.1 +[mypath] +user = myothername +password = myotherpass +host = localhost +.fi +.if n \{\ +.RE +.\} +.PP +When you invoke a client program to connect to the server, the client uses +\&.mylogin\&.cnf +in conjunction with other option files\&. Its precedence is higher than other option files, but less than options specified explicitly on the client command line\&. For information about the order in which option files are used, see +Section\ \&4.2.6, \(lqUsing Option Files\(rq\&. +.\" MYSQL_TEST_LOGIN_FILE environment variable +.\" environment variable: MYSQL_TEST_LOGIN_FILE +.PP +To specify an alternate login path file name, set the MYSQL_TEST_LOGIN_FILE -environment variable\&. This variable is used by the +environment variable\&. This variable is recognized by +\fBmysql_config_editor\fR, by standard MySQL clients (\fBmysql\fR, +\fBmysqladmin\fR, and so forth), and by the \fBmysql\-test\-run\&.pl\fR -testing utility, but also is recognized by -mysql_config_editor -and by MySQL clients such as -\fBmysql\fR, -\fBmysqladmin\fR, and so forth\&. +testing utility\&. +.PP +Programs use groups in the login path file as follows: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fBmysql_config_editor\fR +operates on the +client +login path by default if you specify no +\fB\-\-login\-path=\fR\fB\fIname\fR\fR +option to indicate explicitly which login path to use\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Without a +\fB\-\-login\-path\fR +option, client programs read the same option groups from the login path file that they read from other option files\&. Consider this command: +.sp +.if n \{\ +.RS 4 +.\} +.nf +shell> \fBmysql\fR +.fi +.if n \{\ +.RE +.\} +.sp +By default, the +\fBmysql\fR +client reads the +[client] +and +[mysql] +groups from other option files, so it reads them from the login path file as well\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +With a +\fB\-\-login\-path\fR +option, client programs additionally read the named login path from the login path ile\&. The option groups read from other option files remain the same\&. Consider this command: +.sp +.if n \{\ +.RS 4 +.\} +.nf +shell> \fBmysql \-\-login\-path=mypath\fR +.fi +.if n \{\ +.RE +.\} +.sp +The +\fBmysql\fR +client reads +[client] +and +[mysql] +from other option files, and +[client], +[mysql], and +[mypath] +from the login path file\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Client programs read the login path file even when the +\fB\-\-no\-defaults\fR +option is used\&. This permits passwords to be specified in a safer way than on the command line even if +\fB\-\-no\-defaults\fR +is present\&. +.RE .PP \fBmysql_config_editor\fR encrypts the \&.mylogin\&.cnf -file so it cannot be read as clear text, and its contents when decrypted by client programs are used only in memory\&. In this way, passwords can be stored in a file in non\-cleartext format and used later without ever needing to be exposed on the command line or in an environment variable\&. +file so it cannot be read as cleartext, and its contents when decrypted by client programs are used only in memory\&. In this way, passwords can be stored in a file in non\-cleartext format and used later without ever needing to be exposed on the command line or in an environment variable\&. \fBmysql_config_editor\fR provides a print -command that enables the user to display the file contents, but even in this case, password values are masked so as never to appear in a way that other users can see them\&. +command for displaying the login path file contents, but even in this case, password values are masked so as never to appear in a way that other users can see them\&. .PP The encryption used by \fBmysql_config_editor\fR prevents passwords from appearing in \&.mylogin\&.cnf -as clear text and provides a measure of security by preventing inadvertent password exposure\&. For example, if you display a regular unencrypted +as cleartext and provides a measure of security by preventing inadvertent password exposure\&. For example, if you display a regular unencrypted my\&.cnf option file on the screen, any passwords it contains are visible for anyone to see\&. With \&.mylogin\&.cnf, that is not true\&. But the encryption used will not deter a determined attacker and you should not consider it unbreakable\&. A user who can gain system administration privileges on your machine to access your files could decrypt the \&.mylogin\&.cnf file with some effort\&. .PP -The login file must be readable and writable to the current user, and inaccessible to other users\&. Otherwise, +The login path file must be readable and writable to the current user, and inaccessible to other users\&. Otherwise, \fBmysql_config_editor\fR -ignores it, and the file is not used by client programs, either\&. On Windows, this constraint does not apply; instead, the user must have access to the -%APPDATA%\eMySQL -directory\&. +ignores it, and client programs do not use it, either\&. .PP -The unencrypted format of the -\&.mylogin\&.cnf -login file consists of option groups, similar to other option files\&. Each option group in -\&.mylogin\&.cnf -is called a -\(lqlogin path,\(rq -which is a group that permits only a limited set of options: -\fBhost\fR, -\fBuser\fR, and -\fBpassword\fR\&. Think of a login path as a set of values that indicate the server host and the credentials for authenticating with the server\&. Here is an example: +Invoke +\fBmysql_config_editor\fR +like this: .sp .if n \{\ .RS 4 .\} .nf -[myloginpath] -user = myname -password = mypass -host = 127\&.0\&.0\&.1 +shell> \fBmysql_config_editor [\fR\fB\fIprogram_options\fR\fR\fB] \fR\fB\fIcommand\fR\fR\fB [\fR\fB\fIcommand_options\fR\fR\fB]\fR .fi .if n \{\ .RE .\} .PP -When you invoke a client program to connect to the server, -\&.mylogin\&.cnf -is used in conjunction with other option files\&. Its precedence is higher than other option files, but less than options specified explicitly on the client command line\&. For information about the order in which option files are used, see -Section\ \&4.2.6, \(lqUsing Option Files\(rq\&. +If the login path file does not exist, +\fBmysql_config_editor\fR +creates it\&. .PP -Invoke -mysql_config_editor -like this: +Command arguments are given as follows: .sp -.if n \{\ .RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c .\} -.nf -shell> \fBmysql_config_editor [\fR\fB\fIprogram_options\fR\fR\fB] \fR\fB\fIcommand\fR\fR\fB [\fR\fB\fIcommand_options\fR\fR\fB]\fR -.fi -.if n \{\ -.RE +.el \{\ +.sp -1 +.IP \(bu 2.3 .\} -.PP \fIprogram_options\fR consists of general \fBmysql_config_editor\fR options\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} command -indicates what command to perform, and -\fIcommand_options\fR -indicates any additional options needed by the command\&. -.PP -The command indicates what action to perform on the +indicates what action to perform on the \&.mylogin\&.cnf -login file\&. For example, +login path file\&. For example, set writes a login path to the file, remove removes a login path, and print -displays login path contents\&. Any options given provide information to the command, such as the login path name and the values to use in the login path\&. +displays login path contents\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fIcommand_options\fR +indicates any additional options specific to the command, such as the login path name and the values to use in the login path\&. +.RE .PP The position of the command name within the set of program arguments is significant\&. For example, these command lines have the same arguments, but produce different results: .sp @@ -147,43 +284,67 @@ The position of the command name within the set of program arguments is signific .RS 4 .\} .nf -mysql_config_editor \-\-help set -mysql_config_editor set \-\-help +shell> \fBmysql_config_editor \-\-help set\fR +shell> \fBmysql_config_editor set \-\-help\fR .fi .if n \{\ .RE .\} .PP -The first command line displays general +The first command line displays a general \fBmysql_config_editor\fR -help, and ignores the +help message, and ignores the set -command\&. The second command line displays help for the +command\&. The second command line displays a help message specific to the set command\&. .PP -Suppose that you want to establish two login paths named -local -and +Suppose that you want to establish a +client +login path that defines your default connection parameters, and an additional login path named remote -for connecting to the local MySQL server and a server on the host -remote\&.example\&.com\&. You want to authenticate to the local server with a user name and password of +for connecting to the MySQL server the host +remote\&.example\&.com\&. You want to log in as follows: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +By default, to the local server with a user name and password of localuser and -localpass, and to the remote server with a user name and password of +localpass +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +To the remote server with a user name and password of remoteuser and -remotepass\&. To set up the login paths in the +remotepass +.RE +.PP +To set up the login paths in the \&.mylogin\&.cnf file, use the following set -commands\&. Enter each command on a single line, then enter the appropriate password when prompted\&. +commands\&. Enter each command on a single line, and enter the appropriate passwords when prompted: .sp .if n \{\ .RS 4 .\} .nf -shell> \fBmysql_config_editor set \-\-login\-path=local +shell> \fBmysql_config_editor set \-\-login\-path=client \-\-host=localhost \-\-user=localuser \-\-password\fR Enter password: \fIenter password "localpass" here\fR shell> \fBmysql_config_editor set \-\-login\-path=remote @@ -194,9 +355,16 @@ Enter password: \fIenter password "remotepass" here\fR .RE .\} .PP +\fBmysql_config_editor\fR +uses the +client +login path by default, so the +\fB\-\-login\-path=client\fR +option can be omitted from the first command without changing its effect\&. +.PP To see what \fBmysql_config_editor\fR -wrote to the +writes to the \&.mylogin\&.cnf file, use the print @@ -207,7 +375,7 @@ command: .\} .nf shell> \fBmysql_config_editor print \-\-all\fR -[local] +[client] user = localuser password = ***** host = localhost @@ -222,50 +390,93 @@ host = remote\&.example\&.com .PP The print -command displays each login path as a set of lines beginning with a group header indicating the login path name in square brackets, followed by the option values for the login path\&. Password values are masked and do not appear as clear text\&. +command displays each login path as a set of lines beginning with a group header indicating the login path name in square brackets, followed by the option values for the login path\&. Password values are masked and do not appear as cleartext\&. .PP -As shown by the preceding examples, the -\&.mylogin\&.cnf -file can contain multiple login paths\&. In this way, +If you do not specify +\fB\-\-all\fR +to display all login paths or +\fB\-\-login\-path=\fR\fB\fIname\fR\fR +to display a named login path, the +print +command displays the +client +login path by default, if there is one\&. +.PP +As shown by the preceding example, the login path file can contain multiple login paths\&. In this way, \fBmysql_config_editor\fR makes it easy to set up multiple \(lqpersonalities\(rq -for connecting to different MySQL servers\&. Any of these can be selected by name later using the +for connecting to different MySQL servers, or for connecting to a given server using different accounts\&. Any of these can be selected by name later using the \fB\-\-login\-path\fR -option when you invoke a client program\&. For example, to connect to the local server, use this command: +option when you invoke a client program\&. For example, to connect to the remote server, use this command: .sp .if n \{\ .RS 4 .\} .nf -shell> \fBmysql \-\-login\-path=local\fR +shell> \fBmysql \-\-login\-path=remote\fR .fi .if n \{\ .RE .\} .PP -To connect to the remote server, use this command: +Here, +\fBmysql\fR +reads the +[client] +and +[mysql] +option groups from other option files, and the +[client], +[mysql], and +[remote] +groups from the login path file\&. +.PP +To connect to the local server, use this command: .sp .if n \{\ .RS 4 .\} .nf -shell> \fBmysql \-\-login\-path=remote\fR +shell> \fBmysql \-\-login\-path=client\fR .fi .if n \{\ .RE .\} .PP +Because +\fBmysql\fR +reads the +client +and +mysql +login paths by default, the +\fB\-\-login\-path\fR +option does not add anything in this case\&. That command is equivalent to this one: +.sp +.if n \{\ +.RS 4 +.\} +.nf +shell> \fBmysql\fR +.fi +.if n \{\ +.RE +.\} +.PP +Options read from the login path file take precedence over options read from other option files\&. Options read from login path groups appearing later in the login path file take precedence over options read from groups appearing earlier in the file\&. +.PP +\fBmysql_config_editor\fR +adds login paths to the login path file in the order you create them, so you should create more general login paths first and more specific paths later\&. If you need to move a login path within the file, you can remove it, then recreate it to add it to the end\&. +.PP When you use the set command with \fBmysql_config_editor\fR -to create a login path, you need not specify all three possible option values (host name, user name, and password)\&. Only those values given are written to the path\&. Any missing values required later can be specified when you invoke a client path to connect to the MySQL server, either in other option files or on the command line\&. Also, any options specified on the command line override those in option files, including the -\&.mylogin\&.cnf -file\&. For example, if the credentials in the +to create a login path, you need not specify all possible option values (host name, user name, password, port, socket)\&. Only those values given are written to the path\&. Any missing values required later can be specified when you invoke a client path to connect to the MySQL server, either in other option files or on the command line\&. Any options specified on the command line override those specified in the login path file or other option files\&. For example, if the credentials in the remote login path also apply for the host -remote2\&.example\&.com, you can connect to the server on that host like this: +remote2\&.example\&.com, connect to the server on that host like this: .sp .if n \{\ .RS 4 @@ -276,28 +487,11 @@ shell> \fBmysql \-\-login\-path=remote \-\-host=remote2\&.example\&.com\fR .if n \{\ .RE .\} -.PP -The -\&.mylogin\&.cnf -file, if it exists, is read in all cases, even when the -\fB\-\-no\-defaults\fR -option is used\&. This permits passwords to be specified in a safer way than on the command line even if -\fB\-\-no\-defaults\fR -is present\&. -mysql_config_editor Commands.PP -This section describes the permitted -\fBmysql_config_editor\fR -commands, and the interpretation of options that have a command\-specific meaning\&. In addition, -\fBmysql_config_editor\fR -takes other options that can be used with any command, such as -\fB\-\-verbose\fR -to produce more information as -\fBmysql_config_editor\fR -executes\&. This option may be helpful in diagnosing problems if an operation does not have the effect you expect\&. For a list of supported options, see -\fBmysql_config_editor\fR Options\&. -.PP +.sp +mysql_config_editor General Options.PP \fBmysql_config_editor\fR -supports these commands: +supports the following general options, which may be used preceding any command named on the command line\&. For descriptions of command\-specific options, see +mysql_config_editor Commands and Command-Specific Options\&. .sp .RS 4 .ie n \{\ @@ -307,9 +501,29 @@ supports these commands: .sp -1 .IP \(bu 2.3 .\} -help +.\" mysql_config_editor: help option +.\" help option: mysql_config_editor +\fB\-\-help\fR, +\fB\-?\fR +.sp +Display a general help message and exit\&. +.sp +To see a command\-specific help message, invoke +\fBmysql_config_editor\fR +as follows, where +\fIcommand\fR +is a command other than +help: .sp -Display a help message and exit\&. +.if n \{\ +.RS 4 +.\} +.nf +shell> \fBmysql_config_editor \fR\fB\fIcommand\fR\fR\fB \-\-help\fR +.fi +.if n \{\ +.RE +.\} .RE .sp .RS 4 @@ -320,16 +534,17 @@ Display a help message and exit\&. .sp -1 .IP \(bu 2.3 .\} -print [\fIoptions\fR] -.sp -Print the contents of -\&.mylogin\&.cnf -in unencrypted form\&. Passwords are displayed as -*****\&. +.\" mysql_config_editor: debug option +.\" debug option: mysql_config_editor +\fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR, +\fB\-# \fR\fB\fIdebug_options\fR\fR .sp -The -print -command takes these options: +Write a debugging log\&. A typical +\fIdebug_options\fR +string is +d:t:o,\fIfile_name\fR\&. The default is +d:t:o,/tmp/mysql_config_editor\&.trace\&. +.RE .sp .RS 4 .ie n \{\ @@ -339,9 +554,12 @@ command takes these options: .sp -1 .IP \(bu 2.3 .\} -\fB\-\-all\fR +.\" mysql_config_editor: verbose option +.\" verbose option: mysql_config_editor +\fB\-\-verbose\fR, +\fB\-v\fR .sp -Print all login paths\&. +Verbose mode\&. Print more information about what the program does\&. This option may be helpful in diagnosing problems if an operation does not have the effect you expect\&. .RE .sp .RS 4 @@ -352,20 +570,25 @@ Print all login paths\&. .sp -1 .IP \(bu 2.3 .\} -\fB\-\-login\-path=\fR\fB\fIname\fR\fR -.sp -Print the named login path\&. -.RE +.\" mysql_config_editor: version option +.\" version option: mysql_config_editor +\fB\-\-version\fR, +\fB\-V\fR .sp -If no login path is specified, the default path name is -client\&. If both -\fB\-\-all\fR -and -\fB\-\-login\-path\fR -are given, -\fB\-\-all\fR -takes precedence\&. +Display version information and exit\&. .RE +mysql_config_editor Commands and Command\-Specific Options.PP +This section describes the permitted +\fBmysql_config_editor\fR +commands, and, for each one, the command\-specific options permitted following the command name on the command line\&. +.PP +In addition, +\fBmysql_config_editor\fR +supports general options that can be used preceding any command\&. For descriptions of these options, see +mysql_config_editor General Options\&. +.PP +\fBmysql_config_editor\fR +supports these commands: .sp .RS 4 .ie n \{\ @@ -375,27 +598,26 @@ takes precedence\&. .sp -1 .IP \(bu 2.3 .\} -remove [\fIoptions\fR] +help .sp -Remove a login path from the -\&.mylogin\&.cnf -file\&. +Display a general help message and exit\&. This command takes no following options\&. .sp -The -remove -command takes these options: +To see a command\-specific help message, invoke +\fBmysql_config_editor\fR +as follows, where +\fIcommand\fR +is a command other than +help: .sp +.if n \{\ .RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c .\} -.el \{\ -.sp -1 -.IP \(bu 2.3 +.nf +shell> \fBmysql_config_editor \fR\fB\fIcommand\fR\fR\fB \-\-help\fR +.fi +.if n \{\ +.RE .\} -\fB\-\-host\fR -.sp -Remove the host name from the login path\&. .RE .sp .RS 4 @@ -406,11 +628,24 @@ Remove the host name from the login path\&. .sp -1 .IP \(bu 2.3 .\} -\fB\-\-login\-path=\fR\fB\fIname\fR\fR +print [\fIoptions\fR] .sp -The login path to remove\&. If this option is not given, the default path name is -client\&. -.RE +Print the contents of the login path file in unencrypted form, with the exception that passwords are displayed as +*****\&. +.sp +The default login path name is +client +if no login path is named\&. If both +\fB\-\-all\fR +and +\fB\-\-login\-path\fR +are given, +\fB\-\-all\fR +takes precedence\&. +.sp +The +print +command permits these options following the command name: .sp .RS 4 .ie n \{\ @@ -420,9 +655,15 @@ client\&. .sp -1 .IP \(bu 2.3 .\} -\fB\-\-password\fR +\fB\-\-help\fR, +\fB\-?\fR +.sp +Display a help message for the +print +command and exit\&. .sp -Remove the password from the login path\&. +To see a general help message, use +\fBmysql_config_editor \-\-help\fR\&. .RE .sp .RS 4 @@ -433,9 +674,9 @@ Remove the password from the login path\&. .sp -1 .IP \(bu 2.3 .\} -\fB\-\-port\fR +\fB\-\-all\fR .sp -Remove the TCP/IP port number from the login path\&. +Print the contents of all login paths in the login path file\&. .RE .sp .RS 4 @@ -446,9 +687,11 @@ Remove the TCP/IP port number from the login path\&. .sp -1 .IP \(bu 2.3 .\} -\fB\-\-socket\fR +\fB\-\-login\-path=\fR\fB\fIname\fR\fR, +\fB\-G \fR\fB\fIname\fR\fR .sp -Remove the Unix socket file name from the login path\&. +Print the contents of the named login path\&. +.RE .RE .sp .RS 4 @@ -459,53 +702,53 @@ Remove the Unix socket file name from the login path\&. .sp -1 .IP \(bu 2.3 .\} -\fB\-\-user\fR -.sp -Remove the user name from the login path\&. -.RE +remove [\fIoptions\fR] .sp -The -\fB\-\-host\fR, -\fB\-\-user\fR, and -\fB\-\-password\fR -options are supported for the -remove -command as of MySQL 5\&.6\&.9\&. The -\fB\-\-port\fR -and -\fB\-\-socket\fR -options are supported for the -remove -command as of MySQL 5\&.6\&.11 +Remove a login path from the login path file, or modify a login path by removing options from it\&. .sp -The -remove -command removes from the login path only such values as are specified with the +This command removes from the login path only such options as are specified with the \fB\-\-host\fR, \fB\-\-password\fR, \fB\-\-port\fR, \fB\-\-socket\fR, and \fB\-\-user\fR -options\&. If none of them is given, +options\&. If none of those options are given, remove removes the entire login path\&. For example, this command removes only the \fBuser\fR -value from the -client +option from the +mypath login path rather than the entire -client +mypath login path: .sp .if n \{\ .RS 4 .\} .nf -mysql_config_editor remove \-\-login\-path=client \-\-user +shell> \fBmysql_config_editor remove \-\-login\-path=mypath \-\-user\fR .fi .if n \{\ .RE .\} +.sp +This command removes the entire +mypath +login path: +.sp +.if n \{\ +.RS 4 +.\} +.nf +shell> \fBmysql_config_editor remove \-\-login\-path=mypath\fR +.fi +.if n \{\ .RE +.\} +.sp +The +remove +command permits these options following the command name: .sp .RS 4 .ie n \{\ @@ -515,11 +758,15 @@ mysql_config_editor remove \-\-login\-path=client \-\-user .sp -1 .IP \(bu 2.3 .\} -reset +\fB\-\-help\fR, +\fB\-?\fR .sp -Empty the contents of the -\&.mylogin\&.cnf -file\&. The file is created if it does not exist\&. +Display a help message for the +remove +command and exit\&. +.sp +To see a general help message, use +\fBmysql_config_editor \-\-help\fR\&. .RE .sp .RS 4 @@ -530,15 +777,11 @@ file\&. The file is created if it does not exist\&. .sp -1 .IP \(bu 2.3 .\} -set [\fIoptions\fR] -.sp -Write a login path to the -\&.mylogin\&.cnf -file\&. +\fB\-\-host\fR, +\fB\-h\fR .sp -The -set -command takes these options: +Remove the host name from the login path\&. This option was added in MySQL 5\&.6\&.9\&. +.RE .sp .RS 4 .ie n \{\ @@ -548,9 +791,12 @@ command takes these options: .sp -1 .IP \(bu 2.3 .\} -\fB\-\-host=\fR\fB\fIhost_name\fR\fR +\fB\-\-login\-path=\fR\fB\fIname\fR\fR, +\fB\-G \fR\fB\fIname\fR\fR .sp -The host name to write to the login path\&. +The login path to remove or modify\&. The default login path name is +client +if this option is not given\&. .RE .sp .RS 4 @@ -561,10 +807,10 @@ The host name to write to the login path\&. .sp -1 .IP \(bu 2.3 .\} -\fB\-\-login\-path=\fR\fB\fIname\fR\fR +\fB\-\-password\fR, +\fB\-p\fR .sp -The login path to create\&. If this option is not given, the default path name is -client\&. +Remove the password from the login path\&. This option was added in MySQL 5\&.6\&.9\&. .RE .sp .RS 4 @@ -575,9 +821,10 @@ client\&. .sp -1 .IP \(bu 2.3 .\} -\fB\-\-password\fR +\fB\-\-port\fR, +\fB\-P\fR .sp -Prompt for a password to write to the login path\&. +Remove the TCP/IP port number from the login path\&. This option was added in MySQL 5\&.6\&.11\&. .RE .sp .RS 4 @@ -588,9 +835,10 @@ Prompt for a password to write to the login path\&. .sp -1 .IP \(bu 2.3 .\} -\fB\-\-port=\fR\fB\fIport_num\fR\fR +\fB\-\-socket\fR, +\fB\-S\fR .sp -The TCP/IP port number to write to the login path\&. +Remove the Unix socket file name from the login path\&. This option was added in MySQL 5\&.6\&.11\&. .RE .sp .RS 4 @@ -601,9 +849,10 @@ The TCP/IP port number to write to the login path\&. .sp -1 .IP \(bu 2.3 .\} -\fB\-\-socket=\fR\fB\fIfile_name\fR\fR +\fB\-\-user\fR, +\fB\-u\fR .sp -The Unix socket file to write to the login path\&. +Remove the user name from the login path\&. This option was added in MySQL 5\&.6\&.9\&. .RE .sp .RS 4 @@ -614,61 +863,32 @@ The Unix socket file to write to the login path\&. .sp -1 .IP \(bu 2.3 .\} -\fB\-\-user=\fR\fB\fIuser_name\fR\fR +\fB\-\-warn\fR, +\fB\-w\fR .sp -The user name to write to the login path\&. +Warn and prompt the user for confirmation if the command attempts to remove the default login path (client) and +\fB\-\-login\-path=client\fR +was not specified\&. This option is enabled by default; use +\fB\-\-skip\-warn\fR +to disable it\&. +.RE .RE .sp -The -\fB\-\-port\fR -and -\fB\-\-socket\fR -options are supported for the -set -command as of MySQL 5\&.6\&.11 -.sp -The -set -command writes to the login path only such values as are specified with the -\fB\-\-host\fR, -\fB\-\-password\fR, -\fB\-\-port\fR, -\fB\-\-socket\fR, and -\fB\-\-user\fR -options\&. If none of those options are given, -\fBmysql_config_editor\fR -writes the login path as an empty group\&. -.sp -To specify an empty password, use the -set -command with the -\fB\-\-password\fR -option, then press Enter at the password prompt\&. The resulting login path written to -\&.mylogin\&.cnf -will include a line like this: -.sp -.if n \{\ .RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c .\} -.nf -password = -.fi -.if n \{\ -.RE +.el \{\ +.sp -1 +.IP \(bu 2.3 .\} +reset [\fIoptions\fR] .sp -If the login path already exists in -\&.mylogin\&.cnf, the -set -command replaces it\&. To ensure that this is what the user wants, -\fBmysql_config_editor\fR -prints a warning and prompts for confirmation\&. To suppress the warning and prompt, use the -\fB\-\-skip\-warn\fR -option\&. -.RE -mysql_config_editor Options.PP -\fBmysql_config_editor\fR -supports the following options\&. +Empty the contents of the login path file\&. +.sp +The +reset +command permits these options following the command name: .sp .RS 4 .ie n \{\ @@ -678,15 +898,16 @@ supports the following options\&. .sp -1 .IP \(bu 2.3 .\} -.\" mysql_config_editor: help option -.\" help option: mysql_config_editor \fB\-\-help\fR, \fB\-?\fR .sp -Display a help message and exit\&. If preceded by a command name such as -set -or -remove, displays information about that command\&. +Display a help message for the +reset +command and exit\&. +.sp +To see a general help message, use +\fBmysql_config_editor \-\-help\fR\&. +.RE .RE .sp .RS 4 @@ -697,14 +918,23 @@ remove, displays information about that command\&. .sp -1 .IP \(bu 2.3 .\} -.\" mysql_config_editor: all option -.\" all option: mysql_config_editor -\fB\-\-all\fR +set [\fIoptions\fR] .sp -For the -print -command, print all login paths in the login file\&. -.RE +Write a login path to the login path file\&. +.sp +This command writes to the login path only such options as are specified with the +\fB\-\-host\fR, +\fB\-\-password\fR, +\fB\-\-port\fR, +\fB\-\-socket\fR, and +\fB\-\-user\fR +options\&. If none of those options are given, +\fBmysql_config_editor\fR +writes the login path as an empty group\&. +.sp +The +set +command permits these options following the command name: .sp .RS 4 .ie n \{\ @@ -714,16 +944,15 @@ command, print all login paths in the login file\&. .sp -1 .IP \(bu 2.3 .\} -.\" mysql_config_editor: debug option -.\" debug option: mysql_config_editor -\fB\-\-debug[=\fR\fB\fIdebug_options\fR\fR\fB]\fR, -\fB\-# \fR\fB\fIdebug_options\fR\fR +\fB\-\-help\fR, +\fB\-?\fR .sp -Write a debugging log\&. A typical -\fIdebug_options\fR -string is -d:t:o,\fIfile_name\fR\&. The default is -d:t:o\&. +Display a help message for the +set +command and exit\&. +.sp +To see a general help message, use +\fBmysql_config_editor \-\-help\fR\&. .RE .sp .RS 4 @@ -734,16 +963,10 @@ d:t:o\&. .sp -1 .IP \(bu 2.3 .\} -.\" mysql_config_editor: host option -.\" host option: mysql_config_editor \fB\-\-host=\fR\fB\fIhost_name\fR\fR, \fB\-h \fR\fB\fIhost_name\fR\fR .sp -For the -set -command, the host name to write to the login path\&. For the -remove -command, removes the host name from the login path\&. +The host name to write to the login path\&. .RE .sp .RS 4 @@ -754,26 +977,12 @@ command, removes the host name from the login path\&. .sp -1 .IP \(bu 2.3 .\} -.\" mysql_config_editor: login-path option -.\" login-path option: mysql_config_editor \fB\-\-login\-path=\fR\fB\fIname\fR\fR, \fB\-G \fR\fB\fIname\fR\fR .sp -For the -print, -remove, and -set -commands, the login path to use in the -\&.mylogin\&.cnf -login file\&. -.sp -Client programs also support the -\fB\-\-login\-path\fR -option, to enable users to specify which login path to use for connecting to a MySQL server\&. For client programs, -\fB\-\-login\-path\fR -must be the first option given, which is not true for -\fBmysql_config_editor\fR\&. See -Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\&. +The login path to create\&. The default login path name is +client +if this option is not given\&. .RE .sp .RS 4 @@ -784,30 +993,26 @@ Section\ \&4.2.7, \(lqCommand-Line Options that Affect Option-File Handling\(rq\ .sp -1 .IP \(bu 2.3 .\} -.\" mysql_config_editor: password option -.\" password option: mysql_config_editor \fB\-\-password\fR, \fB\-p\fR .sp -For the -set -command, cause -\fBmysql_config_editor\fR -to prompt for a password and write the value entered by the user to the login path\&. After +Prompt for a password to write to the login path\&. After \fBmysql_config_editor\fR -starts and displays the prompt, the user should type the password and press Enter\&. To prevent other users from seeing the password, +displays the prompt, type the password and press Enter\&. To prevent other users from seeing the password, \fBmysql_config_editor\fR does not echo it\&. .sp -This option does not permit a password value following the option name\&. That is, with -\fBmysql_config_editor\fR, you never enter a password on the command line where it might be seen by other users\&. This differs from most other MySQL programs, which permit the password to be given on the command line as -\fB\-\-password=\fR\fB\fIpass_val\fR\fR -or -\fB\-p\fR\fB\fIpass_val\fR\fR\&. (That practice is insecure and should be avoided, however\&.) +To specify an empty password, press Enter at the password prompt\&. The resulting login path written to the login path file will include a line like this: .sp -For the -remove -command, removes the password from the login path\&. +.if n \{\ +.RS 4 +.\} +.nf +password = +.fi +.if n \{\ +.RE +.\} .RE .sp .RS 4 @@ -818,16 +1023,10 @@ command, removes the password from the login path\&. .sp -1 .IP \(bu 2.3 .\} -.\" mysql_config_editor: port option -.\" port option: mysql_config_editor \fB\-\-port=\fR\fB\fIport_num\fR\fR, \fB\-P \fR\fB\fIport_num\fR\fR .sp -For the -set -command, the TCP/IP port number to write to the login path\&. For the -remove -command, removes the port number from the login path\&. +The TCP/IP port number to write to the login path\&. This option was added in MySQL 5\&.6\&.11\&. .RE .sp .RS 4 @@ -838,16 +1037,10 @@ command, removes the port number from the login path\&. .sp -1 .IP \(bu 2.3 .\} -.\" mysql_config_editor: socket option -.\" socket option: mysql_config_editor \fB\-\-socket=\fR\fB\fIfile_name\fR\fR, \fB\-S \fR\fB\fIfile_name\fR\fR .sp -For the -set -command, the Unix socket file name to write to the login path\&. For the -remove -command, removes the socket file from the login path\&. +The Unix socket file name to write to the login path\&. This option was added in MySQL 5\&.6\&.11\&. .RE .sp .RS 4 @@ -858,48 +1051,10 @@ command, removes the socket file from the login path\&. .sp -1 .IP \(bu 2.3 .\} -.\" mysql_config_editor: user option -.\" user option: mysql_config_editor \fB\-\-user=\fR\fB\fIuser_name\fR\fR, \fB\-u \fR\fB\fIuser_name\fR\fR .sp -For the -set -command, the user name to write to the login path\&. For the -remove -command, removes the user name from the login path\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" mysql_config_editor: verbose option -.\" verbose option: mysql_config_editor -\fB\-\-verbose\fR, -\fB\-v\fR -.sp -Verbose mode\&. Print more information about what the program does\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" mysql_config_editor: version option -.\" version option: mysql_config_editor -\fB\-\-version\fR, -\fB\-V\fR -.sp -Display version information and exit\&. +The user name to write to the login path\&. .RE .sp .RS 4 @@ -910,21 +1065,18 @@ Display version information and exit\&. .sp -1 .IP \(bu 2.3 .\} -.\" mysql_config_editor: warn option -.\" warn option: mysql_config_editor \fB\-\-warn\fR, \fB\-w\fR .sp -For the -set -command, warn and prompt the user for confirmation if the command attempts to overwrite an existing login path\&. This option is enabled by default; use +Warn and prompt the user for confirmation if the command attempts to overwrite an existing login path\&. This option is enabled by default; use \fB\-\-skip\-warn\fR to disable it\&. .RE +.RE .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/mysql_convert_table_format.1 b/mysql-wsrep-5.6/man/mysql_convert_table_format.1 index 0b86e454..b5f829f9 100644 --- a/mysql-wsrep-5.6/man/mysql_convert_table_format.1 +++ b/mysql-wsrep-5.6/man/mysql_convert_table_format.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_convert_table_format\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_CONVERT_TAB" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_CONVERT_TAB" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -241,7 +241,7 @@ Display version information and exit\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/mysql_find_rows.1 b/mysql-wsrep-5.6/man/mysql_find_rows.1 index 18f6af87..36fa1071 100644 --- a/mysql-wsrep-5.6/man/mysql_find_rows.1 +++ b/mysql-wsrep-5.6/man/mysql_find_rows.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_find_rows\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_FIND_ROWS\F" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_FIND_ROWS\F" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -176,7 +176,7 @@ Start output from this row\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/mysql_fix_extensions.1 b/mysql-wsrep-5.6/man/mysql_fix_extensions.1 index 6c6f7152..c28a9733 100644 --- a/mysql-wsrep-5.6/man/mysql_fix_extensions.1 +++ b/mysql-wsrep-5.6/man/mysql_fix_extensions.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_fix_extensions\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_FIX_EXTENSI" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_FIX_EXTENSI" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -86,7 +86,7 @@ shell> \fBmysql_fix_extensions \fR\fB\fIdata_dir\fR\fR .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/mysql_install_db.1 b/mysql-wsrep-5.6/man/mysql_install_db.1 index 8b9ce8be..ebb9cb85 100644 --- a/mysql-wsrep-5.6/man/mysql_install_db.1 +++ b/mysql-wsrep-5.6/man/mysql_install_db.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_install_db\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_INSTALL_DB\" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_INSTALL_DB\" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -209,7 +209,7 @@ Display a help message and exit\&. .\} .\" mysql_install_db: basedir option .\" basedir option: mysql_install_db -\fB\-\-basedir=\fR\fB\fIpath\fR\fR +\fB\-\-basedir=\fR\fB\fIdir_name\fR\fR .sp The path to the MySQL installation directory\&. .RE @@ -224,7 +224,7 @@ The path to the MySQL installation directory\&. .\} .\" mysql_install_db: builddir option .\" builddir option: mysql_install_db -\fB\-\-builddir=\fR\fB\fIpath\fR\fR +\fB\-\-builddir=\fR\fB\fIdir_name\fR\fR .sp For use with \fB\-\-srcdir\fR @@ -256,7 +256,7 @@ For internal use\&. This option is used for building system tables on one host i .\} .\" mysql_install_db: datadir option .\" datadir option: mysql_install_db -\fB\-\-datadir=\fR\fB\fIpath\fR\fR +\fB\-\-datadir=\fR\fB\fIdir_name\fR\fR .sp The path to the MySQL data directory\&. Beginning with MySQL 5\&.6\&.8, \fBmysql_install_db\fR @@ -326,7 +326,7 @@ to run even if DNS does not work\&. Grant table entries normally created using h .sp Tell \fBmysql_install_db\fR -preserve any existing +to preserve any existing my\&.cnf file and not create a new default my\&.cnf @@ -343,7 +343,7 @@ file\&. This option was added in MySQL 5\&.6\&.20\&. .\} .\" mysql_install_db: ldata option .\" ldata option: mysql_install_db -\fB\-\-ldata=\fR\fB\fIpath\fR\fR +\fB\-\-ldata=\fR\fB\fIdir_name\fR\fR .sp A synonym for \fB\-\-datadir\fR\&. @@ -523,7 +523,7 @@ Use IP addresses rather than host names when creating grant table entries\&. Thi .\} .\" mysql_install_db: srcdir option .\" srcdir option: mysql_install_db -\fB\-\-srcdir=\fR\fB\fIpath\fR\fR +\fB\-\-srcdir=\fR\fB\fIdir_name\fR\fR .sp For internal use\&. This option specifies the directory under which \fBmysql_install_db\fR @@ -584,7 +584,7 @@ For internal use\&. This option is used for creating Windows distributions\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/mysql_plugin.1 b/mysql-wsrep-5.6/man/mysql_plugin.1 index b2339988..c4550ae9 100644 --- a/mysql-wsrep-5.6/man/mysql_plugin.1 +++ b/mysql-wsrep-5.6/man/mysql_plugin.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_plugin\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_PLUGIN\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_PLUGIN\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -102,7 +102,7 @@ plugin3, all of which should be configured under \fBmysql_plugin\fR control\&. By convention, configuration files have a suffix of \&.ini -and the same basename as the plugin library, so the default configuration file name for this plugin library is +and the same base name as the plugin library, so the default configuration file name for this plugin library is myplugins\&.ini\&. The configuration file contents look like this: .sp .if n \{\ @@ -192,8 +192,8 @@ Display a help message and exit\&. .\} .\" mysql_plugin: basedir option .\" basedir option: mysql_plugin -\fB\-\-basedir=\fR\fB\fIpath\fR\fR, -\fB\-b \fR\fB\fIpath\fR\fR +\fB\-\-basedir=\fR\fB\fIdir_name\fR\fR, +\fB\-b \fR\fB\fIdir_name\fR\fR .sp The server base directory\&. .RE @@ -208,8 +208,8 @@ The server base directory\&. .\} .\" mysql_plugin: datadir option .\" datadir option: mysql_plugin -\fB\-\-datadir=\fR\fB\fIpath\fR\fR, -\fB\-d \fR\fB\fIpath\fR\fR +\fB\-\-datadir=\fR\fB\fIdir_name\fR\fR, +\fB\-d \fR\fB\fIdir_name\fR\fR .sp The server data directory\&. .RE @@ -224,8 +224,8 @@ The server data directory\&. .\} .\" mysql_plugin: my-print-defaults option .\" my-print-defaults option: mysql_plugin -\fB\-\-my\-print\-defaults=\fR\fB\fIpath\fR\fR, -\fB\-b \fR\fB\fIpath\fR\fR +\fB\-\-my\-print\-defaults=\fR\fB\fIfile_name\fR\fR, +\fB\-b \fR\fB\fIfile_name\fR\fR .sp The path to the \fBmy_print_defaults\fR @@ -242,8 +242,8 @@ program\&. .\} .\" mysql_plugin: mysqld option .\" mysqld option: mysql_plugin -\fB\-\-mysqld=\fR\fB\fIpath\fR\fR, -\fB\-b \fR\fB\fIpath\fR\fR +\fB\-\-mysqld=\fR\fB\fIfile_name\fR\fR, +\fB\-b \fR\fB\fIfile_name\fR\fR .sp The path to the \fBmysqld\fR @@ -280,8 +280,8 @@ With .\} .\" mysql_plugin: plugin-dir option .\" plugin-dir option: mysql_plugin -\fB\-\-plugin\-dir=\fR\fB\fIpath\fR\fR, -\fB\-p \fR\fB\fIpath\fR\fR +\fB\-\-plugin\-dir=\fR\fB\fIdir_name\fR\fR, +\fB\-p \fR\fB\fIdir_name\fR\fR .sp The server plugin directory\&. .RE @@ -370,7 +370,7 @@ Display version information and exit\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/mysql_secure_installation.1 b/mysql-wsrep-5.6/man/mysql_secure_installation.1 index 9b3384bf..676fe753 100644 --- a/mysql-wsrep-5.6/man/mysql_secure_installation.1 +++ b/mysql-wsrep-5.6/man/mysql_secure_installation.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_secure_installation\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_SECURE_INST" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_SECURE_INST" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -90,7 +90,7 @@ test_\&. .PP \fBmysql_secure_installation\fR helps you implement security recommendations similar to those described at -Section\ \&2.10.2, \(lqSecuring the Initial MySQL Accounts\(rq\&. +Section\ \&2.10.4, \(lqSecuring the Initial MySQL Accounts\(rq\&. .PP Invoke \fBmysql_secure_installation\fR @@ -110,7 +110,7 @@ When executed, the script prompts you to determine which actions to perform\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/mysql_setpermission.1 b/mysql-wsrep-5.6/man/mysql_setpermission.1 index 822e10c3..8551c7f8 100644 --- a/mysql-wsrep-5.6/man/mysql_setpermission.1 +++ b/mysql-wsrep-5.6/man/mysql_setpermission.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_setpermission\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_SETPERMISSI" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_SETPERMISSI" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -188,7 +188,7 @@ The MySQL user name to use when connecting to the server\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/mysql_tzinfo_to_sql.1 b/mysql-wsrep-5.6/man/mysql_tzinfo_to_sql.1 index 80d6b2dd..d1124367 100644 --- a/mysql-wsrep-5.6/man/mysql_tzinfo_to_sql.1 +++ b/mysql-wsrep-5.6/man/mysql_tzinfo_to_sql.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_tzinfo_to_sql\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_TZINFO_TO_S" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_TZINFO_TO_S" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -41,7 +41,7 @@ The program loads the time zone tables in the mysql database\&. It is used on systems that have a -zoneinfo +\fIzoneinfo\fR database (the set of files describing time zones)\&. Examples of such systems are Linux, FreeBSD, Solaris, and OS X\&. One likely location for these files is the /usr/share/zoneinfo directory (/usr/share/lib/zoneinfo @@ -122,7 +122,7 @@ After running .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/mysql_upgrade.1 b/mysql-wsrep-5.6/man/mysql_upgrade.1 index d0f89e75..afa78832 100644 --- a/mysql-wsrep-5.6/man/mysql_upgrade.1 +++ b/mysql-wsrep-5.6/man/mysql_upgrade.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_upgrade\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_UPGRADE\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_UPGRADE\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -56,7 +56,7 @@ If you install MySQL from RPM packages on Linux, you must install the server and \fBmysql_upgrade\fR is included in the server RPM but requires the client RPM because the latter includes \fBmysqlcheck\fR\&. (See -Section\ \&2.5.5, \(lqInstalling MySQL on Linux Using RPM Packages\(rq\&.) +Section\ \&2.5.5, \(lqInstalling MySQL on Linux Using RPM Packages from Oracle\(rq\&.) .if n \{\ .sp .\} @@ -327,7 +327,7 @@ The path to the MySQL installation directory\&. This option is accepted for back .\} .\" mysql_upgrade: character-sets-dir option .\" character-sets-dir option: mysql_upgrade -\fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR +\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR .sp The directory where character sets are installed\&. See Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&. @@ -426,7 +426,7 @@ Print debugging information and memory and CPU usage statistics when the program .\" default-auth option: mysql_upgrade \fB\-\-default\-auth=\fR\fB\fIplugin\fR\fR .sp -The client\-side authentication plugin to use\&. See +A hint about the client\-side authentication plugin to use\&. See Section\ \&6.3.7, \(lqPluggable Authentication\(rq\&. .sp This option was added in MySQL 5\&.6\&.2\&. @@ -563,12 +563,9 @@ Connect to the MySQL server on the given host\&. .sp Read options from the named login path in the \&.mylogin\&.cnf -login file\&. A +login path file\&. A \(lqlogin path\(rq -is an option group that permits only a limited set of options: -\fBhost\fR, -\fBuser\fR, and -\fBpassword\fR\&. Think of a login path as a set of values that indicate the server host and the credentials for authenticating with the server\&. To create the login path file, use the +is an option group containing options that specify which MySQL server to connect to and which account to authenticate as\&. To create or modify a login path file, use the \fBmysql_config_editor\fR utility\&. See \fBmysql_config_editor\fR(1)\&. This option was added in MySQL 5\&.6\&.6\&. @@ -656,9 +653,9 @@ On Windows, connect to the server using a named pipe\&. This option applies only .\} .\" mysql_upgrade: plugin-dir option .\" plugin-dir option: mysql_upgrade -\fB\-\-plugin\-dir=\fR\fB\fIpath\fR\fR +\fB\-\-plugin\-dir=\fR\fB\fIdir_name\fR\fR .sp -The directory in which to look for plugins\&. It may be necessary to specify this option if the +The directory in which to look for plugins\&. Specify this option if the \fB\-\-default\-auth\fR option is used to specify an authentication plugin but \fBmysql_upgrade\fR @@ -767,7 +764,7 @@ localhost, the Unix socket file to use, or, on Windows, the name of the named pi Options that begin with \fB\-\-ssl\fR specify whether to connect to the server using SSL and indicate where to find SSL keys and certificates\&. See -Section\ \&6.3.10.4, \(lqSSL Command Options\(rq\&. +Section\ \&6.3.9.5, \(lqCommand Options for Secure Connections\(rq\&. .RE .sp .RS 4 @@ -781,7 +778,7 @@ Section\ \&6.3.10.4, \(lqSSL Command Options\(rq\&. .\" mysql_upgrade: tmpdir option .\" tmpdir option: mysql_upgrade \fB\-\-tmpdir=\fR\fB\fIdir_name\fR\fR, -\fB\-t \fR\fB\fIpath\fR\fR +\fB\-t \fR\fB\fIdir_name\fR\fR .sp The path name of the directory to use for creating temporary files\&. .RE @@ -892,7 +889,7 @@ Section\ \&17.1.3.4, \(lqRestrictions on Replication with GTIDs\(rq, for more in .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/mysql_waitpid.1 b/mysql-wsrep-5.6/man/mysql_waitpid.1 index bb9be3af..c0d4fdd7 100644 --- a/mysql-wsrep-5.6/man/mysql_waitpid.1 +++ b/mysql-wsrep-5.6/man/mysql_waitpid.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_waitpid\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_WAITPID\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_WAITPID\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -131,7 +131,7 @@ Display version information and exit\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/mysql_zap.1 b/mysql-wsrep-5.6/man/mysql_zap.1 index 9928a46f..9068c1e6 100644 --- a/mysql-wsrep-5.6/man/mysql_zap.1 +++ b/mysql-wsrep-5.6/man/mysql_zap.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysql_zap\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQL_ZAP\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQL_ZAP\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -127,7 +127,7 @@ Test mode\&. Display information about each process but do not kill it\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/mysqlaccess.1 b/mysql-wsrep-5.6/man/mysqlaccess.1 index 7cabeb6c..5f8bd5ae 100644 --- a/mysql-wsrep-5.6/man/mysqlaccess.1 +++ b/mysql-wsrep-5.6/man/mysqlaccess.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlaccess\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLACCESS\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLACCESS\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -448,7 +448,7 @@ error will occur when you run .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/mysqladmin.1 b/mysql-wsrep-5.6/man/mysqladmin.1 index bc36a2dd..f8b908bc 100644 --- a/mysql-wsrep-5.6/man/mysqladmin.1 +++ b/mysql-wsrep-5.6/man/mysqladmin.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqladmin\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLADMIN\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLADMIN\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -215,7 +215,7 @@ Kill server threads\&. If multiple thread ID values are given, there must be no .sp -1 .IP \(bu 2.3 .\} -old\-password \fInew\-password\fR +old\-password \fInew_password\fR .sp This is like the password @@ -231,10 +231,10 @@ Section\ \&6.1.2.4, \(lqPassword Hashing in MySQL\(rq\&.) .sp -1 .IP \(bu 2.3 .\} -password \fInew\-password\fR +password \fInew_password\fR .sp Set a new password\&. This changes the password to -\fInew\-password\fR +\fInew_password\fR for the account that you use with \fBmysqladmin\fR for connecting to the server\&. Thus, the next time you invoke @@ -242,7 +242,7 @@ for connecting to the server\&. Thus, the next time you invoke (or any other client program) using the same account, you will need to specify the new password\&. .sp If the -\fInew\-password\fR +\fInew_password\fR value contains spaces or other characters that are special to your command interpreter, you need to enclose it within quotation marks\&. On Windows, be sure to use double quotation marks rather than single quotation marks; single quotation marks are not stripped from the password, but rather are interpreted as part of the password\&. For example: .sp .if n \{\ @@ -623,7 +623,7 @@ This option is supported beginning with MySQL 5\&.6\&.1\&. .\} .\" mysqladmin: character-sets-dir option .\" character-sets-dir option: mysqladmin -\fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR +\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR .sp The directory where character sets are installed\&. See Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&. @@ -725,7 +725,7 @@ Print debugging information and memory and CPU usage statistics when the program .\" default-auth option: mysqladmin \fB\-\-default\-auth=\fR\fB\fIplugin\fR\fR .sp -The client\-side authentication plugin to use\&. See +A hint about the client\-side authentication plugin to use\&. See Section\ \&6.3.7, \(lqPluggable Authentication\(rq\&. .RE .sp @@ -826,7 +826,7 @@ groups\&. Enable the mysql_clear_password cleartext authentication plugin\&. (See -Section\ \&6.3.8.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) This option was added in MySQL 5\&.6\&.7\&. +Section\ \&6.4.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) This option was added in MySQL 5\&.6\&.7\&. .RE .sp .RS 4 @@ -877,12 +877,9 @@ Connect to the MySQL server on the given host\&. .sp Read options from the named login path in the \&.mylogin\&.cnf -login file\&. A +login path file\&. A \(lqlogin path\(rq -is an option group that permits only a limited set of options: -\fBhost\fR, -\fBuser\fR, and -\fBpassword\fR\&. Think of a login path as a set of values that indicate the server host and the credentials for authenticating with the server\&. To create the login path file, use the +is an option group containing options that specify which MySQL server to connect to and which account to authenticate as\&. To create or modify a login path file, use the \fBmysql_config_editor\fR utility\&. See \fBmysql_config_editor\fR(1)\&. This option was added in MySQL 5\&.6\&.6\&. @@ -986,9 +983,9 @@ On Windows, connect to the server using a named pipe\&. This option applies only .\} .\" mysqladmin: plugin-dir option .\" plugin-dir option: mysqladmin -\fB\-\-plugin\-dir=\fR\fB\fIpath\fR\fR +\fB\-\-plugin\-dir=\fR\fB\fIdir_name\fR\fR .sp -The directory in which to look for plugins\&. It may be necessary to specify this option if the +The directory in which to look for plugins\&. Specify this option if the \fB\-\-default\-auth\fR option is used to specify an authentication plugin but \fBmysqladmin\fR @@ -1091,7 +1088,7 @@ to disable it\&. This option was added in MySQL 5\&.6\&.17\&. .ps -1 .br Passwords that use the pre\-4\&.1 hashing method are less secure than passwords that use the native password hashing method and should be avoided\&. Pre\-4\&.1 passwords are deprecated and support for them will be removed in a future MySQL release\&. For account upgrade instructions, see -Section\ \&6.3.8.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&. +Section\ \&6.4.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&. .sp .5v .RE .RE @@ -1188,7 +1185,7 @@ localhost, the Unix socket file to use, or, on Windows, the name of the named pi Options that begin with \fB\-\-ssl\fR specify whether to connect to the server using SSL and indicate where to find SSL keys and certificates\&. See -Section\ \&6.3.10.4, \(lqSSL Command Options\(rq\&. +Section\ \&6.3.9.5, \(lqCommand Options for Secure Connections\(rq\&. .RE .sp .RS 4 @@ -1309,7 +1306,7 @@ The maximum number of seconds to wait for server shutdown\&. The default value i .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/mysqlbinlog.1 b/mysql-wsrep-5.6/man/mysqlbinlog.1 index 0eb82b81..c638e551 100644 --- a/mysql-wsrep-5.6/man/mysqlbinlog.1 +++ b/mysql-wsrep-5.6/man/mysqlbinlog.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlbinlog\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLBINLOG\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLBINLOG\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -354,7 +354,7 @@ Specify the maximum size of a row\-based binary log event, in bytes\&. Rows are .\} .\" mysqlbinlog: character-sets-dir option .\" character-sets-dir option: mysqlbinlog -\fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR +\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR .sp The directory where character sets are installed\&. See Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&. @@ -600,7 +600,7 @@ Print debugging information and memory and CPU usage statistics when the program .\" default-auth option: mysqlbinlog \fB\-\-default\-auth=\fR\fB\fIplugin\fR\fR .sp -The client\-side authentication plugin to use\&. See +A hint about the client\-side authentication plugin to use\&. See Section\ \&6.3.7, \(lqPluggable Authentication\(rq\&. .sp This option was added in MySQL 5\&.6\&.2\&. @@ -811,8 +811,8 @@ Display only the groups listed in the .\} .\" mysqlbinlog: local-load option .\" local-load option: mysqlbinlog -\fB\-\-local\-load=\fR\fB\fIpath\fR\fR, -\fB\-l \fR\fB\fIpath\fR\fR +\fB\-\-local\-load=\fR\fB\fIdir_name\fR\fR, +\fB\-l \fR\fB\fIdir_name\fR\fR .sp Prepare local temporary files for LOAD DATA INFILE @@ -850,12 +850,9 @@ or any other MySQL program\&. .sp Read options from the named login path in the \&.mylogin\&.cnf -login file\&. A +login path file\&. A \(lqlogin path\(rq -is an option group that permits only a limited set of options: -\fBhost\fR, -\fBuser\fR, and -\fBpassword\fR\&. Think of a login path as a set of values that indicate the server host and the credentials for authenticating with the server\&. To create the login path file, use the +is an option group containing options that specify which MySQL server to connect to and which account to authenticate as\&. To create or modify a login path file, use the \fBmysql_config_editor\fR utility\&. See \fBmysql_config_editor\fR(1)\&. This option was added in MySQL 5\&.6\&.6\&. @@ -945,9 +942,9 @@ Section\ \&6.1.2.1, \(lqEnd-User Guidelines for Password Security\(rq\&. You can .\} .\" mysqlbinlog: plugin-dir option .\" plugin-dir option: mysqlbinlog -\fB\-\-plugin\-dir=\fR\fB\fIpath\fR\fR +\fB\-\-plugin\-dir=\fR\fB\fIdir_name\fR\fR .sp -The directory in which to look for plugins\&. It may be necessary to specify this option if the +The directory in which to look for plugins\&. Specify this option if the \fB\-\-default\-auth\fR option is used to specify an authentication plugin but \fBmysqlbinlog\fR @@ -1154,7 +1151,7 @@ to disable it\&. This option was added in MySQL 5\&.6\&.17\&. .ps -1 .br Passwords that use the pre\-4\&.1 hashing method are less secure than passwords that use the native password hashing method and should be avoided\&. Pre\-4\&.1 passwords are deprecated and support for them will be removed in a future MySQL release\&. For account upgrade instructions, see -Section\ \&6.3.8.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&. +Section\ \&6.4.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&. .sp .5v .RE .RE @@ -2117,7 +2114,7 @@ Master Pos: The position of the next event in the original master log file\&. .sp -1 .IP \(bu 2.3 .\} -Flags: 16 flags\&. Currently, the following flags are used\&. The others are reserved for future use\&. +Flags: 16 flags\&. The following flags are used\&. The others are reserved for future use\&. .TS allbox tab(:); lB lB lB. @@ -2982,7 +2979,7 @@ specifies a nonzero server ID\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/mysqlbug.1 b/mysql-wsrep-5.6/man/mysqlbug.1 index c9504160..644baec3 100644 --- a/mysql-wsrep-5.6/man/mysqlbug.1 +++ b/mysql-wsrep-5.6/man/mysqlbug.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlbug\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLBUG\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLBUG\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -42,7 +42,7 @@ The normal way to report bugs is to visit .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/mysqlcheck.1 b/mysql-wsrep-5.6/man/mysqlcheck.1 index 70585a8b..48b95db9 100644 --- a/mysql-wsrep-5.6/man/mysqlcheck.1 +++ b/mysql-wsrep-5.6/man/mysqlcheck.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlcheck\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLCHECK\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLCHECK\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -321,7 +321,7 @@ This option is supported beginning with MySQL 5\&.6\&.1\&. .\} .\" mysqlcheck: character-sets-dir option .\" character-sets-dir option: mysqlcheck -\fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR +\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR .sp The directory where character sets are installed\&. See Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&. @@ -413,7 +413,7 @@ Compress all information sent between the client and the server if both support .sp Process all tables in the named databases\&. Normally, \fBmysqlcheck\fR -treats the first name argument on the command line as a database name and following names as table names\&. With this option, it treats all name arguments as database names\&. +treats the first name argument on the command line as a database name and any following names as table names\&. With this option, it treats all name arguments as database names\&. .sp This option may be used to dump the INFORMATION_SCHEMA @@ -588,7 +588,7 @@ If you are using this option to repair tables, it runs an extended repair that m .\" default-auth option: mysqlcheck \fB\-\-default\-auth=\fR\fB\fIplugin\fR\fR .sp -The client\-side authentication plugin to use\&. See +A hint about the client\-side authentication plugin to use\&. See Section\ \&6.3.7, \(lqPluggable Authentication\(rq\&. .sp This option was added in MySQL 5\&.6\&.2\&. @@ -602,6 +602,26 @@ This option was added in MySQL 5\&.6\&.2\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqlcheck: enable-cleartext-plugin option +.\" enable-cleartext-plugin option: mysqlcheck +\fB\-\-enable\-cleartext\-plugin\fR +.sp +Enable the +mysql_clear_password +cleartext authentication plugin\&. (See +Section\ \&6.4.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) +.sp +This option was added in MySQL 5\&.6\&.28\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlcheck: fast option .\" fast option: mysqlcheck \fB\-\-fast\fR, @@ -686,12 +706,9 @@ Connect to the MySQL server on the given host\&. .sp Read options from the named login path in the \&.mylogin\&.cnf -login file\&. A +login path file\&. A \(lqlogin path\(rq -is an option group that permits only a limited set of options: -\fBhost\fR, -\fBuser\fR, and -\fBpassword\fR\&. Think of a login path as a set of values that indicate the server host and the credentials for authenticating with the server\&. To create the login path file, use the +is an option group containing options that specify which MySQL server to connect to and which account to authenticate as\&. To create or modify a login path file, use the \fBmysql_config_editor\fR utility\&. See \fBmysql_config_editor\fR(1)\&. This option was added in MySQL 5\&.6\&.6\&. @@ -813,9 +830,9 @@ On Windows, connect to the server using a named pipe\&. This option applies only .\} .\" mysqlcheck: plugin-dir option .\" plugin-dir option: mysqlcheck -\fB\-\-plugin\-dir=\fR\fB\fIpath\fR\fR +\fB\-\-plugin\-dir=\fR\fB\fIdir_name\fR\fR .sp -The directory in which to look for plugins\&. It may be necessary to specify this option if the +The directory in which to look for plugins\&. Specify this option if the \fB\-\-default\-auth\fR option is used to specify an authentication plugin but \fBmysqlcheck\fR @@ -934,7 +951,7 @@ to disable it\&. This option was added in MySQL 5\&.6\&.17\&. .ps -1 .br Passwords that use the pre\-4\&.1 hashing method are less secure than passwords that use the native password hashing method and should be avoided\&. Pre\-4\&.1 passwords are deprecated and support for them will be removed in a future MySQL release\&. For account upgrade instructions, see -Section\ \&6.3.8.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&. +Section\ \&6.4.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&. .sp .5v .RE .RE @@ -1023,7 +1040,7 @@ localhost, the Unix socket file to use, or, on Windows, the name of the named pi Options that begin with \fB\-\-ssl\fR specify whether to connect to the server using SSL and indicate where to find SSL keys and certificates\&. See -Section\ \&6.3.10.4, \(lqSSL Command Options\(rq\&. +Section\ \&6.3.9.5, \(lqCommand Options for Secure Connections\(rq\&. .RE .sp .RS 4 @@ -1143,7 +1160,7 @@ when these statements should not be sent to replication slaves or run when using .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/mysqld.8 b/mysql-wsrep-5.6/man/mysqld.8 index 4913cd1d..39a26f7e 100644 --- a/mysql-wsrep-5.6/man/mysqld.8 +++ b/mysql-wsrep-5.6/man/mysqld.8 @@ -2,12 +2,12 @@ .\" Title: \fBmysqld\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLD\FR" "8" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLD\FR" "8" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -62,7 +62,7 @@ Chapter\ \&2, Installing and Upgrading MySQL\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/mysqld_multi.1 b/mysql-wsrep-5.6/man/mysqld_multi.1 index ce737a58..94b79a8d 100644 --- a/mysql-wsrep-5.6/man/mysqld_multi.1 +++ b/mysql-wsrep-5.6/man/mysqld_multi.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqld_multi\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLD_MULTI\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLD_MULTI\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -59,7 +59,7 @@ to specify which servers you want to start, stop, or obtain a status report for\ [mysqld] group used for starting \fBmysqld\fR\&. (See, for example, -Section\ \&2.10.1.2, \(lqStarting and Stopping MySQL Automatically\(rq\&.) However, when using multiple servers, it is necessary that each one use its own value for options such as the Unix socket file and TCP/IP port number\&. For more information on which options must be unique per server in a multiple\-server environment, see +Section\ \&2.10.5, \(lqStarting and Stopping MySQL Automatically\(rq\&.) However, when using multiple servers, it is necessary that each one use its own value for options such as the Unix socket file and TCP/IP port number\&. For more information on which options must be unique per server in a multiple\-server environment, see Section\ \&5.3, \(lqRunning Multiple MySQL Instances on One Machine\(rq\&. .PP To invoke @@ -529,8 +529,8 @@ account by executing the following commands for each server: .nf shell> \fBmysql \-u root \-S /tmp/mysql\&.sock \-p\fR Enter password: -mysql> \fBGRANT SHUTDOWN ON *\&.*\fR - \-> \fBTO \*(Aqmulti_admin\*(Aq@\*(Aqlocalhost\*(Aq IDENTIFIED BY \*(Aqmultipass\*(Aq;\fR +mysql> \fBCREATE USER \*(Aqmulti_admin\*(Aq@\*(Aqlocalhost\*(Aq IDENTIFIED BY \*(Aqmultipass\*(Aq;\fR +mysql> \fBGRANT SHUTDOWN ON *\&.* TO \*(Aqmulti_admin\*(Aq@\*(Aqlocalhost\*(Aq;\fR .fi .if n \{\ .RE @@ -644,42 +644,44 @@ in the option file\&. This gives you more flexibility\&. .RS 4 .\} .nf -# This file should probably be in your home dir (~/\&.my\&.cnf) -# or /etc/my\&.cnf -# Version 2\&.1 by Jani Tolonen +# This is an example of a my\&.cnf file for mysqld_multi\&. +# Usually this file is located in home dir ~/\&.my\&.cnf or /etc/my\&.cnf [mysqld_multi] -mysqld = /usr/local/bin/mysqld_safe -mysqladmin = /usr/local/bin/mysqladmin +mysqld = /usr/local/mysql/bin/mysqld_safe +mysqladmin = /usr/local/mysql/bin/mysqladmin user = multi_admin -password = multipass +password = my_password [mysqld2] socket = /tmp/mysql\&.sock2 port = 3307 -pid\-file = /usr/local/mysql/var2/hostname\&.pid2 -datadir = /usr/local/mysql/var2 -language = /usr/local/share/mysql/english -user = john +pid\-file = /usr/local/mysql/data2/hostname\&.pid2 +datadir = /usr/local/mysql/data2 +language = /usr/local/mysql/share/mysql/english +user = unix_user1 [mysqld3] +mysqld = /path/to/mysqld_safe +ledir = /path/to/mysqld\-binary/ +mysqladmin = /path/to/mysqladmin socket = /tmp/mysql\&.sock3 port = 3308 -pid\-file = /usr/local/mysql/var3/hostname\&.pid3 -datadir = /usr/local/mysql/var3 -language = /usr/local/share/mysql/swedish -user = monty +pid\-file = /usr/local/mysql/data3/hostname\&.pid3 +datadir = /usr/local/mysql/data3 +language = /usr/local/mysql/share/mysql/swedish +user = unix_user2 [mysqld4] socket = /tmp/mysql\&.sock4 port = 3309 -pid\-file = /usr/local/mysql/var4/hostname\&.pid4 -datadir = /usr/local/mysql/var4 -language = /usr/local/share/mysql/estonia -user = tonu +pid\-file = /usr/local/mysql/data4/hostname\&.pid4 +datadir = /usr/local/mysql/data4 +language = /usr/local/mysql/share/mysql/estonia +user = unix_user3 [mysqld6] socket = /tmp/mysql\&.sock6 port = 3311 -pid\-file = /usr/local/mysql/var6/hostname\&.pid6 -datadir = /usr/local/mysql/var6 -language = /usr/local/share/mysql/japanese -user = jani +pid\-file = /usr/local/mysql/data6/hostname\&.pid6 +datadir = /usr/local/mysql/data6 +language = /usr/local/mysql/share/mysql/japanese +user = unix_user4 .fi .if n \{\ .RE @@ -690,7 +692,7 @@ Section\ \&4.2.6, \(lqUsing Option Files\(rq\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/mysqld_safe.1 b/mysql-wsrep-5.6/man/mysqld_safe.1 index b0863bc3..93495090 100644 --- a/mysql-wsrep-5.6/man/mysqld_safe.1 +++ b/mysql-wsrep-5.6/man/mysqld_safe.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqld_safe\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLD_SAFE\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLD_SAFE\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -100,11 +100,8 @@ For backward compatibility, \fBmysqld_safe\fR also reads [safe_mysqld] -sections, although it is preferable to rename -[safe_mysqld] -sections to -[mysqld_safe] -sections\&. +sections, but to be current you should rename such sections to +[mysqld_safe]\&. .PP \fBmysqld_safe\fR supports the following options\&. It also reads option files and supports the options for processing them described at @@ -135,7 +132,7 @@ Display a help message and exit\&. .\} .\" mysqld_safe: basedir option .\" basedir option: mysqld_safe -\fB\-\-basedir=\fR\fB\fIpath\fR\fR +\fB\-\-basedir=\fR\fB\fIdir_name\fR\fR .sp The path to the MySQL installation directory\&. .RE @@ -168,7 +165,7 @@ should be able to create\&. The option value is passed to .\} .\" mysqld_safe: datadir option .\" datadir option: mysqld_safe -\fB\-\-datadir=\fR\fB\fIpath\fR\fR +\fB\-\-datadir=\fR\fB\fIdir_name\fR\fR .sp The path to the data directory\&. .RE @@ -183,7 +180,7 @@ The path to the data directory\&. .\} .\" mysqld_safe: defaults-extra-file option .\" defaults-extra-file option: mysqld_safe -\fB\-\-defaults\-extra\-file=\fR\fB\fIpath\fR\fR +\fB\-\-defaults\-extra\-file=\fR\fB\fIfile_name\fR\fR .sp The name of an option file to be read in addition to the usual option files\&. This must be the first option on the command line if it is used\&. If the file does not exist or is otherwise inaccessible, the server will exit with an error\&. .RE @@ -213,7 +210,7 @@ The name of an option file to be read instead of the usual option files\&. This .\} .\" mysqld_safe: ledir option .\" ledir option: mysqld_safe -\fB\-\-ledir=\fR\fB\fIpath\fR\fR +\fB\-\-ledir=\fR\fB\fIdir_name\fR\fR .sp If \fBmysqld_safe\fR @@ -247,7 +244,8 @@ Section\ \&5.2.2, \(lqThe Error Log\(rq\&. .\" mysqld_safe: malloc-lib option .\" mysqld option: malloc-lib \fB\-\-malloc\-lib=[\fR\fB\fIlib_name\fR\fR\fB]\fR -.sp +.\" memory allocation library +.\" tcmalloc: memory allocation library The name of the library to use for memory allocation instead of the system malloc() library\&. Any library can be used by specifying its path name, but there is a shortcut form to enable use of the @@ -408,7 +406,7 @@ option to indicate the path name to the directory where the server is located\&. .sp This option is similar to the \fB\-\-mysqld\fR -option, but you specify only the suffix for the server program name\&. The basename is assumed to be +option, but you specify only the suffix for the server program name\&. The base name is assumed to be \fBmysqld\fR\&. For example, if you use \fB\-\-mysqld\-version=debug\fR, \fBmysqld_safe\fR @@ -521,7 +519,7 @@ The path name of the process ID file\&. .\} .\" mysqld_safe: plugin-dir option .\" plugin-dir option: mysqld_safe -\fB\-\-plugin\-dir=\fR\fB\fIpath\fR\fR +\fB\-\-plugin\-dir=\fR\fB\fIdir_name\fR\fR .sp The path name of the plugin directory\&. .RE @@ -706,7 +704,7 @@ mysql> \fBmysqld_safe \-\-defaults\-file=\fR\fB\fIfile_name\fR\fR\fB \-\-port=\f The \fBmysqld_safe\fR script is written so that it normally can start a server that was installed from either a source or a binary distribution of MySQL, even though these types of distributions typically install the server in slightly different locations\&. (See -Section\ \&2.1.5, \(lqInstallation Layouts\(rq\&.) +Section\ \&2.1.4, \(lqInstallation Layouts\(rq\&.) \fBmysqld_safe\fR expects one of the following conditions to be true: .sp @@ -860,7 +858,7 @@ stderr\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/mysqldump.1 b/mysql-wsrep-5.6/man/mysqldump.1 index 74719081..84140c91 100644 --- a/mysql-wsrep-5.6/man/mysqldump.1 +++ b/mysql-wsrep-5.6/man/mysqldump.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqldump\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLDUMP\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLDUMP\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -41,10 +41,197 @@ mysqldump \- a database backup program .PP The \fBmysqldump\fR -client is a utility that performs -logical backups, producing a set of SQL statements that can be run to reproduce the original schema objects, table data, or both\&. It dumps one or more MySQL database for backup or transfer to another SQL server\&. The +client utility performs +logical backups, producing a set of SQL statements that can be executed to reproduce the original database object definitions and table data\&. It dumps one or more MySQL databases for backup or transfer to another SQL server\&. The \fBmysqldump\fR command can also generate output in CSV, other delimited text, or XML format\&. +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Performance and Scalability Considerations +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Invocation Syntax +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Option Syntax - Alphabetical Summary +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Connection Options +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Option-File Options +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +DDL Options +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Debug Options +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Help Options +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Internationalization Options +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Replication Options +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Format Options +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Filtering Options +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Performance Options +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Transactional Options +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Option Groups +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Examples +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +Restrictions +.RE .PP \fBmysqldump\fR requires at least the @@ -59,9 +246,9 @@ if the \fB\-\-single\-transaction\fR option is not used\&. Certain options might require other privileges as noted in the option descriptions\&. .PP -To reload a dump file, you must have the same privileges needed to create each of the dumped objects by issuing +To reload a dump file, you must have the privileges required to execute the statements that it contains, such as the appropriate CREATE -statements manually\&. +privileges for objects created by those statements\&. .PP \fBmysqldump\fR output can include @@ -69,6 +256,47 @@ ALTER DATABASE statements that change the database collation\&. These may be used when dumping stored programs to preserve their character encodings\&. To reload a dump file containing such statements, the ALTER privilege for the affected database is required\&. +.if n \{\ +.sp +.\} +.RS 4 +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 +\fBNote\fR +.ps -1 +.br +.PP +A dump made using PowerShell on Windows with output redirection creates a file that has UTF\-16 encoding: +.sp +.if n \{\ +.RS 4 +.\} +.nf +shell> \fBmysqldump [options] > dump\&.sql\fR +.fi +.if n \{\ +.RE +.\} +.PP +However, UTF\-16 is not permitted as a connection character set (see +Section\ \&10.1.4, \(lqConnection Character Sets and Collations\(rq), so the dump file will not load correctly\&. To work around this issue, use the +\fB\-\-result\-file\fR +option, which creates the output in ASCII format: +.sp +.if n \{\ +.RS 4 +.\} +.nf +shell> \fBmysqldump [options] \-\-result\-file=dump\&.sql\fR +.fi +.if n \{\ +.RE +.\} +.sp .5v +.RE Performance and Scalability Considerations.PP mysqldump advantages include the convenience and flexibility of viewing or even editing the output before restoring\&. You can clone databases for development and DBA work, or produce slight variations of an existing database for testing\&. It is not intended as a fast or scalable solution for backing up substantial amounts of data\&. With large data sizes, even if the backup step takes a reasonable time, restoring the data can be very slow because replaying the SQL statements involves disk I/O for insertion, index creation, and so on\&. @@ -98,7 +326,7 @@ InnoDB backups with minimal disruption; it can also back up tables from MyISAM and other storage engines; and it provides a number of convenient options to accommodate different backup scenarios\&. See -Section\ \&25.2, \(lqMySQL Enterprise Backup\(rq\&. +Section\ \&25.2, \(lqMySQL Enterprise Backup Overview\(rq\&. .RE .sp .RS 4 @@ -143,7 +371,7 @@ option\&. For additional information about \fBmysqldump\fR, see Section\ \&7.4, \(lqUsing mysqldump for Backups\(rq\&. -Syntax.PP +Invocation Syntax.PP There are in general three ways to use \fBmysqldump\fR\(emin order to dump a set of one or more tables, a set of one or more complete databases, or an entire MySQL server\(emas shown here: .sp @@ -228,7 +456,7 @@ Compress all information sent between the client and the server if both support .\" default-auth option: mysqldump \fB\-\-default\-auth=\fR\fB\fIplugin\fR\fR .sp -The client\-side authentication plugin to use\&. See +A hint about the client\-side authentication plugin to use\&. See Section\ \&6.3.7, \(lqPluggable Authentication\(rq\&. .RE .sp @@ -240,6 +468,26 @@ Section\ \&6.3.7, \(lqPluggable Authentication\(rq\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqldump: enable-cleartext-plugin option +.\" enable-cleartext-plugin option: mysqldump +\fB\-\-enable\-cleartext\-plugin\fR +.sp +Enable the +mysql_clear_password +cleartext authentication plugin\&. (See +Section\ \&6.4.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) +.sp +This option was added in MySQL 5\&.6\&.28\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqldump: host option .\" host option: mysqldump \fB\-\-host=\fR\fB\fIhost_name\fR\fR, @@ -263,12 +511,9 @@ localhost\&. .sp Read options from the named login path in the \&.mylogin\&.cnf -login file\&. A +login path file\&. A \(lqlogin path\(rq -is an option group that permits only a limited set of options: -\fBhost\fR, -\fBuser\fR, and -\fBpassword\fR\&. Think of a login path as a set of values that indicate the server host and the credentials for authenticating with the server\&. To create the login path file, use the +is an option group containing options that specify which MySQL server to connect to and which account to authenticate as\&. To create or modify a login path file, use the \fBmysql_config_editor\fR utility\&. See \fBmysql_config_editor\fR(1)\&. This option was added in MySQL 5\&.6\&.6\&. @@ -329,9 +574,9 @@ On Windows, connect to the server using a named pipe\&. This option applies only .\} .\" mysqldump: plugin-dir option .\" plugin-dir option: mysqldump -\fB\-\-plugin\-dir=\fR\fB\fIpath\fR\fR +\fB\-\-plugin\-dir=\fR\fB\fIdir_name\fR\fR .sp -The directory in which to look for plugins\&. It may be necessary to specify this option if the +The directory in which to look for plugins\&. Specify this option if the \fB\-\-default\-auth\fR option is used to specify an authentication plugin but \fBmysqldump\fR @@ -399,7 +644,7 @@ to disable it\&. This option was added in MySQL 5\&.6\&.17\&. .ps -1 .br Passwords that use the pre\-4\&.1 hashing method are less secure than passwords that use the native password hashing method and should be avoided\&. Pre\-4\&.1 passwords are deprecated and support for them will be removed in a future MySQL release\&. For account upgrade instructions, see -Section\ \&6.3.8.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&. +Section\ \&6.4.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&. .sp .5v .RE .RE @@ -436,7 +681,7 @@ localhost, the Unix socket file to use, or, on Windows, the name of the named pi Options that begin with \fB\-\-ssl\fR specify whether to connect to the server using SSL and indicate where to find SSL keys and certificates\&. See -Section\ \&6.3.10.4, \(lqSSL Command Options\(rq\&. +Section\ \&6.3.9.5, \(lqCommand Options for Secure Connections\(rq\&. .RE .sp .RS 4 @@ -492,9 +737,9 @@ option), \fBmysqldump\fR creates rows up to net_buffer_length -length\&. If you increase this variable, ensure that the +bytes long\&. If you increase this variable, ensure that the MySQL server net_buffer_length -variable in the MySQL server is at least this large\&. +system variable has a value at least this large\&. .RE Option\-File Options.PP These options are used to control which option files to read\&. @@ -621,7 +866,7 @@ include setting up an entire new MySQL instance (including database tables), and .\" add-drop-database option: mysqldump \fB\-\-add\-drop\-database\fR .sp -Add a +Write a DROP DATABASE statement before each CREATE DATABASE @@ -646,7 +891,7 @@ statements are written unless one of those options is specified\&. .\" add-drop-table option: mysqldump \fB\-\-add\-drop\-table\fR .sp -Add a +Write a DROP TABLE statement before each CREATE TABLE @@ -665,7 +910,7 @@ statement\&. .\" add-drop-trigger option: mysqldump \fB\-\-add\-drop\-trigger\fR .sp -Add a +Write a DROP TRIGGER statement before each CREATE TRIGGER @@ -704,7 +949,7 @@ table\&. This information is not otherwise included in the output from \fB\-\-no\-create\-db\fR, \fB\-n\fR .sp -This option suppresses the +Suppress the CREATE DATABASE statements that are otherwise included in the output if the \fB\-\-databases\fR @@ -728,7 +973,7 @@ option is given\&. .sp Do not write CREATE TABLE -statements that re\-create each dumped table\&. +statements that create each dumped table\&. .if n \{\ .sp .\} @@ -743,7 +988,7 @@ statements that re\-create each dumped table\&. .br This option does \fInot\fR -not exclude statements creating log file groups or tablespaces from +exclude statements creating log file groups or tablespaces from \fBmysqldump\fR output; however, you can use the \fB\-\-no\-tablespaces\fR @@ -1039,7 +1284,7 @@ command represents character data with national language settings\&. .\} .\" mysqldump: character-sets-dir option .\" character-sets-dir option: mysqldump -\fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR +\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR .sp The directory where character sets are installed\&. See Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&. @@ -1097,7 +1342,7 @@ setting, the same as specifying .\" set-charset option: mysqldump \fB\-\-set\-charset\fR .sp -Add +Write SET NAMES \fIdefault_character_set\fR to the output\&. This option is enabled by default\&. To suppress the SET NAMES @@ -1275,7 +1520,7 @@ Section\ \&17.2.2, \(lqReplication Relay and Status Logs\(rq)\&. .sp This option enables control over global transaction ID (GTID) information written to the dump file, by indicating whether to add a SET @@global\&.gtid_purged -statement to the output\&. +statement to the output\&. This option may also cause a statement to be written to the output that disables binary logging while the dump file is being reloaded\&. .sp The following table shows the permitted option values\&. The default value is AUTO\&. @@ -1310,6 +1555,52 @@ Add a SET statement to the output if GTIDs are T} .TE .sp 1 +The +\fB\-\-set\-gtid\-purged\fR +option has the following effect on binary logging when the dump file is reloaded: +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-\-set\-gtid\-purged=OFF\fR: +SET @@SESSION\&.SQL_LOG_BIN=0; +is not added to the output\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-\-set\-gtid\-purged=ON\fR: +SET @@SESSION\&.SQL_LOG_BIN=0; +is added to the output\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +\fB\-\-set\-gtid\-purged=AUTO\fR: +SET @@SESSION\&.SQL_LOG_BIN=0; +is added to the output if GTIDs are enabled on the server you are backing up (that is, if +AUTO +evaluates to +ON)\&. +.RE +.sp This option was added in MySQL 5\&.6\&.9\&. .RE Format Options.PP @@ -1519,11 +1810,13 @@ that may enable \fB\-\-result\-file=\fR\fB\fIfile_name\fR\fR, \fB\-r \fR\fB\fIfile_name\fR\fR .sp -Direct output to a given file\&. This option should be used on Windows to prevent newline +Direct output to the named file\&. The result file is created and its previous contents overwritten, even if an error occurs while generating the dump\&. +.sp +This option should be used on Windows to prevent newline \(lq\en\(rq characters from being converted to \(lq\er\en\(rq -carriage return/newline sequences\&. The result file is created and its previous contents overwritten, even if an error occurs while generating the dump\&. +carriage return/newline sequences\&. .RE .sp .RS 4 @@ -1536,8 +1829,8 @@ carriage return/newline sequences\&. The result file is created and its previous .\} .\" mysqldump: tab option .\" tab option: mysqldump -\fB\-\-tab=\fR\fB\fIpath\fR\fR, -\fB\-T \fR\fB\fIpath\fR\fR +\fB\-\-tab=\fR\fB\fIdir_name\fR\fR, +\fB\-T \fR\fB\fIdir_name\fR\fR .sp Produce tab\-separated text\-format data files\&. For each dumped table, \fBmysqldump\fR @@ -1564,9 +1857,15 @@ This option should be used only when \fBmysqldump\fR is run on the same machine as the \fBmysqld\fR -server\&. You must have the +server\&. Because the server creates files +*\&.txt +file in the directory that you specify, the directory must be writable by the server and the MySQL account that you use must have the FILE -privilege, and the server must have permission to write files in the directory that you specify\&. +privilege\&. Because +\fBmysqldump\fR +creates +*\&.sql +in the same directory, it must be writable by your system login account\&. .sp .5v .RE By default, the @@ -1786,7 +2085,22 @@ statements are included in the output before each new database\&. \fB\-\-events\fR, \fB\-E\fR .sp -Include Event Scheduler events for the dumped databases in the output\&. +Include Event Scheduler events for the dumped databases in the output\&. This option requires the +EVENT +privileges for those databases\&. +.sp +The output generated by using +\fB\-\-events\fR +contains +CREATE EVENT +statements to create the events\&. However, these statements do not include attributes such as the event creation and modification timestamps, so when the events are reloaded, they are created with timestamps equal to the reload time\&. +.sp +If you require events to be created with their original timestamp attributes, do not use +\fB\-\-events\fR\&. Instead, dump and reload the contents of the +mysql\&.event +table directly, using a MySQL account that has appropriate privileges for the +mysql +database\&. .RE .sp .RS 4 @@ -1839,15 +2153,17 @@ Include stored routines (procedures and functions) for the dumped databases in t SELECT privilege for the mysql\&.proc -table\&. The output generated by using +table\&. +.sp +The output generated by using \fB\-\-routines\fR contains CREATE PROCEDURE and CREATE FUNCTION -statements to re\-create the routines\&. However, these statements do not include attributes such as the routine creation and modification timestamps\&. This means that when the routines are reloaded, they will be created with the timestamps equal to the reload time\&. +statements to create the routines\&. However, these statements do not include attributes such as the routine creation and modification timestamps, so when the routines are reloaded, they are created with timestamps equal to the reload time\&. .sp -If you require routines to be re\-created with their original timestamp attributes, do not use +If you require routines to be created with their original timestamp attributes, do not use \fB\-\-routines\fR\&. Instead, dump and reload the contents of the mysql\&.proc table directly, using a MySQL account that has appropriate privileges for the @@ -2001,9 +2317,9 @@ tables\&. \fB\-\-extended\-insert\fR, \fB\-e\fR .sp -Use multiple\-row +Write INSERT -syntax that include several +statements using multiple\-row syntax that includes several VALUES lists\&. This results in a smaller dump file and speeds up inserts when the file is reloaded\&. .RE @@ -2563,10 +2879,10 @@ does not dump the INFORMATION_SCHEMA or performance_schema -database by default\&. To dump either of these, name it explicitly on the command line and also use the -\fB\-\-skip\-lock\-tables\fR -option\&. You can also name them with the +database by default\&. To dump either of these, name it explicitly on the command line\&. You can also name it with the \fB\-\-databases\fR +option\&. Also, use the +\fB\-\-skip\-lock\-tables\fR option\&. .PP \fBmysqldump\fR @@ -2585,12 +2901,12 @@ mysql database\&. As of 5\&.6\&.6, the dump includes statements to recreate those tables so that they are not missing after reloading the dump file\&. Log table contents are not dumped\&. .PP If you encounter problems backing up views due to insufficient privileges, see -Section\ \&D.5, \(lqRestrictions on Views\(rq +Section\ \&C.5, \(lqRestrictions on Views\(rq for a workaround\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/mysqldumpslow.1 b/mysql-wsrep-5.6/man/mysqldumpslow.1 index 4f7fc912..8a8451f4 100644 --- a/mysql-wsrep-5.6/man/mysqldumpslow.1 +++ b/mysql-wsrep-5.6/man/mysqldumpslow.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqldumpslow\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLDUMPSLOW\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLDUMPSLOW\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -323,7 +323,7 @@ Count: 3 Time=2\&.13s (6s) Lock=0\&.00s (0s) Rows=0\&.0 (0), root[root]@local .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/mysqlhotcopy.1 b/mysql-wsrep-5.6/man/mysqlhotcopy.1 index 9e585051..8d7114c0 100644 --- a/mysql-wsrep-5.6/man/mysqlhotcopy.1 +++ b/mysql-wsrep-5.6/man/mysqlhotcopy.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlhotcopy\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLHOTCOPY\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLHOTCOPY\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -208,14 +208,14 @@ and table .\} .\" mysqlhotcopy: chroot option .\" chroot option: mysqlhotcopy -\fB\-\-chroot=\fR\fB\fIpath\fR\fR +\fB\-\-chroot=\fR\fB\fIdir_name\fR\fR .sp Base directory of the \fBchroot\fR jail in which \fBmysqld\fR operates\&. The -\fIpath\fR +\fIdir_name\fR value should match that of the \fB\-\-chroot\fR option given to @@ -514,7 +514,7 @@ The suffix to use for names of copied databases\&. .\} .\" mysqlhotcopy: tmpdir option .\" tmpdir option: mysqlhotcopy -\fB\-\-tmpdir=\fR\fB\fIpath\fR\fR +\fB\-\-tmpdir=\fR\fB\fIdir_name\fR\fR .sp The temporary directory\&. The default is /tmp\&. @@ -558,7 +558,7 @@ shell> \fBperldoc mysqlhotcopy\fR .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/mysqlimport.1 b/mysql-wsrep-5.6/man/mysqlimport.1 index a42b7050..07bbb54c 100644 --- a/mysql-wsrep-5.6/man/mysqlimport.1 +++ b/mysql-wsrep-5.6/man/mysqlimport.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlimport\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLIMPORT\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLIMPORT\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -124,7 +124,7 @@ This option is supported beginning with MySQL 5\&.6\&.1\&. .\} .\" mysqlimport: character-sets-dir option .\" character-sets-dir option: mysqlimport -\fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR +\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR .sp The directory where character sets are installed\&. See Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&. @@ -242,7 +242,7 @@ Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&. .\" default-auth option: mysqlimport \fB\-\-default\-auth=\fR\fB\fIplugin\fR\fR .sp -The client\-side authentication plugin to use\&. See +A hint about the client\-side authentication plugin to use\&. See Section\ \&6.3.7, \(lqPluggable Authentication\(rq\&. .sp This option was added in MySQL 5\&.6\&.2\&. @@ -336,6 +336,26 @@ Empty the table before importing the text file\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqlimport: enable-cleartext-plugin option +.\" enable-cleartext-plugin option: mysqlimport +\fB\-\-enable\-cleartext\-plugin\fR +.sp +Enable the +mysql_clear_password +cleartext authentication plugin\&. (See +Section\ \&6.4.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) +.sp +This option was added in MySQL 5\&.6\&.28\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqldump: fields-terminated-by option .\" fields-terminated-by option: mysqldump \fB\-\-fields\-terminated\-by=\&.\&.\&.\fR, @@ -491,12 +511,9 @@ tables for writing before processing any text files\&. This ensures that all tab .sp Read options from the named login path in the \&.mylogin\&.cnf -login file\&. A +login path file\&. A \(lqlogin path\(rq -is an option group that permits only a limited set of options: -\fBhost\fR, -\fBuser\fR, and -\fBpassword\fR\&. Think of a login path as a set of values that indicate the server host and the credentials for authenticating with the server\&. To create the login path file, use the +is an option group containing options that specify which MySQL server to connect to and which account to authenticate as\&. To create or modify a login path file, use the \fBmysql_config_editor\fR utility\&. See \fBmysql_config_editor\fR(1)\&. This option was added in MySQL 5\&.6\&.6\&. @@ -604,9 +621,9 @@ On Windows, connect to the server using a named pipe\&. This option applies only .\} .\" mysqlimport: plugin-dir option .\" plugin-dir option: mysqlimport -\fB\-\-plugin\-dir=\fR\fB\fIpath\fR\fR +\fB\-\-plugin\-dir=\fR\fB\fIdir_name\fR\fR .sp -The directory in which to look for plugins\&. It may be necessary to specify this option if the +The directory in which to look for plugins\&. Specify this option if the \fB\-\-default\-auth\fR option is used to specify an authentication plugin but \fBmysqlimport\fR @@ -713,7 +730,7 @@ to disable it\&. This option was added in MySQL 5\&.6\&.17\&. .ps -1 .br Passwords that use the pre\-4\&.1 hashing method are less secure than passwords that use the native password hashing method and should be avoided\&. Pre\-4\&.1 passwords are deprecated and support for them will be removed in a future MySQL release\&. For account upgrade instructions, see -Section\ \&6.3.8.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&. +Section\ \&6.4.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&. .sp .5v .RE .RE @@ -786,7 +803,7 @@ localhost, the Unix socket file to use, or, on Windows, the name of the named pi Options that begin with \fB\-\-ssl\fR specify whether to connect to the server using SSL and indicate where to find SSL keys and certificates\&. See -Section\ \&6.3.10.4, \(lqSSL Command Options\(rq\&. +Section\ \&6.3.9.5, \(lqCommand Options for Secure Connections\(rq\&. .RE .sp .RS 4 @@ -890,7 +907,7 @@ shell> \fBmysql \-e \*(AqSELECT * FROM imptest\*(Aq test\fR .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/mysqlshow.1 b/mysql-wsrep-5.6/man/mysqlshow.1 index b4943488..fad8568e 100644 --- a/mysql-wsrep-5.6/man/mysqlshow.1 +++ b/mysql-wsrep-5.6/man/mysqlshow.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlshow\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLSHOW\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLSHOW\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -171,7 +171,7 @@ This option is supported beginning with MySQL 5\&.6\&.1\&. .\} .\" mysqlshow: character-sets-dir option .\" character-sets-dir option: mysqlshow -\fB\-\-character\-sets\-dir=\fR\fB\fIpath\fR\fR +\fB\-\-character\-sets\-dir=\fR\fB\fIdir_name\fR\fR .sp The directory where character sets are installed\&. See Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&. @@ -289,7 +289,7 @@ Section\ \&10.5, \(lqCharacter Set Configuration\(rq\&. .\" default-auth option: mysqlshow \fB\-\-default\-auth=\fR\fB\fIplugin\fR\fR .sp -The client\-side authentication plugin to use\&. See +A hint about the client\-side authentication plugin to use\&. See Section\ \&6.3.7, \(lqPluggable Authentication\(rq\&. .sp This option was added in MySQL 5\&.6\&.2\&. @@ -367,6 +367,26 @@ groups\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqlshow: enable-cleartext-plugin option +.\" enable-cleartext-plugin option: mysqlshow +\fB\-\-enable\-cleartext\-plugin\fR +.sp +Enable the +mysql_clear_password +cleartext authentication plugin\&. (See +Section\ \&6.4.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) +.sp +This option was added in MySQL 5\&.6\&.28\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqlshow: host option .\" host option: mysqlshow \fB\-\-host=\fR\fB\fIhost_name\fR\fR, @@ -405,12 +425,9 @@ Show table indexes\&. .sp Read options from the named login path in the \&.mylogin\&.cnf -login file\&. A +login path file\&. A \(lqlogin path\(rq -is an option group that permits only a limited set of options: -\fBhost\fR, -\fBuser\fR, and -\fBpassword\fR\&. Think of a login path as a set of values that indicate the server host and the credentials for authenticating with the server\&. To create the login path file, use the +is an option group containing options that specify which MySQL server to connect to and which account to authenticate as\&. To create or modify a login path file, use the \fBmysql_config_editor\fR utility\&. See \fBmysql_config_editor\fR(1)\&. This option was added in MySQL 5\&.6\&.6\&. @@ -498,9 +515,9 @@ On Windows, connect to the server using a named pipe\&. This option applies only .\} .\" mysqlshow: plugin-dir option .\" plugin-dir option: mysqlshow -\fB\-\-plugin\-dir=\fR\fB\fIpath\fR\fR +\fB\-\-plugin\-dir=\fR\fB\fIdir_name\fR\fR .sp -The directory in which to look for plugins\&. It may be necessary to specify this option if the +The directory in which to look for plugins\&. Specify this option if the \fB\-\-default\-auth\fR option is used to specify an authentication plugin but \fBmysqlshow\fR @@ -585,7 +602,7 @@ to disable it\&. This option was added in MySQL 5\&.6\&.17\&. .ps -1 .br Passwords that use the pre\-4\&.1 hashing method are less secure than passwords that use the native password hashing method and should be avoided\&. Pre\-4\&.1 passwords are deprecated and support for them will be removed in a future MySQL release\&. For account upgrade instructions, see -Section\ \&6.3.8.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&. +Section\ \&6.4.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&. .sp .5v .RE .RE @@ -662,7 +679,7 @@ localhost, the Unix socket file to use, or, on Windows, the name of the named pi Options that begin with \fB\-\-ssl\fR specify whether to connect to the server using SSL and indicate where to find SSL keys and certificates\&. See -Section\ \&6.3.10.4, \(lqSSL Command Options\(rq\&. +Section\ \&6.3.9.5, \(lqCommand Options for Secure Connections\(rq\&. .RE .sp .RS 4 @@ -731,7 +748,7 @@ Display version information and exit\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/mysqlslap.1 b/mysql-wsrep-5.6/man/mysqlslap.1 index 496a230e..1a12182f 100644 --- a/mysql-wsrep-5.6/man/mysqlslap.1 +++ b/mysql-wsrep-5.6/man/mysqlslap.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqlslap\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBMYSQLSLAP\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBMYSQLSLAP\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -511,7 +511,7 @@ Print debugging information and memory and CPU usage statistics when the program .\" default-auth option: mysqlslap \fB\-\-default\-auth=\fR\fB\fIplugin\fR\fR .sp -The client\-side authentication plugin to use\&. See +A hint about the client\-side authentication plugin to use\&. See Section\ \&6.3.7, \(lqPluggable Authentication\(rq\&. .sp This option was added in MySQL 5\&.6\&.2\&. @@ -629,7 +629,7 @@ statements\&. The default is 0 (connections are not detached)\&. Enable the mysql_clear_password cleartext authentication plugin\&. (See -Section\ \&6.3.8.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) This option was added in MySQL 5\&.6\&.7\&. +Section\ \&6.4.1.7, \(lqThe Cleartext Client-Side Authentication Plugin\(rq\&.) This option was added in MySQL 5\&.6\&.7\&. .RE .sp .RS 4 @@ -694,12 +694,9 @@ The number of times to run the tests\&. .sp Read options from the named login path in the \&.mylogin\&.cnf -login file\&. A +login path file\&. A \(lqlogin path\(rq -is an option group that permits only a limited set of options: -\fBhost\fR, -\fBuser\fR, and -\fBpassword\fR\&. Think of a login path as a set of values that indicate the server host and the credentials for authenticating with the server\&. To create the login path file, use the +is an option group containing options that specify which MySQL server to connect to and which account to authenticate as\&. To create or modify a login path file, use the \fBmysql_config_editor\fR utility\&. See \fBmysql_config_editor\fR(1)\&. This option was added in MySQL 5\&.6\&.6\&. @@ -891,9 +888,9 @@ On Windows, connect to the server using a named pipe\&. This option applies only .\} .\" mysqlslap: plugin-dir option .\" plugin-dir option: mysqlslap -\fB\-\-plugin\-dir=\fR\fB\fIpath\fR\fR +\fB\-\-plugin\-dir=\fR\fB\fIdir_name\fR\fR .sp -The directory in which to look for plugins\&. It may be necessary to specify this option if the +The directory in which to look for plugins\&. Specify this option if the \fB\-\-default\-auth\fR option is used to specify an authentication plugin but \fBmysqlslap\fR @@ -1060,7 +1057,7 @@ to disable it\&. This option was added in MySQL 5\&.6\&.17\&. .ps -1 .br Passwords that use the pre\-4\&.1 hashing method are less secure than passwords that use the native password hashing method and should be avoided\&. Pre\-4\&.1 passwords are deprecated and support for them will be removed in a future MySQL release\&. For account upgrade instructions, see -Section\ \&6.3.8.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&. +Section\ \&6.4.1.3, \(lqMigrating Away from Pre-4.1 Password Hashing and the mysql_old_password Plugin\(rq\&. .sp .5v .RE .RE @@ -1128,7 +1125,7 @@ localhost, the Unix socket file to use, or, on Windows, the name of the named pi Options that begin with \fB\-\-ssl\fR specify whether to connect to the server using SSL and indicate where to find SSL keys and certificates\&. See -Section\ \&6.3.10.4, \(lqSSL Command Options\(rq\&. +Section\ \&6.3.9.5, \(lqCommand Options for Secure Connections\(rq\&. .RE .sp .RS 4 @@ -1181,7 +1178,7 @@ Display version information and exit\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/mysqltest.1 b/mysql-wsrep-5.6/man/mysqltest.1 index 98def1e5..b4eb9676 100644 --- a/mysql-wsrep-5.6/man/mysqltest.1 +++ b/mysql-wsrep-5.6/man/mysqltest.1 @@ -2,12 +2,12 @@ .\" Title: \fBmysqltest\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/15/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL .\" Language: English .\" -.TH "\FBMYSQLTEST\FR" "1" "01/15/2015" "MySQL" "MySQL Database System" +.TH "\FBMYSQLTEST\FR" "1" "03/02/2016" "MySQL" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -295,6 +295,23 @@ Print debugging information and memory and CPU usage statistics when the program .sp -1 .IP \(bu 2.3 .\} +.\" mysqltest: explain-protocol option +.\" explain-protocol option: mysqltest +\fB\-\-explain\-protocol\fR, +.sp +Run +EXPLAIN EXTENDED +on all SELECT, INSERT, REPLACE, UPDATE and DELETE queries\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqltest: host option .\" host option: mysqltest \fB\-\-host=\fR\fB\fIhost_name\fR\fR, @@ -331,6 +348,25 @@ command as the first line of the test file\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqltest: json-explain-protocol option +.\" json-explain-protocol option: mysqltest +\fB\-\-json\-explain\-protocol\fR, +.sp +Run +EXPLAIN FORMAT=JSON +on all SELECT, INSERT, REPLACE, UPDATE and DELETE queries\&. The +json\-explain\-protocol +option is available from MySQL 5\&.6\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqltest: logdir option .\" logdir option: mysqltest \fB\-\-logdir=\fR\fB\fIdir_name\fR\fR @@ -382,8 +418,6 @@ The maximum number of connection attempts when connecting to server\&. \fB\-\-max\-connections=\fR\fB\fInum\fR\fR .sp The maximum number of simultaneous server connections per client (that is, per test)\&. If not set, the maximum is 128\&. Minimum allowed limit is 8, maximum is 5120\&. -.sp -This option is available from MySQL 5\&.1\&.45\&. .RE .sp .RS 4 @@ -480,7 +514,7 @@ is default\&. .sp The \fB\-\-protocol\fR -option is available from MySQL 5\&.1\&.51\&. It is ignored if running with the embedded server\&. +option is ignored if running with the embedded server\&. .RE .sp .RS 4 @@ -737,7 +771,7 @@ seconds\&. This option does not affect real_sleep commands\&. .sp -As of MySQL 5\&.0\&.23, an option value of 0 can be used, which effectively disables +An option value of 0 can also be used, which effectively disables sleep commands in the test case\&. .RE @@ -834,6 +868,23 @@ for its reporting\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqltest: tls-version option +.\" tls-version option: mysqltest +\fB\-\-tls\-version=\fR\fB\fIprotocol_list\fR\fR +.sp +The protocols permitted by the client for encrypted connections\&. The value is a comma\-separated list containing one or more of these protocols: TLSv1, TLSv1\&.1, TLSv1\&.2\&. (TLSv1\&.2 is supported only if MySQL was compiled using OpenSSL 1\&.0\&.1 or higher\&. It is not supported if MySQL was compiled using yaSSL\&.) +.sp +This option was added in MySQL 5\&.7\&.10\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqltest: tmpdir option .\" tmpdir option: mysqltest \fB\-\-tmpdir=\fR\fB\fIdir_name\fR\fR, @@ -850,6 +901,26 @@ The temporary directory where socket files are created\&. .sp -1 .IP \(bu 2.3 .\} +.\" mysqltest: trace-exec option +.\" trace-exec option: mysqltest +\fB\-\-trace\-exec\fR +.sp +If enabled, this option causes +\fBmysqltest\fR +to immediately display the output from executed programs to +stdout\&. +.sp +This option was added in MySQL 5\&.8\&.0\&. +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} .\" mysqltest: user option .\" user option: mysqltest \fB\-\-user=\fR\fB\fIuser_name\fR\fR, @@ -904,12 +975,12 @@ Display version information and exit\&. .sp Every SELECT -statement is wrapped inside a view\&. This option was added in MySQL 5\&.0\&.19\&. +statement is wrapped inside a view\&. .RE .SH "COPYRIGHT" .br .PP -Copyright \(co 2006, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 2006, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/ndb-common-options.1 b/mysql-wsrep-5.6/man/ndb-common-options.1 deleted file mode 100644 index e21c2c34..00000000 --- a/mysql-wsrep-5.6/man/ndb-common-options.1 +++ /dev/null @@ -1,603 +0,0 @@ -'\" t -.\" Title: Options Common to MySQL Cluster Programs -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.6 -.\" Language: English -.\" -.TH "OPTIONS COMMON TO MY" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.\" MySQL Cluster: administration -.\" command-line options (MySQL Cluster) -.\" program options (MySQL Cluster) -.\" MySQL Cluster: ndbd -.\" MySQL Cluster: mgm -.\" MySQL Cluster: mgmd -.SH "NAME" -ndb-common-options \- MySQL Cluster Common Program Options -.SH "DESCRIPTION" -.PP -All MySQL Cluster programs accept the options described in this section, with the following exceptions: -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -\fBmysqld\fR -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -\fBndb_print_backup_file\fR -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -\fBndb_print_schema_file\fR -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -\fBndb_print_sys_file\fR -.RE -.PP -Users of earlier MySQL Cluster versions should note that some of these options have been changed to make them consistent with one another as well as with -\fBmysqld\fR\&. You can use the -\fB\-\-help\fR -option with any MySQL Cluster program\(emwith the exception of -\fBndb_print_backup_file\fR, -\fBndb_print_schema_file\fR, and -\fBndb_print_sys_file\fR\(emto view a list of the options which the program supports\&. -.PP -The options in the following table are common to all MySQL Cluster executables (except those noted previously in this section)\&. -.sp -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.B Table\ \&18.98.\ \& This table describes command-line options common to all MySQL Cluster programs -.TS -allbox tab(:); -lB lB lB. -T{ -Format -T}:T{ -Description -T}:T{ -Added or Removed -T} -.T& -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l. -T{ -.PP ---help, -.PP ---usage, -.PP --? -T}:T{ -Display help message and exit -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---ndb-connectstring=connectstring, -.PP ---connect-string=connectstring, -.PP --c -T}:T{ -Set connection string for connecting to ndb_mgmd. Syntax: - [nodeid=;][host=][:]. - Overrides entries specified in NDB_CONNECTSTRING or my.cnf. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---ndb-mgmd-host=host[:port] -T}:T{ -Set the host (and port, if desired) for connecting to management - server -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---ndb-nodeid=# -T}:T{ -Set node id for this node -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---ndb-optimized-node-selection -T}:T{ -Select nodes for transactions in a more optimal way -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---character-sets-dir=path -T}:T{ -Directory where character sets are installed -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---debug=options -T}:T{ -Enable output from debug calls. Can be used only for versions - compiled with debugging enabled -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---core-file -T}:T{ -Write core on errors (defaults to TRUE in debug builds) -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---version, -.PP --V -T}:T{ -Output version information and exit -T}:T{ -.PP -All MySQL 5.6 based releases -T} -.TE -.sp 1 -.PP -For options specific to individual MySQL Cluster programs, see -Section\ \&18.4, \(lqMySQL Cluster Programs\(rq\&. -.PP -See -Section\ \&18.3.4.2, \(lqMySQL Server Options for MySQL Cluster\(rq, for -\fBmysqld\fR -options relating to MySQL Cluster\&. -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" help option (MySQL Cluster programs) -.\" usage option (MySQL Cluster programs) -.\" -? option (MySQL Cluster programs) -\fB\-\-help\fR, -\fB\-\-usage\fR, -\fB\-?\fR -.TS -allbox tab(:); -l l s s -l l s s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-help -T} -T{ -\ \& -T}:T{ -\-\-usage -T} -.TE -.sp 1 -Prints a short list with descriptions of the available command options\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" character-sets-dir option (MySQL Cluster programs) -.\" character-sets-dir option (MySQL Cluster programs) -\fB\-\-character\-sets\-dir=\fR\fB\fIname\fR\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-character\-sets\-dir=path -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -file name -T} -:T{ -\fBDefault\fR -T}:T{ -T} -.TE -.sp 1 -Tells the program where to find character set information\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb-connectstring option (MySQL Cluster programs) -.\" connect-string option (MySQL Cluster programs) -.\" -c option (MySQL Cluster programs) -\fB\-\-ndb\-connectstring=\fR\fB\fIconnect_string\fR\fR, -\fB\-\-connect\-string=\fR\fB\fIconnect_string\fR\fR, -\fB\-c \fR\fB\fIconnect_string\fR\fR -.TS -allbox tab(:); -l l s s -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-ndb\-connectstring=connectstring -T} -T{ -\ \& -T}:T{ -\-\-connect\-string=connectstring -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -string -T} -:T{ -\fBDefault\fR -T}:T{ -localhost:1186 -T} -.TE -.sp 1 -This option takes a MySQL Cluster connection string that specifies the management server for the application to connect to, as shown here: -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fBndbd \-\-ndb\-connectstring="nodeid=2;host=ndb_mgmd\&.mysql\&.com:1186"\fR -.fi -.if n \{\ -.RE -.\} -.sp -For more information, see -Section\ \&18.3.2.3, \(lqMySQL Cluster Connection Strings\(rq\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" core-file option (MySQL Cluster programs) -\fB\-\-core\-file\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-core\-file -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -FALSE -T} -.TE -.sp 1 -Write a core file if the program dies\&. The name and location of the core file are system\-dependent\&. (For MySQL Cluster programs nodes running on Linux, the default location is the program\*(Aqs working directory\(emfor a data node, this is the node\*(Aqs -DataDir\&.) For some systems, there may be restrictions or limitations; for example, it might be necessary to execute -\fBulimit \-c unlimited\fR -before starting the server\&. Consult your system documentation for detailed information\&. -.sp -If MySQL Cluster was built using the -\fB\-\-debug\fR -option for -\fBconfigure\fR, then -\fB\-\-core\-file\fR -is enabled by default\&. For regular builds, -\fB\-\-core\-file\fR -is disabled by default\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" debug option (MySQL Cluster programs) -\fB\-\-debug[=\fR\fB\fIoptions\fR\fR\fB]\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-debug=options -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -string -T} -:T{ -\fBDefault\fR -T}:T{ -d:t:O,/tmp/ndb_restore\&.trace -T} -.TE -.sp 1 -This option can be used only for versions compiled with debugging enabled\&. It is used to enable output from debug calls in the same manner as for the -\fBmysqld\fR -process\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb-mgmd-host option (MySQL Cluster programs) -\fB\-\-ndb\-mgmd\-host=\fR\fB\fIhost\fR\fR\fB[:\fR\fB\fIport\fR\fR\fB]\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-ndb\-mgmd\-host=host[:port] -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -string -T} -:T{ -\fBDefault\fR -T}:T{ -localhost:1186 -T} -.TE -.sp 1 -Can be used to set the host and port number of a single management server for the program to connect to\&. If the program requires node IDs or references to multiple management servers (or both) in its connection information, use the -\fB\-\-ndb\-connectstring\fR -option instead\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb-nodeid option (MySQL Cluster programs) -\fB\-\-ndb\-nodeid=\fR\fB\fI#\fR\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-ndb\-nodeid=# -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -numeric -T} -:T{ -\fBDefault\fR -T}:T{ -0 -T} -.TE -.sp 1 -Sets this node\*(Aqs MySQL Cluster node ID\&. -\fIThe range of permitted values depends on the node\*(Aqs type (data, management, or API) and the MySQL Cluster software version\fR\&. See -Section\ \&18.1.6.2, \(lqLimits and Differences of MySQL Cluster from Standard MySQL Limits\(rq, for more information\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb-optimized-node-selection option (MySQL Cluster) -\fB\-\-ndb\-optimized\-node\-selection\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-ndb\-optimized\-node\-selection -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -TRUE -T} -.TE -.sp 1 -Optimize selection of nodes for transactions\&. Enabled by default\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" version option (MySQL Cluster programs) -.\" -V option (MySQL Cluster programs) -\fB\-\-version\fR, -\fB\-V\fR -.TS -allbox tab(:); -l l s s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-version -T} -.TE -.sp 1 -Prints the MySQL Cluster version number of the executable\&. The version number is relevant because not all versions can be used together, and the MySQL Cluster startup process verifies that the versions of the binaries being used can co\-exist in the same cluster\&. This is also important when performing an online (rolling) software upgrade or downgrade of MySQL Cluster\&. -.sp -See -Section\ \&18.5.5, \(lqPerforming a Rolling Restart of a MySQL Cluster\(rq), for more information\&. -.RE -.SH "COPYRIGHT" -.br -.PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. -.PP -This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. -.PP -This documentation 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. -.PP -You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. -.sp -.SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. -.SH AUTHOR -Oracle Corporation (http://dev.mysql.com/). diff --git a/mysql-wsrep-5.6/man/ndb_blob_tool.1 b/mysql-wsrep-5.6/man/ndb_blob_tool.1 deleted file mode 100644 index 13a702d5..00000000 --- a/mysql-wsrep-5.6/man/ndb_blob_tool.1 +++ /dev/null @@ -1,466 +0,0 @@ -'\" t -.\" Title: \fBndb_blob_tool\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.6 -.\" Language: English -.\" -.TH "\FBNDB_BLOB_TOOL\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.\" ndb_blob_tool -.SH "NAME" -ndb_blob_tool \- check and repair BLOB and TEXT columns of MySQL Cluster tables -.SH "SYNOPSIS" -.HP \w'\fBndb_blob_tool\ \fR\fB\fIoptions\fR\fR\fB\ \fR\fB\fItable\fR\fR\fB\ [\fR\fB\fIcolumn\fR\fR\fB,\ \&.\&.\&.]\fR\ 'u -\fBndb_blob_tool \fR\fB\fIoptions\fR\fR\fB \fR\fB\fItable\fR\fR\fB [\fR\fB\fIcolumn\fR\fR\fB, \&.\&.\&.]\fR -.SH "DESCRIPTION" -.PP -This tool can be used to check for and remove orphaned BLOB column parts from -NDB -tables, as well as to generate a file listing any orphaned parts\&. It is sometimes useful in diagnosing and repairing corrupted or damaged -NDB -tables containing -BLOB -or -TEXT -columns\&. -.PP -The basic syntax for -\fBndb_blob_tool\fR -is shown here: -.sp -.if n \{\ -.RS 4 -.\} -.nf -ndb_blob_tool [\fIoptions\fR] \fItable\fR [\fIcolumn\fR, \&.\&.\&.] -.fi -.if n \{\ -.RE -.\} -.PP -Unless you use the -\fB\-\-help\fR -option, you must specify an action to be performed by including one or more of the options -\fB\-\-check\-orphans\fR, -\fB\-\-delete\-orphans\fR, or -\fB\-\-dump\-file\fR\&. These options cause -\fBndb_blob_tool\fR -to check for orphaned BLOB parts, remove any orphaned BLOB parts, and generate a dump file listing orphaned BLOB parts, respectively, and are described in more detail later in this section\&. -.PP -You must also specify the name of a table when invoking -\fBndb_blob_tool\fR\&. In addition, you can optionally follow the table name with the (comma\-separated) names of one or more -BLOB -or -TEXT -columns from that table\&. If no columns are listed, the tool works on all of the table\*(Aqs -BLOB -and -TEXT -columns\&. If you need to specify a database, use the -\fB\-\-database\fR -(\fB\-d\fR) option\&. -.PP -The -\fB\-\-verbose\fR -option provides additional information in the output about the tool\*(Aqs progress\&. -.PP -The following table includes options that are specific to -\fBndb_blob_tool\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including -\fBndb_blob_tool\fR), see -Options Common to MySQL Cluster Programs(1)\&. -.sp -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.B Table\ \&18.82.\ \& This table describes command-line options for the ndb_blob_tool program -.TS -allbox tab(:); -lB lB lB. -T{ -Format -T}:T{ -Description -T}:T{ -Added or Removed -T} -.T& -l l l -l l l -l l l -l l l -l l l. -T{ -.PP ---check-orphans -T}:T{ -Check for orphan blob parts -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---database=db_name, -.PP --d -T}:T{ -Database to find the table in. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---delete-orphans -T}:T{ -Delete orphan blob parts -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---dump-file=file -T}:T{ -Write orphan keys to specified file -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---verbose, -.PP --v -T}:T{ -Verbose output -T}:T{ -.PP -All MySQL 5.6 based releases -T} -.TE -.sp 1 -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_blob_tool: check-orphans option -.\" check-orphans option: ndb_blob_tool -\fB\-\-check\-orphans\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-check\-orphans -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -FALSE -T} -.TE -.sp 1 -Check for orphaned BLOB parts in MySQL Cluster tables\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_blob_tool: database option -.\" database option: ndb_blob_tool -\fB\-\-database=\fR\fB\fIdb_name\fR\fR, -\fB\-d\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-database=db_name -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -string -T} -:T{ -\fBDefault\fR -T}:T{ -[none] -T} -.TE -.sp 1 -Specify the database to find the table in\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_blob_tool: delete-orphans option -.\" delete-orphans option: ndb_blob_tool -\fB\-\-delete\-orphans\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-delete\-orphans -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -FALSE -T} -.TE -.sp 1 -Remove orphaned BLOB parts from MySQL Cluster tables\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_blob_tool: dump-file option -.\" dump-file option: ndb_blob_tool -\fB\-\-dump\-file=\fR\fB\fIfile\fR\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-dump\-file=file -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -file name -T} -:T{ -\fBDefault\fR -T}:T{ -[none] -T} -.TE -.sp 1 -Writes a list of orphaned BLOB column parts to -\fIfile\fR\&. The information written to the file includes the table key and BLOB part number for each orphaned BLOB part\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_blob_tool: verbose option -.\" verbose option: ndb_blob_tool -\fB\-\-verbose\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-verbose -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -FALSE -T} -.TE -.sp 1 -Provide extra information in the tool\*(Aqs output regarding its progress\&. -.RE -Example.PP -First we create an -NDB -table in the -test -database, using the -CREATE TABLE -statement shown here: -.sp -.if n \{\ -.RS 4 -.\} -.nf -USE test; -CREATE TABLE btest ( - c0 BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, - c1 TEXT, - c2 BLOB -) ENGINE=NDB; -.fi -.if n \{\ -.RE -.\} -.PP -Then we insert a few rows into this table, using a series of statements similar to this one: -.sp -.if n \{\ -.RS 4 -.\} -.nf -INSERT INTO btest VALUES (NULL, \*(Aqx\*(Aq, REPEAT(\*(Aqx\*(Aq, 1000)); -.fi -.if n \{\ -.RE -.\} -.PP -When run with -\fB\-\-check\-orphans\fR -against this table, -\fBndb_blob_tool\fR -generates the following output: -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fBndb_blob_tool \-\-check\-orphans \-\-verbose \-d test btest\fR -connected -processing 2 blobs -processing blob #0 c1 NDB$BLOB_19_1 -NDB$BLOB_19_1: nextResult: res=1 -total parts: 0 -orphan parts: 0 -processing blob #1 c2 NDB$BLOB_19_2 -NDB$BLOB_19_2: nextResult: res=0 -NDB$BLOB_19_2: nextResult: res=0 -NDB$BLOB_19_2: nextResult: res=0 -NDB$BLOB_19_2: nextResult: res=0 -NDB$BLOB_19_2: nextResult: res=0 -NDB$BLOB_19_2: nextResult: res=0 -NDB$BLOB_19_2: nextResult: res=0 -NDB$BLOB_19_2: nextResult: res=0 -NDB$BLOB_19_2: nextResult: res=0 -NDB$BLOB_19_2: nextResult: res=0 -NDB$BLOB_19_2: nextResult: res=1 -total parts: 10 -orphan parts: 0 -disconnected -NDBT_ProgramExit: 0 \- OK -.fi -.if n \{\ -.RE -.\} -.PP -The tool reports that there are no -NDB -BLOB column parts associated with column -c1, even though -c1 -is a -TEXT -column\&. This is due to the fact that, in an -NDB -table, only the first 256 bytes of a -BLOB -or -TEXT -column value are stored inline, and only the excess, if any, is stored separately; thus, if there are no values using more than 256 bytes in a given column of one of these types, no -BLOB -column parts are created by -NDB -for this column\&. See -Section\ \&11.7, \(lqData Type Storage Requirements\(rq, for more information\&. -.SH "COPYRIGHT" -.br -.PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. -.PP -This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. -.PP -This documentation 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. -.PP -You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. -.sp -.SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. -.SH AUTHOR -Oracle Corporation (http://dev.mysql.com/). diff --git a/mysql-wsrep-5.6/man/ndb_config.1 b/mysql-wsrep-5.6/man/ndb_config.1 deleted file mode 100644 index de1958ac..00000000 --- a/mysql-wsrep-5.6/man/ndb_config.1 +++ /dev/null @@ -1,1451 +0,0 @@ -'\" t -.\" Title: \fBndb_config\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.6 -.\" Language: English -.\" -.TH "\FBNDB_CONFIG\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.\" ndb_config -.SH "NAME" -ndb_config \- extract MySQL Cluster configuration information -.SH "SYNOPSIS" -.HP \w'\fBndb_config\ \fR\fB\fIoptions\fR\fR\ 'u -\fBndb_config \fR\fB\fIoptions\fR\fR -.SH "DESCRIPTION" -.PP -This tool extracts current configuration information for data nodes, SQL nodes, and API nodes from one of a number of sources: a MySQL Cluster management node, or its -config\&.ini -or -my\&.cnf -file\&. By default, the management node is the source for the configuration data; to override the default, execute ndb_config with the -\fB\-\-config\-file\fR -or -\fB\-\-mycnf\fR -option\&. It is also possible to use a data node as the source by specifying its node ID with -\fB\-\-config_from_node=\fR\fB\fInode_id\fR\fR\&. -.PP -\fBndb_config\fR -can also provide an offline dump of all configuration parameters which can be used, along with their default, maximum, and minimum values and other information\&. The dump can be produced in either text or XML format; for more information, see the discussion of the -\fB\-\-configinfo\fR -and -\fB\-\-xml\fR -options later in this section)\&. -.PP -You can filter the results by section (DB, -SYSTEM, or -CONNECTIONS) using one of the options -\fB\-\-nodes\fR, -\fB\-\-system\fR, or -\fB\-\-connections\fR\&. -.PP -The following table includes options that are specific to -\fBndb_config\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including -\fBndb_config\fR), see -Options Common to MySQL Cluster Programs(1)\&. -.sp -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.B Table\ \&18.83.\ \& This table describes command-line options for the ndb_config program -.TS -allbox tab(:); -lB lB lB. -T{ -Format -T}:T{ -Description -T}:T{ -Added or Removed -T} -.T& -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l. -T{ -.PP ---nodes -T}:T{ -Print node information (DB section) only. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---connections -T}:T{ -Print CONNECTIONS section information only. Cannot be used with - --nodes or --system option. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---query=string, -.PP --q -T}:T{ -One or more query options (attributes) -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---host=name -T}:T{ -Specify host -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---type=name -T}:T{ -Specify node type -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---nodeid, -.PP ---id -T}:T{ -Get configuration of node with this ID -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---fields=string, -.PP --f -T}:T{ -Field separator -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---rows=string, -.PP --r -T}:T{ -Row separator -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---config-file=path -T}:T{ -Set the path to config.ini file -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---mycnf -T}:T{ -Read configuration data from my.cnf file -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP --c -T}:T{ -Short form for --ndb-connectstring -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---configinfo -T}:T{ -Dumps information about all NDB configuration parameters in text - format with default, maximum, and minimum values. Use with --xml - to obtain XML output. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---configinfo --xml -T}:T{ -Use --xml with --configinfo to obtain a dump of all NDB - configuration parameters in XML format with default, maximum, and - minimum values. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---system -T}:T{ -Print SYSTEM section information only. Cannot be used with --nodes - or --connections option. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---config_from_node=# -T}:T{ -Obtain configuration data from the node having this ID (must be a - data node). -T}:T{ -.PP -All MySQL 5.6 based releases -T} -.TE -.sp 1 -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_config: usage option -.\" usage option: ndb_config -\fB\-\-usage\fR, -\fB\-\-help\fR, or -\fB\-?\fR -.TS -allbox tab(:); -l l s s -l l s s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-help -T} -T{ -\ \& -T}:T{ -\-\-usage -T} -.TE -.sp 1 -Causes -\fBndb_config\fR -to print a list of available options, and then exit\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_config: config_from_node option -.\" config_from_node option: ndb_config -\fB\-\-config_from_node=#\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s -^ l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-config_from_node=# -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -numeric -T} -:T{ -\fBDefault\fR -T}:T{ -none -T} -:T{ -\fBMin Value\fR -T}:T{ -1 -T} -:T{ -\fBMax Value\fR -T}:T{ -48 -T} -.TE -.sp 1 -Obtain the cluster\*(Aqs configuration data from the data node that has this ID\&. -.sp -If the node having this ID is not a data node, -\fBndb_config\fR -fails with an error\&. (To obtain configuration data from the management node instead, simply omit this option\&.) -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_config: version option -.\" version option: ndb_config -\fB\-\-version\fR, -\fB\-V\fR -.TS -allbox tab(:); -l l s s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-version -T} -.TE -.sp 1 -Causes -\fBndb_config\fR -to print a version information string, and then exit\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_config: ndb-connectstring option -.\" ndb-connectstring option: ndb_config -\fB\-\-ndb\-connectstring=\fR\fB\fIconnect_string\fR\fR, -\fB\-c \fR\fB\fIconnect_string\fR\fR -.TS -allbox tab(:); -l l s s -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-ndb\-connectstring=connectstring -T} -T{ -\ \& -T}:T{ -\-\-connect\-string=connectstring -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -string -T} -:T{ -\fBDefault\fR -T}:T{ -localhost:1186 -T} -.TE -.sp 1 -Specifies the connection string to use in connecting to the management server\&. The format for the connection string is the same as described in -Section\ \&18.3.2.3, \(lqMySQL Cluster Connection Strings\(rq, and defaults to -localhost:1186\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_config: config-file option -.\" config-file option: ndb_config -\fB\-\-config\-file=\fR\fB\fIpath\-to\-file\fR\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-config\-file=path -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -file name -T} -:T{ -\fBDefault\fR -T}:T{ -T} -.TE -.sp 1 -Gives the path to the management server\*(Aqs configuration file (config\&.ini)\&. This may be a relative or absolute path\&. If the management node resides on a different host from the one on which -\fBndb_config\fR -is invoked, then an absolute path must be used\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_config: mycnf option -.\" mycnf option: ndb_config -\fB\-\-mycnf\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-mycnf -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -FALSE -T} -.TE -.sp 1 -Read configuration data from the -my\&.cnf -file\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_config: query option -.\" query option: ndb_config -\fB\-\-query=\fR\fB\fIquery\-options\fR\fR, -\fB\-q\fR -\fIquery\-options\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-query=string -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -string -T} -:T{ -\fBDefault\fR -T}:T{ -T} -.TE -.sp 1 -This is a comma\-delimited list of -query options\(emthat is, a list of one or more node attributes to be returned\&. These include -id -(node ID), type (node type\(emthat is, -ndbd, -mysqld, or -ndb_mgmd), and any configuration parameters whose values are to be obtained\&. -.sp -For example, -.\" ndb_config: query option -.\" query option: ndb_config -\fB\-\-query=id,type,indexmemory,datamemory\fR -returns the node ID, node type, -DataMemory, and -IndexMemory -for each node\&. -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBNote\fR -.ps -1 -.br -If a given parameter is not applicable to a certain type of node, than an empty string is returned for the corresponding value\&. See the examples later in this section for more information\&. -.sp .5v -.RE -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_config: host option -.\" host option: ndb_config -\fB\-\-host=\fR\fB\fIhostname\fR\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-host=name -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -string -T} -:T{ -\fBDefault\fR -T}:T{ -T} -.TE -.sp 1 -Specifies the host name of the node for which configuration information is to be obtained\&. -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBNote\fR -.ps -1 -.br -While the hostname -localhost -usually resolves to the IP address -127\&.0\&.0\&.1, this may not necessarily be true for all operating platforms and configurations\&. This means that it is possible, when -localhost -is used in -config\&.ini, for -\fBndb_config \fR\fB\fB\-\-host=localhost\fR\fR -to fail if -\fBndb_config\fR -is run on a different host where -localhost -resolves to a different address (for example, on some versions of SUSE Linux, this is -127\&.0\&.0\&.2)\&. In general, for best results, you should use numeric IP addresses for all MySQL Cluster configuration values relating to hosts, or verify that all MySQL Cluster hosts handle -localhost -in the same fashion\&. -.sp .5v -.RE -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_config: id option -.\" id option: ndb_config -\fB\-\-id=\fR\fB\fInode_id\fR\fR -.sp -.\" ndb_config: nodeid option -.\" nodeid option: ndb_config -\fB\-\-nodeid=\fR\fB\fInode_id\fR\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-ndb\-nodeid=# -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -numeric -T} -:T{ -\fBDefault\fR -T}:T{ -0 -T} -.TE -.sp 1 -Either of these options can be used to specify the node ID of the node for which configuration information is to be obtained\&. -\fB\-\-nodeid\fR -is the preferred form\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_config: nodes option -.\" nodes option: ndb_config -\fB\-\-nodes\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-nodes -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -FALSE -T} -.TE -.sp 1 -Tells -\fBndb_config\fR -to print information from parameters defined in -DB -sections only\&. This option cannot be used together with -\fB\-\-connections\fR -or -\fB\-\-system\fR\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_config: connections option -.\" connections option: ndb_config -\fB\-\-connections\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-connections -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -FALSE -T} -.TE -.sp 1 -Tells -\fBndb_config\fR -to print -CONNECTIONS -information only\&. This option cannot be used together with -\fB\-\-nodes\fR -or -\fB\-\-system\fR\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_config: system option -.\" system option: ndb_config -\fB\-\-system\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-system -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -FALSE -T} -.TE -.sp 1 -Tells -\fBndb_config\fR -to print -SYSTEM -information only\&. -.sp -This option cannot be used together with the -\fB\-\-nodes\fR -or -\fB\-\-system\fR -options\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_config: type option -.\" type option: ndb_config -\fB\-\-type=\fR\fB\fInode_type\fR\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s -^ lt l s -^ ^ l s -^ ^ l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-type=name -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -enumeration -T} -:T{ -\fBDefault\fR -T}:T{ -[none] -T} -:T{ -\fBValid Values\fR -T}:T{ -ndbd -T} -::T{ -mysqld -T} -::T{ -ndb_mgmd -T} -.TE -.sp 1 -Filters results so that only configuration values applying to nodes of the specified -\fInode_type\fR -(ndbd, -mysqld, or -ndb_mgmd) are returned\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_config: fields option -.\" fields option: ndb_config -\fB\-\-fields=\fR\fB\fIdelimiter\fR\fR, -\fB\-f\fR -\fIdelimiter\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-fields=string -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -string -T} -:T{ -\fBDefault\fR -T}:T{ -T} -.TE -.sp 1 -Specifies a -\fIdelimiter\fR -string used to separate the fields in the result\&. The default is -\(lq,\(rq -(the comma character)\&. -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBNote\fR -.ps -1 -.br -If the -\fIdelimiter\fR -contains spaces or escapes (such as -\en -for the linefeed character), then it must be quoted\&. -.sp .5v -.RE -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_config: rows option -.\" rows option: ndb_config -\fB\-\-rows=\fR\fB\fIseparator\fR\fR, -\fB\-r\fR -\fIseparator\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-rows=string -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -string -T} -:T{ -\fBDefault\fR -T}:T{ -T} -.TE -.sp 1 -Specifies a -\fIseparator\fR -string used to separate the rows in the result\&. The default is a space character\&. -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBNote\fR -.ps -1 -.br -If the -\fIseparator\fR -contains spaces or escapes (such as -\en -for the linefeed character), then it must be quoted\&. -.sp .5v -.RE -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_config: configinfo option -.\" configinfo option: ndb_config -\fB\-\-configinfo\fR -.sp -The -\fB\-\-configinfo\fR -option causes -\fBndb_config\fR -to dump a list of each MySQL Cluster configuration parameter supported by the MySQL Cluster distribution of which -\fBndb_config\fR -is a part, including the following information: -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -A brief description of each parameter\*(Aqs purpose, effects, and usage -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -The section of the -config\&.ini -file where the parameter may be used -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -The parameter\*(Aqs data type or unit of measurement -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -Where applicable, the parameter\*(Aqs default, minimum, and maximum values -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -A brief description of the parameter\*(Aqs purpose, effects, and usage -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -MySQL Cluster release version and build information -.RE -.sp -By default, this output is in text format\&. Part of this output is shown here: -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fBndb_config \-\-configinfo\fR -****** SYSTEM ****** -Name (String) -Name of system (NDB Cluster) -MANDATORY -PrimaryMGMNode (Non\-negative Integer) -Node id of Primary ndb_mgmd(MGM) node -Default: 0 (Min: 0, Max: 4294967039) -ConfigGenerationNumber (Non\-negative Integer) -Configuration generation number -Default: 0 (Min: 0, Max: 4294967039) -****** DB ****** -MaxNoOfSubscriptions (Non\-negative Integer) -Max no of subscriptions (default 0 == MaxNoOfTables) -Default: 0 (Min: 0, Max: 4294967039) -MaxNoOfSubscribers (Non\-negative Integer) -Max no of subscribers (default 0 == 2 * MaxNoOfTables) -Default: 0 (Min: 0, Max: 4294967039) -\&... -.fi -.if n \{\ -.RE -.\} -.sp -.\" ndb_config: xml option -.\" xml option: ndb_config -\fB\-\-configinfo\fR -\fB\-\-xml\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-configinfo \-\-xml -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -false -T} -.TE -.sp 1 -You can obtain the output of -\fBndb_config\fR -\fB\-\-configinfo\fR -as XML by adding the -\fB\-\-xml\fR -option\&. A portion of the resulting output is shown in this example: -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fBndb_config \-\-configinfo \-\-xml\fR - -
- - - -
-
- - - \&... -
- \&... -
-.fi -.if n \{\ -.RE -.\} -.sp -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBNote\fR -.ps -1 -.br -Normally, the XML output produced by -\fBndb_config\fR -\fB\-\-configinfo\fR -\fB\-\-xml\fR -is formatted using one line per element; we have added extra whitespace in the previous example, as well as the next one, for reasons of legibility\&. This should not make any difference to applications using this output, since most XML processors either ignore nonessential whitespace as a matter of course, or can be instructed to do so\&. -.sp .5v -.RE -The XML output also indicates when changing a given parameter requires that data nodes be restarted using the -\fB\-\-initial\fR -option\&. This is shown by the presence of an -initial="true" -attribute in the corresponding - -element\&. In addition, the restart type (system -or -node) is also shown; if a given parameter requires a system restart, this is indicated by the presence of a -restart="system" -attribute in the corresponding - -element\&. For example, changing the value set for the -Diskless -parameter requires a system initial restart, as shown here (with the -restart -and -initial -attributes highlighted for visibility): -.sp -.if n \{\ -.RS 4 -.\} -.nf - -.fi -.if n \{\ -.RE -.\} -.sp -Currently, no -initial -attribute is included in the XML output for - -elements corresponding to parameters which do not require initial restarts; in other words, -initial="false" -is the default, and the value -false -should be assumed if the attribute is not present\&. Similarly, the default restart type is -node -(that is, an online or -\(lqrolling\(rq -restart of the cluster), but the -restart -attribute is included only if the restart type is -system -(meaning that all cluster nodes must be shut down at the same time, then restarted)\&. -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBImportant\fR -.ps -1 -.br -The -\fB\-\-xml\fR -option can be used only with the -\fB\-\-configinfo\fR -option\&. Using -\fB\-\-xml\fR -without -\fB\-\-configinfo\fR -fails with an error\&. -.sp .5v -.RE -Unlike the options used with this program to obtain current configuration data, -\fB\-\-configinfo\fR -and -\fB\-\-xml\fR -use information obtained from the MySQL Cluster sources when -\fBndb_config\fR -was compiled\&. For this reason, no connection to a running MySQL Cluster or access to a -config\&.ini -or -my\&.cnf -file is required for these two options\&. -.sp -Combining other -\fBndb_config\fR -options (such as -\fB\-\-query\fR -or -\fB\-\-type\fR) with -\fB\-\-configinfo\fR -or -\fB\-\-xml\fR -is not supported\&. Currently, if you attempt to do so, the usual result is that all other options besides -\fB\-\-configinfo\fR -or -\fB\-\-xml\fR -are simply ignored\&. -\fIHowever, this behavior is not guaranteed and is subject to change at any time\fR\&. In addition, since -\fBndb_config\fR, when used with the -\fB\-\-configinfo\fR -option, does not access the MySQL Cluster or read any files, trying to specify additional options such as -\fB\-\-ndb\-connectstring\fR -or -\fB\-\-config\-file\fR -with -\fB\-\-configinfo\fR -serves no purpose\&. -.RE -Examples -.sp -.RS 4 -.ie n \{\ -\h'-04' 1.\h'+01'\c -.\} -.el \{\ -.sp -1 -.IP " 1." 4.2 -.\} -To obtain the node ID and type of each node in the cluster: -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fB\&./ndb_config \-\-query=id,type \-\-fields=\*(Aq:\*(Aq \-\-rows=\*(Aq\en\*(Aq\fR -1:ndbd -2:ndbd -3:ndbd -4:ndbd -5:ndb_mgmd -6:mysqld -7:mysqld -8:mysqld -9:mysqld -.fi -.if n \{\ -.RE -.\} -.sp -In this example, we used the -\fB\-\-fields\fR -options to separate the ID and type of each node with a colon character (:), and the -\fB\-\-rows\fR -options to place the values for each node on a new line in the output\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04' 2.\h'+01'\c -.\} -.el \{\ -.sp -1 -.IP " 2." 4.2 -.\} -To produce a connection string that can be used by data, SQL, and API nodes to connect to the management server: -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fB\&./ndb_config \-\-config\-file=usr/local/mysql/cluster\-data/config\&.ini \e -\-\-query=hostname,portnumber \-\-fields=: \-\-rows=, \-\-type=ndb_mgmd\fR -192\&.168\&.0\&.179:1186 -.fi -.if n \{\ -.RE -.\} -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04' 3.\h'+01'\c -.\} -.el \{\ -.sp -1 -.IP " 3." 4.2 -.\} -This invocation of -\fBndb_config\fR -checks only data nodes (using the -\fB\-\-type\fR -option), and shows the values for each node\*(Aqs ID and host name, as well as the values set for its -DataMemory, -IndexMemory, and -DataDir -parameters: -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fB\&./ndb_config \-\-type=ndbd \-\-query=id,host,datamemory,indexmemory,datadir \-f \*(Aq : \*(Aq \-r \*(Aq\en\*(Aq\fR -1 : 192\&.168\&.0\&.193 : 83886080 : 18874368 : /usr/local/mysql/cluster\-data -2 : 192\&.168\&.0\&.112 : 83886080 : 18874368 : /usr/local/mysql/cluster\-data -3 : 192\&.168\&.0\&.176 : 83886080 : 18874368 : /usr/local/mysql/cluster\-data -4 : 192\&.168\&.0\&.119 : 83886080 : 18874368 : /usr/local/mysql/cluster\-data -.fi -.if n \{\ -.RE -.\} -.sp -In this example, we used the short options -\fB\-f\fR -and -\fB\-r\fR -for setting the field delimiter and row separator, respectively\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04' 4.\h'+01'\c -.\} -.el \{\ -.sp -1 -.IP " 4." 4.2 -.\} -To exclude results from any host except one in particular, use the -\fB\-\-host\fR -option: -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fB\&./ndb_config \-\-host=192\&.168\&.0\&.176 \-f : \-r \*(Aq\en\*(Aq \-q id,type\fR -3:ndbd -5:ndb_mgmd -.fi -.if n \{\ -.RE -.\} -.sp -In this example, we also used the short form -\fB\-q\fR -to determine the attributes to be queried\&. -.sp -Similarly, you can limit results to a node with a specific ID using the -\fB\-\-id\fR -or -\fB\-\-nodeid\fR -option\&. -.RE -.SH "COPYRIGHT" -.br -.PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. -.PP -This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. -.PP -This documentation 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. -.PP -You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. -.sp -.SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. -.SH AUTHOR -Oracle Corporation (http://dev.mysql.com/). diff --git a/mysql-wsrep-5.6/man/ndb_cpcd.1 b/mysql-wsrep-5.6/man/ndb_cpcd.1 deleted file mode 100644 index c1b5d680..00000000 --- a/mysql-wsrep-5.6/man/ndb_cpcd.1 +++ /dev/null @@ -1,55 +0,0 @@ -'\" t -.\" Title: \fBndb_cpcd\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.6 -.\" Language: English -.\" -.TH "\FBNDB_CPCD\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.\" ndb_cpcd -.SH "NAME" -ndb_cpcd \- automate testing of NDB (development use only) -.SH "SYNOPSIS" -.HP \w'\fBndb_cpcd\ \fR\fB\fIoptions\fR\fR\ 'u -\fBndb_cpcd \fR\fB\fIoptions\fR\fR -.SH "DESCRIPTION" -.PP -A utility having this name was formerly part of an internal automated test framework used in testing and debugging MySQL Cluster\&. It is no longer included in MySQL Cluster distributions provided by Oracle\&. -.SH "COPYRIGHT" -.br -.PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. -.PP -This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. -.PP -This documentation 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. -.PP -You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. -.sp -.SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. -.SH AUTHOR -Oracle Corporation (http://dev.mysql.com/). diff --git a/mysql-wsrep-5.6/man/ndb_delete_all.1 b/mysql-wsrep-5.6/man/ndb_delete_all.1 deleted file mode 100644 index cb1a796b..00000000 --- a/mysql-wsrep-5.6/man/ndb_delete_all.1 +++ /dev/null @@ -1,179 +0,0 @@ -'\" t -.\" Title: \fBndb_delete_all\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.6 -.\" Language: English -.\" -.TH "\FBNDB_DELETE_ALL\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.\" ndb_delete_all -.SH "NAME" -ndb_delete_all \- delete all rows from an NDB table -.SH "SYNOPSIS" -.HP \w'\fBndb_delete_all\ \fR\fB\fIoptions\fR\fR\ 'u -\fBndb_delete_all \fR\fB\fIoptions\fR\fR -.SH "DESCRIPTION" -.PP -\fBndb_delete_all\fR -deletes all rows from the given -NDB -table\&. In some cases, this can be much faster than -DELETE -or even -TRUNCATE TABLE\&. -Usage -.sp -.if n \{\ -.RS 4 -.\} -.nf -ndb_delete_all \-c \fIconnect_string\fR \fItbl_name\fR \-d \fIdb_name\fR -.fi -.if n \{\ -.RE -.\} -.PP -This deletes all rows from the table named -\fItbl_name\fR -in the database named -\fIdb_name\fR\&. It is exactly equivalent to executing -TRUNCATE \fIdb_name\fR\&.\fItbl_name\fR -in MySQL\&. -.PP -The following table includes options that are specific to -\fBndb_delete_all\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including -\fBndb_delete_all\fR), see -Options Common to MySQL Cluster Programs(1)\&. -.sp -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.B Table\ \&18.84.\ \& This table describes command-line options for the ndb_delete_all program -.TS -allbox tab(:); -lB lB lB. -T{ -Format -T}:T{ -Description -T}:T{ -Added or Removed -T} -.T& -l l l -l l l -l l l -l l l. -T{ -.PP ---database=dbname, -.PP --d -T}:T{ -Name of the database in which the table is found -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---transactional, -.PP --t -T}:T{ -Perform the delete in a single transaction (may run out of - operations) -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---tupscan -T}:T{ -Run tup scan -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---diskscan -T}:T{ -Run disk scan -T}:T{ -.PP -All MySQL 5.6 based releases -T} -.TE -.sp 1 -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_delete_all: transactional option -.\" transactional option: ndb_delete_all -\fB\-\-transactional\fR, -\fB\-t\fR -.sp -Use of this option causes the delete operation to be performed as a single transaction\&. -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBWarning\fR -.ps -1 -.br -With very large tables, using this option may cause the number of operations available to the cluster to be exceeded\&. -.sp .5v -.RE -.RE -.SH "COPYRIGHT" -.br -.PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. -.PP -This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. -.PP -This documentation 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. -.PP -You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. -.sp -.SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. -.SH AUTHOR -Oracle Corporation (http://dev.mysql.com/). diff --git a/mysql-wsrep-5.6/man/ndb_desc.1 b/mysql-wsrep-5.6/man/ndb_desc.1 deleted file mode 100644 index 197054f8..00000000 --- a/mysql-wsrep-5.6/man/ndb_desc.1 +++ /dev/null @@ -1,572 +0,0 @@ -'\" t -.\" Title: \fBndb_desc\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.6 -.\" Language: English -.\" -.TH "\FBNDB_DESC\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.\" ndb_desc -.SH "NAME" -ndb_desc \- describe NDB tables -.SH "SYNOPSIS" -.HP \w'\fBndb_desc\ \fR\fB\fIoptions\fR\fR\ 'u -\fBndb_desc \fR\fB\fIoptions\fR\fR -.SH "DESCRIPTION" -.PP -\fBndb_desc\fR -provides a detailed description of one or more -NDB -tables\&. -Usage -.sp -.if n \{\ -.RS 4 -.\} -.nf -ndb_desc \-c \fIconnect_string\fR \fItbl_name\fR \-d \fIdb_name\fR [\-p] -ndb_desc \-c \fIconnect_string\fR \fIindex_name\fR \-d \fIdb_name\fR \-t \fItbl_name\fR -.fi -.if n \{\ -.RE -.\} -.sp -Sample Output.PP -MySQL table creation and population statements: -.sp -.if n \{\ -.RS 4 -.\} -.nf -USE test; -CREATE TABLE fish ( - id INT(11) NOT NULL AUTO_INCREMENT, - name VARCHAR(20) NOT NULL, - length_mm INT(11) NOT NULL, - weight_gm INT(11) NOT NULL, - PRIMARY KEY pk (id), - UNIQUE KEY uk (name) -) ENGINE=NDB; -INSERT INTO fish VALUES - (\*(Aq\*(Aq,\*(Aqguppy\*(Aq, 35, 2), (\*(Aq\*(Aq,\*(Aqtuna\*(Aq, 2500, 150000), - (\*(Aq\*(Aq,\*(Aqshark\*(Aq, 3000, 110000), (\*(Aq\*(Aq,\*(Aqmanta ray\*(Aq, 1500, 50000), - (\*(Aq\*(Aq,\*(Aqgrouper\*(Aq, 900, 125000), (\*(Aq\*(Aq,\*(Aqpuffer\*(Aq, 250, 2500); -.fi -.if n \{\ -.RE -.\} -.PP -Output from -\fBndb_desc\fR: -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fB\&./ndb_desc \-c localhost fish \-d test \-p\fR -\-\- fish \-\- -Version: 2 -Fragment type: 9 -K Value: 6 -Min load factor: 78 -Max load factor: 80 -Temporary table: no -Number of attributes: 4 -Number of primary keys: 1 -Length of frm data: 311 -Row Checksum: 1 -Row GCI: 1 -SingleUserMode: 0 -ForceVarPart: 1 -FragmentCount: 2 -TableStatus: Retrieved -\-\- Attributes \-\- -id Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY AUTO_INCR -name Varchar(20;latin1_swedish_ci) NOT NULL AT=SHORT_VAR ST=MEMORY -length_mm Int NOT NULL AT=FIXED ST=MEMORY -weight_gm Int NOT NULL AT=FIXED ST=MEMORY -\-\- Indexes \-\- -PRIMARY KEY(id) \- UniqueHashIndex -PRIMARY(id) \- OrderedIndex -uk$unique(name) \- UniqueHashIndex -uk(name) \- OrderedIndex -\-\- Per partition info \-\- -Partition Row count Commit count Frag fixed memory \&.\&.\&. -0 2 2 32768 \&.\&.\&. -1 4 4 32768 \&.\&.\&. -\&.\&.\&. Frag varsized memory Extent_space Free extent_space -\&.\&.\&. 32768 0 0 -\&.\&.\&. 32768 0 0 -NDBT_ProgramExit: 0 \- OK -.fi -.if n \{\ -.RE -.\} -.PP -Information about multiple tables can be obtained in a single invocation of -\fBndb_desc\fR -by using their names, separated by spaces\&. All of the tables must be in the same database\&. -.PP -You can obtain additional information about a specific index using the -\fB\-\-table\fR -(short form: -\fB\-t\fR) option supplying the name of the index as the first argument to -\fBndb_desc\fR, as shown here: -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fB\&./ndb_desc uk \-d test \-t fish\fR -\-\- uk \-\- -Version: 3 -Base table: fish -Number of attributes: 1 -Logging: 0 -Index type: OrderedIndex -Index status: Retrieved -\-\- Attributes \-\- -name Varchar(20;latin1_swedish_ci) NOT NULL AT=SHORT_VAR ST=MEMORY -\-\- IndexTable 10/uk \-\- -Version: 3 -Fragment type: FragUndefined -K Value: 6 -Min load factor: 78 -Max load factor: 80 -Temporary table: yes -Number of attributes: 2 -Number of primary keys: 1 -Length of frm data: 0 -Row Checksum: 1 -Row GCI: 1 -SingleUserMode: 2 -ForceVarPart: 0 -FragmentCount: 4 -ExtraRowGciBits: 0 -ExtraRowAuthorBits: 0 -TableStatus: Retrieved -\-\- Attributes \-\- -name Varchar(20;latin1_swedish_ci) NOT NULL AT=SHORT_VAR ST=MEMORY -NDB$TNODE Unsigned [64] PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY -\-\- Indexes \-\- -PRIMARY KEY(NDB$TNODE) \- UniqueHashIndex -NDBT_ProgramExit: 0 \- OK -.fi -.if n \{\ -.RE -.\} -.PP -When an index is specified in this way, the -\fB\-\-extra\-partition\-info\fR -and -\fB\-\-extra\-node\-info\fR -options have no effect\&. -.PP -The -Version -column in the output contains the table\*(Aqs schema object version\&. For information about interpreting this value, see -\m[blue]\fBNDB Schema Object Versions\fR\m[]\&\s-2\u[1]\d\s+2\&. -.PP -The -Extent_space -and -Free extent_space -columns are applicable only to -NDB -tables having columns on disk; for tables having only in\-memory columns, these columns always contain the value -0\&. -.PP -To illustrate their use, we modify the previous example\&. First, we must create the necessary Disk Data objects, as shown here: -.sp -.if n \{\ -.RS 4 -.\} -.nf -CREATE LOGFILE GROUP lg_1 - ADD UNDOFILE \*(Aqundo_1\&.log\*(Aq - INITIAL_SIZE 16M - UNDO_BUFFER_SIZE 2M - ENGINE NDB; -ALTER LOGFILE GROUP lg_1 - ADD UNDOFILE \*(Aqundo_2\&.log\*(Aq - INITIAL_SIZE 12M - ENGINE NDB; -CREATE TABLESPACE ts_1 - ADD DATAFILE \*(Aqdata_1\&.dat\*(Aq - USE LOGFILE GROUP lg_1 - INITIAL_SIZE 32M - ENGINE NDB; -ALTER TABLESPACE ts_1 - ADD DATAFILE \*(Aqdata_2\&.dat\*(Aq - INITIAL_SIZE 48M - ENGINE NDB; -.fi -.if n \{\ -.RE -.\} -.PP -(For more information on the statements just shown and the objects created by them, see -Section\ \&18.5.12.1, \(lqMySQL Cluster Disk Data Objects\(rq, as well as -Section\ \&13.1.14, \(lqCREATE LOGFILE GROUP Syntax\(rq, and -Section\ \&13.1.18, \(lqCREATE TABLESPACE Syntax\(rq\&.) -.PP -Now we can create and populate a version of the -fish -table that stores 2 of its columns on disk (deleting the previous version of the table first, if it already exists): -.sp -.if n \{\ -.RS 4 -.\} -.nf -CREATE TABLE fish ( - id INT(11) NOT NULL AUTO_INCREMENT, - name VARCHAR(20) NOT NULL, - length_mm INT(11) NOT NULL, - weight_gm INT(11) NOT NULL, - PRIMARY KEY pk (id), - UNIQUE KEY uk (name) -) TABLESPACE ts_1 STORAGE DISK -ENGINE=NDB; -INSERT INTO fish VALUES - (\*(Aq\*(Aq,\*(Aqguppy\*(Aq, 35, 2), (\*(Aq\*(Aq,\*(Aqtuna\*(Aq, 2500, 150000), - (\*(Aq\*(Aq,\*(Aqshark\*(Aq, 3000, 110000), (\*(Aq\*(Aq,\*(Aqmanta ray\*(Aq, 1500, 50000), - (\*(Aq\*(Aq,\*(Aqgrouper\*(Aq, 900, 125000), (\*(Aq\*(Aq,\*(Aqpuffer\*(Aq, 250, 2500); -.fi -.if n \{\ -.RE -.\} -.PP -When run against this version of the table, -\fBndb_desc\fR -displays the following output: -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fB\&./ndb_desc \-c localhost fish \-d test \-p\fR -\-\- fish \-\- -Version: 3 -Fragment type: 9 -K Value: 6 -Min load factor: 78 -Max load factor: 80 -Temporary table: no -Number of attributes: 4 -Number of primary keys: 1 -Length of frm data: 321 -Row Checksum: 1 -Row GCI: 1 -SingleUserMode: 0 -ForceVarPart: 1 -FragmentCount: 2 -TableStatus: Retrieved -\-\- Attributes \-\- -id Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY AUTO_INCR -name Varchar(20;latin1_swedish_ci) NOT NULL AT=SHORT_VAR ST=MEMORY -length_mm Int NOT NULL AT=FIXED ST=DISK -weight_gm Int NOT NULL AT=FIXED ST=DISK -\-\- Indexes \-\- -PRIMARY KEY(id) \- UniqueHashIndex -PRIMARY(id) \- OrderedIndex -uk$unique(name) \- UniqueHashIndex -uk(name) \- OrderedIndex -\-\- Per partition info \-\- -Partition Row count Commit count Frag fixed memory \&.\&.\&. -0 2 2 32768 \&.\&.\&. -1 4 4 32768 \&.\&.\&. -\&.\&.\&. Frag varsized memory Extent_space Free extent_space -\&.\&.\&. 32768 0 0 -\&.\&.\&. 32768 0 0 -NDBT_ProgramExit: 0 \- OK -.fi -.if n \{\ -.RE -.\} -.PP -This means that 1048576 bytes are allocated from the tablespace for this table on each partition, of which 1044440 bytes remain free for additional storage\&. In other words, 1048576 \- 1044440 = 4136 bytes per partition is currently being used to store the data from this table\*(Aqs disk\-based columns\&. The number of bytes shown as -Free extent_space -is available for storing on\-disk column data from the -fish -table only; for this reason, it is not visible when selecting from the -INFORMATION_SCHEMA\&.FILES -table\&. -.PP -The following table includes options that are specific to -\fBndb_desc\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including -\fBndb_desc\fR), see -Options Common to MySQL Cluster Programs(1)\&. -.sp -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.B Table\ \&18.85.\ \& This table describes command-line options for the ndb_desc program -.TS -allbox tab(:); -lB lB lB. -T{ -Format -T}:T{ -Description -T}:T{ -Added or Removed -T} -.T& -l l l -l l l -l l l -l l l -l l l -l l l -l l l. -T{ -.PP ---blob-info, -.PP --b -T}:T{ -Include partition information for BLOB tables in output. Requires - that the -p option also be used -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---database=dbname, -.PP --d -T}:T{ -Name of database containing table -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---extra-node-info, -.PP --n -T}:T{ -Include partition-to-data-node mappings in output. Requires that - the -p option also be used -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---extra-partition-info, -.PP --p -T}:T{ -Display information about partitions -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---retries=#, -.PP --r -T}:T{ -Number of times to retry the connection (once per second) -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---table=tbl_name, -.PP --t -T}:T{ -Specify the table in which to find an index. When this option is - used, -p and -n have no effect and are ignored. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---unqualified, -.PP --u -T}:T{ -Use unqualified table names -T}:T{ -.PP -All MySQL 5.6 based releases -T} -.TE -.sp 1 -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_desc: blob-info option -.\" blob-info option: ndb_desc -\fB\-\-blob\-info\fR, -\fB\-b\fR -.sp -Include information about subordinate -BLOB -and -TEXT -columns\&. -.sp -Use of this option also requires the use of the -\fB\-\-extra\-partition\-info\fR -(\fB\-p\fR) option\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_desc: database option -.\" database option: ndb_desc -\fB\-\-database=\fR\fB\fIdb_name\fR\fR, -\fB\-d\fR -.sp -Specify the database in which the table should be found\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_desc: extra-node-info option -.\" extra-node-info option: ndb_desc -\fB\-\-extra\-node\-info\fR, -\fB\-n\fR -.sp -Include information about the mappings between table partitions and the data nodes upon which they reside\&. This information can be useful for verifying distribution awareness mechanisms and supporting more efficient application access to the data stored in MySQL Cluster\&. -.sp -Use of this option also requires the use of the -\fB\-\-extra\-partition\-info\fR -(\fB\-p\fR) option\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_desc: extra-partition-info option -.\" extra-partition-info option: ndb_desc -\fB\-\-extra\-partition\-info\fR, -\fB\-p\fR -.sp -Print additional information about the table\*(Aqs partitions\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_desc: retries option -.\" retries option: ndb_desc -\fB\-\-retries=\fR\fB\fI#\fR\fR, -\fB\-r\fR -.sp -Try to connect this many times before giving up\&. One connect attempt is made per second\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_desc: table option -.\" table option: ndb_desc -\fB\-\-table=\fR\fB\fItbl_name\fR\fR, -\fB\-t\fR -.sp -Specify the table in which to look for an index\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_desc: unqualified option -.\" unqualified option: ndb_desc -\fB\-\-unqualified\fR, -\fB\-u\fR -.sp -Use unqualified table names\&. -.RE -.SH "COPYRIGHT" -.br -.PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. -.PP -This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. -.PP -This documentation 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. -.PP -You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. -.sp -.SH "NOTES" -.IP " 1." 4 -NDB Schema Object Versions -.RS 4 -\%http://dev.mysql.com/doc/ndbapi/en/ndb-internals-schema-object-versions.html -.RE -.SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. -.SH AUTHOR -Oracle Corporation (http://dev.mysql.com/). diff --git a/mysql-wsrep-5.6/man/ndb_drop_index.1 b/mysql-wsrep-5.6/man/ndb_drop_index.1 deleted file mode 100644 index a468fa99..00000000 --- a/mysql-wsrep-5.6/man/ndb_drop_index.1 +++ /dev/null @@ -1,170 +0,0 @@ -'\" t -.\" Title: \fBndb_drop_index\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.6 -.\" Language: English -.\" -.TH "\FBNDB_DROP_INDEX\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.\" ndb_drop_index -.SH "NAME" -ndb_drop_index \- drop index from an NDB table -.SH "SYNOPSIS" -.HP \w'\fBndb_drop_index\ \fR\fB\fIoptions\fR\fR\ 'u -\fBndb_drop_index \fR\fB\fIoptions\fR\fR -.SH "DESCRIPTION" -.PP -\fBndb_drop_index\fR -drops the specified index from an -NDB -table\&. -\fIIt is recommended that you use this utility only as an example for writing NDB API applications\fR\(emsee the Warning later in this section for details\&. -Usage -.sp -.if n \{\ -.RS 4 -.\} -.nf -ndb_drop_index \-c \fIconnect_string\fR \fItable_name\fR \fIindex\fR \-d \fIdb_name\fR -.fi -.if n \{\ -.RE -.\} -.PP -The statement shown above drops the index named -\fIindex\fR -from the -\fItable\fR -in the -\fIdatabase\fR\&. -.PP -The following table includes options that are specific to -\fBndb_drop_index\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including -\fBndb_drop_index\fR), see -Options Common to MySQL Cluster Programs(1)\&. -.sp -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.B Table\ \&18.86.\ \& This table describes command-line options for the ndb_drop_index program -.TS -allbox tab(:); -lB lB lB. -T{ -Format -T}:T{ -Description -T}:T{ -Added or Removed -T} -.T& -l l l. -T{ -.PP ---database=dbname, -.PP --d -T}:T{ -Name of the database in which the table is found -T}:T{ -.PP -All MySQL 5.6 based releases -T} -.TE -.sp 1 -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBWarning\fR -.ps -1 -.br -.PP -\fIOperations performed on Cluster table indexes using the NDB API are not visible to MySQL and make the table unusable by a MySQL server\fR\&. If you use this program to drop an index, then try to access the table from an SQL node, an error results, as shown here: -.sp .5v -.RE -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fB\&./ndb_drop_index \-c localhost dogs ix \-d ctest1\fR -Dropping index dogs/idx\&.\&.\&.OK -NDBT_ProgramExit: 0 \- OK -shell> \fB\&./mysql \-u jon \-p ctest1\fR -Enter password: ******* -Reading table information for completion of table and column names -You can turn off this feature to get a quicker startup with \-A -Welcome to the MySQL monitor\&. Commands end with ; or \eg\&. -Your MySQL connection id is 7 to server version: 5\&.6\&.22\-ndb\-7\&.3\&.9 -Type \*(Aqhelp;\*(Aq or \*(Aq\eh\*(Aq for help\&. Type \*(Aq\ec\*(Aq to clear the buffer\&. -mysql> \fBSHOW TABLES;\fR -+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ -| Tables_in_ctest1 | -+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ -| a | -| bt1 | -| bt2 | -| dogs | -| employees | -| fish | -+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ -6 rows in set (0\&.00 sec) -mysql> \fBSELECT * FROM dogs;\fR -ERROR 1296 (HY000): Got error 4243 \*(AqIndex not found\*(Aq from NDBCLUSTER -.fi -.if n \{\ -.RE -.\} -.PP -In such a case, your -\fIonly\fR -option for making the table available to MySQL again is to drop the table and re\-create it\&. You can use either the SQL statementDROP TABLE -or the -\fBndb_drop_table\fR -utility (see -\fBndb_drop_table\fR(1)) to drop the table\&. -.SH "COPYRIGHT" -.br -.PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. -.PP -This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. -.PP -This documentation 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. -.PP -You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. -.sp -.SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. -.SH AUTHOR -Oracle Corporation (http://dev.mysql.com/). diff --git a/mysql-wsrep-5.6/man/ndb_drop_table.1 b/mysql-wsrep-5.6/man/ndb_drop_table.1 deleted file mode 100644 index 7c73fcd5..00000000 --- a/mysql-wsrep-5.6/man/ndb_drop_table.1 +++ /dev/null @@ -1,111 +0,0 @@ -'\" t -.\" Title: \fBndb_drop_table\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.6 -.\" Language: English -.\" -.TH "\FBNDB_DROP_TABLE\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.\" ndb_drop_table -.SH "NAME" -ndb_drop_table \- drop an NDB table -.SH "SYNOPSIS" -.HP \w'\fBndb_drop_table\ \fR\fB\fIoptions\fR\fR\ 'u -\fBndb_drop_table \fR\fB\fIoptions\fR\fR -.SH "DESCRIPTION" -.PP -\fBndb_drop_table\fR -drops the specified -NDB -table\&. (If you try to use this on a table created with a storage engine other than -NDB, the attempt fails with the error -723: No such table exists\&.) This operation is extremely fast; in some cases, it can be an order of magnitude faster than using a MySQL -DROP TABLE -statement on an -NDB -table\&. -Usage -.sp -.if n \{\ -.RS 4 -.\} -.nf -ndb_drop_table \-c \fIconnect_string\fR \fItbl_name\fR \-d \fIdb_name\fR -.fi -.if n \{\ -.RE -.\} -.PP -The following table includes options that are specific to -\fBndb_drop_table\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including -\fBndb_drop_table\fR), see -Options Common to MySQL Cluster Programs(1)\&. -.sp -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.B Table\ \&18.87.\ \& This table describes command-line options for the ndb_drop_table program -.TS -allbox tab(:); -lB lB lB. -T{ -Format -T}:T{ -Description -T}:T{ -Added or Removed -T} -.T& -l l l. -T{ -.PP ---database=dbname, -.PP --d -T}:T{ -Name of the database in which the table is found -T}:T{ -.PP -All MySQL 5.6 based releases -T} -.TE -.sp 1 -.SH "COPYRIGHT" -.br -.PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. -.PP -This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. -.PP -This documentation 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. -.PP -You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. -.sp -.SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. -.SH AUTHOR -Oracle Corporation (http://dev.mysql.com/). diff --git a/mysql-wsrep-5.6/man/ndb_error_reporter.1 b/mysql-wsrep-5.6/man/ndb_error_reporter.1 deleted file mode 100644 index 07c5c686..00000000 --- a/mysql-wsrep-5.6/man/ndb_error_reporter.1 +++ /dev/null @@ -1,328 +0,0 @@ -'\" t -.\" Title: \fBndb_error_reporter\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.6 -.\" Language: English -.\" -.TH "\FBNDB_ERROR_REPORTE" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.\" ndb_error_reporter -.\" bugs: MySQL Cluster: reporting -.SH "NAME" -ndb_error_reporter \- NDB error\-reporting utility -.SH "SYNOPSIS" -.HP \w'\fBndb_error_reporter\ \fR\fB\fIoptions\fR\fR\ 'u -\fBndb_error_reporter \fR\fB\fIoptions\fR\fR -.SH "DESCRIPTION" -.PP -\fBndb_error_reporter\fR -creates an archive from data node and management node log files that can be used to help diagnose bugs or other problems with a cluster\&. -\fIIt is highly recommended that you make use of this utility when filing reports of bugs in MySQL Cluster\fR\&. -.PP -The following table includes command options specific to the MySQL Cluster program -\fBndb_error_reporter\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including -\fBndb_error_reporter\fR), see -Options Common to MySQL Cluster Programs(1)\&. -.PP -\fBndb_error_reporter\fR -did not support the -\fB\-\-help\fR -option prior to MySQL Cluster NDB 7\&.3\&.3 (Bug #11756666, Bug #48606)\&. The -\fB\-\-connection\-timeout\fR -\fB\-\-dry\-scp\fR, and -\fB\-\-skip\-nodegroup\fR -options were also added in this release (Bug #16602002)\&. -.sp -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.B Table\ \&18.88.\ \& This table describes command-line options for the ndb_error_reporter program -.TS -allbox tab(:); -lB lB lB. -T{ -Format -T}:T{ -Description -T}:T{ -Added or Removed -T} -.T& -l l l -l l l -l l l -l l l. -T{ -.PP ---connection-timeout=timeout -T}:T{ -Number of seconds to wait when connecting to nodes before timing - out. -T}:T{ -.PP -ADDED: NDB 7.3.3 -T} -T{ -.PP ---dry-scp -T}:T{ -Disable scp with remote hosts; used only for testing. -T}:T{ -.PP -ADDED: NDB 7.3.3 -T} -T{ -.PP ---fs -T}:T{ -Include file system data in error report; can use a large amount - of disk space -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---skip-nodegroup=nodegroup_id -T}:T{ -Skip all nodes in the node group having this ID. -T}:T{ -.PP -ADDED: NDB 7.3.3 -T} -.TE -.sp 1 -Usage -.sp -.if n \{\ -.RS 4 -.\} -.nf -ndb_error_reporter \fIpath/to/config\-file\fR [\fIusername\fR] [\fIoptions\fR] -.fi -.if n \{\ -.RE -.\} -.PP -This utility is intended for use on a management node host, and requires the path to the management host configuration file (usually named -config\&.ini)\&. Optionally, you can supply the name of a user that is able to access the cluster\*(Aqs data nodes using SSH, to copy the data node log files\&. -\fBndb_error_reporter\fR -then includes all of these files in archive that is created in the same directory in which it is run\&. The archive is named -ndb_error_report_\fIYYYYMMDDHHMMSS\fR\&.tar\&.bz2, where -\fIYYYYMMDDHHMMSS\fR -is a datetime string\&. -.PP -.\" ndb_error_reporter: options -\fBndb_error_reporter\fR -also accepts the options listed here: -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" connection-timeout option (ndb_error_reporter) -\fB\-\-connection\-timeout=\fR\fB\fItimeout\fR\fR -.TS -allbox tab(:); -l l s s -l l s s -l l l s -^ l l s. -T{ -\fBIntroduced\fR -T}:T{ -5\&.6\&.14\-ndb\-7\&.3\&.3 -T} -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-connection\-timeout=timeout -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -integer -T} -:T{ -\fBDefault\fR -T}:T{ -0 -T} -.TE -.sp 1 -Wait this many seconds when trying to connect to nodes before timing out\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" dry-scp option (ndb_error_reporter) -\fB\-\-dry\-scp\fR -.TS -allbox tab(:); -l l s s -l l s s -l l l s -^ l l s. -T{ -\fBIntroduced\fR -T}:T{ -5\&.6\&.14\-ndb\-7\&.3\&.3 -T} -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-dry\-scp -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -TRUE -T} -.TE -.sp 1 -Run -\fBndb_error_reporter\fR -without using scp from remote hosts\&. Used for testing only\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" fs option (ndb_error_reporter) -\fB\-\-fs\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-fs -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -FALSE -T} -.TE -.sp 1 -Copy the data node file systems to the management host and include them in the archive\&. -.sp -Because data node file systems can be extremely large, even after being compressed, we ask that you please do -\fInot\fR -send archives created using this option to Oracle unless you are specifically requested to do so\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" skip-nodegroup option (ndb_error_reporter) -\fB\-\-skip\-nodegroup=\fR\fB\fInodegroup_id\fR\fR -.TS -allbox tab(:); -l l s s -l l s s -l l l s -^ l l s. -T{ -\fBIntroduced\fR -T}:T{ -5\&.6\&.14\-ndb\-7\&.3\&.3 -T} -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-connection\-timeout=timeout -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -integer -T} -:T{ -\fBDefault\fR -T}:T{ -0 -T} -.TE -.sp 1 -Skip all nodes belong to the node group having the supplied node group ID\&. -.RE -.SH "COPYRIGHT" -.br -.PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. -.PP -This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. -.PP -This documentation 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. -.PP -You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. -.sp -.SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. -.SH AUTHOR -Oracle Corporation (http://dev.mysql.com/). diff --git a/mysql-wsrep-5.6/man/ndb_index_stat.1 b/mysql-wsrep-5.6/man/ndb_index_stat.1 deleted file mode 100644 index 6e5ed099..00000000 --- a/mysql-wsrep-5.6/man/ndb_index_stat.1 +++ /dev/null @@ -1,1028 +0,0 @@ -'\" t -.\" Title: \fBndb_index_stat\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.6 -.\" Language: English -.\" -.TH "\FBNDB_INDEX_STAT\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.\" ndb_index_stat -.SH "NAME" -ndb_index_stat \- NDB index statistics utility -.SH "SYNOPSIS" -.HP \w'\fBndb_index_stat\ \fR\fB\fIoptions\fR\fR\ 'u -\fBndb_index_stat \fR\fB\fIoptions\fR\fR -.SH "DESCRIPTION" -.PP -\fBndb_index_stat\fR -provides per\-fragment statistical information about indexes on -NDB -tables\&. This includes cache version and age, number of index entries per partition, and memory consumption by indexes\&. -Usage.PP -To obtain basic index statistics about a given -NDB -table, invoke -\fBndb_index_stat\fR -as shown here, with the name of the table as the first argument and the name of the database containing this table specified immediately following it, using the -\fB\-\-database\fR -(\fB\-d\fR) option: -.sp -.if n \{\ -.RS 4 -.\} -.nf -ndb_index_stat \fItable\fR \-d \fIdatabase\fR -.fi -.if n \{\ -.RE -.\} -.PP -In this example, we use -\fBndb_index_stat\fR -to obtain such information about an -NDB -table named -mytable -in the -test -database: -.\" ndb_index_stat: interpreting output -.\" ndb_index_stat: example -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fBndb_index_stat \-d test mytable\fR -table:City index:PRIMARY fragCount:2 -sampleVersion:3 loadTime:1399585986 sampleCount:1994 keyBytes:7976 -query cache: valid:1 sampleCount:1994 totalBytes:27916 -times in ms: save: 7\&.133 sort: 1\&.974 sort per sample: 0\&.000 -NDBT_ProgramExit: 0 \- OK -.fi -.if n \{\ -.RE -.\} -.PP -sampleVersion -is the version number of the cache from which the statistics data is taken\&. Running -\fBndb_index_stat\fR -with the -\fB\-\-update\fR -option causes sampleVersion to be incremented\&. -.PP -loadTime -shows when the cache was last updated\&. This is expressed as seconds since the Unix Epoch\&. -.PP -sampleCount -is the number of index entries found per partition\&. You can estimate the total number of entries by multiplying this by the number of fragments (shown as -fragCount)\&. -.PP -sampleCount -can be compared with the cardinality of -SHOW INDEX -or -INFORMATION_SCHEMA\&.STATISTICS, although the latter two provide a view of the table as a whole, while -\fBndb_index_stat\fR -provides a per\-fragment average\&. -.PP -keyBytes -is the number of bytes used by the index\&. In this example, the primary key is an integer, which requires four bytes for each index, so -keyBytes -can be calculated in this case as shown here: -.sp -.if n \{\ -.RS 4 -.\} -.nf - keyBytes = sampleCount * (4 bytes per index) = 1994 * 4 = 7976 -.fi -.if n \{\ -.RE -.\} -.PP -This information can also be obtained using the corresponding column definitions from -INFORMATION_SCHEMA\&.COLUMNS -(this requires a MySQL Server and a MySQL client application)\&. -.PP -totalBytes -is the total memory consumed by all indexes on the table, in bytes\&. -.PP -Timings shown in the preceding examples are specific to each invocation of -\fBndb_index_stat\fR\&. -.PP -The -\fB\-\-verbose\fR -option provides some additional output, as shown here: -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fBndb_index_stat \-d test mytable \-\-verbose\fR -random seed 1337010518 -connected -loop 1 of 1 -table:mytable index:PRIMARY fragCount:4 -sampleVersion:2 loadTime:1336751773 sampleCount:0 keyBytes:0 -read stats -query cache created -query cache: valid:1 sampleCount:0 totalBytes:0 -times in ms: save: 20\&.766 sort: 0\&.001 -disconnected -NDBT_ProgramExit: 0 \- OK -shell> -.fi -.if n \{\ -.RE -.\} -.sp -Options.PP -The following table includes options that are specific to the MySQL Cluster -\fBndb_index_stat\fR -utility\&. Additional descriptions are listed following the table\&. For options common to most MySQL Cluster programs (including -\fBndb_index_stat\fR), see -Options Common to MySQL Cluster Programs(1)\&. -.sp -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.B Table\ \&18.89.\ \& This table describes command-line options for the ndb_index_stat program -.TS -allbox tab(:); -lB lB lB. -T{ -Format -T}:T{ -Description -T}:T{ -Added or Removed -T} -.T& -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l. -T{ -.PP ---database=name, -.PP --d -T}:T{ -Name of the database containing the table. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---delete -T}:T{ -Delete index statistics for the given table, stopping any - auto-update previously configured. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---update -T}:T{ -Update index statistics for the given table, restarting any - auto-update previously configured. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---dump -T}:T{ -Print the query cache. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---query=# -T}:T{ -Perform a number of random range queries on first key attr (must - be int unsigned). -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---sys-drop -T}:T{ -Drop any statistics tables and events in NDB kernel (all - statistics are lost) -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---sys-create -T}:T{ -Create all statistics tables and events in NDB kernel, if none of - them already exist -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---sys-create-if-not-exist -T}:T{ -Create any statistics tables and events in NDB kernel that do not - already exist. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---sys-create-if-not-valid -T}:T{ -Create any statistics tables or events that do not already exist - in the NDB kernel. after dropping any that are invalid. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---sys-check -T}:T{ -Verify that NDB system index statistics and event tables exist. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---sys-skip-tables -T}:T{ -Do not apply sys-* options to tables. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---sys-skip-events -T}:T{ -Do not apply sys-* options to events. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---verbose, -.PP --v -T}:T{ -Turn on verbose output -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---loops=# -T}:T{ -Set the number of times to perform a given command. Default is 0. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -.TE -.sp 1 -.PP -\fBndb_index_stat statistics options\fR. The following options are used to generate index statistics\&. They work with a given table and database\&. They cannot be mixed with system options (see -ndb_index_stat system options)\&. -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" database option (ndb_index_stat) -.\" -d option (ndb_index_stat) -\fB\-\-database=\fR\fB\fIname\fR\fR, -\fB\-d \fR\fB\fIname\fR\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s -^ l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-database=name -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -string -T} -:T{ -\fBDefault\fR -T}:T{ -[none] -T} -:T{ -\fBMin Value\fR -T}:T{ -T} -:T{ -\fBMax Value\fR -T}:T{ -T} -.TE -.sp 1 -The name of the database that contains the table being queried\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" delete option (ndb_index_stat) -\fB\-\-delete\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s -^ l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-delete -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -false -T} -:T{ -\fBMin Value\fR -T}:T{ -T} -:T{ -\fBMax Value\fR -T}:T{ -T} -.TE -.sp 1 -Delete the index statistics for the given table, stopping any auto\-update that was previously configured\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" update option (ndb_index_stat) -\fB\-\-update\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s -^ l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-update -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -false -T} -:T{ -\fBMin Value\fR -T}:T{ -T} -:T{ -\fBMax Value\fR -T}:T{ -T} -.TE -.sp 1 -Update the index statistics for the given table, and restart any auto\-update that was previously configured\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" dump option (ndb_index_stat) -\fB\-\-dump\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s -^ l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-dump -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -false -T} -:T{ -\fBMin Value\fR -T}:T{ -T} -:T{ -\fBMax Value\fR -T}:T{ -T} -.TE -.sp 1 -Dump the contents of the query cache\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" query option (ndb_index_stat) -\fB\-\-query=\fR\fB\fI#\fR\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s -^ l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-query=# -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -numeric -T} -:T{ -\fBDefault\fR -T}:T{ -0 -T} -:T{ -\fBMin Value\fR -T}:T{ -0 -T} -:T{ -\fBMax Value\fR -T}:T{ -MAX_INT -T} -.TE -.sp 1 -Perform random range queries on first key attribute (must be int unsigned)\&. -.RE -.PP -\fBndb_index_stat system options\fR. The following options are used to generate and update the statistics tables in the NDB kernel\&. None of these options can be mixed with statistics options (see -ndb_index_stat statistics options)\&. -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" sys-drop option (ndb_index_stat) -\fB\-\-sys\-drop\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s -^ l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-sys\-drop -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -false -T} -:T{ -\fBMin Value\fR -T}:T{ -T} -:T{ -\fBMax Value\fR -T}:T{ -T} -.TE -.sp 1 -Drop all statistics tables and events in the NDB kernel\&. -\fIThis causes all statistics to be lost\fR\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" sys-create option (ndb_index_stat) -\fB\-\-sys\-create\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s -^ l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-sys\-create -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -false -T} -:T{ -\fBMin Value\fR -T}:T{ -T} -:T{ -\fBMax Value\fR -T}:T{ -T} -.TE -.sp 1 -Create all statistics tables and events in the NDB kernel\&. This works only if none of them exist previously\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" sys-create-if-not-exist option (ndb_index_stat) -\fBsys\-create\-if\-not\-exist\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s -^ l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-sys\-create\-if\-not\-exist -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -false -T} -:T{ -\fBMin Value\fR -T}:T{ -T} -:T{ -\fBMax Value\fR -T}:T{ -T} -.TE -.sp 1 -Create any NDB system statistics tables or events (or both) that do not already exist when the program is invoked\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" sys-create-if-not-valid option (ndb_index_stat) -\fB\-\-sys\-create\-if\-not\-valid\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s -^ l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-sys\-create\-if\-not\-valid -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -false -T} -:T{ -\fBMin Value\fR -T}:T{ -T} -:T{ -\fBMax Value\fR -T}:T{ -T} -.TE -.sp 1 -Create any NDB system statistics tables or events that do not already exist, after dropping any that are invalid\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" sys-check option (ndb_index_stat) -\fB\-\-sys\-check\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s -^ l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-sys\-check -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -false -T} -:T{ -\fBMin Value\fR -T}:T{ -T} -:T{ -\fBMax Value\fR -T}:T{ -T} -.TE -.sp 1 -Verify that all required system statistics tables and events exist in the NDB kernel\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" sys-skip-tables option (ndb_index_stat) -\fB\-\-sys\-skip\-tables\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s -^ l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-sys\-skip\-tables -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -false -T} -:T{ -\fBMin Value\fR -T}:T{ -T} -:T{ -\fBMax Value\fR -T}:T{ -T} -.TE -.sp 1 -Do not apply any -\fB\-\-sys\-*\fR -options to any statistics tables\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" sys-skip-events option (ndb_index_stat) -\fB\-\-sys\-skip\-events\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s -^ l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-sys\-skip\-events -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -false -T} -:T{ -\fBMin Value\fR -T}:T{ -T} -:T{ -\fBMax Value\fR -T}:T{ -T} -.TE -.sp 1 -Do not apply any -\fB\-\-sys\-*\fR -options to any events\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" verbose option (ndb_index_stat) -\fB\-\-verbose\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s -^ l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-verbose -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -false -T} -:T{ -\fBMin Value\fR -T}:T{ -T} -:T{ -\fBMax Value\fR -T}:T{ -T} -.TE -.sp 1 -Turn on verbose output\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" loops option (ndb_index_stat) -\fB\-\-loops=\fR\fB\fI#\fR\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s -^ l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-loops=# -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -numeric -T} -:T{ -\fBDefault\fR -T}:T{ -0 -T} -:T{ -\fBMin Value\fR -T}:T{ -0 -T} -:T{ -\fBMax Value\fR -T}:T{ -MAX_INT -T} -.TE -.sp 1 -Repeat commands this number of times (for use in testing)\&. -.RE -.SH "COPYRIGHT" -.br -.PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. -.PP -This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. -.PP -This documentation 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. -.PP -You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. -.sp -.SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. -.SH AUTHOR -Oracle Corporation (http://dev.mysql.com/). diff --git a/mysql-wsrep-5.6/man/ndb_mgm.1 b/mysql-wsrep-5.6/man/ndb_mgm.1 deleted file mode 100644 index 3b892e7e..00000000 --- a/mysql-wsrep-5.6/man/ndb_mgm.1 +++ /dev/null @@ -1,251 +0,0 @@ -'\" t -.\" Title: \fBndb_mgm\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.6 -.\" Language: English -.\" -.TH "\FBNDB_MGM\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.\" ndb_mgm -.\" MySQL Cluster: ndb_mgm -.\" MySQL Cluster: management client (ndb_mgm) -.\" management client (MySQL Cluster) -.\" ndb_mgm -.\" MySQL Cluster: administration -.\" administration of MySQL Cluster -.SH "NAME" -ndb_mgm \- the MySQL Cluster management client -.SH "SYNOPSIS" -.HP \w'\fBndb_mgm\ \fR\fB\fIoptions\fR\fR\ 'u -\fBndb_mgm \fR\fB\fIoptions\fR\fR -.SH "DESCRIPTION" -.PP -The -\fBndb_mgm\fR -management client process is actually not needed to run the cluster\&. Its value lies in providing a set of commands for checking the cluster\*(Aqs status, starting backups, and performing other administrative functions\&. The management client accesses the management server using a C API\&. Advanced users can also employ this API for programming dedicated management processes to perform tasks similar to those performed by -\fBndb_mgm\fR\&. -.PP -To start the management client, it is necessary to supply the host name and port number of the management server: -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fBndb_mgm [\fR\fB\fIhost_name\fR\fR\fB [\fR\fB\fIport_num\fR\fR\fB]]\fR -.fi -.if n \{\ -.RE -.\} -.PP -For example: -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fBndb_mgm ndb_mgmd\&.mysql\&.com 1186\fR -.fi -.if n \{\ -.RE -.\} -.PP -The default host name and port number are -localhost -and 1186, respectively\&. -.\" MySQL Cluster: administration -.\" MySQL Cluster: commands -.\" command options (MySQL Cluster): ndb_mgm -.\" MySQL Cluster: mgm process -.PP -The following table includes options that are specific to the MySQL Cluster management client program -\fBndb_mgm\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including -\fBndb_mgm\fR), see -Options Common to MySQL Cluster Programs(1)\&. -.sp -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.B Table\ \&18.81.\ \& This table describes command-line options for the ndb_mgm program -.TS -allbox tab(:); -lB lB lB. -T{ -Format -T}:T{ -Description -T}:T{ -Added or Removed -T} -.T& -l l l -l l l. -T{ -.PP ---try-reconnect=#, -.PP --t -T}:T{ -Specify number of tries for connecting to ndb_mgmd (0 = infinite) -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---execute=name, -.PP --e -T}:T{ -Execute command and exit -T}:T{ -.PP -All MySQL 5.6 based releases -T} -.TE -.sp 1 -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" execute option (ndb_mgm) -.\" -e option (ndb_mgm) -\fB\-\-execute=\fR\fBcommand\fR, -\fB\-e \fR\fBcommand\fR -.TS -allbox tab(:); -l l s s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-execute=name -T} -.TE -.sp 1 -This option can be used to send a command to the MySQL Cluster management client from the system shell\&. For example, either of the following is equivalent to executing -SHOW -in the management client: -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fBndb_mgm \-e "SHOW"\fR -shell> \fBndb_mgm \-\-execute="SHOW"\fR -.fi -.if n \{\ -.RE -.\} -.sp -This is analogous to how the -\fB\-\-execute\fR -or -\fB\-e\fR -option works with the -\fBmysql\fR -command\-line client\&. See -Section\ \&4.2.4, \(lqUsing Options on the Command Line\(rq\&. -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBNote\fR -.ps -1 -.br -If the management client command to be passed using this option contains any space characters, then the command -\fImust\fR -be enclosed in quotation marks\&. Either single or double quotation marks may be used\&. If the management client command contains no space characters, the quotation marks are optional\&. -.sp .5v -.RE -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -\fB\-\-try\-reconnect=\fR\fB\fInumber\fR\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-try\-reconnect=# -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -TRUE -T} -.TE -.sp 1 -If the connection to the management server is broken, the node tries to reconnect to it every 5 seconds until it succeeds\&. By using this option, it is possible to limit the number of attempts to -\fInumber\fR -before giving up and reporting an error instead\&. -.RE -.PP -Additional information about using -\fBndb_mgm\fR -can be found in -Section\ \&18.5.2, \(lqCommands in the MySQL Cluster Management Client\(rq\&. -.SH "COPYRIGHT" -.br -.PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. -.PP -This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. -.PP -This documentation 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. -.PP -You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. -.sp -.SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. -.SH AUTHOR -Oracle Corporation (http://dev.mysql.com/). diff --git a/mysql-wsrep-5.6/man/ndb_mgmd.8 b/mysql-wsrep-5.6/man/ndb_mgmd.8 deleted file mode 100644 index 28d1a8a4..00000000 --- a/mysql-wsrep-5.6/man/ndb_mgmd.8 +++ /dev/null @@ -1,1322 +0,0 @@ -'\" t -.\" Title: \fBndb_mgmd\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.6 -.\" Language: English -.\" -.TH "\FBNDB_MGMD\FR" "8" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.\" ndb_mgmd (MySQL Cluster process) -.\" MySQL Cluster: ndb_mgmd process -.\" MySQL Cluster: management nodes -.\" management nodes (MySQL Cluster) -.\" ndb_mgmd -.SH "NAME" -ndb_mgmd \- the MySQL Cluster management server daemon -.SH "SYNOPSIS" -.HP \w'\fBndb_mgmd\ \fR\fB\fIoptions\fR\fR\ 'u -\fBndb_mgmd \fR\fB\fIoptions\fR\fR -.SH "DESCRIPTION" -.PP -The management server is the process that reads the cluster configuration file and distributes this information to all nodes in the cluster that request it\&. It also maintains a log of cluster activities\&. Management clients can connect to the management server and check the cluster\*(Aqs status\&. -.\" MySQL Cluster: administration -.\" MySQL Cluster: commands -.\" command options (MySQL Cluster): ndb_mgmd -.\" MySQL Cluster: mgmd process -.PP -The following table includes options that are specific to the MySQL Cluster management server program -\fBndb_mgmd\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including -\fBndb_mgmd\fR), see -Options Common to MySQL Cluster Programs(1)\&. -.sp -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.B Table\ \&18.80.\ \& This table describes command-line options for the ndb_mgmd program -.TS -allbox tab(:); -lB lB lB. -T{ -Format -T}:T{ -Description -T}:T{ -Added or Removed -T} -.T& -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l. -T{ -.PP ---config-file=file, -.PP --f -T}:T{ -Specify the cluster configuration file; in NDB-6.4.0 and later, - needs --reload or --initial to override configuration cache if - present -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---configdir=directory, -.PP ---config-dir=directory -T}:T{ -Specify the cluster management server's configuration cache - directory -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---bind-address=ip_address -T}:T{ -Local bind address -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---print-full-config, -.PP --P -T}:T{ -Print full configuration and exit -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---daemon, -.PP --d -T}:T{ -Run ndb_mgmd in daemon mode (default) -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---nodaemon -T}:T{ -Do not run ndb_mgmd as a daemon -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---interactive -T}:T{ -Run ndb_mgmd in interactive mode (not officially supported in - production; for testing purposes only) -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---log-name=name -T}:T{ -A name to use when writing messages applying to this node in the - cluster log. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---no-nodeid-checks -T}:T{ -Do not provide any node id checks -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---mycnf -T}:T{ -Read cluster configuration data from the my.cnf file -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---reload -T}:T{ -Causes the management server to compare the configuration file - with its configuration cache -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---initial -T}:T{ -Causes the management server reload its configuration data from - the configuration file, bypassing the configuration cache -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---nowait-nodes=list -T}:T{ -Do not wait for these management nodes when starting this - management server. Also requires --ndb-nodeid to be used. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---config-cache[=TRUE|FALSE] -T}:T{ -Enable the management server configuration cache; TRUE by default. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---install[=name] -T}:T{ -Used to install the management server process as a Windows - service. Does not apply on non-Windows platforms. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---remove[=name] -T}:T{ -Used to remove a management server process that was previously - installed as a Windows service, optionally specifying the name of - the service to be removed. Does not apply on non-Windows - platforms. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -.TE -.sp 1 -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" bind-address option (ndb_mgmd) -\fB\-\-bind\-address=\fR\fB\fIhost\fR\fR\fB[:\fR\fB\fIport\fR\fR\fB]\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-bind\-address=ip_address -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -string -T} -:T{ -\fBDefault\fR -T}:T{ -[none] -T} -.TE -.sp 1 -When specified, this option limits management server connections by management clients to clients at the specified host name or IP address (and possibly port, if this is also specified)\&. In such cases, a management client attempting to connect to the management server from any other address fails with the error -Unable to setup port: \fIhost\fR:\fIport\fR! -.sp -If the -\fIport\fR -is not specified, the management client attempts to use port 1186\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" no-nodeid-checks option (ndb_mgmd) -\fB\-\-no\-nodeid\-checks\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-no\-nodeid\-checks -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -FALSE -T} -.TE -.sp 1 -Do not perform any checks of node IDs\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" configdir option (ndb_mgmd) -\fB\-\-configdir=\fR\fB\fIpath\fR\fR -.TS -allbox tab(:); -l l s s -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-configdir=directory -T} -T{ -\ \& -T}:T{ -\-\-config\-dir=directory -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -file name -T} -:T{ -\fBDefault\fR -T}:T{ -$INSTALLDIR/mysql\-cluster -T} -.TE -.sp 1 -Specifies the cluster management server\*(Aqs configuration cache directory\&. -\fB\-\-config\-dir\fR -is an alias for this option\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" config-cache option (ndb_mgmd) -\fB\-\-config\-cache\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-config\-cache[=TRUE|FALSE] -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -TRUE -T} -.TE -.sp 1 -This option, whose default value is -1 -(or -TRUE, or -ON), can be used to disable the management server\*(Aqs configuration cache, so that it reads its configuration from -config\&.ini -every time it starts (see -Section\ \&18.3.2, \(lqMySQL Cluster Configuration Files\(rq)\&. You can do this by starting the -\fBndb_mgmd\fR -process with any one of the following options: -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -\fB\-\-config\-cache=0\fR -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -\fB\-\-config\-cache=FALSE\fR -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -\fB\-\-config\-cache=OFF\fR -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -\fB\-\-skip\-config\-cache\fR -.RE -.sp -Using one of the options just listed is effective only if the management server has no stored configuration at the time it is started\&. If the management server finds any configuration cache files, then the -\fB\-\-config\-cache\fR -option or the -\fB\-\-skip\-config\-cache\fR -option is ignored\&. Therefore, to disable configuration caching, the option should be used the -\fIfirst\fR -time that the management server is started\&. Otherwise\(emthat is, if you wish to disable configuration caching for a management server that has -\fIalready\fR -created a configuration cache\(emyou must stop the management server, delete any existing configuration cache files manually, then restart the management server with -\fB\-\-skip\-config\-cache\fR -(or with -\fB\-\-config\-cache\fR -set equal to 0, -OFF, or -FALSE)\&. -.sp -Configuration cache files are normally created in a directory named -mysql\-cluster -under the installation directory (unless this location has been overridden using the -\fB\-\-configdir\fR -option)\&. Each time the management server updates its configuration data, it writes a new cache file\&. The files are named sequentially in order of creation using the following format: -.sp -.if n \{\ -.RS 4 -.\} -.nf -ndb_\fInode\-id\fR_config\&.bin\&.\fIseq\-number\fR -.fi -.if n \{\ -.RE -.\} -.sp -\fInode\-id\fR -is the management server\*(Aqs node ID; -\fIseq\-number\fR -is a sequence number, beginning with 1\&. For example, if the management server\*(Aqs node ID is 5, then the first three configuration cache files would, when they are created, be named -ndb_5_config\&.bin\&.1, -ndb_5_config\&.bin\&.2, and -ndb_5_config\&.bin\&.3\&. -.sp -If your intent is to purge or reload the configuration cache without actually disabling caching, you should start -\fBndb_mgmd\fR -with one of the options -\fB\-\-reload\fR -or -\fB\-\-initial\fR -instead of -\fB\-\-skip\-config\-cache\fR\&. -.sp -To re\-enable the configuration cache, simply restart the management server, but without the -\fB\-\-config\-cache\fR -or -\fB\-\-skip\-config\-cache\fR -option that was used previously to disable the configuration cache\&. -.sp -\fBndb_mgmd\fR -does not check for the configuration directory (\fB\-\-configdir\fR) or attempts to create one when -\fB\-\-skip\-config\-cache\fR -is used\&. (Bug #13428853) -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" config-file option (ndb_mgmd) -.\" -f option (ndb_mgmd) -.\" -c option (ndb_mgmd) (OBSOLETE) -\fB\-\-config\-file=\fR\fB\fIfilename\fR\fR, -\fB\-f \fR\fB\fIfilename\fR\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-config\-file=file -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -file name -T} -:T{ -\fBDefault\fR -T}:T{ -[none] -T} -.TE -.sp 1 -Instructs the management server as to which file it should use for its configuration file\&. By default, the management server looks for a file named -config\&.ini -in the same directory as the -\fBndb_mgmd\fR -executable; otherwise the file name and location must be specified explicitly\&. -.sp -This option has no default value, and is ignored unless the management server is forced to read the configuration file, either because -\fBndb_mgmd\fR -was started with the -\fB\-\-reload\fR -or -\fB\-\-initial\fR -option, or because the management server could not find any configuration cache\&. This option is also read if -\fBndb_mgmd\fR -was started with -\fB\-\-config\-cache=OFF\fR\&. See -Section\ \&18.3.2, \(lqMySQL Cluster Configuration Files\(rq, for more information\&. -.sp -Formerly, using this option together with -\fB\-\-initial\fR -caused removal of the configuration cache even if the file was not found\&. This issue was resolved in MySQL Cluster NDB 7\&.3\&.2\&. (Bug #1299289) -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_mgmd: mycnf option -.\" mycnf option: ndb_mgmd -\fB\-\-mycnf\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-mycnf -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -FALSE -T} -.TE -.sp 1 -Read configuration data from the -my\&.cnf -file\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" daemon option (ndb_mgmd) -.\" -d option (ndb_mgmd) -\fB\-\-daemon\fR, -\fB\-d\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-daemon -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -TRUE -T} -.TE -.sp 1 -Instructs -\fBndb_mgmd\fR -to start as a daemon process\&. This is the default behavior\&. -.sp -This option has no effect when running -\fBndb_mgmd\fR -on Windows platforms\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" interactive option (ndb_mgmd) -\fB\-\-interactive\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-interactive -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -FALSE -T} -.TE -.sp 1 -Starts -\fBndb_mgmd\fR -in interactive mode; that is, an -\fBndb_mgm\fR -client session is started as soon as the management server is running\&. This option does not start any other MySQL Cluster nodes\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" initial option (ndb_mgmd) -\fB\-\-initial\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-initial -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -FALSE -T} -.TE -.sp 1 -Configuration data is cached internally, rather than being read from the cluster global configuration file each time the management server is started (see -Section\ \&18.3.2, \(lqMySQL Cluster Configuration Files\(rq)\&. Using the -\fB\-\-initial\fR -option overrides this behavior, by forcing the management server to delete any existing cache files, and then to re\-read the configuration data from the cluster configuration file and to build a new cache\&. -.sp -This differs in two ways from the -\fB\-\-reload\fR -option\&. First, -\fB\-\-reload\fR -forces the server to check the configuration file against the cache and reload its data only if the contents of the file are different from the cache\&. Second, -\fB\-\-reload\fR -does not delete any existing cache files\&. -.sp -If -\fBndb_mgmd\fR -is invoked with -\fB\-\-initial\fR -but cannot find a global configuration file, the management server cannot start\&. -.sp -When a management server starts, it checks for another management server in the same MySQL Cluster and tries to use the other management server\*(Aqs configuration data; -\fBndb_mgmd\fR -ignores -\fB\-\-initial\fR -unless it is the only management server running\&. This behavior also has implications when performing a rolling restart of a MySQL Cluster with multiple management nodes\&. See -Section\ \&18.5.5, \(lqPerforming a Rolling Restart of a MySQL Cluster\(rq, for more information\&. -.sp -Formerly, using this option together with the -\fB\-\-config\-file\fR -option caused removal of the configuration cache even if the file was not found\&. Starting with MySQL Cluster NDB 7\&.3\&.2, the cache is cleared in such cases only if the configuration file is actually found\&. (Bug #1299289) -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" log-name option (ndb_mgmd) -\fB\-\-log\-name=\fR\fB\fIname\fR\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-log\-name=name -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -string -T} -:T{ -\fBDefault\fR -T}:T{ -MgmtSrvr -T} -.TE -.sp 1 -Provides a name to be used for this node in the cluster log\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" nodaemon option (ndb_mgmd) -\fB\-\-nodaemon\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-nodaemon -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -FALSE -T} -.TE -.sp 1 -Instructs -\fBndb_mgmd\fR -not to start as a daemon process\&. -.sp -The default behavior for -\fBndb_mgmd\fR -on Windows is to run in the foreground, making this option unnecessary on Windows platforms\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" print-full-config option (ndb_mgmd) -.\" -P option (ndb_mgmd) -\fB\-\-print\-full\-config\fR, -\fB\-P\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-print\-full\-config -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -FALSE -T} -.TE -.sp 1 -Shows extended information regarding the configuration of the cluster\&. With this option on the command line the -\fBndb_mgmd\fR -process prints information about the cluster setup including an extensive list of the cluster configuration sections as well as parameters and their values\&. Normally used together with the -\fB\-\-config\-file\fR -(\fB\-f\fR) option\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" reload option (ndb_mgmd) -\fB\-\-reload\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-reload -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -FALSE -T} -.TE -.sp 1 -In MySQL Cluster NDB 7\&.3, configuration data is stored internally rather than being read from the cluster global configuration file each time the management server is started (see -Section\ \&18.3.2, \(lqMySQL Cluster Configuration Files\(rq)\&. Using this option forces the management server to check its internal data store against the cluster configuration file and to reload the configuration if it finds that the configuration file does not match the cache\&. Existing configuration cache files are preserved, but not used\&. -.sp -This differs in two ways from the -\fB\-\-initial\fR -option\&. First, -\fB\-\-initial\fR -causes all cache files to be deleted\&. Second, -\fB\-\-initial\fR -forces the management server to re\-read the global configuration file and construct a new cache\&. -.sp -If the management server cannot find a global configuration file, then the -\fB\-\-reload\fR -option is ignored\&. -.sp -When a management server starts, it checks for another management server in the same MySQL Cluster and tries to use the other management server\*(Aqs configuration data; -\fBndb_mgmd\fR -ignores -\fB\-\-reload\fR -unless it is the only management server running\&. This behavior also has implications when performing a rolling restart of a MySQL Cluster with multiple management nodes\&. See -Section\ \&18.5.5, \(lqPerforming a Rolling Restart of a MySQL Cluster\(rq, for more information\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" nowait-nodes option (ndb_mgmd) -\fB\-\-nowait\-nodes\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s -^ l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-nowait\-nodes=list -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -numeric -T} -:T{ -\fBDefault\fR -T}:T{ -T} -:T{ -\fBMin Value\fR -T}:T{ -1 -T} -:T{ -\fBMax Value\fR -T}:T{ -255 -T} -.TE -.sp 1 -When starting a MySQL Cluster is configured with two management nodes, each management server normally checks to see whether the other -\fBndb_mgmd\fR -is also operational and whether the other management server\*(Aqs configuration is identical to its own\&. However, it is sometimes desirable to start the cluster with only one management node (and perhaps to allow the other -\fBndb_mgmd\fR -to be started later)\&. This option causes the management node to bypass any checks for any other management nodes whose node IDs are passed to this option, permitting the cluster to start as though configured to use only the management node that was started\&. -.sp -For purposes of illustration, consider the following portion of a -config\&.ini -file (where we have omitted most of the configuration parameters that are not relevant to this example): -.sp -.if n \{\ -.RS 4 -.\} -.nf -[ndbd] -NodeId = 1 -HostName = 192\&.168\&.0\&.101 -[ndbd] -NodeId = 2 -HostName = 192\&.168\&.0\&.102 -[ndbd] -NodeId = 3 -HostName = 192\&.168\&.0\&.103 -[ndbd] -NodeId = 4 -HostName = 192\&.168\&.0\&.104 -[ndb_mgmd] -NodeId = 10 -HostName = 192\&.168\&.0\&.150 -[ndb_mgmd] -NodeId = 11 -HostName = 192\&.168\&.0\&.151 -[api] -NodeId = 20 -HostName = 192\&.168\&.0\&.200 -[api] -NodeId = 21 -HostName = 192\&.168\&.0\&.201 -.fi -.if n \{\ -.RE -.\} -.sp -Assume that you wish to start this cluster using only the management server having node ID -10 -and running on the host having the IP address 192\&.168\&.0\&.150\&. (Suppose, for example, that the host computer on which you intend to the other management server is temporarily unavailable due to a hardware failure, and you are waiting for it to be repaired\&.) To start the cluster in this way, use a command line on the machine at 192\&.168\&.0\&.150 to enter the following command: -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fBndb_mgmd \-\-ndb\-nodeid=10 \-\-nowait\-nodes=11\fR -.fi -.if n \{\ -.RE -.\} -.sp -As shown in the preceding example, when using -\fB\-\-nowait\-nodes\fR, you must also use the -\fB\-\-ndb\-nodeid\fR -option to specify the node ID of this -\fBndb_mgmd\fR -process\&. -.sp -You can then start each of the cluster\*(Aqs data nodes in the usual way\&. If you wish to start and use the second management server in addition to the first management server at a later time without restarting the data nodes, you must start each data node with a connection string that references both management servers, like this: -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fBndbd \-c 192\&.168\&.0\&.150,192\&.168\&.0\&.151\fR -.fi -.if n \{\ -.RE -.\} -.sp -The same is true with regard to the connection string used with any -\fBmysqld\fR -processes that you wish to start as MySQL Cluster SQL nodes connected to this cluster\&. See -Section\ \&18.3.2.3, \(lqMySQL Cluster Connection Strings\(rq, for more information\&. -.sp -When used with -\fBndb_mgmd\fR, this option affects the behavior of the management node with regard to other management nodes only\&. Do not confuse it with the -\fB\-\-nowait\-nodes\fR -option used with -\fBndbd\fR -or -\fBndbmtd\fR -to permit a cluster to start with fewer than its full complement of data nodes; when used with data nodes, this option affects their behavior only with regard to other data nodes\&. -.sp -Multiple management node IDs may be passed to this option as a comma\-separated list\&. Each node ID must be no less than 1 and no greater than 255\&. In practice, it is quite rare to use more than two management servers for the same MySQL Cluster (or to have any need for doing so); in most cases you need to pass to this option only the single node ID for the one management server that you do not wish to use when starting the cluster\&. -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBNote\fR -.ps -1 -.br -When you later start the -\(lqmissing\(rq -management server, its configuration must match that of the management server that is already in use by the cluster\&. Otherwise, it fails the configuration check performed by the existing management server, and does not start\&. -.sp .5v -.RE -.RE -.PP -It is not strictly necessary to specify a connection string when starting the management server\&. However, if you are using more than one management server, a connection string should be provided and each node in the cluster should specify its node ID explicitly\&. -.PP -See -Section\ \&18.3.2.3, \(lqMySQL Cluster Connection Strings\(rq, for information about using connection strings\&. -\fBndb_mgmd\fR(8), describes other options for -\fBndb_mgmd\fR\&. -.PP -The following files are created or used by -\fBndb_mgmd\fR -in its starting directory, and are placed in the -DataDir -as specified in the -config\&.ini -configuration file\&. In the list that follows, -\fInode_id\fR -is the unique node identifier\&. -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" MySQL Cluster: configuration -.\" configuring MySQL Cluster -.\" config.ini (MySQL Cluster) -config\&.ini -is the configuration file for the cluster as a whole\&. This file is created by the user and read by the management server\&. -Section\ \&18.3, \(lqConfiguration of MySQL Cluster\(rq, discusses how to set up this file\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -ndb_\fInode_id\fR_cluster\&.log -is the cluster events log file\&. Examples of such events include checkpoint startup and completion, node startup events, node failures, and levels of memory usage\&. A complete listing of cluster events with descriptions may be found in -Section\ \&18.5, \(lqManagement of MySQL Cluster\(rq\&. -.sp -When the size of the cluster log reaches one million bytes, the file is renamed to -ndb_\fInode_id\fR_cluster\&.log\&.\fIseq_id\fR, where -\fIseq_id\fR -is the sequence number of the cluster log file\&. (For example: If files with the sequence numbers 1, 2, and 3 already exist, the next log file is named using the number -4\&.) -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -ndb_\fInode_id\fR_out\&.log -is the file used for -stdout -and -stderr -when running the management server as a daemon\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -ndb_\fInode_id\fR\&.pid -is the process ID file used when running the management server as a daemon\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" install option (ndb_mgmd) -\fB\-\-install[=\fR\fB\fIname\fR\fR\fB]\fR -.TS -allbox tab(:); -l l s s -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-install[=name] -T} -T{ -\fBPlatform Specific\fR -T}:T{ -Windows -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -string -T} -:T{ -\fBDefault\fR -T}:T{ -ndb_mgmd -T} -.TE -.sp 1 -Causes -\fBndb_mgmd\fR -to be installed as a Windows service\&. Optionally, you can specify a name for the service; if not set, the service name defaults to -ndb_mgmd\&. Although it is preferable to specify other -\fBndb_mgmd\fR -program options in a -my\&.ini -or -my\&.cnf -configuration file, it is possible to use them together with -\fB\-\-install\fR\&. However, in such cases, the -\fB\-\-install\fR -option must be specified first, before any other options are given, for the Windows service installation to succeed\&. -.sp -It is generally not advisable to use this option together with the -\fB\-\-initial\fR -option, since this causes the configuration cache to be wiped and rebuilt every time the service is stopped and started\&. Care should also be taken if you intend to use any other -\fBndb_mgmd\fR -options that affect the starting of the management server, and you should make absolutely certain you fully understand and allow for any possible consequences of doing so\&. -.sp -The -\fB\-\-install\fR -option has no effect on non\-Windows platforms\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" remove option (ndb_mgmd) -\fB\-\-remove[=\fR\fB\fIname\fR\fR\fB]\fR -.TS -allbox tab(:); -l l s s -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-remove[=name] -T} -T{ -\fBPlatform Specific\fR -T}:T{ -Windows -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -string -T} -:T{ -\fBDefault\fR -T}:T{ -ndb_mgmd -T} -.TE -.sp 1 -Causes an -\fBndb_mgmd\fR -process that was previously installed as a Windows service to be removed\&. Optionally, you can specify a name for the service to be uninstalled; if not set, the service name defaults to -ndb_mgmd\&. -.sp -The -\fB\-\-remove\fR -option has no effect on non\-Windows platforms\&. -.RE -.SH "COPYRIGHT" -.br -.PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. -.PP -This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. -.PP -This documentation 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. -.PP -You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. -.sp -.SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. -.SH AUTHOR -Oracle Corporation (http://dev.mysql.com/). diff --git a/mysql-wsrep-5.6/man/ndb_print_backup_file.1 b/mysql-wsrep-5.6/man/ndb_print_backup_file.1 deleted file mode 100644 index ac788d18..00000000 --- a/mysql-wsrep-5.6/man/ndb_print_backup_file.1 +++ /dev/null @@ -1,89 +0,0 @@ -'\" t -.\" Title: \fBndb_print_backup_file\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.6 -.\" Language: English -.\" -.TH "\FBNDB_PRINT_BACKUP_" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.\" ndb_print_backup_file -.SH "NAME" -ndb_print_backup_file \- print NDB backup file contents -.SH "SYNOPSIS" -.HP \w'\fBndb_print_backup_file\ \fR\fB\fIfile_name\fR\fR\ 'u -\fBndb_print_backup_file \fR\fB\fIfile_name\fR\fR -.SH "DESCRIPTION" -.PP -\fBndb_print_backup_file\fR -obtains diagnostic information from a cluster backup file\&. -Usage -.sp -.if n \{\ -.RS 4 -.\} -.nf -ndb_print_backup_file \fIfile_name\fR -.fi -.if n \{\ -.RE -.\} -.PP -\fIfile_name\fR -is the name of a cluster backup file\&. This can be any of the files (\&.Data, -\&.ctl, or -\&.log -file) found in a cluster backup directory\&. These files are found in the data node\*(Aqs backup directory under the subdirectory -BACKUP\-\fI#\fR, where -\fI#\fR -is the sequence number for the backup\&. For more information about cluster backup files and their contents, see -Section\ \&18.5.3.1, \(lqMySQL Cluster Backup Concepts\(rq\&. -.PP -Like -\fBndb_print_schema_file\fR -and -\fBndb_print_sys_file\fR -(and unlike most of the other -NDB -utilities that are intended to be run on a management server host or to connect to a management server) -\fBndb_print_backup_file\fR -must be run on a cluster data node, since it accesses the data node file system directly\&. Because it does not make use of the management server, this utility can be used when the management server is not running, and even when the cluster has been completely shut down\&. -Additional Options.PP -None\&. -.SH "COPYRIGHT" -.br -.PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. -.PP -This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. -.PP -This documentation 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. -.PP -You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. -.sp -.SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. -.SH AUTHOR -Oracle Corporation (http://dev.mysql.com/). diff --git a/mysql-wsrep-5.6/man/ndb_print_schema_file.1 b/mysql-wsrep-5.6/man/ndb_print_schema_file.1 deleted file mode 100644 index d28b3a5f..00000000 --- a/mysql-wsrep-5.6/man/ndb_print_schema_file.1 +++ /dev/null @@ -1,89 +0,0 @@ -'\" t -.\" Title: \fBndb_print_schema_file\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.6 -.\" Language: English -.\" -.TH "\FBNDB_PRINT_SCHEMA_" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.\" ndb_print_schema_file -.SH "NAME" -ndb_print_schema_file \- print NDB schema file contents -.SH "SYNOPSIS" -.HP \w'\fBndb_print_schema_file\ \fR\fB\fIfile_name\fR\fR\ 'u -\fBndb_print_schema_file \fR\fB\fIfile_name\fR\fR -.SH "DESCRIPTION" -.PP -\fBndb_print_schema_file\fR -obtains diagnostic information from a cluster schema file\&. -Usage -.sp -.if n \{\ -.RS 4 -.\} -.nf -ndb_print_schema_file \fIfile_name\fR -.fi -.if n \{\ -.RE -.\} -.PP -\fIfile_name\fR -is the name of a cluster schema file\&. For more information about cluster schema files, see -\m[blue]\fBMySQL Cluster Data Node File System Directory Files\fR\m[]\&\s-2\u[1]\d\s+2\&. -.PP -Like -\fBndb_print_backup_file\fR -and -\fBndb_print_sys_file\fR -(and unlike most of the other -NDB -utilities that are intended to be run on a management server host or to connect to a management server) -\fBndb_schema_backup_file\fR -must be run on a cluster data node, since it accesses the data node file system directly\&. Because it does not make use of the management server, this utility can be used when the management server is not running, and even when the cluster has been completely shut down\&. -Additional Options.PP -None\&. -.SH "COPYRIGHT" -.br -.PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. -.PP -This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. -.PP -This documentation 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. -.PP -You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. -.sp -.SH "NOTES" -.IP " 1." 4 -MySQL Cluster Data Node File System Directory Files -.RS 4 -\%http://dev.mysql.com/doc/ndbapi/en/ndb-internals-ndbd-filesystemdir-files.html -.RE -.SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. -.SH AUTHOR -Oracle Corporation (http://dev.mysql.com/). diff --git a/mysql-wsrep-5.6/man/ndb_print_sys_file.1 b/mysql-wsrep-5.6/man/ndb_print_sys_file.1 deleted file mode 100644 index a49701f3..00000000 --- a/mysql-wsrep-5.6/man/ndb_print_sys_file.1 +++ /dev/null @@ -1,92 +0,0 @@ -'\" t -.\" Title: \fBndb_print_sys_file\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.6 -.\" Language: English -.\" -.TH "\FBNDB_PRINT_SYS_FIL" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.\" ndb_print_sys_file -.SH "NAME" -ndb_print_sys_file \- print NDB system file contents -.SH "SYNOPSIS" -.HP \w'\fBndb_print_sys_file\ \fR\fB\fIfile_name\fR\fR\ 'u -\fBndb_print_sys_file \fR\fB\fIfile_name\fR\fR -.SH "DESCRIPTION" -.PP -\fBndb_print_sys_file\fR -obtains diagnostic information from a MySQL Cluster system file\&. -Usage -.sp -.if n \{\ -.RS 4 -.\} -.nf -ndb_print_sys_file \fIfile_name\fR -.fi -.if n \{\ -.RE -.\} -.PP -\fIfile_name\fR -is the name of a cluster system file (sysfile)\&. Cluster system files are located in a data node\*(Aqs data directory (DataDir); the path under this directory to system files matches the pattern -ndb_\fI#\fR_fs/D\fI#\fR/DBDIH/P\fI#\fR\&.sysfile\&. In each case, the -\fI#\fR -represents a number (not necessarily the same number)\&. For more information, see -\m[blue]\fBMySQL Cluster Data Node File System Directory Files\fR\m[]\&\s-2\u[1]\d\s+2\&. -.PP -Like -\fBndb_print_backup_file\fR -and -\fBndb_print_schema_file\fR -(and unlike most of the other -NDB -utilities that are intended to be run on a management server host or to connect to a management server) -\fBndb_print_backup_file\fR -must be run on a cluster data node, since it accesses the data node file system directly\&. Because it does not make use of the management server, this utility can be used when the management server is not running, and even when the cluster has been completely shut down\&. -Additional Options.PP -None\&. -.SH "COPYRIGHT" -.br -.PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. -.PP -This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. -.PP -This documentation 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. -.PP -You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. -.sp -.SH "NOTES" -.IP " 1." 4 -MySQL Cluster Data Node File System Directory Files -.RS 4 -\%http://dev.mysql.com/doc/ndbapi/en/ndb-internals-ndbd-filesystemdir-files.html -.RE -.SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. -.SH AUTHOR -Oracle Corporation (http://dev.mysql.com/). diff --git a/mysql-wsrep-5.6/man/ndb_restore.1 b/mysql-wsrep-5.6/man/ndb_restore.1 deleted file mode 100644 index e6b312a6..00000000 --- a/mysql-wsrep-5.6/man/ndb_restore.1 +++ /dev/null @@ -1,2217 +0,0 @@ -'\" t -.\" Title: \fBndb_restore\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.6 -.\" Language: English -.\" -.TH "\FBNDB_RESTORE\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.\" MySQL Cluster: backups -.\" backups: in MySQL Cluster -.\" MySQL Cluster: restoring backups -.\" restoring backups: in MySQL Cluster -.\" ndb_restore -.SH "NAME" -ndb_restore \- restore a MySQL Cluster backup -.SH "SYNOPSIS" -.HP \w'\fBndb_restore\ \fR\fB\fIoptions\fR\fR\ 'u -\fBndb_restore \fR\fB\fIoptions\fR\fR -.SH "DESCRIPTION" -.PP -The cluster restoration program is implemented as a separate command\-line utility -\fBndb_restore\fR, which can normally be found in the MySQL -bin -directory\&. This program reads the files created as a result of the backup and inserts the stored information into the database\&. -.PP -\fBndb_restore\fR -must be executed once for each of the backup files that were created by the -START BACKUP -command used to create the backup (see -Section\ \&18.5.3.2, \(lqUsing The MySQL Cluster Management Client to Create a Backup\(rq)\&. This is equal to the number of data nodes in the cluster at the time that the backup was created\&. -.\" single user mode (MySQL Cluster): and ndb_restore -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBNote\fR -.ps -1 -.br -.PP -Before using -\fBndb_restore\fR, it is recommended that the cluster be running in single user mode, unless you are restoring multiple data nodes in parallel\&. See -Section\ \&18.5.8, \(lqMySQL Cluster Single User Mode\(rq, for more information\&. -.sp .5v -.RE -.PP -The following table includes options that are specific to the MySQL Cluster native backup restoration program -\fBndb_restore\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including -\fBndb_restore\fR), see -Options Common to MySQL Cluster Programs(1)\&. -.sp -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.B Table\ \&18.91.\ \& This table describes command-line options for the ndb_restore program -.TS -allbox tab(:); -lB lB lB. -T{ -Format -T}:T{ -Description -T}:T{ -Added or Removed -T} -.T& -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l. -T{ -.PP ---connect, -.PP --c -T}:T{ -Alias for --connectstring. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---nodeid=#, -.PP --n -T}:T{ -Back up files from node with this ID -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---backupid=#, -.PP --b -T}:T{ -Restore from the backup with the given ID -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---restore_data, -.PP --r -T}:T{ -Restore table data and logs into NDB Cluster using the NDB API -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---restore_meta, -.PP --m -T}:T{ -Restore metadata to NDB Cluster using the NDB API -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---no-upgrade, -.PP --u -T}:T{ -Do not upgrade array type for varsize attributes which do not - already resize VAR data, and do not change column attributes -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---promote-attributes, -.PP --A -T}:T{ -Allow attributes to be promoted when restoring data from backup -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---preserve-trailing-spaces, -.PP --P -T}:T{ -Allow preservation of trailing spaces (including padding) when - promoting fixed-width string types to variable-width types -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---no-restore-disk-objects, -.PP --d -T}:T{ -Do not restore objects relating to Disk Data -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---restore_epoch, -.PP --e -T}:T{ -Restore epoch info into the status table. Convenient on a MySQL - Cluster replication slave for starting replication. The row in - mysql.ndb_apply_status with id 0 will be updated/inserted. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---skip-table-check, -.PP --s -T}:T{ -Skip table structure check during restoring of data -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---parallelism=#, -.PP --p -T}:T{ -Number of parallel transactions to use while restoring data -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---print -T}:T{ -Print metadata, data and log to stdout (equivalent to --print_meta - --print_data --print_log) -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---print_meta -T}:T{ -Print metadata to stdout -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---print_data -T}:T{ -Print data to stdout -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---print_log -T}:T{ -Print to stdout -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---backup_path=path -T}:T{ -Path to backup files directory -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---dont_ignore_systab_0, -.PP --f -T}:T{ -Do not ignore system table during restore. Experimental only; not - for production use -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---ndb-nodegroup-map=map, -.PP --z -T}:T{ -Nodegroup map for NDBCLUSTER storage engine. Syntax: list of - (source_nodegroup, destination_nodegroup) -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---fields-enclosed-by=char -T}:T{ -Fields are enclosed with the indicated character -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---fields-terminated-by=char -T}:T{ -Fields are terminated by the indicated character -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---fields-optionally-enclosed-by -T}:T{ -Fields are optionally enclosed with the indicated character -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---lines-terminated-by=char -T}:T{ -Lines are terminated by the indicated character -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---hex -T}:T{ -Print binary types in hexadecimal format -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---tab=path, -.PP --T -T}:T{ -Creates a tab-separated .txt file for each table in the given path -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---append -T}:T{ -Append data to a tab-delimited file -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---progress-frequency=# -T}:T{ -Print status of restoration each given number of seconds -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---no-binlog -T}:T{ -If a mysqld is connected and using binary logging, do not log the - restored data -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---verbose=# -T}:T{ -Level of verbosity in output -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---include-databases=db-list -T}:T{ -List of one or more databases to restore (excludes those not - named) -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---exclude-databases=db-list -T}:T{ -List of one or more databases to exclude (includes those not - named) -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---include-tables=table-list -T}:T{ -List of one or more tables to restore (excludes those in same - database that are not named); each table reference must include - the database name -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---exclude-tables=table-list -T}:T{ -List of one or more tables to exclude (includes those in the same - database that are not named); each table reference must include - the database name -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---exclude-missing-columns -T}:T{ -Causes columns from the backup version of a table that are missing - from the version of the table in the database to be ignored. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---exclude-missing-tables -T}:T{ -Causes tables from the backup that are missing from the database - to be ignored. -T}:T{ -.PP -ADDED: NDB 7.3.7 -T} -T{ -.PP ---disable-indexes -T}:T{ -Causes indexes from a backup to be ignored; may decrease time - needed to restore data. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---rebuild-indexes -T}:T{ -Causes multi-threaded rebuilding of ordered indexes found in the - backup. Number of threads used is determined by setting - BuildIndexThreads parameter. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---skip-broken-objects -T}:T{ -Causes missing blob tables in the backup file to be ignored. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---skip-unknown-objects -T}:T{ -Causes schema objects not recognized by ndb_restore to be ignored - when restoring a backup made from a newer MySQL Cluster version to - an older version. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---rewrite-database=olddb,newdb -T}:T{ -Restores to a database with a different name than the original -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---lossy-conversions, -.PP --L -T}:T{ -Allow lossy conversions of column values (type demotions or - changes in sign) when restoring data from backup -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---restore-privilege-tables -T}:T{ -Restore MySQL privilege tables that were previously moved to NDB. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---exclude-intermediate-sql-tables[=TRUE|FALSE] -T}:T{ -If TRUE (the default), do not restore any intermediate tables - (having names prefixed with '#sql-') that were left over from - copying ALTER TABLE operations. -T}:T{ -.PP -ADDED: NDB 7.3.6 -T} -.TE -.sp 1 -.\" ndb_restore: typical and required options -.PP -Typical options for this utility are shown here: -.PP -Normally, when restoring from a MySQL Cluster backup, -\fBndb_restore\fR -requires at a minimum the -\fB\-\-nodeid\fR -(short form: -\fB\-n\fR), -\fB\-\-backupid\fR -(short form: -\fB\-b\fR), and -\fB\-\-backup_path\fR -options\&. -.sp -.if n \{\ -.RS 4 -.\} -.nf -ndb_restore [\-c \fIconnection_string\fR] \-n \fInode_id\fR \-b \fIbackup_id\fR \e - [\-m] \-r \-\-backup_path=\fI/path/to/backup/files\fR -.fi -.if n \{\ -.RE -.\} -.PP -.\" restore_connect option (ndb_restore) -The -\fB\-c\fR -option is used to specify a connection string which tells -ndb_restore -where to locate the cluster management server\&. (See -Section\ \&18.3.2.3, \(lqMySQL Cluster Connection Strings\(rq, for information on connection strings\&.) If this option is not used, then -\fBndb_restore\fR -attempts to connect to a management server on -localhost:1186\&. This utility acts as a cluster API node, and so requires a free connection -\(lqslot\(rq -to connect to the cluster management server\&. This means that there must be at least one -[api] -or -[mysqld] -section that can be used by it in the cluster -config\&.ini -file\&. It is a good idea to keep at least one empty -[api] -or -[mysqld] -section in -config\&.ini -that is not being used for a MySQL server or other application for this reason (see -Section\ \&18.3.2.7, \(lqDefining SQL and Other API Nodes in a MySQL Cluster\(rq)\&. -.PP -You can verify that -\fBndb_restore\fR -is connected to the cluster by using the -\fBSHOW\fR -command in the -\fBndb_mgm\fR -management client\&. You can also accomplish this from a system shell, as shown here: -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fBndb_mgm \-e "SHOW"\fR -.fi -.if n \{\ -.RE -.\} -.PP -.\" restore_nodeid option (ndb_restore) -\fB\-n\fR -is used to specify the node ID of the data node on which the backups were taken\&. -.PP -The first time you run the -\fBndb_restore\fR -restoration program, you also need to restore the metadata\&. In other words, you must re\-create the database tables\(emthis can be done by running it with the -\fB\-\-restore_meta\fR -(\fB\-m\fR) option\&. Restoring the metdata need be done only on a single data node; this is sufficient to restore it to the entire cluster\&. Note that the cluster should have an empty database when starting to restore a backup\&. (In other words, you should start -\fBndbd\fR -with -\fB\-\-initial\fR -prior to performing the restore\&.) -.PP -.\" restore_skip-table-check option (ndb_restore) -It is possible to restore data without restoring table metadata\&. The default behavior when doing this is for -\fBndb_restore\fR -to fail with an error if table data do not match the table schema; this can be overridden using the -\fB\-\-skip\-table\-check\fR -or -\fB\-s\fR -option\&. -.PP -Some of the restrictions on mismatches in column definitions when restoring data using -\fBndb_restore\fR -are relaxed; when one of these types of mismatches is encountered, -\fBndb_restore\fR -does not stop with an error as it did previously, but rather accepts the data and inserts it into the target table while issuing a warning to the user that this is being done\&. This behavior occurs whether or not either of the options -\fB\-\-skip\-table\-check\fR -or -\fB\-\-promote\-attributes\fR -is in use\&. These differences in column definitions are of the following types: -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -Different -COLUMN_FORMAT -settings (FIXED, -DYNAMIC, -DEFAULT) -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -Different -STORAGE -settings (MEMORY, -DISK) -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -Different default values -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -Different distribution key settings -.RE -.PP -.\" attribute promotion: ndb_restore -.\" ndb_restore: attribute promotion -.\" promote-attributes option (ndb_restore) -\fBndb_restore\fR -supports limited -attribute promotion -in much the same way that it is supported by MySQL replication; that is, data backed up from a column of a given type can generally be restored to a column using a -\(lqlarger, similar\(rq -type\&. For example, data from a -CHAR(20) -column can be restored to a column declared as -VARCHAR(20), -VARCHAR(30), or -CHAR(30); data from a -MEDIUMINT -column can be restored to a column of type -INT -or -BIGINT\&. See -Section\ \&17.4.1.9.2, \(lqReplication of Columns Having Different Data Types\(rq, for a table of type conversions currently supported by attribute promotion\&. -.PP -Attribute promotion by -\fBndb_restore\fR -must be enabled explicitly, as follows: -.sp -.RS 4 -.ie n \{\ -\h'-04' 1.\h'+01'\c -.\} -.el \{\ -.sp -1 -.IP " 1." 4.2 -.\} -Prepare the table to which the backup is to be restored\&. -\fBndb_restore\fR -cannot be used to re\-create the table with a different definition from the original; this means that you must either create the table manually, or alter the columns which you wish to promote using -ALTER TABLE -after restoring the table metadata but before restoring the data\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04' 2.\h'+01'\c -.\} -.el \{\ -.sp -1 -.IP " 2." 4.2 -.\} -Invoke -\fBndb_restore\fR -with the -\fB\-\-promote\-attributes\fR -option (short form -\fB\-A\fR) when restoring the table data\&. Attribute promotion does not occur if this option is not used; instead, the restore operation fails with an error\&. -.RE -.PP -Prior to MySQL Cluster NDB 7\&.3\&.3, conversions between character data types and -TEXT -or -BLOB -were not handled correctly (Bug #17325051)\&. -.PP -Prior to MySQL Cluster NDB 7\&.3\&.7, demotion of -TEXT -to -TINYTEXT -was not handled correctly (Bug #18875137)\&. -.PP -When converting between character data types and -TEXT -or -BLOB, only conversions between character types (CHAR -and -VARCHAR) and binary types (BINARY -and -VARBINARY) can be performed at the same time\&. For example, you cannot promote an -INT -column to -BIGINT -while promoting a -VARCHAR -column to -TEXT -in the same invocation of -\fBndb_restore\fR\&. -.PP -Converting between -TEXT -columns using different character sets is not supported\&. Beginning with MySQL Cluster NDB 7\&.3\&.7, it is expressly disallowed (Bug #18875137)\&. -.PP -When performing conversions of character or binary types to -TEXT -or -BLOB -with -\fBndb_restore\fR, you may notice that it creates and uses one or more staging tables named -\fItable_name\fR$ST\fInode_id\fR\&. These tables are not needed afterwards, and are normally deleted by -\fBndb_restore\fR -following a successful restoration\&. -.PP -.\" ndb_restore: lossy-conversions option -.\" lossy-conversions option (ndb_restore) -\fB\-\-lossy\-conversions\fR, -\fB\-L\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-lossy\-conversions -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -FALSE -T} -.TE -.sp 1 -.PP -This option is intended to complement the -\fB\-\-promote\-attributes\fR -option\&. Using -\fB\-\-lossy\-conversions\fR -allows lossy conversions of column values (type demotions or changes in sign) when restoring data from backup\&. With some exceptions, the rules governing demotion are the same as for MySQL replication; see -Section\ \&17.4.1.9.2, \(lqReplication of Columns Having Different Data Types\(rq, for information about specific type conversions currently supported by attribute demotion\&. -.PP -\fBndb_restore\fR -reports any truncation of data that it performs during lossy conversions once per attribute and column\&. -.PP -.\" preserve-trailing-spaces option (ndb_restore) -The -\fB\-\-preserve\-trailing\-spaces\fR -option (short form -\fB\-R\fR) causes trailing spaces to be preserved when promoting a fixed\-width character data type to its variable\-width equivalent\(emthat is, when promoting a -CHAR -column value to -VARCHAR -or a -BINARY -column value to -VARBINARY\&. Otherwise, any trailing spaces are dropped from such column values when they are inserted into the new columns\&. -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBNote\fR -.ps -1 -.br -.PP -Although you can promote -CHAR -columns to -VARCHAR -and -BINARY -columns to -VARBINARY, you cannot promote -VARCHAR -columns to -CHAR -or -VARBINARY -columns to -BINARY\&. -.sp .5v -.RE -.PP -.\" backupid option (ndb_restore) -The -\fB\-b\fR -option is used to specify the ID or sequence number of the backup, and is the same number shown by the management client in the -Backup \fIbackup_id\fR completed -message displayed upon completion of a backup\&. (See -Section\ \&18.5.3.2, \(lqUsing The MySQL Cluster Management Client to Create a Backup\(rq\&.) -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBImportant\fR -.ps -1 -.br -.PP -When restoring cluster backups, you must be sure to restore all data nodes from backups having the same backup ID\&. Using files from different backups will at best result in restoring the cluster to an inconsistent state, and may fail altogether\&. -.sp .5v -.RE -.PP -.\" restore_epoch option (ndb_restore) -\fB\-\-restore_epoch\fR -(short form: -\fB\-e\fR) adds (or restores) epoch information to the cluster replication status table\&. This is useful for starting replication on a MySQL Cluster replication slave\&. When this option is used, the row in the -mysql\&.ndb_apply_status -having -0 -in the -id -column is updated if it already exists; such a row is inserted if it does not already exist\&. (See -Section\ \&18.6.9, \(lqMySQL Cluster Backups With MySQL Cluster Replication\(rq\&.) -.PP -.\" restore_data option (ndb_restore) -\fB\-\-restore_data\fR -.PP -This option causes -\fBndb_restore\fR -to output -NDB -table data and logs\&. -.PP -.\" restore_meta option (ndb_restore) -\fB\-\-restore_meta\fR -.PP -This option causes -\fBndb_restore\fR -to print -NDB -table metadata\&. Generally, you need only use this option when restoring the first data node of a cluster; additional data nodes can obtain the metadata from the first one\&. -.PP -.\" restore-privilege-tables option (ndb_restore) -.\" ndb_restore: restore-privilege-tables option -\fB\-\-restore\-privilege\-tables\fR -.PP -\fBndb_restore\fR -does not by default restore distributed MySQL privilege tables\&. This option causes -\fBndb_restore\fR -to restore the privilege tables\&. -.PP -This works only if the privilege tables were converted to -NDB -before the backup was taken\&. For more information, see -Section\ \&18.5.14, \(lqDistributed MySQL Privileges for MySQL Cluster\(rq\&. -.PP -.\" backup_path option (ndb_restore) -.\" ndb_restore: backup_path option -\fB\-\-backup_path\fR -.PP -The path to the backup directory is required; this is supplied to -\fBndb_restore\fR -using the -\fB\-\-backup_path\fR -option, and must include the subdirectory corresponding to the ID backup of the backup to be restored\&. For example, if the data node\*(Aqs -DataDir -is -/var/lib/mysql\-cluster, then the backup directory is -/var/lib/mysql\-cluster/BACKUP, and the backup files for the backup with the ID 3 can be found in -/var/lib/mysql\-cluster/BACKUP/BACKUP\-3\&. The path may be absolute or relative to the directory in which the -\fBndb_restore\fR -executable is located, and may be optionally prefixed with -\fBbackup_path=\fR\&. -.PP -It is possible to restore a backup to a database with a different configuration than it was created from\&. For example, suppose that a backup with backup ID -12, created in a cluster with two database nodes having the node IDs -2 -and -3, is to be restored to a cluster with four nodes\&. Then -\fBndb_restore\fR -must be run twice\(emonce for each database node in the cluster where the backup was taken\&. However, -\fBndb_restore\fR -cannot always restore backups made from a cluster running one version of MySQL to a cluster running a different MySQL version\&. See -Section\ \&18.2.8, \(lqUpgrading and Downgrading MySQL Cluster NDB 7.3\(rq, for more information\&. -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBImportant\fR -.ps -1 -.br -.PP -It is not possible to restore a backup made from a newer version of MySQL Cluster using an older version of -\fBndb_restore\fR\&. You can restore a backup made from a newer version of MySQL to an older cluster, but you must use a copy of -\fBndb_restore\fR -from the newer MySQL Cluster version to do so\&. -.PP -For example, to restore a cluster backup taken from a cluster running MySQL Cluster NDB 7\&.2\&.5 to a cluster running MySQL Cluster NDB 7\&.1\&.21, you must use the -\fBndb_restore\fR -that comes with the MySQL Cluster NDB 7\&.2\&.5 distribution\&. -.sp .5v -.RE -.PP -For more rapid restoration, the data may be restored in parallel, provided that there is a sufficient number of cluster connections available\&. That is, when restoring to multiple nodes in parallel, you must have an -[api] -or -[mysqld] -section in the cluster -config\&.ini -file available for each concurrent -\fBndb_restore\fR -process\&. However, the data files must always be applied before the logs\&. -.PP -.\" no-upgrade option (ndb_restore) -.\" ndb_restore: no-upgrade option -\fB\-\-no\-upgrade\fR -.PP -When using -\fBndb_restore\fR -to restore a backup, -VARCHAR -columns created using the old fixed format are resized and recreated using the variable\-width format now employed\&. This behavior can be overridden using the -\fB\-\-no\-upgrade\fR -option (short form: -\fB\-u\fR) when running -\fBndb_restore\fR\&. -.PP -.\" print_data option (ndb_restore) -.\" ndb_restore: print_data option -\fB\-\-print_data\fR -.PP -The -\fB\-\-print_data\fR -option causes -\fBndb_restore\fR -to direct its output to -stdout\&. -.PP -TEXT -and -BLOB -column values are always truncated\&. In MySQL Cluster NDB 7\&.3\&.7 and earlier, such values are truncated to the first 240 bytes in the output; in MySQL Cluster NDB 7\&.3\&.8 and later, they are truncated to 256 bytes\&. (Bug #14571512, Bug #65467) This cannot currently be overridden when using -\fB\-\-print_data\fR\&. -.PP -Several additional options are available for use with the -\fB\-\-print_data\fR -option in generating data dumps, either to -stdout, or to a file\&. These are similar to some of the options used with -\fBmysqldump\fR, and are shown in the following list: -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_restore: tab option -.\" tab option (ndb_restore) -\fB\-\-tab\fR, -\fB\-T\fR -.TS -allbox tab(:); -l l s s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-tab=path -T} -.TE -.sp 1 -This option causes -\fB\-\-print_data\fR -to create dump files, one per table, each named -\fItbl_name\fR\&.txt\&. It requires as its argument the path to the directory where the files should be saved; use -\&. -for the current directory\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_restore: fields-enclosed-by option -.\" fields-enclosed-by option (ndb_restore) -\fB\-\-fields\-enclosed\-by=\fR\fB\fIstring\fR\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-fields\-enclosed\-by=char -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -string -T} -:T{ -\fBDefault\fR -T}:T{ -T} -.TE -.sp 1 -Each column values are enclosed by the string passed to this option (regardless of data type; see next item)\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_restore: fields-optionally-enclosed-by option -.\" fields-optionally-enclosed-by option (ndb_restore) -\fB\-\-fields\-optionally\-enclosed\-by=\fR\fB\fIstring\fR\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-fields\-optionally\-enclosed\-by -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -string -T} -:T{ -\fBDefault\fR -T}:T{ -T} -.TE -.sp 1 -The string passed to this option is used to enclose column values containing character data (such as -CHAR, -VARCHAR, -BINARY, -TEXT, or -ENUM)\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_restore: fields-terminated-by option -.\" fields-terminated-by option (ndb_restore) -\fB\-\-fields\-terminated\-by=\fR\fB\fIstring\fR\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-fields\-terminated\-by=char -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -string -T} -:T{ -\fBDefault\fR -T}:T{ -\et (tab) -T} -.TE -.sp 1 -The string passed to this option is used to separate column values\&. The default value is a tab character (\et)\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_restore: hex option -.\" hex option (ndb_restore) -\fB\-\-hex\fR -.TS -allbox tab(:); -l l s s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-hex -T} -.TE -.sp 1 -If this option is used, all binary values are output in hexadecimal format\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_restore: fields-terminated-by option -.\" fields-terminated-by option (ndb_restore) -\fB\-\-fields\-terminated\-by=\fR\fB\fIstring\fR\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-fields\-terminated\-by=char -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -string -T} -:T{ -\fBDefault\fR -T}:T{ -\et (tab) -T} -.TE -.sp 1 -This option specifies the string used to end each line of output\&. The default is a linefeed character (\en)\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_restore: append option -.\" append option (ndb_restore) -\fB\-\-append\fR -.TS -allbox tab(:); -l l s s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-append -T} -.TE -.sp 1 -When used with the -\fB\-\-tab\fR -and -\fB\-\-print_data\fR -options, this causes the data to be appended to any existing files having the same names\&. -.RE -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBNote\fR -.ps -1 -.br -.PP -If a table has no explicit primary key, then the output generated when using the -\fB\-\-print_data\fR -option includes the table\*(Aqs hidden primary key\&. -.sp .5v -.RE -.PP -.\" ndb_restore: print_meta option -.\" print_meta option (ndb_restore) -\fB\-\-print_meta\fR -.PP -This option causes -\fBndb_restore\fR -to print all metadata to -stdout\&. -.PP -.\" ndb_restore: print_log option -.\" print_log option (ndb_restore) -\fB\-\-print_log\fR -.PP -The -\fB\-\-print_log\fR -option causes -\fBndb_restore\fR -to output its log to -stdout\&. -.PP -.\" ndb_restore: print option -.\" print option (ndb_restore) -\fB\-\-print\fR -.PP -Causes -\fBndb_restore\fR -to print all data, metadata, and logs to -stdout\&. Equivalent to using the -\fB\-\-print_data\fR, -\fB\-\-print_meta\fR, and -\fB\-\-print_log\fR -options together\&. -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBNote\fR -.ps -1 -.br -.PP -Use of -\fB\-\-print\fR -or any of the -\fB\-\-print_*\fR -options is in effect performing a dry run\&. Including one or more of these options causes any output to be redirected to -stdout; in such cases, -\fBndb_restore\fR -makes no attempt to restore data or metadata to a MySQL Cluster\&. -.sp .5v -.RE -.PP -.\" ndb_restore: dont_ignore_systab_0 option -.\" dont_ignore_systab_0 option (ndb_restore) -\fB\-\-dont_ignore_systab_0\fR -.PP -Normally, when restoring table data and metadata, -\fBndb_restore\fR -ignores the copy of the -NDB -system table that is present in the backup\&. -\fB\-\-dont_ignore_systab_0\fR -causes the system table to be restored\&. -\fIThis option is intended for experimental and development use only, and is not recommended in a production environment\fR\&. -.PP -.\" ndb_restore: ndb-nodegroup-map option -.\" ndb-nodegroup-map option (ndb_restore) -\fB\-\-ndb\-nodegroup\-map\fR, -\fB\-z\fR -.PP -This option can be used to restore a backup taken from one node group to a different node group\&. Its argument is a list of the form -\fIsource_node_group\fR, \fItarget_node_group\fR\&. -.PP -.\" ndb_restore: no-binlog option -.\" no-binlog option (ndb_restore) -\fB\-\-no\-binlog\fR -.PP -This option prevents any connected SQL nodes from writing data restored by -\fBndb_restore\fR -to their binary logs\&. -.PP -.\" ndb_restore: no-restore-disk-objects option -.\" no-restore-disk-objects option (ndb_restore) -\fB\-\-no\-restore\-disk\-objects\fR, -\fB\-d\fR -.PP -This option stops -\fBndb_restore\fR -from restoring any MySQL Cluster Disk Data objects, such as tablespaces and log file groups; see -Section\ \&18.5.12, \(lqMySQL Cluster Disk Data Tables\(rq, for more information about these\&. -.PP -.\" ndb_restore: parallelism option -.\" parallelism option (ndb_restore) -\fB\-\-parallelism=#\fR, -\fB\-p\fR -.PP -Determines the maximum number of parallel transactions that -\fBndb_restore\fR -tries to use\&. By default, this is 128; the minimum is 1, and the maximum is 1024\&. -.PP -.\" ndb_restore: progress-frequency option -.\" progress-frequency option (ndb_restore) -\fB\-\-progress\-frequency=\fR\fB\fIN\fR\fR -.PP -Print a status report each -\fIN\fR -seconds while the backup is in progress\&. 0 (the default) causes no status reports to be printed\&. The maximum is 65535\&. -.PP -.\" ndb_restore: verbose option -.\" verbose option (ndb_restore) -\fB\-\-verbose=#\fR -.PP -Sets the level for the verbosity of the output\&. The minimum is 0; the maximum is 255\&. The default value is 1\&. -.PP -It is possible to restore only selected databases, or selected tables from a single database, using the syntax shown here: -.sp -.if n \{\ -.RS 4 -.\} -.nf -ndb_restore \fIother_options\fR \fIdb_name\fR,[\fIdb_name\fR[,\&.\&.\&.] | \fItbl_name\fR[,\fItbl_name\fR][,\&.\&.\&.]] -.fi -.if n \{\ -.RE -.\} -.PP -In other words, you can specify either of the following to be restored: -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -All tables from one or more databases -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -One or more tables from a single database -.RE -.PP -.\" ndb_restore: include-databases option -.\" include-databases option (ndb_restore) -\fB\-\-include\-databases=\fR\fB\fIdb_name\fR\fR\fB[,\fR\fB\fIdb_name\fR\fR\fB][,\&.\&.\&.]\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-include\-databases=db\-list -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -string -T} -:T{ -\fBDefault\fR -T}:T{ -T} -.TE -.sp 1 -.PP -.\" ndb_restore: include-tables option -.\" include-tables option (ndb_restore) -\fB\-\-include\-tables=\fR\fB\fIdb_name\&.tbl_name\fR\fR\fB[,\fR\fB\fIdb_name\&.tbl_name\fR\fR\fB][,\&.\&.\&.]\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-include\-tables=table\-list -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -string -T} -:T{ -\fBDefault\fR -T}:T{ -T} -.TE -.sp 1 -.PP -Use the -\fB\-\-include\-databases\fR -option or the -\fB\-\-include\-tables\fR -option for restoring only specific databases or tables, respectively\&. -\fB\-\-include\-databases\fR -takes a comma\-delimited list of databases to be restored\&. -\fB\-\-include\-tables\fR -takes a comma\-delimited list of tables (in -\fIdatabase\fR\&.\fItable\fR -format) to be restored\&. -.PP -When -\fB\-\-include\-databases\fR -or -\fB\-\-include\-tables\fR -is used, only those databases or tables named by the option are restored; all other databases and tables are excluded by -\fBndb_restore\fR, and are not restored\&. -.PP -The following table shows several invocations of -\fBndb_restore\fR -using -\fB\-\-include\-*\fR -options (other options possibly required have been omitted for clarity), and the effects these have on restoring from a MySQL Cluster backup: -.TS -allbox tab(:); -lB lB. -T{ -Option Used -T}:T{ -Result -T} -.T& -l l -l l -l l -l l. -T{ -\fB\-\-include\-databases=db1\fR -T}:T{ -Only tables in database db1 are restored; all tables - in all other databases are ignored -T} -T{ -\fB\-\-include\-databases=db1,db2\fR (or - \fB\-\-include\-databases=db1\fR - \fB\-\-include\-databases=db2\fR) -T}:T{ -Only tables in databases db1 and - db2 are restored; all tables in all - other databases are ignored -T} -T{ -\fB\-\-include\-tables=db1\&.t1\fR -T}:T{ -Only table t1 in database db1 is - restored; no other tables in db1 or - in any other database are restored -T} -T{ -\fB\-\-include\-tables=db1\&.t2,db2\&.t1\fR (or - \fB\-\-include\-tables=db1\&.t2\fR - \fB\-\-include\-tables=db2\&.t1\fR) -T}:T{ -Only the table t2 in database db1 - and the table t1 in database - db2 are restored; no other tables in - db1, db2, or any - other database are restored -T} -.TE -.sp 1 -.PP -You can also use these two options together\&. For example, the following causes all tables in databases -db1 -and -db2, together with the tables -t1 -and -t2 -in database -db3, to be restored (and no other databases or tables): -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fBndb_restore [\&.\&.\&.] \-\-include\-databases=db1,db2 \-\-include\-tables=db3\&.t1,db3\&.t2\fR -.fi -.if n \{\ -.RE -.\} -.PP -(Again we have omitted other, possibly required, options in the example just shown\&.) -.PP -.\" ndb_restore: exclude-databases option -.\" exclude-databases option (ndb_restore) -\fB\-\-exclude\-databases=\fR\fB\fIdb_name\fR\fR\fB[,\fR\fB\fIdb_name\fR\fR\fB][,\&.\&.\&.]\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-exclude\-databases=db\-list -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -string -T} -:T{ -\fBDefault\fR -T}:T{ -T} -.TE -.sp 1 -.PP -.\" ndb_restore: exclude-tables option -.\" exclude-tables option (ndb_restore) -\fB\-\-exclude\-tables=\fR\fB\fIdb_name\&.tbl_name\fR\fR\fB[,\fR\fB\fIdb_name\&.tbl_name\fR\fR\fB][,\&.\&.\&.]\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-exclude\-tables=table\-list -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -string -T} -:T{ -\fBDefault\fR -T}:T{ -T} -.TE -.sp 1 -.PP -It is possible to prevent one or more databases or tables from being restored using the -\fBndb_restore\fR -options -\fB\-\-exclude\-databases\fR -and -\fB\-\-exclude\-tables\fR\&. -\fB\-\-exclude\-databases\fR -takes a comma\-delimited list of one or more databases which should not be restored\&. -\fB\-\-exclude\-tables\fR -takes a comma\-delimited list of one or more tables (using -\fIdatabase\fR\&.\fItable\fR -format) which should not be restored\&. -.PP -When -\fB\-\-exclude\-databases\fR -or -\fB\-\-exclude\-tables\fR -is used, only those databases or tables named by the option are excluded; all other databases and tables are restored by -\fBndb_restore\fR\&. -.PP -This table shows several invocations of -\fBndb_restore\fR -usng -\fB\-\-exclude\-*\fR -options (other options possibly required have been omitted for clarity), and the effects these options have on restoring from a MySQL Cluster backup: -.TS -allbox tab(:); -lB lB. -T{ -Option Used -T}:T{ -Result -T} -.T& -l l -l l -l l -l l. -T{ -\fB\-\-exclude\-databases=db1\fR -T}:T{ -All tables in all databases except db1 are restored; - no tables in db1 are restored -T} -T{ -\fB\-\-exclude\-databases=db1,db2\fR (or - \fB\-\-exclude\-databases=db1\fR - \fB\-\-exclude\-databases=db2\fR) -T}:T{ -All tables in all databases except db1 and - db2 are restored; no tables in - db1 or db2 are - restored -T} -T{ -\fB\-\-exclude\-tables=db1\&.t1\fR -T}:T{ -All tables except t1 in database - db1 are restored; all other tables in - db1 are restored; all tables in all - other databases are restored -T} -T{ -\fB\-\-exclude\-tables=db1\&.t2,db2\&.t1\fR (or - \fB\-\-exclude\-tables=db1\&.t2\fR - \fB\-\-exclude\-tables=db2\&.t1)\fR -T}:T{ -All tables in database db1 except for - t2 and all tables in database - db2 except for table - t1 are restored; no other tables in - db1 or db2 are - restored; all tables in all other databases are restored -T} -.TE -.sp 1 -.PP -You can use these two options together\&. For example, the following causes all tables in all databases -\fIexcept for\fR -databases -db1 -and -db2, along with the tables -t1 -and -t2 -in database -db3, -\fInot\fR -to be restored: -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fBndb_restore [\&.\&.\&.] \-\-exclude\-databases=db1,db2 \-\-exclude\-tables=db3\&.t1,db3\&.t2\fR -.fi -.if n \{\ -.RE -.\} -.PP -(Again, we have omitted other possibly necessary options in the interest of clarity and brevity from the example just shown\&.) -.PP -You can use -\fB\-\-include\-*\fR -and -\fB\-\-exclude\-*\fR -options together, subject to the following rules: -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -The actions of all -\fB\-\-include\-*\fR -and -\fB\-\-exclude\-*\fR -options are cumulative\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -All -\fB\-\-include\-*\fR -and -\fB\-\-exclude\-*\fR -options are evaluated in the order passed to ndb_restore, from right to left\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -In the event of conflicting options, the first (rightmost) option takes precedence\&. In other words, the first option (going from right to left) that matches against a given database or table -\(lqwins\(rq\&. -.RE -.PP -For example, the following set of options causes -\fBndb_restore\fR -to restore all tables from database -db1 -except -db1\&.t1, while restoring no other tables from any other databases: -.sp -.if n \{\ -.RS 4 -.\} -.nf -\-\-include\-databases=db1 \-\-exclude\-tables=db1\&.t1 -.fi -.if n \{\ -.RE -.\} -.PP -However, reversing the order of the options just given simply causes all tables from database -db1 -to be restored (including -db1\&.t1, but no tables from any other database), because the -\fB\-\-include\-databases\fR -option, being farthest to the right, is the first match against database -db1 -and thus takes precedence over any other option that matches -db1 -or any tables in -db1: -.sp -.if n \{\ -.RS 4 -.\} -.nf -\-\-exclude\-tables=db1\&.t1 \-\-include\-databases=db1 -.fi -.if n \{\ -.RE -.\} -.PP -.\" ndb_restore: exclude-missing-columns option -.\" exclude-missing-columns option (ndb_restore) -\fB\-\-exclude\-missing\-columns\fR -.TS -allbox tab(:); -l l s s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-exclude\-missing\-columns -T} -.TE -.sp 1 -.PP -It is also possible to restore only selected table columns using the -\fB\-\-exclude\-missing\-columns\fR -option\&. When this option is used, -\fBndb_restore\fR -ignores any columns missing from tables being restored as compared to the versions of those tables found in the backup\&. This option applies to all tables being restored\&. If you wish to apply this option only to selected tables or databases, you can use it in combination with one or more of the options described in the previous paragraph to do so, then restore data to the remaining tables using a complementary set of these options\&. -.PP -.\" ndb_restore: exclude-missing-tables option -.\" exclude-missing-tables option (ndb_restore) -\fB\-\-exclude\-missing\-tables\fR -.TS -allbox tab(:); -l l s s -l l s s. -T{ -\fBIntroduced\fR -T}:T{ -5\&.6\&.21\-ndb\-7\&.3\&.7 -T} -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-exclude\-missing\-tables -T} -.TE -.sp 1 -.PP -Beginning with MySQL Cluster NDB 7\&.3\&.7, it is also possible to restore only selected tables columns using this option, which causes -\fBndb_restore\fR -to ignore any tables from the backup that are not found in the target database\&. -.PP -.\" ndb_restore: disable-indexes option -.\" disable-indexes option (ndb_restore) -\fB\-\-disable\-indexes\fR -.TS -allbox tab(:); -l l s s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-disable\-indexes -T} -.TE -.sp 1 -.PP -Disable restoration of indexes during restoration of the data from a native NDB backup\&. Afterwards, you can restore indexes for all tables at once with multi\-threaded building of indexes using -\fB\-\-rebuild\-indexes\fR, which should be faster than rebuilding indexes concurrently for very large tables\&. -.PP -.\" ndb_restore: rebuild-indexes option -.\" rebuild-indexes option (ndb_restore) -\fB\-\-rebuild\-indexes\fR -.TS -allbox tab(:); -l l s s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-rebuild\-indexes -T} -.TE -.sp 1 -.PP -You can use this option with -\fBndb_restore\fR -to cause multi\-threaded rebuilding of the ordered indexes while restoring a native -NDB -backup\&. The number of threads used for building ordered indexes by -\fBndb_restore\fR -with this option is controlled by the -BuildIndexThreads -data node configuration parameter\&. -.\" indexes: and ndb_restore -.PP -It is necessary to use this option only for the first run of -\fBndb_restore\fR; this causes all ordered indexes to be rebuilt without using -\fB\-\-rebuild\-indexes\fR -again when restoring subsequent nodes\&. You should use this option prior to inserting new rows into the database; otherwise, it is possible for a row to be inserted that later causes a unique constraint violation when trying to rebuild the indexes\&. -.PP -Rebuilding of unique indexes uses disk write bandwidth for redo logging and local checkpointing\&. An insufficient amount of this bandwith can lead to redo buffer overload or log overload errors\&. In such cases you can run -\fBndb_restore\fR -\fB\-\-rebuild\-indexes\fR -again; the process resumes at the point where the error occurred\&. You can also do this when you have encountered temporarary errors\&. You can repeat execution of -\fBndb_restore\fR -\fB\-\-rebuild\-indexes\fR -indefinitely; you may be able to stop such errors by reducing the value of -DiskCheckpointSpeed -to provide additional disk bandwidth to redo logging\&. -.PP -.\" ndb_restore: skip-broken-objects option -.\" skip-broken-objects option (ndb_restore) -\fB\-\-skip\-broken\-objects\fR -.TS -allbox tab(:); -l l s s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-skip\-broken\-objects -T} -.TE -.sp 1 -.PP -This option causes -\fBndb_restore\fR -to ignore corrupt tables while reading a native -NDB -backup, and to continue restoring any remaining tables (that are not also corrupted)\&. Currently, the -\fB\-\-skip\-broken\-objects\fR -option works only in the case of missing blob parts tables\&. -.PP -.\" ndb_restore: skip-unknown-objects option -.\" skip-unknown-objects option (ndb_restore) -\fB\-\-skip\-unknown\-objects\fR -.TS -allbox tab(:); -l l s s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-skip\-unknown\-objects -T} -.TE -.sp 1 -.PP -This option causes -\fBndb_restore\fR -to ignore any schema objects it does not recognize while reading a native -NDB -backup\&. This can be used for restoring a backup made from a cluster running MySQL Cluster NDB 7\&.3 to a cluster running MySQL Cluster NDB 7\&.2\&. -.PP -.\" ndb_restore: rewrite-database option -.\" rewrite-database option (ndb_restore) -\fB\-\-rewrite\-database=\fR\fB\fIold_dbname\fR\fR\fB,\fR\fB\fInew_dbname\fR\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-rewrite\-database=olddb,newdb -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -string -T} -:T{ -\fBDefault\fR -T}:T{ -none -T} -.TE -.sp 1 -.PP -This option makes it possible to restore to a database having a different name from that used in the backup\&. For example, if a backup is made of a database named -products, you can restore the data it contains to a database named -inventory, use this option as shown here (omitting any other options that might be required): -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> ndb_restore \-\-rewrite\-database=product,inventory -.fi -.if n \{\ -.RE -.\} -.PP -The option can be employed multiple times in a single invocation of -\fBndb_restore\fR\&. Thus it is possible to restore simultaneously from a database named -db1 -to a database named -db2 -and from a database named -db3 -to one named -db4 -using -\fB\-\-rewrite\-database=db1,db2 \-\-rewrite\-database=db3,db4\fR\&. Other -\fBndb_restore\fR -options may be used between multiple occurrences of -\fB\-\-rewrite\-database\fR\&. -.PP -In the event of conflicts between multiple -\fB\-\-rewrite\-database\fR -options, the last -\fB\-\-rewrite\-database\fR -option used, reading from left to right, is the one that takes effect\&. For example, if -\fB\-\-rewrite\-database=db1,db2 \-\-rewrite\-database=db1,db3\fR -is used, only -\fB\-\-rewrite\-database=db1,db3\fR -is honored, and -\fB\-\-rewrite\-database=db1,db2\fR -is ignored\&. It is also possible to restore from multiple databases to a single database, so that -\fB\-\-rewrite\-database=db1,db3 \-\-rewrite\-database=db2,db3\fR -restores all tables and data from databases -db1 -and -db2 -into database -db3\&. -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBImportant\fR -.ps -1 -.br -.PP -When restoring from multiple backup databases into a single target database using -\fB\-\-rewrite\-database\fR, no check is made for collisions between table or other object names, and the order in which rows are restored is not guaranteed\&. This means that it is possible in such cases for rows to be overwritten and updates to be lost\&. -.sp .5v -.RE -.PP -.\" ndb_restore: exclude-intermediate-sql-tables option -.\" exclude-intermediate-sql-tables option (ndb_restore) -\fB\-\-exclude\-intermediate\-sql\-tables[=TRUE|FALSE]\fR -.TS -allbox tab(:); -l l s s -l l s s -l l l s -^ l l s. -T{ -\fBIntroduced\fR -T}:T{ -5\&.6\&.17\-ndb\-7\&.3\&.6 -T} -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-exclude\-intermediate\-sql\-tables[=TRUE|FALSE] -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -TRUE -T} -.TE -.sp 1 -.PP -When performing copying -ALTER TABLE -operations, -\fBmysqld\fR -creates intermediate tables (whose names are prefixed with -#sql\-)\&. When -TRUE, the -\fB\-\-exclude\-intermediate\-sql\-tables\fR -option keeps -\fBndb_restore\fR -from restoring such tables that may have been left over from such operations\&. This option is -TRUE -by default\&. -.PP -The -\fB\-\-exclude\-intermediate\-sql\-tables\fR -option was introduced in MySQL Cluster NDB 7\&.3\&.6\&. (Bug #17882305) -.PP -\fBError reporting\fR. .\" ndb_restore: errors -\fBndb_restore\fR -reports both temporary and permanent errors\&. In the case of temporary errors, it may able to recover from them, and reports -Restore successful, but encountered temporary error, please look at configuration -in such cases\&. -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBImportant\fR -.ps -1 -.br -.PP -After using -\fBndb_restore\fR -to initialize a MySQL Cluster for use in circular replication, binary logs on the SQL node acting as the replication slave are not automatically created, and you must cause them to be created manually\&. To cause the binary logs to be created, issue a -SHOW TABLES -statement on that SQL node before running -START SLAVE\&. This is a known issue in MySQL Cluster\&. -.sp .5v -.RE -.SH "COPYRIGHT" -.br -.PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. -.PP -This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. -.PP -This documentation 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. -.PP -You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. -.sp -.SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. -.SH AUTHOR -Oracle Corporation (http://dev.mysql.com/). diff --git a/mysql-wsrep-5.6/man/ndb_select_all.1 b/mysql-wsrep-5.6/man/ndb_select_all.1 deleted file mode 100644 index 467e8848..00000000 --- a/mysql-wsrep-5.6/man/ndb_select_all.1 +++ /dev/null @@ -1,618 +0,0 @@ -'\" t -.\" Title: \fBndb_select_all\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.6 -.\" Language: English -.\" -.TH "\FBNDB_SELECT_ALL\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.\" ndb_select_all -.SH "NAME" -ndb_select_all \- print rows from an NDB table -.SH "SYNOPSIS" -.HP \w'\fBndb_select_all\ \-c\ \fR\fB\fIconnect_string\fR\fR\fB\ \fR\fB\fItbl_name\fR\fR\fB\ \-d\ \fR\fB\fIdb_name\fR\fR\fB\ [>\ \fR\fB\fIfile_name\fR\fR\fB]\fR\ 'u -\fBndb_select_all \-c \fR\fB\fIconnect_string\fR\fR\fB \fR\fB\fItbl_name\fR\fR\fB \-d \fR\fB\fIdb_name\fR\fR\fB [> \fR\fB\fIfile_name\fR\fR\fB]\fR -.SH "DESCRIPTION" -.PP -\fBndb_select_all\fR -prints all rows from an -NDB -table to -stdout\&. -Usage -.sp -.if n \{\ -.RS 4 -.\} -.nf -ndb_select_all \-c \fIconnect_string\fR \fItbl_name\fR \-d \fIdb_name\fR [> \fIfile_name\fR] -.fi -.if n \{\ -.RE -.\} -.PP -The following table includes options that are specific to the MySQL Cluster native backup restoration program -\fBndb_select_all\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including -\fBndb_select_all\fR), see -Options Common to MySQL Cluster Programs(1)\&. -.sp -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.B Table\ \&18.92.\ \& This table describes command-line options for the ndb_select_all program -.TS -allbox tab(:); -lB lB lB. -T{ -Format -T}:T{ -Description -T}:T{ -Added or Removed -T} -.T& -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l. -T{ -.PP ---database=dbname, -.PP --d -T}:T{ -Name of the database in which the table is found -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---parallelism=#, -.PP --p -T}:T{ -Degree of parallelism -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---lock=#, -.PP --l -T}:T{ -Lock type -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---order=index, -.PP --o -T}:T{ -Sort resultset according to index whose name is supplied -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---descending, -.PP --z -T}:T{ -Sort resultset in descending order (requires order flag) -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---header, -.PP --h -T}:T{ -Print header (set to 0|FALSE to disable headers in output) -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---useHexFormat, -.PP --x -T}:T{ -Output numbers in hexadecimal format -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---delimiter=char, -.PP --D -T}:T{ -Set a column delimiter -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---disk -T}:T{ -Print disk references (useful only for Disk Data tables having - nonindexed columns) -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---rowid -T}:T{ -Print rowid -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---gci -T}:T{ -Include GCI in output -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---gci64 -T}:T{ -Include GCI and row epoch in output -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---tup, -.PP --t -T}:T{ -Scan in tup order -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---nodata -T}:T{ -Do not print table column data -T}:T{ -.PP -All MySQL 5.6 based releases -T} -.TE -.sp 1 -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_select_all: database option -\fB\-\-database=\fR\fB\fIdbname\fR\fR, -\fB\-d\fR -\fIdbname\fR -.sp -Name of the database in which the table is found\&. The default value is -TEST_DB\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_select_all: parallelism option -\fBparallelism=\fR\fB\fI#\fR\fR, -\fB\-p\fR -\fI#\fR -.sp -Specifies the degree of parallelism\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_select_all: lock option -.\" lock option: ndb_select_all -\fB\-\-lock=\fR\fB\fIlock_type\fR\fR, -\fB\-l \fR\fB\fIlock_type\fR\fR -.sp -Employs a lock when reading the table\&. Possible values for -\fIlock_type\fR -are: -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -0: Read lock -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -1: Read lock with hold -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -2: Exclusive read lock -.RE -.sp -There is no default value for this option\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_select_all: order option -.\" order option: ndb_select_all -\fB\-\-order=\fR\fB\fIindex_name\fR\fR, -\fB\-o \fR\fB\fIindex_name\fR\fR -.sp -Orders the output according to the index named -\fIindex_name\fR\&. Note that this is the name of an index, not of a column, and that the index must have been explicitly named when created\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_select_all: descending option -.\" descending option: ndb_select_all -\fB\-\-descending\fR, -\fB\-z\fR -.sp -Sorts the output in descending order\&. This option can be used only in conjunction with the -\fB\-o\fR -(\fB\-\-order\fR) option\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_select_all: header option -.\" header option: ndb_select_all -\fB\-\-header=FALSE\fR -.sp -Excludes column headers from the output\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_select_all: useHexFormat option -.\" useHexFormat option: ndb_select_all -\fB\-\-useHexFormat\fR -\fB\-x\fR -.sp -Causes all numeric values to be displayed in hexadecimal format\&. This does not affect the output of numerals contained in strings or datetime values\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_select_all: delimiter option -.\" delimiter option: ndb_select_all -\fB\-\-delimiter=\fR\fB\fIcharacter\fR\fR, -\fB\-D \fR\fB\fIcharacter\fR\fR -.sp -Causes the -\fIcharacter\fR -to be used as a column delimiter\&. Only table data columns are separated by this delimiter\&. -.sp -The default delimiter is the tab character\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_select_all: disk option -.\" disk option: ndb_select_all -\fB\-\-disk\fR -.sp -Adds a disk reference column to the output\&. The column is nonempty only for Disk Data tables having nonindexed columns\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_select_all: rowid option -.\" rowid option: ndb_select_all -\fB\-\-rowid\fR -.sp -Adds a -ROWID -column providing information about the fragments in which rows are stored\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_select_all: gci option -.\" gci option: ndb_select_all -\fB\-\-gci\fR -.sp -Adds a -GCI -column to the output showing the global checkpoint at which each row was last updated\&. See -Section\ \&18.1, \(lqMySQL Cluster Overview\(rq, and -Section\ \&18.5.6.2, \(lqMySQL Cluster Log Events\(rq, for more information about checkpoints\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_select_all: gci64 option -.\" gci64 option: ndb_select_all -\fB\-\-gci64\fR -.sp -Adds a -ROW$GCI64 -column to the output showing the global checkpoint at which each row was last updated, as well as the number of the epoch in which this update occurred\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_select_all: tupscan option -.\" tupscan option: ndb_select_all -\fB\-\-tupscan\fR, -\fB\-t\fR -.sp -Scan the table in the order of the tuples\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_select_all: nodata option -.\" nodata option: ndb_select_all -\fB\-\-nodata\fR -.sp -Causes any table data to be omitted\&. -.RE -Sample Output.PP -Output from a MySQL -SELECT -statement: -.sp -.if n \{\ -.RS 4 -.\} -.nf -mysql> \fBSELECT * FROM ctest1\&.fish;\fR -+\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-+ -| id | name | -+\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-+ -| 3 | shark | -| 6 | puffer | -| 2 | tuna | -| 4 | manta ray | -| 5 | grouper | -| 1 | guppy | -+\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-+ -6 rows in set (0\&.04 sec) -.fi -.if n \{\ -.RE -.\} -.PP -Output from the equivalent invocation of -\fBndb_select_all\fR: -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fB\&./ndb_select_all \-c localhost fish \-d ctest1\fR -id name -3 [shark] -6 [puffer] -2 [tuna] -4 [manta ray] -5 [grouper] -1 [guppy] -6 rows returned -NDBT_ProgramExit: 0 \- OK -.fi -.if n \{\ -.RE -.\} -.PP -Note that all string values are enclosed by square brackets (\(lq[\&.\&.\&.]\(rq) in the output of -\fBndb_select_all\fR\&. For a further example, consider the table created and populated as shown here: -.sp -.if n \{\ -.RS 4 -.\} -.nf -CREATE TABLE dogs ( - id INT(11) NOT NULL AUTO_INCREMENT, - name VARCHAR(25) NOT NULL, - breed VARCHAR(50) NOT NULL, - PRIMARY KEY pk (id), - KEY ix (name) -) -TABLESPACE ts STORAGE DISK -ENGINE=NDBCLUSTER; -INSERT INTO dogs VALUES - (\*(Aq\*(Aq, \*(AqLassie\*(Aq, \*(Aqcollie\*(Aq), - (\*(Aq\*(Aq, \*(AqScooby\-Doo\*(Aq, \*(AqGreat Dane\*(Aq), - (\*(Aq\*(Aq, \*(AqRin\-Tin\-Tin\*(Aq, \*(AqAlsatian\*(Aq), - (\*(Aq\*(Aq, \*(AqRosscoe\*(Aq, \*(AqMutt\*(Aq); -.fi -.if n \{\ -.RE -.\} -.PP -This demonstrates the use of several additional -\fBndb_select_all\fR -options: -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fB\&./ndb_select_all \-d ctest1 dogs \-o ix \-z \-\-gci \-\-disk\fR -GCI id name breed DISK_REF -834461 2 [Scooby\-Doo] [Great Dane] [ m_file_no: 0 m_page: 98 m_page_idx: 0 ] -834878 4 [Rosscoe] [Mutt] [ m_file_no: 0 m_page: 98 m_page_idx: 16 ] -834463 3 [Rin\-Tin\-Tin] [Alsatian] [ m_file_no: 0 m_page: 34 m_page_idx: 0 ] -835657 1 [Lassie] [Collie] [ m_file_no: 0 m_page: 66 m_page_idx: 0 ] -4 rows returned -NDBT_ProgramExit: 0 \- OK -.fi -.if n \{\ -.RE -.\} -.SH "COPYRIGHT" -.br -.PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. -.PP -This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. -.PP -This documentation 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. -.PP -You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. -.sp -.SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. -.SH AUTHOR -Oracle Corporation (http://dev.mysql.com/). diff --git a/mysql-wsrep-5.6/man/ndb_select_count.1 b/mysql-wsrep-5.6/man/ndb_select_count.1 deleted file mode 100644 index 37fd7e42..00000000 --- a/mysql-wsrep-5.6/man/ndb_select_count.1 +++ /dev/null @@ -1,147 +0,0 @@ -'\" t -.\" Title: \fBndb_select_count\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.6 -.\" Language: English -.\" -.TH "\FBNDB_SELECT_COUNT\" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.\" ndb_select_count -.SH "NAME" -ndb_select_count \- print row counts for NDB tables -.SH "SYNOPSIS" -.HP \w'\fBndb_select_count\ [\-c\ \fR\fB\fIconnect_string\fR\fR\fB]\ \-d\ \fR\fB\fIdb_name\fR\fR\fB\ \fR\fB\fItbl_name\fR\fR\fB[\ \fR\fB\fItbl_name2\fR\fR\fB[\ \&.\&.\&.]]\fR\ 'u -\fBndb_select_count [\-c \fR\fB\fIconnect_string\fR\fR\fB] \-d \fR\fB\fIdb_name\fR\fR\fB \fR\fB\fItbl_name\fR\fR\fB[ \fR\fB\fItbl_name2\fR\fR\fB[ \&.\&.\&.]]\fR -.SH "DESCRIPTION" -.PP -\fBndb_select_count\fR -prints the number of rows in one or more -NDB -tables\&. With a single table, the result is equivalent to that obtained by using the MySQL statement -SELECT COUNT(*) FROM \fItbl_name\fR\&. -Usage -.sp -.if n \{\ -.RS 4 -.\} -.nf -ndb_select_count [\-c \fIconnect_string\fR] \-d\fIdb_name\fR \fItbl_name\fR[, \fItbl_name2\fR[, \&.\&.\&.]] -.fi -.if n \{\ -.RE -.\} -.PP -The following table includes options that are specific to the MySQL Cluster native backup restoration program -\fBndb_select_count\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including -\fBndb_select_count\fR), see -Options Common to MySQL Cluster Programs(1)\&. -.sp -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.B Table\ \&18.93.\ \& This table describes command-line options for the ndb_select_count program -.TS -allbox tab(:); -lB lB lB. -T{ -Format -T}:T{ -Description -T}:T{ -Added or Removed -T} -.T& -l l l -l l l -l l l. -T{ -.PP ---database=dbname, -.PP --d -T}:T{ -Name of the database in which the table is found -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---parallelism=#, -.PP --p -T}:T{ -Degree of parallelism -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---lock=#, -.PP --l -T}:T{ -Lock type -T}:T{ -.PP -All MySQL 5.6 based releases -T} -.TE -.sp 1 -.PP -You can obtain row counts from multiple tables in the same database by listing the table names separated by spaces when invoking this command, as shown under -\fBSample Output\fR\&. -Sample Output -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fB\&./ndb_select_count \-c localhost \-d ctest1 fish dogs\fR -6 records in table fish -4 records in table dogs -NDBT_ProgramExit: 0 \- OK -.fi -.if n \{\ -.RE -.\} -.SH "COPYRIGHT" -.br -.PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. -.PP -This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. -.PP -This documentation 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. -.PP -You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. -.sp -.SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. -.SH AUTHOR -Oracle Corporation (http://dev.mysql.com/). diff --git a/mysql-wsrep-5.6/man/ndb_setup.py.1 b/mysql-wsrep-5.6/man/ndb_setup.py.1 deleted file mode 100644 index 773767a3..00000000 --- a/mysql-wsrep-5.6/man/ndb_setup.py.1 +++ /dev/null @@ -1,691 +0,0 @@ -'\" t -.\" Title: \fBndb_setup.py\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.6 -.\" Language: English -.\" -.TH "\FBNDB_SETUP\&.PY\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.\" ndb_setup.py -.SH "NAME" -ndb_setup.py \- Start browser\-based Auti\-Installer for MySQL Cluster -.SH "SYNOPSIS" -.HP \w'\fBndb_setup\&.py\ [\fR\fB\fIoptions\fR\fR\fB]\fR\ 'u -\fBndb_setup\&.py [\fR\fB\fIoptions\fR\fR\fB]\fR -.SH "DESCRIPTION" -.\" MySQL Cluster Auto-Installer: setup program -.PP -\fBndb_setup\&.py\fR -starts the MySQL Cluster Auto\-Installer and opens the installer\*(Aqs Start page in the default Web browser\&. -.PP -This section describes usage of and program options for the command\-line tool only\&. For information about using the Auto\-Installer GUI that is spawned when -\fBndb_setup\&.py\fR -is invoked, see -Section\ \&18.2.1, \(lqThe MySQL Cluster Auto-Installer\(rq\&. -Usage.PP -All platforms: -.sp -.if n \{\ -.RS 4 -.\} -.nf -ndb_setup\&.py [\fIoptions\fR] -.fi -.if n \{\ -.RE -.\} -.sp -.\" setup.bat: MySQL Cluster (Windows) -.\" MySQL Cluster Auto-Installer: setup program (Windows) -.PP -Additionally, on Windows platforms only: -.sp -.if n \{\ -.RS 4 -.\} -.nf -setup\&.bat [\fIoptions\fR] -.fi -.if n \{\ -.RE -.\} -.PP -The following table includes all options that are supported by the MySQL Cluster installation and configuration program -\fBndb_setup\&.py\fR\&. Additional descriptions follow the table\&. -.sp -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.B Table\ \&18.94.\ \& This table describes command-line options for the ndb_setup.py program -.TS -allbox tab(:); -lB lB lB. -T{ -Format -T}:T{ -Description -T}:T{ -Added or Removed -T} -.T& -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l. -T{ -.PP ---browser-start-page=filename, -.PP --s -T}:T{ -Page that the web browser opens when starting. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---ca-certs-file=filename, -.PP --a -T}:T{ -File containing list of client certificates allowed to connect to - the server -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---cert-file=filename, -.PP --c -T}:T{ -File containing X509 certificate that identifies the server. - (Default: cfg.pem) -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---debug-level=level, -.PP --d -T}:T{ -Python logging module debug level. One of DEBUG, INFO, WARNING - (default), ERROR, or CRITICAL. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---help, -.PP --h -T}:T{ -Print help message -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---key-file=file, -.PP --k -T}:T{ -Specify file containing private key (if not included in - --cert-file) -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---no-browser, -.PP --n -T}:T{ -Do not open the start page in a browser, merely start the tool -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---port=#, -.PP --p -T}:T{ -Specify the port used by the web server -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---server-log-file=file, -.PP -o -T}:T{ -Log requests to this file. Use '-' to force logging to stderr - instead. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---server-name=name, -.PP --N -T}:T{ -The name of the server to connect with -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---use-https, -.PP --S -T}:T{ -Use secure (HTTPS) client-server connection -T}:T{ -.PP -All MySQL 5.6 based releases -T} -.TE -.sp 1 -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_setup.py: browser-start-page option -.\" browser-start-page option: ndb_setup.py -\fB\-\-browser\-start\-page=\fR\fB\fIfile\fR\fR, -\fB\-s\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-browser\-start\-page=filename -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -string -T} -:T{ -\fBDefault\fR -T}:T{ -index\&.html -T} -.TE -.sp 1 -Specify the file to open in the browser as the installation and configuration Start page\&. The default is -index\&.html\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_setup.py: ca-certs-file option -.\" ca-certs-file option: ndb_setup.py -\fB\-\-ca\-certs\-file=\fR\fB\fIfile\fR\fR, -\fB\-a\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-ca\-certs\-file=filename -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -file name -T} -:T{ -\fBDefault\fR -T}:T{ -[none] -T} -.TE -.sp 1 -Specify a file containing a list of client certificates which are allowed to connect to the server\&. The default is an empty string, which means that no client authentication is used\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_setup.py: cert-file option -.\" cert-file option: ndb_setup.py -\fB\-\-cert\-file=\fR\fB\fIfile\fR\fR, -\fB\-c\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-cert\-file=filename -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -file name -T} -:T{ -\fBDefault\fR -T}:T{ -cfg\&.pem -T} -.TE -.sp 1 -Specify a file containing an X509 certificate which identifies the server\&. It is possible for the certificate to be self\-signed\&. The default is -cfg\&.pem\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_setup.py: debug-level option -.\" debug-level option: ndb_setup.py -\fB\-\-debug\-level=\fR\fB\fIlevel\fR\fR, -\fB\-d\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s -^ lt l s -^ ^ l s -^ ^ l s -^ ^ l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-debug\-level=level -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -enumeration -T} -:T{ -\fBDefault\fR -T}:T{ -WARNING -T} -:T{ -\fBValid Values\fR -T}:T{ -DEBUG -T} -::T{ -INFO -T} -::T{ -ERROR -T} -::T{ -CRITICAL -T} -.TE -.sp 1 -Set the Python logging module debug level\&. This is one of -DEBUG, -INFO, -WARNING, -ERROR, or -CRITICAL\&. -WARNING -is the default\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_setup.py: help option -.\" help option: ndb_setup.py -\fB\-\-help\fR, -\fB\-h\fR -.TS -allbox tab(:); -l l s s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-help -T} -.TE -.sp 1 -Print a help message\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_setup.py: key-file option -.\" key-file option: ndb_setup.py -\fB\-\-key\-file=\fR\fB\fIfile\fR\fR, -\fB\-d\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-key\-file=file -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -file name -T} -:T{ -\fBDefault\fR -T}:T{ -[none] -T} -.TE -.sp 1 -Specify a file containing the private key if this is not included in the X509 certificate file (\fB\-\-cert\-file\fR)\&. The default is an empty string, which means that no such file is used\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_setup.py: no-browser option -.\" no-browser option: ndb_setup.py -\fB\-\-no\-browser\fR, -\fB\-n\fR -.TS -allbox tab(:); -l l s s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-no\-browser -T} -.TE -.sp 1 -Start the installation and configuration tool, but do not open the Start page in a browser\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_setup.py: port option -.\" port option: ndb_setup.py -\fB\-\-port=\fR\fB\fI#\fR\fR, -\fB\-p\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s -^ l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-port=# -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -numeric -T} -:T{ -\fBDefault\fR -T}:T{ -8081 -T} -:T{ -\fBMin Value\fR -T}:T{ -1 -T} -:T{ -\fBMax Value\fR -T}:T{ -65535 -T} -.TE -.sp 1 -Set the port used by the web server\&. The default is 8081\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_setup.py: server-log-file option -.\" server-log-file option: ndb_setup.py -\fB\-\-server\-log\-file=\fR\fB\fIfile\fR\fR, -\fB\-o\fR -.TS -allbox tab(:); -l l s s -l l s s -l l l s -^ l l s -^ lt l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-server\-log\-file=file -T} -T{ -\ \& -T}:T{ -o -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -file name -T} -:T{ -\fBDefault\fR -T}:T{ -ndb_setup\&.log -T} -:T{ -\fBValid Values\fR -T}:T{ -\- (Log to stderr) -T} -.TE -.sp 1 -Log requests to this file\&. The default is -ndb_setup\&.log\&. To specify logging to -stderr, rather than to a file, use a -\- -(dash character) for the file name\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_setup.py: server-name option -.\" server-name option: ndb_setup.py -\fB\-\-server\-name=\fR\fB\fIhost\fR\fR, -\fB\-N\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-server\-name=name -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -string -T} -:T{ -\fBDefault\fR -T}:T{ -localhost -T} -.TE -.sp 1 -Specify the host name or IP address for the browser to use when connecting\&. The default is -localhost\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_setup.py: use-https option -.\" use-https option: ndb_setup.py -\fB\-\-use\-https\fR, -\fB\-S\fR -.TS -allbox tab(:); -l l s s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-use\-https -T} -.TE -.sp 1 -Make the browser use a secure (HTTPS) connection with the server\&. -.RE -.SH "COPYRIGHT" -.br -.PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. -.PP -This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. -.PP -This documentation 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. -.PP -You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. -.sp -.SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. -.SH AUTHOR -Oracle Corporation (http://dev.mysql.com/). diff --git a/mysql-wsrep-5.6/man/ndb_show_tables.1 b/mysql-wsrep-5.6/man/ndb_show_tables.1 deleted file mode 100644 index d84124d4..00000000 --- a/mysql-wsrep-5.6/man/ndb_show_tables.1 +++ /dev/null @@ -1,323 +0,0 @@ -'\" t -.\" Title: \fBndb_show_tables\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.6 -.\" Language: English -.\" -.TH "\FBNDB_SHOW_TABLES\F" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.\" ndb_show_tables -.SH "NAME" -ndb_show_tables \- display list of NDB tables -.SH "SYNOPSIS" -.HP \w'\fBndb_show_tables\ [\fR\fB\fIoptions\fR\fR\fB]\fR\ 'u -\fBndb_show_tables [\fR\fB\fIoptions\fR\fR\fB]\fR -.SH "DESCRIPTION" -.PP -\fBndb_show_tables\fR -displays a list of all -NDB -database objects in the cluster\&. By default, this includes not only both user\-created tables and -NDB -system tables, but -NDB\-specific indexes, internal triggers, and MySQL Cluster Disk Data objects as well\&. -.PP -The following table includes options that are specific to the MySQL Cluster native backup restoration program -\fBndb_show_tables\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including -\fBndb_show_tables\fR), see -Options Common to MySQL Cluster Programs(1)\&. -.sp -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.B Table\ \&18.95.\ \& This table describes command-line options for the ndb_show_tables program -.TS -allbox tab(:); -lB lB lB. -T{ -Format -T}:T{ -Description -T}:T{ -Added or Removed -T} -.T& -l l l -l l l -l l l -l l l -l l l -l l l. -T{ -.PP ---database=string, -.PP --d -T}:T{ -Specifies the database in which the table is found -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---loops=#, -.PP --l -T}:T{ -Number of times to repeat output -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---type=#, -.PP --t -T}:T{ -Limit output to objects of this type -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---unqualified, -.PP --u -T}:T{ -Do not qualify table names -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---parsable, -.PP --p -T}:T{ -Return output suitable for MySQL LOAD DATA INFILE statement -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---show-temp-status -T}:T{ -Show table temporary flag -T}:T{ -.PP -All MySQL 5.6 based releases -T} -.TE -.sp 1 -Usage -.sp -.if n \{\ -.RS 4 -.\} -.nf -ndb_show_tables [\-c \fIconnect_string\fR] -.fi -.if n \{\ -.RE -.\} -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_show_tables: database option -.\" database option: ndb_show_tables -\fB\-\-database\fR, -\fB\-d\fR -.sp -Specifies the name of the database in which the tables are found\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_show_tables: loops option -.\" loops option: ndb_show_tables -\fB\-\-loops\fR, -\fB\-l\fR -.sp -Specifies the number of times the utility should execute\&. This is 1 when this option is not specified, but if you do use the option, you must supply an integer argument for it\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_show_tables: parsable option -.\" parsable option: ndb_show_tables -\fB\-\-parsable\fR, -\fB\-p\fR -.sp -Using this option causes the output to be in a format suitable for use with -LOAD DATA INFILE\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_show_tables: show-temp-status option -.\" show-temp-status option: ndb_show_tables -\fB\-\-show\-temp\-status\fR -.sp -If specified, this causes temporary tables to be displayed\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_show_tables: type option -.\" type option: ndb_show_tables -\fB\-\-type\fR, -\fB\-t\fR -.sp -Can be used to restrict the output to one type of object, specified by an integer type code as shown here: -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -1: System table -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -2: User\-created table -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -3: Unique hash index -.RE -.sp -Any other value causes all -NDB -database objects to be listed (the default)\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_show_tables: unqualified option -.\" unqualified option: ndb_show_tables -\fB\-\-unqualified\fR, -\fB\-u\fR -.sp -If specified, this causes unqualified object names to be displayed\&. -.RE -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBNote\fR -.ps -1 -.br -.PP -Only user\-created MySQL Cluster tables may be accessed from MySQL; system tables such as -SYSTAB_0 -are not visible to -\fBmysqld\fR\&. However, you can examine the contents of system tables using -NDB -API applications such as -\fBndb_select_all\fR -(see -\fBndb_select_all\fR(1))\&. -.sp .5v -.RE -.SH "COPYRIGHT" -.br -.PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. -.PP -This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. -.PP -This documentation 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. -.PP -You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. -.sp -.SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. -.SH AUTHOR -Oracle Corporation (http://dev.mysql.com/). diff --git a/mysql-wsrep-5.6/man/ndb_size.pl.1 b/mysql-wsrep-5.6/man/ndb_size.pl.1 deleted file mode 100644 index 149f3d3a..00000000 --- a/mysql-wsrep-5.6/man/ndb_size.pl.1 +++ /dev/null @@ -1,413 +0,0 @@ -'\" t -.\" Title: \fBndb_size.pl\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.6 -.\" Language: English -.\" -.TH "\FBNDB_SIZE\&.PL\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.\" ndb_size.pl -.SH "NAME" -ndb_size.pl \- NDBCLUSTER Size Requirement Estimator -.SH "SYNOPSIS" -.HP \w'\fBndb_size\&.pl\ \fR\fB\fIarguments\fR\fR\ 'u -\fBndb_size\&.pl \fR\fB\fIarguments\fR\fR -.SH "DESCRIPTION" -.PP -This is a Perl script that can be used to estimate the amount of space that would be required by a MySQL database if it were converted to use the -NDBCLUSTER -storage engine\&. Unlike the other utilities discussed in this section, it does not require access to a MySQL Cluster (in fact, there is no reason for it to do so)\&. However, it does need to access the MySQL server on which the database to be tested resides\&. -Requirements -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -A running MySQL server\&. The server instance does not have to provide support for MySQL Cluster\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -A working installation of Perl\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -The -DBI -module, which can be obtained from CPAN if it is not already part of your Perl installation\&. (Many Linux and other operating system distributions provide their own packages for this library\&.) -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -A MySQL user account having the necessary privileges\&. If you do not wish to use an existing account, then creating one using -GRANT USAGE ON \fIdb_name\fR\&.*\(emwhere -\fIdb_name\fR -is the name of the database to be examined\(emis sufficient for this purpose\&. -.RE -.PP -ndb_size\&.pl -can also be found in the MySQL sources in -storage/ndb/tools\&. -.PP -The following table includes options that are specific to the MySQL Cluster program -\fBndb_size\&.pl\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including -\fBndb_size\&.pl\fR), see -Options Common to MySQL Cluster Programs(1)\&. -.sp -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.B Table\ \&18.96.\ \& This table describes command-line options for the ndb_size.pl program -.TS -allbox tab(:); -lB lB lB. -T{ -Format -T}:T{ -Description -T}:T{ -Added or Removed -T} -.T& -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l. -T{ -.PP ---database=dbname -T}:T{ -The database or databases to examine; accepts a comma-delimited - list; the default is ALL (use all databases found on the server) -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---hostname[:port] -T}:T{ -Specify host and optional port as host[:port] -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---socket=file -T}:T{ -Specify a socket to connect to -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---user=string -T}:T{ -Specify a MySQL user name -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---password=string -T}:T{ -Specify a MySQL user password -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---format=string -T}:T{ -Set output format (text or HTML) -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---excludetables=tbl_list -T}:T{ -Skip any tables in a comma-separated list of tables -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---excludedbs=db_list -T}:T{ -Skip any databases in a comma-separated list of databases -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---savequeries=file -T}:T{ -Saves all queries to the database into the file specified -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---loadqueries=file -T}:T{ -Loads all queries from the file specified; does not connect to a - database -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---real_table_name=table -T}:T{ -Designates a table to handle unique index size calculations -T}:T{ -.PP -All MySQL 5.6 based releases -T} -.TE -.sp 1 -Usage -.sp -.if n \{\ -.RS 4 -.\} -.nf -perl ndb_size\&.pl [\-\-database={\fIdb_name\fR|ALL}] [\-\-hostname=\fIhost\fR[:\fIport\fR]] [\-\-socket=\fIsocket\fR] \e - [\-\-user=\fIuser\fR] [\-\-password=\fIpassword\fR] \e - [\-\-help|\-h] [\-\-format={html|text}] \e - [\-\-loadqueries=\fIfile_name\fR] [\-\-savequeries=\fIfile_name\fR] -.fi -.if n \{\ -.RE -.\} -.PP -By default, this utility attempts to analyze all databases on the server\&. You can specify a single database using the -\fB\-\-database\fR -option; the default behavior can be made explicit by using -ALL -for the name of the database\&. You can also exclude one or more databases by using the -\fB\-\-excludedbs\fR -option with a comma\-separated list of the names of the databases to be skipped\&. Similarly, you can cause specific tables to be skipped by listing their names, separated by commas, following the optional -\fB\-\-excludetables\fR -option\&. A host name can be specified using -\fB\-\-hostname\fR; the default is -localhost\&. You can specify a port in addition to the host using -\fIhost\fR:\fIport\fR -format for the value of -\fB\-\-hostname\fR\&. The default port number is 3306\&. If necessary, you can also specify a socket; the default is -/var/lib/mysql\&.sock\&. A MySQL user name and password can be specified the corresponding options shown\&. It also possible to control the format of the output using the -\fB\-\-format\fR -option; this can take either of the values -html -or -text, with -text -being the default\&. An example of the text output is shown here: -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fBndb_size\&.pl \-\-database=test \-\-socket=/tmp/mysql\&.sock\fR -ndb_size\&.pl report for database: \*(Aqtest\*(Aq (1 tables) -\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- -Connected to: DBI:mysql:host=localhost;mysql_socket=/tmp/mysql\&.sock -Including information for versions: 4\&.1, 5\&.0, 5\&.1 -test\&.t1 -\-\-\-\-\-\-\- -DataMemory for Columns (* means varsized DataMemory): - Column Name Type Varsized Key 4\&.1 5\&.0 5\&.1 - HIDDEN_NDB_PKEY bigint PRI 8 8 8 - c2 varchar(50) Y 52 52 4* - c1 int(11) 4 4 4 - \-\- \-\- \-\- -Fixed Size Columns DM/Row 64 64 12 - Varsize Columns DM/Row 0 0 4 -DataMemory for Indexes: - Index Name Type 4\&.1 5\&.0 5\&.1 - PRIMARY BTREE 16 16 16 - \-\- \-\- \-\- - Total Index DM/Row 16 16 16 -IndexMemory for Indexes: - Index Name 4\&.1 5\&.0 5\&.1 - PRIMARY 33 16 16 - \-\- \-\- \-\- - Indexes IM/Row 33 16 16 -Summary (for THIS table): - 4\&.1 5\&.0 5\&.1 - Fixed Overhead DM/Row 12 12 16 - NULL Bytes/Row 4 4 4 - DataMemory/Row 96 96 48 - (Includes overhead, bitmap and indexes) - Varsize Overhead DM/Row 0 0 8 - Varsize NULL Bytes/Row 0 0 4 - Avg Varside DM/Row 0 0 16 - No\&. Rows 0 0 0 - Rows/32kb DM Page 340 340 680 -Fixedsize DataMemory (KB) 0 0 0 -Rows/32kb Varsize DM Page 0 0 2040 - Varsize DataMemory (KB) 0 0 0 - Rows/8kb IM Page 248 512 512 - IndexMemory (KB) 0 0 0 -Parameter Minimum Requirements -\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- -* indicates greater than default - Parameter Default 4\&.1 5\&.0 5\&.1 - DataMemory (KB) 81920 0 0 0 - NoOfOrderedIndexes 128 1 1 1 - NoOfTables 128 1 1 1 - IndexMemory (KB) 18432 0 0 0 - NoOfUniqueHashIndexes 64 0 0 0 - NoOfAttributes 1000 3 3 3 - NoOfTriggers 768 5 5 5 -.fi -.if n \{\ -.RE -.\} -.PP -For debugging purposes, the Perl arrays containing the queries run by this script can be read from the file specified using can be saved to a file using -\fB\-\-savequeries\fR; a file containing such arrays to be read in during script execution can be specified using -\fB\-\-loadqueries\fR\&. Neither of these options has a default value\&. -.PP -To produce output in HTML format, use the -\fB\-\-format\fR -option and redirect the output to a file, as shown here: -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fBndb_size\&.pl \-\-database=test \-\-socket=/tmp/mysql\&.sock \-\-format=html > ndb_size\&.html\fR -.fi -.if n \{\ -.RE -.\} -.PP -(Without the redirection, the output is sent to -stdout\&.) -.PP -The output from this script includes the following information: -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -Minimum values for the -DataMemory, -IndexMemory, -MaxNoOfTables, -MaxNoOfAttributes, -MaxNoOfOrderedIndexes, -MaxNoOfUniqueHashIndexes, and -MaxNoOfTriggers -configuration parameters required to accommodate the tables analyzed\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -Memory requirements for all of the tables, attributes, ordered indexes, and unique hash indexes defined in the database\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -The -IndexMemory -and -DataMemory -required per table and table row\&. -.RE -.SH "COPYRIGHT" -.br -.PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. -.PP -This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. -.PP -This documentation 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. -.PP -You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. -.sp -.SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. -.SH AUTHOR -Oracle Corporation (http://dev.mysql.com/). diff --git a/mysql-wsrep-5.6/man/ndb_waiter.1 b/mysql-wsrep-5.6/man/ndb_waiter.1 deleted file mode 100644 index 8c7c83e5..00000000 --- a/mysql-wsrep-5.6/man/ndb_waiter.1 +++ /dev/null @@ -1,497 +0,0 @@ -'\" t -.\" Title: \fBndb_waiter\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.6 -.\" Language: English -.\" -.TH "\FBNDB_WAITER\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.\" ndb_waiter -.SH "NAME" -ndb_waiter \- wait for MySQL Cluster to reach a given status -.SH "SYNOPSIS" -.HP \w'\fBndb_waiter\ \fR\fB\fIoptions\fR\fR\ 'u -\fBndb_waiter \fR\fB\fIoptions\fR\fR -.SH "DESCRIPTION" -.PP -\fBndb_waiter\fR -repeatedly (each 100 milliseconds) prints out the status of all cluster data nodes until either the cluster reaches a given status or the -\fB\-\-timeout\fR -limit is exceeded, then exits\&. By default, it waits for the cluster to achieve -STARTED -status, in which all nodes have started and connected to the cluster\&. This can be overridden using the -\fB\-\-no\-contact\fR -and -\fB\-\-not\-started\fR -options\&. -.PP -The node states reported by this utility are as follows: -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -NO_CONTACT: The node cannot be contacted\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -UNKNOWN: The node can be contacted, but its status is not yet known\&. Usually, this means that the node has received a -START -or -RESTART -command from the management server, but has not yet acted on it\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -NOT_STARTED: The node has stopped, but remains in contact with the cluster\&. This is seen when restarting the node using the management client\*(Aqs -RESTART -command\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -STARTING: The node\*(Aqs -\fBndbd\fR -process has started, but the node has not yet joined the cluster\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -STARTED: The node is operational, and has joined the cluster\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -SHUTTING_DOWN: The node is shutting down\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -SINGLE USER MODE: This is shown for all cluster data nodes when the cluster is in single user mode\&. -.RE -.PP -The following table includes options that are specific to the MySQL Cluster native backup restoration program -\fBndb_waiter\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including -\fBndb_waiter\fR), see -Options Common to MySQL Cluster Programs(1)\&. -.sp -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.B Table\ \&18.97.\ \& This table describes command-line options for the ndb_waiter program -.TS -allbox tab(:); -lB lB lB. -T{ -Format -T}:T{ -Description -T}:T{ -Added or Removed -T} -.T& -l l l -l l l -l l l -l l l -l l l -l l l. -T{ -.PP ---no-contact, -.PP --n -T}:T{ -Wait for cluster to reach NO CONTACT state -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---not-started -T}:T{ -Wait for cluster to reach NOT STARTED state -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---single-user -T}:T{ -Wait for cluster to enter single user mode -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---timeout=#, -.PP --t -T}:T{ -Wait this many seconds, then exit whether or not cluster has - reached desired state; default is 2 minutes (120 seconds) -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---nowait-nodes=list -T}:T{ -List of nodes not to be waited for. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---wait-nodes=list, -.PP --w -T}:T{ -List of nodes to be waited for. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -.TE -.sp 1 -Usage -.sp -.if n \{\ -.RS 4 -.\} -.nf -ndb_waiter [\-c \fIconnect_string\fR] -.fi -.if n \{\ -.RE -.\} -Additional Options -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_waiter: no-contact option -.\" no-contact option: ndb_waiter -\fB\-\-no\-contact\fR, -\fB\-n\fR -.sp -Instead of waiting for the -STARTED -state, -\fBndb_waiter\fR -continues running until the cluster reaches -NO_CONTACT -status before exiting\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_waiter: not-started option -.\" not-started option: ndb_waiter -\fB\-\-not\-started\fR -.sp -Instead of waiting for the -STARTED -state, -\fBndb_waiter\fR -continues running until the cluster reaches -NOT_STARTED -status before exiting\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_waiter: timeout option -.\" timeout option: ndb_waiter -\fB\-\-timeout=\fR\fB\fIseconds\fR\fR, -\fB\-t \fR\fB\fIseconds\fR\fR -.sp -Time to wait\&. The program exits if the desired state is not achieved within this number of seconds\&. The default is 120 seconds (1200 reporting cycles)\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_waiter: single-user option -.\" single-user option: ndb_waiter -\fB\-\-single\-user\fR -.sp -The program waits for the cluster to enter single user mode\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_waiter: nowait-nodes option -.\" nowait-nodes option: ndb_waiter -\fB\-\-nowait\-nodes=\fR\fB\fIlist\fR\fR -.sp -When this option is used, ndb_waiter does not wait for the nodes whose IDs are listed\&. The list is comma\-delimited; ranges can be indicated by dashes, as shown here: -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fBndb_waiter \-\-nowait\-nodes=1,3,7\-9\fR -.fi -.if n \{\ -.RE -.\} -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBImportant\fR -.ps -1 -.br -Do -\fInot\fR -use this option together with the -\fB\-\-wait\-nodes\fR -option\&. -.sp .5v -.RE -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" ndb_waiter: wait-nodes option -.\" wait-nodes option: ndb_waiter -\fB\-\-wait\-nodes=\fR\fB\fIlist\fR\fR, -\fB\-w \fR\fB\fIlist\fR\fR -.sp -When this option is used, -\fBndb_waiter\fR -waits only for the nodes whose IDs are listed\&. The list is comma\-delimited; ranges can be indicated by dashes, as shown here: -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fBndb_waiter \-\-wait\-nodes=2,4\-6,10\fR -.fi -.if n \{\ -.RE -.\} -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBImportant\fR -.ps -1 -.br -Do -\fInot\fR -use this option together with the -\fB\-\-nowait\-nodes\fR -option\&. -.sp .5v -.RE -.RE -.PP -\fBSample Output\fR. Shown here is the output from -\fBndb_waiter\fR -when run against a 4\-node cluster in which two nodes have been shut down and then started again manually\&. Duplicate reports (indicated by -\(lq\&.\&.\&.\(rq) are omitted\&. -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fB\&./ndb_waiter \-c localhost\fR -Connecting to mgmsrv at (localhost) -State node 1 STARTED -State node 2 NO_CONTACT -State node 3 STARTED -State node 4 NO_CONTACT -Waiting for cluster enter state STARTED -\&.\&.\&. -State node 1 STARTED -State node 2 UNKNOWN -State node 3 STARTED -State node 4 NO_CONTACT -Waiting for cluster enter state STARTED -\&.\&.\&. -State node 1 STARTED -State node 2 STARTING -State node 3 STARTED -State node 4 NO_CONTACT -Waiting for cluster enter state STARTED -\&.\&.\&. -State node 1 STARTED -State node 2 STARTING -State node 3 STARTED -State node 4 UNKNOWN -Waiting for cluster enter state STARTED -\&.\&.\&. -State node 1 STARTED -State node 2 STARTING -State node 3 STARTED -State node 4 STARTING -Waiting for cluster enter state STARTED -\&.\&.\&. -State node 1 STARTED -State node 2 STARTED -State node 3 STARTED -State node 4 STARTING -Waiting for cluster enter state STARTED -\&.\&.\&. -State node 1 STARTED -State node 2 STARTED -State node 3 STARTED -State node 4 STARTED -Waiting for cluster enter state STARTED -NDBT_ProgramExit: 0 \- OK -.fi -.if n \{\ -.RE -.\} -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBNote\fR -.ps -1 -.br -.PP -If no connection string is specified, then -\fBndb_waiter\fR -tries to connect to a management on -localhost, and reports -Connecting to mgmsrv at (null)\&. -.sp .5v -.RE -.SH "COPYRIGHT" -.br -.PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. -.PP -This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. -.PP -This documentation 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. -.PP -You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. -.sp -.SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. -.SH AUTHOR -Oracle Corporation (http://dev.mysql.com/). diff --git a/mysql-wsrep-5.6/man/ndbd.8 b/mysql-wsrep-5.6/man/ndbd.8 deleted file mode 100644 index 449f7b0d..00000000 --- a/mysql-wsrep-5.6/man/ndbd.8 +++ /dev/null @@ -1,1167 +0,0 @@ -'\" t -.\" Title: \fBndbd\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.6 -.\" Language: English -.\" -.TH "\FBNDBD\FR" "8" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.\" ndbd -.\" MySQL Cluster: ndbd -.\" MySQL Cluster: data nodes -.\" data nodes (MySQL Cluster) -.\" storage nodes - see data nodes, ndbd -.SH "NAME" -ndbd \- the MySQL Cluster data node daemon -.SH "SYNOPSIS" -.HP \w'\fBndbd\ \fR\fB\fIoptions\fR\fR\ 'u -\fBndbd \fR\fB\fIoptions\fR\fR -.SH "DESCRIPTION" -.PP -\fBndbd\fR -is the process that is used to handle all the data in tables using the NDB Cluster storage engine\&. This is the process that empowers a data node to accomplish distributed transaction handling, node recovery, checkpointing to disk, online backup, and related tasks\&. -.PP -In a MySQL Cluster, a set of -\fBndbd\fR -processes cooperate in handling data\&. These processes can execute on the same computer (host) or on different computers\&. The correspondences between data nodes and Cluster hosts is completely configurable\&. -.\" MySQL Cluster: administration -.\" MySQL Cluster: commands -.\" command options (MySQL Cluster): ndbd -.\" MySQL Cluster: ndbd process -.PP -The following table includes command options specific to the MySQL Cluster data node program -\fBndbd\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including -\fBndbd\fR), see -Options Common to MySQL Cluster Programs(1)\&. -.sp -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.B Table\ \&18.78.\ \& This table describes command-line options for the ndbd program -.TS -allbox tab(:); -lB lB lB. -T{ -Format -T}:T{ -Description -T}:T{ -Added or Removed -T} -.T& -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l -l l l. -T{ -.PP ---initial -T}:T{ -Perform initial start of ndbd, including cleaning the file system. - Consult the documentation before using this option -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---nostart, -.PP --n -T}:T{ -Don't start ndbd immediately; ndbd waits for command to start - from ndb_mgmd -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---daemon, -.PP --d -T}:T{ -Start ndbd as daemon (default); override with --nodaemon -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---nodaemon -T}:T{ -Do not start ndbd as daemon; provided for testing purposes -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---foreground -T}:T{ -Run ndbd in foreground, provided for debugging purposes (implies - --nodaemon) -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---nowait-nodes=list -T}:T{ -Do not wait for these data nodes to start (takes comma-separated - list of node IDs). Also requires --ndb-nodeid to be used. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---initial-start -T}:T{ -Perform partial initial start (requires --nowait-nodes) -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---bind-address=name -T}:T{ -Local bind address -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---install[=name] -T}:T{ -Used to install the data node process as a Windows service. Does - not apply on non-Windows platforms. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---remove[=name] -T}:T{ -Used to remove a data node process that was previously installed - as a Windows service. Does not apply on non-Windows platforms. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---connect-retries=# -T}:T{ -Number of times to try contacting the management server; set to -1 - to keep trying indefinitely -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---connect-delay=# -T}:T{ -Time to wait between attempts to contact a management server, in - seconds -T}:T{ -.PP -All MySQL 5.6 based releases -T} -.TE -.sp 1 -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBNote\fR -.ps -1 -.br -.PP -All of these options also apply to the multi\-threaded version of this program (\fBndbmtd\fR) and you may substitute -\(lq\fBndbmtd\fR\(rq -for -\(lq\fBndbd\fR\(rq -wherever the latter occurs in this section\&. -.sp .5v -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -\fB\-\-bind\-address\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-bind\-address=name -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -string -T} -:T{ -\fBDefault\fR -T}:T{ -T} -.TE -.sp 1 -Causes -\fBndbd\fR -to bind to a specific network interface (host name or IP address)\&. This option has no default value\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -\fB\-\-daemon\fR, -\fB\-d\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-daemon -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -TRUE -T} -.TE -.sp 1 -Instructs -\fBndbd\fR -or -\fBndbmtd\fR -to execute as a daemon process\&. This is the default behavior\&. -\fB\-\-nodaemon\fR -can be used to prevent the process from running as a daemon\&. -.sp -This option has no effect when running -\fBndbd\fR -or -\fBndbmtd\fR -on Windows platforms\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -\fB\-\-nodaemon\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-nodaemon -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -FALSE -T} -.TE -.sp 1 -Prevents -\fBndbd\fR -or -\fBndbmtd\fR -from executing as a daemon process\&. This option overrides the -\fB\-\-daemon\fR -option\&. This is useful for redirecting output to the screen when debugging the binary\&. -.sp -The default behavior for -\fBndbd\fR -and -\fBndbmtd\fR -on Windows is to run in the foreground, making this option unnecessary on Windows platforms, where it has no effect\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -\fB\-\-foreground\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-foreground -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -FALSE -T} -.TE -.sp 1 -Causes -\fBndbd\fR -or -\fBndbmtd\fR -to execute as a foreground process, primarily for debugging purposes\&. This option implies the -\fB\-\-nodaemon\fR -option\&. -.sp -This option has no effect when running -\fBndbd\fR -or -\fBndbmtd\fR -on Windows platforms\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" initial option (ndbd) -.\" initial option (ndbmtd) -\fB\-\-initial\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-initial -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -FALSE -T} -.TE -.sp 1 -Instructs -\fBndbd\fR -to perform an initial start\&. An initial start erases any files created for recovery purposes by earlier instances of -\fBndbd\fR\&. It also re\-creates recovery log files\&. Note that on some operating systems this process can take a substantial amount of time\&. -.sp -An -\fB\-\-initial\fR -start is to be used -\fIonly\fR -when starting the -\fBndbd\fR -process under very special circumstances; this is because this option causes all files to be removed from the MySQL Cluster file system and all redo log files to be re\-created\&. These circumstances are listed here: -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -When performing a software upgrade which has changed the contents of any files\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -When restarting the node with a new version of -\fBndbd\fR\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -As a measure of last resort when for some reason the node restart or system restart repeatedly fails\&. In this case, be aware that this node can no longer be used to restore data due to the destruction of the data files\&. -.RE -.sp -Use of this option prevents the -StartPartialTimeout -and -StartPartitionedTimeout -configuration parameters from having any effect\&. -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBImportant\fR -.ps -1 -.br -This option does -\fInot\fR -affect either of the following types of files: -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -Backup files that have already been created by the affected node -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -MySQL Cluster Disk Data files (see -Section\ \&18.5.12, \(lqMySQL Cluster Disk Data Tables\(rq)\&. -.RE -.sp -This option also has no effect on recovery of data by a data node that is just starting (or restarting) from data nodes that are already running\&. This recovery of data occurs automatically, and requires no user intervention in a MySQL Cluster that is running normally\&. -.sp .5v -.RE -It is permissible to use this option when starting the cluster for the very first time (that is, before any data node files have been created); however, it is -\fInot\fR -necessary to do so\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" initial-start option (ndbd) -.\" initial-start option (ndbmtd) -\fB\-\-initial\-start\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-initial\-start -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -FALSE -T} -.TE -.sp 1 -This option is used when performing a partial initial start of the cluster\&. Each node should be started with this option, as well as -\fB\-\-nowait\-nodes\fR\&. -.sp -Suppose that you have a 4\-node cluster whose data nodes have the IDs 2, 3, 4, and 5, and you wish to perform a partial initial start using only nodes 2, 4, and 5\(emthat is, omitting node 3: -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fBndbd \-\-ndb\-nodeid=2 \-\-nowait\-nodes=3 \-\-initial\-start\fR -shell> \fBndbd \-\-ndb\-nodeid=4 \-\-nowait\-nodes=3 \-\-initial\-start\fR -shell> \fBndbd \-\-ndb\-nodeid=5 \-\-nowait\-nodes=3 \-\-initial\-start\fR -.fi -.if n \{\ -.RE -.\} -.sp -When using this option, you must also specify the node ID for the data node being started with the -\fB\-\-ndb\-nodeid\fR -option\&. -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBImportant\fR -.ps -1 -.br -Do not confuse this option with the -\fB\-\-nowait\-nodes\fR -option for -\fBndb_mgmd\fR, which can be used to enable a cluster configured with multiple management servers to be started without all management servers being online\&. -.sp .5v -.RE -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" nowait-nodes option (ndbd) -.\" nowait-nodes option (ndbmtd) -\fB\-\-nowait\-nodes=\fR\fB\fInode_id_1\fR\fR\fB[, \fR\fB\fInode_id_2\fR\fR\fB[, \&.\&.\&.]]\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-nowait\-nodes=list -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -string -T} -:T{ -\fBDefault\fR -T}:T{ -T} -.TE -.sp 1 -This option takes a list of data nodes which for which the cluster will not wait for before starting\&. -.sp -This can be used to start the cluster in a partitioned state\&. For example, to start the cluster with only half of the data nodes (nodes 2, 3, 4, and 5) running in a 4\-node cluster, you can start each -\fBndbd\fR -process with -\fB\-\-nowait\-nodes=3,5\fR\&. In this case, the cluster starts as soon as nodes 2 and 4 connect, and does -\fInot\fR -wait -StartPartitionedTimeout -milliseconds for nodes 3 and 5 to connect as it would otherwise\&. -.sp -If you wanted to start up the same cluster as in the previous example without one -\fBndbd\fR -(say, for example, that the host machine for node 3 has suffered a hardware failure) then start nodes 2, 4, and 5 with -\fB\-\-nowait\-nodes=3\fR\&. Then the cluster will start as soon as nodes 2, 4, and 5 connect and will not wait for node 3 to start\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" nostart option (ndbd) -.\" -n option (ndbd) -.\" nostart option (ndbmtd) -.\" -n option (ndbmtd) -\fB\-\-nostart\fR, -\fB\-n\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-nostart -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -FALSE -T} -.TE -.sp 1 -Instructs -\fBndbd\fR -not to start automatically\&. When this option is used, -\fBndbd\fR -connects to the management server, obtains configuration data from it, and initializes communication objects\&. However, it does not actually start the execution engine until specifically requested to do so by the management server\&. This can be accomplished by issuing the proper -START -command in the management client (see -Section\ \&18.5.2, \(lqCommands in the MySQL Cluster Management Client\(rq)\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" install option (ndbd) -.\" install option (ndbmtd) -\fB\-\-install[=\fR\fB\fIname\fR\fR\fB]\fR -.TS -allbox tab(:); -l l s s -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-install[=name] -T} -T{ -\fBPlatform Specific\fR -T}:T{ -Windows -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -string -T} -:T{ -\fBDefault\fR -T}:T{ -ndbd -T} -.TE -.sp 1 -Causes -\fBndbd\fR -to be installed as a Windows service\&. Optionally, you can specify a name for the service; if not set, the service name defaults to -ndbd\&. Although it is preferable to specify other -\fBndbd\fR -program options in a -my\&.ini -or -my\&.cnf -configuration file, it is possible to use together with -\fB\-\-install\fR\&. However, in such cases, the -\fB\-\-install\fR -option must be specified first, before any other options are given, for the Windows service installation to succeed\&. -.sp -It is generally not advisable to use this option together with the -\fB\-\-initial\fR -option, since this causes the data node file system to be wiped and rebuilt every time the service is stopped and started\&. Extreme care should also be taken if you intend to use any of the other -\fBndbd\fR -options that affect the starting of data nodes\(emincluding -\fB\-\-initial\-start\fR, -\fB\-\-nostart\fR, and -\fB\-\-nowait\-nodes\fR\(emtogether with -\fB\-\-install\fR, and you should make absolutely certain you fully understand and allow for any possible consequences of doing so\&. -.sp -The -\fB\-\-install\fR -option has no effect on non\-Windows platforms\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" remove option (ndbd) -.\" remove option (ndbmtd) -\fB\-\-remove[=\fR\fB\fIname\fR\fR\fB]\fR -.TS -allbox tab(:); -l l s s -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-remove[=name] -T} -T{ -\fBPlatform Specific\fR -T}:T{ -Windows -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -string -T} -:T{ -\fBDefault\fR -T}:T{ -ndbd -T} -.TE -.sp 1 -Causes an -\fBndbd\fR -process that was previously installed as a Windows service to be removed\&. Optionally, you can specify a name for the service to be uninstalled; if not set, the service name defaults to -ndbd\&. -.sp -The -\fB\-\-remove\fR -option has no effect on non\-Windows platforms\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" connect-retries option (ndbd) -.\" connect-retries option (ndbmtd) -\fB\-\-connect\-retries=\fR\fB\fI#\fR\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s -^ l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-connect\-retries=# -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -numeric -T} -:T{ -\fBDefault\fR -T}:T{ -12 -T} -:T{ -\fBMin Value\fR -T}:T{ -\-1 -T} -:T{ -\fBMax Value\fR -T}:T{ -65535 -T} -.TE -.sp 1 -Determines the number of times that the data node attempts to contact a management server when starting\&. Setting this option to \-1 causes the data node to keep trying to make contact indefinitely\&. The default is 12 attempts\&. The time to wait between attempts is controlled by the -\fB\-\-connect\-delay\fR -option\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" connect-delay option (ndbd) -.\" connect-delay option (ndbmtd) -\fB\-\-connect\-delay=\fR\fB\fI#\fR\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s -^ l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-connect\-delay=# -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -numeric -T} -:T{ -\fBDefault\fR -T}:T{ -5 -T} -:T{ -\fBMin Value\fR -T}:T{ -0 -T} -:T{ -\fBMax Value\fR -T}:T{ -3600 -T} -.TE -.sp 1 -Determines the time to wait between attempts to contact a management server when starting (the time between attempts is controlled by the -\fB\-\-connect\-retries\fR -option)\&. The default is 5 attempts\&. -.sp -This option was added in MySQL Cluster NDB 7\&.2\&.9\&. -.RE -.\" MySQL Cluster: log files -.\" log files (MySQL Cluster) -.PP -\fBndbd\fR -generates a set of log files which are placed in the directory specified by -DataDir -in the -config\&.ini -configuration file\&. -.PP -These log files are listed below\&. -\fInode_id\fR -is the node\*(Aqs unique identifier\&. Note that -\fInode_id\fR -represents the node\*(Aqs unique identifier\&. For example, -ndb_2_error\&.log -is the error log generated by the data node whose node ID is -2\&. -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" MySQL Cluster: error logs -.\" error logs (MySQL Cluster) -ndb_\fInode_id\fR_error\&.log -is a file containing records of all crashes which the referenced -\fBndbd\fR -process has encountered\&. Each record in this file contains a brief error string and a reference to a trace file for this crash\&. A typical entry in this file might appear as shown here: -.sp -.if n \{\ -.RS 4 -.\} -.nf -Date/Time: Saturday 30 July 2004 \- 00:20:01 -Type of error: error -Message: Internal program error (failed ndbrequire) -Fault ID: 2341 -Problem data: DbtupFixAlloc\&.cpp -Object of reference: DBTUP (Line: 173) -ProgramName: NDB Kernel -ProcessID: 14909 -TraceFile: ndb_2_trace\&.log\&.2 -***EOM*** -.fi -.if n \{\ -.RE -.\} -.sp -Listings of possible -\fBndbd\fR -exit codes and messages generated when a data node process shuts down prematurely can be found in -\m[blue]\fBndbd Error Messages\fR\m[]\&\s-2\u[1]\d\s+2\&. -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBImportant\fR -.ps -1 -.br -\fIThe last entry in the error log file is not necessarily the newest one\fR -(nor is it likely to be)\&. Entries in the error log are -\fInot\fR -listed in chronological order; rather, they correspond to the order of the trace files as determined in the -ndb_\fInode_id\fR_trace\&.log\&.next -file (see below)\&. Error log entries are thus overwritten in a cyclical and not sequential fashion\&. -.sp .5v -.RE -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" MySQL Cluster: trace files -.\" trace files (MySQL Cluster) -ndb_\fInode_id\fR_trace\&.log\&.\fItrace_id\fR -is a trace file describing exactly what happened just before the error occurred\&. This information is useful for analysis by the MySQL Cluster development team\&. -.sp -It is possible to configure the number of these trace files that will be created before old files are overwritten\&. -\fItrace_id\fR -is a number which is incremented for each successive trace file\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -ndb_\fInode_id\fR_trace\&.log\&.next -is the file that keeps track of the next trace file number to be assigned\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -ndb_\fInode_id\fR_out\&.log -is a file containing any data output by the -\fBndbd\fR -process\&. This file is created only if -\fBndbd\fR -is started as a daemon, which is the default behavior\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -ndb_\fInode_id\fR\&.pid -is a file containing the process ID of the -\fBndbd\fR -process when started as a daemon\&. It also functions as a lock file to avoid the starting of nodes with the same identifier\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -ndb_\fInode_id\fR_signal\&.log -is a file used only in debug versions of -\fBndbd\fR, where it is possible to trace all incoming, outgoing, and internal messages with their data in the -\fBndbd\fR -process\&. -.RE -.PP -It is recommended not to use a directory mounted through NFS because in some environments this can cause problems whereby the lock on the -\&.pid -file remains in effect even after the process has terminated\&. -.PP -To start -\fBndbd\fR, it may also be necessary to specify the host name of the management server and the port on which it is listening\&. Optionally, one may also specify the node ID that the process is to use\&. -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fBndbd \-\-connect\-string="nodeid=2;host=ndb_mgmd\&.mysql\&.com:1186"\fR -.fi -.if n \{\ -.RE -.\} -.PP -See -Section\ \&18.3.2.3, \(lqMySQL Cluster Connection Strings\(rq, for additional information about this issue\&. -Options Common to MySQL Cluster Programs(1), describes other command\-line options which can be used with -\fBndbd\fR\&. For information about data node configuration parameters, see -Section\ \&18.3.2.6, \(lqDefining MySQL Cluster Data Nodes\(rq\&. -.PP -When -\fBndbd\fR -starts, it actually initiates two processes\&. The first of these is called the -\(lqangel process\(rq; its only job is to discover when the execution process has been completed, and then to restart the -\fBndbd\fR -process if it is configured to do so\&. Thus, if you attempt to kill -\fBndbd\fR -using the Unix -\fBkill\fR -command, it is necessary to kill both processes, beginning with the angel process\&. The preferred method of terminating an -\fBndbd\fR -process is to use the management client and stop the process from there\&. -.PP -The execution process uses one thread for reading, writing, and scanning data, as well as all other activities\&. This thread is implemented asynchronously so that it can easily handle thousands of concurrent actions\&. In addition, a watch\-dog thread supervises the execution thread to make sure that it does not hang in an endless loop\&. A pool of threads handles file I/O, with each thread able to handle one open file\&. Threads can also be used for transporter connections by the transporters in the -\fBndbd\fR -process\&. In a multi\-processor system performing a large number of operations (including updates), the -\fBndbd\fR -process can consume up to 2 CPUs if permitted to do so\&. -.PP -For a machine with many CPUs it is possible to use several -\fBndbd\fR -processes which belong to different node groups; however, such a configuration is still considered experimental and is not supported for MySQL 5\&.6 in a production setting\&. See -Section\ \&18.1.6, \(lqKnown Limitations of MySQL Cluster\(rq\&. -.SH "COPYRIGHT" -.br -.PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. -.PP -This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. -.PP -This documentation 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. -.PP -You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. -.sp -.SH "NOTES" -.IP " 1." 4 -ndbd Error Messages -.RS 4 -\%http://dev.mysql.com/doc/ndbapi/en/ndbd-error-messages.html -.RE -.SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. -.SH AUTHOR -Oracle Corporation (http://dev.mysql.com/). diff --git a/mysql-wsrep-5.6/man/ndbd_redo_log_reader.1 b/mysql-wsrep-5.6/man/ndbd_redo_log_reader.1 deleted file mode 100644 index fec5339d..00000000 --- a/mysql-wsrep-5.6/man/ndbd_redo_log_reader.1 +++ /dev/null @@ -1,253 +0,0 @@ -'\" t -.\" Title: \fBndbd_redo_log_reader\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.6 -.\" Language: English -.\" -.TH "\FBNDBD_REDO_LOG_REA" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.\" ndbd_redo_log_reader -.SH "NAME" -ndbd_redo_log_reader \- check and print content of cluster redo log -.SH "SYNOPSIS" -.HP \w'\fBndbd_redo_log_reader\ \fR\fB\fIfile_name\fR\fR\fB\ [\fR\fB\fIoptions\fR\fR\fB]\fR\ 'u -\fBndbd_redo_log_reader \fR\fB\fIfile_name\fR\fR\fB [\fR\fB\fIoptions\fR\fR\fB]\fR -.SH "DESCRIPTION" -.PP -Reads a redo log file, checking it for errors, printing its contents in a human\-readable format, or both\&. -\fBndbd_redo_log_reader\fR -is intended for use primarily by MySQL Cluster developers and Support personnel in debugging and diagnosing problems\&. -.PP -This utility remains under development, and its syntax and behavior are subject to change in future MySQL Cluster releases\&. -.PP -The C++ source files for -\fBndbd_redo_log_reader\fR -can be found in the directory -/storage/ndb/src/kernel/blocks/dblqh/redoLogReader\&. -.PP -The following table includes options that are specific to the MySQL Cluster program -\fBndbd_redo_log_reader\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including -\fBndbd_redo_log_reader\fR), see -Options Common to MySQL Cluster Programs(1)\&. -.sp -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.B Table\ \&18.90.\ \& This table describes command-line options for the ndbd_redo_log_reader program -.TS -allbox tab(:); -lB lB lB. -T{ -Format -T}:T{ -Description -T}:T{ -Added or Removed -T} -.T& -l l l -l l l -l l l. -T{ -.PP --noprint -T}:T{ -Do not print records -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP --nocheck -T}:T{ -Do not check records for errors -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---help -T}:T{ -Print usage information -T}:T{ -.PP -ADDED: NDB 7.3.4 -T} -.TE -.sp 1 -Usage -.sp -.if n \{\ -.RS 4 -.\} -.nf -ndbd_redo_log_reader \fIfile_name\fR [\fIoptions\fR] -.fi -.if n \{\ -.RE -.\} -.PP -\fIfile_name\fR -is the name of a cluster redo log file\&. redo log files are located in the numbered directories under the data node\*(Aqs data directory (DataDir); the path under this directory to the redo log files matches the pattern -ndb_\fI#\fR_fs/D\fI#\fR/LCP/\fI#\fR/T\fI#\fRF\fI#\fR\&.Data\&. In each case, the -\fI#\fR -represents a number (not necessarily the same number)\&. For more information, see -\m[blue]\fBMySQL Cluster Data Node File System Directory Files\fR\m[]\&\s-2\u[1]\d\s+2\&. -.PP -The name of the file to be read may be followed by one or more of the options listed here: -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-noprint -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -FALSE -T} -.TE -.sp 1 -\fB\-noprint\fR: Do not print the contents of the log file\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.TS -allbox tab(:); -l l s s -l l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-nocheck -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -boolean -T} -:T{ -\fBDefault\fR -T}:T{ -FALSE -T} -.TE -.sp 1 -\fB\-nocheck\fR: Do not check the log file for errors\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.TS -allbox tab(:); -l l s s -l l s s. -T{ -\fBIntroduced\fR -T}:T{ -5\&.6\&.15\-ndb\-7\&.3\&.4 -T} -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-help -T} -.TE -.sp 1 -\fB\-\-help\fR: Print usage information\&. -.sp -Added in MySQL Cluster NDB 7\&.3\&.4\&. (Bug #11749591, Bug #36805) -.RE -.PP -Like -\fBndb_print_backup_file\fR -and -\fBndb_print_schema_file\fR -(and unlike most of the -NDB -utilities that are intended to be run on a management server host or to connect to a management server) -\fBndbd_redo_log_reader\fR -must be run on a cluster data node, since it accesses the data node file system directly\&. Because it does not make use of the management server, this utility can be used when the management server is not running, and even when the cluster has been completely shut down\&. -.SH "COPYRIGHT" -.br -.PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. -.PP -This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. -.PP -This documentation 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. -.PP -You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. -.sp -.SH "NOTES" -.IP " 1." 4 -MySQL Cluster Data Node File System Directory Files -.RS 4 -\%http://dev.mysql.com/doc/ndbapi/en/ndb-internals-ndbd-filesystemdir-files.html -.RE -.SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. -.SH AUTHOR -Oracle Corporation (http://dev.mysql.com/). diff --git a/mysql-wsrep-5.6/man/ndbinfo_select_all.1 b/mysql-wsrep-5.6/man/ndbinfo_select_all.1 deleted file mode 100644 index 0736aa7d..00000000 --- a/mysql-wsrep-5.6/man/ndbinfo_select_all.1 +++ /dev/null @@ -1,303 +0,0 @@ -'\" t -.\" Title: \fBndbinfo_select_all\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.6 -.\" Language: English -.\" -.TH "\FBNDBINFO_SELECT_AL" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.\" ndbinfo_select_all -.\" MySQL Cluster: ndbinfo_select_all -.SH "NAME" -ndbinfo_select_all \- select from ndbinfo tables -.SH "SYNOPSIS" -.HP \w'\fBndbinfo_select_all\ \fR\fB\fIoptions\fR\fR\ 'u -\fBndbinfo_select_all \fR\fB\fIoptions\fR\fR -.SH "DESCRIPTION" -.PP -\fBndbinfo_select_all\fR -is a client program that selects all rows and columns from one or more tables in the -ndbinfo -database\&. It is included with the MySQL Cluster distribution beginning with MySQL Cluster NDB 7\&.2\&.2\&. -.PP -Not all -ndbinfo -tables can be accessed by this program\&. -ndbinfo_select_all -can access the -counters, -diskpagebuffer, -logbuffers, -logspaces, -nodes, -resources, -threadblocks, -threadstat, and -transporters -tables\&. -.PP -To select from one or more -ndbinfo -tables using -\fBndbinfo_select_all\fR, it is necessary to supply the names of the tables when invoking the program as shown here: -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fBndbinfo_select_all \fR\fB\fItable_name1\fR\fR\fB [\fR\fB\fItable_name2\fR\fR\fB] [\&.\&.\&.]\fR -.fi -.if n \{\ -.RE -.\} -.PP -For example: -.sp -.if n \{\ -.RS 4 -.\} -.nf -shell> \fBndbinfo_select_all logbuffers logspaces\fR -== logbuffers == -node_id log_type log_id log_part total used high -5 0 0 0 33554432 262144 0 -6 0 0 0 33554432 262144 0 -7 0 0 0 33554432 262144 0 -8 0 0 0 33554432 262144 0 -== logspaces == -node_id log_type log_id log_part total used high -5 0 0 0 268435456 0 0 -5 0 0 1 268435456 0 0 -5 0 0 2 268435456 0 0 -5 0 0 3 268435456 0 0 -6 0 0 0 268435456 0 0 -6 0 0 1 268435456 0 0 -6 0 0 2 268435456 0 0 -6 0 0 3 268435456 0 0 -7 0 0 0 268435456 0 0 -7 0 0 1 268435456 0 0 -7 0 0 2 268435456 0 0 -7 0 0 3 268435456 0 0 -8 0 0 0 268435456 0 0 -8 0 0 1 268435456 0 0 -8 0 0 2 268435456 0 0 -8 0 0 3 268435456 0 0 -shell> -.fi -.if n \{\ -.RE -.\} -.sp -.\" command options (MySQL Cluster): ndbinfo_select_all -.PP -The following table includes options that are specific to -\fBndbinfo_select_all\fR\&. Additional descriptions follow the table\&. For options common to most MySQL Cluster programs (including -\fBndbinfo_select_all\fR), see -Options Common to MySQL Cluster Programs(1)\&. -.sp -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.B Table\ \&18.79.\ \& This table describes command-line options for the ndbinfo_select_all program -.TS -allbox tab(:); -lB lB lB. -T{ -Format -T}:T{ -Description -T}:T{ -Added or Removed -T} -.T& -l l l -l l l -l l l -l l l. -T{ -.PP ---delay=# -T}:T{ -Set the delay in seconds between loops. Default is 5. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---loops=#, -.PP --l -T}:T{ -Set the number of times to perform the select. Default is 1. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---database=db_name, -.PP --d -T}:T{ -Name of the database where the table located. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -T{ -.PP ---parallelism=#, -.PP --p -T}:T{ -Set the degree of parallelism. -T}:T{ -.PP -All MySQL 5.6 based releases -T} -.TE -.sp 1 -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" delay option (ndbinfo_select_all) -\fB\-\-delay=\fR\fBseconds\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s -^ l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-delay=# -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -numeric -T} -:T{ -\fBDefault\fR -T}:T{ -5 -T} -:T{ -\fBMin Value\fR -T}:T{ -0 -T} -:T{ -\fBMax Value\fR -T}:T{ -MAX_INT -T} -.TE -.sp 1 -This option sets the number of seconds to wait between executing loops\&. Has no effect if -\fB\-\-loops\fR -is set to 0 or 1\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04'\(bu\h'+03'\c -.\} -.el \{\ -.sp -1 -.IP \(bu 2.3 -.\} -.\" loops option (ndbinfo_select_all) -.\" -l option (ndbinfo_select_all) -\fB\-\-loops=\fR\fBnumber\fR, -\fB\-l \fR\fB\fInumber\fR\fR -.TS -allbox tab(:); -l l s s -l l l s -^ l l s -^ l l s -^ l l s. -T{ -\fBCommand\-Line Format\fR -T}:T{ -\-\-loops=# -T} -T{ -\fBPermitted Values\fR -T}:T{ -\fBType\fR -T}:T{ -numeric -T} -:T{ -\fBDefault\fR -T}:T{ -1 -T} -:T{ -\fBMin Value\fR -T}:T{ -0 -T} -:T{ -\fBMax Value\fR -T}:T{ -MAX_INT -T} -.TE -.sp 1 -This option sets the number of times to execute the select\&. Use -\fB\-\-delay\fR -to set the time between loops\&. -.RE -.SH "COPYRIGHT" -.br -.PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. -.PP -This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. -.PP -This documentation 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. -.PP -You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. -.sp -.SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. -.SH AUTHOR -Oracle Corporation (http://dev.mysql.com/). diff --git a/mysql-wsrep-5.6/man/ndbmtd.8 b/mysql-wsrep-5.6/man/ndbmtd.8 deleted file mode 100644 index b884308a..00000000 --- a/mysql-wsrep-5.6/man/ndbmtd.8 +++ /dev/null @@ -1,225 +0,0 @@ -'\" t -.\" Title: \fBndbmtd\fR -.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] -.\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 -.\" Manual: MySQL Database System -.\" Source: MySQL 5.6 -.\" Language: English -.\" -.TH "\FBNDBMTD\FR" "8" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" -.\" ----------------------------------------------------------------- -.\" * Define some portability stuff -.\" ----------------------------------------------------------------- -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.\" http://bugs.debian.org/507673 -.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html -.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" ----------------------------------------------------------------- -.\" * set default formatting -.\" ----------------------------------------------------------------- -.\" disable hyphenation -.nh -.\" disable justification (adjust text to left margin only) -.ad l -.\" ----------------------------------------------------------------- -.\" * MAIN CONTENT STARTS HERE * -.\" ----------------------------------------------------------------- -.\" ndbmtd -.\" MySQL Cluster: ndbmtd -.\" MySQL Cluster: data nodes -.\" data nodes (MySQL Cluster) -.\" storage nodes - see data nodes, ndbd, ndbmtd -.SH "NAME" -ndbmtd \- the MySQL Cluster data node daemon (multi\-threaded version) -.SH "SYNOPSIS" -.HP \w'\fBndbmtd\ \fR\fB\fIoptions\fR\fR\ 'u -\fBndbmtd \fR\fB\fIoptions\fR\fR -.SH "DESCRIPTION" -.PP -\fBndbmtd\fR -is a multi\-threaded version of -\fBndbd\fR, the process that is used to handle all the data in tables using the -NDBCLUSTER -storage engine\&. -\fBndbmtd\fR -is intended for use on host computers having multiple CPU cores\&. Except where otherwise noted, -\fBndbmtd\fR -functions in the same way as -\fBndbd\fR; therefore, in this section, we concentrate on the ways in which -\fBndbmtd\fR -differs from -\fBndbd\fR, and you should consult -\fBndbd\fR(8), for additional information about running MySQL Cluster data nodes that apply to both the single\-threaded and multi\-threaded versions of the data node process\&. -.PP -Command\-line options and configuration parameters used with -\fBndbd\fR -also apply to -\fBndbmtd\fR\&. For more information about these options and parameters, see -\fBndbd\fR(8), and -Section\ \&18.3.2.6, \(lqDefining MySQL Cluster Data Nodes\(rq, respectively\&. -.PP -\fBndbmtd\fR -is also file system\-compatible with -\fBndbd\fR\&. In other words, a data node running -\fBndbd\fR -can be stopped, the binary replaced with -\fBndbmtd\fR, and then restarted without any loss of data\&. (However, when doing this, you must make sure that -MaxNoOfExecutionThreads -is set to an apppriate value before restarting the node if you wish for -\fBndbmtd\fR -to run in multi\-threaded fashion\&.) Similarly, an -\fBndbmtd\fR -binary can be replaced with -\fBndbd\fR -simply by stopping the node and then starting -\fBndbd\fR -in place of the multi\-threaded binary\&. It is not necessary when switching between the two to start the data node binary using -\fB\-\-initial\fR\&. -.PP -Using -\fBndbmtd\fR -differs from using -\fBndbd\fR -in two key respects: -.sp -.RS 4 -.ie n \{\ -\h'-04' 1.\h'+01'\c -.\} -.el \{\ -.sp -1 -.IP " 1." 4.2 -.\} -Because -\fBndbmtd\fR -runs by default in single\-threaded mode (that is, it behaves like -\fBndbd\fR), you must configure it to use multiple threads\&. This can be done by setting an appropriate value in the -config\&.ini -file for the -MaxNoOfExecutionThreads -configuration parameter or the -ThreadConfig -configuration parameter\&. Using -MaxNoOfExecutionThreads -is simpler, but -ThreadConfig -offers more flexibility\&. For more information about these configuration parameters and their use, see -Multi-Threading Configuration Parameters (ndbmtd)\&. -.RE -.sp -.RS 4 -.ie n \{\ -\h'-04' 2.\h'+01'\c -.\} -.el \{\ -.sp -1 -.IP " 2." 4.2 -.\} -Trace files are generated by critical errors in -\fBndbmtd\fR -processes in a somewhat different fashion from how these are generated by -\fBndbd\fR -failures\&. These differences are discussed in more detail in the next few paragraphs\&. -.RE -.\" ndbmtd: trace files -.\" trace files: ndbmtd -.\" MySQL Cluster: log files -.\" log files (MySQL Cluster): ndbmtd -.\" ndbmtd: trace files -.PP -Like -\fBndbd\fR, -\fBndbmtd\fR -generates a set of log files which are placed in the directory specified by -DataDir -in the -config\&.ini -configuration file\&. Except for trace files, these are generated in the same way and have the same names as those generated by -\fBndbd\fR\&. -.PP -In the event of a critical error, -\fBndbmtd\fR -generates trace files describing what happened just prior to the error\*(Aq occurrence\&. These files, which can be found in the data node\*(Aqs -DataDir, are useful for analysis of problems by the MySQL Cluster Development and Support teams\&. One trace file is generated for each -\fBndbmtd\fR -thread\&. The names of these files have the following pattern: -.sp -.if n \{\ -.RS 4 -.\} -.nf -ndb_\fInode_id\fR_trace\&.log\&.\fItrace_id\fR_t\fIthread_id\fR, -.fi -.if n \{\ -.RE -.\} -.PP -In this pattern, -\fInode_id\fR -stands for the data node\*(Aqs unique node ID in the cluster, -\fItrace_id\fR -is a trace sequence number, and -\fIthread_id\fR -is the thread ID\&. For example, in the event of the failure of an -\fBndbmtd\fR -process running as a MySQL Cluster data node having the node ID 3 and with -MaxNoOfExecutionThreads -equal to 4, four trace files are generated in the data node\*(Aqs data directory\&. If the is the first time this node has failed, then these files are named -ndb_3_trace\&.log\&.1_t1, -ndb_3_trace\&.log\&.1_t2, -ndb_3_trace\&.log\&.1_t3, and -ndb_3_trace\&.log\&.1_t4\&. Internally, these trace files follow the same format as -\fBndbd\fR -trace files\&. -.PP -The -\fBndbd\fR -exit codes and messages that are generated when a data node process shuts down prematurely are also used by -\fBndbmtd\fR\&. See -\m[blue]\fBndbd Error Messages\fR\m[]\&\s-2\u[1]\d\s+2, for a listing of these\&. -.if n \{\ -.sp -.\} -.RS 4 -.it 1 an-trap -.nr an-no-space-flag 1 -.nr an-break-flag 1 -.br -.ps +1 -\fBNote\fR -.ps -1 -.br -.PP -It is possible to use -\fBndbd\fR -and -\fBndbmtd\fR -concurrently on different data nodes in the same MySQL Cluster\&. However, such configurations have not been tested extensively; thus, we cannot recommend doing so in a production setting at this time\&. -.sp .5v -.RE -.SH "COPYRIGHT" -.br -.PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. -.PP -This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. -.PP -This documentation 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. -.PP -You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. -.sp -.SH "NOTES" -.IP " 1." 4 -ndbd Error Messages -.RS 4 -\%http://dev.mysql.com/doc/ndbapi/en/ndbd-error-messages.html -.RE -.SH "SEE ALSO" -For more information, please refer to the MySQL Reference Manual, -which may already be installed locally and which is also available -online at http://dev.mysql.com/doc/. -.SH AUTHOR -Oracle Corporation (http://dev.mysql.com/). diff --git a/mysql-wsrep-5.6/man/perror.1 b/mysql-wsrep-5.6/man/perror.1 index c6551e03..f9f15180 100644 --- a/mysql-wsrep-5.6/man/perror.1 +++ b/mysql-wsrep-5.6/man/perror.1 @@ -2,12 +2,12 @@ .\" Title: \fBperror\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBPERROR\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBPERROR\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -102,7 +102,7 @@ shell> \fBperror \-\-ndb \fR\fB\fIerrorcode\fR\fR .RE .\} .PP -Note that the meaning of system error messages may be dependent on your operating system\&. A given error code may mean different things on different operating systems\&. +The meaning of system error messages may be dependent on your operating system\&. A given error code may mean different things on different operating systems\&. .PP \fBperror\fR supports the following options\&. @@ -190,7 +190,7 @@ Display version information and exit\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/replace.1 b/mysql-wsrep-5.6/man/replace.1 index cbb77293..e4c2ef8f 100644 --- a/mysql-wsrep-5.6/man/replace.1 +++ b/mysql-wsrep-5.6/man/replace.1 @@ -2,12 +2,12 @@ .\" Title: \fBreplace\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBREPLACE\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBREPLACE\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -169,7 +169,7 @@ Display version information and exit\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/resolve_stack_dump.1 b/mysql-wsrep-5.6/man/resolve_stack_dump.1 index b0c0ad9e..e3d1ab18 100644 --- a/mysql-wsrep-5.6/man/resolve_stack_dump.1 +++ b/mysql-wsrep-5.6/man/resolve_stack_dump.1 @@ -2,12 +2,12 @@ .\" Title: \fBresolve_stack_dump\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBRESOLVE_STACK_DUM" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBRESOLVE_STACK_DUM" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -125,11 +125,11 @@ Display version information and exit\&. .RE .PP For more information, see -Section\ \&24.4.1.5, \(lqUsing a Stack Trace\(rq\&. +Section\ \&24.5.1.5, \(lqUsing a Stack Trace\(rq\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/man/resolveip.1 b/mysql-wsrep-5.6/man/resolveip.1 index 4efad013..97b76581 100644 --- a/mysql-wsrep-5.6/man/resolveip.1 +++ b/mysql-wsrep-5.6/man/resolveip.1 @@ -2,12 +2,12 @@ .\" Title: \fBresolveip\fR .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 01/16/2015 +.\" Date: 03/02/2016 .\" Manual: MySQL Database System .\" Source: MySQL 5.6 .\" Language: English .\" -.TH "\FBRESOLVEIP\FR" "1" "01/16/2015" "MySQL 5\&.6" "MySQL Database System" +.TH "\FBRESOLVEIP\FR" "1" "03/02/2016" "MySQL 5\&.6" "MySQL Database System" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -108,7 +108,7 @@ Display version information and exit\&. .SH "COPYRIGHT" .br .PP -Copyright \(co 1997, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright \(co 1997, 2016, Oracle and/or its affiliates. All rights reserved. .PP This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. .PP diff --git a/mysql-wsrep-5.6/mysql-test/CMakeLists.txt b/mysql-wsrep-5.6/mysql-test/CMakeLists.txt index 56c43225..9e677b80 100644 --- a/mysql-wsrep-5.6/mysql-test/CMakeLists.txt +++ b/mysql-wsrep-5.6/mysql-test/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2015, 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 @@ -80,7 +80,7 @@ IF(CMAKE_BUILD_TYPE) ENDIF() ENDIF() -# On windows do: 'devenv mysql.sln /build Debug /project test-mtr' +# On windows do: 'cmake --build . --config debug --target test-mtr' # On unix do: 'make test-mtr' ADD_CUSTOM_TARGET(test-mtr COMMAND perl ./mysql-test-run.pl --force --parallel=4 --suite=main diff --git a/mysql-wsrep-5.6/mysql-test/collections/README b/mysql-wsrep-5.6/mysql-test/collections/README index cdbccc39..45a2f49c 100644 --- a/mysql-wsrep-5.6/mysql-test/collections/README +++ b/mysql-wsrep-5.6/mysql-test/collections/README @@ -1,11 +1,11 @@ This directory contains collections of test runs that we run during our integration and release testing. These files are not directly useful outside this context, but need to be part of the source repository -and are included for reference.Each file contains zero or more lines, +and are included for reference. Each file contains zero or more lines, with one invocation of mysql-test-run.pl on each. These invocations are written so that, with the assumption that perl is in your search path, -any collection can run as a shell script or a batch file, with the parent -mysql-test directory being the current working directory. +any collection can in principle run as a shell script or a batch file, +with the parent mysql-test directory being the current working directory. During integration testing, we choose the collection to run by following these steps: @@ -19,6 +19,9 @@ these steps: testing plus the extension as determined in step 1, we choose that collection. +2b) If we are running a valgrind test and there is a collection with + the chosen name and the suffix "-valgrind" we choose that instead. + 3) If the branch is unknown or we have removed all characters from it and still not found a matching collection, we choose the name "default" plus the extension determined in step 1. If there is no such file, @@ -38,3 +41,29 @@ CMake will create a new file without the .in suffix where the include lines are replaced with the contents of the referred file. Filename is local to the collections directory, and includes do not nest. + +Notes on some of the mysql-test-run.pl arguments and how they work in +our continous intergation test framework. These are mostly for those +writing or editing such files as they are specific to that setup. + +1) The --comment argument produces a header which is parsed by the log + analyzer to produce an entry for the result summary, seen as the + name of the test batch. The names should be unique. Also, avoid too + long names as it may clutter the presentation. + +2) Do not use --mem, use --vardir instead. Before the test is run, a + host specific ramdisk path is prepended to the vardir argument to + ensure that tests always run on ramdisk. This also works on Windows + or Mac OSX where --mem is not supported. + +3) The name of the --vardir directory must start with 'var' in order for + the test results to be correctly included in the result + tarballs. They should also be unique across the collection file to + avoid clashes. If --vardir is not specified, the --comment name will + be used with a prefix "var-". + +4) Any --parallel setting will be overridden by a host specific + setting (which may be modified by branch; e.g. some hosts may need a + lower setting for cluster). Most hosts use 8. It does not hurt to + add --parallel=auto but this will only have effect should we have + forgotten to set a parallel setting for a host. diff --git a/mysql-wsrep-5.6/mysql-test/collections/default.daily b/mysql-wsrep-5.6/mysql-test/collections/default.daily index 67c4c293..a04eff96 100644 --- a/mysql-wsrep-5.6/mysql-test/collections/default.daily +++ b/mysql-wsrep-5.6/mysql-test/collections/default.daily @@ -1,6 +1,6 @@ # Default suites in modes normal(which includes binlog format stmt/mixed/row, parts), embedded and ps-protocol # Adding "--big-test" option to the default suite, normal(which includes binlog format stmt/mixed/row, parts), embedded and ps-protocol -perl mysql-test-run.pl --force --timer --big-test --testcase-timeout=90 --debug-server --parallel=auto --experimental=collections/default.experimental --comment=normal-debug-big --vardir=var-normal-debug-big --report-features --skip-test-list=collections/disabled-daily.list --unit-tests +perl mysql-test-run.pl --force --timer --big-test --testcase-timeout=90 --debug-server --parallel=auto --experimental=collections/default.experimental --comment=normal-debug-big --vardir=var-normal-debug-big --report-features --skip-test-list=collections/disabled-daily.list --unit-tests-report # --debug-server is not used for embedded runs since debug build of embedded server is not available perl mysql-test-run.pl --force --timer --big-test --testcase-timeout=60 --parallel=auto --experimental=collections/default.experimental --comment=embedded-big --vardir=var-embedded-big --embedded-server perl mysql-test-run.pl --force --timer --big-test --testcase-timeout=60 --debug-server --parallel=auto --experimental=collections/default.experimental --comment=ps-debug-big --vardir=var-ps-debug-big --ps-protocol --skip-test-list=collections/disabled-daily.list diff --git a/mysql-wsrep-5.6/mysql-test/collections/default.experimental b/mysql-wsrep-5.6/mysql-test/collections/default.experimental index 25194282..1cfa4c5d 100644 --- a/mysql-wsrep-5.6/mysql-test/collections/default.experimental +++ b/mysql-wsrep-5.6/mysql-test/collections/default.experimental @@ -21,9 +21,3 @@ rpl.rpl_gtid_logs_without_rotate_or_stop_event @windows # Bug#16207800 2013-0 perfschema.socket_summary_by_instance_func # bug#16274580 innodb.innodb_bug14676111 # bug#17026780 2013-07-08 anitha Originally made experimental due to bug#16371942 which is now fixed. Now fails with mismatch in CLUST_INDEX_SIZE -# This file is for marking internal tests as experimental. -# Use the same way as the "normal" default.experimental -# The contents of this file will be appended to it in PB2 but not for -# normal developer builds. -# Internal tests should *not* be listed in the public default.experimental! - diff --git a/mysql-wsrep-5.6/mysql-test/collections/default.push b/mysql-wsrep-5.6/mysql-test/collections/default.push index 872b97fc..31ee3ba6 100644 --- a/mysql-wsrep-5.6/mysql-test/collections/default.push +++ b/mysql-wsrep-5.6/mysql-test/collections/default.push @@ -1,4 +1,4 @@ -perl mysql-test-run.pl --timer --debug-server --force --parallel=auto --comment=n_mix-debug --vardir=var-n_mix --mysqld=--binlog-format=mixed --experimental=collections/default.experimental --skip-test-list=collections/disabled-per-push.list --unit-tests +perl mysql-test-run.pl --timer --debug-server --force --parallel=auto --comment=n_mix-debug --vardir=var-n_mix --mysqld=--binlog-format=mixed --experimental=collections/default.experimental --skip-test-list=collections/disabled-per-push.list --unit-tests-report perl mysql-test-run.pl --timer --debug-server --force --parallel=auto --comment=rpl_binlog_ps_row-debug --vardir=var-rpl_binlog-ps_row --suite=rpl,binlog --ps-protocol --mysqld=--binlog-format=row --experimental=collections/default.experimental --skip-test-list=collections/disabled-per-push.list perl mysql-test-run.pl --timer --force --parallel=auto --comment=main_embedded-debug --vardir=var-main_embedded --suite=main --embedded --experimental=collections/default.experimental --skip-test-list=collections/disabled-per-push.list perl mysql-test-run.pl --timer --debug-server --force --parallel=auto --comment=innodb_4k_size-debug --vardir=var-innodb-4k --experimental=collections/default.experimental --suite=innodb --mysqld=--innodb-page-size=4k --skip-test-list=collections/disabled-per-push.list diff --git a/mysql-wsrep-5.6/mysql-test/collections/default.release b/mysql-wsrep-5.6/mysql-test/collections/default.release deleted file mode 100644 index 9ac7af55..00000000 --- a/mysql-wsrep-5.6/mysql-test/collections/default.release +++ /dev/null @@ -1,16 +0,0 @@ -# This file contains the old default.release, the plan is to replace that -# with something like the below (remove space after #): -# include default.daily -# include default.weekly -perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=debug --vardir=var-debug --skip-rpl --report-features --debug-server -perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=normal --vardir=var-normal --report-features --unit-tests -perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=ps --vardir=var-ps --ps-protocol -perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=funcs1+ps --vardir=var-funcs_1_ps --suite=funcs_1 --ps-protocol -perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=funcs2 --vardir=var-funcs2 --suite=funcs_2 -perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=partitions --vardir=var-parts --suite=parts -perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=stress --vardir=var-stress --suite=stress -perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=jp --vardir=var-jp --suite=jp -perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=embedded --vardir=var-embedded --embedded-server --skip-rpl -perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=nist --vardir=var-nist --suite=nist -perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=nist+ps --vardir=var-nist_ps --suite=nist --ps-protocol -perl mysql-test-run.pl --timer --force --comment=memcached --vardir=var-memcached --experimental=collections/default.experimental --parallel=auto --retry=0 --suite=memcached diff --git a/mysql-wsrep-5.6/mysql-test/collections/default.release.done b/mysql-wsrep-5.6/mysql-test/collections/default.release.done deleted file mode 100644 index 3d1016bb..00000000 --- a/mysql-wsrep-5.6/mysql-test/collections/default.release.done +++ /dev/null @@ -1 +0,0 @@ -/export/home/pb2/build/sb_0-14135359-1421674846.01/mysql-5.6.23-release-export-7480611_gpl/mysql-test/collections/default.release.in diff --git a/mysql-wsrep-5.6/mysql-test/collections/default.release.in b/mysql-wsrep-5.6/mysql-test/collections/default.release.in index b4d36e53..c8904d86 100644 --- a/mysql-wsrep-5.6/mysql-test/collections/default.release.in +++ b/mysql-wsrep-5.6/mysql-test/collections/default.release.in @@ -5,9 +5,8 @@ # include default.weekly perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=debug --vardir=var-debug --skip-rpl --report-features --debug-server -perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=normal --vardir=var-normal --report-features --unit-tests +perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=normal --vardir=var-normal --report-features --unit-tests-report perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=ps --vardir=var-ps --ps-protocol -perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=funcs1+ps --vardir=var-funcs_1_ps --suite=funcs_1 --ps-protocol perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=funcs2 --vardir=var-funcs2 --suite=funcs_2 perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=partitions --vardir=var-parts --suite=parts perl mysql-test-run.pl --force --timer --parallel=auto --experimental=collections/default.experimental --comment=stress --vardir=var-stress --suite=stress diff --git a/mysql-wsrep-5.6/mysql-test/collections/default.weekly b/mysql-wsrep-5.6/mysql-test/collections/default.weekly index 2ea6dc0c..cde8e75d 100644 --- a/mysql-wsrep-5.6/mysql-test/collections/default.weekly +++ b/mysql-wsrep-5.6/mysql-test/collections/default.weekly @@ -12,7 +12,7 @@ # big-test option for normal runs # # Default suites (in modes binlog format stmt/mixed/row) -perl mysql-test-run.pl --force --timer --big-test --testcase-timeout=90 --debug-server --parallel=auto --experimental=collections/default.experimental --comment=normal-debug-big --vardir=var-normal-debug-big --report-features --skip-test-list=collections/disabled-weekly.list --mysqld=--innodb_autoextend_increment=64 --unit-tests +perl mysql-test-run.pl --force --timer --big-test --testcase-timeout=90 --debug-server --parallel=auto --experimental=collections/default.experimental --comment=normal-debug-big --vardir=var-normal-debug-big --report-features --skip-test-list=collections/disabled-weekly.list --mysqld=--innodb_autoextend_increment=64 --unit-tests-report # embedded # --debug-server is not used for embedded runs since debug build of embedded server is not available perl mysql-test-run.pl --force --timer --big-test --testcase-timeout=60 --parallel=auto --experimental=collections/default.experimental --comment=embedded-big --vardir=var-embedded-big --embedded-server diff --git a/mysql-wsrep-5.6/mysql-test/collections/default.weekly.basic b/mysql-wsrep-5.6/mysql-test/collections/default.weekly.basic index 5491110a..954f8b89 100644 --- a/mysql-wsrep-5.6/mysql-test/collections/default.weekly.basic +++ b/mysql-wsrep-5.6/mysql-test/collections/default.weekly.basic @@ -13,7 +13,7 @@ # Repeat daily run # big-test option for normal runs # Default suites (in modes binlog format stmt/mixed/row, parts), embedded and ps-protocol -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=normal-debug --vardir=var-normal-debug --report-features --skip-test-list=collections/disabled-daily.list --mysqld=--innodb_autoextend_increment=64 --unit-tests +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=normal-debug --vardir=var-normal-debug --report-features --skip-test-list=collections/disabled-daily.list --mysqld=--innodb_autoextend_increment=64 --unit-tests-report # Run all default suites with embedded server # --debug-server is not used for embedded runs since debug build of embedded server is not available diff --git a/mysql-wsrep-5.6/mysql-test/extra/binlog_tests/binlog.test b/mysql-wsrep-5.6/mysql-test/extra/binlog_tests/binlog.test index 8a36566f..c332c015 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/binlog_tests/binlog.test +++ b/mysql-wsrep-5.6/mysql-test/extra/binlog_tests/binlog.test @@ -337,7 +337,8 @@ dfLtTBcBAAAAIgAAAPkAAAAAABcAAAAAAAcAAf/+AQAAAA== SELECT * FROM t1; --echo # Their values should be ON -SHOW SESSION VARIABLES LIKE "%_checks"; +SHOW SESSION VARIABLES LIKE "foreign_key_checks"; +SHOW SESSION VARIABLES LIKE "unique_checks"; --echo SET @@SESSION.foreign_key_checks= OFF; @@ -352,7 +353,8 @@ dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA== SELECT * FROM t1; --echo # Their values should be OFF -SHOW SESSION VARIABLES LIKE "%_checks"; +SHOW SESSION VARIABLES LIKE "foreign_key_checks"; +SHOW SESSION VARIABLES LIKE "unique_checks"; --echo # INSERT INTO t1 VALUES(2) --echo # foreign_key_checks=1 and unique_checks=1 @@ -366,7 +368,8 @@ dfLtTBcBAAAAIgAAAM0BAAAAABcAAAAAAAEAAf/+AgAAAA== SELECT * FROM t1; --echo # Their values should be OFF -SHOW SESSION VARIABLES LIKE "%_checks"; +SHOW SESSION VARIABLES LIKE "foreign_key_checks"; +SHOW SESSION VARIABLES LIKE "unique_checks"; DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/extra/binlog_tests/binlog_mysqlbinlog_row.inc b/mysql-wsrep-5.6/mysql-test/extra/binlog_tests/binlog_mysqlbinlog_row.inc index a9d0232a..8a76032e 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/binlog_tests/binlog_mysqlbinlog_row.inc +++ b/mysql-wsrep-5.6/mysql-test/extra/binlog_tests/binlog_mysqlbinlog_row.inc @@ -476,6 +476,38 @@ INSERT INTO t2 SET b=1; UPDATE t1, t2 SET t1.a=10, t2.a=20; DROP TABLE t1,t2; + +# +# Bug#20836250 MYSQLBINLOG --VERBOSE FOR BINARY DATATYPE NOT SKIPPING ' +# (QUOTE) & \(BACKSLASH) +# +# Binary and Varbinary types in mysqlbinlog --verbose are displayed +# as string types. Single quote(0x27) and back slash (0x5c) +# should not be converted to it's string equalents (' and \ ) as +# it confuses users with bad binary data output. +# +CREATE TABLE t1(a BINARY(16), b VARBINARY(32)); +INSERT INTO t1 VALUES (0x275c275c3132,0x5c78276566); +UPDATE t1 SET a= 0x5c27; +DELETE FROM t1 where b=0x5c78276566; +DROP TABLE t1; + +# Since binlog content does not differntiate between binary and +# non-binary data types, even the data in string data types also +# will be affected by this patch. Now 'a''b' will now be seen +# in mysqlbinlog -v -v as 'a\x27b' instead 'a'b' and 'a\x5cb' +# instead of 'a\b'. + +CREATE TABLE t1(i INT, a CHAR(16), b VARCHAR(32)); +INSERT INTO t1 VALUES(1, 'a''b', 'a''b'); +INSERT INTO t1 VALUES(2, 'a\\b', 'a\\b'); +UPDATE t1 SET a='a\\b', b='a\\b' WHERE i=1; +UPDATE t1 SET a='a''b', b='a''b' WHERE i=2; +DELETE FROM t1 WHERE a='a''b' AND b='a''b'; +DELETE FROM t1 WHERE a='a\\b' AND b='a\\b'; +DROP TABLE t1; +# End of Testing for Bug#20836250 + flush logs; let $MYSQLD_DATADIR= `select @@datadir`; diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_binlog_error.inc b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_binlog_error.inc index 2ee30462..b59d7dfe 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_binlog_error.inc +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_binlog_error.inc @@ -84,12 +84,15 @@ eval SET GLOBAL debug=IF(LENGTH('$old_debug') > 0, CONCAT('$old_debug', ":d,erro -- error ER_NO_UNIQUE_LOGFILE FLUSH LOGS; -- echo # assert: must show one binlog --- source include/show_binary_logs.inc +--list_files $MYSQLD_DATADIR *master-bin.0* ### ACTION: clean up and move to next test --disable_query_log eval SET GLOBAL debug='$old_debug'; --enable_query_log +# Restart the server to enable binary log. +--let $rpl_server_number= 1 +--source include/rpl_restart_server.inc RESET MASTER; -- echo ###################### TEST #3 @@ -145,6 +148,9 @@ SELECT count(*) FROM t2; eval SET GLOBAL debug='$old_debug'; --enable_query_log DELETE FROM t2; +# Restart the server to enable binary log. +--let $rpl_server_number= 1 +--source include/rpl_restart_server.inc RESET MASTER; -- echo ###################### TEST #5 @@ -199,6 +205,9 @@ SET AUTOCOMMIT= 1; eval SET GLOBAL debug='$old_debug'; --enable_query_log DELETE FROM t2; +# Restart the server to enable binary log. +--let $rpl_server_number= 1 +--source include/rpl_restart_server.inc RESET MASTER; -- echo ###################### TEST #7 @@ -218,15 +227,15 @@ SELECT count(*) FROM t4; -- echo # assert: must show 1 entry SELECT count(*) FROM t4; --- echo ### check that the incident event is written to the current log --disable_query_log eval SET GLOBAL debug='$old_debug'; --enable_query_log --- let $binlog_limit= 1 --- source include/show_binlog_events.inc # clean up and move to next test DELETE FROM t4; +# Restart the server to enable binary log. +--let $rpl_server_number= 1 +--source include/rpl_restart_server.inc RESET MASTER; -- echo ###################### TEST #8 @@ -252,9 +261,26 @@ SELECT count(*) FROM t2; -- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR -- error ER_NO_UNIQUE_LOGFILE -- eval LOAD DATA INFILE '$load_file' INTO TABLE t4 + +# Restart the server to enable binary log. +--let $rpl_server_number= 1 +--source include/rpl_restart_server.inc + +--disable_query_log +eval SET GLOBAL debug=IF(LENGTH('$old_debug') > 0, CONCAT('$old_debug', ":d,error_unique_log_filename"), 'd,error_unique_log_filename'); +--enable_query_log + -- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR -- error ER_NO_UNIQUE_LOGFILE -- eval LOAD DATA INFILE '$load_file' INTO TABLE t2 + +# Restart the server to enable binary log. +--let $rpl_server_number= 1 +--source include/rpl_restart_server.inc + +--disable_query_log +eval SET GLOBAL debug=IF(LENGTH('$old_debug') > 0, CONCAT('$old_debug', ":d,error_unique_log_filename"), 'd,error_unique_log_filename'); +--enable_query_log set @aaa = repeat('aaa',1000); set @bbb = repeat('bbb',1000); set @ccc = repeat('ccc',1000); @@ -269,8 +295,30 @@ SELECT count(*) FROM t4; -- echo # original rows remain SELECT count(*) FROM t2; +# Restart the server to enable binary log. +--let $rpl_server_number= 1 +--source include/rpl_restart_server.inc + +--disable_query_log +eval SET GLOBAL debug=IF(LENGTH('$old_debug') > 0, CONCAT('$old_debug', ":d,error_unique_log_filename"), 'd,error_unique_log_filename'); +--enable_query_log + +SET @xxx = REPEAT('xxx', 1000); +SET @yyy = REPEAT('yyy', 1000); -- error ER_NO_UNIQUE_LOGFILE DELETE FROM t4 WHERE a IN (@xxx, @yyy) OR 1; + +# Restart the server to enable binary log. +--let $rpl_server_number= 1 +--source include/rpl_restart_server.inc + +--disable_query_log +eval SET GLOBAL debug=IF(LENGTH('$old_debug') > 0, CONCAT('$old_debug', ":d,error_unique_log_filename"), 'd,error_unique_log_filename'); +--enable_query_log + +set @aaa = repeat('aaa',1000); +set @bbb = repeat('bbb',1000); +set @ccc = repeat('ccc',1000); -- error ER_NO_UNIQUE_LOGFILE DELETE FROM t2 WHERE a IN (@aaa, @bbb, @ccc) OR 1; @@ -320,6 +368,9 @@ eval SET GLOBAL debug='$old_debug'; call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file."); call mtr.add_suppression("Could not open .*"); +# Restart the server to enable binary log. +--let $rpl_server_number= 1 +--source include/rpl_restart_server.inc RESET MASTER; SHOW WARNINGS; @@ -477,6 +528,8 @@ call mtr.add_suppression("Can't generate a unique log-filename .*"); --disable_query_log eval SET GLOBAL debug='$old_debug'; --enable_query_log +-- remove_file $MYSQLTEST_VARDIR/tmp/bug_46166.data +-- remove_file $MYSQLTEST_VARDIR/tmp/bug_46166-2.data RESET SLAVE; RESET MASTER; --let $rpl_only_running_threads= 1 diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_gtid_mts_relay_log_recovery.test b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_gtid_mts_relay_log_recovery.test new file mode 100644 index 00000000..5ffd4877 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_gtid_mts_relay_log_recovery.test @@ -0,0 +1,118 @@ +############################################################################### +# Bug#19316063: MAKE MTS WORK WITH RELAY_LOG_RECOVERY=1 WHEN +# GTID IS ENABLED +# +# Problem: +# ======== +# When gaps are present in MTS and trying to restart the server with +# relay-log-recovery=1 will result in the following error. +# "relay-log-recovery cannot be executed when the slave was stopped with an +# error or killed in MTS mode" +# +# Test: +# ===== +# Enable GTID protocol along with MTS. Generate gaps in MTS, on the slave and +# restart slave server with relay-log-recovery=1. The gaps should +# be filled because of GTID protocol and slave should be in sync with master. +############################################################################### +--source include/rpl_connection_master.inc +CREATE DATABASE d1; +CREATE DATABASE d2; +CREATE DATABASE d3; +CREATE DATABASE d4; + +CREATE TABLE d1.t1 (a int unique) ENGINE=INNODB; +CREATE TABLE d2.t1 (a int unique) ENGINE=INNODB; +CREATE TABLE d3.t1 (a int unique) ENGINE=INNODB; +CREATE TABLE d4.t1 (a int unique) ENGINE=INNODB; + +--source include/sync_slave_sql_with_master.inc +STOP SLAVE SQL_THREAD; +SET GLOBAL DEBUG='d,flush_after_reading_user_var_event'; +# Generate three blocked workers on slave for 3 GAPS. +BEGIN; +INSERT INTO d1.t1 VALUES (1); # to cause the dup key error +INSERT INTO d2.t1 VALUES (2); +INSERT INTO d3.t1 VALUES (3); +# change-master with gaps +--source include/rpl_connection_master.inc +INSERT INTO d1.t1 VALUES (4); +INSERT INTO d2.t1 VALUES (5); +INSERT INTO d3.t1 VALUES (6); +INSERT INTO d4.t1 VALUES (7); +--source include/rpl_connection_master1.inc +# Using debug extension point d,flush_after_reading_user_var_event +# split the following transaction across the relay logs on slave. +BEGIN; +INSERT INTO d1.t1 VALUES (1); +SET @v= 100; +INSERT INTO d1.t1 VALUES (@v); +INSERT INTO d2.t1 VALUES (2); +INSERT INTO d3.t1 VALUES (3); + +--source include/rpl_connection_master.inc +BEGIN; +INSERT INTO d4.t1 VALUES (8); # this worker will race over one inserting (1) +--source include/rpl_connection_master1.inc +COMMIT; + +--source include/rpl_connection_slave1.inc +SET DEBUG_SYNC='now WAIT_FOR Reached'; +FLUSH LOGS; +--echo # Let IO thread continue splitting has been done now. +SET DEBUG_SYNC= 'now SIGNAL signal.flush_complete_continue'; + +--source include/rpl_connection_master.inc +COMMIT; +INSERT INTO d4.t1 VALUES (9); +--source include/sync_slave_io_with_master.inc + +--source include/rpl_connection_slave1.inc +START SLAVE SQL_THREAD; +# make sure workers doing d2.t1 raced the one that occupied with d1.t1 +--let $count= 1 +--let $table= d4.t1 +--let $wait_condition= select count(*) = 1 from $table where a = 8 +--source include/wait_condition.inc + +--source include/rpl_connection_slave.inc +# make worker executing (1) to error out +COMMIT; + +--let $slave_sql_errno= convert_error(ER_DUP_ENTRY) +--source include/wait_for_slave_sql_error.inc + +--source include/stop_slave_io.inc +# Remove tuple 13 from slave so that upon restart when the missing +# transaction is fetched again it will cause duplicate key error. +DELETE FROM d1.t1 where a=1; +DELETE FROM d2.t1 where a=2; +DELETE FROM d3.t1 where a=3; + +# Restart the salve server +--let $rpl_server_number= 2 +--let $rpl_start_with_gtids= 1 +--let $rpl_server_parameters= --skip_slave_start=FALSE --relay_log_info_repository=TABLE --master_info_repository=TABLE --sync_master_info=1 --relay-log-recovery=1 +--source include/rpl_restart_server.inc + +--source include/rpl_connection_master.inc +--source include/sync_slave_sql_with_master.inc + +# Compare the tables on master and slave they should be in sync +let $i=4; +while($i) +{ + --let diff_tables=master:d$i.t1, slave:d$i.t1 + --source include/diff_tables.inc + --dec $i +} + +# +# cleanup +# +--source include/rpl_connection_master.inc +DROP DATABASE d1; +DROP DATABASE d2; +DROP DATABASE d3; +DROP DATABASE d4; +--source include/sync_slave_sql_with_master.inc diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_gtid_temp_table_in_func_or_trigger.inc b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_gtid_temp_table_in_func_or_trigger.inc new file mode 100644 index 00000000..c6a56ad5 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_gtid_temp_table_in_func_or_trigger.inc @@ -0,0 +1,120 @@ +# CREATE FUNCTION USING func_or_trig_body PROVIDED BY MAIN TEST SCRIPT +--let $header=CREATE FUNCTION func1 () RETURNS varchar(30) CHARSET utf8 +--let $begin=BEGIN +--let $return=RETURN 0; +--let $end=END +--let $cmd=`select CONCAT("$header", "\n","$begin","\n", "$func_or_trig_body","\n", "$return", "\n","$end")` +--eval $cmd + +# USE THAT FUNCTION IN SELECT QUERY +--error ER_GTID_UNSAFE_CREATE_DROP_TEMPORARY_TABLE_IN_TRANSACTION +SELECT func1(); + +# USE THAT FUNCTION IN SELECT QUERY IN MULTI TRANSACTION STATEMENT +START TRANSACTION; +--error ER_GTID_UNSAFE_CREATE_DROP_TEMPORARY_TABLE_IN_TRANSACTION +SELECT func1(); +COMMIT; + +# iter 1 : INSERT/UPDATE/DELETE QUERY ON transaction table USING THAT FUNCTION +# iter 2 : INSERT/UPDATE/DELETE QUERY ON non transaction table USING THAT FUNCTION +--let $iter=1 +while ($iter <=2) +{ + if ($iter == 1) + { + --let $table=trans_table2 + } + if ($iter == 2) + { + --let $table=non_trans_table2 + } + --let $insert_cmd= INSERT INTO $table VALUES (func1()) + --error ER_GTID_UNSAFE_CREATE_DROP_TEMPORARY_TABLE_IN_TRANSACTION, ER_GTID_UNSAFE_NON_TRANSACTIONAL_TABLE + --eval $insert_cmd + + --let $update_cmd= UPDATE $table SET i=func1() + --error ER_GTID_UNSAFE_CREATE_DROP_TEMPORARY_TABLE_IN_TRANSACTION, ER_GTID_UNSAFE_NON_TRANSACTIONAL_TABLE + --eval $update_cmd + + --let $delete_cmd= DELETE FROM $table WHERE i=func1() + --error ER_GTID_UNSAFE_CREATE_DROP_TEMPORARY_TABLE_IN_TRANSACTION, ER_GTID_UNSAFE_NON_TRANSACTIONAL_TABLE + --eval $delete_cmd + + --inc $iter +} + +# DELETE THAT FUNCTION +DROP FUNCTION func1; + +# CREATE A TRIGGER USING func_or_trig_body PROVIDED BY MAIN TEST SCRIPT +# iter1: BEFORE INSERT ON transaction table +# iter2: AFTER INSERT ON transaction table +# iter3: BEFORE UPDATE ON transaction table +# iter4: AFTER UPDATE ON transaction table +# iter5: BEFORE DELETE ON transaction table +# iter6: AFTER DELETE ON transaction table +# iter7: BEFORE INSERT ON non transaction table +# iter8: AFTER INSERT ON non transaction table +# iter9: BEFORE UPDATE ON non transaction table +# iter10: AFTER UPDATE ON non transaction table +# iter11: BEFORE DELETE ON non transaction table +# iter12: AFTER DELETE ON non transaction table + +# And all 12 iterations should throw an error +--let $iter=1 +while ($iter <= 12) +{ + --let $header=CREATE TRIGGER trigger1 + --let $for_each_row= FOR EACH ROW + --let $begin=BEGIN + --let $end=END + + --let $table=trans_table2 + if ($iter >= 7) + { + --let $table=non_trans_table2 + } + + --let $before_or_after=BEFORE + if (`SELECT $iter IN (2, 4, 6, 8, 10, 12)`) + { + --let $before_or_after=AFTER + } + + --let $insert_or_update_or_delete=INSERT + if (`SELECT $iter IN (3, 4, 9, 10)`) + { + --let $insert_or_update_or_delete=UPDATE + } + if (`SELECT $iter IN (5, 6, 11, 12)`) + { + --let $insert_or_update_or_delete=DELETE + } + + --let $cmd=`select CONCAT("$header", "\n", "$before_or_after", " ", "$insert_or_update_or_delete", " ON ", "$table", " ", "$for_each_row", "\n", "$begin","\n", "$func_or_trig_body","\n", "$end")` + --eval $cmd + + if (`SELECT $iter IN (1, 2, 7, 8)`) + { + --let $insert_cmd= INSERT INTO $table VALUES (10) + --error ER_GTID_UNSAFE_CREATE_DROP_TEMPORARY_TABLE_IN_TRANSACTION, ER_GTID_UNSAFE_NON_TRANSACTIONAL_TABLE + --eval $insert_cmd + } + + if (`SELECT $iter IN (3, 4, 9, 10)`) + { + --let $update_cmd= UPDATE $table SET i=12 + --error ER_GTID_UNSAFE_CREATE_DROP_TEMPORARY_TABLE_IN_TRANSACTION, ER_GTID_UNSAFE_NON_TRANSACTIONAL_TABLE + --eval $update_cmd + } + + if (`SELECT $iter IN (5, 6, 11, 12)`) + { + --let $delete_cmd= DELETE FROM $table + --error ER_GTID_UNSAFE_CREATE_DROP_TEMPORARY_TABLE_IN_TRANSACTION, ER_GTID_UNSAFE_NON_TRANSACTIONAL_TABLE + --eval $delete_cmd + } + DROP TRIGGER trigger1; + --inc $iter +} diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_rollback_to_savepoint.inc b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_rollback_to_savepoint.inc new file mode 100644 index 00000000..af22389d --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_rollback_to_savepoint.inc @@ -0,0 +1,327 @@ +############################################################################### +# Bug#76727: SLAVE ASSERTION IN UNPACK_ROW WITH ROLLBACK TO +# SAVEPOINT IN ERROR HANDLER +# +# Problem: +# ======== +# "SAVEPOINT", "ROLLBACK TO savepoint" wipe out table map on slave during +# execution binary log events. For trigger the map is written to binary log once +# for all trigger body and if trigger contains "SAVEPOINT" or +# "ROLLBACK TO savepoint" statements any trigger's events after these +# statements will not have table map. This results in an assert on slave. +# +# Test: +# ===== +# Test case 1: +# Create a trigger with exception handler which rollsback to a savepoint. +# Test proves that there will not be any assert during execution of rolling +# back to savepoint. +# +# Test case 2: +# Create a trigger which calls a procedure which in turn calls an exception +# handler which rollsback to a savepoint. Prove that it doesn't cause any +# assertion during execution. +# +# Test case 3: +# Create a simple trigger which creates a SAVEPOINT and ROLLSBACK to savepoint +# and doesn't follow with any other DML statement. Prove that it doesn't cause +# any assertion during execution. +# +# Test case 4: +# Create a trigger with SAVEPOINT and follows with a DML without ROLLBACK TO +# savepoint. Ensure that data is replicated properly. +# +# Test case 5: +# Create a trigger with SAVEPOINT and it does nothing. Do few DMLS following +# the trigger ensure that the data is replicated properly +# +# Test case 6: +# Create a stored function which creates a SAVEPOINT and ROLLSBACK to +# savepoint. Do few inserts following the stored function call and ensure that +# no assert is generated on slave and all the rows are replicated to slave. +# +# Test case 7: +# Create a stored function which creates a SAVEPOINT alone and follows with +# DMLS without ROLLBACK TO savepoint. Ensure that data is replicated properly. +# +# Test case 8: +# Create a stored function which has SAVEPOINT inside it and does noting. It +# should follow with other DMLs. Ensure that data is replicated properly. +############################################################################### +--source include/have_innodb.inc +--source include/master-slave.inc + +--echo #Test case 1: +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY); +CREATE TABLE t2 (f1 INTEGER PRIMARY KEY); +CREATE TABLE t3 (f1 INTEGER PRIMARY KEY); +DELIMITER |; + +CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW +BEGIN + DECLARE EXIT HANDLER FOR SQLEXCEPTION + BEGIN + ROLLBACK TO event_logging_1; + INSERT t3 VALUES (1); + END; + + SAVEPOINT event_logging_1; + + INSERT INTO t2 VALUES (1); + + RELEASE SAVEPOINT event_logging_1; + +END| +DELIMITER ;| + +INSERT INTO t2 VALUES (1); +INSERT INTO t1 VALUES (1); + +--source include/show_binlog_events.inc + +--sync_slave_with_master + +--source include/rpl_connection_master.inc + +DROP TRIGGER tr1; +DELETE FROM t1; +DELETE FROM t2; +DELETE FROM t3; + +--echo # Test case 2: + +DELIMITER |; + +CREATE PROCEDURE p1() +BEGIN + DECLARE EXIT HANDLER FOR SQLEXCEPTION + BEGIN + ROLLBACK TO event_logging_2; + INSERT t3 VALUES (3); + END; + + SAVEPOINT event_logging_2; + + INSERT INTO t2 VALUES (1); + + RELEASE SAVEPOINT event_logging_2; +END| + +CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW CALL p1()| + +DELIMITER ;| + +INSERT INTO t2 VALUES (1); +INSERT INTO t1 VALUES (1); + +--source include/show_binlog_events.inc + +--sync_slave_with_master + +--source include/rpl_connection_master.inc + +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; + +DROP PROCEDURE p1; + +--echo # Test case 3: +--source include/rpl_reset.inc +--source include/rpl_connection_master.inc + +CREATE TABLE t (f1 int(10) unsigned NOT NULL, PRIMARY KEY (f1)) ENGINE=InnoDB; + +--delimiter | +CREATE TRIGGER t_insert_trig AFTER INSERT ON t +FOR EACH ROW +BEGIN + +SAVEPOINT savepoint_1; +ROLLBACK TO savepoint_1; + +END | +--delimiter ; + +INSERT INTO t VALUES (2); +INSERT INTO t VALUES (3); + +--source include/show_binlog_events.inc + +SELECT * FROM t; + +--source include/sync_slave_sql_with_master.inc + +SELECT * FROM t; + +--source include/rpl_connection_master.inc +DROP TABLE t; + +--echo # Test case 4: +--source include/rpl_reset.inc +--source include/rpl_connection_master.inc +CREATE TABLE t (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB; +CREATE TABLE t1 (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB; + +--delimiter | +CREATE TRIGGER t_insert_trig BEFORE INSERT ON t +FOR EACH ROW +BEGIN + +SAVEPOINT savepoint_1; +INSERT INTO t1 VALUES (5); +END | +--delimiter ; + +INSERT INTO t VALUES (2), (3); +INSERT INTO t1 VALUES (30); +--source include/show_binlog_events.inc + +SELECT * FROM t; +SELECT * FROM t1; +--source include/sync_slave_sql_with_master.inc + +SELECT * FROM t; +SELECT * FROM t1; + +--source include/rpl_connection_master.inc +DROP TABLE t; +DROP TABLE t1; + +--echo # Test case 5: +--source include/rpl_reset.inc +--source include/rpl_connection_master.inc +CREATE TABLE t (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB; +CREATE TABLE t1 (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB; + +--delimiter | +CREATE TRIGGER t_insert_trig BEFORE INSERT ON t +FOR EACH ROW +BEGIN + +SAVEPOINT savepoint_1; +END | + +--delimiter ; + +INSERT INTO t VALUES (2), (3); +INSERT INTO t1 VALUES (30); +--source include/show_binlog_events.inc + +SELECT * FROM t; +SELECT * FROM t1; +--source include/sync_slave_sql_with_master.inc + +SELECT * FROM t; +SELECT * FROM t1; + +--source include/rpl_connection_master.inc +DROP TABLE t; +DROP TABLE t1; + +--echo # Test case 6: +--source include/rpl_reset.inc +--source include/rpl_connection_master.inc +CREATE TABLE t1 (f1 INTEGER ) ENGINE=INNODB; +CREATE TABLE t2 (f1 INTEGER ) ENGINE=INNODB; + +--delimiter | + +CREATE FUNCTION f1() RETURNS INT +BEGIN + SAVEPOINT event_logging_2; + + INSERT INTO t1 VALUES (1); + + ROLLBACK TO event_logging_2; + RETURN 0; +END| + +--delimiter ; + +BEGIN; +INSERT INTO t2 VALUES (1), (f1()), (2), (4); +COMMIT; +INSERT INTO t2 VALUES (10); +--source include/show_binlog_events.inc + +--source include/rpl_connection_master.inc +SELECT * FROM t2; +SELECT * FROM t1; +--source include/sync_slave_sql_with_master.inc +SELECT * FROM t2; +SELECT * FROM t1; + +--source include/rpl_connection_master.inc +DROP TABLE t1; +DROP TABLE t2; +DROP FUNCTION f1; + +--echo # Test case 7: +--source include/rpl_reset.inc +--source include/rpl_connection_master.inc +CREATE TABLE t1 (f1 INTEGER ) ENGINE=INNODB; +CREATE TABLE t2 (f1 INTEGER ) ENGINE=INNODB; + +--delimiter | + +CREATE FUNCTION f1() RETURNS INT +BEGIN + SAVEPOINT event_logging_2; + + INSERT INTO t1 VALUES (1); + + RETURN 0; +END| + +--delimiter ; + +BEGIN; +INSERT INTO t2 VALUES (1), (f1()), (2), (4); +COMMIT; +INSERT INTO t2 VALUES (10); +--source include/show_binlog_events.inc + +--source include/rpl_connection_master.inc +SELECT * FROM t2; +SELECT * FROM t1; +--source include/sync_slave_sql_with_master.inc +SELECT * FROM t2; +SELECT * FROM t1; + +--source include/rpl_connection_master.inc +DROP TABLE t1; +DROP TABLE t2; +DROP FUNCTION f1; + +--echo # Test case 8: +--source include/rpl_reset.inc +--source include/rpl_connection_master.inc +CREATE TABLE t1 (f1 INTEGER ) ENGINE=INNODB; + +--delimiter | + +CREATE FUNCTION f1() RETURNS INT +BEGIN + SAVEPOINT event_logging_2; + RETURN 0; +END| + +--delimiter ; + +BEGIN; +INSERT INTO t1 VALUES (1), (f1()), (2), (4); +COMMIT; +INSERT INTO t1 VALUES (10); +--source include/show_binlog_events.inc + +--source include/rpl_connection_master.inc +SELECT * FROM t1; +--source include/sync_slave_sql_with_master.inc +SELECT * FROM t1; + +--source include/rpl_connection_master.inc +DROP TABLE t1; +DROP FUNCTION f1; + +--source include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_stress_test.inc b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_stress_test.inc index be50f38c..608e4d1e 100644 --- a/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_stress_test.inc +++ b/mysql-wsrep-5.6/mysql-test/extra/rpl_tests/rpl_stress_test.inc @@ -27,12 +27,15 @@ while ($i < $n) --connect(con$i,127.0.0.1,root,,test,$MASTER_MYPORT,) --inc $i } ---let $i= 1 -while ($i < $connections) +if ($error_simulation) { - --connection con$i - set session debug="+d,simulate_binlog_flush_error"; - --inc $i + --let $i= 1 + while ($i < $connections) + { + --connection con$i + set session debug="+d,simulate_binlog_flush_error"; + --inc $i + } } --enable_result_log --enable_query_log @@ -63,13 +66,15 @@ while ($j < $m) } --inc $j } - ---let $i= 1 -while ($i < $connections) +if ($error_simulation) { - --connection con$i - set session debug="-d,simulate_binlog_flush_error"; - --inc $i + --let $i= 1 + while ($i < $connections) + { + --connection con$i + set session debug="-d,simulate_binlog_flush_error"; + --inc $i + } } --enable_result_log --enable_query_log diff --git a/mysql-wsrep-5.6/mysql-test/include/assert_grep.inc b/mysql-wsrep-5.6/mysql-test/include/assert_grep.inc new file mode 100644 index 00000000..a980a6d7 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/include/assert_grep.inc @@ -0,0 +1,154 @@ +# ==== Purpose ==== +# +# Grep a file for a pattern, produce a single string out of the +# matching lines, and assert that the string matches a given regular +# expression. +# +# ==== Usage ==== +# +# --let $assert_text= TEXT +# --let $assert_file= FILE +# --let $assert_select= REGEX +# [--let $assert_match= REGEX | --let $assert_count= NUMBER] +# [--let $assert_only_after= REGEX] +# --source include/assert_grep.inc +# +# Parameters: +# +# $assert_text +# Text that describes what is being checked. This text is written to +# the query log so it should not contain non-deterministic elements. +# +# $assert_file +# File to search. +# +# $assert_select +# All lines matching this text will be checked. +# +# $assert_match +# The script will find all lines that match $assert_select, +# concatenate them to a long string, and assert that it matches +# $assert_match. +# +# $assert_count +# Instead of asserting that the selected lines match +# $assert_match, assert that there were exactly $assert_count +# matching lines. +# +# $assert_only_after +# Reset all the lines matched and the counter when finding this pattern. +# It is useful for searching things in the mysqld.err log file just +# after the last server restart for example (discarding the log content +# of previous server executions). + + +if (!$assert_text) +{ + --die !!!ERROR IN TEST: you must set $assert_text +} +if (!$assert_file) +{ + --die !!!ERROR IN TEST: you must set $assert_file +} +if (!$assert_select) +{ + --die !!!ERROR IN TEST: you must set $assert_select +} +if ($assert_match == '') +{ + if ($assert_count == '') + { + --die !!!ERROR IN TEST: you must set either $assert_match or $assert_count + } +} +if ($assert_match != '') +{ + if ($assert_count != '') + { + --echo assert_text='$assert_text' assert_count='$assert_count' + --die !!!ERROR IN TEST: you must set only one of $assert_match or $assert_count + } +} + + +--let $include_filename= assert_grep.inc [$assert_text] +--source include/begin_include_file.inc + + +--let _AG_ASSERT_TEXT= $assert_text +--let _AG_ASSERT_FILE= $assert_file +--let _AG_ASSERT_SELECT= $assert_select +--let _AG_ASSERT_MATCH= $assert_match +--let _AG_ASSERT_COUNT= $assert_count +--let _AG_OUT= `SELECT CONCAT('$MYSQLTEST_VARDIR/tmp/_ag_', UUID())` +--let _AG_ASSERT_ONLY_AFTER= $assert_only_after + + +--perl + use strict; + use warnings; + my $file= $ENV{'_AG_ASSERT_FILE'}; + my $assert_select= $ENV{'_AG_ASSERT_SELECT'}; + my $assert_match= $ENV{'_AG_ASSERT_MATCH'}; + my $assert_count= $ENV{'_AG_ASSERT_COUNT'}; + my $assert_only_after= $ENV{'_AG_ASSERT_ONLY_AFTER'}; + my $out= $ENV{'_AG_OUT'}; + + my $result= ''; + my $count= 0; + open(FILE, "$file") or die("Error $? opening $file: $!\n"); + while () { + my $line = $_; + if ($assert_only_after && $line =~ /$assert_only_after/) { + $result = ""; + $count = 0; + } + if ($line =~ /$assert_select/) { + if ($assert_count ne '') { + $count++; + } + else { + $result .= $line; + } + } + } + close(FILE) or die("Error $? closing $file: $!"); + open OUT, "> $out" or die("Error $? opening $out: $!"); + if ($assert_count ne '' && ($count != $assert_count)) { + print OUT ($count) or die("Error $? writing $out: $!"); + } + elsif ($assert_count eq '' && $result !~ /$assert_match/) { + print OUT ($result) or die("Error $? writing $out: $!"); + } + else { + print OUT ("assert_grep.inc ok"); + } + close OUT or die("Error $? closing $out: $!"); +EOF + + +--let $_ag_outcome= `SELECT LOAD_FILE('$_AG_OUT')` +if ($_ag_outcome != 'assert_grep.inc ok') +{ + --source include/show_rpl_debug_info.inc + --echo include/assert_grep.inc failed! + --echo assert_text: '$assert_text' + --echo assert_file: '$assert_file' + --echo assert_select: '$assert_select' + --echo assert_match: '$assert_match' + --echo assert_count: '$assert_count' + --echo assert_only_after: '$assert_only_after' + if ($assert_match != '') + { + --echo matching lines: '$_ag_outcome' + } + if ($assert_count != '') + { + --echo number of matching lines: $_ag_outcome + } + --die assert_grep.inc failed. +} + + +--let $include_filename= include/assert_grep.inc [$assert_text] +--source include/end_include_file.inc diff --git a/mysql-wsrep-5.6/mysql-test/include/check-testcase.test b/mysql-wsrep-5.6/mysql-test/include/check-testcase.test index fe5c7562..6ef3aece 100644 --- a/mysql-wsrep-5.6/mysql-test/include/check-testcase.test +++ b/mysql-wsrep-5.6/mysql-test/include/check-testcase.test @@ -6,6 +6,7 @@ # tescase. In that way, it is possible to check that a testcase does # not have any unwanted side affects. +--source include/wait_until_connected_again.inc --disable_query_log # We want to ensure all slave configuration is restored. But SHOW diff --git a/mysql-wsrep-5.6/mysql-test/include/default_mysqld.cnf b/mysql-wsrep-5.6/mysql-test/include/default_mysqld.cnf index cecd4a65..1c98245b 100644 --- a/mysql-wsrep-5.6/mysql-test/include/default_mysqld.cnf +++ b/mysql-wsrep-5.6/mysql-test/include/default_mysqld.cnf @@ -34,7 +34,7 @@ loose-innodb_lru_scan_depth= 100 loose-innodb_write_io_threads= 2 loose-innodb_read_io_threads= 2 loose-innodb_log_buffer_size= 1M -loose-innodb_log_file_size= 5M +innodb_log_file_size= 5M loose-innodb_additional_mem_pool_size= 1M loose-innodb_log_files_in_group= 2 diff --git a/mysql-wsrep-5.6/mysql-test/include/galera_clear_sync_point.inc b/mysql-wsrep-5.6/mysql-test/include/galera_clear_sync_point.inc new file mode 100644 index 00000000..589522a5 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/include/galera_clear_sync_point.inc @@ -0,0 +1 @@ +SET GLOBAL wsrep_provider_options = 'dbug='; diff --git a/mysql-wsrep-5.6/mysql-test/include/galera_cluster.inc b/mysql-wsrep-5.6/mysql-test/include/galera_cluster.inc new file mode 100644 index 00000000..bc652225 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/include/galera_cluster.inc @@ -0,0 +1,10 @@ +# galera_cluster.inc +# ================== +# +# Description +# ----------- +# Configure galera cluster with 2 nodes. +# + +--let $galera_cluster_size = 2 +--source include/galera_init.inc diff --git a/mysql-wsrep-5.6/mysql-test/include/galera_connect.inc b/mysql-wsrep-5.6/mysql-test/include/galera_connect.inc new file mode 100644 index 00000000..bfd9b188 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/include/galera_connect.inc @@ -0,0 +1,45 @@ +# galera_connect.inc +# ================== +# +# Description +# ----------- +# Open a connection to the specified server number ($galera_server_number). +# The connection itself would be identified by $galera_connection_name. +# +# Parameters +# ---------- +# $galera_connection_name +# Name of the resulting connection. +# +# $galera_server_number +# Sequence number of the node in the galera cluster. +# +# $galera_debug +# Print debug information. +# + +if (!$galera_connection_name) +{ + --die ERROR IN TEST: $galera_connection_name must be set before sourcing include/galera_connect.inc +} + +if (!$galera_server_number) +{ + --die ERROR IN TEST: $galera_server_number must be set before sourcing include/galera_connect.inc +} + +--let $_galera_port= \$NODE_MYPORT_$galera_server_number +if (!$_galera_port) +{ + --echo Bug in test case: '\$NODE_MYPORT_$galera_server_number' not initialized. Check the test's .cfg file. + --die Not all NODE_MYPORT_* environment variables are setup correctly. +} + +if ($galera_debug) +{ + --echo connect($galera_connection_name,127.0.0.1,root,,test,$_galera_port,) +} + +# Open a connection +--connect($galera_connection_name,127.0.0.1,root,,test,$_galera_port,) + diff --git a/mysql-wsrep-5.6/mysql-test/include/galera_diff.inc b/mysql-wsrep-5.6/mysql-test/include/galera_diff.inc new file mode 100644 index 00000000..6043b582 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/include/galera_diff.inc @@ -0,0 +1,100 @@ +# galera_diff.inc +# =============== +# +# Description +# ----------- +# Compare the output of the given statement on all the nodes of the cluster. +# +# Parameters +# ---------- +# $galera_diff_statement +# Statement for which the output would be compared. +# +# $galera_diff_database +# Database against which the above statement would be executed. +# (Default : test) +# +# $galera_diff_servers +# Comma separated list of servers to executed the diff statement on. If not +# set, a list of servers will be generated based on $galera_cluster_size. +# +# $galerra_debug +# Print debug information. +# + +if (!$galera_diff_statement) +{ + --die ERROR IN TEST: $galera_diff_statement must be set before sourcing include/galera_diff.inc +} + +--let $_galera_diff_database = $galera_diff_database +if (!$_galera_diff_database) +{ + --let $_galera_diff_database = test +} + +--let $_galera_diff_servers= $galera_diff_servers +if (!$_galera_diff_servers) +{ + --let $_i= $galera_cluster_size + --let $_galera_diff_servers= + while ($_i) + { + --let $_galera_diff_servers= $_i,$_galera_diff_servers + --dec $_i + } +} +if ($galera_debug) +{ + --echo \$galera_diff_servers= '$_galera_diff_servers' +} + +if (!$galera_debug) +{ + --disable_query_log +} + +# Generate file containing $galera_diff_statement. We don't pass the +# statement on the command line, because it would be subject to shell +# substitutions. +--let $write_to_file= GENERATE +--let $write_var= $galera_diff_statement +--source include/write_var_to_file.inc +--let $_galera_diff_statement_file= $write_to_file + +if (!$galera_debug) +{ + --enable_query_log +} + +# Compare all servers. +--let $_galera_diff_first= 1 +while ($_galera_diff_servers) +{ + # Set $_galera_diff_server_i to the first number in the list + --let $_galera_diff_server_i= `SELECT SUBSTRING_INDEX('$_galera_diff_servers', ',', 1)` + # Remove $_galera_diff_server_i from the list + --let $_galera_diff_servers= `SELECT SUBSTRING('$_galera_diff_servers', LENGTH('$_galera_diff_server_i') + 2)` + + # Execute statement + --let $_galera_diff_file= $MYSQLTEST_VARDIR/tmp/_galera_diff_server-$_galera_diff_server_i.tmp + --exec $MYSQL --defaults-group-suffix=.$_galera_diff_server_i $_galera_diff_database < $_galera_diff_statement_file > $_galera_diff_file + + # Compare + if (!$_galera_diff_first) + { + if ($galera_debug) + { + --echo diffing $_galera_diff_file and $_galera_diff_prev_file + } + --diff_files $_galera_diff_file $_galera_diff_prev_file + --remove_file $_galera_diff_prev_file + } + --let $_galera_diff_prev_file= $_galera_diff_file + --let $_galera_diff_first= 0 +} + +# Cleanup +--remove_file $_galera_diff_prev_file +--remove_file $_galera_diff_statement_file + diff --git a/mysql-wsrep-5.6/mysql-test/include/galera_end.inc b/mysql-wsrep-5.6/mysql-test/include/galera_end.inc new file mode 100644 index 00000000..0fb54798 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/include/galera_end.inc @@ -0,0 +1,25 @@ +# galera_end.inc +# ============== +# +# Description +# ----------- +# Closes the connections opened via include/galera_init.inc +# +# Parameters +# ---------- +# $galera_cluster_size +# Number of nodes in the cluster. +# + +--let $_galera_node= $galera_cluster_size + +while ($_galera_node) +{ + if ($galera_debug) + { + --echo Disconnecting node_$_galera_node + } + --disconnect node_$_galera_node + --dec $_galera_node +} + diff --git a/mysql-wsrep-5.6/mysql-test/include/galera_init.inc b/mysql-wsrep-5.6/mysql-test/include/galera_init.inc new file mode 100644 index 00000000..7c79d6fc --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/include/galera_init.inc @@ -0,0 +1,27 @@ +# galera_init.inc +# =============== +# +# Description +# ----------- +# Set up a Galera cluster with $wsrep_cluster_size nodes. +# +# Parameters +# ---------- +# $galera_cluster_size +# Number of nodes in the cluster. +# + +--source include/have_wsrep_provider.inc +--source include/have_wsrep_enabled.inc + +--let $_galera_node= $galera_cluster_size + +while ($_galera_node) +{ + --let $galera_connection_name= node_$_galera_node + --let $galera_server_number= $_galera_node + --source include/galera_connect.inc + + --dec $_galera_node +} + diff --git a/mysql-wsrep-5.6/mysql-test/include/galera_resume.inc b/mysql-wsrep-5.6/mysql-test/include/galera_resume.inc new file mode 100644 index 00000000..232cb464 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/include/galera_resume.inc @@ -0,0 +1,9 @@ +--echo Resuming node ... +--perl + my $pid_filename = $ENV{'_SUSPEND_NODE_PIDFILE'}; + my $mysqld_pid = `cat $pid_filename`; + chomp($mysqld_pid); + system("kill -18 $mysqld_pid"); + exit(0); +EOF + diff --git a/mysql-wsrep-5.6/mysql-test/include/galera_set_sync_point.inc b/mysql-wsrep-5.6/mysql-test/include/galera_set_sync_point.inc new file mode 100644 index 00000000..5fe4e8c3 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/include/galera_set_sync_point.inc @@ -0,0 +1 @@ +--eval SET GLOBAL wsrep_provider_options = 'dbug=d,$galera_sync_point' diff --git a/mysql-wsrep-5.6/mysql-test/include/galera_signal_sync_point.inc b/mysql-wsrep-5.6/mysql-test/include/galera_signal_sync_point.inc new file mode 100644 index 00000000..eaa5cdd4 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/include/galera_signal_sync_point.inc @@ -0,0 +1 @@ +--eval SET GLOBAL wsrep_provider_options = 'signal=$galera_sync_point' diff --git a/mysql-wsrep-5.6/mysql-test/include/galera_suspend.inc b/mysql-wsrep-5.6/mysql-test/include/galera_suspend.inc new file mode 100644 index 00000000..3495ad23 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/include/galera_suspend.inc @@ -0,0 +1,14 @@ +# +# This macro suspends the current node +# + +--let _SUSPEND_NODE_PIDFILE = `SELECT @@pid_file` +--echo Suspending node ... + +--perl + my $pid_filename = $ENV{'_SUSPEND_NODE_PIDFILE'}; + my $mysqld_pid = `cat $pid_filename`; + chomp($mysqld_pid); + system("kill -19 $mysqld_pid"); + exit(0); +EOF diff --git a/mysql-wsrep-5.6/mysql-test/include/galera_wait_ready.inc b/mysql-wsrep-5.6/mysql-test/include/galera_wait_ready.inc new file mode 100644 index 00000000..56525385 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/include/galera_wait_ready.inc @@ -0,0 +1,3 @@ +let $wait_timeout = 10; +let $wait_condition = SELECT 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready' AND VARIABLE_VALUE = 'ON'; +--source include/wait_condition.inc diff --git a/mysql-wsrep-5.6/mysql-test/include/galera_wait_sync_point.inc b/mysql-wsrep-5.6/mysql-test/include/galera_wait_sync_point.inc new file mode 100644 index 00000000..cf3a4980 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/include/galera_wait_sync_point.inc @@ -0,0 +1,6 @@ +--let $wait_timeout = 10 +--let $wsrep_on_orig = `SELECT @@wsrep_on` +SET SESSION wsrep_on = 0; +--let $wait_condition = SELECT 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters' AND VARIABLE_VALUE = '$galera_sync_point' +--source include/wait_condition.inc +--eval SET SESSION wsrep_on = $wsrep_on_orig diff --git a/mysql-wsrep-5.6/mysql-test/include/have_mysql_no_login_plugin.inc b/mysql-wsrep-5.6/mysql-test/include/have_mysql_no_login_plugin.inc new file mode 100644 index 00000000..d0053043 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/include/have_mysql_no_login_plugin.inc @@ -0,0 +1,21 @@ +# +# Check if server has support for loading plugins +# +if (`SELECT @@have_dynamic_loading != 'YES'`) { + --skip mysql_no_login requires dynamic loading +} + +# +# Check if the variable MYSQL_NO_LOGIN is set +# +if (!$MYSQL_NO_LOGIN) { + --skip mysql_no_login requires the environment variable \$MYSQL_NO_LOGIN to be set (normally done by mtr) +} + +# +# Check if --plugin-dir was setup for mysql_no_login +# +if (`SELECT CONCAT('--plugin-dir=', REPLACE(@@plugin_dir, '\\\\', '/')) != '$MYSQL_NO_LOGIN_OPT/'`) { + --skip mysql_no_login requires that --plugin-dir is set to the mysql_no_login dir (either the .opt file does not contain \$MYSQL_NO_LOGIN_OPT or another plugin is in use) +} + diff --git a/mysql-wsrep-5.6/mysql-test/include/have_numa.inc b/mysql-wsrep-5.6/mysql-test/include/have_numa.inc new file mode 100644 index 00000000..bd1c7d7a --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/include/have_numa.inc @@ -0,0 +1,18 @@ +let $numa_support = `SELECT COUNT(VARIABLE_VALUE) = 1 FROM + INFORMATION_SCHEMA.GLOBAL_VARIABLES + WHERE VARIABLE_NAME='innodb_numa_interleave'`; + +if ( $numa_support == 0 ) +{ + --skip Test requires: NUMA must be enabled +} + +if ( $numa_support == 1 ) +{ + let $numa = `SELECT @@GLOBAL.innodb_numa_interleave = 'OFF'`; + if ( $numa == 1 ) + { + --skip Test requires: NUMA must be enabled + } +} + diff --git a/mysql-wsrep-5.6/mysql-test/include/have_wsrep.inc b/mysql-wsrep-5.6/mysql-test/include/have_wsrep.inc new file mode 100644 index 00000000..52220edf --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/include/have_wsrep.inc @@ -0,0 +1,8 @@ +# To be used in a test which requires server to be compiled with wsrep support +# (-DWITH_WSREP=ON) and wsrep plugin is ACTIVE. + +if (`SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME = 'wsrep' AND PLUGIN_STATUS='ACTIVE'`) +{ + --skip Test requires wsrep plugin. +} + diff --git a/mysql-wsrep-5.6/mysql-test/include/have_wsrep_enabled.inc b/mysql-wsrep-5.6/mysql-test/include/have_wsrep_enabled.inc new file mode 100644 index 00000000..1b5948fe --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/include/have_wsrep_enabled.inc @@ -0,0 +1,10 @@ + +# To be used in a test which requires wsrep plugin to be ACTIVE and enabled +# (i.e. wsrep_on=ON). It includes have_wsrep.inc. + +--source include/have_wsrep.inc + +--require r/have_wsrep.require +--disable_query_log +SHOW VARIABLES LIKE 'wsrep_on'; +--enable_query_log diff --git a/mysql-wsrep-5.6/mysql-test/include/have_wsrep_provider.inc b/mysql-wsrep-5.6/mysql-test/include/have_wsrep_provider.inc new file mode 100644 index 00000000..bb5cbc00 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/include/have_wsrep_provider.inc @@ -0,0 +1,6 @@ +if (`SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE + VARIABLE_NAME LIKE 'wsrep_provider' AND VARIABLE_VALUE NOT LIKE 'none'`) +{ + --skip Test requires wsrep provider library (libgalera_smm.so). Did you set $WSREP_PROVIDER? +} + diff --git a/mysql-wsrep-5.6/mysql-test/include/kill_galera.inc b/mysql-wsrep-5.6/mysql-test/include/kill_galera.inc new file mode 100644 index 00000000..c61bad8e --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/include/kill_galera.inc @@ -0,0 +1,21 @@ +--echo Killing server ... + +# Write file to make mysql-test-run.pl expect the crash, but don't start it +--source include/wait_until_connected_again.inc +--let $_server_id= `SELECT @@server_id` +--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect +--exec echo "wait" > $_expect_file_name + +# Kill the connected server +--disable_reconnect +--let KILL_NODE_PIDFILE = `SELECT @@pid_file` + +--perl + my $pid_filename = $ENV{'KILL_NODE_PIDFILE'}; + my $mysqld_pid = `cat $pid_filename`; + chomp($mysqld_pid); + system("kill -9 $mysqld_pid"); + exit(0); +EOF + +--source include/wait_until_disconnected.inc diff --git a/mysql-wsrep-5.6/mysql-test/include/mtr_check.sql b/mysql-wsrep-5.6/mysql-test/include/mtr_check.sql index 3bd25834..c08a32bb 100644 --- a/mysql-wsrep-5.6/mysql-test/include/mtr_check.sql +++ b/mysql-wsrep-5.6/mysql-test/include/mtr_check.sql @@ -60,15 +60,24 @@ BEGIN -- Dump all global variables except those that may change. -- timestamp changes if time passes. server_uuid changes if server restarts. + -- wsrep_start_position can change on mysqldump SST + -- auto_increment_offset can change on cluster reconfigurations SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp', 'server_uuid', 'innodb_file_format_max', - 'gtid_executed', 'gtid_purged') + 'gtid_executed', 'gtid_purged', + 'wsrep_start_position', + 'auto_increment_offset', + 'auto_increment_increment', + 'wsrep_data_home_dir') ORDER BY VARIABLE_NAME; -- Dump all databases, there should be none -- except those that was created during bootstrap - SELECT * FROM INFORMATION_SCHEMA.SCHEMATA; + -- and the mtr_wsrep_notify schema which is populated by the std_data/wsrep_notify.sh script + -- and the suite/galera/t/galera_var_notify_cmd.test + -- and the wsrep_schema schema that may be created by Galera + SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema'); -- The test database should not contain any tables SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES diff --git a/mysql-wsrep-5.6/mysql-test/include/mtr_warnings.sql b/mysql-wsrep-5.6/mysql-test/include/mtr_warnings.sql index 9de3058c..228ccce9 100644 --- a/mysql-wsrep-5.6/mysql-test/include/mtr_warnings.sql +++ b/mysql-wsrep-5.6/mysql-test/include/mtr_warnings.sql @@ -1,4 +1,4 @@ --- Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. +-- Copyright (c) 2008, 2015, 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 @@ -243,9 +243,49 @@ INSERT INTO global_suppressions VALUES ("Changed limits: max_open_files: *"), ("Changed limits: max_connections: *"), - ("Changed limits: table_cache: *"), + ("Changed limits: table_open_cache: *"), ("Could not increase number of max_open_files to more than *"), + /* + Galera suppressions + */ + ("WSREP:*down context*"), + ("WSREP: Failed to send state UUID:*"), + ("WSREP: wsrep_sst_receive_address is set to '127.0.0.1"), + ("WSREP: option --wsrep-causal-reads is deprecated"), + ("WSREP: --wsrep-causal-reads=ON takes precedence over --wsrep-sync-wait=0"), + ("WSREP: Could not open saved state file for reading: "), + ("WSREP: Could not open state file for reading: "), + ("WSREP: access file\\(.*gvwstate\\.dat\\) failed\\(No such file or directory\\)"), + ("WSREP: Gap in state sequence\\. Need state transfer\\."), + ("WSREP: Failed to prepare for incremental state transfer: Local state UUID \\(00000000-0000-0000-0000-000000000000\\) does not match group state UUID"), + ("WSREP: No existing UUID has been found, so we assume that this is the first time that this server has been started\\. Generating a new UUID: "), + ("WSREP: last inactive check more than"), + ("WSREP: binlog cache not empty \\(0 bytes\\) at connection close"), + ("WSREP: SQL statement was ineffective"), + ("WSREP: Refusing exit for the last slave thread"), + ("WSREP: Quorum: No node with complete state"), + ("WSREP: Failed to report last committed"), + ("Slave SQL: Error 'Duplicate entry"), + ("Query apply warning:"), + ("WSREP: Ignoring error for TO isolated action:"), + ("WSREP: Initial position was provided by configuration or SST, avoiding override"), + ("Warning: Using a password on the command line interface can be insecure"), + ("InnoDB: Error: Table \"mysql\"\\.\"innodb_table_stats\" not found"), + ("but it is impossible to select State Transfer donor: Resource temporarily unavailable"), + ("WSREP: Could not find peer"), + ("WSREP: discarding established \\(time wait\\)"), + ("sending install message failed: Resource temporarily unavailable"), + ("WSREP: Ignoring possible split-brain \\(allowed by configuration\\) from view"), + ("WSREP: no nodes coming from prim view, prim not possible"), + ("WSREP: Failed to prepare for incremental state transfer: Local state seqno is undefined:"), + ("WSREP: gcs_caused\\(\\) returned -107 \\(Transport endpoint is not connected\\)"), + ("WSREP: gcs_caused\\(\\) returned -1 \\(Operation not permitted\\)"), + ("WSREP: Action message in non-primary configuration from member 0"), + ("InnoDB: Resizing redo log from"), + ("InnoDB: Starting to delete and rewrite log files"), + ("InnoDB: New log files created, LSN="), + ("THE_LAST_SUPPRESSION")|| @@ -292,7 +332,17 @@ BEGIN END IF; -- Cleanup for next test - TRUNCATE test_suppressions; + IF @@wsrep_on = 1 THEN + -- The TRUNCATE should not be replicated under Galera + -- as it causes the custom suppressions on the other + -- nodes to be deleted as well + SET wsrep_on = 0; + TRUNCATE test_suppressions; + SET wsrep_on = 1; + ELSE + TRUNCATE test_suppressions; + END IF; + DROP TABLE error_log; END|| diff --git a/mysql-wsrep-5.6/mysql-test/include/mysqld--help.inc b/mysql-wsrep-5.6/mysql-test/include/mysqld--help.inc index e156cfd6..8b3b387f 100644 --- a/mysql-wsrep-5.6/mysql-test/include/mysqld--help.inc +++ b/mysql-wsrep-5.6/mysql-test/include/mysqld--help.inc @@ -18,7 +18,7 @@ perl; # their paths may vary: @skipvars=qw/basedir open-files-limit general-log-file plugin-dir pid-file slow-query-log-file - datadir slave-load-tmpdir tmpdir socket table-definition-cache table-open-cache/; + datadir slave-load-tmpdir tmpdir socket table-definition-cache table-open-cache wsrep-node-name/; # Plugins which may or may not be there: @plugins=qw/innodb ndb ndbinfo archive blackhole federated partition ndbcluster debug temp-pool ssl des-key-file diff --git a/mysql-wsrep-5.6/mysql-test/suite/perfschema/include/no_protocol.inc b/mysql-wsrep-5.6/mysql-test/include/no_protocol.inc similarity index 89% rename from mysql-wsrep-5.6/mysql-test/suite/perfschema/include/no_protocol.inc rename to mysql-wsrep-5.6/mysql-test/include/no_protocol.inc index 451c22f6..8ffd3509 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/perfschema/include/no_protocol.inc +++ b/mysql-wsrep-5.6/mysql-test/include/no_protocol.inc @@ -1,5 +1,3 @@ -# Tests for the performance schema - # The file with expected results fits only to a run without # ps-protocol/sp-protocol/cursor-protocol/view-protocol. if (`SELECT $PS_PROTOCOL + $SP_PROTOCOL + $CURSOR_PROTOCOL diff --git a/mysql-wsrep-5.6/mysql-test/include/not_wsrep.inc b/mysql-wsrep-5.6/mysql-test/include/not_wsrep.inc new file mode 100644 index 00000000..3314b5c8 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/include/not_wsrep.inc @@ -0,0 +1,7 @@ +# To be used in a test which should be skipped if server is compiled with wsrep +# support (-DWITH_WSREP=ON) and wsrep plugin is ACTIVE. + +-- require r/not_wsrep.require +disable_query_log; +SELECT VERSION() LIKE '%wsrep%' AS 'HAVE_WSREP'; +enable_query_log; diff --git a/mysql-wsrep-5.6/mysql-test/include/plugin.defs b/mysql-wsrep-5.6/mysql-test/include/plugin.defs index f5818cd3..a1a378a9 100644 --- a/mysql-wsrep-5.6/mysql-test/include/plugin.defs +++ b/mysql-wsrep-5.6/mysql-test/include/plugin.defs @@ -45,3 +45,4 @@ libdaemon_example plugin/daemon_example DAEMONEXAMPLE libmemcached plugin/innodb_memcached/daemon_memcached DAEMON_MEMCACHED daemon_memcached innodb_engine plugin/innodb_memcached/innodb_memcache INNODB_ENGINE validate_password plugin/password_validation VALIDATE_PASSWORD validate_password +mysql_no_login plugin/mysql_no_login MYSQL_NO_LOGIN mysql_no_login diff --git a/mysql-wsrep-5.6/mysql-test/include/range.inc b/mysql-wsrep-5.6/mysql-test/include/range.inc index f59e3ed1..e8c01f05 100644 --- a/mysql-wsrep-5.6/mysql-test/include/range.inc +++ b/mysql-wsrep-5.6/mysql-test/include/range.inc @@ -1796,3 +1796,44 @@ eval $query_ba; --echo DROP TABLE t1,t2; +--echo # +--echo # Bug #20229614: OR CONDITIONS ON MULTI-COLUMN INDEX MAY NOT USE ALL +--echo # INDEX COLUMNS TO FILTER ROWS +--echo # + +CREATE TABLE t1 ( + c1 INT, + c2 INT, + c3 INT, + PRIMARY KEY(c1, c2, c3) +) ENGINE=INNODB; + +INSERT INTO t1 VALUES (1, 1, 1), (1, 1, 2), (1, 1, 3), + (1, 1, 4), (1, 1, 5); +INSERT INTO t1 SELECT c1, 2, c3 FROM t1; +INSERT INTO t1 SELECT c1, 3, c3 FROM t1 WHERE c2 = 1; + +SELECT COUNT(*) FROM t1; + +EXPLAIN SELECT c1, c2, c3 + FROM t1 + WHERE (c1 = 1 AND c2 = 1 AND c3 = 1) OR + (c1 = 1 AND c2 = 2 AND c3 = 2) OR + (c1 = 1 AND c2 = 2 AND c3 = 3); +DROP TABLE t1; + + +--echo # +--echo # Bug#21139683: ASSERTION FAILED: TYPE_ARG == MAYBE_KEY || +--echo # TYPE_ARG == IMPOSSIBLE +--echo # + +CREATE TABLE t1 ( + a BLOB, + PRIMARY KEY(a(1)), + KEY(a(1)) +) ENGINE=INNODB; + +SELECT 1 FROM t1 WHERE a <> 'a' OR a <> ""; + +DROP TABLE t1; \ No newline at end of file diff --git a/mysql-wsrep-5.6/mysql-test/include/rpl_init.inc b/mysql-wsrep-5.6/mysql-test/include/rpl_init.inc index f0f6e32f..ade2e580 100644 --- a/mysql-wsrep-5.6/mysql-test/include/rpl_init.inc +++ b/mysql-wsrep-5.6/mysql-test/include/rpl_init.inc @@ -252,12 +252,15 @@ if ($rpl_check_server_ids) } } -# $rpl_master_list must be set so that include/rpl_change_topology.inc -# knows which servers are initialized and not. -if (!`SELECT COUNT(*) = 0 OR VARIABLE_VALUE != 'ON' FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME = 'GTID_MODE'`) +if ($use_gtids == '') { - --let $use_gtids=1 + if (!`SELECT COUNT(*) = 0 OR VARIABLE_VALUE != 'ON' FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME = 'GTID_MODE'`) + { + --let $use_gtids=1 + } } +# $rpl_master_list must be set so that include/rpl_change_topology.inc +# knows which servers are initialized and not. --let $rpl_master_list= `SELECT REPEAT('x', $rpl_server_count * LENGTH($rpl_server_count))` --source include/rpl_change_topology.inc diff --git a/mysql-wsrep-5.6/mysql-test/include/start_mysqld.inc b/mysql-wsrep-5.6/mysql-test/include/start_mysqld.inc index 983c5668..4ee3d178 100644 --- a/mysql-wsrep-5.6/mysql-test/include/start_mysqld.inc +++ b/mysql-wsrep-5.6/mysql-test/include/start_mysqld.inc @@ -1,7 +1,16 @@ # Include this script only after using shutdown_mysqld.inc # where $_expect_file_name was initialized. # Write file to make mysql-test-run.pl start up the server again ---exec echo "restart" > $_expect_file_name + +if ($galera_wsrep_start_position != '') { + --echo Using --wsrep-start-position when starting mysqld ... + --exec echo "restart:$start_mysqld_params --wsrep-start-position=$galera_wsrep_start_position" > $_expect_file_name + --let $galera_wsrep_start_position = 0 +} + +if ($galera_wsrep_start_position == '') { + --exec echo "restart:$start_mysqld_params" > $_expect_file_name +} # Turn on reconnect --enable_reconnect @@ -11,4 +20,3 @@ # Turn off reconnect again --disable_reconnect - diff --git a/mysql-wsrep-5.6/mysql-test/include/subquery_mat.inc b/mysql-wsrep-5.6/mysql-test/include/subquery_mat.inc index 15de01bc..f88faed8 100644 --- a/mysql-wsrep-5.6/mysql-test/include/subquery_mat.inc +++ b/mysql-wsrep-5.6/mysql-test/include/subquery_mat.inc @@ -1457,6 +1457,8 @@ eval $query; ALTER TABLE t1 MODIFY a VARCHAR(332) CHARACTER SET UTF8; --enable_warnings +ANALYZE TABLE t1; + # Now subquery materialization can be used, and result is still correct: eval EXPLAIN $query; eval $query; diff --git a/mysql-wsrep-5.6/mysql-test/include/subquery_sj.inc b/mysql-wsrep-5.6/mysql-test/include/subquery_sj.inc index 208932cb..8a95c37c 100644 --- a/mysql-wsrep-5.6/mysql-test/include/subquery_sj.inc +++ b/mysql-wsrep-5.6/mysql-test/include/subquery_sj.inc @@ -6522,6 +6522,83 @@ p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); DROP TABLE t1,t2; +--echo # +--echo # Bug#18194196: OPTIMIZER EXECUTES STATEMENT INPERFORMANT +--echo # + +CREATE TABLE t1 (uid INTEGER, fid INTEGER, INDEX(uid)); +INSERT INTO t1 VALUES +(1,1), (1,2), (1,3), (1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); + +CREATE TABLE t2 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t2 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); + +CREATE TABLE t3 (uid INT, fid INT, INDEX(uid)); +INSERT INTO t3 VALUES +(1,1), (1,2), (1,3),(1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); + +CREATE TABLE t4 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t4 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); + +ANALYZE TABLE t1,t2,t3,t4; + +EXPLAIN SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; + +FLUSH STATUS; + +SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; + +SHOW STATUS LIKE '%handler_read%'; + +DROP TABLE t1,t2,t3,t4; + +--echo # End of test for Bug#18194196 + +--echo # +--echo # Bug#21184091 ASSERT `READ_ROWS >= 0.0' AT +--echo # COST_MODEL_SERVER::TMPTABLE_READWRITE_COST() +--echo # + +CREATE TABLE t1 ( + col_int int(11), + pk int(11) NOT NULL, + col_int_key int(11) , + col_varchar varchar(1), + PRIMARY KEY (pk) +) ENGINE=MyISAM; + +CREATE TABLE t2 ( + col_int int(11), + col_varchar varchar(1) +) ENGINE=MyISAM; + +INSERT INTO t2 VALUES (19,'x'); +INSERT INTO t2 VALUES (20,'z'); + +SELECT table1.col_varchar +FROM (t2 AS table1 RIGHT JOIN + ((t2 STRAIGHT_JOIN t1 ON (t1.col_varchar = t2.col_varchar))) + ON (t1.pk = t2.col_int)) +WHERE (t1.pk IN (SELECT t1.col_int_key + FROM (t1 INNER JOIN t2 ON (t2.col_int = t1.col_int)))) +AND table1.col_varchar != 'q'; + +DROP TABLE t1,t2; + +--echo # End of test for Bug#21184091 + set @@optimizer_switch=@old_opt_switch; # New tests go here. diff --git a/mysql-wsrep-5.6/mysql-test/include/wait_condition.inc b/mysql-wsrep-5.6/mysql-test/include/wait_condition.inc index 34bc59fb..de53fb59 100644 --- a/mysql-wsrep-5.6/mysql-test/include/wait_condition.inc +++ b/mysql-wsrep-5.6/mysql-test/include/wait_condition.inc @@ -39,6 +39,7 @@ let $wait_timeout= 0; let $wait_condition_reps= 0; while ($wait_counter) { + --error 0,ER_NO_SUCH_TABLE,ER_LOCK_WAIT_TIMEOUT,ER_UNKNOWN_COM_ERROR let $success= `$wait_condition`; inc $wait_condition_reps; if ($success) diff --git a/mysql-wsrep-5.6/mysql-test/include/wait_for_ndb_to_binlog.inc b/mysql-wsrep-5.6/mysql-test/include/wait_for_ndb_to_binlog.inc deleted file mode 100644 index c1f94802..00000000 --- a/mysql-wsrep-5.6/mysql-test/include/wait_for_ndb_to_binlog.inc +++ /dev/null @@ -1,26 +0,0 @@ -# ==== Purpose ==== -# -# Several test primitives from mysql-test/extra/rpl_tests -# are shared for test cases for MyISAM, InnoDB, NDB and -# other engines. -# For NDB engine all events will be added by NDB injector -# so tests only can continue after injector is ready, -# this test waits for proper injector thread state. -# -# ==== Usage ==== -# -# let $engine_type= NDB; -# --source include/wait_for_ndb_to_binlog.inc -# -# ==== Parameters ===== -# -# $engine_type -# Type of engine. If type is NDB then it waits for injector -# thread proper state. - -if (`SELECT UPPER(LEFT('$engine_type',3)) = 'NDB'`) { - let $show_statement= SHOW PROCESSLIST; - let $field= State; - let $condition= = 'Waiting for event from ndbcluster'; - source include/wait_show_condition.inc; -} diff --git a/mysql-wsrep-5.6/mysql-test/include/wait_for_slave_to_sync_with_master.inc b/mysql-wsrep-5.6/mysql-test/include/wait_for_slave_to_sync_with_master.inc new file mode 100644 index 00000000..bae56fbf --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/include/wait_for_slave_to_sync_with_master.inc @@ -0,0 +1,27 @@ +# +# Similar to sync_slave_with_master but supports a configurable timeout +# let $slave_sync_timeout = 300; +# source include/wait_for_slave_to_sync_with_master; +# + +connection slave; +stop slave; +start slave; + +connection master; + +let $file = query_get_value(SHOW MASTER STATUS, File, 1); +let $pos = query_get_value(SHOW MASTER STATUS, Position, 1); + +connection slave; +--disable_result_log +--disable_query_log +eval select master_pos_wait("$file", $pos, $slave_sync_timeout); +--enable_result_log +--enable_query_log + +connection master; +sync_slave_with_master; + +connection master; + diff --git a/mysql-wsrep-5.6/mysql-test/include/wait_until_connected_again.inc b/mysql-wsrep-5.6/mysql-test/include/wait_until_connected_again.inc index c7bb7749..c45917e7 100644 --- a/mysql-wsrep-5.6/mysql-test/include/wait_until_connected_again.inc +++ b/mysql-wsrep-5.6/mysql-test/include/wait_until_connected_again.inc @@ -1,23 +1,34 @@ # # Include this script to wait until the connection to the # server has been restored or timeout occurs + +# +# We require two consequtive connection successes in order to +# work around a race condition on Galera startup where the server +# can temporarily accept queries before starting to reject them again +# + --disable_result_log --disable_query_log -let $counter= 500; +let $counter= 1200; let $mysql_errno= 9999; -while ($mysql_errno) -{ - # Strangely enough, the server might return "Too many connections" - # while being shutdown, thus 1040 is an "allowed" error - # See BUG#36228 - --error 0,1040,1053,2002,2003,2006,2013 - show status; +let $successes= 2; + +while ($successes) { + while ($mysql_errno) { + # Strangely enough, the server might return "Too many connections" + # while being shutdown, thus 1040 is an "allowed" error + # See BUG#36228 + --error 0,1040,1047,1053,1205,2002,2003,2006,2013,1205 + show status; - dec $counter; - if (!$counter) - { - --die Server failed to restart + --dec $counter + if (!$counter) { + --die Server failed to restart + } + --sleep 0.1 } + --dec $successes --sleep 0.1 } --enable_query_log diff --git a/mysql-wsrep-5.6/mysql-test/include/wait_until_disconnected.inc b/mysql-wsrep-5.6/mysql-test/include/wait_until_disconnected.inc index 8a989bec..56889d14 100644 --- a/mysql-wsrep-5.6/mysql-test/include/wait_until_disconnected.inc +++ b/mysql-wsrep-5.6/mysql-test/include/wait_until_disconnected.inc @@ -7,7 +7,7 @@ let $counter= 500; let $mysql_errno= 0; while (!$mysql_errno) { - --error 0,1040,1053,2002,2003,2006,2013 + --error 0,1040,1047,1053,2002,2003,2006,2013 show status; dec $counter; diff --git a/mysql-wsrep-5.6/mysql-test/include/write_var_to_file.inc b/mysql-wsrep-5.6/mysql-test/include/write_var_to_file.inc index 8bb9e728..6ee04c7c 100644 --- a/mysql-wsrep-5.6/mysql-test/include/write_var_to_file.inc +++ b/mysql-wsrep-5.6/mysql-test/include/write_var_to_file.inc @@ -54,7 +54,7 @@ if (`SELECT LENGTH(@@secure_file_priv) > 0`) --copy_file $_wvtf_tmp_file $write_to_file --remove_file $_wvtf_tmp_file } -if (`SELECT LENGTH(@@secure_file_priv) = 0`) +if (`SELECT LENGTH(@@secure_file_priv) = 0 OR LENGTH(@@secure_file_priv) IS NULL`) { --eval SELECT '$write_var' INTO DUMPFILE '$write_to_file' } diff --git a/mysql-wsrep-5.6/mysql-test/lib/My/Config.pm b/mysql-wsrep-5.6/mysql-test/lib/My/Config.pm index 535df078..642ee0a3 100644 --- a/mysql-wsrep-5.6/mysql-test/lib/My/Config.pm +++ b/mysql-wsrep-5.6/mysql-test/lib/My/Config.pm @@ -178,6 +178,36 @@ sub if_exist { return $option->value(); } +package My::Config::Group::ENV; +our @ISA=qw(My::Config::Group); + +use strict; +use warnings; +use Carp; + +sub new { + my ($class, $group_name)= @_; + bless My::Config::Group->new($group_name), $class; +} + +# +# Return value for an option in the group, fail if it does not exist +# +sub value { + my ($self, $option_name)= @_; + my $option= $self->option($option_name); + + if (! defined($option) and defined $ENV{$option_name}) { + my $value= $ENV{$option_name}; + $option= My::Config::Option->new($option_name, $value); + } + + croak "No option named '$option_name' in group '$self->{name}'" + if ! defined($option); + + return $option->value(); +} + package My::Config; @@ -197,7 +227,9 @@ sub new { my ($class, $path)= @_; my $group_name= undef; - my $self= bless { groups => [] }, $class; + my $self= bless { groups => [ + My::Config::Group::ENV->new('ENV') + ] }, $class; my $F= IO::File->new($path, "<") or croak "Could not open '$path': $!"; diff --git a/mysql-wsrep-5.6/mysql-test/lib/My/ConfigFactory.pm b/mysql-wsrep-5.6/mysql-test/lib/My/ConfigFactory.pm index bf2a8fad..fca7f9d1 100644 --- a/mysql-wsrep-5.6/mysql-test/lib/My/ConfigFactory.pm +++ b/mysql-wsrep-5.6/mysql-test/lib/My/ConfigFactory.pm @@ -1,5 +1,5 @@ # -*- cperl -*- -# Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2011, Oracle and/or its affiliates # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public @@ -31,12 +31,22 @@ use File::Basename; # # Rules to run first of all # + +sub add_opt_values { + my ($self, $config)= @_; + + # add auto-options + $config->insert('OPT', 'port' => sub { fix_port($self, $config) }); + $config->insert('mysqld', "loose-skip-plugin-$_" => undef) for (@::optional_plugins); +} + my @pre_rules= ( + \&add_opt_values, ); -my @share_locations= ("share/mysql", "sql/share", "share"); +my @share_locations= ("share/mariadb", "share/mysql", "sql/share", "share"); sub get_basedir { @@ -89,16 +99,12 @@ sub fix_pidfile { sub fix_port { my ($self, $config, $group_name, $group)= @_; - my $hostname= $group->value('#host'); - return $self->{HOSTS}->{$hostname}++; + return $self->{PORT}++; } sub fix_host { my ($self)= @_; - # Get next host from HOSTS array - my @hosts= keys(%{$self->{HOSTS}});; - my $host_no= $self->{NEXT_HOST}++ % @hosts; - return $hosts[$host_no]; + 'localhost' } sub is_unique { @@ -169,13 +175,6 @@ sub fix_log_slow_queries { return "$dir/mysqld-slow.log"; } -sub fix_secure_file_priv { - my ($self)= @_; - my $vardir= $self->{ARGS}->{vardir}; - # By default, prevent the started mysqld to access files outside of vardir - return $vardir; -} - sub fix_std_data { my ($self, $config, $group_name, $group)= @_; my $testdir= $self->get_testdir($group); @@ -239,12 +238,18 @@ my @mysqld_rules= { 'pid-file' => \&fix_pidfile }, { '#host' => \&fix_host }, { 'port' => \&fix_port }, + # galera base_port and port used during SST + { '#galera_port' => \&fix_port }, + # Galera uses base_port + 1 for IST, so we do not use it for things such as SST + { '#ist_port' => \&fix_port }, + { '#sst_port' => \&fix_port }, { 'socket' => \&fix_socket }, { '#log-error' => \&fix_log_error }, - { 'general_log' => 1 }, - { 'general_log_file' => \&fix_log }, - { 'slow_query_log' => 1 }, - { 'slow_query_log_file' => \&fix_log_slow_queries }, + { 'general-log' => 1 }, + { 'plugin-dir' => sub { $::plugindir } }, + { 'general-log-file' => \&fix_log }, + { 'slow-query-log' => 1 }, + { 'slow-query-log-file' => \&fix_log_slow_queries }, { '#user' => sub { return shift->{ARGS}->{user} || ""; } }, { '#password' => sub { return shift->{ARGS}->{password} || ""; } }, { 'server-id' => \&fix_server_id, }, @@ -265,7 +270,7 @@ if (IS_WINDOWS) sub fix_ndb_mgmd_port { my ($self, $config, $group_name, $group)= @_; my $hostname= $group->value('HostName'); - return $self->{HOSTS}->{$hostname}++; + return $self->{PORT}++; } @@ -307,8 +312,6 @@ my @ndbd_rules= { 'BackupDataDir' => \&fix_cluster_backup_dir }, ); - -# # Rules to run for each memcached in the config # - will be run in order listed here # @@ -396,7 +399,7 @@ sub post_check_client_group { if (! defined $option){ #print $config; - croak "Could not get value for '$name_from'"; + croak "Could not get value for '$name_from' for test $self->{testname}"; } $config->insert($client_group_name, $name_to, $option->value()) } @@ -419,7 +422,7 @@ sub post_check_client_group { sub post_check_client_groups { my ($self, $config)= @_; - my $first_mysqld= $config->first_like('mysqld.'); + my $first_mysqld= $config->first_like('mysqld\.'); return unless $first_mysqld; @@ -455,7 +458,7 @@ sub post_check_embedded_group { my $first_mysqld= $config->first_like('mysqld.') or croak "Can't run with embedded, config has no mysqld"; - my @no_copy = + my %no_copy = map { $_ => 1 } ( '#log-error', # Embedded server writes stderr to mysqltest's log file 'slave-net-timeout', # Embedded server are not build with replication @@ -464,7 +467,7 @@ sub post_check_embedded_group { foreach my $option ( $mysqld->options(), $first_mysqld->options() ) { # Don't copy options whose name is in "no_copy" list - next if grep ( $option->name() eq $_, @no_copy); + next if $no_copy{$option->name()}; $config->insert('embedded', $option->name(), $option->value()) } @@ -474,20 +477,24 @@ sub post_check_embedded_group { sub resolve_at_variable { my ($self, $config, $group, $option)= @_; + local $_ = $option->value(); + my ($res, $after); - # Split the options value on last . - my @parts= split(/\./, $option->value()); - my $option_name= pop(@parts); - my $group_name= join('.', @parts); - - $group_name =~ s/^\@//; # Remove at + while (m/(.*?)\@((?:\w+\.)+)(#?[-\w]+)/g) { + my ($before, $group_name, $option_name)= ($1, $2, $3); + $after = $'; + chop($group_name); my $from_group= $config->group($group_name) or croak "There is no group named '$group_name' that ", - "can be used to resolve '$option_name'"; + "can be used to resolve '$option_name' for test '$self->{testname}'"; - my $from= $from_group->value($option_name); - $config->insert($group->name(), $option->name(), $from) + my $value= $from_group->value($option_name); + $res .= $before.$value; + } + $res .= $after; + + $config->insert($group->name(), $option->name(), $res) } @@ -499,7 +506,7 @@ sub post_fix_resolve_at_variables { next unless defined $option->value(); $self->resolve_at_variable($config, $group, $option) - if ($option->value() =~ /^\@/); + if ($option->value() =~ /\@/); } } } @@ -641,37 +648,21 @@ sub new_config { croak "you must pass '$required'" unless defined $args->{$required}; } - # Fill in hosts/port hash - my $hosts= {}; - my $baseport= $args->{baseport}; - $args->{hosts}= [ 'localhost' ] unless exists($args->{hosts}); - foreach my $host ( @{$args->{hosts}} ) { - $hosts->{$host}= $baseport; - } - # Open the config template my $config= My::Config->new($args->{'template_path'}); - my $extra_template_path= $args->{'extra_template_path'}; - if ($extra_template_path){ - $config->append(My::Config->new($extra_template_path)); - } my $self= bless { CONFIG => $config, ARGS => $args, - HOSTS => $hosts, - NEXT_HOST => 0, + PORT => $args->{baseport}, SERVER_ID => 1, + testname => $args->{testname}, }, $class; - - { - # Run pre rules - foreach my $rule ( @pre_rules ) { - &$rule($self, $config); - } + # Run pre rules + foreach my $rule ( @pre_rules ) { + &$rule($self, $config); } - $self->run_section_rules($config, 'cluster_config\.\w*$', @cluster_config_rules); @@ -689,9 +680,9 @@ sub new_config { @mysqld_rules); $self->run_section_rules($config, - 'memcached.', - @memcached_rules); - + 'memcached.', + @memcached_rules); + # [mysqlbinlog] need additional settings $self->run_rules_for_group($config, $config->insert('mysqlbinlog'), diff --git a/mysql-wsrep-5.6/mysql-test/lib/My/ConfigFactory.pm.memcached b/mysql-wsrep-5.6/mysql-test/lib/My/ConfigFactory.pm.memcached new file mode 100644 index 00000000..0b0e4688 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/lib/My/ConfigFactory.pm.memcached @@ -0,0 +1,718 @@ +# -*- cperl -*- +# Copyright (c) 2007, 2011, Oracle and/or its affiliates +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; version 2 +# of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU 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 + +package My::ConfigFactory; + +use strict; +use warnings; +use Carp; + +use My::Config; +use My::Find; +use My::Platform; + +use File::Basename; + + +# +# Rules to run first of all +# + +sub add_opt_values { + my ($self, $config)= @_; + + # add auto-options + $config->insert('OPT', 'port' => sub { fix_port($self, $config) }); + $config->insert('mysqld', "loose-skip-plugin-$_" => undef) for (@::optional_plugins); +} + +my @pre_rules= +( + \&add_opt_values, +); + + +my @share_locations= ("share/mariadb", "share/mysql", "sql/share", "share"); + + +sub get_basedir { + my ($self, $group)= @_; + my $basedir= $group->if_exist('basedir') || + $self->{ARGS}->{basedir}; + return $basedir; +} + +sub get_testdir { + my ($self, $group)= @_; + my $testdir= $group->if_exist('testdir') || + $self->{ARGS}->{testdir}; + return $testdir; +} + +# Retrive build directory (which is different from basedir in out-of-source build) +sub get_bindir { + if (defined $ENV{MTR_BINDIR}) + { + return $ENV{MTR_BINDIR}; + } + my ($self, $group)= @_; + return $self->get_basedir($group); +} + +sub fix_charset_dir { + my ($self, $config, $group_name, $group)= @_; + return my_find_dir($self->get_basedir($group), + \@share_locations, "charsets"); +} + +sub fix_language { + my ($self, $config, $group_name, $group)= @_; + return my_find_dir($self->get_bindir($group), + \@share_locations); +} + +sub fix_datadir { + my ($self, $config, $group_name)= @_; + my $vardir= $self->{ARGS}->{vardir}; + return "$vardir/$group_name/data"; +} + +sub fix_pidfile { + my ($self, $config, $group_name, $group)= @_; + my $vardir= $self->{ARGS}->{vardir}; + return "$vardir/run/$group_name.pid"; +} + +sub fix_port { + my ($self, $config, $group_name, $group)= @_; + return $self->{PORT}++; +} + +sub fix_host { + my ($self)= @_; + 'localhost' +} + +sub is_unique { + my ($config, $name, $value)= @_; + + foreach my $group ( $config->groups() ) { + if ($group->option($name)) { + if ($group->value($name) eq $value){ + return 0; + } + } + } + return 1; +} + +sub fix_server_id { + my ($self, $config, $group_name, $group)= @_; +#define in the order that mysqlds are listed in my.cnf + + my $server_id= $group->if_exist('server-id'); + if (defined $server_id){ + if (!is_unique($config, 'server-id', $server_id)) { + croak "The server-id($server_id) for '$group_name' is not unique"; + } + return $server_id; + } + + do { + $server_id= $self->{SERVER_ID}++; + } while(!is_unique($config, 'server-id', $server_id)); + + #print "$group_name: server_id: $server_id\n"; + return $server_id; +} + +sub fix_socket { + my ($self, $config, $group_name, $group)= @_; + # Put socket file in tmpdir + my $dir= $self->{ARGS}->{tmpdir}; + return "$dir/$group_name.sock"; +} + +sub fix_tmpdir { + my ($self, $config, $group_name, $group)= @_; + my $dir= $self->{ARGS}->{tmpdir}; + return "$dir/$group_name"; +} + +sub fix_log_error { + my ($self, $config, $group_name, $group)= @_; + my $dir= $self->{ARGS}->{vardir}; + if ( $::opt_valgrind and $::opt_debug ) { + return "$dir/log/$group_name.trace"; + } else { + return "$dir/log/$group_name.err"; + } +} + +sub fix_log { + my ($self, $config, $group_name, $group)= @_; + my $dir= dirname($group->value('datadir')); + return "$dir/mysqld.log"; +} + +sub fix_log_slow_queries { + my ($self, $config, $group_name, $group)= @_; + my $dir= dirname($group->value('datadir')); + return "$dir/mysqld-slow.log"; +} + +sub fix_std_data { + my ($self, $config, $group_name, $group)= @_; + my $testdir= $self->get_testdir($group); + return "$testdir/std_data"; +} + +sub ssl_supported { + my ($self)= @_; + return $self->{ARGS}->{ssl}; +} + +sub fix_skip_ssl { + return if !ssl_supported(@_); + # Add skip-ssl if ssl is supported to avoid + # that mysqltest connects with SSL by default + return 1; +} + +sub fix_ssl_ca { + return if !ssl_supported(@_); + my $std_data= fix_std_data(@_); + return "$std_data/cacert.pem" +} + +sub fix_ssl_server_cert { + return if !ssl_supported(@_); + my $std_data= fix_std_data(@_); + return "$std_data/server-cert.pem" +} + +sub fix_ssl_client_cert { + return if !ssl_supported(@_); + my $std_data= fix_std_data(@_); + return "$std_data/client-cert.pem" +} + +sub fix_ssl_server_key { + return if !ssl_supported(@_); + my $std_data= fix_std_data(@_); + return "$std_data/server-key.pem" +} + +sub fix_ssl_client_key { + return if !ssl_supported(@_); + my $std_data= fix_std_data(@_); + return "$std_data/client-key.pem" +} + + +# +# Rules to run for each mysqld in the config +# - will be run in order listed here +# +my @mysqld_rules= + ( + { 'basedir' => sub { return shift->{ARGS}->{basedir}; } }, + { 'tmpdir' => \&fix_tmpdir }, + { 'character-sets-dir' => \&fix_charset_dir }, + { 'lc-messages-dir' => \&fix_language }, + { 'datadir' => \&fix_datadir }, + { 'pid-file' => \&fix_pidfile }, + { '#host' => \&fix_host }, + { 'port' => \&fix_port }, + # galera base_port and port used during SST + { '#galera_port' => \&fix_port }, + { '#sst_port' => \&fix_port }, + { '#memcached_port' => \&fix_port }, + { 'socket' => \&fix_socket }, + { '#log-error' => \&fix_log_error }, + { 'general-log' => 1 }, + { 'plugin-dir' => sub { $::plugindir } }, + { 'general-log-file' => \&fix_log }, + { 'slow-query-log' => 1 }, + { 'slow-query-log-file' => \&fix_log_slow_queries }, + { '#user' => sub { return shift->{ARGS}->{user} || ""; } }, + { '#password' => sub { return shift->{ARGS}->{password} || ""; } }, + { 'server-id' => \&fix_server_id, }, + # By default, prevent the started mysqld to access files outside of vardir + { 'secure-file-priv' => sub { return shift->{ARGS}->{vardir}; } }, + { 'ssl-ca' => \&fix_ssl_ca }, + { 'ssl-cert' => \&fix_ssl_server_cert }, + { 'ssl-key' => \&fix_ssl_server_key }, + ); + +if (IS_WINDOWS) +{ + # For simplicity, we use the same names for shared memory and + # named pipes. + push(@mysqld_rules, {'shared-memory-base-name' => \&fix_socket}); +} + +sub fix_ndb_mgmd_port { + my ($self, $config, $group_name, $group)= @_; + my $hostname= $group->value('HostName'); + return $self->{PORT}++; +} + + +sub fix_cluster_dir { + my ($self, $config, $group_name, $group)= @_; + my $vardir= $self->{ARGS}->{vardir}; + my (undef, $process_type, $idx, $suffix)= split(/\./, $group_name); + return "$vardir/mysql_cluster.$suffix/$process_type.$idx"; +} + + +sub fix_cluster_backup_dir { + my ($self, $config, $group_name, $group)= @_; + my $vardir= $self->{ARGS}->{vardir}; + my (undef, $process_type, $idx, $suffix)= split(/\./, $group_name); + return "$vardir/mysql_cluster.$suffix/"; +} + + +# +# Rules to run for each ndb_mgmd in the config +# - will be run in order listed here +# +my @ndb_mgmd_rules= +( + { 'PortNumber' => \&fix_ndb_mgmd_port }, + { 'DataDir' => \&fix_cluster_dir }, +); + + +# +# Rules to run for each ndbd in the config +# - will be run in order listed here +# +my @ndbd_rules= +( + { 'HostName' => \&fix_host }, + { 'DataDir' => \&fix_cluster_dir }, + { 'BackupDataDir' => \&fix_cluster_backup_dir }, +); + +# Rules to run for each memcached in the config +# - will be run in order listed here +# +my @memcached_rules= +( + { '#host' => \&fix_host }, + { 'port' => \&fix_port }, +); + +# +# Rules to run for each cluster_config section +# - will be run in order listed here +# +my @cluster_config_rules= +( + { 'ndb_mgmd' => \&fix_host }, + { 'ndbd' => \&fix_host }, + { 'mysqld' => \&fix_host }, + { 'ndbapi' => \&fix_host }, +); + + +# +# Rules to run for [client] section +# - will be run in order listed here +# +my @client_rules= +( +); + + +# +# Rules to run for [mysqltest] section +# - will be run in order listed here +# +my @mysqltest_rules= +( + { 'ssl-ca' => \&fix_ssl_ca }, + { 'ssl-cert' => \&fix_ssl_client_cert }, + { 'ssl-key' => \&fix_ssl_client_key }, + { 'skip-ssl' => \&fix_skip_ssl }, +); + + +# +# Rules to run for [mysqlbinlog] section +# - will be run in order listed here +# +my @mysqlbinlog_rules= +( + { 'character-sets-dir' => \&fix_charset_dir }, +); + + +# +# Rules to run for [mysql_upgrade] section +# - will be run in order listed here +# +my @mysql_upgrade_rules= +( + { 'tmpdir' => sub { return shift->{ARGS}->{tmpdir}; } }, +); + + +# +# Generate a [client.] group to be +# used for connecting to [mysqld.] +# +sub post_check_client_group { + my ($self, $config, $client_group_name, $mysqld_group_name)= @_; + + + # Settings needed for client, copied from its "mysqld" + my %client_needs= + ( + port => 'port', + socket => 'socket', + host => '#host', + user => '#user', + password => '#password', + ); + my $group_to_copy_from= $config->group($mysqld_group_name); + while (my ($name_to, $name_from)= each( %client_needs )) { + my $option= $group_to_copy_from->option($name_from); + + if (! defined $option){ + #print $config; + croak "Could not get value for '$name_from' for test $self->{testname}"; + } + $config->insert($client_group_name, $name_to, $option->value()) + } + + if (IS_WINDOWS) + { + if (! $self->{ARGS}->{embedded}) + { + # Shared memory base may or may not be defined (e.g not defined in embedded) + my $shm = $group_to_copy_from->option("shared-memory-base-name"); + if (defined $shm) + { + $config->insert($client_group_name,"shared-memory-base-name", $shm->value()); + } + } + } +} + + +sub post_check_client_groups { + my ($self, $config)= @_; + + my $first_mysqld= $config->first_like('mysqld\.'); + + return unless $first_mysqld; + + # Always generate [client] pointing to the first + # [mysqld.] + $self->post_check_client_group($config, + 'client', + $first_mysqld->name()); + + # Then generate [client.] for each [mysqld.] + foreach my $mysqld ( $config->like('mysqld.') ) { + $self->post_check_client_group($config, + 'client'.$mysqld->after('mysqld'), + $mysqld->name()) + } + +} + + +# +# Generate [embedded] by copying the values +# needed from the default [mysqld] section +# and from first [mysqld.] +# +sub post_check_embedded_group { + my ($self, $config)= @_; + + return unless $self->{ARGS}->{embedded}; + + my $mysqld= $config->group('mysqld') or + croak "Can't run with embedded, config has no default mysqld section"; + + my $first_mysqld= $config->first_like('mysqld.') or + croak "Can't run with embedded, config has no mysqld"; + + my %no_copy = map { $_ => 1 } + ( + '#log-error', # Embedded server writes stderr to mysqltest's log file + 'slave-net-timeout', # Embedded server are not build with replication + 'shared-memory-base-name', # No shared memory for embedded + ); + + foreach my $option ( $mysqld->options(), $first_mysqld->options() ) { + # Don't copy options whose name is in "no_copy" list + next if $no_copy{$option->name()}; + + $config->insert('embedded', $option->name(), $option->value()) + } + +} + + +sub resolve_at_variable { + my ($self, $config, $group, $option)= @_; + local $_ = $option->value(); + my ($res, $after); + + while (m/(.*?)\@((?:\w+\.)+)(#?[-\w]+)/g) { + my ($before, $group_name, $option_name)= ($1, $2, $3); + $after = $'; + chop($group_name); + + my $from_group= $config->group($group_name) + or croak "There is no group named '$group_name' that ", + "can be used to resolve '$option_name' for test '$self->{testname}'"; + + my $value= $from_group->value($option_name); + $res .= $before.$value; + } + $res .= $after; + + $config->insert($group->name(), $option->name(), $res) +} + + +sub post_fix_resolve_at_variables { + my ($self, $config)= @_; + + foreach my $group ( $config->groups() ) { + foreach my $option ( $group->options()) { + next unless defined $option->value(); + + $self->resolve_at_variable($config, $group, $option) + if ($option->value() =~ /\@/); + } + } +} + +sub post_fix_mysql_cluster_section { + my ($self, $config)= @_; + + # Add a [mysl_cluster.] section for each + # defined [cluster_config.] section + foreach my $group ( $config->like('cluster_config\.\w*$') ) + { + my @urls; + # Generate ndb_connectstring for this cluster + foreach my $ndb_mgmd ( $config->like('cluster_config.ndb_mgmd.')) { + if ($ndb_mgmd->suffix() eq $group->suffix()) { + my $host= $ndb_mgmd->value('HostName'); + my $port= $ndb_mgmd->value('PortNumber'); + push(@urls, "$host:$port"); + } + } + croak "Could not generate valid ndb_connectstring for '$group'" + unless @urls > 0; + my $ndb_connectstring= join(";", @urls); + + # Add ndb_connectstring to [mysql_cluster.] + $config->insert('mysql_cluster'.$group->suffix(), + 'ndb_connectstring', $ndb_connectstring); + + # Add ndb_connectstring to each mysqld connected to this + # cluster + foreach my $mysqld ( $config->like('cluster_config.mysqld.')) { + if ($mysqld->suffix() eq $group->suffix()) { + my $after= $mysqld->after('cluster_config.mysqld'); + $config->insert("mysqld$after", + 'ndb_connectstring', $ndb_connectstring); + } + } + } +} + +# +# Rules to run last of all +# +my @post_rules= +( + \&post_check_client_groups, + \&post_fix_mysql_cluster_section, + \&post_fix_resolve_at_variables, + \&post_check_embedded_group, +); + + +sub run_rules_for_group { + my ($self, $config, $group, @rules)= @_; + foreach my $hash ( @rules ) { + while (my ($option, $rule)= each( %{$hash} )) { + # Only run this rule if the value is not already defined + if (!$config->exists($group->name(), $option)) { + my $value; + if (ref $rule eq "CODE") { + # Call the rule function + $value= &$rule($self, $config, $group->name(), + $config->group($group->name())); + } else { + $value= $rule; + } + if (defined $value) { + $config->insert($group->name(), $option, $value, 1); + } + } + } + } +} + + +sub run_section_rules { + my ($self, $config, $name, @rules)= @_; + + foreach my $group ( $config->like($name) ) { + $self->run_rules_for_group($config, $group, @rules); + } +} + + +sub run_generate_sections_from_cluster_config { + my ($self, $config)= @_; + + my @options= ('ndb_mgmd', 'ndbd', + 'mysqld', 'ndbapi'); + + foreach my $group ( $config->like('cluster_config\.\w*$') ) { + + # Keep track of current index per process type + my %idxes; + map { $idxes{$_}= 1; } @options; + + foreach my $option_name ( @options ) { + my $value= $group->value($option_name); + my @hosts= split(/,/, $value, -1); # -1 => return also empty strings + + # Add at least one host + push(@hosts, undef) unless scalar(@hosts); + + # Assign hosts unless already fixed + @hosts= map { $self->fix_host() unless $_; } @hosts; + + # Write the hosts value back + $group->insert($option_name, join(",", @hosts)); + + # Generate sections for each host + foreach my $host ( @hosts ){ + my $idx= $idxes{$option_name}++; + + my $suffix= $group->suffix(); + # Generate a section for ndb_mgmd to read + $config->insert("cluster_config.$option_name.$idx$suffix", + "HostName", $host); + + if ($option_name eq 'mysqld'){ + my $datadir= + $self->fix_cluster_dir($config, + "cluster_config.mysqld.$idx$suffix", + $group); + $config->insert("mysqld.$idx$suffix", + 'datadir', "$datadir/data"); + } + } + } + } +} + + +sub new_config { + my ($class, $args)= @_; + + my @required_args= ('basedir', 'baseport', 'vardir', 'template_path'); + + foreach my $required ( @required_args ) { + croak "you must pass '$required'" unless defined $args->{$required}; + } + + # Open the config template + my $config= My::Config->new($args->{'template_path'}); + my $self= bless { + CONFIG => $config, + ARGS => $args, + PORT => $args->{baseport}, + SERVER_ID => 1, + testname => $args->{testname}, + }, $class; + + # Run pre rules + foreach my $rule ( @pre_rules ) { + &$rule($self, $config); + } + + $self->run_section_rules($config, + 'cluster_config\.\w*$', + @cluster_config_rules); + $self->run_generate_sections_from_cluster_config($config); + + $self->run_section_rules($config, + 'cluster_config.ndb_mgmd.', + @ndb_mgmd_rules); + $self->run_section_rules($config, + 'cluster_config.ndbd', + @ndbd_rules); + + $self->run_section_rules($config, + 'mysqld.', + @mysqld_rules); + + $self->run_section_rules($config, + 'memcached.', + @memcached_rules); + + # [mysqlbinlog] need additional settings + $self->run_rules_for_group($config, + $config->insert('mysqlbinlog'), + @mysqlbinlog_rules); + + # [mysql_upgrade] need additional settings + $self->run_rules_for_group($config, + $config->insert('mysql_upgrade'), + @mysql_upgrade_rules); + + # Additional rules required for [client] + $self->run_rules_for_group($config, + $config->insert('client'), + @client_rules); + + + # Additional rules required for [mysqltest] + $self->run_rules_for_group($config, + $config->insert('mysqltest'), + @mysqltest_rules); + + { + # Run post rules + foreach my $rule ( @post_rules ) { + &$rule($self, $config); + } + } + + return $config; +} + + +1; + diff --git a/mysql-wsrep-5.6/mysql-test/lib/mtr_cases.pm b/mysql-wsrep-5.6/mysql-test/lib/mtr_cases.pm index 45867d21..b9e4fb1a 100644 --- a/mysql-wsrep-5.6/mysql-test/lib/mtr_cases.pm +++ b/mysql-wsrep-5.6/mysql-test/lib/mtr_cases.pm @@ -508,6 +508,9 @@ sub collect_one_suite($) my @new_cases; foreach my $comb (@combinations) { + # ENV is used in My::Config::ENV to store the environment so is not a true combination + next if ( $comb->{'name'} eq 'ENV' ); + foreach my $test (@cases) { diff --git a/mysql-wsrep-5.6/mysql-test/mtr.out-of-source b/mysql-wsrep-5.6/mysql-test/mtr.out-of-source index 2c634b3e..51713517 100644 --- a/mysql-wsrep-5.6/mysql-test/mtr.out-of-source +++ b/mysql-wsrep-5.6/mysql-test/mtr.out-of-source @@ -1,5 +1,5 @@ #!/usr/bin/perl # Call mtr in out-of-source build -$ENV{MTR_BINDIR} = "@CMAKE_BINARY_DIR@"; -chdir("@CMAKE_SOURCE_DIR@/mysql-test"); -exit(system($^X, "@CMAKE_SOURCE_DIR@/mysql-test/mysql-test-run.pl", @ARGV) >> 8); +$ENV{MTR_BINDIR} = '@CMAKE_BINARY_DIR@'; +chdir('@CMAKE_SOURCE_DIR@/mysql-test'); +exit(system($^X, '@CMAKE_SOURCE_DIR@/mysql-test/mysql-test-run.pl', @ARGV) >> 8); diff --git a/mysql-wsrep-5.6/mysql-test/mysql-test-run.pl b/mysql-wsrep-5.6/mysql-test/mysql-test-run.pl index 82b5d1c6..879a9d85 100755 --- a/mysql-wsrep-5.6/mysql-test/mysql-test-run.pl +++ b/mysql-wsrep-5.6/mysql-test/mysql-test-run.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl # -*- cperl -*- -# Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2004, 2015, 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 @@ -204,6 +204,7 @@ our @opt_cases; # The test cases names in argv our $opt_embedded_server; # -1 indicates use default, override with env.var. our $opt_ctest= env_or_val(MTR_UNIT_TESTS => -1); +our $opt_ctest_report; # Unit test report stored here for delayed printing my $ctest_report; @@ -335,6 +336,7 @@ my $opt_max_save_datadir= env_or_val(MTR_MAX_SAVE_DATADIR => 20); my $opt_max_test_fail= env_or_val(MTR_MAX_TEST_FAIL => 10); my $opt_parallel= $ENV{MTR_PARALLEL} || 1; +my $opt_port_group_size = $ENV{MTR_PORT_GROUP_SIZE} || 10; select(STDOUT); $| = 1; # Automatically flush STDOUT @@ -360,6 +362,8 @@ sub main { gcov_prepare($basedir); } + check_wsrep_support(); + if (!$opt_suites) { $opt_suites= $DEFAULT_SUITES; } @@ -1073,6 +1077,7 @@ sub command_line_setup { # Specify ports 'build-thread|mtr-build-thread=i' => \$opt_build_thread, 'port-base|mtr-port-base=i' => \$opt_port_base, + 'port-group-size=s' => \$opt_port_group_size, # Test case authoring 'record' => \$opt_record, @@ -1174,6 +1179,7 @@ sub command_line_setup { 'report-times' => \$opt_report_times, 'result-file' => \$opt_resfile, 'unit-tests!' => \$opt_ctest, + 'unit-tests-report!' => \$opt_ctest_report, 'stress=s' => \$opt_stress, 'help|h' => \$opt_usage, @@ -1618,12 +1624,21 @@ sub command_line_setup { } # -------------------------------------------------------------------------- - # Don't run ctest if tests or suites named + # Set default values for opt_ctest (--unit-tests) # -------------------------------------------------------------------------- - $opt_ctest= 0 if $opt_ctest == -1 && ($opt_suites || @opt_cases); - # Override: disable if running in the PB test environment - $opt_ctest= 0 if $opt_ctest == -1 && defined $ENV{PB2WORKDIR}; + if ($opt_ctest == -1) { + if (defined $opt_ctest_report && $opt_ctest_report) { + # Turn on --unit-tests by default if --unit-tests-report is used + $opt_ctest= 1; + } elsif ($opt_suites || @opt_cases) { + # Don't run ctest if tests or suites named + $opt_ctest= 0; + } elsif (defined $ENV{PB2WORKDIR}) { + # Override: disable if running in the PB test environment + $opt_ctest= 0; + } + } # -------------------------------------------------------------------------- # Check use of wait-all @@ -1798,16 +1813,16 @@ sub set_build_thread_ports($) { $ENV{MTR_BUILD_THREAD}= $build_thread; # Calculate baseport - $baseport= $build_thread * 10 + 10000; - if ( $baseport < 5001 or $baseport + 9 >= 32767 ) + $baseport= $build_thread * $opt_port_group_size + 10000; + if ( $baseport < 5001 or $baseport + $opt_port_group_size >= 32767 ) { mtr_error("MTR_BUILD_THREAD number results in a port", "outside 5001 - 32767", - "($baseport - $baseport + 9)"); + "($baseport - $baseport + $opt_port_group_size)"); } mtr_report("Using MTR_BUILD_THREAD $build_thread,", - "with reserved ports $baseport..".($baseport+9)); + "with reserved ports $baseport..".($baseport+($opt_port_group_size-1))); } @@ -2895,7 +2910,6 @@ sub check_ndbcluster_support ($) { # which is the default case return; } - if ($opt_skip_ndbcluster) { # Compiled with ndbcluster but ndbcluster skipped @@ -3311,6 +3325,49 @@ sub ndbcluster_start ($) { } +sub have_wsrep() { + my $wsrep_on= $mysqld_variables{'wsrep-on'}; + return defined $wsrep_on +} + + +sub check_wsrep_support() { + if (have_wsrep()) + { + mtr_report(" - binaries built with wsrep patch"); + + # ADD scripts to $PATH to that wsrep_sst_* can be found + my ($path) = grep { -f "$_/wsrep_sst_rsync"; } "$::bindir/scripts", $::path_client_bindir; + mtr_error("No SST scripts") unless $path; + $ENV{PATH}="$path:$ENV{PATH}"; + + # Check whether WSREP_PROVIDER environment variable is set. + if (defined $ENV{'WSREP_PROVIDER'}) { + if ((mtr_file_exists($ENV{'WSREP_PROVIDER'}) eq "") && + ($ENV{'WSREP_PROVIDER'} ne "none")) { + mtr_error("WSREP_PROVIDER env set to an invalid path"); + } + # WSREP_PROVIDER is valid; set to a valid path or "none"). + mtr_verbose("WSREP_PROVIDER env set to $ENV{'WSREP_PROVIDER'}"); + } else { + # WSREP_PROVIDER env not defined. Lets try to locate the wsrep provider + # library. + my $file_wsrep_provider= + mtr_file_exists("/usr/lib/galera/libgalera_smm.so", + "/usr/lib64/galera/libgalera_smm.so"); + + if ($file_wsrep_provider ne "") { + # wsrep provider library found ! + mtr_verbose("wsrep provider library found : $file_wsrep_provider"); + $ENV{'WSREP_PROVIDER'}= $file_wsrep_provider; + } else { + mtr_verbose("Could not find wsrep provider library, setting it to 'none'"); + $ENV{'WSREP_PROVIDER'}= "none"; + } + } + } +} + sub create_config_file_for_extern { my %opts= ( @@ -3404,8 +3461,8 @@ sub kill_leftovers ($) { sub check_ports_free ($) { my $bthread= shift; - my $portbase = $bthread * 10 + 10000; - for ($portbase..$portbase+9){ + my $portbase = $bthread * $opt_port_group_size + 10000; + for ($portbase..$portbase+($opt_port_group_size-1)){ if (mtr_ping_port($_)){ mtr_report(" - 'localhost:$_' was not free"); return 0; # One port was not free @@ -3551,12 +3608,6 @@ sub mysql_install_db { mtr_add_arg($args, "--lc-messages-dir=%s", $install_lang); mtr_add_arg($args, "--character-sets-dir=%s", $install_chsdir); - # On some old linux kernels, aio on tmpfs is not supported - # Remove this if/when Bug #58421 fixes this in the server - if ($^O eq "linux" && $opt_mem) { - mtr_add_arg($args, "--loose-skip-innodb-use-native-aio"); - } - # InnoDB arguments that affect file location and sizes may # need to be given to the bootstrap process as well as the # server process. @@ -3737,6 +3788,24 @@ sub run_query { } +sub sleep_until_returns_true($$$) { + my ($tinfo, $mysqld, $query)= @_; + + my $timeout = $opt_start_timeout; + my $sleeptime= 100; # Milliseconds + my $loops= ($timeout * 1000) / $sleeptime; + + for ( my $loop= 1; $loop <= $loops; $loop++ ) { + my $query_result = run_query($tinfo, $mysqld, $query); + if (run_query($tinfo, $mysqld, $query) == 1) { + return 0; + } + } + + return 1; +} + + sub do_before_run_mysqltest($) { my $tinfo= shift; @@ -4272,239 +4341,225 @@ sub run_testcase ($) { } my $test= start_mysqltest($tinfo); - # Set only when we have to keep waiting after expectedly died server - my $keep_waiting_proc = 0; my $print_timeout= start_timer($print_freq * 60); + my @procs; while (1) { - my $proc; - if ($keep_waiting_proc) + if ($test_timeout > $print_timeout) { - # Any other process exited? - $proc = My::SafeProcess->check_any(); - if ($proc) + my $proc = My::SafeProcess->wait_any_timeout($print_timeout); + mtr_verbose("Got $proc"); + push @procs, $proc; + if ( $proc->{timeout} ) { - mtr_verbose ("Found exited process $proc"); - } - else - { - $proc = $keep_waiting_proc; - # Also check if timer has expired, if so cancel waiting - if ( has_expired($test_timeout) ) - { - $keep_waiting_proc = 0; - } + #print out that the test is still on + mtr_print("Test still running: $tinfo->{name}"); + #reset the timer + $print_timeout= start_timer($print_freq * 60); + next; } } - if (! $keep_waiting_proc) + else { - if($test_timeout > $print_timeout) - { - $proc= My::SafeProcess->wait_any_timeout($print_timeout); - if ( $proc->{timeout} ) - { - #print out that the test is still on - mtr_print("Test still running: $tinfo->{name}"); - #reset the timer - $print_timeout= start_timer($print_freq * 60); - next; - } - } - else + my $proc= My::SafeProcess->check_any(); + + if ($proc) { + mtr_verbose("Got $proc"); + push @procs, $proc; + } elsif ( has_expired($test_timeout) ) { - $proc= My::SafeProcess->wait_any_timeout($test_timeout); + my $timeout= My::SafeProcess->wait_any_timeout($test_timeout); + push @procs, $timeout; + } else { + mtr_milli_sleep(100); } } - # Will be restored if we need to keep waiting - $keep_waiting_proc = 0; - - unless ( defined $proc ) - { - mtr_error("wait_any failed"); - } - mtr_verbose("Got $proc"); - mark_time_used('test'); # ---------------------------------------------------- # Was it the test program that exited # ---------------------------------------------------- - if ($proc eq $test) - { - my $res= $test->exit_status(); - if ($res == 0 and $opt_warnings and check_warnings($tinfo) ) + foreach my $proc (@procs) { + if ($proc eq $test) { - # Test case suceeded, but it has produced unexpected - # warnings, continue in $res == 1 - $res= 1; - resfile_output($tinfo->{'warnings'}) if $opt_resfile; - } + my $res= $test->exit_status(); - if ( $res == 0 ) - { - my $check_res; - if ( restart_forced_by_test('force_restart') ) - { - stop_all_servers($opt_shutdown_timeout); - } - elsif ( $opt_check_testcases and - $check_res= check_testcase($tinfo, "after")) - { - if ($check_res == 1) { - # Test case had sideeffects, not fatal error, just continue - stop_all_servers($opt_shutdown_timeout); - mtr_report("Resuming tests...\n"); - resfile_output($tinfo->{'check'}) if $opt_resfile; - } - else { - # Test case check failed fatally, probably a server crashed - report_failure_and_restart($tinfo); - return 1; - } - } - mtr_report_test_passed($tinfo); - } - elsif ( $res == 62 ) - { - # Testcase itself tell us to skip this one - $tinfo->{skip_detected_by_test}= 1; - # Try to get reason from test log file - find_testcase_skipped_reason($tinfo); - mtr_report_test_skipped($tinfo); - # Restart if skipped due to missing perl, it may have had side effects - if ( restart_forced_by_test('force_restart_if_skipped') || - $tinfo->{'comment'} =~ /^perl not found/ ) - { - stop_all_servers($opt_shutdown_timeout); - } + if ($res == 0 and $opt_warnings and check_warnings($tinfo) ) + { + # Test case suceeded, but it has produced unexpected + # warnings, continue in $res == 1 + $res= 1; + resfile_output($tinfo->{'warnings'}) if $opt_resfile; + } + + if ( $res == 0 ) + { + my $check_res; + if ( restart_forced_by_test('force_restart') ) + { + stop_all_servers($opt_shutdown_timeout); + } + elsif ( $opt_check_testcases and + $check_res= check_testcase($tinfo, "after")) + { + if ($check_res == 1) { + # Test case had sideeffects, not fatal error, just continue + stop_all_servers($opt_shutdown_timeout); + mtr_report("Resuming tests...\n"); + resfile_output($tinfo->{'check'}) if $opt_resfile; + } + else { + # Test case check failed fatally, probably a server crashed + report_failure_and_restart($tinfo); + return 1; + } + } + mtr_report_test_passed($tinfo); + } + elsif ( $res == 62 ) + { + # Testcase itself tell us to skip this one + $tinfo->{skip_detected_by_test}= 1; + # Try to get reason from test log file + find_testcase_skipped_reason($tinfo); + mtr_report_test_skipped($tinfo); + # Restart if skipped due to missing perl, it may have had side effects + if ( restart_forced_by_test('force_restart_if_skipped') || + $tinfo->{'comment'} =~ /^perl not found/ ) + { + stop_all_servers($opt_shutdown_timeout); + } + } + elsif ( $res == 65 ) + { + # Testprogram killed by signal + $tinfo->{comment}= + "testprogram crashed(returned code $res)"; + report_failure_and_restart($tinfo); + } + elsif ( $res == 1 ) + { + # Check if the test tool requests that + # an analyze script should be run + my $analyze= find_analyze_request(); + if ($analyze){ + run_on_all($tinfo, "analyze-$analyze"); + } + + # Wait a bit and see if a server died, if so report that instead + mtr_milli_sleep(100); + my $srvproc= My::SafeProcess::check_any(); + if ($srvproc && grep($srvproc eq $_, started(all_servers()))) { + $proc= $srvproc; + goto SRVDIED; + } + + # Test case failure reported by mysqltest + report_failure_and_restart($tinfo); + } + else + { + # mysqltest failed, probably crashed + $tinfo->{comment}= + "mysqltest failed with unexpected return code $res\n"; + report_failure_and_restart($tinfo); + } + + # Save info from this testcase run to mysqltest.log + if( -f $path_current_testlog) + { + if ($opt_resfile && $res && $res != 62) { + resfile_output_file($path_current_testlog); + } + mtr_appendfile_to_file($path_current_testlog, $path_testlog); + unlink($path_current_testlog); + } + + return ($res == 62) ? 0 : $res; } - elsif ( $res == 65 ) + + # ---------------------------------------------------- + # Check if it was an expected crash + # ---------------------------------------------------- + my $check_crash = check_expected_crash_and_restart($proc); + mtr_verbose("check_expected_crash_and_restart - $check_crash - $proc"); + if ($check_crash) { - # Testprogram killed by signal - $tinfo->{comment}= - "testprogram crashed(returned code $res)"; - report_failure_and_restart($tinfo); + # Keep waiting if it returned 2, if 1 don't wait or stop waiting. + if ($check_crash == 1) { + @procs = grep { $_ ne $proc } @procs; + } + + next; } - elsif ( $res == 1 ) - { - # Check if the test tool requests that - # an analyze script should be run - my $analyze= find_analyze_request(); - if ($analyze){ - run_on_all($tinfo, "analyze-$analyze"); - } - # Wait a bit and see if a server died, if so report that instead - mtr_milli_sleep(100); - my $srvproc= My::SafeProcess::check_any(); - if ($srvproc && grep($srvproc eq $_, started(all_servers()))) { - $proc= $srvproc; - goto SRVDIED; - } + SRVDIED: + # ---------------------------------------------------- + # Stop the test case timer + # ---------------------------------------------------- + $test_timeout= 0; - # Test case failure reported by mysqltest - report_failure_and_restart($tinfo); - } - else + # ---------------------------------------------------- + # Check if it was a server that died + # ---------------------------------------------------- + if ( grep($proc eq $_, started(all_servers())) ) { - # mysqltest failed, probably crashed - $tinfo->{comment}= - "mysqltest failed with unexpected return code $res\n"; - report_failure_and_restart($tinfo); + # Server failed, probably crashed + $tinfo->{comment}= + "Server $proc failed during test run" . + get_log_from_proc($proc, $tinfo->{name}); + + # ---------------------------------------------------- + # It's not mysqltest that has exited, kill it + # ---------------------------------------------------- + $test->kill(); + + report_failure_and_restart($tinfo); + return 1; } - # Save info from this testcase run to mysqltest.log - if( -f $path_current_testlog) + # Try to dump core for mysqltest and all servers + foreach my $proc ($test, started(all_servers())) { - if ($opt_resfile && $res && $res != 62) { - resfile_output_file($path_current_testlog); - } - mtr_appendfile_to_file($path_current_testlog, $path_testlog); - unlink($path_current_testlog); + mtr_print("Trying to dump core for $proc"); + if ($proc->dump_core()) + { + $proc->wait_one(20); + } } - return ($res == 62) ? 0 : $res; - - } - - # ---------------------------------------------------- - # Check if it was an expected crash - # ---------------------------------------------------- - my $check_crash = check_expected_crash_and_restart($proc); - if ($check_crash) - { - # Keep waiting if it returned 2, if 1 don't wait or stop waiting. - $keep_waiting_proc = 0 if $check_crash == 1; - $keep_waiting_proc = $proc if $check_crash == 2; - next; - } - - SRVDIED: - # ---------------------------------------------------- - # Stop the test case timer - # ---------------------------------------------------- - $test_timeout= 0; - - # ---------------------------------------------------- - # Check if it was a server that died - # ---------------------------------------------------- - if ( grep($proc eq $_, started(all_servers())) ) - { - # Server failed, probably crashed - $tinfo->{comment}= - "Server $proc failed during test run" . - get_log_from_proc($proc, $tinfo->{name}); - # ---------------------------------------------------- # It's not mysqltest that has exited, kill it # ---------------------------------------------------- $test->kill(); - report_failure_and_restart($tinfo); - return 1; - } - - # Try to dump core for mysqltest and all servers - foreach my $proc ($test, started(all_servers())) - { - mtr_print("Trying to dump core for $proc"); - if ($proc->dump_core()) + # ---------------------------------------------------- + # Check if testcase timer expired + # ---------------------------------------------------- + if ( $proc->{timeout} ) { - $proc->wait_one(20); - } - } - - # ---------------------------------------------------- - # It's not mysqltest that has exited, kill it - # ---------------------------------------------------- - $test->kill(); + my $log_file_name= $opt_vardir."/log/".$tinfo->{shortname}.".log"; + $tinfo->{comment}= + "Test case timeout after ".testcase_timeout($tinfo). + " seconds\n\n"; + # Add 20 last executed commands from test case log file + if (-e $log_file_name) + { + $tinfo->{comment}.= + "== $log_file_name == \n". + mtr_lastlinesfromfile($log_file_name, 20)."\n"; + } + $tinfo->{'timeout'}= testcase_timeout($tinfo); # Mark as timeout + run_on_all($tinfo, 'analyze-timeout'); - # ---------------------------------------------------- - # Check if testcase timer expired - # ---------------------------------------------------- - if ( $proc->{timeout} ) - { - my $log_file_name= $opt_vardir."/log/".$tinfo->{shortname}.".log"; - $tinfo->{comment}= - "Test case timeout after ".testcase_timeout($tinfo). - " seconds\n\n"; - # Add 20 last executed commands from test case log file - if (-e $log_file_name) - { - $tinfo->{comment}.= - "== $log_file_name == \n". - mtr_lastlinesfromfile($log_file_name, 20)."\n"; + report_failure_and_restart($tinfo); + return 1; } - $tinfo->{'timeout'}= testcase_timeout($tinfo); # Mark as timeout - run_on_all($tinfo, 'analyze-timeout'); - report_failure_and_restart($tinfo); - return 1; + mtr_error("Unhandled process $proc exited"); } - - mtr_error("Unhandled process $proc exited"); } mtr_error("Should never come here"); } @@ -5785,6 +5840,13 @@ sub start_servers($) { } return 1; } + + if (have_wsrep()) { + if(sleep_until_returns_true($tinfo, $mysqld, 'SELECT @@wsrep_ready')) { + $tinfo->{logfile}= "WSREP did not transition to state READY"; + return 1; + } + } } # Start memcached(s) for each cluster @@ -6438,6 +6500,8 @@ sub run_ctest() { open (CTEST, " > $ctfile") or die ("Could not open output file $ctfile"); + $ctest_report .= $ctest_out if $opt_ctest_report; + # Put ctest output in log file, while analyzing results for (split ('\n', $ctest_out)) { print CTEST "$_\n"; @@ -6563,6 +6627,8 @@ Options that specify ports build-thread=# Can be set in environment variable MTR_BUILD_THREAD. Set MTR_BUILD_THREAD="auto" to automatically aquire a build thread id that is unique to current host + port-group-size=N Reserve groups of TCP ports of size N for each MTR thread + Options for test case authoring @@ -6701,6 +6767,7 @@ Misc options nounit-tests Do not run unit tests. Normally run if configured and if not running named tests/suites unit-tests Run unit tests even if they would otherwise not be run + unit-tests-report Include report of every test included in unit tests. stress=ARGS Run stress test, providing options to mysql-stress-test.pl. Options are separated by comma. diff --git a/mysql-wsrep-5.6/mysql-test/r/alter_table.result b/mysql-wsrep-5.6/mysql-test/r/alter_table.result index fc505a08..c1675768 100644 --- a/mysql-wsrep-5.6/mysql-test/r/alter_table.result +++ b/mysql-wsrep-5.6/mysql-test/r/alter_table.result @@ -1719,8 +1719,8 @@ ALTER TABLE tm1 DROP INDEX im3; affected rows: 2 info: Records: 2 Duplicates: 0 Warnings: 0 ALTER TABLE ti1 DROP COLUMN d2; -affected rows: 2 -info: Records: 2 Duplicates: 0 Warnings: 0 +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 ALTER TABLE tm1 DROP COLUMN d2; affected rows: 2 info: Records: 2 Duplicates: 0 Warnings: 0 @@ -1987,3 +1987,594 @@ CREATE TABLE help_topic (dummy int) ENGINE=innodb; ERROR HY000: Storage engine 'InnoDB' does not support system tables. [mysql.help_topic] use test; # End of Bug#11815557 +# +# BUG#17246318 - ALTER TABLE SHOULD NOT ALLOW CREATION OF TABLES +# WITH BOTH 5.5 AND 5.6 TEMPORALS +# +# BUG 18985760 -"FAST" ALTER TABLE CHANGE ON ENUM COLUMN +# TRIGGERS FULL TABLE REBUILD. +# Test for the case where 'avoid_temporal_upgrade' is set +# to the DEFAULT value(OFF). +ALTER TABLE t1 ENGINE= INNODB; +#ALTER operations using INPLACE algorithm is disallowed +#since the table contains old temporal type. +ALTER TABLE t1 ADD COLUMN fld4 TIMESTAMP, ALGORITHM= INPLACE; +ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY. +ALTER TABLE t1 ADD COLUMN fld4 TIMESTAMP FIRST, ALGORITHM= INPLACE; +ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY. +ALTER TABLE t1 ADD COLUMN fld4 TIMESTAMP AFTER f_timestamp, ALGORITHM= INPLACE; +ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY. +ALTER TABLE t1 CHANGE COLUMN f_time fld4 TIMESTAMP, ALGORITHM= INPLACE; +ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY. +ALTER TABLE t1 MODIFY f_datetime TIME, ALGORITHM= INPLACE; +ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY. +ALTER TABLE t1 ADD INDEX index1(f_datetime), ALGORITHM= INPLACE; +ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY. +#ALTER operations using COPY algorithm is allowed +#when the table contains old temporal type. +#Note: Timestamp encoding remains the same for the non-fractional part +#even in the 5.6 format. Hence there is no change in the display before +#and after upgrade. +#ADD COLUMN upgrades the old temporal type. +CREATE TABLE t2 LIKE t1; +INSERT INTO t2 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22'); +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 0000124A7C3C8A4E 4ECAA4EE +ALTER TABLE t2 ADD COLUMN fld4 TIMESTAMP, ALGORITHM= COPY; +Warnings: +Note 1880 TIME/TIMESTAMP/DATETIME columns of old format have been upgraded to the new format. +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 816596 998AAB6596 4ECAA4EE +DROP TABLE t2; +#ADD COLUMN FIRST upgrades the old temporal type. +CREATE TABLE t2 LIKE t1; +INSERT INTO t2 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22'); +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 0000124A7C3C8A4E 4ECAA4EE +ALTER TABLE t2 ADD COLUMN fld4 TIMESTAMP FIRST, ALGORITHM= COPY; +Warnings: +Note 1880 TIME/TIMESTAMP/DATETIME columns of old format have been upgraded to the new format. +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 816596 998AAB6596 4ECAA4EE +DROP TABLE t2; +#ADD COLUMN AFTER upgrades the old temporal type. +CREATE TABLE t2 LIKE t1; +INSERT INTO t2 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22'); +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 0000124A7C3C8A4E 4ECAA4EE +ALTER TABLE t2 ADD COLUMN fld4 TIMESTAMP AFTER f_timestamp, ALGORITHM= COPY; +Warnings: +Note 1880 TIME/TIMESTAMP/DATETIME columns of old format have been upgraded to the new format. +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 816596 998AAB6596 4ECAA4EE +DROP TABLE t2; +#CHANGE COLUMN upgrades the old temporal type. +CREATE TABLE t2 LIKE t1; +INSERT INTO t2 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22'); +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 0000124A7C3C8A4E 4ECAA4EE +ALTER TABLE t2 CHANGE COLUMN f_timestamp fld4 TIMESTAMP, ALGORITHM= COPY; +Warnings: +Note 1880 TIME/TIMESTAMP/DATETIME columns of old format have been upgraded to the new format. +SELECT f_time, f_datetime, fld4, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(fld4)) FROM t2; +f_time f_datetime fld4 HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(fld4)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 816596 998AAB6596 4ECAA4EE +DROP TABLE t2; +#MODIFY COLUMN upgrades the old temporal type. +CREATE TABLE t2 LIKE t1; +INSERT INTO t2 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22'); +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 0000124A7C3C8A4E 4ECAA4EE +ALTER TABLE t2 MODIFY f_timestamp TIME, ALGORITHM= COPY; +Warnings: +Note 1880 TIME/TIMESTAMP/DATETIME columns of old format have been upgraded to the new format. +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 22:22:22 816596 998AAB6596 816596 +DROP TABLE t2; +#ADD INDEX upgrades the old temporal type. +CREATE TABLE t2 LIKE t1; +INSERT INTO t2 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22'); +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 0000124A7C3C8A4E 4ECAA4EE +ALTER TABLE t2 ADD INDEX index1(f_timestamp), ALGORITHM= COPY; +Warnings: +Note 1880 TIME/TIMESTAMP/DATETIME columns of old format have been upgraded to the new format. +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 816596 998AAB6596 4ECAA4EE +DROP TABLE t2; +#ALTER operations using DEFAULT algorithm is allowed +#when the table contains old temporal type. +#ADD COLUMN upgrades the old temporal type. +CREATE TABLE t2 LIKE t1; +INSERT INTO t2 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22'); +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 0000124A7C3C8A4E 4ECAA4EE +ALTER TABLE t2 ADD COLUMN fld4 TIMESTAMP, ALGORITHM= DEFAULT; +Warnings: +Note 1880 TIME/TIMESTAMP/DATETIME columns of old format have been upgraded to the new format. +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 816596 998AAB6596 4ECAA4EE +DROP TABLE t2; +#ADD COLUMN FIRST upgrades the old temporal type. +CREATE TABLE t2 LIKE t1; +INSERT INTO t2 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22'); +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 0000124A7C3C8A4E 4ECAA4EE +ALTER TABLE t2 ADD COLUMN fld4 TIMESTAMP FIRST, ALGORITHM= DEFAULT; +Warnings: +Note 1880 TIME/TIMESTAMP/DATETIME columns of old format have been upgraded to the new format. +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 816596 998AAB6596 4ECAA4EE +DROP TABLE t2; +#ADD COLUMN AFTER upgrades the old temporal type. +CREATE TABLE t2 LIKE t1; +INSERT INTO t2 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22'); +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 0000124A7C3C8A4E 4ECAA4EE +ALTER TABLE t2 ADD COLUMN fld4 TIMESTAMP AFTER f_timestamp, ALGORITHM= DEFAULT; +Warnings: +Note 1880 TIME/TIMESTAMP/DATETIME columns of old format have been upgraded to the new format. +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 816596 998AAB6596 4ECAA4EE +DROP TABLE t2; +#CHANGE COLUMN upgrades the old temporal type. +CREATE TABLE t2 LIKE t1; +INSERT INTO t2 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22'); +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 0000124A7C3C8A4E 4ECAA4EE +ALTER TABLE t2 CHANGE COLUMN f_timestamp fld4 DATETIME, ALGORITHM= DEFAULT; +Warnings: +Note 1880 TIME/TIMESTAMP/DATETIME columns of old format have been upgraded to the new format. +SELECT f_time, f_datetime, fld4, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(fld4)) FROM t2; +f_time f_datetime fld4 HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(fld4)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 816596 998AAB6596 998AAB6596 +DROP TABLE t2; +#MODIFY COLUMN upgrades the old temporal type. +CREATE TABLE t2 LIKE t1; +INSERT INTO t2 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22'); +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 0000124A7C3C8A4E 4ECAA4EE +ALTER TABLE t2 MODIFY f_timestamp TIME, ALGORITHM= DEFAULT; +Warnings: +Note 1880 TIME/TIMESTAMP/DATETIME columns of old format have been upgraded to the new format. +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 22:22:22 816596 998AAB6596 816596 +DROP TABLE t2; +#ADD INDEX upgrades the old temporal type. +CREATE TABLE t2 LIKE t1; +INSERT INTO t2 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22'); +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 0000124A7C3C8A4E 4ECAA4EE +ALTER TABLE t2 ADD INDEX index1(f_timestamp), ALGORITHM= DEFAULT; +Warnings: +Note 1880 TIME/TIMESTAMP/DATETIME columns of old format have been upgraded to the new format. +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 816596 998AAB6596 4ECAA4EE +DROP TABLE t2; +#ALTER TABLE FORCE upgrades the old temporal types. +CREATE TABLE t2 LIKE t1; +INSERT INTO t2 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22'); +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 0000124A7C3C8A4E 4ECAA4EE +ALTER TABLE t2 FORCE; +Warnings: +Note 1880 TIME/TIMESTAMP/DATETIME columns of old format have been upgraded to the new format. +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 816596 998AAB6596 4ECAA4EE +DROP TABLE t2; +#Examples where the NOT NULL/NULL FLAG and DEFAULT values are retained +#after upgrade. +CREATE TABLE t2 LIKE t1; +INSERT INTO t2 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22'); +#Before upgrade. +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `f_time` time DEFAULT NULL, + `f_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `f_datetime` datetime DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +ALTER TABLE t2 ADD COLUMN fld4 TIMESTAMP, ALGORITHM= COPY; +Warnings: +Note 1880 TIME/TIMESTAMP/DATETIME columns of old format have been upgraded to the new format. +#After upgrade. +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `f_time` time DEFAULT NULL, + `f_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `f_datetime` datetime DEFAULT NULL, + `fld4` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +#Examples of the Alter operation which does not upgrade +#the temporal formats. +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t1; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +10:10:10 2010-10-10 10:10:10 2031-11-21 17:11:01 818A92 0000124821911312 7468F975 +00:00:00 2000-01-01 01:01:01 2001-01-21 18:11:01 800000 00001230A2EA8AB5 3A6AFC05 +01:01:10 2020-01-01 01:01:01 1980-11-21 18:06:01 80277E 0000125F33D85AB5 147BF1D9 +NULL 2000-01-01 01:01:01 2015-11-21 17:11:01 NULL 00001230A2EA8AB5 56507B75 +00:00:00 NULL 2011-11-21 17:11:01 800000 NULL 4ECA5BF5 +ALTER TABLE t1 DROP COLUMN f_timestamp; +SELECT f_time, f_datetime, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)) FROM t1; +f_time f_datetime HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) +10:10:10 2010-10-10 10:10:10 818A92 0000124821911312 +00:00:00 2000-01-01 01:01:01 800000 00001230A2EA8AB5 +01:01:10 2020-01-01 01:01:01 80277E 0000125F33D85AB5 +NULL 2000-01-01 01:01:01 NULL 00001230A2EA8AB5 +00:00:00 NULL 800000 NULL +RENAME TABLE t1 to t3; +SELECT f_time, f_datetime, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)) FROM t3; +f_time f_datetime HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) +10:10:10 2010-10-10 10:10:10 818A92 0000124821911312 +00:00:00 2000-01-01 01:01:01 800000 00001230A2EA8AB5 +01:01:10 2020-01-01 01:01:01 80277E 0000125F33D85AB5 +NULL 2000-01-01 01:01:01 NULL 00001230A2EA8AB5 +00:00:00 NULL 800000 NULL +#Once the old temporal type is upgraded to new temporal type, +#ADD/CHANGE COLUMN, ADD INDEX operations succeed using INPLACE +#ALGORITHM. +ALTER TABLE t2 ADD COLUMN fld5 INT, ALGORITHM= INPLACE; +ALTER TABLE t2 ADD INDEX index2(fld5), ALGORITHM= INPLACE; +ALTER TABLE t2 CHANGE fld5 fld6 INT, ALGORITHM= INPLACE; +ALTER TABLE t2 MODIFY fld6 INT, ALGORITHM= INPLACE; +#Cleanup +DROP TABLE t2, t3; +# +# BUG 18985760 -"FAST" ALTER TABLE CHANGE ON ENUM COLUMN +# TRIGGERS FULL TABLE REBUILD. +# +# To support INPLACE ALTER table operations later in the test. +ALTER TABLE t1 ENGINE= INNODB; +#Test cases with the global variable 'avoid_temporal_upgrade' +#enabled. +SET @save_avoid_temporal_upgrade= @@global.avoid_temporal_upgrade; +Warnings: +Warning 1287 '@@avoid_temporal_upgrade' is deprecated and will be removed in a future release. +SET GLOBAL avoid_temporal_upgrade= ON; +Warnings: +Warning 1287 '@@avoid_temporal_upgrade' is deprecated and will be removed in a future release. +#ALTER operations using INPLACE algorithm are allowed +#when the table contains old temporal type since +#the global variable 'avoid_temporal_upgrade' is +#enabled. The old temporal types are not upgraded. +CREATE TABLE t2 LIKE t1; +INSERT INTO t2 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22'); +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 0000124A7C3C8A4E 4ECAA4EE +ALTER TABLE t2 ADD COLUMN fld4 TIMESTAMP, ALGORITHM= INPLACE; +SELECT f_time, f_datetime, f_timestamp, fld4, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)), +HEX(WEIGHT_STRING(fld4)) FROM t2; +f_time f_datetime f_timestamp fld4 HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) HEX(WEIGHT_STRING(fld4)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 0000-00-00 00:00:00 83640E 0000124A7C3C8A4E 4ECAA4EE 00000000 +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 0000124A7C3C8A4E 4ECAA4EE +ALTER TABLE t2 ADD COLUMN fld5 TIME DEFAULT '101010' FIRST, ALGORITHM= INPLACE; +SELECT f_time, f_datetime, f_timestamp, fld5, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)), +HEX(WEIGHT_STRING(fld5)) FROM t2; +f_time f_datetime f_timestamp fld5 HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) HEX(WEIGHT_STRING(fld5)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 10:10:10 83640E 0000124A7C3C8A4E 4ECAA4EE 80A28A +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 0000124A7C3C8A4E 4ECAA4EE +ALTER TABLE t2 ADD COLUMN fld6 TIMESTAMP AFTER f_timestamp, ALGORITHM= INPLACE; +SELECT f_time, f_datetime, f_timestamp, fld6, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)), +HEX(WEIGHT_STRING(fld6)) FROM t2; +f_time f_datetime f_timestamp fld6 HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) HEX(WEIGHT_STRING(fld6)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 0000-00-00 00:00:00 83640E 0000124A7C3C8A4E 4ECAA4EE 00000000 +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 0000124A7C3C8A4E 4ECAA4EE +ALTER TABLE t2 ADD INDEX index1(f_datetime), ALGORITHM= INPLACE; +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 0000124A7C3C8A4E 4ECAA4EE +DROP TABLE t2; +#ALTER operations using COPY algorithm are allowed +#when the table contains old temporal type and +#does not upgrade the old temporal types. +#ADD COLUMN does not upgrade the old temporal type. +CREATE TABLE t2 LIKE t1; +INSERT INTO t2 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22'); +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 0000124A7C3C8A4E 4ECAA4EE +ALTER TABLE t2 ADD COLUMN fld4 TIMESTAMP, ALGORITHM= COPY; +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 0000124A7C3C8A4E 4ECAA4EE +#ADD COLUMN FIRST does not upgrade the old temporal type. +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 0000124A7C3C8A4E 4ECAA4EE +ALTER TABLE t2 ADD COLUMN fld5 TIMESTAMP FIRST, ALGORITHM= COPY; +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 0000124A7C3C8A4E 4ECAA4EE +#ADD COLUMN AFTER does not upgrade the old temporal type. +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 0000124A7C3C8A4E 4ECAA4EE +ALTER TABLE t2 ADD COLUMN fld6 TIMESTAMP AFTER f_timestamp, ALGORITHM= COPY; +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 0000124A7C3C8A4E 4ECAA4EE +#CHANGE COLUMN upgrades the old temporal type only for the column which +#is changed. +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 0000124A7C3C8A4E 4ECAA4EE +ALTER TABLE t2 CHANGE COLUMN f_datetime fld7 DATETIME, ALGORITHM= COPY; +SELECT f_time, fld7, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(fld7)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time fld7 f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(fld7)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 998AAB6596 4ECAA4EE +#MODIFY COLUMN upgrades the old temporal type only for the column +#modified. +SELECT f_time, fld7, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(fld7)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time fld7 f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(fld7)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 998AAB6596 4ECAA4EE +ALTER TABLE t2 MODIFY f_timestamp DATETIME, ALGORITHM= COPY; +SELECT f_time, fld7, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(fld7)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time fld7 f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(fld7)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 998AAB6596 998AAB6596 +#ADD INDEX does not upgrade the old temporal type. +SELECT f_time, fld7, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(fld7)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time fld7 f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(fld7)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 998AAB6596 998AAB6596 +ALTER TABLE t2 ADD INDEX index1(f_time), ALGORITHM= COPY; +SELECT f_time, fld7, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(fld7)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time fld7 f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(fld7)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 998AAB6596 998AAB6596 +DROP TABLE t2; +#ALTER operations using DEFAULT algorithm are allowed +#when the table contains old temporal type and does not +#upgrade the old temporal types. +#ADD COLUMN does not upgrade the old temporal type. +CREATE TABLE t2 LIKE t1; +INSERT INTO t2 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22'); +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 0000124A7C3C8A4E 4ECAA4EE +ALTER TABLE t2 ADD COLUMN fld4 TIMESTAMP, ALGORITHM= DEFAULT; +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 0000124A7C3C8A4E 4ECAA4EE +#ADD COLUMN FIRST does not upgrade the old temporal type. +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 0000124A7C3C8A4E 4ECAA4EE +ALTER TABLE t2 ADD COLUMN fld5 TIMESTAMP FIRST, ALGORITHM= DEFAULT; +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 0000124A7C3C8A4E 4ECAA4EE +#ADD COLUMN AFTER does not upgrade the old temporal type. +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 0000124A7C3C8A4E 4ECAA4EE +ALTER TABLE t2 ADD COLUMN fld6 TIMESTAMP AFTER f_timestamp, ALGORITHM= DEFAULT; +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 0000124A7C3C8A4E 4ECAA4EE +#CHANGE COLUMN upgrades the old temporal type only for the column which +#is changed. +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 0000124A7C3C8A4E 4ECAA4EE +ALTER TABLE t2 CHANGE COLUMN f_datetime fld7 DATETIME, ALGORITHM= DEFAULT; +SELECT f_time, fld7, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(fld7)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time fld7 f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(fld7)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 998AAB6596 4ECAA4EE +#MODIFY COLUMN upgrades the old temporal type only for the column +#modified. +SELECT f_time, fld7, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(fld7)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time fld7 f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(fld7)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 998AAB6596 4ECAA4EE +ALTER TABLE t2 MODIFY f_timestamp DATETIME, ALGORITHM= DEFAULT; +SELECT f_time, fld7, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(fld7)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time fld7 f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(fld7)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 998AAB6596 998AAB6596 +#ADD INDEX does not upgrade the old temporal type. +SELECT f_time, fld7, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(fld7)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time fld7 f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(fld7)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 998AAB6596 998AAB6596 +ALTER TABLE t2 ADD INDEX index1(f_time), ALGORITHM= DEFAULT; +SELECT f_time, fld7, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(fld7)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time fld7 f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(fld7)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 998AAB6596 998AAB6596 +DROP TABLE t2; +#ALTER TABLE FORCE does not upgrade the old temporal types. +CREATE TABLE t2 LIKE t1; +INSERT INTO t2 VALUES ('22:22:22','2011-11-21 22:22:22','2011-11-21 22:22:22'); +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 0000124A7C3C8A4E 4ECAA4EE +ALTER TABLE t2 FORCE; +SELECT f_time, f_datetime, f_timestamp, HEX(WEIGHT_STRING(f_time)), +HEX(WEIGHT_STRING(f_datetime)), HEX(WEIGHT_STRING(f_timestamp)) FROM t2; +f_time f_datetime f_timestamp HEX(WEIGHT_STRING(f_time)) HEX(WEIGHT_STRING(f_datetime)) HEX(WEIGHT_STRING(f_timestamp)) +22:22:22 2011-11-21 22:22:22 2011-11-21 22:22:22 83640E 0000124A7C3C8A4E 4ECAA4EE +DROP TABLE t2; +SET @@global.avoid_temporal_upgrade= @save_avoid_temporal_upgrade; +Warnings: +Warning 1287 '@@avoid_temporal_upgrade' is deprecated and will be removed in a future release. +#Test cases with the session variable 'show_old_temporals' +#enabled. +#Setup +CREATE TABLE t2(fld1 time, fld2 datetime, fld3 timestamp); +SET @save_show_old_temporals= @@session.show_old_temporals; +Warnings: +Warning 1287 '@@show_old_temporals' is deprecated and will be removed in a future release. +SET SESSION show_old_temporals= ON; +Warnings: +Warning 1287 '@@show_old_temporals' is deprecated and will be removed in a future release. +#Displays a comment to indicate that the columns are of 5.5 +#binary format +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_time` time /* 5.5 binary format */ DEFAULT NULL, + `f_timestamp` timestamp /* 5.5 binary format */ NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `f_datetime` datetime /* 5.5 binary format */ DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t1'; +COLUMN_TYPE +time /* 5.5 binary format */ +timestamp /* 5.5 binary format */ +datetime /* 5.5 binary format */ +#Since the temporal types are in new format, no comment is +#displayed +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `fld1` time DEFAULT NULL, + `fld2` datetime DEFAULT NULL, + `fld3` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t2'; +COLUMN_TYPE +time +datetime +timestamp +#Does not display the comment for table with old temporal types +#since the session variable 'show_old_temporals' is OFF. +SET SESSION show_old_temporals= OFF; +Warnings: +Warning 1287 '@@show_old_temporals' is deprecated and will be removed in a future release. +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f_time` time DEFAULT NULL, + `f_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + `f_datetime` datetime DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +SELECT COLUMN_TYPE FROM information_schema.columns WHERE table_name='t1'; +COLUMN_TYPE +time +timestamp +datetime +#Cleanup +SET @@session.show_old_temporals= @save_show_old_temporals; +Warnings: +Warning 1287 '@@show_old_temporals' is deprecated and will be removed in a future release. +DROP TABLE t1, t2; +# +# Bug#21345391: ALTER TABLE ... CONVERT TO CHARACTER SET NOT EFFECT +# AND REMAIN A TEMP TABLE +CREATE TABLE t1 (fld1 INT PRIMARY KEY) ENGINE = INNODB CHARACTER SET gbk; +ALTER TABLE t1 CONVERT TO CHARACTER SET UTF8, ALGORITHM = INPLACE; +# Without fix, the CHARSET SET for table remains gbk. +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `fld1` int(11) NOT NULL, + PRIMARY KEY (`fld1`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +# Without fix, the temporary .frm file is not cleaned up. +DROP TABLE t1; +# Test cases added for coverage. +# Reports an error for tables containing datatypes supporting +# characters. +CREATE TABLE t1 (fld1 CHAR(10) PRIMARY KEY) ENGINE = INNODB CHARACTER SET gbk; +ALTER TABLE t1 CONVERT TO CHARACTER SET UTF8, ALGORITHM = INPLACE; +ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY. +DROP TABLE t1; +# ALTER TABLE, CHARACTER SET operation. +CREATE TABLE t1 (fld1 INT PRIMARY KEY, fld2 CHAR(10)) ENGINE = INNODB +CHARACTER SET gbk; +ALTER TABLE t1 CHARACTER SET UTF8, ALGORITHM = INPLACE; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `fld1` int(11) NOT NULL, + `fld2` char(10) CHARACTER SET gbk DEFAULT NULL, + PRIMARY KEY (`fld1`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/r/connect_debug.result b/mysql-wsrep-5.6/mysql-test/r/connect_debug.result new file mode 100644 index 00000000..7adb23d9 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/r/connect_debug.result @@ -0,0 +1,49 @@ + +# -- Bug#20201006: Spamming show processlist prevents old connection +# -- threads from cleaning up. +SET @saved_max_connections = @@global.max_connections; +SET GLOBAL max_connections = 2; + +# -- Check that we allow only max_connections + 1 connections here +connect con_1, localhost, root; +connect con_2, localhost, root; +connect(localhost,root,,test,MYSQL_PORT,MYSQL_SOCK); +connect con_3, localhost, root; +ERROR HY000: Too many connections + +# -- Ensure we have max_connections + 1 connections. +SELECT count(*)= @@global.max_connections + 1 FROM information_schema.processlist; +count(*)= @@global.max_connections + 1 +1 + +# -- Take LOCK_thd_remove and close one connection then +# attempt new one [should fail]... +SET DEBUG_SYNC='fill_schema_processlist_after_copying_threads SIGNAL disconnect_connection WAIT_FOR continue'; +SELECT user FROM INFORMATION_SCHEMA.PROCESSLIST GROUP BY user;; +connection default; +SET DEBUG_SYNC='now WAIT_FOR disconnect_connection'; +disconnect con_1; +connect(localhost,root,,test,MYSQL_PORT,MYSQL_SOCK); +connect con_3, localhost, root; +ERROR HY000: Too many connections + +# -- Release the lock. Now new connection should go through +SET DEBUG_SYNC='now SIGNAL continue'; +connection con_2; +user +root +SET DEBUG_SYNC='RESET'; + +# -- Waiting for connection to close... +connect con_3, localhost, root; + +# -- Closing connections... +disconnect con_3; +disconnect con_2; +connection default; + +# -- Resetting variables... +SET GLOBAL max_connections= @saved_max_connections; + +# -- End of Bug#20201006. + diff --git a/mysql-wsrep-5.6/mysql-test/r/ctype_utf8.result b/mysql-wsrep-5.6/mysql-test/r/ctype_utf8.result index 52e84818..04e91815 100644 --- a/mysql-wsrep-5.6/mysql-test/r/ctype_utf8.result +++ b/mysql-wsrep-5.6/mysql-test/r/ctype_utf8.result @@ -113,7 +113,7 @@ hex(a) STRCMP(a,'a') STRCMP(a,'a ') DROP TABLE t1; select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es'); insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es') -this is a test +this is test select insert("aa",100,1,"b"),insert("aa",1,3,"b"); insert("aa",100,1,"b") insert("aa",1,3,"b") aa b @@ -5141,7 +5141,8 @@ 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' +COUNT(*) +25 DROP TABLE t1; # # Bug#11764503 (Bug#57341) Query in EXPLAIN EXTENDED shows wrong characters diff --git a/mysql-wsrep-5.6/mysql-test/r/ctype_utf8mb4.result b/mysql-wsrep-5.6/mysql-test/r/ctype_utf8mb4.result index 3b7a5604..e1824d4c 100644 --- a/mysql-wsrep-5.6/mysql-test/r/ctype_utf8mb4.result +++ b/mysql-wsrep-5.6/mysql-test/r/ctype_utf8mb4.result @@ -116,7 +116,7 @@ hex(a) STRCMP(a,'a') STRCMP(a,'a ') DROP TABLE t1; select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es'); insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es') -this is a test +this is test select insert("aa",100,1,"b"),insert("aa",1,3,"b"); insert("aa",100,1,"b") insert("aa",1,3,"b") aa b diff --git a/mysql-wsrep-5.6/mysql-test/r/ctype_utf8mb4_heap.result b/mysql-wsrep-5.6/mysql-test/r/ctype_utf8mb4_heap.result index 1c6b997a..5902c6b3 100644 --- a/mysql-wsrep-5.6/mysql-test/r/ctype_utf8mb4_heap.result +++ b/mysql-wsrep-5.6/mysql-test/r/ctype_utf8mb4_heap.result @@ -116,7 +116,7 @@ hex(a) STRCMP(a,'a') STRCMP(a,'a ') DROP TABLE t1; select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es'); insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es') -this is a test +this is test select insert("aa",100,1,"b"),insert("aa",1,3,"b"); insert("aa",100,1,"b") insert("aa",1,3,"b") aa b diff --git a/mysql-wsrep-5.6/mysql-test/r/ctype_utf8mb4_innodb.result b/mysql-wsrep-5.6/mysql-test/r/ctype_utf8mb4_innodb.result index ff2d9bc5..473bc2f8 100644 --- a/mysql-wsrep-5.6/mysql-test/r/ctype_utf8mb4_innodb.result +++ b/mysql-wsrep-5.6/mysql-test/r/ctype_utf8mb4_innodb.result @@ -116,7 +116,7 @@ hex(a) STRCMP(a,'a') STRCMP(a,'a ') DROP TABLE t1; select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es'); insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es') -this is a test +this is test select insert("aa",100,1,"b"),insert("aa",1,3,"b"); insert("aa",100,1,"b") insert("aa",1,3,"b") aa b diff --git a/mysql-wsrep-5.6/mysql-test/r/ctype_utf8mb4_myisam.result b/mysql-wsrep-5.6/mysql-test/r/ctype_utf8mb4_myisam.result index f1e77a51..bd165a27 100644 --- a/mysql-wsrep-5.6/mysql-test/r/ctype_utf8mb4_myisam.result +++ b/mysql-wsrep-5.6/mysql-test/r/ctype_utf8mb4_myisam.result @@ -116,7 +116,7 @@ hex(a) STRCMP(a,'a') STRCMP(a,'a ') DROP TABLE t1; select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es'); insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es') -this is a test +this is test select insert("aa",100,1,"b"),insert("aa",1,3,"b"); insert("aa",100,1,"b") insert("aa",1,3,"b") aa b diff --git a/mysql-wsrep-5.6/mysql-test/r/enable_cleartext_plugin.result b/mysql-wsrep-5.6/mysql-test/r/enable_cleartext_plugin.result new file mode 100644 index 00000000..d986fd99 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/r/enable_cleartext_plugin.result @@ -0,0 +1,39 @@ +# +# Bug #21235226 : THE --ENABLE-CLEARTEXT-PLUGIN IS NOT IMPLEMENTED +# IN ALL CLIENT PROGRAMS +# +CREATE DATABASE db21235226; +USE db21235226; +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (1), (2); +SELECT * FROM t1; +a +1 +2 +CREATE USER uplain@localhost IDENTIFIED WITH 'cleartext_plugin_server' + AS 'cleartext_test'; +GRANT ALL PRIVILEGES ON *.* TO uplain@localhost; +Warning: Using a password on the command line interface can be insecure. +mysqldump: Got error: 2059: Authentication plugin 'mysql_clear_password' cannot be loaded: plugin not enabled when trying to connect +SELECT * FROM t1; +a +Warning: Using a password on the command line interface can be insecure. +mysqlimport: Error: 2059 Authentication plugin 'mysql_clear_password' cannot be loaded: plugin not enabled +SELECT * FROM t1; +a +1 +2 +Warning: Using a password on the command line interface can be insecure. +mysqlshow: Authentication plugin 'mysql_clear_password' cannot be loaded: plugin not enabled +Database: db21235226 ++--------+ +| Tables | ++--------+ +| t1 | ++--------+ +Warning: Using a password on the command line interface can be insecure. +mysqlcheck: Got error: 2059: Authentication plugin 'mysql_clear_password' cannot be loaded: plugin not enabled when trying to connect +db21235226.t1 OK +DROP TABLE t1; +DROP DATABASE db21235226; +DROP USER uplain@localhost; diff --git a/mysql-wsrep-5.6/mysql-test/r/events_1.result b/mysql-wsrep-5.6/mysql-test/r/events_1.result index f50915aa..8f2c7416 100644 --- a/mysql-wsrep-5.6/mysql-test/r/events_1.result +++ b/mysql-wsrep-5.6/mysql-test/r/events_1.result @@ -114,7 +114,7 @@ create table t_event3 (a int, b float); drop event if exists event3; Warnings: Note 1305 Event event3 does not exist -create event event3 on schedule every 50 + 10 minute starts date_add("20100101", interval 5 minute) ends date_add("20151010", interval 5 day) comment "portokala_comment" DO insert into t_event3 values (unix_timestamp(), rand()); +create event event3 on schedule every 50 + 10 minute starts date_add(curdate(), interval 5 minute) ends date_add(curdate(), interval 5 day) comment "portokala_comment" DO insert into t_event3 values (unix_timestamp(), rand()); select count(*) from t_event3; count(*) 0 diff --git a/mysql-wsrep-5.6/mysql-test/r/explain.result b/mysql-wsrep-5.6/mysql-test/r/explain.result index 66396e11..2c600cfd 100644 --- a/mysql-wsrep-5.6/mysql-test/r/explain.result +++ b/mysql-wsrep-5.6/mysql-test/r/explain.result @@ -554,3 +554,18 @@ NULL UNION RESULT ALL NULL NULL NULL NULL NULL Using temporary DROP TABLE t1, t2; # End WL#4897 End of 6.0 tests. +# +# Bug #18899860: EXPLAIN .. SELECT .. FOR UPDATE TAKES LOCKS +# +CREATE TABLE t1(c1 INT PRIMARY KEY) ENGINE=INNODB; +INSERT INTO t1 VALUES (1),(2),(3); +START TRANSACTION; +EXPLAIN SELECT * FROM t1 WHERE c1 = 1 FOR UPDATE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index +START TRANSACTION; +EXPLAIN SELECT * FROM t1 WHERE c1 = 1 FOR UPDATE; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index +DROP TABLE t1; +# End of test for Bug#18899860 diff --git a/mysql-wsrep-5.6/mysql-test/r/fulltext.result b/mysql-wsrep-5.6/mysql-test/r/fulltext.result index 57daf798..175c1807 100644 --- a/mysql-wsrep-5.6/mysql-test/r/fulltext.result +++ b/mysql-wsrep-5.6/mysql-test/r/fulltext.result @@ -541,7 +541,7 @@ MATCH(a) AGAINST('aaa1* aaa14 aaa15 aaa16' IN BOOLEAN MODE) DROP TABLE t1; CREATE TABLE t1(a TEXT); SELECT GROUP_CONCAT(a) AS st FROM t1 HAVING MATCH(st) AGAINST('test' IN BOOLEAN MODE); -ERROR HY000: Incorrect arguments to AGAINST +ERROR HY000: Incorrect arguments to MATCH DROP TABLE t1; CREATE TABLE t1(a VARCHAR(64), FULLTEXT(a)); INSERT INTO t1 VALUES('awrd bwrd cwrd'),('awrd bwrd cwrd'),('awrd bwrd cwrd'); diff --git a/mysql-wsrep-5.6/mysql-test/r/func_math.result b/mysql-wsrep-5.6/mysql-test/r/func_math.result index 0eda71e3..b1111da2 100644 --- a/mysql-wsrep-5.6/mysql-test/r/func_math.result +++ b/mysql-wsrep-5.6/mysql-test/r/func_math.result @@ -636,9 +636,9 @@ ERROR 22003: BIGINT UNSIGNED value is out of range in '(18446744073709551615 DIV CREATE TABLE t1(a BIGINT, b BIGINT UNSIGNED); INSERT INTO t1 VALUES(-9223372036854775808, 9223372036854775809); SELECT -a FROM t1; -ERROR 22003: BIGINT value is out of range in '-('-9223372036854775808')' +ERROR 22003: BIGINT value is out of range in '-(`test`.`t1`.`a`)' SELECT -b FROM t1; -ERROR 22003: BIGINT value is out of range in '-('9223372036854775809')' +ERROR 22003: BIGINT value is out of range in '-(`test`.`t1`.`b`)' DROP TABLE t1; SET @a:=999999999999999999999999999999999999999999999999999999999999999999999999999999999; SELECT @a + @a; diff --git a/mysql-wsrep-5.6/mysql-test/r/func_str.result b/mysql-wsrep-5.6/mysql-test/r/func_str.result index 61b8c587..000e8eea 100644 --- a/mysql-wsrep-5.6/mysql-test/r/func_str.result +++ b/mysql-wsrep-5.6/mysql-test/r/func_str.result @@ -203,7 +203,7 @@ CONCAT('"',CONCAT_WS('";"',repeat('a',60),repeat('b',60),repeat('c',60),repeat(' "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";"cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc";"dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd" select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es'); insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es') -this is a test +this is test select replace('aaaa','a','b'),replace('aaaa','aa','b'),replace('aaaa','a','bb'),replace('aaaa','','b'),replace('bbbb','a','c'); replace('aaaa','a','b') replace('aaaa','aa','b') replace('aaaa','a','bb') replace('aaaa','','b') replace('bbbb','a','c') bbbb bb bbbbbbbb aaaa bbbb @@ -2336,7 +2336,7 @@ INSERT('abc', 3, 3, '1234') ab1234 SELECT INSERT('abc', 4, 3, '1234'); INSERT('abc', 4, 3, '1234') -abc1234 +abc SELECT INSERT('abc', 5, 3, '1234'); INSERT('abc', 5, 3, '1234') abc @@ -2623,7 +2623,7 @@ CREATE TABLE t1 ( a TEXT ); SELECT 'aaaaaaaaaaaaaa' INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug58165.txt';; SELECT insert( substring_index( 'a', 'a', 'b' ), 1, 0, 'x' ); insert( substring_index( 'a', 'a', 'b' ), 1, 0, 'x' ) -x + Warnings: Warning 1292 Truncated incorrect INTEGER value: 'b' LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug58165.txt' INTO TABLE t1;; @@ -4500,5 +4500,19 @@ a DROP TABLE t1; SET NAMES latin1; # +# Bug #21056907: CONTENTS OF NOT REQUESTED CHAR/VARCHAR COLUMN ARE +# REVEALED +CREATE TABLE t1 (id INT, d TEXT); +INSERT INTO t1 VALUES (1, 'this is a secret'), (2, 'public data'); +SELECT id, insert(':', 1, 0, d) FROM t1; +id insert(':', 1, 0, d) +1 this is a secret: +2 public data: +SELECT id, insert(0x3a, 1, 0, d) FROM t1; +id insert(0x3a, 1, 0, d) +1 this is a secret: +2 public data: +DROP TABLE t1; +# # End of 5.6 tests # diff --git a/mysql-wsrep-5.6/mysql-test/r/func_str_debug.result b/mysql-wsrep-5.6/mysql-test/r/func_str_debug.result new file mode 100644 index 00000000..7737cceb --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/r/func_str_debug.result @@ -0,0 +1,8 @@ +# Bug#20554017 CONCAT MAY INCORRECTLY COPY OVERLAPPING STRINGS +SET @old_debug= @@session.debug; +SET session debug='d,force_fake_uuid'; +do concat('111','11111111111111111111111111', +substring_index(uuid(),0,1.111111e+308)); +do concat_ws(',','111','11111111111111111111111111', +substring_index(uuid(),0,1.111111e+308)); +SET session debug= @old_debug; diff --git a/mysql-wsrep-5.6/mysql-test/r/func_str_no_ps.result b/mysql-wsrep-5.6/mysql-test/r/func_str_no_ps.result new file mode 100644 index 00000000..31f3666c --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/r/func_str_no_ps.result @@ -0,0 +1,24 @@ +# +# Bug#20315088 LCASE/LTRIM, SOURCE AND DESTINATION OVERLAP IN MEMCPY +# +do lcase(ltrim(from_unixtime(0,' %T '))); +do _cp852 "" <= lcase(trim(leading 1 from 12222)) not between '1' and '2'; +do decode(substring(sha1('1'),'11'),25); +do encode(mid(sysdate(),"5",1),'11'); +do upper(substring(1.111111111111111111 from '2n')); +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '2n' +Warning 1292 Truncated incorrect INTEGER value: '2n' +do nullif(1,'-' between lcase(right(11111111," 7,]" ))and '1'); +Warnings: +Warning 1292 Truncated incorrect INTEGER value: ' 7,]' +Warning 1292 Truncated incorrect INTEGER value: ' 7,]' +do upper(right(198039009115594390000000000000000000000.000000,35)); +do concat('111','11111111111111111111111111', +substring_index(uuid(),0,1.111111e+308)); +do replace(ltrim(from_unixtime(0,' %T ')), '0', '1'); +do insert(ltrim(from_unixtime(0,' %T ')), 2, 1, 'hi'); +set @old_collation_connection=@@collation_connection; +set collation_connection="utf8_general_ci"; +do replace(ltrim(from_unixtime(0,' %T ')), '0', '1'); +set collation_connection=@old_collation_connection; diff --git a/mysql-wsrep-5.6/mysql-test/r/galera_sst_mode.result b/mysql-wsrep-5.6/mysql-test/r/galera_sst_mode.result new file mode 100644 index 00000000..ea25b322 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/r/galera_sst_mode.result @@ -0,0 +1,24 @@ +# +# Test for mysqldump's galera-sst-mode option +# +# +# MDEV-6490: mysqldump unknown option --galera-sst-mode +# +CREATE DATABASE bug6490; +USE bug6490; +CREATE TABLE t1(c1 INT); +INSERT INTO t1 values (1); +INSERT INTO t1 values (2); +# Save the current gtid_binlog_state. +# Take a dump of bug6490 database +DROP TABLE t1; +# Load the dump +RESET MASTER; +SELECT * from t1; +c1 +1 +2 +# Compare the two gtid_binlog_state's +# Cleanup +DROP DATABASE bug6490; +# End of test diff --git a/mysql-wsrep-5.6/mysql-test/r/grant.result b/mysql-wsrep-5.6/mysql-test/r/grant.result index 5f7d2a7c..25a094b9 100644 --- a/mysql-wsrep-5.6/mysql-test/r/grant.result +++ b/mysql-wsrep-5.6/mysql-test/r/grant.result @@ -1696,6 +1696,7 @@ revoke create, insert on mysqltest.t6 from mysqltest@localhost; drop user mysqltest@localhost; drop database mysqltest; use test; +call mtr.add_suppression("Can't open and lock privilege tables"); FLUSH PRIVILEGES without procs_priv table. RENAME TABLE mysql.procs_priv TO mysql.procs_gone; FLUSH PRIVILEGES; diff --git a/mysql-wsrep-5.6/mysql-test/r/group_min_max.result b/mysql-wsrep-5.6/mysql-test/r/group_min_max.result index 78ae0012..a7fd7b8f 100644 --- a/mysql-wsrep-5.6/mysql-test/r/group_min_max.result +++ b/mysql-wsrep-5.6/mysql-test/r/group_min_max.result @@ -2046,7 +2046,7 @@ a BB EXPLAIN SELECT a FROM t1 WHERE a='AA' GROUP BY a; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref PRIMARY PRIMARY 7 const 3 Using where; Using index +1 SIMPLE t1 range PRIMARY PRIMARY 7 NULL 1 Using where; Using index for group-by EXPLAIN SELECT a FROM t1 WHERE a='BB' GROUP BY a; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref PRIMARY PRIMARY 7 const 1 Using where; Using index @@ -2444,7 +2444,7 @@ a b 3 13 explain extended select sql_buffer_result a, max(b)+1 from t1 where a = 0 group by a; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 ref PRIMARY,index PRIMARY 4 const 15 100.00 Using index; Using temporary +1 SIMPLE t1 range PRIMARY,index PRIMARY 4 NULL 3 100.00 Using where; Using index for group-by; Using temporary Warnings: Note 1003 /* select#1 */ select sql_buffer_result `test`.`t1`.`a` AS `a`,(max(`test`.`t1`.`b`) + 1) AS `max(b)+1` from `test`.`t1` where (`test`.`t1`.`a` = 0) group by `test`.`t1`.`a` drop table t1; @@ -3138,3 +3138,33 @@ SET optimizer_trace_max_mem_size=DEFAULT; SET optimizer_trace=DEFAULT; SET end_markers_in_json=DEFAULT; DROP TABLE t; +# +# Bug#18109609: LOOSE INDEX SCAN IS NOT USED WHEN IT SHOULD +# +CREATE TABLE t1 ( +id INT AUTO_INCREMENT PRIMARY KEY, +c1 INT, +c2 INT, +KEY(c1,c2)); +INSERT INTO t1(c1,c2) VALUES +(1, 1), (1,2), (2,1), (2,2), (3,1), (3,2), (3,3), (4,1), (4,2), (4,3), +(4,4), (4,5), (4,6), (4,7), (4,8), (4,9), (4,10), (4,11), (4,12), (4,13), +(4,14), (4,15), (4,16), (4,17), (4,18), (4,19), (4,20),(5,5); +EXPLAIN SELECT MAX(c2), c1 FROM t1 WHERE c1 = 4 GROUP BY c1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range c1 c1 5 NULL 7 Using where; Using index for group-by +FLUSH STATUS; +SELECT MAX(c2), c1 FROM t1 WHERE c1 = 4 GROUP BY c1; +MAX(c2) c1 +20 4 +SHOW SESSION STATUS LIKE 'Handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 3 +Handler_read_last 1 +Handler_read_next 0 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 0 +DROP TABLE t1; +# End of test for Bug#18109609 diff --git a/mysql-wsrep-5.6/mysql-test/r/have_wsrep.require b/mysql-wsrep-5.6/mysql-test/r/have_wsrep.require new file mode 100644 index 00000000..af32ac7d --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/r/have_wsrep.require @@ -0,0 +1,2 @@ +Variable_name Value +wsrep_on ON diff --git a/mysql-wsrep-5.6/mysql-test/r/having.result b/mysql-wsrep-5.6/mysql-test/r/having.result index 083e8967..782b3f2f 100644 --- a/mysql-wsrep-5.6/mysql-test/r/having.result +++ b/mysql-wsrep-5.6/mysql-test/r/having.result @@ -653,4 +653,82 @@ HAVING min_pk <= 10; MIN(table1.i4) min_pk DROP TABLE t1; +# +# Bug#17055185: WRONG RESULTS WHEN RUNNING A SELECT THAT INCLUDE +# A HAVING BASED ON A FUNCTION. +# +CREATE TABLE series ( +val INT(10) UNSIGNED NOT NULL +); +INSERT INTO series VALUES(1); +CREATE FUNCTION next_seq_value() RETURNS INT +BEGIN +DECLARE next_val INT; +SELECT val INTO next_val FROM series; +UPDATE series SET val=mod(val + 1, 2); +RETURN next_val; +END; +| +CREATE TABLE t1 (t INT, u INT, KEY(t)); +INSERT INTO t1 VALUES(10, 10), (11, 11), (12, 12), (12, 13),(14, 15), (15, 16), +(16, 17), (17, 18); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +SELECT t, next_seq_value() r FROM t1 FORCE INDEX(t) +GROUP BY t HAVING r = 1 ORDER BY t1.u; +t r +10 1 +12 1 +15 1 +17 1 +SELECT DISTINCT t1.t, next_seq_value() r FROM t1, t1 P +WHERE P.t = t1.t HAVING r = 1 ORDER BY t1.u; +t r +10 0 +11 0 +12 0 +14 0 +15 0 +16 0 +17 0 +PREPARE STMT FROM 'SELECT t, next_seq_value() r FROM t1 FORCE INDEX(t) + GROUP BY t HAVING (SELECT 1 FROM t1 WHERE r = 1 LIMIT 1) + ORDER BY t1.u'; +EXECUTE stmt; +t r +10 0 +11 0 +12 0 +14 0 +15 0 +16 0 +17 0 +EXECUTE stmt; +t r +10 0 +11 0 +12 0 +14 0 +15 0 +16 0 +17 0 +DEALLOCATE PREPARE stmt; +INSERT INTO t1 SELECT * FROM t1; +ALTER TABLE t1 ADD KEY(t, u); +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +SELECT next_seq_value() r, MIN(u) FROM t1 GROUP BY t HAVING r = 1; +r MIN(u) +0 10 +0 11 +0 12 +0 15 +0 16 +0 17 +0 18 +DROP TABLE t1; +DROP FUNCTION next_seq_value; +DROP TABLE series; End of 5.6 tests diff --git a/mysql-wsrep-5.6/mysql-test/r/information_schema.result b/mysql-wsrep-5.6/mysql-test/r/information_schema.result index fce2f40d..149babcb 100644 --- a/mysql-wsrep-5.6/mysql-test/r/information_schema.result +++ b/mysql-wsrep-5.6/mysql-test/r/information_schema.result @@ -1664,9 +1664,7 @@ drop table if exists t1;drop table if exists t1; drop table if exists t1;drop table if exists t1; drop table if exists t1;drop table if exists t1; drop table if exists t1;drop table if exists t1; -drop table if exists t1;drop table if exists -Warnings: -Warning 1265 Data truncated for column 'VARIABLE_VALUE' at row 1 +drop table if exists t1;drop table if exists t1; set global init_connect=""; create table t0 select * from information_schema.global_status where VARIABLE_NAME='COM_SELECT'; SELECT 1; diff --git a/mysql-wsrep-5.6/mysql-test/r/insert.result b/mysql-wsrep-5.6/mysql-test/r/insert.result index 6f7169e9..0763b89c 100644 --- a/mysql-wsrep-5.6/mysql-test/r/insert.result +++ b/mysql-wsrep-5.6/mysql-test/r/insert.result @@ -712,3 +712,41 @@ ERROR 42000: Column 'a' specified twice INSERT IGNORE t1 (a, a) SELECT 1,1 UNION SELECT 2,2; ERROR 42000: Column 'a' specified twice DROP TABLE t1; +# +# BUG#22037930: INSERT IGNORE FAILS TO IGNORE +# FOREIGN KEY CONSTRAINT +# Setup. +CREATE TABLE t1 (fld1 INT PRIMARY KEY) ENGINE=INNODB; +CREATE TABLE t2 (fld2 INT, FOREIGN KEY (fld2) REFERENCES t1 (fld1)) +ENGINE=INNODB; +INSERT INTO t1 VALUES(0); +INSERT INTO t2 VALUES(0); +# Without fix, an error is reported. +INSERT IGNORE INTO t2 VALUES(1); +Warnings: +Warning 1452 `test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`) +UPDATE IGNORE t2 SET fld2=20 WHERE fld2=0; +Warnings: +Warning 1452 `test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`) +UPDATE IGNORE t1 SET fld1=20 WHERE fld1=0; +Warnings: +Warning 1451 `test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`) +# Test for multi update. +UPDATE IGNORE t1, t2 SET t2.fld2= t2.fld2 + 3; +Warnings: +Warning 1452 `test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`) +UPDATE IGNORE t1, t2 SET t1.fld1= t1.fld1 + 3; +Warnings: +Warning 1451 `test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`) +# Reports an error since IGNORE is not used. +INSERT INTO t2 VALUES(1); +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`)) +UPDATE t2 SET fld2=20 WHERE fld2=0; +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`)) +UPDATE t1 SET fld1=20 WHERE fld1=0; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`)) +UPDATE t1, t2 SET t2.fld2= t2.fld2 + 3; +ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`)) +UPDATE t1, t2 SET t1.fld1= t1.fld1 + 3; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`)) +DROP TABLE t2, t1; diff --git a/mysql-wsrep-5.6/mysql-test/r/loadxml.result b/mysql-wsrep-5.6/mysql-test/r/loadxml.result index d7ae2a40..1128caf9 100644 --- a/mysql-wsrep-5.6/mysql-test/r/loadxml.result +++ b/mysql-wsrep-5.6/mysql-test/r/loadxml.result @@ -69,8 +69,8 @@ primary key (id) load xml infile '../../std_data/loadxml2.dat' into table t1; select * from t1; id text -1 line1 -line2 +1 line1 +line2 line3 drop table t1; # @@ -93,3 +93,30 @@ a b 216 !&bb b; 3 !b3 DROP TABLE t1; +# +# Bug#16171518 LOAD XML DOES NOT HANDLE EMPTY ELEMENTS +# +CREATE TABLE t1 (col1 VARCHAR(3), col2 VARCHAR(3), col3 VARCHAR(3), col4 VARCHAR(4)); +LOAD XML INFILE '../../std_data/bug16171518_1.dat' INTO TABLE t1; +SELECT * FROM t1 ORDER BY col1, col2, col3, col4; +col1 col2 col3 col4 +0bc def ghi jkl +1no NULL pqr stu +2BC DEF GHI JKL +3NO NULL PQR STU +4bc def ghi jkl +5no pqr stu vwx +6BC DEF NULL JKL +7NO PQR STU VWX +8bc def ghi NULL +9kl NULL mno pqr +ABC DEF NULL JKL +MNO NULL STU VWX +DROP TABLE t1; +CREATE TABLE t1 (col1 VARCHAR(3), col2 VARCHAR(3), col3 INTEGER); +LOAD XML INFILE '../../std_data/bug16171518_2.dat' INTO TABLE t1; +SELECT * FROM t1 ORDER BY col1, col2, col3; +col1 col2 col3 +ABC DEF NULL +GHI NULL 123 +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/r/log_empty_name.result b/mysql-wsrep-5.6/mysql-test/r/log_empty_name.result new file mode 100644 index 00000000..2ff2e0ff --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/r/log_empty_name.result @@ -0,0 +1,6 @@ +# -- +# -- Bug#19392264: SERVER CRASH WHEN SPECIFYING EMPTY --GENERAL-LOG-FILE +# -- OPTION +# -- +# Before fix, server should crash. After fix server has to start +# successfully with the options provided in general_log-master.opt file. diff --git a/mysql-wsrep-5.6/mysql-test/r/lowercase_fs_on.result b/mysql-wsrep-5.6/mysql-test/r/lowercase_fs_on.result new file mode 100644 index 00000000..a090f46c --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/r/lowercase_fs_on.result @@ -0,0 +1,3 @@ +# +# Bug#20198490 : LOWER_CASE_TABLE_NAMES=0 ON WINDOWS LEADS TO PROBLEMS +# diff --git a/mysql-wsrep-5.6/mysql-test/r/lowercase_table3.result b/mysql-wsrep-5.6/mysql-test/r/lowercase_table3.result deleted file mode 100644 index 1beed103..00000000 --- a/mysql-wsrep-5.6/mysql-test/r/lowercase_table3.result +++ /dev/null @@ -1,11 +0,0 @@ -call mtr.add_suppression("InnoDB: Cannot open table test/BUG29839 from"); -DROP TABLE IF EXISTS t1,T1; -CREATE TABLE t1 (a INT); -SELECT * FROM T1; -a -FLUSH TABLES; -DROP TABLE t1; -CREATE TABLE bug29839 (a INT) ENGINE=INNODB; -SELECT * FROM BUG29839; -ERROR 42S02: Table 'test.BUG29839' doesn't exist -DROP TABLE bug29839; diff --git a/mysql-wsrep-5.6/mysql-test/r/mdl_sync.result b/mysql-wsrep-5.6/mysql-test/r/mdl_sync.result index a1ab0baf..a9cee65d 100644 --- a/mysql-wsrep-5.6/mysql-test/r/mdl_sync.result +++ b/mysql-wsrep-5.6/mysql-test/r/mdl_sync.result @@ -3101,3 +3101,53 @@ SET DEBUG_SYNC= 'now SIGNAL continue'; # Connection default DROP TABLE m1, t1, t2; SET DEBUG_SYNC= 'RESET'; +# +# Bug#21021848 ASSERTION `M_STATUS == DA_ERROR' FAILED. +# +CREATE TABLE t1(c1 INT NOT NULL) ENGINE = csv; +CREATE TABLE t2(c1 INT NOT NULL); +# Emulate corruption of t1 +LOCK TABLES t1 WRITE; +INSERT INTO t1 VALUES(0); +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check error Corrupt +UNLOCK TABLES; +# Start XA txn on default +XA START 'test2'; +# Acquire SR on t2 +SELECT * FROM t2; +c1 +# Block IS query just before calling lock_table_names() (before X on t1) +SET DEBUG_SYNC='recover_ot_repair SIGNAL parked WAIT_FOR go'; +SELECT COUNT(*)FROM information_schema.key_column_usage; +# Create a new conncection which will compete for MDL lock +# Wait until default becomes blocked +SET DEBUG_SYNC='now WAIT_FOR parked'; +# Try to acquire X on t1 and t2, which will block while default +# holds SR on t2 +DROP TABLES t1, t2; +# Create control connection +# Wait until con1 is blocked +# Wake up XA txn/IS query on default +SET DEBUG_SYNC='now SIGNAL go'; +# Disconnect control connection +# Switch to default connection +# Wait for IS query which will try repair t1 which requires X. +# Previously that resulted in deadlock with con1 over t1, +# but now t1 is skipped and a warning is issued +COUNT(*) +59 +Warnings: +Warning 1194 Table 't1' is marked as crashed and should be repaired +# Finish XA txn 'test2' to release SR on t2 so that con1 +# becomes unblocked +XA END 'test2'; +XA PREPARE 'test2'; +XA COMMIT 'test2'; +# Cleanup +SET DEBUG_SYNC= 'RESET'; +# Clean up con1 now that the XA txn has finished +# Wait for the now unblocked DROP t1, t2 to complete +# Disconnecting con1 +# Switching to back to default at end of test case diff --git a/mysql-wsrep-5.6/mysql-test/r/merge_recover.result b/mysql-wsrep-5.6/mysql-test/r/myisam_recover.result similarity index 59% rename from mysql-wsrep-5.6/mysql-test/r/merge_recover.result rename to mysql-wsrep-5.6/mysql-test/r/myisam_recover.result index 871c12ca..be828694 100644 --- a/mysql-wsrep-5.6/mysql-test/r/merge_recover.result +++ b/mysql-wsrep-5.6/mysql-test/r/myisam_recover.result @@ -1,5 +1,7 @@ # -# Test of MyISAM MRG tables with corrupted children. +# Tests for corrupted MyISAM tables and MyISAMMRG tables with corrupted +# children.. +# # Run with --myisam-recover=force option. # # Preparation: we need to make sure that the merge parent @@ -16,6 +18,8 @@ call mtr.add_suppression("Got an error from thread_id=.*ha_myisam.cc:"); call mtr.add_suppression("MySQL thread id .*, query id .* localhost.*root Checking table"); call mtr.add_suppression(" '\..test.t1'"); +set @start_table_open_cache=@@global.table_open_cache; +set @start_table_definition_cache=@@global.table_definition_cache; set global table_open_cache=256; set global table_definition_cache=400; drop procedure if exists p_create; @@ -44,20 +48,20 @@ drop procedure p_create; # Switching to connection 'default' # # -# We have to disable the ps-protocol, to avoid +# We have to disable the ps-protocol, to avoid # "Prepared statement needs to be re-prepared" errors # -- table def versions change all the time with full table cache. -# +# drop table if exists t1, t1_mrg, t1_copy; # # Prepare a MERGE engine table, that refers to a corrupted # child. -# +# create table t1 (a int, key(a)) engine=myisam; create table t1_mrg (a int) union (t1) engine=merge; # # Create a table with a corrupted index file: -# save an old index file, insert more rows, +# save an old index file, insert more rows, # overwrite the new index file with the old one. # insert into t1 (a) values (1), (2), (3); @@ -99,5 +103,50 @@ unlock tables; prepare stmt from @drop_table_stmt; execute stmt; deallocate prepare stmt; -set @@global.table_definition_cache=default; -set @@global.table_open_cache=default; +set @@global.table_definition_cache=@start_table_definition_cache; +set @@global.table_open_cache=@start_table_open_cache; +# +# 18075170 - sql node restart required to avoid deadlock after +# restore +# +# Check that auto-repair for MyISAM tables can now happen in the +# middle of transaction, without aborting it. +create table t1 (a int, key(a)) engine=myisam; +create table t2 (a int); +insert into t2 values (1); +# Create a table with a corrupted index file: +# save an old index file, insert more rows, +# overwrite the new index file with the old one. +insert into t1 (a) values (1); +flush table t1; +insert into t1 (a) values (4); +flush table t1; +# Check table is needed to mark the table as crashed. +check table t1; +Table Op Msg_type Msg_text +test.t1 check warning Size of datafile is: 14 Should be: 7 +test.t1 check error Record-count is not ok; is 2 Should be: 1 +test.t1 check warning Found 2 key parts. Should be: 1 +test.t1 check error Corrupt +# At this point we have a corrupt t1 +set autocommit = 0; +select * from t2; +a +1 +# Without fix select from t1 will break the transaction. After the fix +# transaction should be active and should hold lock on table t2. Alter +# table from con2 will wait only if the transaction is not broken. +select * from t1; +a +1 +4 +Warnings: +Error 145 Table 't1' is marked as crashed and should be repaired +Error 1194 Table 't1' is marked as crashed and should be repaired +Error 1034 Number of rows changed from 1 to 2 +ALTER TABLE t2 ADD val INT; +# With fix we should have alter table waiting for t2 lock here. +ROLLBACK; +SET autocommit = 1; +# Cleanup +drop table t1, t2; diff --git a/mysql-wsrep-5.6/mysql-test/r/mysql_binary_mode.result b/mysql-wsrep-5.6/mysql-test/r/mysql_binary_mode.result index 0eee0f81..cb230037 100644 --- a/mysql-wsrep-5.6/mysql-test/r/mysql_binary_mode.result +++ b/mysql-wsrep-5.6/mysql-test/r/mysql_binary_mode.result @@ -4,24 +4,24 @@ RESET MASTER; # The test verify that 0x00 and 0x0D0A sequence can be handled correctly by # mysql -CREATE TABLE `A +CREATE TABLE `A B` (c1 CHAR(100)); # It is a faked statement. ASCII 0 is in the original statement, it would # make the test result to become a binary file which was difficult to get # the diff result if the original query was logged in the result. INSERT INTO `A\r\nB` VALUES("A\0B"); -INSERT INTO `A -B` VALUES("A +INSERT INTO `A +B` VALUES("A B"); -SELECT HEX(c1) FROM `A +SELECT HEX(c1) FROM `A B`; HEX(c1) 410042 410D0A42 FLUSH LOGS; -DROP TABLE `A +DROP TABLE `A B`; RESET MASTER; @@ -36,13 +36,13 @@ DROP TABLE `TABLE_NAME_MASKED`; # In binary_mode, table name '0x410D0A42' and string '0x410042' can be # handled correctly. RESET MASTER; -SELECT HEX(c1) FROM `A +SELECT HEX(c1) FROM `A B`; HEX(c1) 410042 410D0A42 -DROP TABLE `A +DROP TABLE `A B`; RESET MASTER; include/assert.inc [Table and contents created through mysqltest match 0x610D0A62.] diff --git a/mysql-wsrep-5.6/mysql-test/r/mysql_config_editor.result b/mysql-wsrep-5.6/mysql-test/r/mysql_config_editor.result index a84fa308..f1acfc73 100644 --- a/mysql-wsrep-5.6/mysql-test/r/mysql_config_editor.result +++ b/mysql-wsrep-5.6/mysql-test/r/mysql_config_editor.result @@ -100,7 +100,7 @@ user = test_user4 ############################################## # Tests for mysql_config_editor's help command ############################################## -Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective diff --git a/mysql-wsrep-5.6/mysql-test/r/mysql_plugin.result b/mysql-wsrep-5.6/mysql-test/r/mysql_plugin.result index b2ccdce1..e971d8bc 100644 --- a/mysql-wsrep-5.6/mysql-test/r/mysql_plugin.result +++ b/mysql-wsrep-5.6/mysql-test/r/mysql_plugin.result @@ -105,7 +105,7 @@ ERROR: Missing --plugin_dir option. # Show the help. # mysql_plugin Ver V.V.VV Distrib XX.XX.XX -Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. Enable or disable plugins. diff --git a/mysql-wsrep-5.6/mysql-test/r/mysql_upgrade.result b/mysql-wsrep-5.6/mysql-test/r/mysql_upgrade.result index 627f359a..5c1616a0 100644 --- a/mysql-wsrep-5.6/mysql-test/r/mysql_upgrade.result +++ b/mysql-wsrep-5.6/mysql-test/r/mysql_upgrade.result @@ -115,7 +115,7 @@ DROP USER mysqltest1@'%'; Run mysql_upgrade with a non existing server socket Warning: Using a password on the command line interface can be insecure. mysqlcheck: Got error: 2005: Unknown MySQL server host 'not_existing_host' (errno) when trying to connect -FATAL ERROR: Upgrade failed +FATAL ERROR: Error during call to mysql_check for fixing the db/tables names on mysql db set GLOBAL sql_mode='STRICT_ALL_TABLES,ANSI_QUOTES,NO_ZERO_DATE'; Warnings: Warning 1681 'NO_ZERO_DATE' is deprecated and will be removed in a future release. @@ -502,5 +502,12 @@ DROP USER B20023823_empty@localhost; DROP USER B20023823_def@localhost; DROP USER B20023823_41hash@localhost; DROP USER B20023823_16hash@localhost; +# +# Bug #21489398: MYSQL_UPGRADE: FATAL ERROR: UPGRADE FAILED - IMPROVE ERROR +# +Run mysql_upgrade with unauthorized access +Warning: Using a password on the command line interface can be insecure. +Error: Failed while fetching Server version! Could be due to unauthorized access. +FATAL ERROR: Upgrade failed End of tests diff --git a/mysql-wsrep-5.6/mysql-test/r/mysqld--help-notwin.result b/mysql-wsrep-5.6/mysql-test/r/mysqld--help-notwin.result index 18b21ffd..ab5251c6 100644 --- a/mysql-wsrep-5.6/mysql-test/r/mysqld--help-notwin.result +++ b/mysql-wsrep-5.6/mysql-test/r/mysqld--help-notwin.result @@ -28,6 +28,12 @@ The following options may be given as the first argument: --automatic-sp-privileges Creating and dropping stored procedures alters ACLs (Defaults to on; use --skip-automatic-sp-privileges to disable.) + --avoid-temporal-upgrade + When this option is enabled, the pre-5.6.4 temporal types + are not upgraded to the new format for ALTER TABLE + requests ADD/CHANGE/MODIFY COLUMN, ADD INDEX or FORCE + operation. This variable is deprecated and will be + removed in a future release. --back-log=# The number of outstanding connection requests MySQL can have. This comes into play when the main MySQL thread gets very many connection requests in a very short time @@ -73,18 +79,20 @@ The following options may be given as the first argument: and back implicitly per each query accessing an NDBCLUSTER table --binlog-gtid-simple-recovery - If this option is enabled, the server does not scan more - than one binary log for every iteration when initializing - GTID sets on server restart. Enabling this option is very - useful when restarting a server which has already - generated lots of binary logs without GTID events. Note: - If this option is enabled, GLOBAL.GTID_EXECUTED and - GLOBAL.GTID_PURGED cannot be initialized correctly if - binary log(s) with GTID events were generated before - binary log(s) without GTID events, for example if - gtid_mode is disabled when the server has already - generated binary log(s) with GTID events and not purged - them. + If this option is enabled, the server does not open more + than two binary logs when initializing GTID_PURGED and + GTID_EXECUTED, either during server restart or when + binary logs are being purged. Enabling this option is + useful when the server has already generated many binary + logs without GTID events (e.g., having GTID_MODE = OFF). + Note: If this option is enabled, GLOBAL.GTID_EXECUTED and + GLOBAL.GTID_PURGED may be initialized wrongly in two + cases: (1) GTID_MODE was ON for some binary logs but OFF + for the newest binary log. (2) SET GTID_PURGED was issued + after the oldest existing binary log was generated. If a + wrong set is computed in one of case (1) or case (2), it + will remain wrong even if the server is later restarted + with this option disabled. --binlog-ignore-db=name Tells the master that updates to the given database should not be logged to the binary log. @@ -409,6 +417,8 @@ The following options may be given as the first argument: INSERT DELAYED statements. If set to zero INSERT DELAYED will be not used.This variable is deprecated along with INSERT DELAYED. + --max-digest-length=# + Maximum length considered for digest text. --max-error-count=# Max number of errors/warnings to store for a statement --max-heap-table-size=# Don't allow creation of heap tables bigger than this @@ -500,8 +510,8 @@ The following options may be given as the first argument: If this is not 0, then mysqld will use this value to reserve file descriptors to use with setrlimit(). If this value is 0 then mysqld will reserve max_connections*5 or - max_connections + table_cache*2 (whichever is larger) - number of file descriptors + max_connections + table_open_cache*2 (whichever is + larger) number of file descriptors --optimizer-prune-level=# Controls the heuristic(s) applied during query optimization to prune less-promising partial plans from @@ -621,6 +631,9 @@ The following options may be given as the first argument: --performance-schema-max-cond-instances=# Maximum number of instrumented condition objects. Use 0 to disable, -1 for automated sizing. + --performance-schema-max-digest-length=# + Maximum length considered for digest text, when stored in + performance_schema tables. --performance-schema-max-file-classes=# Maximum number of file instruments. --performance-schema-max-file-handles=# @@ -831,6 +844,12 @@ The following options may be given as the first argument: --server-id=# Uniquely identifies the server instance in the community of replication partners --server-id-bits=# Set number of significant bits in server-id + --show-old-temporals + When this option is enabled, the pre-5.6.4 temporal types + will be marked in the 'SHOW CREATE TABLE' and + 'INFORMATION_SCHEMA.COLUMNS' table as a comment in + COLUMN_TYPE field. This variable is deprecated and will + be removed in a future release. --show-slave-auth-info Show user and password in SHOW SLAVE HOSTS on this master. @@ -1010,6 +1029,97 @@ The following options may be given as the first argument: -V, --version Output version information and exit. --wait-timeout=# The number of seconds the server waits for activity on a connection before closing it + --wsrep-OSU-method[=name] + Method for Online Schema Upgrade + --wsrep-auto-increment-control + To automatically control the assignment of autoincrement + variables + (Defaults to on; use --skip-wsrep-auto-increment-control to disable.) + --wsrep-causal-reads + (DEPRECATED) setting this variable is equivalent to + setting wsrep_sync_wait READ flag + --wsrep-certify-nonPK + Certify tables with no primary key + (Defaults to on; use --skip-wsrep-certify-nonPK to disable.) + --wsrep-cluster-address=name + Address to initially connect to cluster + --wsrep-cluster-name=name + Name for the cluster + --wsrep-convert-LOCK-to-trx + To convert locking sessions into transactions + --wsrep-data-home-dir=name + home directory for wsrep provider + --wsrep-dbug-option=name + DBUG options to provider library + --wsrep-debug To enable debug level logging + --wsrep-desync To desynchronize the node from the cluster + --wsrep-dirty-reads Allow reads from a node is not in primary component + --wsrep-drupal-282555-workaround + To use a workaround forbad autoincrement value + --wsrep-forced-binlog-format=name + binlog format to take effect over user's choice + --wsrep-load-data-splitting + To commit LOAD DATA transaction after every 10K rows + inserted + (Defaults to on; use --skip-wsrep-load-data-splitting to disable.) + --wsrep-log-conflicts + To log multi-master conflicts + --wsrep-max-ws-rows=# + Max number of rows in write set + --wsrep-max-ws-size=# + Max write set size (bytes) + --wsrep-mysql-replication-bundle=# + mysql replication group commit + --wsrep-node-address=name + Node address + --wsrep-node-incoming-address=name + Client connection address + --wsrep-node-name=name + Node name + --wsrep-notify-cmd=name + --wsrep-on To enable wsrep replication + (Defaults to on; use --skip-wsrep-on to disable.) + --wsrep-preordered To enable preordered write set processing + --wsrep-provider=name + Path to replication provider library + --wsrep-provider-options=name + provider specific options + --wsrep-recover Recover database state after crash and exit + --wsrep-reject-queries[=name] + Variable to set to reject queries + --wsrep-replicate-myisam + To enable myisam replication + --wsrep-restart-slave + Should MySQL slave be restarted automatically, when node + joins back to cluster + --wsrep-retry-autocommit=# + Max number of times to retry a failed autocommit + statement + --wsrep-slave-FK-checks + Should slave thread do foreign key constraint checks + (Defaults to on; use --skip-wsrep-slave-FK-checks to disable.) + --wsrep-slave-UK-checks + Should slave thread do secondary index uniqueness chesks + --wsrep-slave-threads=# + Number of slave appliers to launch + --wsrep-sst-auth=name + Authentication for SST connection + --wsrep-sst-donor=name + preferred donor node for the SST + --wsrep-sst-donor-rejects-queries + Reject client queries when donating state snapshot + transfer + --wsrep-sst-method=name + State snapshot transfer method + --wsrep-sst-receive-address=name + Address where node is waiting for SST contact + --wsrep-start-position=name + global transaction position to start from + --wsrep-sync-wait[=#] + Ensure "synchronous" read view before executing an + operation of the type specified by bitmask: 1 - + READ(includes SELECT, SHOW and BEGIN/START TRANSACTION); + 2 - UPDATE and DELETE; 4 - INSERT and REPLACE Variables (--variable-name=value) abort-slave-event-count 0 @@ -1018,6 +1128,7 @@ auto-increment-increment 1 auto-increment-offset 1 autocommit TRUE automatic-sp-privileges TRUE +avoid-temporal-upgrade FALSE back-log 80 big-tables FALSE bind-address * @@ -1129,6 +1240,7 @@ max-binlog-stmt-cache-size 18446744073709547520 max-connect-errors 100 max-connections 151 max-delayed-threads 20 +max-digest-length 1024 max-error-count 64 max-heap-table-size 16777216 max-join-size 18446744073709551615 @@ -1197,6 +1309,7 @@ performance-schema-hosts-size -1 performance-schema-instrument performance-schema-max-cond-classes 80 performance-schema-max-cond-instances -1 +performance-schema-max-digest-length 1024 performance-schema-max-file-classes 50 performance-schema-max-file-handles 32768 performance-schema-max-file-instances -1 @@ -1249,6 +1362,7 @@ secure-auth TRUE secure-file-priv (No default value) server-id 0 server-id-bits 32 +show-old-temporals FALSE show-slave-auth-info FALSE simplified-binlog-gtid-recovery FALSE skip-grant-tables TRUE @@ -1299,6 +1413,47 @@ updatable-views-with-limit YES validate-user-plugins TRUE verbose TRUE wait-timeout 28800 +wsrep-OSU-method TOI +wsrep-auto-increment-control TRUE +wsrep-causal-reads FALSE +wsrep-certify-nonPK TRUE +wsrep-cluster-address +wsrep-cluster-name my_wsrep_cluster +wsrep-convert-LOCK-to-trx FALSE +wsrep-data-home-dir +wsrep-dbug-option +wsrep-debug FALSE +wsrep-desync FALSE +wsrep-dirty-reads FALSE +wsrep-drupal-282555-workaround FALSE +wsrep-forced-binlog-format NONE +wsrep-load-data-splitting TRUE +wsrep-log-conflicts FALSE +wsrep-max-ws-rows 131072 +wsrep-max-ws-size 1073741824 +wsrep-mysql-replication-bundle 0 +wsrep-node-address +wsrep-node-incoming-address AUTO +wsrep-notify-cmd +wsrep-on FALSE +wsrep-preordered FALSE +wsrep-provider none +wsrep-provider-options +wsrep-recover FALSE +wsrep-reject-queries NONE +wsrep-replicate-myisam FALSE +wsrep-restart-slave FALSE +wsrep-retry-autocommit 1 +wsrep-slave-FK-checks TRUE +wsrep-slave-UK-checks FALSE +wsrep-slave-threads 1 +wsrep-sst-auth (No default value) +wsrep-sst-donor +wsrep-sst-donor-rejects-queries FALSE +wsrep-sst-method rsync +wsrep-sst-receive-address AUTO +wsrep-start-position 00000000-0000-0000-0000-000000000000:-1 +wsrep-sync-wait 0 To see what values a running MySQL server is using, type 'mysqladmin variables' instead of 'mysqld --verbose --help'. diff --git a/mysql-wsrep-5.6/mysql-test/r/mysqld--help-win.result b/mysql-wsrep-5.6/mysql-test/r/mysqld--help-win.result index 7e5e2596..f51feb53 100644 --- a/mysql-wsrep-5.6/mysql-test/r/mysqld--help-win.result +++ b/mysql-wsrep-5.6/mysql-test/r/mysqld--help-win.result @@ -28,6 +28,12 @@ The following options may be given as the first argument: --automatic-sp-privileges Creating and dropping stored procedures alters ACLs (Defaults to on; use --skip-automatic-sp-privileges to disable.) + --avoid-temporal-upgrade + When this option is enabled, the pre-5.6.4 temporal types + are not upgraded to the new format for ALTER TABLE + requests ADD/CHANGE/MODIFY COLUMN, ADD INDEX or FORCE + operation. This variable is deprecated and will be + removed in a future release. --back-log=# The number of outstanding connection requests MySQL can have. This comes into play when the main MySQL thread gets very many connection requests in a very short time @@ -73,18 +79,20 @@ The following options may be given as the first argument: and back implicitly per each query accessing an NDBCLUSTER table --binlog-gtid-simple-recovery - If this option is enabled, the server does not scan more - than one binary log for every iteration when initializing - GTID sets on server restart. Enabling this option is very - useful when restarting a server which has already - generated lots of binary logs without GTID events. Note: - If this option is enabled, GLOBAL.GTID_EXECUTED and - GLOBAL.GTID_PURGED cannot be initialized correctly if - binary log(s) with GTID events were generated before - binary log(s) without GTID events, for example if - gtid_mode is disabled when the server has already - generated binary log(s) with GTID events and not purged - them. + If this option is enabled, the server does not open more + than two binary logs when initializing GTID_PURGED and + GTID_EXECUTED, either during server restart or when + binary logs are being purged. Enabling this option is + useful when the server has already generated many binary + logs without GTID events (e.g., having GTID_MODE = OFF). + Note: If this option is enabled, GLOBAL.GTID_EXECUTED and + GLOBAL.GTID_PURGED may be initialized wrongly in two + cases: (1) GTID_MODE was ON for some binary logs but OFF + for the newest binary log. (2) SET GTID_PURGED was issued + after the oldest existing binary log was generated. If a + wrong set is computed in one of case (1) or case (2), it + will remain wrong even if the server is later restarted + with this option disabled. --binlog-ignore-db=name Tells the master that updates to the given database should not be logged to the binary log. @@ -408,6 +416,8 @@ The following options may be given as the first argument: INSERT DELAYED statements. If set to zero INSERT DELAYED will be not used.This variable is deprecated along with INSERT DELAYED. + --max-digest-length=# + Maximum length considered for digest text. --max-error-count=# Max number of errors/warnings to store for a statement --max-heap-table-size=# Don't allow creation of heap tables bigger than this @@ -500,8 +510,8 @@ The following options may be given as the first argument: If this is not 0, then mysqld will use this value to reserve file descriptors to use with setrlimit(). If this value is 0 then mysqld will reserve max_connections*5 or - max_connections + table_cache*2 (whichever is larger) - number of file descriptors + max_connections + table_open_cache*2 (whichever is + larger) number of file descriptors --optimizer-prune-level=# Controls the heuristic(s) applied during query optimization to prune less-promising partial plans from @@ -621,6 +631,9 @@ The following options may be given as the first argument: --performance-schema-max-cond-instances=# Maximum number of instrumented condition objects. Use 0 to disable, -1 for automated sizing. + --performance-schema-max-digest-length=# + Maximum length considered for digest text, when stored in + performance_schema tables. --performance-schema-max-file-classes=# Maximum number of file instruments. --performance-schema-max-file-handles=# @@ -834,6 +847,12 @@ The following options may be given as the first argument: --shared-memory Enable the shared memory --shared-memory-base-name=name Base name of shared memory + --show-old-temporals + When this option is enabled, the pre-5.6.4 temporal types + will be marked in the 'SHOW CREATE TABLE' and + 'INFORMATION_SCHEMA.COLUMNS' table as a comment in + COLUMN_TYPE field. This variable is deprecated and will + be removed in a future release. --show-slave-auth-info Show user and password in SHOW SLAVE HOSTS on this master. @@ -1026,6 +1045,7 @@ auto-increment-increment 1 auto-increment-offset 1 autocommit TRUE automatic-sp-privileges TRUE +avoid-temporal-upgrade FALSE back-log 80 big-tables FALSE bind-address * @@ -1136,6 +1156,7 @@ max-binlog-stmt-cache-size 18446744073709547520 max-connect-errors 100 max-connections 151 max-delayed-threads 20 +max-digest-length 1024 max-error-count 64 max-heap-table-size 16777216 max-join-size 18446744073709551615 @@ -1205,6 +1226,7 @@ performance-schema-hosts-size -1 performance-schema-instrument performance-schema-max-cond-classes 80 performance-schema-max-cond-instances -1 +performance-schema-max-digest-length 1024 performance-schema-max-file-classes 50 performance-schema-max-file-handles 32768 performance-schema-max-file-instances -1 @@ -1259,6 +1281,7 @@ server-id 0 server-id-bits 32 shared-memory FALSE shared-memory-base-name MYSQL +show-old-temporals FALSE show-slave-auth-info FALSE simplified-binlog-gtid-recovery FALSE skip-grant-tables TRUE diff --git a/mysql-wsrep-5.6/mysql-test/r/mysqldump.result b/mysql-wsrep-5.6/mysql-test/r/mysqldump.result index c1299119..4e3c6863 100644 --- a/mysql-wsrep-5.6/mysql-test/r/mysqldump.result +++ b/mysql-wsrep-5.6/mysql-test/r/mysqldump.result @@ -5404,3 +5404,31 @@ HEX(a) 00000000010200000005000000000000000000F03F000000000000F03F0000000000000040000000000000F03F00000000000000400000000000000040000000000000F03F0000000000000040000000000000F03F000000000000F03F INSERT INTO `t1` (`a`) VALUES (0x00000000010200000005000000000000000000F03F000000000000F03F0000000000000040000000000000F03F00000000000000400000000000000040000000000000F03F0000000000000040000000000000F03F000000000000F03F); DROP DATABASE dump_gis; +# +# Bug #20772273 : MYSQLIMPORT --USE-THREADS DOESN'T USE MULTIPLE THREADS +# +CREATE DATABASE db_20772273; +USE db_20772273; +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (1), (2); +CREATE TABLE t2(a INT); +INSERT INTO t2 VALUES (3), (4); +SELECT * FROM t1; +a +1 +2 +SELECT * FROM t2; +a +3 +4 +SELECT * FROM t1; +a +1 +2 +SELECT * FROM t2; +a +3 +4 +DROP TABLE t1; +DROP TABLE t2; +DROP DATABASE db_20772273; diff --git a/mysql-wsrep-5.6/mysql-test/r/mysqltest.result b/mysql-wsrep-5.6/mysql-test/r/mysqltest.result index f3ba8cd9..671ece0a 100644 --- a/mysql-wsrep-5.6/mysql-test/r/mysqltest.result +++ b/mysql-wsrep-5.6/mysql-test/r/mysqltest.result @@ -244,6 +244,12 @@ mysqltest: At line 1: Unknown SQL error name 'E9999' mysqltest: At line 1: Invalid argument to error: '999e9' - the errno may only consist of digits[0-9] mysqltest: At line 1: Invalid argument to error: '9b' - the errno may only consist of digits[0-9] mysqltest: At line 1: Too many errorcodes specified +CREATE TABLE t1 (a INT); +CREATE TABLE t1 (a INT); +ERROR 42S01: Table 't1' already exists +CREATE TABLE t1 (a INT); +ERROR 42S01: Table 't1' already exists +DROP TABLE t1; MySQL "MySQL" MySQL: The world''s most popular open source database diff --git a/mysql-wsrep-5.6/mysql-test/r/not_embedded_server.result b/mysql-wsrep-5.6/mysql-test/r/not_embedded_server.result index 17ec114e..571013d3 100644 --- a/mysql-wsrep-5.6/mysql-test/r/not_embedded_server.result +++ b/mysql-wsrep-5.6/mysql-test/r/not_embedded_server.result @@ -17,6 +17,7 @@ LOCK TABLES t1 READ; FLUSH PRIVILEGES; ERROR HY000: Table 'user' was not locked with LOCK TABLES UNLOCK TABLES; +FLUSH PRIVILEGES; DROP TABLE t1; # # Bug#54812: assert in Diagnostics_area::set_ok_status during EXPLAIN diff --git a/mysql-wsrep-5.6/mysql-test/r/not_wsrep.require b/mysql-wsrep-5.6/mysql-test/r/not_wsrep.require new file mode 100644 index 00000000..7c8e74af --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/r/not_wsrep.require @@ -0,0 +1,2 @@ +HAVE_WSREP +0 diff --git a/mysql-wsrep-5.6/mysql-test/r/partition_binlog.result b/mysql-wsrep-5.6/mysql-test/r/partition_binlog.result index 488ff7d4..82080d0d 100644 --- a/mysql-wsrep-5.6/mysql-test/r/partition_binlog.result +++ b/mysql-wsrep-5.6/mysql-test/r/partition_binlog.result @@ -16,16 +16,20 @@ ERROR HY000: Error in list of partitions to DROP # No error returned, output in table format instead: ALTER TABLE t1 ANALYZE PARTITION p1; Table Op Msg_type Msg_text -test.t1 analyze error Error in list of partitions to test.t1 +test.t1 analyze Error Error in list of partitions to test.t1 +test.t1 analyze status Operation failed ALTER TABLE t1 CHECK PARTITION p1; Table Op Msg_type Msg_text -test.t1 check error Error in list of partitions to test.t1 +test.t1 check Error Error in list of partitions to test.t1 +test.t1 check status Operation failed ALTER TABLE t1 OPTIMIZE PARTITION p1; Table Op Msg_type Msg_text -test.t1 optimize error Error in list of partitions to test.t1 +test.t1 optimize Error Error in list of partitions to test.t1 +test.t1 optimize status Operation failed ALTER TABLE t1 REPAIR PARTITION p1; Table Op Msg_type Msg_text -test.t1 repair error Error in list of partitions to test.t1 +test.t1 repair Error Error in list of partitions to test.t1 +test.t1 repair status Operation failed ALTER TABLE t1 ANALYZE PARTITION p0; Table Op Msg_type Msg_text test.t1 analyze status OK @@ -42,6 +46,9 @@ ALTER TABLE t1 TRUNCATE PARTITION p0; ALTER TABLE t1 DROP PARTITION p0; include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; ALTER TABLE t1 ANALYZE PARTITION p1 +master-bin.000001 # Query # # use `test`; ALTER TABLE t1 OPTIMIZE PARTITION p1 +master-bin.000001 # Query # # use `test`; ALTER TABLE t1 REPAIR PARTITION p1 master-bin.000001 # Query # # use `test`; ALTER TABLE t1 ANALYZE PARTITION p0 master-bin.000001 # Query # # use `test`; ALTER TABLE t1 OPTIMIZE PARTITION p0 master-bin.000001 # Query # # use `test`; ALTER TABLE t1 REPAIR PARTITION p0 diff --git a/mysql-wsrep-5.6/mysql-test/r/partition_error.result b/mysql-wsrep-5.6/mysql-test/r/partition_error.result index cc484c9e..5e8ad51a 100644 --- a/mysql-wsrep-5.6/mysql-test/r/partition_error.result +++ b/mysql-wsrep-5.6/mysql-test/r/partition_error.result @@ -1086,7 +1086,7 @@ partition by key (a) subpartition by hash (sin(a+b)) (partition x1 (subpartition x11, subpartition x12), partition x2 (subpartition x21, subpartition x22)); -ERROR HY000: It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning +ERROR HY000: This partition function is not allowed select load_file('$MYSQLD_DATADIR/test/t1.par'); load_file('$MYSQLD_DATADIR/test/t1.par') NULL diff --git a/mysql-wsrep-5.6/mysql-test/r/partition_innodb.result b/mysql-wsrep-5.6/mysql-test/r/partition_innodb.result index 02fe9a47..c50c4e2e 100644 --- a/mysql-wsrep-5.6/mysql-test/r/partition_innodb.result +++ b/mysql-wsrep-5.6/mysql-test/r/partition_innodb.result @@ -381,42 +381,42 @@ DROP TABLE t1; create table t1 (a int) engine=innodb partition by hash(a) ; show table status like 't1'; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 InnoDB 10 Compact 2 # # 0 0 # NULL NULL NULL NULL latin1_swedish_ci NULL partitioned +t1 InnoDB 10 Compact 2 # # 0 0 # NULL # NULL NULL latin1_swedish_ci NULL partitioned drop table t1; create table t1 (a int) engine = innodb partition by key (a); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 InnoDB 10 Compact 2 # # 0 0 # NULL NULL NULL NULL latin1_swedish_ci NULL partitioned +t1 InnoDB 10 Compact 2 # # 0 0 # NULL # NULL NULL latin1_swedish_ci NULL partitioned insert into t1 values (0), (1), (2), (3); analyze table t1; Table Op Msg_type Msg_text test.t1 analyze status OK show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 InnoDB 10 Compact 4 # # 0 0 # NULL NULL NULL NULL latin1_swedish_ci NULL partitioned +t1 InnoDB 10 Compact 4 # # 0 0 # NULL # NULL NULL latin1_swedish_ci NULL partitioned drop table t1; create table t1 (a int auto_increment primary key) engine = innodb partition by key (a); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 InnoDB 10 Compact 2 # # 0 0 # 1 NULL NULL NULL latin1_swedish_ci NULL partitioned +t1 InnoDB 10 Compact 2 # # 0 0 # 1 # NULL NULL latin1_swedish_ci NULL partitioned insert into t1 values (NULL), (NULL), (NULL), (NULL); analyze table t1; Table Op Msg_type Msg_text test.t1 analyze status OK show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 InnoDB 10 Compact 4 # # 0 0 # 5 NULL NULL NULL latin1_swedish_ci NULL partitioned +t1 InnoDB 10 Compact 4 # # 0 0 # 5 # NULL NULL latin1_swedish_ci NULL partitioned insert into t1 values (NULL), (NULL), (NULL), (NULL); analyze table t1; Table Op Msg_type Msg_text test.t1 analyze status OK show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 InnoDB 10 Compact 8 # # 0 0 # 9 NULL NULL NULL latin1_swedish_ci NULL partitioned +t1 InnoDB 10 Compact 8 # # 0 0 # 9 # NULL NULL latin1_swedish_ci NULL partitioned drop table t1; create table t1 (a int) partition by key (a) @@ -758,3 +758,120 @@ test.t7 check status OK ALTER TABLE t7 CHANGE f1 f1 INT AFTER f4, ALGORITHM=INPLACE; ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY. DROP TABLE t1,t2,t3,t4,t5,t6,t7; +# +# Bug #17299181 CREATE_TIME AND UPDATE_TIME ARE +# WRONG FOR PARTITIONED TABLES +# +CREATE TABLE t1 (a int, PRIMARY KEY (a)) ENGINE=InnoDB +PARTITION BY HASH (a) PARTITIONS 2; +SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE +CREATE_TIME IS NOT NULL AND TABLE_NAME='t1'; +COUNT(*) +1 +DROP TABLE t1; +# +# Bug#20160327 OPTIMIZE TABLE REMOVES THE DATA DIRECTORY IN PARTITIONS +# +CREATE TABLE `t1` ( +`f1` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, +`f2` MEDIUMTEXT NOT NULL, +`f3` CHAR(100) NOT NULL, +`f4` TINYINT(1) unsigned NOT NULL, +PRIMARY KEY (`f1`,`f4`) +) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1 +PARTITION BY LIST (`f4`) +(PARTITION p0 VALUES IN (0) ENGINE = InnoDB, +PARTITION p1 VALUES IN (1) DATA DIRECTORY = 'MYSQL_TMP_DIR/temp_dir' ENGINE = InnoDB); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f1` int(10) unsigned NOT NULL AUTO_INCREMENT, + `f2` mediumtext NOT NULL, + `f3` char(100) NOT NULL, + `f4` tinyint(1) unsigned NOT NULL, + PRIMARY KEY (`f1`,`f4`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY LIST (`f4`) +(PARTITION p0 VALUES IN (0) ENGINE = InnoDB, + PARTITION p1 VALUES IN (1) DATA DIRECTORY = 'MYSQL_TMP_DIR/temp_dir' ENGINE = InnoDB) */ +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 status OK +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f1` int(10) unsigned NOT NULL AUTO_INCREMENT, + `f2` mediumtext NOT NULL, + `f3` char(100) NOT NULL, + `f4` tinyint(1) unsigned NOT NULL, + PRIMARY KEY (`f1`,`f4`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY LIST (`f4`) +(PARTITION p0 VALUES IN (0) ENGINE = InnoDB, + PARTITION p1 VALUES IN (1) DATA DIRECTORY = 'MYSQL_TMP_DIR/temp_dir' ENGINE = InnoDB) */ +t1#p#p1.ibd +ALTER TABLE t1 OPTIMIZE PARTITION p0; +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize on partitions. All partitions will be rebuilt and analyzed. +test.t1 optimize status OK +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f1` int(10) unsigned NOT NULL AUTO_INCREMENT, + `f2` mediumtext NOT NULL, + `f3` char(100) NOT NULL, + `f4` tinyint(1) unsigned NOT NULL, + PRIMARY KEY (`f1`,`f4`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY LIST (`f4`) +(PARTITION p0 VALUES IN (0) ENGINE = InnoDB, + PARTITION p1 VALUES IN (1) DATA DIRECTORY = 'MYSQL_TMP_DIR/temp_dir' ENGINE = InnoDB) */ +t1#p#p1.ibd +ALTER TABLE t1 OPTIMIZE PARTITION p1; +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize on partitions. All partitions will be rebuilt and analyzed. +test.t1 optimize status OK +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f1` int(10) unsigned NOT NULL AUTO_INCREMENT, + `f2` mediumtext NOT NULL, + `f3` char(100) NOT NULL, + `f4` tinyint(1) unsigned NOT NULL, + PRIMARY KEY (`f1`,`f4`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY LIST (`f4`) +(PARTITION p0 VALUES IN (0) ENGINE = InnoDB, + PARTITION p1 VALUES IN (1) DATA DIRECTORY = 'MYSQL_TMP_DIR/temp_dir' ENGINE = InnoDB) */ +t1#p#p1.ibd +ALTER TABLE t1 REBUILD PARTITION ALL; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f1` int(10) unsigned NOT NULL AUTO_INCREMENT, + `f2` mediumtext NOT NULL, + `f3` char(100) NOT NULL, + `f4` tinyint(1) unsigned NOT NULL, + PRIMARY KEY (`f1`,`f4`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY LIST (`f4`) +(PARTITION p0 VALUES IN (0) ENGINE = InnoDB, + PARTITION p1 VALUES IN (1) DATA DIRECTORY = 'MYSQL_TMP_DIR/temp_dir' ENGINE = InnoDB) */ +t1#p#p1.ibd +ALTER TABLE t1 ADD extracol VARCHAR(32) NULL; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f1` int(10) unsigned NOT NULL AUTO_INCREMENT, + `f2` mediumtext NOT NULL, + `f3` char(100) NOT NULL, + `f4` tinyint(1) unsigned NOT NULL, + `extracol` varchar(32) DEFAULT NULL, + PRIMARY KEY (`f1`,`f4`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +/*!50100 PARTITION BY LIST (`f4`) +(PARTITION p0 VALUES IN (0) ENGINE = InnoDB, + PARTITION p1 VALUES IN (1) DATA DIRECTORY = 'MYSQL_TMP_DIR/temp_dir' ENGINE = InnoDB) */ +t1#p#p1.ibd +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/r/partition_key_cache.result b/mysql-wsrep-5.6/mysql-test/r/partition_key_cache.result index 154f2008..5e3d3d6b 100644 --- a/mysql-wsrep-5.6/mysql-test/r/partition_key_cache.result +++ b/mysql-wsrep-5.6/mysql-test/r/partition_key_cache.result @@ -201,13 +201,21 @@ COUNT(*) FLUSH TABLES; # Restrict partitioned commands to partitioned tables only CACHE INDEX t2 PARTITION (p0) KEY (`inx_b`) IN hot_cache; -ERROR HY000: Partition management on a not partitioned table is not possible +Table Op Msg_type Msg_text +test.t2 assign_to_keycache Error Partition management on a not partitioned table is not possible +test.t2 assign_to_keycache status Operation failed CACHE INDEX t2 PARTITION (p0,`p1`) INDEX (`PRIMARY`) IN hot_cache; -ERROR HY000: Partition management on a not partitioned table is not possible +Table Op Msg_type Msg_text +test.t2 assign_to_keycache Error Partition management on a not partitioned table is not possible +test.t2 assign_to_keycache status Operation failed CACHE INDEX t2 PARTITION (`p1`) INDEX (`PRIMARY`,`inx_b`) IN hot_cache; -ERROR HY000: Partition management on a not partitioned table is not possible +Table Op Msg_type Msg_text +test.t2 assign_to_keycache Error Partition management on a not partitioned table is not possible +test.t2 assign_to_keycache status Operation failed CACHE INDEX t2 PARTITION (ALL) KEY (`inx_b`,`PRIMARY`) IN hot_cache; -ERROR HY000: Partition management on a not partitioned table is not possible +Table Op Msg_type Msg_text +test.t2 assign_to_keycache Error Partition management on a not partitioned table is not possible +test.t2 assign_to_keycache status Operation failed # Basic key cache testing # The manual correctly says: "The syntax of CACHE INDEX enables you to # specify that only particular indexes from a table should be assigned @@ -326,7 +334,9 @@ Table Op Msg_type Msg_text test.t2 preload_keys error Indexes use different block sizes test.t2 preload_keys status Operation failed LOAD INDEX INTO CACHE t2 PARTITION (p1) INDEX (`PRIMARY`); -ERROR HY000: Partition management on a not partitioned table is not possible +Table Op Msg_type Msg_text +test.t2 preload_keys Error Partition management on a not partitioned table is not possible +test.t2 preload_keys status Operation failed LOAD INDEX INTO CACHE t1, t2; Table Op Msg_type Msg_text test.t1 preload_keys status OK @@ -381,7 +391,9 @@ test.t1 preload_keys status Operation failed DROP INDEX `inx_b` on t1; DROP INDEX `inx_b` on t2; CACHE INDEX t2 PARTITION (p0) KEY (`inx_b`) IN hot_cache; -ERROR HY000: Partition management on a not partitioned table is not possible +Table Op Msg_type Msg_text +test.t2 assign_to_keycache Error Partition management on a not partitioned table is not possible +test.t2 assign_to_keycache status Operation failed CACHE INDEX t2 INDEX (`inx_b`) IN hot_cache; Table Op Msg_type Msg_text test.t2 assign_to_keycache Error Key 'inx_b' doesn't exist in table 't2' diff --git a/mysql-wsrep-5.6/mysql-test/r/partition_mgm.result b/mysql-wsrep-5.6/mysql-test/r/partition_mgm.result index 5e817b5e..13916a7e 100644 --- a/mysql-wsrep-5.6/mysql-test/r/partition_mgm.result +++ b/mysql-wsrep-5.6/mysql-test/r/partition_mgm.result @@ -7,7 +7,8 @@ CREATE TABLE t1 PARTITION BY KEY(a) PARTITIONS 3; ALTER TABLE t1 REPAIR PARTITION p2,p3,p1; Table Op Msg_type Msg_text -test.t1 repair error Error in list of partitions to test.t1 +test.t1 repair Error Error in list of partitions to test.t1 +test.t1 repair status Operation failed ALTER TABLE t1 ORDER BY a; DROP TABLE t1; # diff --git a/mysql-wsrep-5.6/mysql-test/r/partition_mgm_err.result b/mysql-wsrep-5.6/mysql-test/r/partition_mgm_err.result index cbf45a2b..3c394fd7 100644 --- a/mysql-wsrep-5.6/mysql-test/r/partition_mgm_err.result +++ b/mysql-wsrep-5.6/mysql-test/r/partition_mgm_err.result @@ -85,13 +85,21 @@ ERROR HY000: Partition management on a not partitioned table is not possible ALTER TABLE t1 COALESCE PARTITION 1; ERROR HY000: Partition management on a not partitioned table is not possible ALTER TABLE t1 ANALYZE PARTITION p1; -ERROR HY000: Partition management on a not partitioned table is not possible +Table Op Msg_type Msg_text +test.t1 analyze Error Partition management on a not partitioned table is not possible +test.t1 analyze status Operation failed ALTER TABLE t1 CHECK PARTITION p1; -ERROR HY000: Partition management on a not partitioned table is not possible +Table Op Msg_type Msg_text +test.t1 check Error Partition management on a not partitioned table is not possible +test.t1 check status Operation failed ALTER TABLE t1 OPTIMIZE PARTITION p1; -ERROR HY000: Partition management on a not partitioned table is not possible +Table Op Msg_type Msg_text +test.t1 optimize Error Partition management on a not partitioned table is not possible +test.t1 optimize status Operation failed ALTER TABLE t1 REPAIR PARTITION p1; -ERROR HY000: Partition management on a not partitioned table is not possible +Table Op Msg_type Msg_text +test.t1 repair Error Partition management on a not partitioned table is not possible +test.t1 repair status Operation failed DROP TABLE t1; CREATE TABLE t1 (a int) PARTITION BY KEY (a) @@ -158,3 +166,27 @@ PARTITION p1 VALUES IN (0) (SUBPARTITION p1b), PARTITION p2 VALUES IN (2) (SUBPARTITION p1b) ); ERROR HY000: Duplicate partition name p1b +# +# Bug#20284744: COMMANDS OUT OF SYNC, MALFORMED PACKET, HANG, +# DISCONNECTIONS +# +create table t1 (a int) engine=innodb; +create procedure `p1`() +begin +declare `c` cursor for select 1 ; +declare continue handler for sqlexception begin select 1; end ; +alter table t1 check partition a; +open `c`; +end $ +# Without the fix this would fail with 2027: Malformed packet +call p1(); +Table Op Msg_type Msg_text +test.t1 check Error Partition management on a not partitioned table is not possible +test.t1 check status Operation failed +# Without the fix the connection would get out of sync here (error 2014)! +call p1(); +Table Op Msg_type Msg_text +test.t1 check Error Partition management on a not partitioned table is not possible +test.t1 check status Operation failed +drop procedure p1; +drop table t1; diff --git a/mysql-wsrep-5.6/mysql-test/r/partition_open_files_limit.result b/mysql-wsrep-5.6/mysql-test/r/partition_open_files_limit.result index 3cea9dcf..76b0dfd4 100644 --- a/mysql-wsrep-5.6/mysql-test/r/partition_open_files_limit.result +++ b/mysql-wsrep-5.6/mysql-test/r/partition_open_files_limit.result @@ -1,3 +1,11 @@ +CALL mtr.add_suppression("innodb_open_files should not be greater than the open_files_limit."); +CALL mtr.add_suppression("Warning: you must raise the value of "); +CALL mtr.add_suppression(" InnoDB: Warning: too many (.*) files stay open"); +CALL mtr.add_suppression(" while the maximum"); +CALL mtr.add_suppression("InnoDB: allowed value would be 1."); +CALL mtr.add_suppression("InnoDB: You may need to raise the value of"); +CALL mtr.add_suppression(" innodb_open_files in"); +CALL mtr.add_suppression("InnoDB: my.cnf."); DROP TABLE IF EXISTS `t1`; # Bug#46922: crash when adding partitions and open_files_limit is reached CREATE TABLE t1 (a INT PRIMARY KEY) diff --git a/mysql-wsrep-5.6/mysql-test/r/partition_utf8.result b/mysql-wsrep-5.6/mysql-test/r/partition_utf8.result index 339871f1..19dfc4f6 100644 --- a/mysql-wsrep-5.6/mysql-test/r/partition_utf8.result +++ b/mysql-wsrep-5.6/mysql-test/r/partition_utf8.result @@ -2,6 +2,10 @@ set names utf8; create table t1 (a varchar(2) character set cp1250) partition by list columns (a) ( partition p0 values in (0x81)); +Warnings: +Warning 1300 Invalid cp1250 character string: '81' +Warning 1300 Invalid cp1250 character string: '81' +Warning 1300 Invalid cp1250 character string: '81' show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -9,6 +13,8 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50500 PARTITION BY LIST COLUMNS(a) (PARTITION p0 VALUES IN (_cp1250 0x81) ENGINE = MyISAM) */ +Warnings: +Warning 1300 Invalid cp1250 character string: '81' drop table t1; create table t1 (a varchar(2) character set cp1250) partition by list columns (a) diff --git a/mysql-wsrep-5.6/mysql-test/r/perror-win.result b/mysql-wsrep-5.6/mysql-test/r/perror-win.result index 2f6c5a23..139b5667 100644 --- a/mysql-wsrep-5.6/mysql-test/r/perror-win.result +++ b/mysql-wsrep-5.6/mysql-test/r/perror-win.result @@ -1,7 +1,7 @@ MySQL error code 150: Foreign key constraint is incorrectly formed -Win32 error code 150: System trace information was not specified in your CONFIG.SYS file, or tracing is disallowed. +Win32 error code 150: System trace information was not specified in your CONFIG.SYS file, or tracing is disallowed. OS error code 23: Too many open files in system -Win32 error code 23: Data error (cyclic redundancy check). +Win32 error code 23: Data error (cyclic redundancy check). MySQL error code 1062 (ER_DUP_ENTRY): Duplicate entry '%-.192s' for key %d -Win32 error code 1062: The service has not been started. +Win32 error code 1062: The service has not been started. Illegal error code: 30000 diff --git a/mysql-wsrep-5.6/mysql-test/r/plugin_auth_qa.result b/mysql-wsrep-5.6/mysql-test/r/plugin_auth_qa.result index 8b0f23c3..fbc06d73 100644 --- a/mysql-wsrep-5.6/mysql-test/r/plugin_auth_qa.result +++ b/mysql-wsrep-5.6/mysql-test/r/plugin_auth_qa.result @@ -220,15 +220,24 @@ plüg_dest mysql_native_password DROP USER plüg_dest; SET NAMES ascii; CREATE USER 'plüg' IDENTIFIED WITH 'test_plugin_server' AS 'plüg_dest'; +Warnings: +Warning 1300 Invalid ascii character string: 'pl\xC3\xBCg' +Warning 1300 Invalid ascii character string: 'pl\xC3\xBCg_...' 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'; +Warnings: +Warning 1300 Invalid ascii character string: 'pl\xC3\xBCg' CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd'; +Warnings: +Warning 1300 Invalid ascii character string: 'pl\xC3\xBCg_...' SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string pl??g_dest mysql_native_password DROP USER 'plüg_dest'; +Warnings: +Warning 1300 Invalid ascii character string: 'pl\xC3\xBCg_...' SET NAMES latin1; ========== test 1.1.1.5 ==================================== CREATE USER 'plüg' IDENTIFIED WITH 'test_plügin_server' AS 'plüg_dest'; diff --git a/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256.result b/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256.result index 3ba4c1c3..7ad5deed 100644 --- a/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256.result +++ b/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256.result @@ -47,7 +47,7 @@ USER() CURRENT_USER() kristofer@localhost kristofer@localhost SHOW GRANTS FOR 'kristofer'@'localhost'; Grants for kristofer@localhost -GRANT ALL PRIVILEGES ON *.* TO 'kristofer'@'localhost' IDENTIFIED BY PASSWORD '' +GRANT ALL PRIVILEGES ON *.* TO 'kristofer'@'localhost' DROP USER 'kristofer'@'localhost'; GRANT ALL ON *.* TO 'kristofer'@'33.33.33.33' IDENTIFIED WITH 'sha256_password'; SET PASSWORD FOR 'kristofer'@'33.33.33.33'=PASSWORD(''); diff --git a/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256_2.result b/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256_2.result index 38c537d2..261bb623 100644 --- a/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256_2.result +++ b/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256_2.result @@ -33,7 +33,7 @@ user() current_user() kristofer@localhost kristofer@localhost SHOW GRANTS FOR 'kristofer'@'localhost'; Grants for kristofer@localhost -GRANT ALL PRIVILEGES ON *.* TO 'kristofer'@'localhost' IDENTIFIED BY PASSWORD '' +GRANT ALL PRIVILEGES ON *.* TO 'kristofer'@'localhost' DROP USER 'kristofer'@'localhost'; GRANT ALL ON *.* TO 'kristofer'@'33.33.33.33' IDENTIFIED BY ''; Connection should fail for localhost diff --git a/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256_server_default.result b/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256_server_default.result index 6f1aa20b..6e57e74f 100644 --- a/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256_server_default.result +++ b/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256_server_default.result @@ -44,7 +44,7 @@ USER() CURRENT_USER() kristofer@localhost kristofer@localhost SHOW GRANTS FOR 'kristofer'@'localhost'; Grants for kristofer@localhost -GRANT ALL PRIVILEGES ON *.* TO 'kristofer'@'localhost' IDENTIFIED BY PASSWORD '' +GRANT ALL PRIVILEGES ON *.* TO 'kristofer'@'localhost' DROP USER 'kristofer'@'localhost'; GRANT ALL ON *.* TO 'kristofer'@'33.33.33.33'; SET PASSWORD FOR 'kristofer'@'33.33.33.33'=PASSWORD(''); diff --git a/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256_server_default_tls.result b/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256_server_default_tls.result index 76ec29a1..0a4a920f 100644 --- a/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256_server_default_tls.result +++ b/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256_server_default_tls.result @@ -44,7 +44,7 @@ USER() CURRENT_USER() kristofer@localhost kristofer@localhost SHOW GRANTS FOR 'kristofer'@'localhost'; Grants for kristofer@localhost -GRANT ALL PRIVILEGES ON *.* TO 'kristofer'@'localhost' IDENTIFIED BY PASSWORD '' +GRANT ALL PRIVILEGES ON *.* TO 'kristofer'@'localhost' DROP USER 'kristofer'@'localhost'; GRANT ALL ON *.* TO 'kristofer'@'33.33.33.33'; SET PASSWORD FOR 'kristofer'@'33.33.33.33'=PASSWORD(''); diff --git a/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256_tls.result b/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256_tls.result index 79b45fef..975393b2 100644 --- a/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256_tls.result +++ b/mysql-wsrep-5.6/mysql-test/r/plugin_auth_sha256_tls.result @@ -22,7 +22,7 @@ USER() CURRENT_USER() kristofer@localhost kristofer@localhost SHOW GRANTS FOR 'kristofer'@'localhost'; Grants for kristofer@localhost -GRANT ALL PRIVILEGES ON *.* TO 'kristofer'@'localhost' IDENTIFIED BY PASSWORD '' +GRANT ALL PRIVILEGES ON *.* TO 'kristofer'@'localhost' DROP USER 'kristofer'@'localhost'; GRANT ALL ON *.* TO 'kristofer'@'33.33.33.33' IDENTIFIED WITH 'sha256_password'; SET PASSWORD FOR 'kristofer'@'33.33.33.33'=PASSWORD(''); diff --git a/mysql-wsrep-5.6/mysql-test/r/ps_grant.result b/mysql-wsrep-5.6/mysql-test/r/ps_grant.result index 388f6aa7..a35cc0d1 100644 --- a/mysql-wsrep-5.6/mysql-test/r/ps_grant.result +++ b/mysql-wsrep-5.6/mysql-test/r/ps_grant.result @@ -18,7 +18,7 @@ current_user() second_user@localhost show grants for current_user(); Grants for second_user@localhost -GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' +GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost' prepare s_t9 from 'select c1 as my_col from t9 where c1= 1' ; @@ -42,7 +42,7 @@ GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost' GRANT SELECT ON `mysqltest`.`t1` TO 'second_user'@'localhost' show grants for second_user@localhost ; Grants for second_user@localhost -GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' +GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost' GRANT SELECT ON `mysqltest`.`t1` TO 'second_user'@'localhost' prepare s_t1 from 'select a as my_col from t1' ; @@ -62,7 +62,7 @@ GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost' show grants for second_user@localhost ; Grants for second_user@localhost -GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' +GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost' execute s_t1 ; ERROR 42000: SELECT command denied to user 'second_user'@'localhost' for table 't1' diff --git a/mysql-wsrep-5.6/mysql-test/r/range_all.result b/mysql-wsrep-5.6/mysql-test/r/range_all.result index aa8b3535..a4b2c4ac 100644 --- a/mysql-wsrep-5.6/mysql-test/r/range_all.result +++ b/mysql-wsrep-5.6/mysql-test/r/range_all.result @@ -2457,4 +2457,41 @@ a b 2001-01-01 11:22:33 2001-01-01 11:22:33 DROP TABLE t1,t2; +# +# Bug #20229614: OR CONDITIONS ON MULTI-COLUMN INDEX MAY NOT USE ALL +# INDEX COLUMNS TO FILTER ROWS +# +CREATE TABLE t1 ( +c1 INT, +c2 INT, +c3 INT, +PRIMARY KEY(c1, c2, c3) +) ENGINE=INNODB; +INSERT INTO t1 VALUES (1, 1, 1), (1, 1, 2), (1, 1, 3), +(1, 1, 4), (1, 1, 5); +INSERT INTO t1 SELECT c1, 2, c3 FROM t1; +INSERT INTO t1 SELECT c1, 3, c3 FROM t1 WHERE c2 = 1; +SELECT COUNT(*) FROM t1; +COUNT(*) +15 +EXPLAIN SELECT c1, c2, c3 +FROM t1 +WHERE (c1 = 1 AND c2 = 1 AND c3 = 1) OR +(c1 = 1 AND c2 = 2 AND c3 = 2) OR +(c1 = 1 AND c2 = 2 AND c3 = 3); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY PRIMARY 12 NULL 3 Using where; Using index +DROP TABLE t1; +# +# Bug#21139683: ASSERTION FAILED: TYPE_ARG == MAYBE_KEY || +# TYPE_ARG == IMPOSSIBLE +# +CREATE TABLE t1 ( +a BLOB, +PRIMARY KEY(a(1)), +KEY(a(1)) +) ENGINE=INNODB; +SELECT 1 FROM t1 WHERE a <> 'a' OR a <> ""; +1 +DROP TABLE t1; set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/range_icp.result b/mysql-wsrep-5.6/mysql-test/r/range_icp.result index eacb2548..361fcb0d 100644 --- a/mysql-wsrep-5.6/mysql-test/r/range_icp.result +++ b/mysql-wsrep-5.6/mysql-test/r/range_icp.result @@ -2457,4 +2457,41 @@ a b 2001-01-01 11:22:33 2001-01-01 11:22:33 DROP TABLE t1,t2; +# +# Bug #20229614: OR CONDITIONS ON MULTI-COLUMN INDEX MAY NOT USE ALL +# INDEX COLUMNS TO FILTER ROWS +# +CREATE TABLE t1 ( +c1 INT, +c2 INT, +c3 INT, +PRIMARY KEY(c1, c2, c3) +) ENGINE=INNODB; +INSERT INTO t1 VALUES (1, 1, 1), (1, 1, 2), (1, 1, 3), +(1, 1, 4), (1, 1, 5); +INSERT INTO t1 SELECT c1, 2, c3 FROM t1; +INSERT INTO t1 SELECT c1, 3, c3 FROM t1 WHERE c2 = 1; +SELECT COUNT(*) FROM t1; +COUNT(*) +15 +EXPLAIN SELECT c1, c2, c3 +FROM t1 +WHERE (c1 = 1 AND c2 = 1 AND c3 = 1) OR +(c1 = 1 AND c2 = 2 AND c3 = 2) OR +(c1 = 1 AND c2 = 2 AND c3 = 3); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY PRIMARY 12 NULL 3 Using where; Using index +DROP TABLE t1; +# +# Bug#21139683: ASSERTION FAILED: TYPE_ARG == MAYBE_KEY || +# TYPE_ARG == IMPOSSIBLE +# +CREATE TABLE t1 ( +a BLOB, +PRIMARY KEY(a(1)), +KEY(a(1)) +) ENGINE=INNODB; +SELECT 1 FROM t1 WHERE a <> 'a' OR a <> ""; +1 +DROP TABLE t1; set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/range_icp_mrr.result b/mysql-wsrep-5.6/mysql-test/r/range_icp_mrr.result index c6ebadfa..1550bcf0 100644 --- a/mysql-wsrep-5.6/mysql-test/r/range_icp_mrr.result +++ b/mysql-wsrep-5.6/mysql-test/r/range_icp_mrr.result @@ -2457,4 +2457,41 @@ a b 2001-01-01 11:22:33 2001-01-01 11:22:33 DROP TABLE t1,t2; +# +# Bug #20229614: OR CONDITIONS ON MULTI-COLUMN INDEX MAY NOT USE ALL +# INDEX COLUMNS TO FILTER ROWS +# +CREATE TABLE t1 ( +c1 INT, +c2 INT, +c3 INT, +PRIMARY KEY(c1, c2, c3) +) ENGINE=INNODB; +INSERT INTO t1 VALUES (1, 1, 1), (1, 1, 2), (1, 1, 3), +(1, 1, 4), (1, 1, 5); +INSERT INTO t1 SELECT c1, 2, c3 FROM t1; +INSERT INTO t1 SELECT c1, 3, c3 FROM t1 WHERE c2 = 1; +SELECT COUNT(*) FROM t1; +COUNT(*) +15 +EXPLAIN SELECT c1, c2, c3 +FROM t1 +WHERE (c1 = 1 AND c2 = 1 AND c3 = 1) OR +(c1 = 1 AND c2 = 2 AND c3 = 2) OR +(c1 = 1 AND c2 = 2 AND c3 = 3); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY PRIMARY 12 NULL 3 Using where; Using index +DROP TABLE t1; +# +# Bug#21139683: ASSERTION FAILED: TYPE_ARG == MAYBE_KEY || +# TYPE_ARG == IMPOSSIBLE +# +CREATE TABLE t1 ( +a BLOB, +PRIMARY KEY(a(1)), +KEY(a(1)) +) ENGINE=INNODB; +SELECT 1 FROM t1 WHERE a <> 'a' OR a <> ""; +1 +DROP TABLE t1; set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/range_mrr.result b/mysql-wsrep-5.6/mysql-test/r/range_mrr.result index 4e9f0bc3..6c612d08 100644 --- a/mysql-wsrep-5.6/mysql-test/r/range_mrr.result +++ b/mysql-wsrep-5.6/mysql-test/r/range_mrr.result @@ -2457,4 +2457,41 @@ a b 2001-01-01 11:22:33 2001-01-01 11:22:33 DROP TABLE t1,t2; +# +# Bug #20229614: OR CONDITIONS ON MULTI-COLUMN INDEX MAY NOT USE ALL +# INDEX COLUMNS TO FILTER ROWS +# +CREATE TABLE t1 ( +c1 INT, +c2 INT, +c3 INT, +PRIMARY KEY(c1, c2, c3) +) ENGINE=INNODB; +INSERT INTO t1 VALUES (1, 1, 1), (1, 1, 2), (1, 1, 3), +(1, 1, 4), (1, 1, 5); +INSERT INTO t1 SELECT c1, 2, c3 FROM t1; +INSERT INTO t1 SELECT c1, 3, c3 FROM t1 WHERE c2 = 1; +SELECT COUNT(*) FROM t1; +COUNT(*) +15 +EXPLAIN SELECT c1, c2, c3 +FROM t1 +WHERE (c1 = 1 AND c2 = 1 AND c3 = 1) OR +(c1 = 1 AND c2 = 2 AND c3 = 2) OR +(c1 = 1 AND c2 = 2 AND c3 = 3); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY PRIMARY 12 NULL 3 Using where; Using index +DROP TABLE t1; +# +# Bug#21139683: ASSERTION FAILED: TYPE_ARG == MAYBE_KEY || +# TYPE_ARG == IMPOSSIBLE +# +CREATE TABLE t1 ( +a BLOB, +PRIMARY KEY(a(1)), +KEY(a(1)) +) ENGINE=INNODB; +SELECT 1 FROM t1 WHERE a <> 'a' OR a <> ""; +1 +DROP TABLE t1; set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/range_mrr_cost.result b/mysql-wsrep-5.6/mysql-test/r/range_mrr_cost.result index bd7c80ca..decf2550 100644 --- a/mysql-wsrep-5.6/mysql-test/r/range_mrr_cost.result +++ b/mysql-wsrep-5.6/mysql-test/r/range_mrr_cost.result @@ -2457,4 +2457,41 @@ a b 2001-01-01 11:22:33 2001-01-01 11:22:33 DROP TABLE t1,t2; +# +# Bug #20229614: OR CONDITIONS ON MULTI-COLUMN INDEX MAY NOT USE ALL +# INDEX COLUMNS TO FILTER ROWS +# +CREATE TABLE t1 ( +c1 INT, +c2 INT, +c3 INT, +PRIMARY KEY(c1, c2, c3) +) ENGINE=INNODB; +INSERT INTO t1 VALUES (1, 1, 1), (1, 1, 2), (1, 1, 3), +(1, 1, 4), (1, 1, 5); +INSERT INTO t1 SELECT c1, 2, c3 FROM t1; +INSERT INTO t1 SELECT c1, 3, c3 FROM t1 WHERE c2 = 1; +SELECT COUNT(*) FROM t1; +COUNT(*) +15 +EXPLAIN SELECT c1, c2, c3 +FROM t1 +WHERE (c1 = 1 AND c2 = 1 AND c3 = 1) OR +(c1 = 1 AND c2 = 2 AND c3 = 2) OR +(c1 = 1 AND c2 = 2 AND c3 = 3); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY PRIMARY 12 NULL 3 Using where; Using index +DROP TABLE t1; +# +# Bug#21139683: ASSERTION FAILED: TYPE_ARG == MAYBE_KEY || +# TYPE_ARG == IMPOSSIBLE +# +CREATE TABLE t1 ( +a BLOB, +PRIMARY KEY(a(1)), +KEY(a(1)) +) ENGINE=INNODB; +SELECT 1 FROM t1 WHERE a <> 'a' OR a <> ""; +1 +DROP TABLE t1; set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/range_none.result b/mysql-wsrep-5.6/mysql-test/r/range_none.result index 0a5d35ed..ef718a40 100644 --- a/mysql-wsrep-5.6/mysql-test/r/range_none.result +++ b/mysql-wsrep-5.6/mysql-test/r/range_none.result @@ -2456,4 +2456,41 @@ a b 2001-01-01 11:22:33 2001-01-01 11:22:33 DROP TABLE t1,t2; +# +# Bug #20229614: OR CONDITIONS ON MULTI-COLUMN INDEX MAY NOT USE ALL +# INDEX COLUMNS TO FILTER ROWS +# +CREATE TABLE t1 ( +c1 INT, +c2 INT, +c3 INT, +PRIMARY KEY(c1, c2, c3) +) ENGINE=INNODB; +INSERT INTO t1 VALUES (1, 1, 1), (1, 1, 2), (1, 1, 3), +(1, 1, 4), (1, 1, 5); +INSERT INTO t1 SELECT c1, 2, c3 FROM t1; +INSERT INTO t1 SELECT c1, 3, c3 FROM t1 WHERE c2 = 1; +SELECT COUNT(*) FROM t1; +COUNT(*) +15 +EXPLAIN SELECT c1, c2, c3 +FROM t1 +WHERE (c1 = 1 AND c2 = 1 AND c3 = 1) OR +(c1 = 1 AND c2 = 2 AND c3 = 2) OR +(c1 = 1 AND c2 = 2 AND c3 = 3); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY PRIMARY 12 NULL 3 Using where; Using index +DROP TABLE t1; +# +# Bug#21139683: ASSERTION FAILED: TYPE_ARG == MAYBE_KEY || +# TYPE_ARG == IMPOSSIBLE +# +CREATE TABLE t1 ( +a BLOB, +PRIMARY KEY(a(1)), +KEY(a(1)) +) ENGINE=INNODB; +SELECT 1 FROM t1 WHERE a <> 'a' OR a <> ""; +1 +DROP TABLE t1; set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/rewrite_general_log.result b/mysql-wsrep-5.6/mysql-test/r/rewrite_general_log.result index 332999c5..5cb844ed 100644 --- a/mysql-wsrep-5.6/mysql-test/r/rewrite_general_log.result +++ b/mysql-wsrep-5.6/mysql-test/r/rewrite_general_log.result @@ -101,8 +101,36 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: Note 1003 /* select#1 */ select ((@`a`) = 5) AS `@a=5`,(@b:=10) AS `@b:=10`,(@c:=20) AS `@c:=20`,(@d:=(40 + 5)) AS `@d:=40+5`,((@e:=80) + 5) AS `(@e:=80)+5` +# +# Bug#16953758: PREPARED STATEMENT IS WRITTEN TO GENERAL QUERY LOG AFTER ITS EXECUTION IS FINISH +# +TRUNCATE TABLE mysql.general_log; +SET GLOBAL general_log='ON'; +SET @sql='SELECT command_type, argument FROM mysql.general_log WHERE argument LIKE "%Bug#16953758%"'; +PREPARE stmt FROM @sql; +EXECUTE stmt; +command_type argument +Query SET @sql='SELECT command_type, argument FROM mysql.general_log WHERE argument LIKE "%Bug#16953758%"' +Prepare SELECT command_type, argument FROM mysql.general_log WHERE argument LIKE "%Bug#16953758%" +Execute SELECT command_type, argument FROM mysql.general_log WHERE argument LIKE "%Bug#16953758%" +DEALLOCATE PREPARE stmt; +# +# Bug#18616826: PREPARED STATEMENTS WHOSE EXECUTION FAIL ARE NOT LOGGED TO THE GENERAL LOG +# +TRUNCATE TABLE mysql.general_log; +SET @sql='DROP TABLE 18616826_does_not_exist'; +PREPARE stmt FROM @sql; +EXECUTE stmt; +ERROR 42S02: Unknown table 'test.18616826_does_not_exist' +DEALLOCATE PREPARE stmt; +SELECT command_type, argument FROM mysql.general_log WHERE argument LIKE "DROP TABLE 18616826_does_not_exist"; +command_type argument +Prepare DROP TABLE 18616826_does_not_exist +Execute DROP TABLE 18616826_does_not_exist DROP TABLE test_log; SET GLOBAL general_log_file= @old_general_log_file; SET GLOBAL general_log= @old_general_log; SET GLOBAL log_output= @old_log_output; + End of 5.6 tests! + diff --git a/mysql-wsrep-5.6/mysql-test/r/show_check.result b/mysql-wsrep-5.6/mysql-test/r/show_check.result index 92d31470..8bc7b0ec 100644 --- a/mysql-wsrep-5.6/mysql-test/r/show_check.result +++ b/mysql-wsrep-5.6/mysql-test/r/show_check.result @@ -101,19 +101,19 @@ drop table t1; show variables like "wait_timeout%"; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def information_schema VARIABLES VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8 -def information_schema VARIABLES VARIABLES VARIABLE_VALUE Value 253 1024 5 Y 0 0 8 +def information_schema VARIABLES VARIABLES VARIABLE_VALUE Value 253 2048 5 Y 0 0 8 Variable_name Value wait_timeout 28800 show variables like "WAIT_timeout%"; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def information_schema VARIABLES VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8 -def information_schema VARIABLES VARIABLES VARIABLE_VALUE Value 253 1024 5 Y 0 0 8 +def information_schema VARIABLES VARIABLES VARIABLE_VALUE Value 253 2048 5 Y 0 0 8 Variable_name Value wait_timeout 28800 show variables like "this_doesn't_exists%"; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def information_schema VARIABLES VARIABLES VARIABLE_NAME Variable_name 253 64 0 N 1 0 8 -def information_schema VARIABLES VARIABLES VARIABLE_VALUE Value 253 1024 0 Y 0 0 8 +def information_schema VARIABLES VARIABLES VARIABLE_VALUE Value 253 2048 0 Y 0 0 8 Variable_name Value show table status from test like "this_doesn't_exists%"; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr diff --git a/mysql-wsrep-5.6/mysql-test/r/sp-threads.result b/mysql-wsrep-5.6/mysql-test/r/sp-threads.result index 31974b66..194f2133 100644 --- a/mysql-wsrep-5.6/mysql-test/r/sp-threads.result +++ b/mysql-wsrep-5.6/mysql-test/r/sp-threads.result @@ -34,8 +34,8 @@ lock tables t2 write; call bug9486(); show processlist; Id User Host db Command Time State Info +# root localhost test Query # STATE show processlist # root localhost test Query # Waiting for table metadata lock update t1, t2 set val= 1 where id1=id2 -# root localhost test Query # init show processlist # root localhost test Sleep # NULL # root localhost test Sleep # NULL unlock tables; diff --git a/mysql-wsrep-5.6/mysql-test/r/sp.result b/mysql-wsrep-5.6/mysql-test/r/sp.result index 1659947d..800d7b31 100644 --- a/mysql-wsrep-5.6/mysql-test/r/sp.result +++ b/mysql-wsrep-5.6/mysql-test/r/sp.result @@ -4305,57 +4305,57 @@ test.t1 repair status OK test.t2 repair status OK test.t3 repair status OK test.v1 repair Error 'test.v1' is not BASE TABLE -test.v1 repair error Corrupt +test.v1 repair status Operation failed Table Op Msg_type Msg_text test.t1 optimize status OK test.t2 optimize status OK test.t3 optimize status OK test.v1 optimize Error 'test.v1' is not BASE TABLE -test.v1 optimize error Corrupt +test.v1 optimize status Operation failed Table Op Msg_type Msg_text test.t1 analyze status Table is already up to date test.t2 analyze status Table is already up to date test.t3 analyze status Table is already up to date test.v1 analyze Error 'test.v1' is not BASE TABLE -test.v1 analyze error Corrupt +test.v1 analyze status Operation failed call bug13012()| Table Op Msg_type Msg_text test.t1 repair status OK test.t2 repair status OK test.t3 repair status OK test.v1 repair Error 'test.v1' is not BASE TABLE -test.v1 repair error Corrupt +test.v1 repair status Operation failed Table Op Msg_type Msg_text test.t1 optimize status OK test.t2 optimize status OK test.t3 optimize status OK test.v1 optimize Error 'test.v1' is not BASE TABLE -test.v1 optimize error Corrupt +test.v1 optimize status Operation failed Table Op Msg_type Msg_text test.t1 analyze status Table is already up to date test.t2 analyze status Table is already up to date test.t3 analyze status Table is already up to date test.v1 analyze Error 'test.v1' is not BASE TABLE -test.v1 analyze error Corrupt +test.v1 analyze status Operation failed call bug13012()| Table Op Msg_type Msg_text test.t1 repair status OK test.t2 repair status OK test.t3 repair status OK test.v1 repair Error 'test.v1' is not BASE TABLE -test.v1 repair error Corrupt +test.v1 repair status Operation failed Table Op Msg_type Msg_text test.t1 optimize status OK test.t2 optimize status OK test.t3 optimize status OK test.v1 optimize Error 'test.v1' is not BASE TABLE -test.v1 optimize error Corrupt +test.v1 optimize status Operation failed Table Op Msg_type Msg_text test.t1 analyze status Table is already up to date test.t2 analyze status Table is already up to date test.t3 analyze status Table is already up to date test.v1 analyze Error 'test.v1' is not BASE TABLE -test.v1 analyze error Corrupt +test.v1 analyze status Operation failed drop procedure bug13012| drop view v1| select * from t1 order by data| @@ -7759,4 +7759,104 @@ MyISAM SET @@default_storage_engine = @default_storage_engine_saved; DROP PROCEDURE p1; DROP TABLE t1; + +# +# BUG 16041903: CONTINUE HANDLER NOT INVOKED +# IN A STORED FUNCTION AFTER A LOCK WAIT TIMEOUT +# + +# Save and set lock wait timeout +SET @lock_wait_timeout_saved= @@lock_wait_timeout; +SET @innodb_lock_wait_timeout_saved= @@innodb_lock_wait_timeout; +SET @@lock_wait_timeout= 1; +SET @@innodb_lock_wait_timeout= 1; + +# Create a function with exit handler: +CREATE FUNCTION f1() RETURNS VARCHAR(20) +BEGIN +DECLARE EXIT HANDLER FOR SQLSTATE '42S02' RETURN 'No such table'; +INSERT INTO no_such_table VALUES (1); +END// + +# Create a function calling f1(): +CREATE FUNCTION f2() RETURNS VARCHAR(20) +BEGIN +RETURN f1(); +END// + +# Create a function provoking deadlock: +CREATE FUNCTION f3() RETURNS VARCHAR(20) +BEGIN +UPDATE t1 SET i= 1 WHERE i= 1; +RETURN 'Will never get here'; +END// + +# Create a function calling f3, to create +# a deadlock indirectly: +CREATE FUNCTION f4() RETURNS VARCHAR(20) +BEGIN +RETURN f3(); +END// + +# Open another connection, create and initialize a table +# to be used for provoking deadlock, put a lock on the table: +CREATE TABLE t1 (i INT) ENGINE=InnoDB; +INSERT INTO t1 VALUES (1); +SET AUTOCOMMIT= 0; +UPDATE t1 SET i=1 WHERE i=1; + +# On the default connection, do an update to provoke a +# deadlock, then call the function with handler. This case +# fails without the patch (with error ER_NO_SUCH_TABLE): +SET AUTOCOMMIT= 0; +UPDATE t1 SET i=1 WHERE i=1; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +SELECT f1() AS 'f1():'; +f1(): +No such table + +# Provoke another deadlock, then call the function with +# handler indirectly. This case fails without the patch +# (with error ER_NO_SUCH_TABLE): +UPDATE t1 SET i= 1 WHERE i= 1; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +SELECT f2() AS 'f2():'; +f2(): +No such table + +# Provoke yet another deadlock, but now from within a function, +# then call the function with handler. This succeeds even +# without the patch because is_fatal_sub_stmt_error is reset +# in restore_sub_stmt after the failing function has been +# executed. The test case is included anyway for better coverage: +SELECT f3() AS 'f3():'; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +SELECT f1() AS 'f1():'; +f1(): +No such table +# Provoke yet another deadlock, but now from within a function, +# calling another function, then call the function with handler. +# This succeeds even without the patch because +# is_fatal_sub_stmt_error is reset in restore_sub_stmt after +# the failing function has been executed. The test case is +# included anyway for better coverage: +SELECT f4() AS 'f4():'; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +SELECT f1() AS 'f1():'; +f1(): +No such table + +# Disconnect, drop functions and table: +DROP FUNCTION f4; +DROP FUNCTION f3; +DROP FUNCTION f2; +DROP FUNCTION f1; +DROP TABLE t1; + +# Reset lock wait timeouts +SET @@lock_wait_timeout= @lock_wait_timeout_saved; +SET @@innodb_lock_wait_timeout= @innodb_lock_wait_timeout_saved; +# +# BUG 16041903: End of test case +# # End of 5.6 tests diff --git a/mysql-wsrep-5.6/mysql-test/r/ssl_mode.result b/mysql-wsrep-5.6/mysql-test/r/ssl_mode.result new file mode 100644 index 00000000..6a95e208 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/r/ssl_mode.result @@ -0,0 +1,45 @@ +# positive client tests +# mysql +Variable_name Value +Ssl_cipher DHE-RSA-AES256-SHA +Variable_name Value +Ssl_cipher DHE-RSA-AES256-SHA +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES(0); +# mysqldump +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; +INSERT INTO `t1` VALUES (0); +# mysqladmin +Warning: Using a password on the command line interface can be insecure. +mysqld is alive +# mysqlcheck +test.t1 OK +# mysqlimport +CREATE TABLE words(a VARCHAR(255)); +test.words: Records: 70 Deleted: 0 Skipped: 0 Warnings: 0 +DROP TABLE words; +# mysqlshow +Database: test ++--------+ +| Tables | ++--------+ +| t1 | ++--------+ +# mysqlslap +# mysqltest +Output from mysqltest-x.inc +DROP TABLE t1; +# negative client tests +# mysql +Unknown value to --ssl-mode: ''. Use --ssl-mode=REQUIRED +Unknown value to --ssl-mode: 'DERIUQER'. Use --ssl-mode=REQUIRED +ERROR 2026 (HY000): --ssl-mode=REQUIRED option forbids non SSL connections +ERROR 2026 (HY000): --ssl-mode=REQUIRED option forbids non SSL connections +ERROR 2026 (HY000): --ssl-mode=REQUIRED option forbids non SSL connections + +End of tests diff --git a/mysql-wsrep-5.6/mysql-test/r/ssl_mode_no_ssl.result b/mysql-wsrep-5.6/mysql-test/r/ssl_mode_no_ssl.result new file mode 100644 index 00000000..4955efab --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/r/ssl_mode_no_ssl.result @@ -0,0 +1,23 @@ +# negative client tests +# mysql +ERROR 2026 (HY000): --ssl-mode=REQUIRED option forbids non SSL connections +ERROR 2026 (HY000): --ssl-mode=REQUIRED option forbids non SSL connections +ERROR 2026 (HY000): --ssl-mode=REQUIRED option forbids non SSL connections +ERROR 2026 (HY000): --ssl-mode=REQUIRED option forbids non SSL connections +# mysqldump +mysqldump: Got error: 2026: --ssl-mode=REQUIRED option forbids non SSL connections when trying to connect +# mysqladmin +Warning: Using a password on the command line interface can be insecure. +mysqladmin: error: '--ssl-mode=REQUIRED option forbids non SSL connections' +# mysqlcheck +mysqlcheck: Got error: 2026: --ssl-mode=REQUIRED option forbids non SSL connections when trying to connect +# mysqlimport +mysqlimport: Error: 2026 --ssl-mode=REQUIRED option forbids non SSL connections +# mysqlshow +mysqlshow: --ssl-mode=REQUIRED option forbids non SSL connections +# mysqlslap +mysqlslap: Error when connecting to server: --ssl-mode=REQUIRED option forbids non SSL connections +# mysqltest +mysqltest: Could not open connection 'default': 2026 --ssl-mode=REQUIRED option forbids non SSL connections + +End of tests diff --git a/mysql-wsrep-5.6/mysql-test/r/status_debug.result b/mysql-wsrep-5.6/mysql-test/r/status_debug.result new file mode 100644 index 00000000..59d94b23 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/r/status_debug.result @@ -0,0 +1,23 @@ +# +# Bug#18591145 - SOME MONOTONICALLY INCREASING STATUS VARIABLES DECREASES UNEXPECTEDLY +# +CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(64), val VARCHAR(1024)); +# Insert 1 tuple to increment com_insert status. +INSERT INTO t1(name, val) VALUES ('dummy', 0); +connect con1, localhost, root,,; +SET DEBUG_SYNC='before_preparing_global_status_array SIGNAL change_user WAIT_FOR continue'; +SET DEBUG_SYNC='after_preparing_global_status_array SIGNAL continue_change_user'; +INSERT INTO t1(name, val) SELECT * FROM INFORMATION_SCHEMA.global_status WHERE variable_name='com_insert';; +connection default; +SET DEBUG_SYNC='now WAIT_FOR change_user'; +SET DEBUG_SYNC='thd_cleanup_start SIGNAL continue WAIT_FOR continue_change_user'; +connection con1; +SET DEBUG_SYNC='RESET'; +connection default; +INSERT INTO t1(name, val) +SELECT * FROM INFORMATION_SCHEMA.global_status WHERE variable_name='com_insert'; +SELECT (SELECT val FROM t1 WHERE id = 2) - (SELECT val FROM t1 WHERE id = 3); +(SELECT val FROM t1 WHERE id = 2) - (SELECT val FROM t1 WHERE id = 3) +0 +disconnect con1; +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_mat.result b/mysql-wsrep-5.6/mysql-test/r/subquery_mat.result index d2fe3159..9398f581 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_mat.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_mat.result @@ -1899,14 +1899,17 @@ SELECT t2.a FROM t1 as t2 COUNT(*) 0 ALTER TABLE t1 MODIFY a VARCHAR(332) CHARACTER SET UTF8; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK EXPLAIN SELECT COUNT(*) FROM t1 WHERE t1.a NOT IN ( SELECT t2.a FROM t1 as t2 ); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 1 Using where -2 SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL +1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where +2 SUBQUERY t2 ALL NULL NULL NULL NULL 32 NULL SELECT COUNT(*) FROM t1 WHERE t1.a NOT IN ( diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_mat_all.result b/mysql-wsrep-5.6/mysql-test/r/subquery_mat_all.result index fff4b4d5..b9137e77 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_mat_all.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_mat_all.result @@ -1912,14 +1912,17 @@ SELECT t2.a FROM t1 as t2 COUNT(*) 0 ALTER TABLE t1 MODIFY a VARCHAR(332) CHARACTER SET UTF8; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK EXPLAIN SELECT COUNT(*) FROM t1 WHERE t1.a NOT IN ( SELECT t2.a FROM t1 as t2 ); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 1 Using where -2 SUBQUERY t2 ALL NULL NULL NULL NULL 1 NULL +1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where +2 SUBQUERY t2 ALL NULL NULL NULL NULL 32 NULL SELECT COUNT(*) FROM t1 WHERE t1.a NOT IN ( diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_mat_none.result b/mysql-wsrep-5.6/mysql-test/r/subquery_mat_none.result index 9f70f1a7..f0a072c3 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_mat_none.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_mat_none.result @@ -1898,14 +1898,17 @@ SELECT t2.a FROM t1 as t2 COUNT(*) 0 ALTER TABLE t1 MODIFY a VARCHAR(332) CHARACTER SET UTF8; +ANALYZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK EXPLAIN SELECT COUNT(*) FROM t1 WHERE t1.a NOT IN ( SELECT t2.a FROM t1 as t2 ); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 1 Using where -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using where +1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 32 Using where SELECT COUNT(*) FROM t1 WHERE t1.a NOT IN ( diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_all.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_all.result index 098f71eb..b0408bf0 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_all.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_all.result @@ -2939,42 +2939,48 @@ EXPLAIN { "query_block": { "select_id": 1, - "duplicates_removal": { - "using_temporary_table": true, - "nested_loop": [ - { - "table": { - "table_name": "t11", - "access_type": "ALL", - "rows": 8, - "filtered": 100 - } - }, - { - "table": { - "table_name": "t1", - "access_type": "eq_ref", - "possible_keys": [ - "PRIMARY" - ], - "key": "PRIMARY", - "used_key_parts": [ - "a" - ], - "key_length": "4", - "ref": [ - "test.t11.a" - ], - "rows": 1, - "filtered": 100 + "nested_loop": [ + { + "table": { + "table_name": "", + "access_type": "ALL", + "materialized_from_subquery": { + "using_temporary_table": true, + "query_block": { + "table": { + "table_name": "t11", + "access_type": "ALL", + "rows": 8, + "filtered": 100 + } + } } } - ] - } + }, + { + "table": { + "table_name": "t1", + "access_type": "eq_ref", + "possible_keys": [ + "PRIMARY" + ], + "key": "PRIMARY", + "used_key_parts": [ + "a" + ], + "key_length": "4", + "ref": [ + ".a" + ], + "rows": 1, + "filtered": 100 + } + } + ] } } Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` semi join (`test`.`t11`) where (`test`.`t1`.`a` = `test`.`t11`.`a`) +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` semi join (`test`.`t11`) where (`test`.`t1`.`a` = ``.`a`) select t21.* from t21,t22 where t21.a = t22.a and t22.a in (select t12.a from t11, t12 where t11.a in(255,256) and t11.a = t12.a and t11.c is null) and t22.c is null order by t21.a; a b c @@ -3227,8 +3233,9 @@ create table t3 ( a int , filler char(100), key(a)); insert into t3 select A.a + 10*B.a, 'filler' from t0 A, t0 B; explain select * from t3 where a in (select a from t2) and (a > 5 or a < 10); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where; Start temporary -1 SIMPLE t3 ref a a 5 test.t2.a 1 End temporary +1 SIMPLE ALL NULL NULL NULL NULL NULL Using where +1 SIMPLE t3 ref a a 5 .a 1 NULL +2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 NULL select * from t3 where a in (select a from t2); a filler 1 filler @@ -5746,11 +5753,12 @@ INNER JOIN t2 c ON c.idContact=cona.idContact WHERE cona.postalStripped='T2H3B2' ); id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE cona ALL NULL NULL NULL NULL 2 100.00 Using where; Start temporary -1 SIMPLE c eq_ref PRIMARY PRIMARY 4 test.cona.idContact 1 100.00 Using where -1 SIMPLE a eq_ref PRIMARY PRIMARY 4 test.c.idObj 1 100.00 Using index; End temporary +1 SIMPLE ALL NULL NULL NULL NULL NULL 0.00 NULL +1 SIMPLE a index PRIMARY PRIMARY 4 NULL 2 100.00 Using where; Using index; Using join buffer (Block Nested Loop) +2 MATERIALIZED cona ALL NULL NULL NULL NULL 2 100.00 Using where +2 MATERIALIZED c eq_ref PRIMARY PRIMARY 4 test.cona.idContact 1 100.00 NULL Warnings: -Note 1003 /* select#1 */ select `test`.`a`.`idIndividual` AS `idIndividual` from `test`.`t1` `a` semi join (`test`.`t3` `cona` join `test`.`t2` `c`) where ((`test`.`c`.`idContact` = `test`.`cona`.`idContact`) and (`test`.`a`.`idIndividual` = `test`.`c`.`idObj`) and (`test`.`cona`.`postalStripped` = 'T2H3B2')) +Note 1003 /* select#1 */ select `test`.`a`.`idIndividual` AS `idIndividual` from `test`.`t1` `a` semi join (`test`.`t3` `cona` join `test`.`t2` `c`) where ((`test`.`c`.`idContact` = `test`.`cona`.`idContact`) and (`test`.`a`.`idIndividual` = ``.`idObj`) and (`test`.`cona`.`postalStripped` = 'T2H3B2')) drop table t1,t2,t3; CREATE TABLE t1 (one int, two int, flag char(1)); CREATE TABLE t2 (one int, two int, flag char(1)); @@ -6868,8 +6876,8 @@ and t2.uid=t1.fid; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary 1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index -1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 End temporary -1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 9 Using where; Using join buffer (Block Nested Loop) +1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 Using where +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 End temporary select name from t2, t1 where t1.uid in (select t4.uid from t4, t3 where t3.uid=1 and t4.uid=t3.fid) and t2.uid=t1.fid; @@ -7641,8 +7649,9 @@ WHERE col_varchar_key IN (SELECT col_varchar_nokey FROM t2) ORDER BY col_datetime_key LIMIT 4; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort; Start temporary -1 SIMPLE t1 ref col_varchar_key col_varchar_key 3 test.t2.col_varchar_nokey 1 End temporary +1 SIMPLE t1 ALL col_varchar_key NULL NULL NULL 20 Using where; Using filesort +1 SIMPLE eq_ref 3 test.t1.col_varchar_key 1 NULL +2 MATERIALIZED t2 ALL NULL NULL NULL NULL 6 NULL SELECT col_varchar_key FROM t1 WHERE col_varchar_key IN (SELECT col_varchar_nokey @@ -7714,9 +7723,10 @@ AND grandparent1.col_varchar_key IS NOT NULL ); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where -2 SUBQUERY parent1 ALL NULL NULL NULL NULL 20 Start temporary -2 SUBQUERY parent2 eq_ref PRIMARY PRIMARY 4 test.parent1.pk 1 Using index -2 SUBQUERY grandparent1 ref col_varchar_key col_varchar_key 3 test.parent1.col_varchar_nokey 1 Using index condition; End temporary +2 SUBQUERY ALL NULL NULL NULL NULL NULL NULL +2 SUBQUERY grandparent1 ref col_varchar_key col_varchar_key 3 .p1 1 Using index condition +3 MATERIALIZED parent1 ALL NULL NULL NULL NULL 20 NULL +3 MATERIALIZED parent2 eq_ref PRIMARY PRIMARY 4 test.parent1.pk 1 Using index SELECT * FROM t1 WHERE g1 NOT IN @@ -10582,6 +10592,95 @@ p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); ID 126 DROP TABLE t1,t2; +# +# Bug#18194196: OPTIMIZER EXECUTES STATEMENT INPERFORMANT +# +CREATE TABLE t1 (uid INTEGER, fid INTEGER, INDEX(uid)); +INSERT INTO t1 VALUES +(1,1), (1,2), (1,3), (1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t2 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t2 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +CREATE TABLE t3 (uid INT, fid INT, INDEX(uid)); +INSERT INTO t3 VALUES +(1,1), (1,2), (1,3),(1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t4 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t4 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +ANALYZE TABLE t1,t2,t3,t4; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +test.t3 analyze status OK +test.t4 analyze status OK +EXPLAIN SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index +1 SIMPLE t1 ALL uid NULL NULL NULL 11 Using where; End temporary; Using join buffer (Block Nested Loop) +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 NULL +FLUSH STATUS; +SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +name +A +B +C +D +E +F +G +H +A +B +I +SHOW STATUS LIKE '%handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 16 +Handler_read_last 0 +Handler_read_next 4 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 12 +DROP TABLE t1,t2,t3,t4; +# End of test for Bug#18194196 +# +# Bug#21184091 ASSERT `READ_ROWS >= 0.0' AT +# COST_MODEL_SERVER::TMPTABLE_READWRITE_COST() +# +CREATE TABLE t1 ( +col_int int(11), +pk int(11) NOT NULL, +col_int_key int(11) , +col_varchar varchar(1), +PRIMARY KEY (pk) +) ENGINE=MyISAM; +CREATE TABLE t2 ( +col_int int(11), +col_varchar varchar(1) +) ENGINE=MyISAM; +INSERT INTO t2 VALUES (19,'x'); +INSERT INTO t2 VALUES (20,'z'); +SELECT table1.col_varchar +FROM (t2 AS table1 RIGHT JOIN +((t2 STRAIGHT_JOIN t1 ON (t1.col_varchar = t2.col_varchar))) +ON (t1.pk = t2.col_int)) +WHERE (t1.pk IN (SELECT t1.col_int_key +FROM (t1 INNER JOIN t2 ON (t2.col_int = t1.col_int)))) +AND table1.col_varchar != 'q'; +col_varchar +DROP TABLE t1,t2; +# End of test for Bug#21184091 set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_all_bka.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_all_bka.result index 55d7d63d..acf5190a 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_all_bka.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_all_bka.result @@ -2940,43 +2940,49 @@ EXPLAIN { "query_block": { "select_id": 1, - "duplicates_removal": { - "using_temporary_table": true, - "nested_loop": [ - { - "table": { - "table_name": "t11", - "access_type": "ALL", - "rows": 8, - "filtered": 100 - } - }, - { - "table": { - "table_name": "t1", - "access_type": "eq_ref", - "possible_keys": [ - "PRIMARY" - ], - "key": "PRIMARY", - "used_key_parts": [ - "a" - ], - "key_length": "4", - "ref": [ - "test.t11.a" - ], - "rows": 1, - "filtered": 100, - "using_join_buffer": "Batched Key Access" + "nested_loop": [ + { + "table": { + "table_name": "", + "access_type": "ALL", + "materialized_from_subquery": { + "using_temporary_table": true, + "query_block": { + "table": { + "table_name": "t11", + "access_type": "ALL", + "rows": 8, + "filtered": 100 + } + } } } - ] - } + }, + { + "table": { + "table_name": "t1", + "access_type": "eq_ref", + "possible_keys": [ + "PRIMARY" + ], + "key": "PRIMARY", + "used_key_parts": [ + "a" + ], + "key_length": "4", + "ref": [ + ".a" + ], + "rows": 1, + "filtered": 100, + "using_join_buffer": "Batched Key Access" + } + } + ] } } Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` semi join (`test`.`t11`) where (`test`.`t1`.`a` = `test`.`t11`.`a`) +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` semi join (`test`.`t11`) where (`test`.`t1`.`a` = ``.`a`) select t21.* from t21,t22 where t21.a = t22.a and t22.a in (select t12.a from t11, t12 where t11.a in(255,256) and t11.a = t12.a and t11.c is null) and t22.c is null order by t21.a; a b c @@ -3229,8 +3235,9 @@ create table t3 ( a int , filler char(100), key(a)); insert into t3 select A.a + 10*B.a, 'filler' from t0 A, t0 B; explain select * from t3 where a in (select a from t2) and (a > 5 or a < 10); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where; Start temporary -1 SIMPLE t3 ref a a 5 test.t2.a 1 End temporary; Using join buffer (Batched Key Access) +1 SIMPLE ALL NULL NULL NULL NULL NULL Using where +1 SIMPLE t3 ref a a 5 .a 1 Using join buffer (Batched Key Access) +2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 NULL select * from t3 where a in (select a from t2); a filler 1 filler @@ -5749,11 +5756,12 @@ INNER JOIN t2 c ON c.idContact=cona.idContact WHERE cona.postalStripped='T2H3B2' ); id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE cona ALL NULL NULL NULL NULL 2 100.00 Using where; Start temporary -1 SIMPLE c eq_ref PRIMARY PRIMARY 4 test.cona.idContact 1 100.00 Using where; Using join buffer (Batched Key Access) -1 SIMPLE a eq_ref PRIMARY PRIMARY 4 test.c.idObj 1 100.00 Using index; End temporary +1 SIMPLE ALL NULL NULL NULL NULL NULL 0.00 NULL +1 SIMPLE a index PRIMARY PRIMARY 4 NULL 2 100.00 Using where; Using index; Using join buffer (Block Nested Loop) +2 MATERIALIZED cona ALL NULL NULL NULL NULL 2 100.00 Using where +2 MATERIALIZED c eq_ref PRIMARY PRIMARY 4 test.cona.idContact 1 100.00 Using join buffer (Batched Key Access) Warnings: -Note 1003 /* select#1 */ select `test`.`a`.`idIndividual` AS `idIndividual` from `test`.`t1` `a` semi join (`test`.`t3` `cona` join `test`.`t2` `c`) where ((`test`.`c`.`idContact` = `test`.`cona`.`idContact`) and (`test`.`a`.`idIndividual` = `test`.`c`.`idObj`) and (`test`.`cona`.`postalStripped` = 'T2H3B2')) +Note 1003 /* select#1 */ select `test`.`a`.`idIndividual` AS `idIndividual` from `test`.`t1` `a` semi join (`test`.`t3` `cona` join `test`.`t2` `c`) where ((`test`.`c`.`idContact` = `test`.`cona`.`idContact`) and (`test`.`a`.`idIndividual` = ``.`idObj`) and (`test`.`cona`.`postalStripped` = 'T2H3B2')) drop table t1,t2,t3; CREATE TABLE t1 (one int, two int, flag char(1)); CREATE TABLE t2 (one int, two int, flag char(1)); @@ -6873,8 +6881,8 @@ and t2.uid=t1.fid; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary 1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index -1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 End temporary; Using join buffer (Batched Key Access) -1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 9 Using where; Using join buffer (Block Nested Loop) +1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 Using where; Using join buffer (Batched Key Access) +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 End temporary; Using join buffer (Batched Key Access) select name from t2, t1 where t1.uid in (select t4.uid from t4, t3 where t3.uid=1 and t4.uid=t3.fid) and t2.uid=t1.fid; @@ -7646,8 +7654,9 @@ WHERE col_varchar_key IN (SELECT col_varchar_nokey FROM t2) ORDER BY col_datetime_key LIMIT 4; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort; Start temporary -1 SIMPLE t1 ref col_varchar_key col_varchar_key 3 test.t2.col_varchar_nokey 1 End temporary; Using join buffer (Batched Key Access) +1 SIMPLE t1 ALL col_varchar_key NULL NULL NULL 20 Using where; Using filesort +1 SIMPLE eq_ref 3 test.t1.col_varchar_key 1 NULL +2 MATERIALIZED t2 ALL NULL NULL NULL NULL 6 NULL SELECT col_varchar_key FROM t1 WHERE col_varchar_key IN (SELECT col_varchar_nokey @@ -7719,9 +7728,10 @@ AND grandparent1.col_varchar_key IS NOT NULL ); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where -2 SUBQUERY parent1 ALL NULL NULL NULL NULL 20 Start temporary -2 SUBQUERY parent2 eq_ref PRIMARY PRIMARY 4 test.parent1.pk 1 Using index -2 SUBQUERY grandparent1 ref col_varchar_key col_varchar_key 3 test.parent1.col_varchar_nokey 1 Using index condition; End temporary; Using join buffer (Batched Key Access) +2 SUBQUERY ALL NULL NULL NULL NULL NULL NULL +2 SUBQUERY grandparent1 ref col_varchar_key col_varchar_key 3 .p1 1 Using index condition; Using join buffer (Batched Key Access) +3 MATERIALIZED parent1 ALL NULL NULL NULL NULL 20 NULL +3 MATERIALIZED parent2 eq_ref PRIMARY PRIMARY 4 test.parent1.pk 1 Using index SELECT * FROM t1 WHERE g1 NOT IN @@ -10588,6 +10598,95 @@ p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); ID 126 DROP TABLE t1,t2; +# +# Bug#18194196: OPTIMIZER EXECUTES STATEMENT INPERFORMANT +# +CREATE TABLE t1 (uid INTEGER, fid INTEGER, INDEX(uid)); +INSERT INTO t1 VALUES +(1,1), (1,2), (1,3), (1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t2 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t2 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +CREATE TABLE t3 (uid INT, fid INT, INDEX(uid)); +INSERT INTO t3 VALUES +(1,1), (1,2), (1,3),(1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t4 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t4 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +ANALYZE TABLE t1,t2,t3,t4; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +test.t3 analyze status OK +test.t4 analyze status OK +EXPLAIN SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index +1 SIMPLE t1 ALL uid NULL NULL NULL 11 Using where; End temporary; Using join buffer (Block Nested Loop) +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 Using join buffer (Batched Key Access) +FLUSH STATUS; +SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +name +A +A +B +B +C +D +E +F +G +H +I +SHOW STATUS LIKE '%handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 16 +Handler_read_last 0 +Handler_read_next 15 +Handler_read_prev 0 +Handler_read_rnd 11 +Handler_read_rnd_next 12 +DROP TABLE t1,t2,t3,t4; +# End of test for Bug#18194196 +# +# Bug#21184091 ASSERT `READ_ROWS >= 0.0' AT +# COST_MODEL_SERVER::TMPTABLE_READWRITE_COST() +# +CREATE TABLE t1 ( +col_int int(11), +pk int(11) NOT NULL, +col_int_key int(11) , +col_varchar varchar(1), +PRIMARY KEY (pk) +) ENGINE=MyISAM; +CREATE TABLE t2 ( +col_int int(11), +col_varchar varchar(1) +) ENGINE=MyISAM; +INSERT INTO t2 VALUES (19,'x'); +INSERT INTO t2 VALUES (20,'z'); +SELECT table1.col_varchar +FROM (t2 AS table1 RIGHT JOIN +((t2 STRAIGHT_JOIN t1 ON (t1.col_varchar = t2.col_varchar))) +ON (t1.pk = t2.col_int)) +WHERE (t1.pk IN (SELECT t1.col_int_key +FROM (t1 INNER JOIN t2 ON (t2.col_int = t1.col_int)))) +AND table1.col_varchar != 'q'; +col_varchar +DROP TABLE t1,t2; +# End of test for Bug#21184091 set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_all_bka_nixbnl.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_all_bka_nixbnl.result index 52f4ae6d..85d3b8e3 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_all_bka_nixbnl.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_all_bka_nixbnl.result @@ -2935,43 +2935,49 @@ EXPLAIN { "query_block": { "select_id": 1, - "duplicates_removal": { - "using_temporary_table": true, - "nested_loop": [ - { - "table": { - "table_name": "t11", - "access_type": "ALL", - "rows": 8, - "filtered": 100 - } - }, - { - "table": { - "table_name": "t1", - "access_type": "eq_ref", - "possible_keys": [ - "PRIMARY" - ], - "key": "PRIMARY", - "used_key_parts": [ - "a" - ], - "key_length": "4", - "ref": [ - "test.t11.a" - ], - "rows": 1, - "filtered": 100, - "using_join_buffer": "Batched Key Access" + "nested_loop": [ + { + "table": { + "table_name": "", + "access_type": "ALL", + "materialized_from_subquery": { + "using_temporary_table": true, + "query_block": { + "table": { + "table_name": "t11", + "access_type": "ALL", + "rows": 8, + "filtered": 100 + } + } } } - ] - } + }, + { + "table": { + "table_name": "t1", + "access_type": "eq_ref", + "possible_keys": [ + "PRIMARY" + ], + "key": "PRIMARY", + "used_key_parts": [ + "a" + ], + "key_length": "4", + "ref": [ + ".a" + ], + "rows": 1, + "filtered": 100, + "using_join_buffer": "Batched Key Access" + } + } + ] } } Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` semi join (`test`.`t11`) where (`test`.`t1`.`a` = `test`.`t11`.`a`) +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` semi join (`test`.`t11`) where (`test`.`t1`.`a` = ``.`a`) select t21.* from t21,t22 where t21.a = t22.a and t22.a in (select t12.a from t11, t12 where t11.a in(255,256) and t11.a = t12.a and t11.c is null) and t22.c is null order by t21.a; a b c @@ -3224,8 +3230,9 @@ create table t3 ( a int , filler char(100), key(a)); insert into t3 select A.a + 10*B.a, 'filler' from t0 A, t0 B; explain select * from t3 where a in (select a from t2) and (a > 5 or a < 10); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where; Start temporary -1 SIMPLE t3 ref a a 5 test.t2.a 1 End temporary; Using join buffer (Batched Key Access) +1 SIMPLE ALL NULL NULL NULL NULL NULL Using where +1 SIMPLE t3 ref a a 5 .a 1 Using join buffer (Batched Key Access) +2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 NULL select * from t3 where a in (select a from t2); a filler 1 filler @@ -5759,11 +5766,12 @@ INNER JOIN t2 c ON c.idContact=cona.idContact WHERE cona.postalStripped='T2H3B2' ); id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE cona ALL NULL NULL NULL NULL 2 100.00 Using where; Start temporary -1 SIMPLE c eq_ref PRIMARY PRIMARY 4 test.cona.idContact 1 100.00 Using where; Using join buffer (Batched Key Access) -1 SIMPLE a eq_ref PRIMARY PRIMARY 4 test.c.idObj 1 100.00 Using index; End temporary +1 SIMPLE ALL NULL NULL NULL NULL NULL 0.00 Using where +1 SIMPLE a eq_ref PRIMARY PRIMARY 4 .idObj 1 100.00 Using index +2 MATERIALIZED cona ALL NULL NULL NULL NULL 2 100.00 Using where +2 MATERIALIZED c eq_ref PRIMARY PRIMARY 4 test.cona.idContact 1 100.00 Using join buffer (Batched Key Access) Warnings: -Note 1003 /* select#1 */ select `test`.`a`.`idIndividual` AS `idIndividual` from `test`.`t1` `a` semi join (`test`.`t3` `cona` join `test`.`t2` `c`) where ((`test`.`c`.`idContact` = `test`.`cona`.`idContact`) and (`test`.`a`.`idIndividual` = `test`.`c`.`idObj`) and (`test`.`cona`.`postalStripped` = 'T2H3B2')) +Note 1003 /* select#1 */ select `test`.`a`.`idIndividual` AS `idIndividual` from `test`.`t1` `a` semi join (`test`.`t3` `cona` join `test`.`t2` `c`) where ((`test`.`c`.`idContact` = `test`.`cona`.`idContact`) and (`test`.`a`.`idIndividual` = ``.`idObj`) and (`test`.`cona`.`postalStripped` = 'T2H3B2')) drop table t1,t2,t3; CREATE TABLE t1 (one int, two int, flag char(1)); CREATE TABLE t2 (one int, two int, flag char(1)); @@ -6883,8 +6891,8 @@ and t2.uid=t1.fid; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary 1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index -1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 End temporary; Using join buffer (Batched Key Access) -1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 9 Using where +1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 Using where; Using join buffer (Batched Key Access) +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 End temporary; Using join buffer (Batched Key Access) select name from t2, t1 where t1.uid in (select t4.uid from t4, t3 where t3.uid=1 and t4.uid=t3.fid) and t2.uid=t1.fid; @@ -7656,8 +7664,9 @@ WHERE col_varchar_key IN (SELECT col_varchar_nokey FROM t2) ORDER BY col_datetime_key LIMIT 4; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort; Start temporary -1 SIMPLE t1 ref col_varchar_key col_varchar_key 3 test.t2.col_varchar_nokey 1 End temporary; Using join buffer (Batched Key Access) +1 SIMPLE t1 ALL col_varchar_key NULL NULL NULL 20 Using where; Using filesort +1 SIMPLE eq_ref 3 test.t1.col_varchar_key 1 NULL +2 MATERIALIZED t2 ALL NULL NULL NULL NULL 6 NULL SELECT col_varchar_key FROM t1 WHERE col_varchar_key IN (SELECT col_varchar_nokey @@ -7729,9 +7738,10 @@ AND grandparent1.col_varchar_key IS NOT NULL ); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where -2 SUBQUERY parent1 ALL NULL NULL NULL NULL 20 Start temporary -2 SUBQUERY parent2 eq_ref PRIMARY PRIMARY 4 test.parent1.pk 1 Using index -2 SUBQUERY grandparent1 ref col_varchar_key col_varchar_key 3 test.parent1.col_varchar_nokey 1 Using index condition; End temporary; Using join buffer (Batched Key Access) +2 SUBQUERY ALL NULL NULL NULL NULL NULL NULL +2 SUBQUERY grandparent1 ref col_varchar_key col_varchar_key 3 .p1 1 Using index condition; Using join buffer (Batched Key Access) +3 MATERIALIZED parent1 ALL NULL NULL NULL NULL 20 NULL +3 MATERIALIZED parent2 eq_ref PRIMARY PRIMARY 4 test.parent1.pk 1 Using index SELECT * FROM t1 WHERE g1 NOT IN @@ -10597,6 +10607,95 @@ p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); ID 126 DROP TABLE t1,t2; +# +# Bug#18194196: OPTIMIZER EXECUTES STATEMENT INPERFORMANT +# +CREATE TABLE t1 (uid INTEGER, fid INTEGER, INDEX(uid)); +INSERT INTO t1 VALUES +(1,1), (1,2), (1,3), (1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t2 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t2 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +CREATE TABLE t3 (uid INT, fid INT, INDEX(uid)); +INSERT INTO t3 VALUES +(1,1), (1,2), (1,3),(1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t4 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t4 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +ANALYZE TABLE t1,t2,t3,t4; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +test.t3 analyze status OK +test.t4 analyze status OK +EXPLAIN SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index +1 SIMPLE t1 ref uid uid 5 test.t3.fid 4 Using where; End temporary; Using join buffer (Batched Key Access) +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 Using join buffer (Batched Key Access) +FLUSH STATUS; +SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +name +A +A +B +B +C +D +E +F +G +H +I +SHOW STATUS LIKE '%handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 20 +Handler_read_last 0 +Handler_read_next 26 +Handler_read_prev 0 +Handler_read_rnd 22 +Handler_read_rnd_next 0 +DROP TABLE t1,t2,t3,t4; +# End of test for Bug#18194196 +# +# Bug#21184091 ASSERT `READ_ROWS >= 0.0' AT +# COST_MODEL_SERVER::TMPTABLE_READWRITE_COST() +# +CREATE TABLE t1 ( +col_int int(11), +pk int(11) NOT NULL, +col_int_key int(11) , +col_varchar varchar(1), +PRIMARY KEY (pk) +) ENGINE=MyISAM; +CREATE TABLE t2 ( +col_int int(11), +col_varchar varchar(1) +) ENGINE=MyISAM; +INSERT INTO t2 VALUES (19,'x'); +INSERT INTO t2 VALUES (20,'z'); +SELECT table1.col_varchar +FROM (t2 AS table1 RIGHT JOIN +((t2 STRAIGHT_JOIN t1 ON (t1.col_varchar = t2.col_varchar))) +ON (t1.pk = t2.col_int)) +WHERE (t1.pk IN (SELECT t1.col_int_key +FROM (t1 INNER JOIN t2 ON (t2.col_int = t1.col_int)))) +AND table1.col_varchar != 'q'; +col_varchar +DROP TABLE t1,t2; +# End of test for Bug#21184091 set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_all_bkaunique.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_all_bkaunique.result index f05ca11b..b3540ad1 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_all_bkaunique.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_all_bkaunique.result @@ -2941,43 +2941,49 @@ EXPLAIN { "query_block": { "select_id": 1, - "duplicates_removal": { - "using_temporary_table": true, - "nested_loop": [ - { - "table": { - "table_name": "t11", - "access_type": "ALL", - "rows": 8, - "filtered": 100 - } - }, - { - "table": { - "table_name": "t1", - "access_type": "eq_ref", - "possible_keys": [ - "PRIMARY" - ], - "key": "PRIMARY", - "used_key_parts": [ - "a" - ], - "key_length": "4", - "ref": [ - "test.t11.a" - ], - "rows": 1, - "filtered": 100, - "using_join_buffer": "Batched Key Access (unique)" + "nested_loop": [ + { + "table": { + "table_name": "", + "access_type": "ALL", + "materialized_from_subquery": { + "using_temporary_table": true, + "query_block": { + "table": { + "table_name": "t11", + "access_type": "ALL", + "rows": 8, + "filtered": 100 + } + } } } - ] - } + }, + { + "table": { + "table_name": "t1", + "access_type": "eq_ref", + "possible_keys": [ + "PRIMARY" + ], + "key": "PRIMARY", + "used_key_parts": [ + "a" + ], + "key_length": "4", + "ref": [ + ".a" + ], + "rows": 1, + "filtered": 100, + "using_join_buffer": "Batched Key Access (unique)" + } + } + ] } } Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` semi join (`test`.`t11`) where (`test`.`t1`.`a` = `test`.`t11`.`a`) +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` semi join (`test`.`t11`) where (`test`.`t1`.`a` = ``.`a`) select t21.* from t21,t22 where t21.a = t22.a and t22.a in (select t12.a from t11, t12 where t11.a in(255,256) and t11.a = t12.a and t11.c is null) and t22.c is null order by t21.a; a b c @@ -3230,8 +3236,9 @@ create table t3 ( a int , filler char(100), key(a)); insert into t3 select A.a + 10*B.a, 'filler' from t0 A, t0 B; explain select * from t3 where a in (select a from t2) and (a > 5 or a < 10); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where; Start temporary -1 SIMPLE t3 ref a a 5 test.t2.a 1 End temporary; Using join buffer (Batched Key Access (unique)) +1 SIMPLE ALL NULL NULL NULL NULL NULL Using where +1 SIMPLE t3 ref a a 5 .a 1 Using join buffer (Batched Key Access (unique)) +2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 NULL select * from t3 where a in (select a from t2); a filler 1 filler @@ -5750,11 +5757,12 @@ INNER JOIN t2 c ON c.idContact=cona.idContact WHERE cona.postalStripped='T2H3B2' ); id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE cona ALL NULL NULL NULL NULL 2 100.00 Using where; Start temporary -1 SIMPLE c eq_ref PRIMARY PRIMARY 4 test.cona.idContact 1 100.00 Using where; Using join buffer (Batched Key Access (unique)) -1 SIMPLE a eq_ref PRIMARY PRIMARY 4 test.c.idObj 1 100.00 Using index; End temporary +1 SIMPLE ALL NULL NULL NULL NULL NULL 0.00 NULL +1 SIMPLE a index PRIMARY PRIMARY 4 NULL 2 100.00 Using where; Using index; Using join buffer (Block Nested Loop) +2 MATERIALIZED cona ALL NULL NULL NULL NULL 2 100.00 Using where +2 MATERIALIZED c eq_ref PRIMARY PRIMARY 4 test.cona.idContact 1 100.00 Using join buffer (Batched Key Access (unique)) Warnings: -Note 1003 /* select#1 */ select `test`.`a`.`idIndividual` AS `idIndividual` from `test`.`t1` `a` semi join (`test`.`t3` `cona` join `test`.`t2` `c`) where ((`test`.`c`.`idContact` = `test`.`cona`.`idContact`) and (`test`.`a`.`idIndividual` = `test`.`c`.`idObj`) and (`test`.`cona`.`postalStripped` = 'T2H3B2')) +Note 1003 /* select#1 */ select `test`.`a`.`idIndividual` AS `idIndividual` from `test`.`t1` `a` semi join (`test`.`t3` `cona` join `test`.`t2` `c`) where ((`test`.`c`.`idContact` = `test`.`cona`.`idContact`) and (`test`.`a`.`idIndividual` = ``.`idObj`) and (`test`.`cona`.`postalStripped` = 'T2H3B2')) drop table t1,t2,t3; CREATE TABLE t1 (one int, two int, flag char(1)); CREATE TABLE t2 (one int, two int, flag char(1)); @@ -6874,8 +6882,8 @@ and t2.uid=t1.fid; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary 1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index -1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 End temporary; Using join buffer (Batched Key Access (unique)) -1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 9 Using where; Using join buffer (Block Nested Loop) +1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 Using where; Using join buffer (Batched Key Access (unique)) +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 End temporary; Using join buffer (Batched Key Access (unique)) select name from t2, t1 where t1.uid in (select t4.uid from t4, t3 where t3.uid=1 and t4.uid=t3.fid) and t2.uid=t1.fid; @@ -7647,8 +7655,9 @@ WHERE col_varchar_key IN (SELECT col_varchar_nokey FROM t2) ORDER BY col_datetime_key LIMIT 4; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort; Start temporary -1 SIMPLE t1 ref col_varchar_key col_varchar_key 3 test.t2.col_varchar_nokey 1 End temporary; Using join buffer (Batched Key Access (unique)) +1 SIMPLE t1 ALL col_varchar_key NULL NULL NULL 20 Using where; Using filesort +1 SIMPLE eq_ref 3 test.t1.col_varchar_key 1 NULL +2 MATERIALIZED t2 ALL NULL NULL NULL NULL 6 NULL SELECT col_varchar_key FROM t1 WHERE col_varchar_key IN (SELECT col_varchar_nokey @@ -7720,9 +7729,10 @@ AND grandparent1.col_varchar_key IS NOT NULL ); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where -2 SUBQUERY parent1 ALL NULL NULL NULL NULL 20 Start temporary -2 SUBQUERY parent2 eq_ref PRIMARY PRIMARY 4 test.parent1.pk 1 Using index -2 SUBQUERY grandparent1 ref col_varchar_key col_varchar_key 3 test.parent1.col_varchar_nokey 1 Using index condition; End temporary; Using join buffer (Batched Key Access (unique)) +2 SUBQUERY ALL NULL NULL NULL NULL NULL NULL +2 SUBQUERY grandparent1 ref col_varchar_key col_varchar_key 3 .p1 1 Using index condition; Using join buffer (Batched Key Access (unique)) +3 MATERIALIZED parent1 ALL NULL NULL NULL NULL 20 NULL +3 MATERIALIZED parent2 eq_ref PRIMARY PRIMARY 4 test.parent1.pk 1 Using index SELECT * FROM t1 WHERE g1 NOT IN @@ -10589,6 +10599,95 @@ p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); ID 126 DROP TABLE t1,t2; +# +# Bug#18194196: OPTIMIZER EXECUTES STATEMENT INPERFORMANT +# +CREATE TABLE t1 (uid INTEGER, fid INTEGER, INDEX(uid)); +INSERT INTO t1 VALUES +(1,1), (1,2), (1,3), (1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t2 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t2 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +CREATE TABLE t3 (uid INT, fid INT, INDEX(uid)); +INSERT INTO t3 VALUES +(1,1), (1,2), (1,3),(1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t4 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t4 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +ANALYZE TABLE t1,t2,t3,t4; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +test.t3 analyze status OK +test.t4 analyze status OK +EXPLAIN SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index +1 SIMPLE t1 ALL uid NULL NULL NULL 11 Using where; End temporary; Using join buffer (Block Nested Loop) +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 Using join buffer (Batched Key Access (unique)) +FLUSH STATUS; +SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +name +A +A +B +B +C +D +E +F +G +H +I +SHOW STATUS LIKE '%handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 14 +Handler_read_last 0 +Handler_read_next 13 +Handler_read_prev 0 +Handler_read_rnd 9 +Handler_read_rnd_next 12 +DROP TABLE t1,t2,t3,t4; +# End of test for Bug#18194196 +# +# Bug#21184091 ASSERT `READ_ROWS >= 0.0' AT +# COST_MODEL_SERVER::TMPTABLE_READWRITE_COST() +# +CREATE TABLE t1 ( +col_int int(11), +pk int(11) NOT NULL, +col_int_key int(11) , +col_varchar varchar(1), +PRIMARY KEY (pk) +) ENGINE=MyISAM; +CREATE TABLE t2 ( +col_int int(11), +col_varchar varchar(1) +) ENGINE=MyISAM; +INSERT INTO t2 VALUES (19,'x'); +INSERT INTO t2 VALUES (20,'z'); +SELECT table1.col_varchar +FROM (t2 AS table1 RIGHT JOIN +((t2 STRAIGHT_JOIN t1 ON (t1.col_varchar = t2.col_varchar))) +ON (t1.pk = t2.col_int)) +WHERE (t1.pk IN (SELECT t1.col_int_key +FROM (t1 INNER JOIN t2 ON (t2.col_int = t1.col_int)))) +AND table1.col_varchar != 'q'; +col_varchar +DROP TABLE t1,t2; +# End of test for Bug#21184091 set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed.result index c9c4e7ad..e17ca8e3 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed.result @@ -6811,8 +6811,8 @@ and t2.uid=t1.fid; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary 1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index -1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 End temporary -1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 9 Using where; Using join buffer (Block Nested Loop) +1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 Using where +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 End temporary select name from t2, t1 where t1.uid in (select t4.uid from t4, t3 where t3.uid=1 and t4.uid=t3.fid) and t2.uid=t1.fid; @@ -8035,9 +8035,9 @@ AND grandparent1.col_int_key <> 3 ); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 DEPENDENT SUBQUERY parent1 ref col_int_key col_int_key 4 func 2 Using where; Start temporary -2 DEPENDENT SUBQUERY parent2 index col_int_key col_int_key 4 NULL 1 Using where; Using index; Using join buffer (Block Nested Loop) -2 DEPENDENT SUBQUERY grandparent1 ref col_int_key col_int_key 4 func 2 Using where; End temporary +2 DEPENDENT SUBQUERY grandparent1 ref col_int_key col_int_key 4 func 2 Using where; Start temporary +2 DEPENDENT SUBQUERY parent1 ref col_int_key col_int_key 4 func 2 Using where +2 DEPENDENT SUBQUERY parent2 index col_int_key col_int_key 4 NULL 1 Using where; Using index; End temporary; Using join buffer (Block Nested Loop) explain format=json SELECT * FROM t3 WHERE g1 NOT IN (SELECT grandparent1.col_int_nokey AS g1 @@ -8068,7 +8068,7 @@ EXPLAIN "nested_loop": [ { "table": { - "table_name": "parent1", + "table_name": "grandparent1", "access_type": "ref", "possible_keys": [ "col_int_key" @@ -8083,13 +8083,13 @@ EXPLAIN ], "rows": 2, "filtered": 100, - "attached_condition": "(`test`.`parent1`.`col_int_key` <> 3)" + "attached_condition": "((`test`.`grandparent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`) and (`test`.`grandparent1`.`col_int_key` <> 3) and (('8') = `test`.`grandparent1`.`col_int_nokey`))" } }, { "table": { - "table_name": "parent2", - "access_type": "index", + "table_name": "parent1", + "access_type": "ref", "possible_keys": [ "col_int_key" ], @@ -8098,17 +8098,18 @@ EXPLAIN "col_int_key" ], "key_length": "4", - "rows": 1, + "ref": [ + "func" + ], + "rows": 2, "filtered": 100, - "using_index": true, - "using_join_buffer": "Block Nested Loop", - "attached_condition": "(is_not_null_compl(parent2), (`test`.`parent1`.`col_int_nokey` = `test`.`parent2`.`col_int_key`), true)" + "attached_condition": "(`test`.`parent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`)" } }, { "table": { - "table_name": "grandparent1", - "access_type": "ref", + "table_name": "parent2", + "access_type": "index", "possible_keys": [ "col_int_key" ], @@ -8117,12 +8118,11 @@ EXPLAIN "col_int_key" ], "key_length": "4", - "ref": [ - "func" - ], - "rows": 2, + "rows": 1, "filtered": 100, - "attached_condition": "((`test`.`grandparent1`.`col_int_nokey` = `test`.`parent1`.`col_int_key`) and (`test`.`grandparent1`.`col_int_key` = `test`.`parent1`.`col_int_key`))" + "using_index": true, + "using_join_buffer": "Block Nested Loop", + "attached_condition": "(is_not_null_compl(parent2), (`test`.`parent1`.`col_int_nokey` = `test`.`parent2`.`col_int_key`), true)" } } ] @@ -8134,7 +8134,7 @@ EXPLAIN } } Warnings: -Note 1003 /* select#1 */ select '8' AS `g1` from dual where (not(('8',(/* select#2 */ select 1 from `test`.`t1` `grandparent1` semi join (`test`.`t1` `parent1` left join `test`.`t2` `parent2` on((`test`.`parent1`.`col_int_nokey` = `test`.`parent2`.`col_int_key`))) where ((`test`.`grandparent1`.`col_int_nokey` = `test`.`parent1`.`col_int_key`) and (`test`.`grandparent1`.`col_int_key` = `test`.`parent1`.`col_int_key`) and (`test`.`parent1`.`col_int_key` <> 3) and (('8') = `test`.`parent1`.`col_int_key`)))))) +Note 1003 /* select#1 */ select '8' AS `g1` from dual where (not(('8',(/* select#2 */ select 1 from `test`.`t1` `grandparent1` semi join (`test`.`t1` `parent1` left join `test`.`t2` `parent2` on((`test`.`parent1`.`col_int_nokey` = `test`.`parent2`.`col_int_key`))) where ((`test`.`grandparent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`) and (`test`.`parent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`) and (`test`.`grandparent1`.`col_int_key` <> 3) and (('8') = `test`.`grandparent1`.`col_int_nokey`)))))) SELECT * FROM t3 WHERE g1 NOT IN (SELECT grandparent1.col_int_nokey AS g1 @@ -10464,6 +10464,95 @@ p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); ID 126 DROP TABLE t1,t2; +# +# Bug#18194196: OPTIMIZER EXECUTES STATEMENT INPERFORMANT +# +CREATE TABLE t1 (uid INTEGER, fid INTEGER, INDEX(uid)); +INSERT INTO t1 VALUES +(1,1), (1,2), (1,3), (1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t2 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t2 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +CREATE TABLE t3 (uid INT, fid INT, INDEX(uid)); +INSERT INTO t3 VALUES +(1,1), (1,2), (1,3),(1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t4 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t4 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +ANALYZE TABLE t1,t2,t3,t4; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +test.t3 analyze status OK +test.t4 analyze status OK +EXPLAIN SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index +1 SIMPLE t1 ALL uid NULL NULL NULL 11 Using where; End temporary; Using join buffer (Block Nested Loop) +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 NULL +FLUSH STATUS; +SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +name +A +B +C +D +E +F +G +H +A +B +I +SHOW STATUS LIKE '%handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 16 +Handler_read_last 0 +Handler_read_next 4 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 12 +DROP TABLE t1,t2,t3,t4; +# End of test for Bug#18194196 +# +# Bug#21184091 ASSERT `READ_ROWS >= 0.0' AT +# COST_MODEL_SERVER::TMPTABLE_READWRITE_COST() +# +CREATE TABLE t1 ( +col_int int(11), +pk int(11) NOT NULL, +col_int_key int(11) , +col_varchar varchar(1), +PRIMARY KEY (pk) +) ENGINE=MyISAM; +CREATE TABLE t2 ( +col_int int(11), +col_varchar varchar(1) +) ENGINE=MyISAM; +INSERT INTO t2 VALUES (19,'x'); +INSERT INTO t2 VALUES (20,'z'); +SELECT table1.col_varchar +FROM (t2 AS table1 RIGHT JOIN +((t2 STRAIGHT_JOIN t1 ON (t1.col_varchar = t2.col_varchar))) +ON (t1.pk = t2.col_int)) +WHERE (t1.pk IN (SELECT t1.col_int_key +FROM (t1 INNER JOIN t2 ON (t2.col_int = t1.col_int)))) +AND table1.col_varchar != 'q'; +col_varchar +DROP TABLE t1,t2; +# End of test for Bug#21184091 set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed_bka.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed_bka.result index 7ce8131c..3b5bd304 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed_bka.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed_bka.result @@ -6812,8 +6812,8 @@ and t2.uid=t1.fid; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary 1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index -1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 End temporary -1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 9 Using where; Using join buffer (Block Nested Loop) +1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 Using where +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 End temporary select name from t2, t1 where t1.uid in (select t4.uid from t4, t3 where t3.uid=1 and t4.uid=t3.fid) and t2.uid=t1.fid; @@ -8036,9 +8036,9 @@ AND grandparent1.col_int_key <> 3 ); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 DEPENDENT SUBQUERY parent1 ref col_int_key col_int_key 4 func 2 Using where; Start temporary -2 DEPENDENT SUBQUERY parent2 index col_int_key col_int_key 4 NULL 1 Using where; Using index; Using join buffer (Block Nested Loop) -2 DEPENDENT SUBQUERY grandparent1 ref col_int_key col_int_key 4 func 2 Using where; End temporary +2 DEPENDENT SUBQUERY grandparent1 ref col_int_key col_int_key 4 func 2 Using where; Start temporary +2 DEPENDENT SUBQUERY parent1 ref col_int_key col_int_key 4 func 2 Using where +2 DEPENDENT SUBQUERY parent2 index col_int_key col_int_key 4 NULL 1 Using where; Using index; End temporary; Using join buffer (Block Nested Loop) explain format=json SELECT * FROM t3 WHERE g1 NOT IN (SELECT grandparent1.col_int_nokey AS g1 @@ -8069,7 +8069,7 @@ EXPLAIN "nested_loop": [ { "table": { - "table_name": "parent1", + "table_name": "grandparent1", "access_type": "ref", "possible_keys": [ "col_int_key" @@ -8084,13 +8084,13 @@ EXPLAIN ], "rows": 2, "filtered": 100, - "attached_condition": "(`test`.`parent1`.`col_int_key` <> 3)" + "attached_condition": "((`test`.`grandparent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`) and (`test`.`grandparent1`.`col_int_key` <> 3) and (('8') = `test`.`grandparent1`.`col_int_nokey`))" } }, { "table": { - "table_name": "parent2", - "access_type": "index", + "table_name": "parent1", + "access_type": "ref", "possible_keys": [ "col_int_key" ], @@ -8099,17 +8099,18 @@ EXPLAIN "col_int_key" ], "key_length": "4", - "rows": 1, + "ref": [ + "func" + ], + "rows": 2, "filtered": 100, - "using_index": true, - "using_join_buffer": "Block Nested Loop", - "attached_condition": "(is_not_null_compl(parent2), (`test`.`parent1`.`col_int_nokey` = `test`.`parent2`.`col_int_key`), true)" + "attached_condition": "(`test`.`parent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`)" } }, { "table": { - "table_name": "grandparent1", - "access_type": "ref", + "table_name": "parent2", + "access_type": "index", "possible_keys": [ "col_int_key" ], @@ -8118,12 +8119,11 @@ EXPLAIN "col_int_key" ], "key_length": "4", - "ref": [ - "func" - ], - "rows": 2, + "rows": 1, "filtered": 100, - "attached_condition": "((`test`.`grandparent1`.`col_int_nokey` = `test`.`parent1`.`col_int_key`) and (`test`.`grandparent1`.`col_int_key` = `test`.`parent1`.`col_int_key`))" + "using_index": true, + "using_join_buffer": "Block Nested Loop", + "attached_condition": "(is_not_null_compl(parent2), (`test`.`parent1`.`col_int_nokey` = `test`.`parent2`.`col_int_key`), true)" } } ] @@ -8135,7 +8135,7 @@ EXPLAIN } } Warnings: -Note 1003 /* select#1 */ select '8' AS `g1` from dual where (not(('8',(/* select#2 */ select 1 from `test`.`t1` `grandparent1` semi join (`test`.`t1` `parent1` left join `test`.`t2` `parent2` on((`test`.`parent1`.`col_int_nokey` = `test`.`parent2`.`col_int_key`))) where ((`test`.`grandparent1`.`col_int_nokey` = `test`.`parent1`.`col_int_key`) and (`test`.`grandparent1`.`col_int_key` = `test`.`parent1`.`col_int_key`) and (`test`.`parent1`.`col_int_key` <> 3) and (('8') = `test`.`parent1`.`col_int_key`)))))) +Note 1003 /* select#1 */ select '8' AS `g1` from dual where (not(('8',(/* select#2 */ select 1 from `test`.`t1` `grandparent1` semi join (`test`.`t1` `parent1` left join `test`.`t2` `parent2` on((`test`.`parent1`.`col_int_nokey` = `test`.`parent2`.`col_int_key`))) where ((`test`.`grandparent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`) and (`test`.`parent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`) and (`test`.`grandparent1`.`col_int_key` <> 3) and (('8') = `test`.`grandparent1`.`col_int_nokey`)))))) SELECT * FROM t3 WHERE g1 NOT IN (SELECT grandparent1.col_int_nokey AS g1 @@ -10469,6 +10469,95 @@ p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); ID 126 DROP TABLE t1,t2; +# +# Bug#18194196: OPTIMIZER EXECUTES STATEMENT INPERFORMANT +# +CREATE TABLE t1 (uid INTEGER, fid INTEGER, INDEX(uid)); +INSERT INTO t1 VALUES +(1,1), (1,2), (1,3), (1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t2 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t2 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +CREATE TABLE t3 (uid INT, fid INT, INDEX(uid)); +INSERT INTO t3 VALUES +(1,1), (1,2), (1,3),(1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t4 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t4 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +ANALYZE TABLE t1,t2,t3,t4; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +test.t3 analyze status OK +test.t4 analyze status OK +EXPLAIN SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index +1 SIMPLE t1 ALL uid NULL NULL NULL 11 Using where; End temporary; Using join buffer (Block Nested Loop) +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 NULL +FLUSH STATUS; +SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +name +A +B +C +D +E +F +G +H +A +B +I +SHOW STATUS LIKE '%handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 16 +Handler_read_last 0 +Handler_read_next 4 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 12 +DROP TABLE t1,t2,t3,t4; +# End of test for Bug#18194196 +# +# Bug#21184091 ASSERT `READ_ROWS >= 0.0' AT +# COST_MODEL_SERVER::TMPTABLE_READWRITE_COST() +# +CREATE TABLE t1 ( +col_int int(11), +pk int(11) NOT NULL, +col_int_key int(11) , +col_varchar varchar(1), +PRIMARY KEY (pk) +) ENGINE=MyISAM; +CREATE TABLE t2 ( +col_int int(11), +col_varchar varchar(1) +) ENGINE=MyISAM; +INSERT INTO t2 VALUES (19,'x'); +INSERT INTO t2 VALUES (20,'z'); +SELECT table1.col_varchar +FROM (t2 AS table1 RIGHT JOIN +((t2 STRAIGHT_JOIN t1 ON (t1.col_varchar = t2.col_varchar))) +ON (t1.pk = t2.col_int)) +WHERE (t1.pk IN (SELECT t1.col_int_key +FROM (t1 INNER JOIN t2 ON (t2.col_int = t1.col_int)))) +AND table1.col_varchar != 'q'; +col_varchar +DROP TABLE t1,t2; +# End of test for Bug#21184091 set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed_bka_nixbnl.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed_bka_nixbnl.result index b355b9bf..0128f426 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed_bka_nixbnl.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed_bka_nixbnl.result @@ -6822,8 +6822,8 @@ and t2.uid=t1.fid; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary 1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index -1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 End temporary -1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 9 Using where +1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 Using where +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 End temporary select name from t2, t1 where t1.uid in (select t4.uid from t4, t3 where t3.uid=1 and t4.uid=t3.fid) and t2.uid=t1.fid; @@ -10469,6 +10469,95 @@ p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); ID 126 DROP TABLE t1,t2; +# +# Bug#18194196: OPTIMIZER EXECUTES STATEMENT INPERFORMANT +# +CREATE TABLE t1 (uid INTEGER, fid INTEGER, INDEX(uid)); +INSERT INTO t1 VALUES +(1,1), (1,2), (1,3), (1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t2 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t2 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +CREATE TABLE t3 (uid INT, fid INT, INDEX(uid)); +INSERT INTO t3 VALUES +(1,1), (1,2), (1,3),(1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t4 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t4 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +ANALYZE TABLE t1,t2,t3,t4; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +test.t3 analyze status OK +test.t4 analyze status OK +EXPLAIN SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index +1 SIMPLE t1 ref uid uid 5 test.t3.fid 4 Using where; End temporary +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 NULL +FLUSH STATUS; +SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +name +A +B +C +D +E +F +G +H +A +B +I +SHOW STATUS LIKE '%handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 20 +Handler_read_last 0 +Handler_read_next 15 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 0 +DROP TABLE t1,t2,t3,t4; +# End of test for Bug#18194196 +# +# Bug#21184091 ASSERT `READ_ROWS >= 0.0' AT +# COST_MODEL_SERVER::TMPTABLE_READWRITE_COST() +# +CREATE TABLE t1 ( +col_int int(11), +pk int(11) NOT NULL, +col_int_key int(11) , +col_varchar varchar(1), +PRIMARY KEY (pk) +) ENGINE=MyISAM; +CREATE TABLE t2 ( +col_int int(11), +col_varchar varchar(1) +) ENGINE=MyISAM; +INSERT INTO t2 VALUES (19,'x'); +INSERT INTO t2 VALUES (20,'z'); +SELECT table1.col_varchar +FROM (t2 AS table1 RIGHT JOIN +((t2 STRAIGHT_JOIN t1 ON (t1.col_varchar = t2.col_varchar))) +ON (t1.pk = t2.col_int)) +WHERE (t1.pk IN (SELECT t1.col_int_key +FROM (t1 INNER JOIN t2 ON (t2.col_int = t1.col_int)))) +AND table1.col_varchar != 'q'; +col_varchar +DROP TABLE t1,t2; +# End of test for Bug#21184091 set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed_bkaunique.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed_bkaunique.result index b30cc400..d68b5723 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed_bkaunique.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_dupsweed_bkaunique.result @@ -6813,8 +6813,8 @@ and t2.uid=t1.fid; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary 1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index -1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 End temporary -1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 9 Using where; Using join buffer (Block Nested Loop) +1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 Using where +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 End temporary select name from t2, t1 where t1.uid in (select t4.uid from t4, t3 where t3.uid=1 and t4.uid=t3.fid) and t2.uid=t1.fid; @@ -8037,9 +8037,9 @@ AND grandparent1.col_int_key <> 3 ); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 DEPENDENT SUBQUERY parent1 ref col_int_key col_int_key 4 func 2 Using where; Start temporary -2 DEPENDENT SUBQUERY parent2 index col_int_key col_int_key 4 NULL 1 Using where; Using index; Using join buffer (Block Nested Loop) -2 DEPENDENT SUBQUERY grandparent1 ref col_int_key col_int_key 4 func 2 Using where; End temporary +2 DEPENDENT SUBQUERY grandparent1 ref col_int_key col_int_key 4 func 2 Using where; Start temporary +2 DEPENDENT SUBQUERY parent1 ref col_int_key col_int_key 4 func 2 Using where +2 DEPENDENT SUBQUERY parent2 index col_int_key col_int_key 4 NULL 1 Using where; Using index; End temporary; Using join buffer (Block Nested Loop) explain format=json SELECT * FROM t3 WHERE g1 NOT IN (SELECT grandparent1.col_int_nokey AS g1 @@ -8070,7 +8070,7 @@ EXPLAIN "nested_loop": [ { "table": { - "table_name": "parent1", + "table_name": "grandparent1", "access_type": "ref", "possible_keys": [ "col_int_key" @@ -8085,13 +8085,13 @@ EXPLAIN ], "rows": 2, "filtered": 100, - "attached_condition": "(`test`.`parent1`.`col_int_key` <> 3)" + "attached_condition": "((`test`.`grandparent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`) and (`test`.`grandparent1`.`col_int_key` <> 3) and (('8') = `test`.`grandparent1`.`col_int_nokey`))" } }, { "table": { - "table_name": "parent2", - "access_type": "index", + "table_name": "parent1", + "access_type": "ref", "possible_keys": [ "col_int_key" ], @@ -8100,17 +8100,18 @@ EXPLAIN "col_int_key" ], "key_length": "4", - "rows": 1, + "ref": [ + "func" + ], + "rows": 2, "filtered": 100, - "using_index": true, - "using_join_buffer": "Block Nested Loop", - "attached_condition": "(is_not_null_compl(parent2), (`test`.`parent1`.`col_int_nokey` = `test`.`parent2`.`col_int_key`), true)" + "attached_condition": "(`test`.`parent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`)" } }, { "table": { - "table_name": "grandparent1", - "access_type": "ref", + "table_name": "parent2", + "access_type": "index", "possible_keys": [ "col_int_key" ], @@ -8119,12 +8120,11 @@ EXPLAIN "col_int_key" ], "key_length": "4", - "ref": [ - "func" - ], - "rows": 2, + "rows": 1, "filtered": 100, - "attached_condition": "((`test`.`grandparent1`.`col_int_nokey` = `test`.`parent1`.`col_int_key`) and (`test`.`grandparent1`.`col_int_key` = `test`.`parent1`.`col_int_key`))" + "using_index": true, + "using_join_buffer": "Block Nested Loop", + "attached_condition": "(is_not_null_compl(parent2), (`test`.`parent1`.`col_int_nokey` = `test`.`parent2`.`col_int_key`), true)" } } ] @@ -8136,7 +8136,7 @@ EXPLAIN } } Warnings: -Note 1003 /* select#1 */ select '8' AS `g1` from dual where (not(('8',(/* select#2 */ select 1 from `test`.`t1` `grandparent1` semi join (`test`.`t1` `parent1` left join `test`.`t2` `parent2` on((`test`.`parent1`.`col_int_nokey` = `test`.`parent2`.`col_int_key`))) where ((`test`.`grandparent1`.`col_int_nokey` = `test`.`parent1`.`col_int_key`) and (`test`.`grandparent1`.`col_int_key` = `test`.`parent1`.`col_int_key`) and (`test`.`parent1`.`col_int_key` <> 3) and (('8') = `test`.`parent1`.`col_int_key`)))))) +Note 1003 /* select#1 */ select '8' AS `g1` from dual where (not(('8',(/* select#2 */ select 1 from `test`.`t1` `grandparent1` semi join (`test`.`t1` `parent1` left join `test`.`t2` `parent2` on((`test`.`parent1`.`col_int_nokey` = `test`.`parent2`.`col_int_key`))) where ((`test`.`grandparent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`) and (`test`.`parent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`) and (`test`.`grandparent1`.`col_int_key` <> 3) and (('8') = `test`.`grandparent1`.`col_int_nokey`)))))) SELECT * FROM t3 WHERE g1 NOT IN (SELECT grandparent1.col_int_nokey AS g1 @@ -10470,6 +10470,95 @@ p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); ID 126 DROP TABLE t1,t2; +# +# Bug#18194196: OPTIMIZER EXECUTES STATEMENT INPERFORMANT +# +CREATE TABLE t1 (uid INTEGER, fid INTEGER, INDEX(uid)); +INSERT INTO t1 VALUES +(1,1), (1,2), (1,3), (1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t2 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t2 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +CREATE TABLE t3 (uid INT, fid INT, INDEX(uid)); +INSERT INTO t3 VALUES +(1,1), (1,2), (1,3),(1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t4 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t4 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +ANALYZE TABLE t1,t2,t3,t4; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +test.t3 analyze status OK +test.t4 analyze status OK +EXPLAIN SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index +1 SIMPLE t1 ALL uid NULL NULL NULL 11 Using where; End temporary; Using join buffer (Block Nested Loop) +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 NULL +FLUSH STATUS; +SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +name +A +B +C +D +E +F +G +H +A +B +I +SHOW STATUS LIKE '%handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 16 +Handler_read_last 0 +Handler_read_next 4 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 12 +DROP TABLE t1,t2,t3,t4; +# End of test for Bug#18194196 +# +# Bug#21184091 ASSERT `READ_ROWS >= 0.0' AT +# COST_MODEL_SERVER::TMPTABLE_READWRITE_COST() +# +CREATE TABLE t1 ( +col_int int(11), +pk int(11) NOT NULL, +col_int_key int(11) , +col_varchar varchar(1), +PRIMARY KEY (pk) +) ENGINE=MyISAM; +CREATE TABLE t2 ( +col_int int(11), +col_varchar varchar(1) +) ENGINE=MyISAM; +INSERT INTO t2 VALUES (19,'x'); +INSERT INTO t2 VALUES (20,'z'); +SELECT table1.col_varchar +FROM (t2 AS table1 RIGHT JOIN +((t2 STRAIGHT_JOIN t1 ON (t1.col_varchar = t2.col_varchar))) +ON (t1.pk = t2.col_int)) +WHERE (t1.pk IN (SELECT t1.col_int_key +FROM (t1 INNER JOIN t2 ON (t2.col_int = t1.col_int)))) +AND table1.col_varchar != 'q'; +col_varchar +DROP TABLE t1,t2; +# End of test for Bug#21184091 set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch.result index 190cae50..6f96deba 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch.result @@ -6810,8 +6810,8 @@ and t2.uid=t1.fid; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary 1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index -1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 End temporary -1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 9 Using where; Using join buffer (Block Nested Loop) +1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 Using where +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 End temporary select name from t2, t1 where t1.uid in (select t4.uid from t4, t3 where t3.uid=1 and t4.uid=t3.fid) and t2.uid=t1.fid; @@ -8034,9 +8034,9 @@ AND grandparent1.col_int_key <> 3 ); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 DEPENDENT SUBQUERY parent1 ref col_int_key col_int_key 4 func 2 Using where; Start temporary -2 DEPENDENT SUBQUERY parent2 index col_int_key col_int_key 4 NULL 1 Using where; Using index; Using join buffer (Block Nested Loop) -2 DEPENDENT SUBQUERY grandparent1 ref col_int_key col_int_key 4 func 2 Using where; End temporary +2 DEPENDENT SUBQUERY grandparent1 ref col_int_key col_int_key 4 func 2 Using where +2 DEPENDENT SUBQUERY parent1 ref col_int_key col_int_key 4 func 2 Using where +2 DEPENDENT SUBQUERY parent2 ref col_int_key col_int_key 4 test.parent1.col_int_nokey 2 Using index; FirstMatch(grandparent1) explain format=json SELECT * FROM t3 WHERE g1 NOT IN (SELECT grandparent1.col_int_nokey AS g1 @@ -8062,70 +8062,69 @@ EXPLAIN "cacheable": false, "query_block": { "select_id": 2, - "duplicates_removal": { - "using_temporary_table": true, - "nested_loop": [ - { - "table": { - "table_name": "parent1", - "access_type": "ref", - "possible_keys": [ - "col_int_key" - ], - "key": "col_int_key", - "used_key_parts": [ - "col_int_key" - ], - "key_length": "4", - "ref": [ - "func" - ], - "rows": 2, - "filtered": 100, - "attached_condition": "(`test`.`parent1`.`col_int_key` <> 3)" - } - }, - { - "table": { - "table_name": "parent2", - "access_type": "index", - "possible_keys": [ - "col_int_key" - ], - "key": "col_int_key", - "used_key_parts": [ - "col_int_key" - ], - "key_length": "4", - "rows": 1, - "filtered": 100, - "using_index": true, - "using_join_buffer": "Block Nested Loop", - "attached_condition": "(is_not_null_compl(parent2), (`test`.`parent1`.`col_int_nokey` = `test`.`parent2`.`col_int_key`), true)" - } - }, - { - "table": { - "table_name": "grandparent1", - "access_type": "ref", - "possible_keys": [ - "col_int_key" - ], - "key": "col_int_key", - "used_key_parts": [ - "col_int_key" - ], - "key_length": "4", - "ref": [ - "func" - ], - "rows": 2, - "filtered": 100, - "attached_condition": "((`test`.`grandparent1`.`col_int_nokey` = `test`.`parent1`.`col_int_key`) and (`test`.`grandparent1`.`col_int_key` = `test`.`parent1`.`col_int_key`))" - } + "nested_loop": [ + { + "table": { + "table_name": "grandparent1", + "access_type": "ref", + "possible_keys": [ + "col_int_key" + ], + "key": "col_int_key", + "used_key_parts": [ + "col_int_key" + ], + "key_length": "4", + "ref": [ + "func" + ], + "rows": 2, + "filtered": 100, + "attached_condition": "((`test`.`grandparent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`) and (`test`.`grandparent1`.`col_int_key` <> 3) and (('8') = `test`.`grandparent1`.`col_int_nokey`))" } - ] - } + }, + { + "table": { + "table_name": "parent1", + "access_type": "ref", + "possible_keys": [ + "col_int_key" + ], + "key": "col_int_key", + "used_key_parts": [ + "col_int_key" + ], + "key_length": "4", + "ref": [ + "func" + ], + "rows": 2, + "filtered": 100, + "attached_condition": "(`test`.`parent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`)" + } + }, + { + "table": { + "table_name": "parent2", + "access_type": "ref", + "possible_keys": [ + "col_int_key" + ], + "key": "col_int_key", + "used_key_parts": [ + "col_int_key" + ], + "key_length": "4", + "ref": [ + "test.parent1.col_int_nokey" + ], + "rows": 2, + "filtered": 100, + "using_index": true, + "first_match": "grandparent1" + } + } + ] } } ] @@ -8133,7 +8132,7 @@ EXPLAIN } } Warnings: -Note 1003 /* select#1 */ select '8' AS `g1` from dual where (not(('8',(/* select#2 */ select 1 from `test`.`t1` `grandparent1` semi join (`test`.`t1` `parent1` left join `test`.`t2` `parent2` on((`test`.`parent1`.`col_int_nokey` = `test`.`parent2`.`col_int_key`))) where ((`test`.`grandparent1`.`col_int_nokey` = `test`.`parent1`.`col_int_key`) and (`test`.`grandparent1`.`col_int_key` = `test`.`parent1`.`col_int_key`) and (`test`.`parent1`.`col_int_key` <> 3) and (('8') = `test`.`parent1`.`col_int_key`)))))) +Note 1003 /* select#1 */ select '8' AS `g1` from dual where (not(('8',(/* select#2 */ select 1 from `test`.`t1` `grandparent1` semi join (`test`.`t1` `parent1` left join `test`.`t2` `parent2` on((`test`.`parent1`.`col_int_nokey` = `test`.`parent2`.`col_int_key`))) where ((`test`.`grandparent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`) and (`test`.`parent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`) and (`test`.`grandparent1`.`col_int_key` <> 3) and (('8') = `test`.`grandparent1`.`col_int_nokey`)))))) SELECT * FROM t3 WHERE g1 NOT IN (SELECT grandparent1.col_int_nokey AS g1 @@ -9957,55 +9956,39 @@ EXPLAIN "select_id": 1, "nested_loop": [ { - "duplicates_removal": { - "using_temporary_table": true, - "nested_loop": [ - { + "table": { + "table_name": "derived1", + "access_type": "ALL", + "rows": 7, + "filtered": 100, + "materialized_from_subquery": { + "using_temporary_table": true, + "dependent": false, + "cacheable": true, + "query_block": { + "select_id": 2, "table": { - "table_name": "derived2", + "table_name": "t2", "access_type": "ALL", - "possible_keys": [ - "col_varchar_key" - ], "rows": 7, - "filtered": 100, - "attached_condition": "((`test`.`derived2`.`col_varchar_key` = `test`.`derived2`.`col_varchar_nokey`) and (`test`.`derived2`.`col_varchar_nokey` is not null))" - } - }, - { - "table": { - "table_name": "derived1", - "access_type": "ref", - "possible_keys": [ - "" - ], - "key": "", - "used_key_parts": [ - "col_varchar_nokey" - ], - "key_length": "4", - "ref": [ - "test.derived2.col_varchar_nokey" - ], - "rows": 2, - "filtered": 100, - "materialized_from_subquery": { - "using_temporary_table": true, - "dependent": false, - "cacheable": true, - "query_block": { - "select_id": 2, - "table": { - "table_name": "t2", - "access_type": "ALL", - "rows": 7, - "filtered": 100 - } - } - } + "filtered": 100 } } - ] + } + } + }, + { + "table": { + "table_name": "derived2", + "access_type": "ALL", + "possible_keys": [ + "col_varchar_key" + ], + "rows": 7, + "filtered": 85.714, + "first_match": "derived1", + "using_join_buffer": "Block Nested Loop", + "attached_condition": "((`test`.`derived2`.`col_varchar_nokey` = `derived1`.`col_varchar_nokey`) and (`test`.`derived2`.`col_varchar_key` = `derived1`.`col_varchar_nokey`))" } }, { @@ -10015,14 +9998,14 @@ EXPLAIN "rows": 20, "filtered": 100, "using_join_buffer": "Block Nested Loop", - "attached_condition": "(is_not_null_compl(t1), (`test`.`t1`.`col_varchar_nokey` = `test`.`derived2`.`col_varchar_nokey`), true)" + "attached_condition": "(is_not_null_compl(t1), (`test`.`t1`.`col_varchar_nokey` = `derived1`.`col_varchar_nokey`), true)" } } ] } } Warnings: -Note 1003 /* select#1 */ select `derived1`.`col_varchar_nokey` AS `col_varchar_nokey`,`derived1`.`col_varchar_key` AS `col_varchar_key` from (/* select#2 */ select `test`.`t2`.`col_varchar_key` AS `col_varchar_key`,`test`.`t2`.`col_varchar_nokey` AS `col_varchar_nokey` from `test`.`t2`) `derived1` semi join (`test`.`t2` `derived2`) left join `test`.`t1` on((`test`.`t1`.`col_varchar_nokey` = `test`.`derived2`.`col_varchar_nokey`)) where ((`test`.`derived2`.`col_varchar_key` = `test`.`derived2`.`col_varchar_nokey`) and (`derived1`.`col_varchar_nokey` = `test`.`derived2`.`col_varchar_nokey`)) +Note 1003 /* select#1 */ select `derived1`.`col_varchar_nokey` AS `col_varchar_nokey`,`derived1`.`col_varchar_key` AS `col_varchar_key` from (/* select#2 */ select `test`.`t2`.`col_varchar_key` AS `col_varchar_key`,`test`.`t2`.`col_varchar_nokey` AS `col_varchar_nokey` from `test`.`t2`) `derived1` semi join (`test`.`t2` `derived2`) left join `test`.`t1` on((`test`.`t1`.`col_varchar_nokey` = `derived1`.`col_varchar_nokey`)) where ((`test`.`derived2`.`col_varchar_nokey` = `derived1`.`col_varchar_nokey`) and (`test`.`derived2`.`col_varchar_key` = `derived1`.`col_varchar_nokey`)) SELECT * FROM (SELECT * FROM t2) AS derived1 LEFT JOIN t1 @@ -10447,6 +10430,95 @@ p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); ID 126 DROP TABLE t1,t2; +# +# Bug#18194196: OPTIMIZER EXECUTES STATEMENT INPERFORMANT +# +CREATE TABLE t1 (uid INTEGER, fid INTEGER, INDEX(uid)); +INSERT INTO t1 VALUES +(1,1), (1,2), (1,3), (1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t2 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t2 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +CREATE TABLE t3 (uid INT, fid INT, INDEX(uid)); +INSERT INTO t3 VALUES +(1,1), (1,2), (1,3),(1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t4 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t4 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +ANALYZE TABLE t1,t2,t3,t4; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +test.t3 analyze status OK +test.t4 analyze status OK +EXPLAIN SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index +1 SIMPLE t1 ALL uid NULL NULL NULL 11 Using where; End temporary; Using join buffer (Block Nested Loop) +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 NULL +FLUSH STATUS; +SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +name +A +B +C +D +E +F +G +H +A +B +I +SHOW STATUS LIKE '%handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 16 +Handler_read_last 0 +Handler_read_next 4 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 12 +DROP TABLE t1,t2,t3,t4; +# End of test for Bug#18194196 +# +# Bug#21184091 ASSERT `READ_ROWS >= 0.0' AT +# COST_MODEL_SERVER::TMPTABLE_READWRITE_COST() +# +CREATE TABLE t1 ( +col_int int(11), +pk int(11) NOT NULL, +col_int_key int(11) , +col_varchar varchar(1), +PRIMARY KEY (pk) +) ENGINE=MyISAM; +CREATE TABLE t2 ( +col_int int(11), +col_varchar varchar(1) +) ENGINE=MyISAM; +INSERT INTO t2 VALUES (19,'x'); +INSERT INTO t2 VALUES (20,'z'); +SELECT table1.col_varchar +FROM (t2 AS table1 RIGHT JOIN +((t2 STRAIGHT_JOIN t1 ON (t1.col_varchar = t2.col_varchar))) +ON (t1.pk = t2.col_int)) +WHERE (t1.pk IN (SELECT t1.col_int_key +FROM (t1 INNER JOIN t2 ON (t2.col_int = t1.col_int)))) +AND table1.col_varchar != 'q'; +col_varchar +DROP TABLE t1,t2; +# End of test for Bug#21184091 set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests # diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch_bka.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch_bka.result index 76682cd3..40521dba 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch_bka.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch_bka.result @@ -6811,8 +6811,8 @@ and t2.uid=t1.fid; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary 1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index -1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 End temporary -1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 9 Using where; Using join buffer (Block Nested Loop) +1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 Using where +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 End temporary select name from t2, t1 where t1.uid in (select t4.uid from t4, t3 where t3.uid=1 and t4.uid=t3.fid) and t2.uid=t1.fid; @@ -8035,9 +8035,9 @@ AND grandparent1.col_int_key <> 3 ); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 DEPENDENT SUBQUERY parent1 ref col_int_key col_int_key 4 func 2 Using where; Start temporary -2 DEPENDENT SUBQUERY parent2 index col_int_key col_int_key 4 NULL 1 Using where; Using index; Using join buffer (Block Nested Loop) -2 DEPENDENT SUBQUERY grandparent1 ref col_int_key col_int_key 4 func 2 Using where; End temporary +2 DEPENDENT SUBQUERY grandparent1 ref col_int_key col_int_key 4 func 2 Using where +2 DEPENDENT SUBQUERY parent1 ref col_int_key col_int_key 4 func 2 Using where +2 DEPENDENT SUBQUERY parent2 ref col_int_key col_int_key 4 test.parent1.col_int_nokey 2 Using index; FirstMatch(grandparent1) explain format=json SELECT * FROM t3 WHERE g1 NOT IN (SELECT grandparent1.col_int_nokey AS g1 @@ -8063,70 +8063,69 @@ EXPLAIN "cacheable": false, "query_block": { "select_id": 2, - "duplicates_removal": { - "using_temporary_table": true, - "nested_loop": [ - { - "table": { - "table_name": "parent1", - "access_type": "ref", - "possible_keys": [ - "col_int_key" - ], - "key": "col_int_key", - "used_key_parts": [ - "col_int_key" - ], - "key_length": "4", - "ref": [ - "func" - ], - "rows": 2, - "filtered": 100, - "attached_condition": "(`test`.`parent1`.`col_int_key` <> 3)" - } - }, - { - "table": { - "table_name": "parent2", - "access_type": "index", - "possible_keys": [ - "col_int_key" - ], - "key": "col_int_key", - "used_key_parts": [ - "col_int_key" - ], - "key_length": "4", - "rows": 1, - "filtered": 100, - "using_index": true, - "using_join_buffer": "Block Nested Loop", - "attached_condition": "(is_not_null_compl(parent2), (`test`.`parent1`.`col_int_nokey` = `test`.`parent2`.`col_int_key`), true)" - } - }, - { - "table": { - "table_name": "grandparent1", - "access_type": "ref", - "possible_keys": [ - "col_int_key" - ], - "key": "col_int_key", - "used_key_parts": [ - "col_int_key" - ], - "key_length": "4", - "ref": [ - "func" - ], - "rows": 2, - "filtered": 100, - "attached_condition": "((`test`.`grandparent1`.`col_int_nokey` = `test`.`parent1`.`col_int_key`) and (`test`.`grandparent1`.`col_int_key` = `test`.`parent1`.`col_int_key`))" - } + "nested_loop": [ + { + "table": { + "table_name": "grandparent1", + "access_type": "ref", + "possible_keys": [ + "col_int_key" + ], + "key": "col_int_key", + "used_key_parts": [ + "col_int_key" + ], + "key_length": "4", + "ref": [ + "func" + ], + "rows": 2, + "filtered": 100, + "attached_condition": "((`test`.`grandparent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`) and (`test`.`grandparent1`.`col_int_key` <> 3) and (('8') = `test`.`grandparent1`.`col_int_nokey`))" } - ] - } + }, + { + "table": { + "table_name": "parent1", + "access_type": "ref", + "possible_keys": [ + "col_int_key" + ], + "key": "col_int_key", + "used_key_parts": [ + "col_int_key" + ], + "key_length": "4", + "ref": [ + "func" + ], + "rows": 2, + "filtered": 100, + "attached_condition": "(`test`.`parent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`)" + } + }, + { + "table": { + "table_name": "parent2", + "access_type": "ref", + "possible_keys": [ + "col_int_key" + ], + "key": "col_int_key", + "used_key_parts": [ + "col_int_key" + ], + "key_length": "4", + "ref": [ + "test.parent1.col_int_nokey" + ], + "rows": 2, + "filtered": 100, + "using_index": true, + "first_match": "grandparent1" + } + } + ] } } ] @@ -8134,7 +8133,7 @@ EXPLAIN } } Warnings: -Note 1003 /* select#1 */ select '8' AS `g1` from dual where (not(('8',(/* select#2 */ select 1 from `test`.`t1` `grandparent1` semi join (`test`.`t1` `parent1` left join `test`.`t2` `parent2` on((`test`.`parent1`.`col_int_nokey` = `test`.`parent2`.`col_int_key`))) where ((`test`.`grandparent1`.`col_int_nokey` = `test`.`parent1`.`col_int_key`) and (`test`.`grandparent1`.`col_int_key` = `test`.`parent1`.`col_int_key`) and (`test`.`parent1`.`col_int_key` <> 3) and (('8') = `test`.`parent1`.`col_int_key`)))))) +Note 1003 /* select#1 */ select '8' AS `g1` from dual where (not(('8',(/* select#2 */ select 1 from `test`.`t1` `grandparent1` semi join (`test`.`t1` `parent1` left join `test`.`t2` `parent2` on((`test`.`parent1`.`col_int_nokey` = `test`.`parent2`.`col_int_key`))) where ((`test`.`grandparent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`) and (`test`.`parent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`) and (`test`.`grandparent1`.`col_int_key` <> 3) and (('8') = `test`.`grandparent1`.`col_int_nokey`)))))) SELECT * FROM t3 WHERE g1 NOT IN (SELECT grandparent1.col_int_nokey AS g1 @@ -9958,55 +9957,39 @@ EXPLAIN "select_id": 1, "nested_loop": [ { - "duplicates_removal": { - "using_temporary_table": true, - "nested_loop": [ - { + "table": { + "table_name": "derived1", + "access_type": "ALL", + "rows": 7, + "filtered": 100, + "materialized_from_subquery": { + "using_temporary_table": true, + "dependent": false, + "cacheable": true, + "query_block": { + "select_id": 2, "table": { - "table_name": "derived2", + "table_name": "t2", "access_type": "ALL", - "possible_keys": [ - "col_varchar_key" - ], "rows": 7, - "filtered": 100, - "attached_condition": "((`test`.`derived2`.`col_varchar_key` = `test`.`derived2`.`col_varchar_nokey`) and (`test`.`derived2`.`col_varchar_nokey` is not null))" - } - }, - { - "table": { - "table_name": "derived1", - "access_type": "ref", - "possible_keys": [ - "" - ], - "key": "", - "used_key_parts": [ - "col_varchar_nokey" - ], - "key_length": "4", - "ref": [ - "test.derived2.col_varchar_nokey" - ], - "rows": 2, - "filtered": 100, - "materialized_from_subquery": { - "using_temporary_table": true, - "dependent": false, - "cacheable": true, - "query_block": { - "select_id": 2, - "table": { - "table_name": "t2", - "access_type": "ALL", - "rows": 7, - "filtered": 100 - } - } - } + "filtered": 100 } } - ] + } + } + }, + { + "table": { + "table_name": "derived2", + "access_type": "ALL", + "possible_keys": [ + "col_varchar_key" + ], + "rows": 7, + "filtered": 85.714, + "first_match": "derived1", + "using_join_buffer": "Block Nested Loop", + "attached_condition": "((`test`.`derived2`.`col_varchar_nokey` = `derived1`.`col_varchar_nokey`) and (`test`.`derived2`.`col_varchar_key` = `derived1`.`col_varchar_nokey`))" } }, { @@ -10016,14 +9999,14 @@ EXPLAIN "rows": 20, "filtered": 100, "using_join_buffer": "Block Nested Loop", - "attached_condition": "(is_not_null_compl(t1), (`test`.`t1`.`col_varchar_nokey` = `test`.`derived2`.`col_varchar_nokey`), true)" + "attached_condition": "(is_not_null_compl(t1), (`test`.`t1`.`col_varchar_nokey` = `derived1`.`col_varchar_nokey`), true)" } } ] } } Warnings: -Note 1003 /* select#1 */ select `derived1`.`col_varchar_nokey` AS `col_varchar_nokey`,`derived1`.`col_varchar_key` AS `col_varchar_key` from (/* select#2 */ select `test`.`t2`.`col_varchar_key` AS `col_varchar_key`,`test`.`t2`.`col_varchar_nokey` AS `col_varchar_nokey` from `test`.`t2`) `derived1` semi join (`test`.`t2` `derived2`) left join `test`.`t1` on((`test`.`t1`.`col_varchar_nokey` = `test`.`derived2`.`col_varchar_nokey`)) where ((`test`.`derived2`.`col_varchar_key` = `test`.`derived2`.`col_varchar_nokey`) and (`derived1`.`col_varchar_nokey` = `test`.`derived2`.`col_varchar_nokey`)) +Note 1003 /* select#1 */ select `derived1`.`col_varchar_nokey` AS `col_varchar_nokey`,`derived1`.`col_varchar_key` AS `col_varchar_key` from (/* select#2 */ select `test`.`t2`.`col_varchar_key` AS `col_varchar_key`,`test`.`t2`.`col_varchar_nokey` AS `col_varchar_nokey` from `test`.`t2`) `derived1` semi join (`test`.`t2` `derived2`) left join `test`.`t1` on((`test`.`t1`.`col_varchar_nokey` = `derived1`.`col_varchar_nokey`)) where ((`test`.`derived2`.`col_varchar_nokey` = `derived1`.`col_varchar_nokey`) and (`test`.`derived2`.`col_varchar_key` = `derived1`.`col_varchar_nokey`)) SELECT * FROM (SELECT * FROM t2) AS derived1 LEFT JOIN t1 @@ -10448,6 +10431,95 @@ p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); ID 126 DROP TABLE t1,t2; +# +# Bug#18194196: OPTIMIZER EXECUTES STATEMENT INPERFORMANT +# +CREATE TABLE t1 (uid INTEGER, fid INTEGER, INDEX(uid)); +INSERT INTO t1 VALUES +(1,1), (1,2), (1,3), (1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t2 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t2 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +CREATE TABLE t3 (uid INT, fid INT, INDEX(uid)); +INSERT INTO t3 VALUES +(1,1), (1,2), (1,3),(1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t4 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t4 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +ANALYZE TABLE t1,t2,t3,t4; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +test.t3 analyze status OK +test.t4 analyze status OK +EXPLAIN SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index +1 SIMPLE t1 ALL uid NULL NULL NULL 11 Using where; End temporary; Using join buffer (Block Nested Loop) +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 NULL +FLUSH STATUS; +SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +name +A +B +C +D +E +F +G +H +A +B +I +SHOW STATUS LIKE '%handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 16 +Handler_read_last 0 +Handler_read_next 4 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 12 +DROP TABLE t1,t2,t3,t4; +# End of test for Bug#18194196 +# +# Bug#21184091 ASSERT `READ_ROWS >= 0.0' AT +# COST_MODEL_SERVER::TMPTABLE_READWRITE_COST() +# +CREATE TABLE t1 ( +col_int int(11), +pk int(11) NOT NULL, +col_int_key int(11) , +col_varchar varchar(1), +PRIMARY KEY (pk) +) ENGINE=MyISAM; +CREATE TABLE t2 ( +col_int int(11), +col_varchar varchar(1) +) ENGINE=MyISAM; +INSERT INTO t2 VALUES (19,'x'); +INSERT INTO t2 VALUES (20,'z'); +SELECT table1.col_varchar +FROM (t2 AS table1 RIGHT JOIN +((t2 STRAIGHT_JOIN t1 ON (t1.col_varchar = t2.col_varchar))) +ON (t1.pk = t2.col_int)) +WHERE (t1.pk IN (SELECT t1.col_int_key +FROM (t1 INNER JOIN t2 ON (t2.col_int = t1.col_int)))) +AND table1.col_varchar != 'q'; +col_varchar +DROP TABLE t1,t2; +# End of test for Bug#21184091 set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests # diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch_bka_nixbnl.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch_bka_nixbnl.result index c0ac2b51..8d6f9322 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch_bka_nixbnl.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch_bka_nixbnl.result @@ -6823,8 +6823,8 @@ and t2.uid=t1.fid; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary 1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index -1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 End temporary -1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 9 Using where +1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 Using where +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 End temporary select name from t2, t1 where t1.uid in (select t4.uid from t4, t3 where t3.uid=1 and t4.uid=t3.fid) and t2.uid=t1.fid; @@ -10454,6 +10454,95 @@ p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); ID 126 DROP TABLE t1,t2; +# +# Bug#18194196: OPTIMIZER EXECUTES STATEMENT INPERFORMANT +# +CREATE TABLE t1 (uid INTEGER, fid INTEGER, INDEX(uid)); +INSERT INTO t1 VALUES +(1,1), (1,2), (1,3), (1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t2 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t2 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +CREATE TABLE t3 (uid INT, fid INT, INDEX(uid)); +INSERT INTO t3 VALUES +(1,1), (1,2), (1,3),(1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t4 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t4 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +ANALYZE TABLE t1,t2,t3,t4; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +test.t3 analyze status OK +test.t4 analyze status OK +EXPLAIN SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index +1 SIMPLE t1 ref uid uid 5 test.t3.fid 4 Using where; End temporary +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 NULL +FLUSH STATUS; +SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +name +A +B +C +D +E +F +G +H +A +B +I +SHOW STATUS LIKE '%handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 20 +Handler_read_last 0 +Handler_read_next 15 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 0 +DROP TABLE t1,t2,t3,t4; +# End of test for Bug#18194196 +# +# Bug#21184091 ASSERT `READ_ROWS >= 0.0' AT +# COST_MODEL_SERVER::TMPTABLE_READWRITE_COST() +# +CREATE TABLE t1 ( +col_int int(11), +pk int(11) NOT NULL, +col_int_key int(11) , +col_varchar varchar(1), +PRIMARY KEY (pk) +) ENGINE=MyISAM; +CREATE TABLE t2 ( +col_int int(11), +col_varchar varchar(1) +) ENGINE=MyISAM; +INSERT INTO t2 VALUES (19,'x'); +INSERT INTO t2 VALUES (20,'z'); +SELECT table1.col_varchar +FROM (t2 AS table1 RIGHT JOIN +((t2 STRAIGHT_JOIN t1 ON (t1.col_varchar = t2.col_varchar))) +ON (t1.pk = t2.col_int)) +WHERE (t1.pk IN (SELECT t1.col_int_key +FROM (t1 INNER JOIN t2 ON (t2.col_int = t1.col_int)))) +AND table1.col_varchar != 'q'; +col_varchar +DROP TABLE t1,t2; +# End of test for Bug#21184091 set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests # diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch_bkaunique.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch_bkaunique.result index 0f5d9ac2..28d2780a 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch_bkaunique.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_firstmatch_bkaunique.result @@ -6812,8 +6812,8 @@ and t2.uid=t1.fid; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary 1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index -1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 End temporary -1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 9 Using where; Using join buffer (Block Nested Loop) +1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 Using where +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 End temporary select name from t2, t1 where t1.uid in (select t4.uid from t4, t3 where t3.uid=1 and t4.uid=t3.fid) and t2.uid=t1.fid; @@ -8036,9 +8036,9 @@ AND grandparent1.col_int_key <> 3 ); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 DEPENDENT SUBQUERY parent1 ref col_int_key col_int_key 4 func 2 Using where; Start temporary -2 DEPENDENT SUBQUERY parent2 index col_int_key col_int_key 4 NULL 1 Using where; Using index; Using join buffer (Block Nested Loop) -2 DEPENDENT SUBQUERY grandparent1 ref col_int_key col_int_key 4 func 2 Using where; End temporary +2 DEPENDENT SUBQUERY grandparent1 ref col_int_key col_int_key 4 func 2 Using where +2 DEPENDENT SUBQUERY parent1 ref col_int_key col_int_key 4 func 2 Using where +2 DEPENDENT SUBQUERY parent2 ref col_int_key col_int_key 4 test.parent1.col_int_nokey 2 Using index; FirstMatch(grandparent1) explain format=json SELECT * FROM t3 WHERE g1 NOT IN (SELECT grandparent1.col_int_nokey AS g1 @@ -8064,70 +8064,69 @@ EXPLAIN "cacheable": false, "query_block": { "select_id": 2, - "duplicates_removal": { - "using_temporary_table": true, - "nested_loop": [ - { - "table": { - "table_name": "parent1", - "access_type": "ref", - "possible_keys": [ - "col_int_key" - ], - "key": "col_int_key", - "used_key_parts": [ - "col_int_key" - ], - "key_length": "4", - "ref": [ - "func" - ], - "rows": 2, - "filtered": 100, - "attached_condition": "(`test`.`parent1`.`col_int_key` <> 3)" - } - }, - { - "table": { - "table_name": "parent2", - "access_type": "index", - "possible_keys": [ - "col_int_key" - ], - "key": "col_int_key", - "used_key_parts": [ - "col_int_key" - ], - "key_length": "4", - "rows": 1, - "filtered": 100, - "using_index": true, - "using_join_buffer": "Block Nested Loop", - "attached_condition": "(is_not_null_compl(parent2), (`test`.`parent1`.`col_int_nokey` = `test`.`parent2`.`col_int_key`), true)" - } - }, - { - "table": { - "table_name": "grandparent1", - "access_type": "ref", - "possible_keys": [ - "col_int_key" - ], - "key": "col_int_key", - "used_key_parts": [ - "col_int_key" - ], - "key_length": "4", - "ref": [ - "func" - ], - "rows": 2, - "filtered": 100, - "attached_condition": "((`test`.`grandparent1`.`col_int_nokey` = `test`.`parent1`.`col_int_key`) and (`test`.`grandparent1`.`col_int_key` = `test`.`parent1`.`col_int_key`))" - } + "nested_loop": [ + { + "table": { + "table_name": "grandparent1", + "access_type": "ref", + "possible_keys": [ + "col_int_key" + ], + "key": "col_int_key", + "used_key_parts": [ + "col_int_key" + ], + "key_length": "4", + "ref": [ + "func" + ], + "rows": 2, + "filtered": 100, + "attached_condition": "((`test`.`grandparent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`) and (`test`.`grandparent1`.`col_int_key` <> 3) and (('8') = `test`.`grandparent1`.`col_int_nokey`))" } - ] - } + }, + { + "table": { + "table_name": "parent1", + "access_type": "ref", + "possible_keys": [ + "col_int_key" + ], + "key": "col_int_key", + "used_key_parts": [ + "col_int_key" + ], + "key_length": "4", + "ref": [ + "func" + ], + "rows": 2, + "filtered": 100, + "attached_condition": "(`test`.`parent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`)" + } + }, + { + "table": { + "table_name": "parent2", + "access_type": "ref", + "possible_keys": [ + "col_int_key" + ], + "key": "col_int_key", + "used_key_parts": [ + "col_int_key" + ], + "key_length": "4", + "ref": [ + "test.parent1.col_int_nokey" + ], + "rows": 2, + "filtered": 100, + "using_index": true, + "first_match": "grandparent1" + } + } + ] } } ] @@ -8135,7 +8134,7 @@ EXPLAIN } } Warnings: -Note 1003 /* select#1 */ select '8' AS `g1` from dual where (not(('8',(/* select#2 */ select 1 from `test`.`t1` `grandparent1` semi join (`test`.`t1` `parent1` left join `test`.`t2` `parent2` on((`test`.`parent1`.`col_int_nokey` = `test`.`parent2`.`col_int_key`))) where ((`test`.`grandparent1`.`col_int_nokey` = `test`.`parent1`.`col_int_key`) and (`test`.`grandparent1`.`col_int_key` = `test`.`parent1`.`col_int_key`) and (`test`.`parent1`.`col_int_key` <> 3) and (('8') = `test`.`parent1`.`col_int_key`)))))) +Note 1003 /* select#1 */ select '8' AS `g1` from dual where (not(('8',(/* select#2 */ select 1 from `test`.`t1` `grandparent1` semi join (`test`.`t1` `parent1` left join `test`.`t2` `parent2` on((`test`.`parent1`.`col_int_nokey` = `test`.`parent2`.`col_int_key`))) where ((`test`.`grandparent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`) and (`test`.`parent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`) and (`test`.`grandparent1`.`col_int_key` <> 3) and (('8') = `test`.`grandparent1`.`col_int_nokey`)))))) SELECT * FROM t3 WHERE g1 NOT IN (SELECT grandparent1.col_int_nokey AS g1 @@ -9959,55 +9958,39 @@ EXPLAIN "select_id": 1, "nested_loop": [ { - "duplicates_removal": { - "using_temporary_table": true, - "nested_loop": [ - { + "table": { + "table_name": "derived1", + "access_type": "ALL", + "rows": 7, + "filtered": 100, + "materialized_from_subquery": { + "using_temporary_table": true, + "dependent": false, + "cacheable": true, + "query_block": { + "select_id": 2, "table": { - "table_name": "derived2", + "table_name": "t2", "access_type": "ALL", - "possible_keys": [ - "col_varchar_key" - ], "rows": 7, - "filtered": 100, - "attached_condition": "((`test`.`derived2`.`col_varchar_key` = `test`.`derived2`.`col_varchar_nokey`) and (`test`.`derived2`.`col_varchar_nokey` is not null))" - } - }, - { - "table": { - "table_name": "derived1", - "access_type": "ref", - "possible_keys": [ - "" - ], - "key": "", - "used_key_parts": [ - "col_varchar_nokey" - ], - "key_length": "4", - "ref": [ - "test.derived2.col_varchar_nokey" - ], - "rows": 2, - "filtered": 100, - "materialized_from_subquery": { - "using_temporary_table": true, - "dependent": false, - "cacheable": true, - "query_block": { - "select_id": 2, - "table": { - "table_name": "t2", - "access_type": "ALL", - "rows": 7, - "filtered": 100 - } - } - } + "filtered": 100 } } - ] + } + } + }, + { + "table": { + "table_name": "derived2", + "access_type": "ALL", + "possible_keys": [ + "col_varchar_key" + ], + "rows": 7, + "filtered": 85.714, + "first_match": "derived1", + "using_join_buffer": "Block Nested Loop", + "attached_condition": "((`test`.`derived2`.`col_varchar_nokey` = `derived1`.`col_varchar_nokey`) and (`test`.`derived2`.`col_varchar_key` = `derived1`.`col_varchar_nokey`))" } }, { @@ -10017,14 +10000,14 @@ EXPLAIN "rows": 20, "filtered": 100, "using_join_buffer": "Block Nested Loop", - "attached_condition": "(is_not_null_compl(t1), (`test`.`t1`.`col_varchar_nokey` = `test`.`derived2`.`col_varchar_nokey`), true)" + "attached_condition": "(is_not_null_compl(t1), (`test`.`t1`.`col_varchar_nokey` = `derived1`.`col_varchar_nokey`), true)" } } ] } } Warnings: -Note 1003 /* select#1 */ select `derived1`.`col_varchar_nokey` AS `col_varchar_nokey`,`derived1`.`col_varchar_key` AS `col_varchar_key` from (/* select#2 */ select `test`.`t2`.`col_varchar_key` AS `col_varchar_key`,`test`.`t2`.`col_varchar_nokey` AS `col_varchar_nokey` from `test`.`t2`) `derived1` semi join (`test`.`t2` `derived2`) left join `test`.`t1` on((`test`.`t1`.`col_varchar_nokey` = `test`.`derived2`.`col_varchar_nokey`)) where ((`test`.`derived2`.`col_varchar_key` = `test`.`derived2`.`col_varchar_nokey`) and (`derived1`.`col_varchar_nokey` = `test`.`derived2`.`col_varchar_nokey`)) +Note 1003 /* select#1 */ select `derived1`.`col_varchar_nokey` AS `col_varchar_nokey`,`derived1`.`col_varchar_key` AS `col_varchar_key` from (/* select#2 */ select `test`.`t2`.`col_varchar_key` AS `col_varchar_key`,`test`.`t2`.`col_varchar_nokey` AS `col_varchar_nokey` from `test`.`t2`) `derived1` semi join (`test`.`t2` `derived2`) left join `test`.`t1` on((`test`.`t1`.`col_varchar_nokey` = `derived1`.`col_varchar_nokey`)) where ((`test`.`derived2`.`col_varchar_nokey` = `derived1`.`col_varchar_nokey`) and (`test`.`derived2`.`col_varchar_key` = `derived1`.`col_varchar_nokey`)) SELECT * FROM (SELECT * FROM t2) AS derived1 LEFT JOIN t1 @@ -10449,6 +10432,95 @@ p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); ID 126 DROP TABLE t1,t2; +# +# Bug#18194196: OPTIMIZER EXECUTES STATEMENT INPERFORMANT +# +CREATE TABLE t1 (uid INTEGER, fid INTEGER, INDEX(uid)); +INSERT INTO t1 VALUES +(1,1), (1,2), (1,3), (1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t2 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t2 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +CREATE TABLE t3 (uid INT, fid INT, INDEX(uid)); +INSERT INTO t3 VALUES +(1,1), (1,2), (1,3),(1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t4 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t4 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +ANALYZE TABLE t1,t2,t3,t4; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +test.t3 analyze status OK +test.t4 analyze status OK +EXPLAIN SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index +1 SIMPLE t1 ALL uid NULL NULL NULL 11 Using where; End temporary; Using join buffer (Block Nested Loop) +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 NULL +FLUSH STATUS; +SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +name +A +B +C +D +E +F +G +H +A +B +I +SHOW STATUS LIKE '%handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 16 +Handler_read_last 0 +Handler_read_next 4 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 12 +DROP TABLE t1,t2,t3,t4; +# End of test for Bug#18194196 +# +# Bug#21184091 ASSERT `READ_ROWS >= 0.0' AT +# COST_MODEL_SERVER::TMPTABLE_READWRITE_COST() +# +CREATE TABLE t1 ( +col_int int(11), +pk int(11) NOT NULL, +col_int_key int(11) , +col_varchar varchar(1), +PRIMARY KEY (pk) +) ENGINE=MyISAM; +CREATE TABLE t2 ( +col_int int(11), +col_varchar varchar(1) +) ENGINE=MyISAM; +INSERT INTO t2 VALUES (19,'x'); +INSERT INTO t2 VALUES (20,'z'); +SELECT table1.col_varchar +FROM (t2 AS table1 RIGHT JOIN +((t2 STRAIGHT_JOIN t1 ON (t1.col_varchar = t2.col_varchar))) +ON (t1.pk = t2.col_int)) +WHERE (t1.pk IN (SELECT t1.col_int_key +FROM (t1 INNER JOIN t2 ON (t2.col_int = t1.col_int)))) +AND table1.col_varchar != 'q'; +col_varchar +DROP TABLE t1,t2; +# End of test for Bug#21184091 set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests # diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_innodb_all.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_innodb_all.result index 91bc76e6..85ade1fe 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_innodb_all.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_innodb_all.result @@ -31,8 +31,9 @@ a b 9 5 explain select * from t2 where b in (select a from t1); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where; Start temporary -1 SIMPLE t2 ref b b 5 test.t1.a 1 End temporary +1 SIMPLE ALL NULL NULL NULL NULL NULL Using where +1 SIMPLE t2 ref b b 5 .a 1 NULL +2 MATERIALIZED t1 ALL NULL NULL NULL NULL 3 NULL select * from t2 where b in (select a from t1); a b 1 1 @@ -49,8 +50,9 @@ primary key(pk1, pk2, pk3) insert into t3 select a,a, a,a,a from t0; explain select * from t3 where b in (select a from t1); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where; Start temporary -1 SIMPLE t3 ref b b 5 test.t1.a 1 End temporary +1 SIMPLE ALL NULL NULL NULL NULL NULL Using where +1 SIMPLE t3 ref b b 5 .a 1 NULL +2 MATERIALIZED t1 ALL NULL NULL NULL NULL 3 NULL select * from t3 where b in (select a from t1); a b pk1 pk2 pk3 1 1 1 1 1 @@ -72,8 +74,9 @@ A.a + 10*B.a, A.a + 10*B.a, A.a + 10*B.a, A.a + 10*B.a from t0 A, t0 B where B.a <5; explain select * from t3 where b in (select a from t0); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t0 ALL NULL NULL NULL NULL # Using where; Start temporary -1 SIMPLE t3 ref b b 5 test.t0.a # End temporary +1 SIMPLE ALL NULL NULL NULL NULL # Using where +1 SIMPLE t3 ref b b 5 .a # NULL +2 MATERIALIZED t0 ALL NULL NULL NULL NULL # NULL select * from t3 where b in (select A.a+B.a from t0 A, t0 B where B.a<5); a b pk1 pk2 0 0 0 0 diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_innodb_all_bka.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_innodb_all_bka.result index 86688f77..b269d1d4 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_innodb_all_bka.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_innodb_all_bka.result @@ -32,8 +32,9 @@ a b 9 5 explain select * from t2 where b in (select a from t1); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where; Start temporary -1 SIMPLE t2 ref b b 5 test.t1.a 1 End temporary; Using join buffer (Batched Key Access) +1 SIMPLE ALL NULL NULL NULL NULL NULL Using where +1 SIMPLE t2 ref b b 5 .a 1 Using join buffer (Batched Key Access) +2 MATERIALIZED t1 ALL NULL NULL NULL NULL 3 NULL select * from t2 where b in (select a from t1); a b 1 1 @@ -50,8 +51,9 @@ primary key(pk1, pk2, pk3) insert into t3 select a,a, a,a,a from t0; explain select * from t3 where b in (select a from t1); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where; Start temporary -1 SIMPLE t3 ref b b 5 test.t1.a 1 End temporary; Using join buffer (Batched Key Access) +1 SIMPLE ALL NULL NULL NULL NULL NULL Using where +1 SIMPLE t3 ref b b 5 .a 1 Using join buffer (Batched Key Access) +2 MATERIALIZED t1 ALL NULL NULL NULL NULL 3 NULL select * from t3 where b in (select a from t1); a b pk1 pk2 pk3 1 1 1 1 1 @@ -73,8 +75,9 @@ A.a + 10*B.a, A.a + 10*B.a, A.a + 10*B.a, A.a + 10*B.a from t0 A, t0 B where B.a <5; explain select * from t3 where b in (select a from t0); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t0 ALL NULL NULL NULL NULL # Using where; Start temporary -1 SIMPLE t3 ref b b 5 test.t0.a # End temporary; Using join buffer (Batched Key Access) +1 SIMPLE ALL NULL NULL NULL NULL # Using where +1 SIMPLE t3 ref b b 5 .a # Using join buffer (Batched Key Access) +2 MATERIALIZED t0 ALL NULL NULL NULL NULL # NULL select * from t3 where b in (select A.a+B.a from t0 A, t0 B where B.a<5); a b pk1 pk2 0 0 0 0 diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_innodb_all_bka_nixbnl.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_innodb_all_bka_nixbnl.result index e2407ec2..6d68085f 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_innodb_all_bka_nixbnl.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_innodb_all_bka_nixbnl.result @@ -32,8 +32,9 @@ a b 9 5 explain select * from t2 where b in (select a from t1); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where; Start temporary -1 SIMPLE t2 ref b b 5 test.t1.a 1 End temporary; Using join buffer (Batched Key Access) +1 SIMPLE ALL NULL NULL NULL NULL NULL Using where +1 SIMPLE t2 ref b b 5 .a 1 Using join buffer (Batched Key Access) +2 MATERIALIZED t1 ALL NULL NULL NULL NULL 3 NULL select * from t2 where b in (select a from t1); a b 1 1 @@ -50,8 +51,9 @@ primary key(pk1, pk2, pk3) insert into t3 select a,a, a,a,a from t0; explain select * from t3 where b in (select a from t1); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where; Start temporary -1 SIMPLE t3 ref b b 5 test.t1.a 1 End temporary; Using join buffer (Batched Key Access) +1 SIMPLE ALL NULL NULL NULL NULL NULL Using where +1 SIMPLE t3 ref b b 5 .a 1 Using join buffer (Batched Key Access) +2 MATERIALIZED t1 ALL NULL NULL NULL NULL 3 NULL select * from t3 where b in (select a from t1); a b pk1 pk2 pk3 1 1 1 1 1 @@ -73,8 +75,9 @@ A.a + 10*B.a, A.a + 10*B.a, A.a + 10*B.a, A.a + 10*B.a from t0 A, t0 B where B.a <5; explain select * from t3 where b in (select a from t0); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t0 ALL NULL NULL NULL NULL # Using where; Start temporary -1 SIMPLE t3 ref b b 5 test.t0.a # End temporary; Using join buffer (Batched Key Access) +1 SIMPLE ALL NULL NULL NULL NULL # Using where +1 SIMPLE t3 ref b b 5 .a # Using join buffer (Batched Key Access) +2 MATERIALIZED t0 ALL NULL NULL NULL NULL # NULL select * from t3 where b in (select A.a+B.a from t0 A, t0 B where B.a<5); a b pk1 pk2 0 0 0 0 diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_innodb_all_bkaunique.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_innodb_all_bkaunique.result index f5f395a8..222aa38a 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_innodb_all_bkaunique.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_innodb_all_bkaunique.result @@ -33,8 +33,9 @@ a b 9 5 explain select * from t2 where b in (select a from t1); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where; Start temporary -1 SIMPLE t2 ref b b 5 test.t1.a 1 End temporary; Using join buffer (Batched Key Access (unique)) +1 SIMPLE ALL NULL NULL NULL NULL NULL Using where +1 SIMPLE t2 ref b b 5 .a 1 Using join buffer (Batched Key Access (unique)) +2 MATERIALIZED t1 ALL NULL NULL NULL NULL 3 NULL select * from t2 where b in (select a from t1); a b 1 1 @@ -51,8 +52,9 @@ primary key(pk1, pk2, pk3) insert into t3 select a,a, a,a,a from t0; explain select * from t3 where b in (select a from t1); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where; Start temporary -1 SIMPLE t3 ref b b 5 test.t1.a 1 End temporary; Using join buffer (Batched Key Access (unique)) +1 SIMPLE ALL NULL NULL NULL NULL NULL Using where +1 SIMPLE t3 ref b b 5 .a 1 Using join buffer (Batched Key Access (unique)) +2 MATERIALIZED t1 ALL NULL NULL NULL NULL 3 NULL select * from t3 where b in (select a from t1); a b pk1 pk2 pk3 1 1 1 1 1 @@ -74,8 +76,9 @@ A.a + 10*B.a, A.a + 10*B.a, A.a + 10*B.a, A.a + 10*B.a from t0 A, t0 B where B.a <5; explain select * from t3 where b in (select a from t0); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t0 ALL NULL NULL NULL NULL # Using where; Start temporary -1 SIMPLE t3 ref b b 5 test.t0.a # End temporary; Using join buffer (Batched Key Access (unique)) +1 SIMPLE ALL NULL NULL NULL NULL # Using where +1 SIMPLE t3 ref b b 5 .a # Using join buffer (Batched Key Access (unique)) +2 MATERIALIZED t0 ALL NULL NULL NULL NULL # NULL select * from t3 where b in (select A.a+B.a from t0 A, t0 B where B.a<5); a b pk1 pk2 0 0 0 0 diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan.result index 2529cca2..50177f0b 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan.result @@ -6812,8 +6812,8 @@ and t2.uid=t1.fid; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary 1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index -1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 End temporary -1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 9 Using where; Using join buffer (Block Nested Loop) +1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 Using where +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 End temporary select name from t2, t1 where t1.uid in (select t4.uid from t4, t3 where t3.uid=1 and t4.uid=t3.fid) and t2.uid=t1.fid; @@ -8036,9 +8036,9 @@ AND grandparent1.col_int_key <> 3 ); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 DEPENDENT SUBQUERY parent1 ref col_int_key col_int_key 4 func 2 Using where; Start temporary -2 DEPENDENT SUBQUERY parent2 index col_int_key col_int_key 4 NULL 1 Using where; Using index; Using join buffer (Block Nested Loop) -2 DEPENDENT SUBQUERY grandparent1 ref col_int_key col_int_key 4 func 2 Using where; End temporary +2 DEPENDENT SUBQUERY grandparent1 ref col_int_key col_int_key 4 func 2 Using where; Start temporary +2 DEPENDENT SUBQUERY parent1 ref col_int_key col_int_key 4 func 2 Using where +2 DEPENDENT SUBQUERY parent2 index col_int_key col_int_key 4 NULL 1 Using where; Using index; End temporary; Using join buffer (Block Nested Loop) explain format=json SELECT * FROM t3 WHERE g1 NOT IN (SELECT grandparent1.col_int_nokey AS g1 @@ -8069,7 +8069,7 @@ EXPLAIN "nested_loop": [ { "table": { - "table_name": "parent1", + "table_name": "grandparent1", "access_type": "ref", "possible_keys": [ "col_int_key" @@ -8084,13 +8084,13 @@ EXPLAIN ], "rows": 2, "filtered": 100, - "attached_condition": "(`test`.`parent1`.`col_int_key` <> 3)" + "attached_condition": "((`test`.`grandparent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`) and (`test`.`grandparent1`.`col_int_key` <> 3) and (('8') = `test`.`grandparent1`.`col_int_nokey`))" } }, { "table": { - "table_name": "parent2", - "access_type": "index", + "table_name": "parent1", + "access_type": "ref", "possible_keys": [ "col_int_key" ], @@ -8099,17 +8099,18 @@ EXPLAIN "col_int_key" ], "key_length": "4", - "rows": 1, + "ref": [ + "func" + ], + "rows": 2, "filtered": 100, - "using_index": true, - "using_join_buffer": "Block Nested Loop", - "attached_condition": "(is_not_null_compl(parent2), (`test`.`parent1`.`col_int_nokey` = `test`.`parent2`.`col_int_key`), true)" + "attached_condition": "(`test`.`parent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`)" } }, { "table": { - "table_name": "grandparent1", - "access_type": "ref", + "table_name": "parent2", + "access_type": "index", "possible_keys": [ "col_int_key" ], @@ -8118,12 +8119,11 @@ EXPLAIN "col_int_key" ], "key_length": "4", - "ref": [ - "func" - ], - "rows": 2, + "rows": 1, "filtered": 100, - "attached_condition": "((`test`.`grandparent1`.`col_int_nokey` = `test`.`parent1`.`col_int_key`) and (`test`.`grandparent1`.`col_int_key` = `test`.`parent1`.`col_int_key`))" + "using_index": true, + "using_join_buffer": "Block Nested Loop", + "attached_condition": "(is_not_null_compl(parent2), (`test`.`parent1`.`col_int_nokey` = `test`.`parent2`.`col_int_key`), true)" } } ] @@ -8135,7 +8135,7 @@ EXPLAIN } } Warnings: -Note 1003 /* select#1 */ select '8' AS `g1` from dual where (not(('8',(/* select#2 */ select 1 from `test`.`t1` `grandparent1` semi join (`test`.`t1` `parent1` left join `test`.`t2` `parent2` on((`test`.`parent1`.`col_int_nokey` = `test`.`parent2`.`col_int_key`))) where ((`test`.`grandparent1`.`col_int_nokey` = `test`.`parent1`.`col_int_key`) and (`test`.`grandparent1`.`col_int_key` = `test`.`parent1`.`col_int_key`) and (`test`.`parent1`.`col_int_key` <> 3) and (('8') = `test`.`parent1`.`col_int_key`)))))) +Note 1003 /* select#1 */ select '8' AS `g1` from dual where (not(('8',(/* select#2 */ select 1 from `test`.`t1` `grandparent1` semi join (`test`.`t1` `parent1` left join `test`.`t2` `parent2` on((`test`.`parent1`.`col_int_nokey` = `test`.`parent2`.`col_int_key`))) where ((`test`.`grandparent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`) and (`test`.`parent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`) and (`test`.`grandparent1`.`col_int_key` <> 3) and (('8') = `test`.`grandparent1`.`col_int_nokey`)))))) SELECT * FROM t3 WHERE g1 NOT IN (SELECT grandparent1.col_int_nokey AS g1 @@ -10465,6 +10465,95 @@ p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); ID 126 DROP TABLE t1,t2; +# +# Bug#18194196: OPTIMIZER EXECUTES STATEMENT INPERFORMANT +# +CREATE TABLE t1 (uid INTEGER, fid INTEGER, INDEX(uid)); +INSERT INTO t1 VALUES +(1,1), (1,2), (1,3), (1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t2 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t2 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +CREATE TABLE t3 (uid INT, fid INT, INDEX(uid)); +INSERT INTO t3 VALUES +(1,1), (1,2), (1,3),(1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t4 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t4 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +ANALYZE TABLE t1,t2,t3,t4; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +test.t3 analyze status OK +test.t4 analyze status OK +EXPLAIN SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index +1 SIMPLE t1 ALL uid NULL NULL NULL 11 Using where; End temporary; Using join buffer (Block Nested Loop) +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 NULL +FLUSH STATUS; +SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +name +A +B +C +D +E +F +G +H +A +B +I +SHOW STATUS LIKE '%handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 16 +Handler_read_last 0 +Handler_read_next 4 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 12 +DROP TABLE t1,t2,t3,t4; +# End of test for Bug#18194196 +# +# Bug#21184091 ASSERT `READ_ROWS >= 0.0' AT +# COST_MODEL_SERVER::TMPTABLE_READWRITE_COST() +# +CREATE TABLE t1 ( +col_int int(11), +pk int(11) NOT NULL, +col_int_key int(11) , +col_varchar varchar(1), +PRIMARY KEY (pk) +) ENGINE=MyISAM; +CREATE TABLE t2 ( +col_int int(11), +col_varchar varchar(1) +) ENGINE=MyISAM; +INSERT INTO t2 VALUES (19,'x'); +INSERT INTO t2 VALUES (20,'z'); +SELECT table1.col_varchar +FROM (t2 AS table1 RIGHT JOIN +((t2 STRAIGHT_JOIN t1 ON (t1.col_varchar = t2.col_varchar))) +ON (t1.pk = t2.col_int)) +WHERE (t1.pk IN (SELECT t1.col_int_key +FROM (t1 INNER JOIN t2 ON (t2.col_int = t1.col_int)))) +AND table1.col_varchar != 'q'; +col_varchar +DROP TABLE t1,t2; +# End of test for Bug#21184091 set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan_bka.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan_bka.result index c0f3fd55..e79aa141 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan_bka.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan_bka.result @@ -6813,8 +6813,8 @@ and t2.uid=t1.fid; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary 1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index -1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 End temporary -1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 9 Using where; Using join buffer (Block Nested Loop) +1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 Using where +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 End temporary select name from t2, t1 where t1.uid in (select t4.uid from t4, t3 where t3.uid=1 and t4.uid=t3.fid) and t2.uid=t1.fid; @@ -8037,9 +8037,9 @@ AND grandparent1.col_int_key <> 3 ); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 DEPENDENT SUBQUERY parent1 ref col_int_key col_int_key 4 func 2 Using where; Start temporary -2 DEPENDENT SUBQUERY parent2 index col_int_key col_int_key 4 NULL 1 Using where; Using index; Using join buffer (Block Nested Loop) -2 DEPENDENT SUBQUERY grandparent1 ref col_int_key col_int_key 4 func 2 Using where; End temporary +2 DEPENDENT SUBQUERY grandparent1 ref col_int_key col_int_key 4 func 2 Using where; Start temporary +2 DEPENDENT SUBQUERY parent1 ref col_int_key col_int_key 4 func 2 Using where +2 DEPENDENT SUBQUERY parent2 index col_int_key col_int_key 4 NULL 1 Using where; Using index; End temporary; Using join buffer (Block Nested Loop) explain format=json SELECT * FROM t3 WHERE g1 NOT IN (SELECT grandparent1.col_int_nokey AS g1 @@ -8070,7 +8070,7 @@ EXPLAIN "nested_loop": [ { "table": { - "table_name": "parent1", + "table_name": "grandparent1", "access_type": "ref", "possible_keys": [ "col_int_key" @@ -8085,13 +8085,13 @@ EXPLAIN ], "rows": 2, "filtered": 100, - "attached_condition": "(`test`.`parent1`.`col_int_key` <> 3)" + "attached_condition": "((`test`.`grandparent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`) and (`test`.`grandparent1`.`col_int_key` <> 3) and (('8') = `test`.`grandparent1`.`col_int_nokey`))" } }, { "table": { - "table_name": "parent2", - "access_type": "index", + "table_name": "parent1", + "access_type": "ref", "possible_keys": [ "col_int_key" ], @@ -8100,17 +8100,18 @@ EXPLAIN "col_int_key" ], "key_length": "4", - "rows": 1, + "ref": [ + "func" + ], + "rows": 2, "filtered": 100, - "using_index": true, - "using_join_buffer": "Block Nested Loop", - "attached_condition": "(is_not_null_compl(parent2), (`test`.`parent1`.`col_int_nokey` = `test`.`parent2`.`col_int_key`), true)" + "attached_condition": "(`test`.`parent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`)" } }, { "table": { - "table_name": "grandparent1", - "access_type": "ref", + "table_name": "parent2", + "access_type": "index", "possible_keys": [ "col_int_key" ], @@ -8119,12 +8120,11 @@ EXPLAIN "col_int_key" ], "key_length": "4", - "ref": [ - "func" - ], - "rows": 2, + "rows": 1, "filtered": 100, - "attached_condition": "((`test`.`grandparent1`.`col_int_nokey` = `test`.`parent1`.`col_int_key`) and (`test`.`grandparent1`.`col_int_key` = `test`.`parent1`.`col_int_key`))" + "using_index": true, + "using_join_buffer": "Block Nested Loop", + "attached_condition": "(is_not_null_compl(parent2), (`test`.`parent1`.`col_int_nokey` = `test`.`parent2`.`col_int_key`), true)" } } ] @@ -8136,7 +8136,7 @@ EXPLAIN } } Warnings: -Note 1003 /* select#1 */ select '8' AS `g1` from dual where (not(('8',(/* select#2 */ select 1 from `test`.`t1` `grandparent1` semi join (`test`.`t1` `parent1` left join `test`.`t2` `parent2` on((`test`.`parent1`.`col_int_nokey` = `test`.`parent2`.`col_int_key`))) where ((`test`.`grandparent1`.`col_int_nokey` = `test`.`parent1`.`col_int_key`) and (`test`.`grandparent1`.`col_int_key` = `test`.`parent1`.`col_int_key`) and (`test`.`parent1`.`col_int_key` <> 3) and (('8') = `test`.`parent1`.`col_int_key`)))))) +Note 1003 /* select#1 */ select '8' AS `g1` from dual where (not(('8',(/* select#2 */ select 1 from `test`.`t1` `grandparent1` semi join (`test`.`t1` `parent1` left join `test`.`t2` `parent2` on((`test`.`parent1`.`col_int_nokey` = `test`.`parent2`.`col_int_key`))) where ((`test`.`grandparent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`) and (`test`.`parent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`) and (`test`.`grandparent1`.`col_int_key` <> 3) and (('8') = `test`.`grandparent1`.`col_int_nokey`)))))) SELECT * FROM t3 WHERE g1 NOT IN (SELECT grandparent1.col_int_nokey AS g1 @@ -10470,6 +10470,95 @@ p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); ID 126 DROP TABLE t1,t2; +# +# Bug#18194196: OPTIMIZER EXECUTES STATEMENT INPERFORMANT +# +CREATE TABLE t1 (uid INTEGER, fid INTEGER, INDEX(uid)); +INSERT INTO t1 VALUES +(1,1), (1,2), (1,3), (1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t2 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t2 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +CREATE TABLE t3 (uid INT, fid INT, INDEX(uid)); +INSERT INTO t3 VALUES +(1,1), (1,2), (1,3),(1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t4 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t4 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +ANALYZE TABLE t1,t2,t3,t4; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +test.t3 analyze status OK +test.t4 analyze status OK +EXPLAIN SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index +1 SIMPLE t1 ALL uid NULL NULL NULL 11 Using where; End temporary; Using join buffer (Block Nested Loop) +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 NULL +FLUSH STATUS; +SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +name +A +B +C +D +E +F +G +H +A +B +I +SHOW STATUS LIKE '%handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 16 +Handler_read_last 0 +Handler_read_next 4 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 12 +DROP TABLE t1,t2,t3,t4; +# End of test for Bug#18194196 +# +# Bug#21184091 ASSERT `READ_ROWS >= 0.0' AT +# COST_MODEL_SERVER::TMPTABLE_READWRITE_COST() +# +CREATE TABLE t1 ( +col_int int(11), +pk int(11) NOT NULL, +col_int_key int(11) , +col_varchar varchar(1), +PRIMARY KEY (pk) +) ENGINE=MyISAM; +CREATE TABLE t2 ( +col_int int(11), +col_varchar varchar(1) +) ENGINE=MyISAM; +INSERT INTO t2 VALUES (19,'x'); +INSERT INTO t2 VALUES (20,'z'); +SELECT table1.col_varchar +FROM (t2 AS table1 RIGHT JOIN +((t2 STRAIGHT_JOIN t1 ON (t1.col_varchar = t2.col_varchar))) +ON (t1.pk = t2.col_int)) +WHERE (t1.pk IN (SELECT t1.col_int_key +FROM (t1 INNER JOIN t2 ON (t2.col_int = t1.col_int)))) +AND table1.col_varchar != 'q'; +col_varchar +DROP TABLE t1,t2; +# End of test for Bug#21184091 set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan_bka_nixbnl.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan_bka_nixbnl.result index dbb80885..37d314d5 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan_bka_nixbnl.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan_bka_nixbnl.result @@ -6823,8 +6823,8 @@ and t2.uid=t1.fid; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary 1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index -1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 End temporary -1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 9 Using where +1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 Using where +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 End temporary select name from t2, t1 where t1.uid in (select t4.uid from t4, t3 where t3.uid=1 and t4.uid=t3.fid) and t2.uid=t1.fid; @@ -10470,6 +10470,95 @@ p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); ID 126 DROP TABLE t1,t2; +# +# Bug#18194196: OPTIMIZER EXECUTES STATEMENT INPERFORMANT +# +CREATE TABLE t1 (uid INTEGER, fid INTEGER, INDEX(uid)); +INSERT INTO t1 VALUES +(1,1), (1,2), (1,3), (1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t2 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t2 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +CREATE TABLE t3 (uid INT, fid INT, INDEX(uid)); +INSERT INTO t3 VALUES +(1,1), (1,2), (1,3),(1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t4 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t4 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +ANALYZE TABLE t1,t2,t3,t4; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +test.t3 analyze status OK +test.t4 analyze status OK +EXPLAIN SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index +1 SIMPLE t1 ref uid uid 5 test.t3.fid 4 Using where; End temporary +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 NULL +FLUSH STATUS; +SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +name +A +B +C +D +E +F +G +H +A +B +I +SHOW STATUS LIKE '%handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 20 +Handler_read_last 0 +Handler_read_next 15 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 0 +DROP TABLE t1,t2,t3,t4; +# End of test for Bug#18194196 +# +# Bug#21184091 ASSERT `READ_ROWS >= 0.0' AT +# COST_MODEL_SERVER::TMPTABLE_READWRITE_COST() +# +CREATE TABLE t1 ( +col_int int(11), +pk int(11) NOT NULL, +col_int_key int(11) , +col_varchar varchar(1), +PRIMARY KEY (pk) +) ENGINE=MyISAM; +CREATE TABLE t2 ( +col_int int(11), +col_varchar varchar(1) +) ENGINE=MyISAM; +INSERT INTO t2 VALUES (19,'x'); +INSERT INTO t2 VALUES (20,'z'); +SELECT table1.col_varchar +FROM (t2 AS table1 RIGHT JOIN +((t2 STRAIGHT_JOIN t1 ON (t1.col_varchar = t2.col_varchar))) +ON (t1.pk = t2.col_int)) +WHERE (t1.pk IN (SELECT t1.col_int_key +FROM (t1 INNER JOIN t2 ON (t2.col_int = t1.col_int)))) +AND table1.col_varchar != 'q'; +col_varchar +DROP TABLE t1,t2; +# End of test for Bug#21184091 set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan_bkaunique.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan_bkaunique.result index 8207454f..98a23d3a 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan_bkaunique.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_loosescan_bkaunique.result @@ -6814,8 +6814,8 @@ and t2.uid=t1.fid; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary 1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index -1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 End temporary -1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 9 Using where; Using join buffer (Block Nested Loop) +1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 Using where +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 End temporary select name from t2, t1 where t1.uid in (select t4.uid from t4, t3 where t3.uid=1 and t4.uid=t3.fid) and t2.uid=t1.fid; @@ -8038,9 +8038,9 @@ AND grandparent1.col_int_key <> 3 ); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -2 DEPENDENT SUBQUERY parent1 ref col_int_key col_int_key 4 func 2 Using where; Start temporary -2 DEPENDENT SUBQUERY parent2 index col_int_key col_int_key 4 NULL 1 Using where; Using index; Using join buffer (Block Nested Loop) -2 DEPENDENT SUBQUERY grandparent1 ref col_int_key col_int_key 4 func 2 Using where; End temporary +2 DEPENDENT SUBQUERY grandparent1 ref col_int_key col_int_key 4 func 2 Using where; Start temporary +2 DEPENDENT SUBQUERY parent1 ref col_int_key col_int_key 4 func 2 Using where +2 DEPENDENT SUBQUERY parent2 index col_int_key col_int_key 4 NULL 1 Using where; Using index; End temporary; Using join buffer (Block Nested Loop) explain format=json SELECT * FROM t3 WHERE g1 NOT IN (SELECT grandparent1.col_int_nokey AS g1 @@ -8071,7 +8071,7 @@ EXPLAIN "nested_loop": [ { "table": { - "table_name": "parent1", + "table_name": "grandparent1", "access_type": "ref", "possible_keys": [ "col_int_key" @@ -8086,13 +8086,13 @@ EXPLAIN ], "rows": 2, "filtered": 100, - "attached_condition": "(`test`.`parent1`.`col_int_key` <> 3)" + "attached_condition": "((`test`.`grandparent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`) and (`test`.`grandparent1`.`col_int_key` <> 3) and (('8') = `test`.`grandparent1`.`col_int_nokey`))" } }, { "table": { - "table_name": "parent2", - "access_type": "index", + "table_name": "parent1", + "access_type": "ref", "possible_keys": [ "col_int_key" ], @@ -8101,17 +8101,18 @@ EXPLAIN "col_int_key" ], "key_length": "4", - "rows": 1, + "ref": [ + "func" + ], + "rows": 2, "filtered": 100, - "using_index": true, - "using_join_buffer": "Block Nested Loop", - "attached_condition": "(is_not_null_compl(parent2), (`test`.`parent1`.`col_int_nokey` = `test`.`parent2`.`col_int_key`), true)" + "attached_condition": "(`test`.`parent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`)" } }, { "table": { - "table_name": "grandparent1", - "access_type": "ref", + "table_name": "parent2", + "access_type": "index", "possible_keys": [ "col_int_key" ], @@ -8120,12 +8121,11 @@ EXPLAIN "col_int_key" ], "key_length": "4", - "ref": [ - "func" - ], - "rows": 2, + "rows": 1, "filtered": 100, - "attached_condition": "((`test`.`grandparent1`.`col_int_nokey` = `test`.`parent1`.`col_int_key`) and (`test`.`grandparent1`.`col_int_key` = `test`.`parent1`.`col_int_key`))" + "using_index": true, + "using_join_buffer": "Block Nested Loop", + "attached_condition": "(is_not_null_compl(parent2), (`test`.`parent1`.`col_int_nokey` = `test`.`parent2`.`col_int_key`), true)" } } ] @@ -8137,7 +8137,7 @@ EXPLAIN } } Warnings: -Note 1003 /* select#1 */ select '8' AS `g1` from dual where (not(('8',(/* select#2 */ select 1 from `test`.`t1` `grandparent1` semi join (`test`.`t1` `parent1` left join `test`.`t2` `parent2` on((`test`.`parent1`.`col_int_nokey` = `test`.`parent2`.`col_int_key`))) where ((`test`.`grandparent1`.`col_int_nokey` = `test`.`parent1`.`col_int_key`) and (`test`.`grandparent1`.`col_int_key` = `test`.`parent1`.`col_int_key`) and (`test`.`parent1`.`col_int_key` <> 3) and (('8') = `test`.`parent1`.`col_int_key`)))))) +Note 1003 /* select#1 */ select '8' AS `g1` from dual where (not(('8',(/* select#2 */ select 1 from `test`.`t1` `grandparent1` semi join (`test`.`t1` `parent1` left join `test`.`t2` `parent2` on((`test`.`parent1`.`col_int_nokey` = `test`.`parent2`.`col_int_key`))) where ((`test`.`grandparent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`) and (`test`.`parent1`.`col_int_key` = `test`.`grandparent1`.`col_int_nokey`) and (`test`.`grandparent1`.`col_int_key` <> 3) and (('8') = `test`.`grandparent1`.`col_int_nokey`)))))) SELECT * FROM t3 WHERE g1 NOT IN (SELECT grandparent1.col_int_nokey AS g1 @@ -10471,6 +10471,95 @@ p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); ID 126 DROP TABLE t1,t2; +# +# Bug#18194196: OPTIMIZER EXECUTES STATEMENT INPERFORMANT +# +CREATE TABLE t1 (uid INTEGER, fid INTEGER, INDEX(uid)); +INSERT INTO t1 VALUES +(1,1), (1,2), (1,3), (1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t2 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t2 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +CREATE TABLE t3 (uid INT, fid INT, INDEX(uid)); +INSERT INTO t3 VALUES +(1,1), (1,2), (1,3),(1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t4 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t4 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +ANALYZE TABLE t1,t2,t3,t4; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +test.t3 analyze status OK +test.t4 analyze status OK +EXPLAIN SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index +1 SIMPLE t1 ALL uid NULL NULL NULL 11 Using where; End temporary; Using join buffer (Block Nested Loop) +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 NULL +FLUSH STATUS; +SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +name +A +B +C +D +E +F +G +H +A +B +I +SHOW STATUS LIKE '%handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 16 +Handler_read_last 0 +Handler_read_next 4 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 12 +DROP TABLE t1,t2,t3,t4; +# End of test for Bug#18194196 +# +# Bug#21184091 ASSERT `READ_ROWS >= 0.0' AT +# COST_MODEL_SERVER::TMPTABLE_READWRITE_COST() +# +CREATE TABLE t1 ( +col_int int(11), +pk int(11) NOT NULL, +col_int_key int(11) , +col_varchar varchar(1), +PRIMARY KEY (pk) +) ENGINE=MyISAM; +CREATE TABLE t2 ( +col_int int(11), +col_varchar varchar(1) +) ENGINE=MyISAM; +INSERT INTO t2 VALUES (19,'x'); +INSERT INTO t2 VALUES (20,'z'); +SELECT table1.col_varchar +FROM (t2 AS table1 RIGHT JOIN +((t2 STRAIGHT_JOIN t1 ON (t1.col_varchar = t2.col_varchar))) +ON (t1.pk = t2.col_int)) +WHERE (t1.pk IN (SELECT t1.col_int_key +FROM (t1 INNER JOIN t2 ON (t2.col_int = t1.col_int)))) +AND table1.col_varchar != 'q'; +col_varchar +DROP TABLE t1,t2; +# End of test for Bug#21184091 set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat.result index acd322bd..4f0885a3 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat.result @@ -3002,42 +3002,48 @@ EXPLAIN { "query_block": { "select_id": 1, - "duplicates_removal": { - "using_temporary_table": true, - "nested_loop": [ - { - "table": { - "table_name": "t11", - "access_type": "ALL", - "rows": 8, - "filtered": 100 - } - }, - { - "table": { - "table_name": "t1", - "access_type": "eq_ref", - "possible_keys": [ - "PRIMARY" - ], - "key": "PRIMARY", - "used_key_parts": [ - "a" - ], - "key_length": "4", - "ref": [ - "test.t11.a" - ], - "rows": 1, - "filtered": 100 + "nested_loop": [ + { + "table": { + "table_name": "", + "access_type": "ALL", + "materialized_from_subquery": { + "using_temporary_table": true, + "query_block": { + "table": { + "table_name": "t11", + "access_type": "ALL", + "rows": 8, + "filtered": 100 + } + } } } - ] - } + }, + { + "table": { + "table_name": "t1", + "access_type": "eq_ref", + "possible_keys": [ + "PRIMARY" + ], + "key": "PRIMARY", + "used_key_parts": [ + "a" + ], + "key_length": "4", + "ref": [ + ".a" + ], + "rows": 1, + "filtered": 100 + } + } + ] } } Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` semi join (`test`.`t11`) where (`test`.`t1`.`a` = `test`.`t11`.`a`) +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` semi join (`test`.`t11`) where (`test`.`t1`.`a` = ``.`a`) select t21.* from t21,t22 where t21.a = t22.a and t22.a in (select t12.a from t11, t12 where t11.a in(255,256) and t11.a = t12.a and t11.c is null) and t22.c is null order by t21.a; a b c @@ -3292,8 +3298,9 @@ create table t3 ( a int , filler char(100), key(a)); insert into t3 select A.a + 10*B.a, 'filler' from t0 A, t0 B; explain select * from t3 where a in (select a from t2) and (a > 5 or a < 10); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where; Start temporary -1 SIMPLE t3 ref a a 5 test.t2.a 1 End temporary +1 SIMPLE ALL NULL NULL NULL NULL NULL Using where +1 SIMPLE t3 ref a a 5 .a 1 NULL +2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 NULL select * from t3 where a in (select a from t2); a filler 1 filler @@ -5830,11 +5837,12 @@ INNER JOIN t2 c ON c.idContact=cona.idContact WHERE cona.postalStripped='T2H3B2' ); id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE cona ALL NULL NULL NULL NULL 2 100.00 Using where; Start temporary -1 SIMPLE c eq_ref PRIMARY PRIMARY 4 test.cona.idContact 1 100.00 Using where -1 SIMPLE a eq_ref PRIMARY PRIMARY 4 test.c.idObj 1 100.00 Using index; End temporary +1 SIMPLE ALL NULL NULL NULL NULL NULL 0.00 NULL +1 SIMPLE a index PRIMARY PRIMARY 4 NULL 2 100.00 Using where; Using index; Using join buffer (Block Nested Loop) +2 MATERIALIZED cona ALL NULL NULL NULL NULL 2 100.00 Using where +2 MATERIALIZED c eq_ref PRIMARY PRIMARY 4 test.cona.idContact 1 100.00 NULL Warnings: -Note 1003 /* select#1 */ select `test`.`a`.`idIndividual` AS `idIndividual` from `test`.`t1` `a` semi join (`test`.`t3` `cona` join `test`.`t2` `c`) where ((`test`.`c`.`idContact` = `test`.`cona`.`idContact`) and (`test`.`a`.`idIndividual` = `test`.`c`.`idObj`) and (`test`.`cona`.`postalStripped` = 'T2H3B2')) +Note 1003 /* select#1 */ select `test`.`a`.`idIndividual` AS `idIndividual` from `test`.`t1` `a` semi join (`test`.`t3` `cona` join `test`.`t2` `c`) where ((`test`.`c`.`idContact` = `test`.`cona`.`idContact`) and (`test`.`a`.`idIndividual` = ``.`idObj`) and (`test`.`cona`.`postalStripped` = 'T2H3B2')) drop table t1,t2,t3; CREATE TABLE t1 (one int, two int, flag char(1)); CREATE TABLE t2 (one int, two int, flag char(1)); @@ -6967,8 +6975,8 @@ and t2.uid=t1.fid; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary 1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index -1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 End temporary -1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 9 Using where; Using join buffer (Block Nested Loop) +1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 Using where +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 End temporary select name from t2, t1 where t1.uid in (select t4.uid from t4, t3 where t3.uid=1 and t4.uid=t3.fid) and t2.uid=t1.fid; @@ -7740,8 +7748,9 @@ WHERE col_varchar_key IN (SELECT col_varchar_nokey FROM t2) ORDER BY col_datetime_key LIMIT 4; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort; Start temporary -1 SIMPLE t1 ref col_varchar_key col_varchar_key 3 test.t2.col_varchar_nokey 1 End temporary +1 SIMPLE t1 ALL col_varchar_key NULL NULL NULL 20 Using where; Using filesort +1 SIMPLE eq_ref 3 test.t1.col_varchar_key 1 NULL +2 MATERIALIZED t2 ALL NULL NULL NULL NULL 6 NULL SELECT col_varchar_key FROM t1 WHERE col_varchar_key IN (SELECT col_varchar_nokey @@ -7813,9 +7822,10 @@ AND grandparent1.col_varchar_key IS NOT NULL ); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where -2 SUBQUERY parent1 ALL NULL NULL NULL NULL 20 Start temporary -2 SUBQUERY parent2 eq_ref PRIMARY PRIMARY 4 test.parent1.pk 1 Using index -2 SUBQUERY grandparent1 ref col_varchar_key col_varchar_key 3 test.parent1.col_varchar_nokey 1 Using where; End temporary +2 SUBQUERY ALL NULL NULL NULL NULL NULL NULL +2 SUBQUERY grandparent1 ref col_varchar_key col_varchar_key 3 .p1 1 Using where +3 MATERIALIZED parent1 ALL NULL NULL NULL NULL 20 NULL +3 MATERIALIZED parent2 eq_ref PRIMARY PRIMARY 4 test.parent1.pk 1 Using index SELECT * FROM t1 WHERE g1 NOT IN @@ -10685,6 +10695,95 @@ p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); ID 126 DROP TABLE t1,t2; +# +# Bug#18194196: OPTIMIZER EXECUTES STATEMENT INPERFORMANT +# +CREATE TABLE t1 (uid INTEGER, fid INTEGER, INDEX(uid)); +INSERT INTO t1 VALUES +(1,1), (1,2), (1,3), (1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t2 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t2 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +CREATE TABLE t3 (uid INT, fid INT, INDEX(uid)); +INSERT INTO t3 VALUES +(1,1), (1,2), (1,3),(1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t4 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t4 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +ANALYZE TABLE t1,t2,t3,t4; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +test.t3 analyze status OK +test.t4 analyze status OK +EXPLAIN SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index +1 SIMPLE t1 ALL uid NULL NULL NULL 11 Using where; End temporary; Using join buffer (Block Nested Loop) +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 NULL +FLUSH STATUS; +SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +name +A +B +C +D +E +F +G +H +A +B +I +SHOW STATUS LIKE '%handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 16 +Handler_read_last 0 +Handler_read_next 4 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 12 +DROP TABLE t1,t2,t3,t4; +# End of test for Bug#18194196 +# +# Bug#21184091 ASSERT `READ_ROWS >= 0.0' AT +# COST_MODEL_SERVER::TMPTABLE_READWRITE_COST() +# +CREATE TABLE t1 ( +col_int int(11), +pk int(11) NOT NULL, +col_int_key int(11) , +col_varchar varchar(1), +PRIMARY KEY (pk) +) ENGINE=MyISAM; +CREATE TABLE t2 ( +col_int int(11), +col_varchar varchar(1) +) ENGINE=MyISAM; +INSERT INTO t2 VALUES (19,'x'); +INSERT INTO t2 VALUES (20,'z'); +SELECT table1.col_varchar +FROM (t2 AS table1 RIGHT JOIN +((t2 STRAIGHT_JOIN t1 ON (t1.col_varchar = t2.col_varchar))) +ON (t1.pk = t2.col_int)) +WHERE (t1.pk IN (SELECT t1.col_int_key +FROM (t1 INNER JOIN t2 ON (t2.col_int = t1.col_int)))) +AND table1.col_varchar != 'q'; +col_varchar +DROP TABLE t1,t2; +# End of test for Bug#21184091 set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_bka.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_bka.result index 7864846e..5aef8649 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_bka.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_bka.result @@ -3003,42 +3003,48 @@ EXPLAIN { "query_block": { "select_id": 1, - "duplicates_removal": { - "using_temporary_table": true, - "nested_loop": [ - { - "table": { - "table_name": "t11", - "access_type": "ALL", - "rows": 8, - "filtered": 100 - } - }, - { - "table": { - "table_name": "t1", - "access_type": "eq_ref", - "possible_keys": [ - "PRIMARY" - ], - "key": "PRIMARY", - "used_key_parts": [ - "a" - ], - "key_length": "4", - "ref": [ - "test.t11.a" - ], - "rows": 1, - "filtered": 100 + "nested_loop": [ + { + "table": { + "table_name": "", + "access_type": "ALL", + "materialized_from_subquery": { + "using_temporary_table": true, + "query_block": { + "table": { + "table_name": "t11", + "access_type": "ALL", + "rows": 8, + "filtered": 100 + } + } } } - ] - } + }, + { + "table": { + "table_name": "t1", + "access_type": "eq_ref", + "possible_keys": [ + "PRIMARY" + ], + "key": "PRIMARY", + "used_key_parts": [ + "a" + ], + "key_length": "4", + "ref": [ + ".a" + ], + "rows": 1, + "filtered": 100 + } + } + ] } } Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` semi join (`test`.`t11`) where (`test`.`t1`.`a` = `test`.`t11`.`a`) +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` semi join (`test`.`t11`) where (`test`.`t1`.`a` = ``.`a`) select t21.* from t21,t22 where t21.a = t22.a and t22.a in (select t12.a from t11, t12 where t11.a in(255,256) and t11.a = t12.a and t11.c is null) and t22.c is null order by t21.a; a b c @@ -3293,8 +3299,9 @@ create table t3 ( a int , filler char(100), key(a)); insert into t3 select A.a + 10*B.a, 'filler' from t0 A, t0 B; explain select * from t3 where a in (select a from t2) and (a > 5 or a < 10); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where; Start temporary -1 SIMPLE t3 ref a a 5 test.t2.a 1 End temporary +1 SIMPLE ALL NULL NULL NULL NULL NULL Using where +1 SIMPLE t3 ref a a 5 .a 1 NULL +2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 NULL select * from t3 where a in (select a from t2); a filler 1 filler @@ -5831,11 +5838,12 @@ INNER JOIN t2 c ON c.idContact=cona.idContact WHERE cona.postalStripped='T2H3B2' ); id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE cona ALL NULL NULL NULL NULL 2 100.00 Using where; Start temporary -1 SIMPLE c eq_ref PRIMARY PRIMARY 4 test.cona.idContact 1 100.00 Using where -1 SIMPLE a eq_ref PRIMARY PRIMARY 4 test.c.idObj 1 100.00 Using index; End temporary +1 SIMPLE ALL NULL NULL NULL NULL NULL 0.00 NULL +1 SIMPLE a index PRIMARY PRIMARY 4 NULL 2 100.00 Using where; Using index; Using join buffer (Block Nested Loop) +2 MATERIALIZED cona ALL NULL NULL NULL NULL 2 100.00 Using where +2 MATERIALIZED c eq_ref PRIMARY PRIMARY 4 test.cona.idContact 1 100.00 NULL Warnings: -Note 1003 /* select#1 */ select `test`.`a`.`idIndividual` AS `idIndividual` from `test`.`t1` `a` semi join (`test`.`t3` `cona` join `test`.`t2` `c`) where ((`test`.`c`.`idContact` = `test`.`cona`.`idContact`) and (`test`.`a`.`idIndividual` = `test`.`c`.`idObj`) and (`test`.`cona`.`postalStripped` = 'T2H3B2')) +Note 1003 /* select#1 */ select `test`.`a`.`idIndividual` AS `idIndividual` from `test`.`t1` `a` semi join (`test`.`t3` `cona` join `test`.`t2` `c`) where ((`test`.`c`.`idContact` = `test`.`cona`.`idContact`) and (`test`.`a`.`idIndividual` = ``.`idObj`) and (`test`.`cona`.`postalStripped` = 'T2H3B2')) drop table t1,t2,t3; CREATE TABLE t1 (one int, two int, flag char(1)); CREATE TABLE t2 (one int, two int, flag char(1)); @@ -6968,8 +6976,8 @@ and t2.uid=t1.fid; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary 1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index -1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 End temporary -1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 9 Using where; Using join buffer (Block Nested Loop) +1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 Using where +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 End temporary select name from t2, t1 where t1.uid in (select t4.uid from t4, t3 where t3.uid=1 and t4.uid=t3.fid) and t2.uid=t1.fid; @@ -7741,8 +7749,9 @@ WHERE col_varchar_key IN (SELECT col_varchar_nokey FROM t2) ORDER BY col_datetime_key LIMIT 4; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort; Start temporary -1 SIMPLE t1 ref col_varchar_key col_varchar_key 3 test.t2.col_varchar_nokey 1 End temporary +1 SIMPLE t1 ALL col_varchar_key NULL NULL NULL 20 Using where; Using filesort +1 SIMPLE eq_ref 3 test.t1.col_varchar_key 1 NULL +2 MATERIALIZED t2 ALL NULL NULL NULL NULL 6 NULL SELECT col_varchar_key FROM t1 WHERE col_varchar_key IN (SELECT col_varchar_nokey @@ -7814,9 +7823,10 @@ AND grandparent1.col_varchar_key IS NOT NULL ); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where -2 SUBQUERY parent1 ALL NULL NULL NULL NULL 20 Start temporary -2 SUBQUERY parent2 eq_ref PRIMARY PRIMARY 4 test.parent1.pk 1 Using index -2 SUBQUERY grandparent1 ref col_varchar_key col_varchar_key 3 test.parent1.col_varchar_nokey 1 Using where; End temporary +2 SUBQUERY ALL NULL NULL NULL NULL NULL NULL +2 SUBQUERY grandparent1 ref col_varchar_key col_varchar_key 3 .p1 1 Using where +3 MATERIALIZED parent1 ALL NULL NULL NULL NULL 20 NULL +3 MATERIALIZED parent2 eq_ref PRIMARY PRIMARY 4 test.parent1.pk 1 Using index SELECT * FROM t1 WHERE g1 NOT IN @@ -10686,6 +10696,95 @@ p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); ID 126 DROP TABLE t1,t2; +# +# Bug#18194196: OPTIMIZER EXECUTES STATEMENT INPERFORMANT +# +CREATE TABLE t1 (uid INTEGER, fid INTEGER, INDEX(uid)); +INSERT INTO t1 VALUES +(1,1), (1,2), (1,3), (1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t2 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t2 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +CREATE TABLE t3 (uid INT, fid INT, INDEX(uid)); +INSERT INTO t3 VALUES +(1,1), (1,2), (1,3),(1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t4 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t4 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +ANALYZE TABLE t1,t2,t3,t4; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +test.t3 analyze status OK +test.t4 analyze status OK +EXPLAIN SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index +1 SIMPLE t1 ALL uid NULL NULL NULL 11 Using where; End temporary; Using join buffer (Block Nested Loop) +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 NULL +FLUSH STATUS; +SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +name +A +B +C +D +E +F +G +H +A +B +I +SHOW STATUS LIKE '%handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 16 +Handler_read_last 0 +Handler_read_next 4 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 12 +DROP TABLE t1,t2,t3,t4; +# End of test for Bug#18194196 +# +# Bug#21184091 ASSERT `READ_ROWS >= 0.0' AT +# COST_MODEL_SERVER::TMPTABLE_READWRITE_COST() +# +CREATE TABLE t1 ( +col_int int(11), +pk int(11) NOT NULL, +col_int_key int(11) , +col_varchar varchar(1), +PRIMARY KEY (pk) +) ENGINE=MyISAM; +CREATE TABLE t2 ( +col_int int(11), +col_varchar varchar(1) +) ENGINE=MyISAM; +INSERT INTO t2 VALUES (19,'x'); +INSERT INTO t2 VALUES (20,'z'); +SELECT table1.col_varchar +FROM (t2 AS table1 RIGHT JOIN +((t2 STRAIGHT_JOIN t1 ON (t1.col_varchar = t2.col_varchar))) +ON (t1.pk = t2.col_int)) +WHERE (t1.pk IN (SELECT t1.col_int_key +FROM (t1 INNER JOIN t2 ON (t2.col_int = t1.col_int)))) +AND table1.col_varchar != 'q'; +col_varchar +DROP TABLE t1,t2; +# End of test for Bug#21184091 set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_bka_nixbnl.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_bka_nixbnl.result index d7705d49..53ea4f1f 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_bka_nixbnl.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_bka_nixbnl.result @@ -2991,42 +2991,48 @@ EXPLAIN { "query_block": { "select_id": 1, - "duplicates_removal": { - "using_temporary_table": true, - "nested_loop": [ - { - "table": { - "table_name": "t11", - "access_type": "ALL", - "rows": 8, - "filtered": 100 - } - }, - { - "table": { - "table_name": "t1", - "access_type": "eq_ref", - "possible_keys": [ - "PRIMARY" - ], - "key": "PRIMARY", - "used_key_parts": [ - "a" - ], - "key_length": "4", - "ref": [ - "test.t11.a" - ], - "rows": 1, - "filtered": 100 + "nested_loop": [ + { + "table": { + "table_name": "", + "access_type": "ALL", + "materialized_from_subquery": { + "using_temporary_table": true, + "query_block": { + "table": { + "table_name": "t11", + "access_type": "ALL", + "rows": 8, + "filtered": 100 + } + } } } - ] - } + }, + { + "table": { + "table_name": "t1", + "access_type": "eq_ref", + "possible_keys": [ + "PRIMARY" + ], + "key": "PRIMARY", + "used_key_parts": [ + "a" + ], + "key_length": "4", + "ref": [ + ".a" + ], + "rows": 1, + "filtered": 100 + } + } + ] } } Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` semi join (`test`.`t11`) where (`test`.`t1`.`a` = `test`.`t11`.`a`) +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` semi join (`test`.`t11`) where (`test`.`t1`.`a` = ``.`a`) select t21.* from t21,t22 where t21.a = t22.a and t22.a in (select t12.a from t11, t12 where t11.a in(255,256) and t11.a = t12.a and t11.c is null) and t22.c is null order by t21.a; a b c @@ -3281,8 +3287,9 @@ create table t3 ( a int , filler char(100), key(a)); insert into t3 select A.a + 10*B.a, 'filler' from t0 A, t0 B; explain select * from t3 where a in (select a from t2) and (a > 5 or a < 10); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where; Start temporary -1 SIMPLE t3 ref a a 5 test.t2.a 1 End temporary +1 SIMPLE ALL NULL NULL NULL NULL NULL Using where +1 SIMPLE t3 ref a a 5 .a 1 NULL +2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 NULL select * from t3 where a in (select a from t2); a filler 1 filler @@ -5819,11 +5826,12 @@ INNER JOIN t2 c ON c.idContact=cona.idContact WHERE cona.postalStripped='T2H3B2' ); id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE cona ALL NULL NULL NULL NULL 2 100.00 Using where; Start temporary -1 SIMPLE c eq_ref PRIMARY PRIMARY 4 test.cona.idContact 1 100.00 Using where -1 SIMPLE a eq_ref PRIMARY PRIMARY 4 test.c.idObj 1 100.00 Using index; End temporary +1 SIMPLE ALL NULL NULL NULL NULL NULL 0.00 Using where +1 SIMPLE a eq_ref PRIMARY PRIMARY 4 .idObj 1 100.00 Using index +2 MATERIALIZED cona ALL NULL NULL NULL NULL 2 100.00 Using where +2 MATERIALIZED c eq_ref PRIMARY PRIMARY 4 test.cona.idContact 1 100.00 NULL Warnings: -Note 1003 /* select#1 */ select `test`.`a`.`idIndividual` AS `idIndividual` from `test`.`t1` `a` semi join (`test`.`t3` `cona` join `test`.`t2` `c`) where ((`test`.`c`.`idContact` = `test`.`cona`.`idContact`) and (`test`.`a`.`idIndividual` = `test`.`c`.`idObj`) and (`test`.`cona`.`postalStripped` = 'T2H3B2')) +Note 1003 /* select#1 */ select `test`.`a`.`idIndividual` AS `idIndividual` from `test`.`t1` `a` semi join (`test`.`t3` `cona` join `test`.`t2` `c`) where ((`test`.`c`.`idContact` = `test`.`cona`.`idContact`) and (`test`.`a`.`idIndividual` = ``.`idObj`) and (`test`.`cona`.`postalStripped` = 'T2H3B2')) drop table t1,t2,t3; CREATE TABLE t1 (one int, two int, flag char(1)); CREATE TABLE t2 (one int, two int, flag char(1)); @@ -6956,8 +6964,8 @@ and t2.uid=t1.fid; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary 1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index -1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 End temporary -1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 9 Using where +1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 Using where +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 End temporary select name from t2, t1 where t1.uid in (select t4.uid from t4, t3 where t3.uid=1 and t4.uid=t3.fid) and t2.uid=t1.fid; @@ -7729,8 +7737,9 @@ WHERE col_varchar_key IN (SELECT col_varchar_nokey FROM t2) ORDER BY col_datetime_key LIMIT 4; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort; Start temporary -1 SIMPLE t1 ref col_varchar_key col_varchar_key 3 test.t2.col_varchar_nokey 1 End temporary +1 SIMPLE t1 ALL col_varchar_key NULL NULL NULL 20 Using where; Using filesort +1 SIMPLE eq_ref 3 test.t1.col_varchar_key 1 NULL +2 MATERIALIZED t2 ALL NULL NULL NULL NULL 6 NULL SELECT col_varchar_key FROM t1 WHERE col_varchar_key IN (SELECT col_varchar_nokey @@ -7802,9 +7811,10 @@ AND grandparent1.col_varchar_key IS NOT NULL ); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where -2 SUBQUERY parent1 ALL NULL NULL NULL NULL 20 Start temporary -2 SUBQUERY parent2 eq_ref PRIMARY PRIMARY 4 test.parent1.pk 1 Using index -2 SUBQUERY grandparent1 ref col_varchar_key col_varchar_key 3 test.parent1.col_varchar_nokey 1 Using where; End temporary +2 SUBQUERY ALL NULL NULL NULL NULL NULL NULL +2 SUBQUERY grandparent1 ref col_varchar_key col_varchar_key 3 .p1 1 Using where +3 MATERIALIZED parent1 ALL NULL NULL NULL NULL 20 NULL +3 MATERIALIZED parent2 eq_ref PRIMARY PRIMARY 4 test.parent1.pk 1 Using index SELECT * FROM t1 WHERE g1 NOT IN @@ -10670,6 +10680,95 @@ p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); ID 126 DROP TABLE t1,t2; +# +# Bug#18194196: OPTIMIZER EXECUTES STATEMENT INPERFORMANT +# +CREATE TABLE t1 (uid INTEGER, fid INTEGER, INDEX(uid)); +INSERT INTO t1 VALUES +(1,1), (1,2), (1,3), (1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t2 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t2 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +CREATE TABLE t3 (uid INT, fid INT, INDEX(uid)); +INSERT INTO t3 VALUES +(1,1), (1,2), (1,3),(1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t4 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t4 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +ANALYZE TABLE t1,t2,t3,t4; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +test.t3 analyze status OK +test.t4 analyze status OK +EXPLAIN SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index +1 SIMPLE t1 ref uid uid 5 test.t3.fid 4 Using where; End temporary +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 NULL +FLUSH STATUS; +SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +name +A +B +C +D +E +F +G +H +A +B +I +SHOW STATUS LIKE '%handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 20 +Handler_read_last 0 +Handler_read_next 15 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 0 +DROP TABLE t1,t2,t3,t4; +# End of test for Bug#18194196 +# +# Bug#21184091 ASSERT `READ_ROWS >= 0.0' AT +# COST_MODEL_SERVER::TMPTABLE_READWRITE_COST() +# +CREATE TABLE t1 ( +col_int int(11), +pk int(11) NOT NULL, +col_int_key int(11) , +col_varchar varchar(1), +PRIMARY KEY (pk) +) ENGINE=MyISAM; +CREATE TABLE t2 ( +col_int int(11), +col_varchar varchar(1) +) ENGINE=MyISAM; +INSERT INTO t2 VALUES (19,'x'); +INSERT INTO t2 VALUES (20,'z'); +SELECT table1.col_varchar +FROM (t2 AS table1 RIGHT JOIN +((t2 STRAIGHT_JOIN t1 ON (t1.col_varchar = t2.col_varchar))) +ON (t1.pk = t2.col_int)) +WHERE (t1.pk IN (SELECT t1.col_int_key +FROM (t1 INNER JOIN t2 ON (t2.col_int = t1.col_int)))) +AND table1.col_varchar != 'q'; +col_varchar +DROP TABLE t1,t2; +# End of test for Bug#21184091 set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_bkaunique.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_bkaunique.result index 48dda601..d7d4d0f5 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_bkaunique.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_bkaunique.result @@ -3004,42 +3004,48 @@ EXPLAIN { "query_block": { "select_id": 1, - "duplicates_removal": { - "using_temporary_table": true, - "nested_loop": [ - { - "table": { - "table_name": "t11", - "access_type": "ALL", - "rows": 8, - "filtered": 100 - } - }, - { - "table": { - "table_name": "t1", - "access_type": "eq_ref", - "possible_keys": [ - "PRIMARY" - ], - "key": "PRIMARY", - "used_key_parts": [ - "a" - ], - "key_length": "4", - "ref": [ - "test.t11.a" - ], - "rows": 1, - "filtered": 100 + "nested_loop": [ + { + "table": { + "table_name": "", + "access_type": "ALL", + "materialized_from_subquery": { + "using_temporary_table": true, + "query_block": { + "table": { + "table_name": "t11", + "access_type": "ALL", + "rows": 8, + "filtered": 100 + } + } } } - ] - } + }, + { + "table": { + "table_name": "t1", + "access_type": "eq_ref", + "possible_keys": [ + "PRIMARY" + ], + "key": "PRIMARY", + "used_key_parts": [ + "a" + ], + "key_length": "4", + "ref": [ + ".a" + ], + "rows": 1, + "filtered": 100 + } + } + ] } } Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` semi join (`test`.`t11`) where (`test`.`t1`.`a` = `test`.`t11`.`a`) +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` semi join (`test`.`t11`) where (`test`.`t1`.`a` = ``.`a`) select t21.* from t21,t22 where t21.a = t22.a and t22.a in (select t12.a from t11, t12 where t11.a in(255,256) and t11.a = t12.a and t11.c is null) and t22.c is null order by t21.a; a b c @@ -3294,8 +3300,9 @@ create table t3 ( a int , filler char(100), key(a)); insert into t3 select A.a + 10*B.a, 'filler' from t0 A, t0 B; explain select * from t3 where a in (select a from t2) and (a > 5 or a < 10); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where; Start temporary -1 SIMPLE t3 ref a a 5 test.t2.a 1 End temporary +1 SIMPLE ALL NULL NULL NULL NULL NULL Using where +1 SIMPLE t3 ref a a 5 .a 1 NULL +2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 NULL select * from t3 where a in (select a from t2); a filler 1 filler @@ -5832,11 +5839,12 @@ INNER JOIN t2 c ON c.idContact=cona.idContact WHERE cona.postalStripped='T2H3B2' ); id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE cona ALL NULL NULL NULL NULL 2 100.00 Using where; Start temporary -1 SIMPLE c eq_ref PRIMARY PRIMARY 4 test.cona.idContact 1 100.00 Using where -1 SIMPLE a eq_ref PRIMARY PRIMARY 4 test.c.idObj 1 100.00 Using index; End temporary +1 SIMPLE ALL NULL NULL NULL NULL NULL 0.00 NULL +1 SIMPLE a index PRIMARY PRIMARY 4 NULL 2 100.00 Using where; Using index; Using join buffer (Block Nested Loop) +2 MATERIALIZED cona ALL NULL NULL NULL NULL 2 100.00 Using where +2 MATERIALIZED c eq_ref PRIMARY PRIMARY 4 test.cona.idContact 1 100.00 NULL Warnings: -Note 1003 /* select#1 */ select `test`.`a`.`idIndividual` AS `idIndividual` from `test`.`t1` `a` semi join (`test`.`t3` `cona` join `test`.`t2` `c`) where ((`test`.`c`.`idContact` = `test`.`cona`.`idContact`) and (`test`.`a`.`idIndividual` = `test`.`c`.`idObj`) and (`test`.`cona`.`postalStripped` = 'T2H3B2')) +Note 1003 /* select#1 */ select `test`.`a`.`idIndividual` AS `idIndividual` from `test`.`t1` `a` semi join (`test`.`t3` `cona` join `test`.`t2` `c`) where ((`test`.`c`.`idContact` = `test`.`cona`.`idContact`) and (`test`.`a`.`idIndividual` = ``.`idObj`) and (`test`.`cona`.`postalStripped` = 'T2H3B2')) drop table t1,t2,t3; CREATE TABLE t1 (one int, two int, flag char(1)); CREATE TABLE t2 (one int, two int, flag char(1)); @@ -6969,8 +6977,8 @@ and t2.uid=t1.fid; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary 1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index -1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 End temporary -1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 9 Using where; Using join buffer (Block Nested Loop) +1 SIMPLE t1 ref uid uid 5 test.t3.fid 2 Using where +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 End temporary select name from t2, t1 where t1.uid in (select t4.uid from t4, t3 where t3.uid=1 and t4.uid=t3.fid) and t2.uid=t1.fid; @@ -7742,8 +7750,9 @@ WHERE col_varchar_key IN (SELECT col_varchar_nokey FROM t2) ORDER BY col_datetime_key LIMIT 4; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort; Start temporary -1 SIMPLE t1 ref col_varchar_key col_varchar_key 3 test.t2.col_varchar_nokey 1 End temporary +1 SIMPLE t1 ALL col_varchar_key NULL NULL NULL 20 Using where; Using filesort +1 SIMPLE eq_ref 3 test.t1.col_varchar_key 1 NULL +2 MATERIALIZED t2 ALL NULL NULL NULL NULL 6 NULL SELECT col_varchar_key FROM t1 WHERE col_varchar_key IN (SELECT col_varchar_nokey @@ -7815,9 +7824,10 @@ AND grandparent1.col_varchar_key IS NOT NULL ); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where -2 SUBQUERY parent1 ALL NULL NULL NULL NULL 20 Start temporary -2 SUBQUERY parent2 eq_ref PRIMARY PRIMARY 4 test.parent1.pk 1 Using index -2 SUBQUERY grandparent1 ref col_varchar_key col_varchar_key 3 test.parent1.col_varchar_nokey 1 Using where; End temporary +2 SUBQUERY ALL NULL NULL NULL NULL NULL NULL +2 SUBQUERY grandparent1 ref col_varchar_key col_varchar_key 3 .p1 1 Using where +3 MATERIALIZED parent1 ALL NULL NULL NULL NULL 20 NULL +3 MATERIALIZED parent2 eq_ref PRIMARY PRIMARY 4 test.parent1.pk 1 Using index SELECT * FROM t1 WHERE g1 NOT IN @@ -10687,6 +10697,95 @@ p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); ID 126 DROP TABLE t1,t2; +# +# Bug#18194196: OPTIMIZER EXECUTES STATEMENT INPERFORMANT +# +CREATE TABLE t1 (uid INTEGER, fid INTEGER, INDEX(uid)); +INSERT INTO t1 VALUES +(1,1), (1,2), (1,3), (1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t2 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t2 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +CREATE TABLE t3 (uid INT, fid INT, INDEX(uid)); +INSERT INTO t3 VALUES +(1,1), (1,2), (1,3),(1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t4 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t4 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +ANALYZE TABLE t1,t2,t3,t4; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +test.t3 analyze status OK +test.t4 analyze status OK +EXPLAIN SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ref uid uid 5 const 4 Using where; Start temporary +1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index +1 SIMPLE t1 ALL uid NULL NULL NULL 11 Using where; End temporary; Using join buffer (Block Nested Loop) +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 NULL +FLUSH STATUS; +SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +name +A +B +C +D +E +F +G +H +A +B +I +SHOW STATUS LIKE '%handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 16 +Handler_read_last 0 +Handler_read_next 4 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 12 +DROP TABLE t1,t2,t3,t4; +# End of test for Bug#18194196 +# +# Bug#21184091 ASSERT `READ_ROWS >= 0.0' AT +# COST_MODEL_SERVER::TMPTABLE_READWRITE_COST() +# +CREATE TABLE t1 ( +col_int int(11), +pk int(11) NOT NULL, +col_int_key int(11) , +col_varchar varchar(1), +PRIMARY KEY (pk) +) ENGINE=MyISAM; +CREATE TABLE t2 ( +col_int int(11), +col_varchar varchar(1) +) ENGINE=MyISAM; +INSERT INTO t2 VALUES (19,'x'); +INSERT INTO t2 VALUES (20,'z'); +SELECT table1.col_varchar +FROM (t2 AS table1 RIGHT JOIN +((t2 STRAIGHT_JOIN t1 ON (t1.col_varchar = t2.col_varchar))) +ON (t1.pk = t2.col_int)) +WHERE (t1.pk IN (SELECT t1.col_int_key +FROM (t1 INNER JOIN t2 ON (t2.col_int = t1.col_int)))) +AND table1.col_varchar != 'q'; +col_varchar +DROP TABLE t1,t2; +# End of test for Bug#21184091 set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_nosj.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_nosj.result index 6d169a9c..46aa563b 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_nosj.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_mat_nosj.result @@ -10451,6 +10451,95 @@ p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); ID 126 DROP TABLE t1,t2; +# +# Bug#18194196: OPTIMIZER EXECUTES STATEMENT INPERFORMANT +# +CREATE TABLE t1 (uid INTEGER, fid INTEGER, INDEX(uid)); +INSERT INTO t1 VALUES +(1,1), (1,2), (1,3), (1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t2 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t2 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +CREATE TABLE t3 (uid INT, fid INT, INDEX(uid)); +INSERT INTO t3 VALUES +(1,1), (1,2), (1,3),(1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t4 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t4 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +ANALYZE TABLE t1,t2,t3,t4; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +test.t3 analyze status OK +test.t4 analyze status OK +EXPLAIN SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 11 Using where +1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 NULL +2 SUBQUERY t3 ref uid uid 5 const 4 Using where +2 SUBQUERY t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index +FLUSH STATUS; +SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +name +A +B +C +D +E +F +G +H +A +B +I +SHOW STATUS LIKE '%handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 19 +Handler_read_last 0 +Handler_read_next 4 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 12 +DROP TABLE t1,t2,t3,t4; +# End of test for Bug#18194196 +# +# Bug#21184091 ASSERT `READ_ROWS >= 0.0' AT +# COST_MODEL_SERVER::TMPTABLE_READWRITE_COST() +# +CREATE TABLE t1 ( +col_int int(11), +pk int(11) NOT NULL, +col_int_key int(11) , +col_varchar varchar(1), +PRIMARY KEY (pk) +) ENGINE=MyISAM; +CREATE TABLE t2 ( +col_int int(11), +col_varchar varchar(1) +) ENGINE=MyISAM; +INSERT INTO t2 VALUES (19,'x'); +INSERT INTO t2 VALUES (20,'z'); +SELECT table1.col_varchar +FROM (t2 AS table1 RIGHT JOIN +((t2 STRAIGHT_JOIN t1 ON (t1.col_varchar = t2.col_varchar))) +ON (t1.pk = t2.col_int)) +WHERE (t1.pk IN (SELECT t1.col_int_key +FROM (t1 INNER JOIN t2 ON (t2.col_int = t1.col_int)))) +AND table1.col_varchar != 'q'; +col_varchar +DROP TABLE t1,t2; +# End of test for Bug#21184091 set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_none.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_none.result index cf5d6bf6..90d4a19c 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_none.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_none.result @@ -10460,6 +10460,95 @@ p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); ID 126 DROP TABLE t1,t2; +# +# Bug#18194196: OPTIMIZER EXECUTES STATEMENT INPERFORMANT +# +CREATE TABLE t1 (uid INTEGER, fid INTEGER, INDEX(uid)); +INSERT INTO t1 VALUES +(1,1), (1,2), (1,3), (1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t2 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t2 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +CREATE TABLE t3 (uid INT, fid INT, INDEX(uid)); +INSERT INTO t3 VALUES +(1,1), (1,2), (1,3),(1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t4 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t4 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +ANALYZE TABLE t1,t2,t3,t4; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +test.t3 analyze status OK +test.t4 analyze status OK +EXPLAIN SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 11 Using where +1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 NULL +2 DEPENDENT SUBQUERY t4 eq_ref PRIMARY PRIMARY 4 func 1 Using index +2 DEPENDENT SUBQUERY t3 ref uid uid 5 const 4 Using where +FLUSH STATUS; +SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +name +A +B +C +D +E +F +G +H +A +B +I +SHOW STATUS LIKE '%handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 33 +Handler_read_last 0 +Handler_read_next 10 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 12 +DROP TABLE t1,t2,t3,t4; +# End of test for Bug#18194196 +# +# Bug#21184091 ASSERT `READ_ROWS >= 0.0' AT +# COST_MODEL_SERVER::TMPTABLE_READWRITE_COST() +# +CREATE TABLE t1 ( +col_int int(11), +pk int(11) NOT NULL, +col_int_key int(11) , +col_varchar varchar(1), +PRIMARY KEY (pk) +) ENGINE=MyISAM; +CREATE TABLE t2 ( +col_int int(11), +col_varchar varchar(1) +) ENGINE=MyISAM; +INSERT INTO t2 VALUES (19,'x'); +INSERT INTO t2 VALUES (20,'z'); +SELECT table1.col_varchar +FROM (t2 AS table1 RIGHT JOIN +((t2 STRAIGHT_JOIN t1 ON (t1.col_varchar = t2.col_varchar))) +ON (t1.pk = t2.col_int)) +WHERE (t1.pk IN (SELECT t1.col_int_key +FROM (t1 INNER JOIN t2 ON (t2.col_int = t1.col_int)))) +AND table1.col_varchar != 'q'; +col_varchar +DROP TABLE t1,t2; +# End of test for Bug#21184091 set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_none_bka.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_none_bka.result index 65efb8c1..27eb308f 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_none_bka.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_none_bka.result @@ -10461,6 +10461,95 @@ p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); ID 126 DROP TABLE t1,t2; +# +# Bug#18194196: OPTIMIZER EXECUTES STATEMENT INPERFORMANT +# +CREATE TABLE t1 (uid INTEGER, fid INTEGER, INDEX(uid)); +INSERT INTO t1 VALUES +(1,1), (1,2), (1,3), (1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t2 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t2 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +CREATE TABLE t3 (uid INT, fid INT, INDEX(uid)); +INSERT INTO t3 VALUES +(1,1), (1,2), (1,3),(1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t4 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t4 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +ANALYZE TABLE t1,t2,t3,t4; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +test.t3 analyze status OK +test.t4 analyze status OK +EXPLAIN SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 11 Using where +1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 NULL +2 DEPENDENT SUBQUERY t4 eq_ref PRIMARY PRIMARY 4 func 1 Using index +2 DEPENDENT SUBQUERY t3 ref uid uid 5 const 4 Using where +FLUSH STATUS; +SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +name +A +B +C +D +E +F +G +H +A +B +I +SHOW STATUS LIKE '%handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 33 +Handler_read_last 0 +Handler_read_next 10 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 12 +DROP TABLE t1,t2,t3,t4; +# End of test for Bug#18194196 +# +# Bug#21184091 ASSERT `READ_ROWS >= 0.0' AT +# COST_MODEL_SERVER::TMPTABLE_READWRITE_COST() +# +CREATE TABLE t1 ( +col_int int(11), +pk int(11) NOT NULL, +col_int_key int(11) , +col_varchar varchar(1), +PRIMARY KEY (pk) +) ENGINE=MyISAM; +CREATE TABLE t2 ( +col_int int(11), +col_varchar varchar(1) +) ENGINE=MyISAM; +INSERT INTO t2 VALUES (19,'x'); +INSERT INTO t2 VALUES (20,'z'); +SELECT table1.col_varchar +FROM (t2 AS table1 RIGHT JOIN +((t2 STRAIGHT_JOIN t1 ON (t1.col_varchar = t2.col_varchar))) +ON (t1.pk = t2.col_int)) +WHERE (t1.pk IN (SELECT t1.col_int_key +FROM (t1 INNER JOIN t2 ON (t2.col_int = t1.col_int)))) +AND table1.col_varchar != 'q'; +col_varchar +DROP TABLE t1,t2; +# End of test for Bug#21184091 set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_none_bka_nixbnl.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_none_bka_nixbnl.result index 8455f48f..217f7fb4 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_none_bka_nixbnl.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_none_bka_nixbnl.result @@ -10456,6 +10456,95 @@ p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); ID 126 DROP TABLE t1,t2; +# +# Bug#18194196: OPTIMIZER EXECUTES STATEMENT INPERFORMANT +# +CREATE TABLE t1 (uid INTEGER, fid INTEGER, INDEX(uid)); +INSERT INTO t1 VALUES +(1,1), (1,2), (1,3), (1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t2 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t2 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +CREATE TABLE t3 (uid INT, fid INT, INDEX(uid)); +INSERT INTO t3 VALUES +(1,1), (1,2), (1,3),(1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t4 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t4 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +ANALYZE TABLE t1,t2,t3,t4; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +test.t3 analyze status OK +test.t4 analyze status OK +EXPLAIN SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 11 Using where +1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 NULL +2 DEPENDENT SUBQUERY t4 eq_ref PRIMARY PRIMARY 4 func 1 Using index +2 DEPENDENT SUBQUERY t3 ref uid uid 5 const 4 Using where +FLUSH STATUS; +SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +name +A +B +C +D +E +F +G +H +A +B +I +SHOW STATUS LIKE '%handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 33 +Handler_read_last 0 +Handler_read_next 10 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 12 +DROP TABLE t1,t2,t3,t4; +# End of test for Bug#18194196 +# +# Bug#21184091 ASSERT `READ_ROWS >= 0.0' AT +# COST_MODEL_SERVER::TMPTABLE_READWRITE_COST() +# +CREATE TABLE t1 ( +col_int int(11), +pk int(11) NOT NULL, +col_int_key int(11) , +col_varchar varchar(1), +PRIMARY KEY (pk) +) ENGINE=MyISAM; +CREATE TABLE t2 ( +col_int int(11), +col_varchar varchar(1) +) ENGINE=MyISAM; +INSERT INTO t2 VALUES (19,'x'); +INSERT INTO t2 VALUES (20,'z'); +SELECT table1.col_varchar +FROM (t2 AS table1 RIGHT JOIN +((t2 STRAIGHT_JOIN t1 ON (t1.col_varchar = t2.col_varchar))) +ON (t1.pk = t2.col_int)) +WHERE (t1.pk IN (SELECT t1.col_int_key +FROM (t1 INNER JOIN t2 ON (t2.col_int = t1.col_int)))) +AND table1.col_varchar != 'q'; +col_varchar +DROP TABLE t1,t2; +# End of test for Bug#21184091 set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_none_bkaunique.result b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_none_bkaunique.result index c55f7179..6936ca24 100644 --- a/mysql-wsrep-5.6/mysql-test/r/subquery_sj_none_bkaunique.result +++ b/mysql-wsrep-5.6/mysql-test/r/subquery_sj_none_bkaunique.result @@ -10462,6 +10462,95 @@ p2, t1 p3 WHERE p0.id=p2.id6 AND p2.id7=p3.id)); ID 126 DROP TABLE t1,t2; +# +# Bug#18194196: OPTIMIZER EXECUTES STATEMENT INPERFORMANT +# +CREATE TABLE t1 (uid INTEGER, fid INTEGER, INDEX(uid)); +INSERT INTO t1 VALUES +(1,1), (1,2), (1,3), (1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t2 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t2 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +CREATE TABLE t3 (uid INT, fid INT, INDEX(uid)); +INSERT INTO t3 VALUES +(1,1), (1,2), (1,3),(1,4), +(2,5), (2,6), (2,7), (2,8), +(3,1), (3,2), (3,9); +CREATE TABLE t4 (uid INT PRIMARY KEY, name VARCHAR(128), INDEX(name)); +INSERT INTO t4 VALUES +(1, "A"), (2, "B"), (3, "C"), (4, "D"), (5, "E"), +(6, "F"), (7, "G"), (8, "H"), (9, "I"); +ANALYZE TABLE t1,t2,t3,t4; +Table Op Msg_type Msg_text +test.t1 analyze status OK +test.t2 analyze status OK +test.t3 analyze status OK +test.t4 analyze status OK +EXPLAIN SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 ALL NULL NULL NULL NULL 11 Using where +1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 NULL +2 DEPENDENT SUBQUERY t4 eq_ref PRIMARY PRIMARY 4 func 1 Using index +2 DEPENDENT SUBQUERY t3 ref uid uid 5 const 4 Using where +FLUSH STATUS; +SELECT name FROM t2, t1 +WHERE t1.uid IN (SELECT t4.uid FROM t4, t3 WHERE t3.uid=1 AND t4.uid=t3.fid) +AND t2.uid=t1.fid; +name +A +B +C +D +E +F +G +H +A +B +I +SHOW STATUS LIKE '%handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 33 +Handler_read_last 0 +Handler_read_next 10 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 12 +DROP TABLE t1,t2,t3,t4; +# End of test for Bug#18194196 +# +# Bug#21184091 ASSERT `READ_ROWS >= 0.0' AT +# COST_MODEL_SERVER::TMPTABLE_READWRITE_COST() +# +CREATE TABLE t1 ( +col_int int(11), +pk int(11) NOT NULL, +col_int_key int(11) , +col_varchar varchar(1), +PRIMARY KEY (pk) +) ENGINE=MyISAM; +CREATE TABLE t2 ( +col_int int(11), +col_varchar varchar(1) +) ENGINE=MyISAM; +INSERT INTO t2 VALUES (19,'x'); +INSERT INTO t2 VALUES (20,'z'); +SELECT table1.col_varchar +FROM (t2 AS table1 RIGHT JOIN +((t2 STRAIGHT_JOIN t1 ON (t1.col_varchar = t2.col_varchar))) +ON (t1.pk = t2.col_int)) +WHERE (t1.pk IN (SELECT t1.col_int_key +FROM (t1 INNER JOIN t2 ON (t2.col_int = t1.col_int)))) +AND table1.col_varchar != 'q'; +col_varchar +DROP TABLE t1,t2; +# End of test for Bug#21184091 set @@optimizer_switch=@old_opt_switch; # End of 5.6 tests set optimizer_switch=default; diff --git a/mysql-wsrep-5.6/mysql-test/r/table_open_cache_functionality.result b/mysql-wsrep-5.6/mysql-test/r/table_open_cache_functionality.result index 7f9121f2..a44bd322 100644 --- a/mysql-wsrep-5.6/mysql-test/r/table_open_cache_functionality.result +++ b/mysql-wsrep-5.6/mysql-test/r/table_open_cache_functionality.result @@ -1,3 +1,11 @@ +CALL mtr.add_suppression("innodb_open_files should not be greater than the open_files_limit."); +CALL mtr.add_suppression("Warning: you must raise the value of "); +CALL mtr.add_suppression(" InnoDB: Warning: too many (.*) files stay open"); +CALL mtr.add_suppression(" while the maximum"); +CALL mtr.add_suppression("InnoDB: allowed value would be 1."); +CALL mtr.add_suppression("InnoDB: You may need to raise the value of"); +CALL mtr.add_suppression(" innodb_open_files in"); +CALL mtr.add_suppression("InnoDB: my.cnf."); '#________________________VAR_05_table_open_cache__________________#' echo '##' --echo '#---------------------WL6372_VAR_5_01----------------------#' diff --git a/mysql-wsrep-5.6/mysql-test/r/trigger-trans.result b/mysql-wsrep-5.6/mysql-test/r/trigger-trans.result index 722ac798..cab7336c 100644 --- a/mysql-wsrep-5.6/mysql-test/r/trigger-trans.result +++ b/mysql-wsrep-5.6/mysql-test/r/trigger-trans.result @@ -195,3 +195,28 @@ b val 14 g drop trigger t1_after_insert; drop table t1,t2; +# +#Bug#19683834 SOME INNODB ERRORS CAUSES STORED FUNCTION +# AND TRIGGER HANDLERS TO BE IGNORED +#Code fixed in Bug#16041903 +CREATE TABLE t1 (id int unsigned PRIMARY KEY, val int DEFAULT 0) +ENGINE=InnoDB; +INSERT INTO t1 (id) VALUES (1), (2); +CREATE TABLE t2 (id int PRIMARY KEY); +CREATE TABLE t3 LIKE t2; +CREATE TRIGGER bef_insert BEFORE INSERT ON t2 FOR EACH ROW +BEGIN +DECLARE CONTINUE HANDLER FOR 1062 BEGIN END; +INSERT INTO t3 (id) VALUES (NEW.id); +INSERT INTO t3 (id) VALUES (NEW.id); +END// +START TRANSACTION; +UPDATE t1 SET val = val + 1; +connect con2,localhost,root,,test,,; +SET SESSION innodb_lock_wait_timeout = 2; +UPDATE t1 SET val = val + 1; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +INSERT INTO t2 (id) VALUES (1); +disconnect con2; +connection default; +DROP TABLE t3, t2, t1; diff --git a/mysql-wsrep-5.6/mysql-test/r/update.result b/mysql-wsrep-5.6/mysql-test/r/update.result index 881ccf7b..6de8cfad 100644 --- a/mysql-wsrep-5.6/mysql-test/r/update.result +++ b/mysql-wsrep-5.6/mysql-test/r/update.result @@ -593,3 +593,16 @@ Variable_name Value Handler_update 5 ROLLBACK; DROP TABLE t1, t2; +# Bug #21143080: UPDATE ON VARCHAR AND TEXT COLUMNS PRODUCE INCORRECT +# RESULTS +CREATE TABLE t1 (a VARCHAR(50), b TEXT, c CHAR(50)) ENGINE=INNODB; +INSERT INTO t1 (a, b, c) VALUES ('start trail', '', 'even longer string'); +UPDATE t1 SET b = a, a = 'inject'; +SELECT a, b FROM t1; +a b +inject start trail +UPDATE t1 SET b = c, c = 'inject'; +SELECT c, b FROM t1; +c b +inject even longer string +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/r/validate_password_plugin.result b/mysql-wsrep-5.6/mysql-test/r/validate_password_plugin.result index e0aef415..532cecc7 100644 --- a/mysql-wsrep-5.6/mysql-test/r/validate_password_plugin.result +++ b/mysql-wsrep-5.6/mysql-test/r/validate_password_plugin.result @@ -96,10 +96,7 @@ SET @@global.validate_password_special_char_count= 1; SET @@global.validate_password_policy=STRONG; SET PASSWORD FOR 'base_user'@'localhost'= PASSWORD('password1A#'); UPDATE mysql.user SET PASSWORD= PASSWORD('password1A#') WHERE user='base_user'; -UNINSTALL PLUGIN validate_password; -# restarting the server with dictionary file. -# Restart server. -INSTALL PLUGIN validate_password SONAME 'validate_password.so'; +SET @@global.validate_password_dictionary_file="MYSQL_ERRMSG_BASEDIR/dictionary.txt"; # password policy strong # default_file : dictionary.txt SET @@global.validate_password_policy=STRONG; @@ -161,4 +158,70 @@ DROP USER 'user2'@'localhost'; DROP USER 'base_user'@'localhost'; DROP USER 'user1'@'localhost'; DROP USER 'user'@'localhost'; +SET @@global.validate_password_length=default; +SET @@global.validate_password_number_count=default; +SET @@global.validate_password_mixed_case_count=default; +SET @@global.validate_password_special_char_count=default; +SET @@global.validate_password_policy=default; +SET @@global.validate_password_dictionary_file=default; +SELECT @@validate_password_length, +@@validate_password_number_count, +@@validate_password_mixed_case_count, +@@validate_password_special_char_count, +@@validate_password_policy, +@@validate_password_dictionary_file; +@@validate_password_length @@validate_password_number_count @@validate_password_mixed_case_count @@validate_password_special_char_count @@validate_password_policy @@validate_password_dictionary_file +8 1 1 1 MEDIUM NULL +# +# Bug#14588145 - NEED ABILITY TO FLUSH PASSWORD VALIDATION DICTIONARY FILE +# +SET @@global.validate_password_policy=STRONG; +# No dictionary file, password is accepted +CREATE USER 'user1'@'localhost' IDENTIFIED BY 'passWORD123#'; +SET @@global.validate_password_dictionary_file="MYSQLTEST_VARDIR/tmp/dictionary2.txt"; +# must return 3 +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS +WHERE VARIABLE_NAME = 'validate_password_dictionary_file_words_count'; +VARIABLE_VALUE +3 +SELECT VARIABLE_VALUE into @ts1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS +WHERE VARIABLE_NAME = "validate_password_dictionary_file_last_parsed"; +# check format of the TS +SELECT @ts1; +@ts1 +0000-00-00 00:00:00 +# must return 19 +SELECT LENGTH(@ts1); +LENGTH(@ts1) +19 +# must sleep for at least 1 sec so that the timestamps differ +SET @@global.validate_password_dictionary_file="MYSQLTEST_VARDIR/tmp/dictionary.txt"; +# must return 2 +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS +WHERE VARIABLE_NAME = 'validate_password_dictionary_file_words_count'; +VARIABLE_VALUE +2 +SELECT VARIABLE_VALUE into @ts2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS +WHERE VARIABLE_NAME = "validate_password_dictionary_file_last_parsed"; +# must return 1 +SELECT @ts1 <> @ts2; +@ts1 <> @ts2 +1 +CREATE USER 'user2'@'localhost' IDENTIFIED BY 'passWORD123#'; +ERROR HY000: Your password does not satisfy the current policy requirements +SET @@global.validate_password_dictionary_file=NULL; +# Cache flushed and no dictionary file is loaded +CREATE USER 'user2'@'localhost' IDENTIFIED BY 'passWORD123#'; +# Select commands to show that the validate_password lock is instrumented +SELECT NAME FROM performance_schema.setup_instruments WHERE NAME LIKE '%validate%'; +NAME +wait/synch/rwlock/validate/LOCK_dict_file +SELECT NAME FROM performance_schema.rwlock_instances WHERE NAME LIKE '%validate%'; +NAME +wait/synch/rwlock/validate/LOCK_dict_file +# cleanup +DROP USER 'user1'@'localhost', 'user2'@'localhost'; +SET @@global.validate_password_policy=DEFAULT; +# clean up after the test UNINSTALL PLUGIN validate_password; +End of tests diff --git a/mysql-wsrep-5.6/mysql-test/r/view.result b/mysql-wsrep-5.6/mysql-test/r/view.result index dc6fb575..f63c80ae 100644 --- a/mysql-wsrep-5.6/mysql-test/r/view.result +++ b/mysql-wsrep-5.6/mysql-test/r/view.result @@ -2402,28 +2402,28 @@ CREATE VIEW v1 AS SELECT id FROM t1; OPTIMIZE TABLE v1; Table Op Msg_type Msg_text test.v1 optimize Error 'test.v1' is not BASE TABLE -test.v1 optimize error Corrupt +test.v1 optimize status Operation failed ANALYZE TABLE v1; Table Op Msg_type Msg_text test.v1 analyze Error 'test.v1' is not BASE TABLE -test.v1 analyze error Corrupt +test.v1 analyze status Operation failed REPAIR TABLE v1; Table Op Msg_type Msg_text test.v1 repair Error 'test.v1' is not BASE TABLE -test.v1 repair error Corrupt +test.v1 repair status Operation failed DROP TABLE t1; OPTIMIZE TABLE v1; Table Op Msg_type Msg_text test.v1 optimize Error 'test.v1' is not BASE TABLE -test.v1 optimize error Corrupt +test.v1 optimize status Operation failed ANALYZE TABLE v1; Table Op Msg_type Msg_text test.v1 analyze Error 'test.v1' is not BASE TABLE -test.v1 analyze error Corrupt +test.v1 analyze status Operation failed REPAIR TABLE v1; Table Op Msg_type Msg_text test.v1 repair Error 'test.v1' is not BASE TABLE -test.v1 repair error Corrupt +test.v1 repair status Operation failed DROP VIEW v1; create definer = current_user() sql security invoker view v1 as select 1; show create view v1; @@ -4248,3 +4248,234 @@ SHOW CREATE VIEW v4; View Create View character_set_client collation_connection v4 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v4` AS (select 'BUG#14117018' AS `col1`) union all (select '' AS `col2`) union all (select '' AS `Name_exp_3`) latin1 latin1_swedish_ci DROP VIEW v1, v2, v3, v4; +CREATE TABLE t0(x INTEGER); +INSERT INTO t0 VALUES(0); +CREATE TABLE t1(a1 INTEGER PRIMARY KEY, b1 INTEGER); +CREATE TABLE t2(a2 INTEGER PRIMARY KEY, b2 INTEGER); +CREATE VIEW v0 AS SELECT DISTINCT x FROM t0; +CREATE VIEW vmat1 AS SELECT DISTINCT * FROM t1; +CREATE VIEW vmat2 AS SELECT DISTINCT * FROM t2; +CREATE VIEW vtt AS +SELECT * FROM t1 JOIN t2 ON t1.a1=t2.a2; +CREATE VIEW vtr AS +SELECT * FROM t1 JOIN vmat2 AS dt2 ON t1.a1=dt2.a2; +CREATE VIEW vtrd AS +SELECT * FROM t1 JOIN (SELECT DISTINCT * FROM t2) AS dt2 ON t1.a1=dt2.a2; +ERROR HY000: View's SELECT contains a subquery in the FROM clause +CREATE VIEW vrt AS +SELECT * FROM vmat1 AS dt1 JOIN t2 ON dt1.a1=t2.a2; +CREATE VIEW vrtd AS +SELECT * FROM (SELECT DISTINCT * FROM t1) AS dt1 JOIN t2 ON dt1.a1=t2.a2; +ERROR HY000: View's SELECT contains a subquery in the FROM clause +CREATE VIEW vrr AS +SELECT * FROM vmat1 AS dt1 JOIN vmat2 AS dt2 ON dt1.a1=dt2.a2; +CREATE VIEW vrrd AS +SELECT * FROM (SELECT DISTINCT * FROM t1) AS dt1 JOIN +(SELECT DISTINCT * FROM t2) AS dt2 ON dt1.a1=dt2.a2; +ERROR HY000: View's SELECT contains a subquery in the FROM clause +INSERT INTO vtt(a1,b1) VALUES (1,100); +INSERT INTO vtt(a2,b2) VALUES (1,100); +INSERT INTO vtr(a1,b1) VALUES (2,100); +ERROR HY000: The target table vtr of the INSERT is not insertable-into +INSERT INTO vtrd(a1,b1) VALUES (3,100); +ERROR 42S02: Table 'test.vtrd' doesn't exist +INSERT INTO vtr(a2,b2) VALUES (2,100); +ERROR HY000: The target table vtr of the INSERT is not insertable-into +INSERT INTO vtrd(a2,b2) VALUES (3,100); +ERROR 42S02: Table 'test.vtrd' doesn't exist +INSERT INTO vrt(a1,b1) VALUES (4,100); +ERROR HY000: The target table vrt of the INSERT is not insertable-into +INSERT INTO vrtd(a1,b1) VALUES (5,100); +ERROR 42S02: Table 'test.vrtd' doesn't exist +INSERT INTO vrt(a2,b2) VALUES (4,100); +ERROR HY000: The target table vrt of the INSERT is not insertable-into +INSERT INTO vrtd(a2,b2) VALUES (5,100); +ERROR 42S02: Table 'test.vrtd' doesn't exist +INSERT INTO vrr(a1,b1) VALUES (6,100); +ERROR HY000: The target table vrr of the INSERT is not insertable-into +INSERT INTO vrrd(a1,b1) VALUES (7,100); +ERROR 42S02: Table 'test.vrrd' doesn't exist +INSERT INTO vrr(a2,b2) VALUES (6,100); +ERROR HY000: The target table vrr of the INSERT is not insertable-into +INSERT INTO vrrd(a2,b2) VALUES (7,100); +ERROR 42S02: Table 'test.vrrd' doesn't exist +SELECT * FROM vtt; +a1 b1 a2 b2 +1 100 1 100 +DELETE FROM t1; +DELETE FROM t2; +INSERT INTO vtt(a1,b1) SELECT 1,100; +INSERT INTO vtt(a2,b2) SELECT 1,100; +INSERT INTO vtr(a1,b1) SELECT 2,100; +ERROR HY000: The target table vtr of the INSERT is not insertable-into +INSERT INTO vtrd(a1,b1) SELECT 3,100; +ERROR 42S02: Table 'test.vtrd' doesn't exist +INSERT INTO vtr(a2,b2) SELECT 2,100; +ERROR HY000: The target table vtr of the INSERT is not insertable-into +INSERT INTO vtrd(a2,b2) SELECT 3,100; +ERROR 42S02: Table 'test.vtrd' doesn't exist +INSERT INTO vrt(a1,b1) SELECT 4,100; +ERROR HY000: The target table vrt of the INSERT is not insertable-into +INSERT INTO vrtd(a1,b1) SELECT 5,100; +ERROR 42S02: Table 'test.vrtd' doesn't exist +INSERT INTO vrt(a2,b2) SELECT 4,100; +ERROR HY000: The target table vrt of the INSERT is not insertable-into +INSERT INTO vrtd(a2,b2) SELECT 5,100; +ERROR 42S02: Table 'test.vrtd' doesn't exist +INSERT INTO vrr(a1,b1) SELECT 6,100; +ERROR HY000: The target table vrr of the INSERT is not insertable-into +INSERT INTO vrrd(a1,b1) SELECT 7,100; +ERROR 42S02: Table 'test.vrrd' doesn't exist +INSERT INTO vrr(a2,b2) SELECT 6,100; +ERROR HY000: The target table vrr of the INSERT is not insertable-into +INSERT INTO vrrd(a2,b2) SELECT 7,100; +ERROR 42S02: Table 'test.vrrd' doesn't exist +SELECT * FROM vtt; +a1 b1 a2 b2 +1 100 1 100 +DELETE FROM t1; +DELETE FROM t2; +INSERT INTO t1 VALUES +(1,100), (2,100), (3,100), (4,100), (5,100), +(6,100), (7,100), (8,100), (9,100), (10,100), +(11,100), (12,100), (13,100), (14,100); +INSERT INTO t2 VALUES +(1,100), (2,100), (3,100), (4,100), (5,100), +(6,100), (7,100), (8,100), (9,100), (10,100), +(11,100), (12,100), (13,100), (14,100); +DELETE FROM vtt WHERE a1=1; +ERROR HY000: Can not delete from join view 'test.vtt' +DELETE FROM vtr WHERE a1=2; +ERROR HY000: Can not delete from join view 'test.vtr' +DELETE FROM vtrd WHERE a1=3; +ERROR 42S02: Table 'test.vtrd' doesn't exist +DELETE FROM vrt WHERE a1=4; +ERROR HY000: Can not delete from join view 'test.vrt' +DELETE FROM vrtd WHERE a1=5; +ERROR 42S02: Table 'test.vrtd' doesn't exist +DELETE FROM vrr WHERE a1=6; +ERROR HY000: Can not delete from join view 'test.vrr' +DELETE FROM vrrd WHERE a1=7; +ERROR 42S02: Table 'test.vrrd' doesn't exist +DELETE vtt FROM vtt WHERE a1=8; +ERROR HY000: Can not delete from join view 'test.vtt' +DELETE vtr FROM vtr WHERE a1=9; +ERROR HY000: Can not delete from join view 'test.vtr' +DELETE vtrd FROM vtrd WHERE a1=10; +ERROR 42S02: Table 'test.vtrd' doesn't exist +DELETE vrt FROM vrt WHERE a1=11; +ERROR HY000: Can not delete from join view 'test.vrt' +DELETE vrtd FROM vrtd WHERE a1=12; +ERROR 42S02: Table 'test.vrtd' doesn't exist +DELETE vrr FROM vrr WHERE a1=13; +ERROR HY000: Can not delete from join view 'test.vrr' +DELETE vrrd FROM vrrd WHERE a1=14; +ERROR 42S02: Table 'test.vrrd' doesn't exist +SELECT * FROM vtt; +a1 b1 a2 b2 +1 100 1 100 +2 100 2 100 +3 100 3 100 +4 100 4 100 +5 100 5 100 +6 100 6 100 +7 100 7 100 +8 100 8 100 +9 100 9 100 +10 100 10 100 +11 100 11 100 +12 100 12 100 +13 100 13 100 +14 100 14 100 +DELETE FROM t1; +DELETE FROM t2; +INSERT INTO t1 VALUES (1,100); +INSERT INTO t2 VALUES (1,100); +UPDATE vtt SET b1=b1+1 WHERE a1=1; +UPDATE vtt SET b2=b2+1 WHERE a2=1; +UPDATE vtr SET b1=b1+1 WHERE a1=1; +UPDATE vtrd SET b1=b1+1 WHERE a1=1; +ERROR 42S02: Table 'test.vtrd' doesn't exist +UPDATE vtr SET b2=b2+1 WHERE a2=1; +ERROR HY000: The target table dt2 of the UPDATE is not updatable +UPDATE vtrd SET b2=b2+1 WHERE a2=1; +ERROR 42S02: Table 'test.vtrd' doesn't exist +UPDATE vrt SET b1=b1+1 WHERE a1=1; +ERROR HY000: The target table dt1 of the UPDATE is not updatable +UPDATE vrtd SET b1=b1+1 WHERE a1=1; +ERROR 42S02: Table 'test.vrtd' doesn't exist +UPDATE vrt SET b2=b2+1 WHERE a2=1; +UPDATE vrtd SET b2=b2+1 WHERE a2=1; +ERROR 42S02: Table 'test.vrtd' doesn't exist +UPDATE vrr SET b1=b1+1 WHERE a1=1; +ERROR HY000: The target table dt1 of the UPDATE is not updatable +UPDATE vrrd SET b1=b1+1 WHERE a1=1; +ERROR 42S02: Table 'test.vrrd' doesn't exist +UPDATE vrr SET b2=b2+1 WHERE a2=1; +ERROR HY000: The target table dt2 of the UPDATE is not updatable +UPDATE vrrd SET b2=b2+1 WHERE a2=1; +ERROR 42S02: Table 'test.vrrd' doesn't exist +UPDATE vtt, v0 AS dt SET b1=b1+1 WHERE a1=1; +UPDATE vtt, v0 SET b2=b2+1 WHERE a2=1; +UPDATE vtr, v0 SET b1=b1+1 WHERE a1=1; +UPDATE vtrd, v0 SET b1=b1+1 WHERE a1=1; +ERROR 42S02: Table 'test.vtrd' doesn't exist +UPDATE vtr, v0 SET b2=b2+1 WHERE a2=1; +ERROR HY000: The target table dt2 of the UPDATE is not updatable +UPDATE vtrd, v0 SET b2=b2+1 WHERE a2=1; +ERROR 42S02: Table 'test.vtrd' doesn't exist +UPDATE vrt, v0 SET b1=b1+1 WHERE a1=1; +ERROR HY000: The target table dt1 of the UPDATE is not updatable +UPDATE vrtd, v0 SET b1=b1+1 WHERE a1=1; +ERROR 42S02: Table 'test.vrtd' doesn't exist +UPDATE vrt, v0 SET b2=b2+1 WHERE a2=1; +UPDATE vrtd, v0 SET b2=b2+1 WHERE a2=1; +ERROR 42S02: Table 'test.vrtd' doesn't exist +UPDATE vrr, v0 SET b1=b1+1 WHERE a1=1; +ERROR HY000: The target table dt1 of the UPDATE is not updatable +UPDATE vrrd, v0 SET b1=b1+1 WHERE a1=1; +ERROR 42S02: Table 'test.vrrd' doesn't exist +UPDATE vrr, v0 SET b2=b2+1 WHERE a2=1; +ERROR HY000: The target table dt2 of the UPDATE is not updatable +UPDATE vrrd, v0 SET b2=b2+1 WHERE a2=1; +ERROR 42S02: Table 'test.vrrd' doesn't exist +SELECT * FROM vtt; +a1 b1 a2 b2 +1 104 1 104 +DROP VIEW v0, vtt, vtr, vrt, vrr, vmat1, vmat2; +DROP TABLE t0, t1, t2; +# +# BUG#19886430: VIEW CREATION WITH NAMED COLUMNS, OVER UNION, +# IS REJECTED +# Without the patch, reports an error. +CREATE VIEW v1 (fld1, fld2) AS +SELECT 1 AS a, 2 AS b +UNION ALL +SELECT 1 AS a, 1 AS a; +# The column names are explicitly specified and not duplicates, hence +# succeeds. +CREATE VIEW v2 (fld1, fld2) AS +SELECT 1 AS a, 2 AS a +UNION ALL +SELECT 1 AS a, 1 AS a; +# The column name in the first SELECT are not duplicates, hence succeeds. +CREATE VIEW v3 AS +SELECT 1 AS a, 2 AS b +UNION ALL +SELECT 1 AS a, 1 AS a; +# Should report an error, since the explicitly specified column names are +# duplicates. +CREATE VIEW v4 (fld1, fld1) AS +SELECT 1 AS a, 2 AS b +UNION ALL +SELECT 1 AS a, 1 AS a; +ERROR 42S21: Duplicate column name 'fld1' +# Should report an error, since duplicate column name is specified in the +# First SELECT. +CREATE VIEW v4 AS +SELECT 1 AS a, 2 AS a +UNION ALL +SELECT 1 AS a, 1 AS a; +ERROR 42S21: Duplicate column name 'a' +# Cleanup +DROP VIEW v1, v2, v3; diff --git a/mysql-wsrep-5.6/mysql-test/r/xml.result b/mysql-wsrep-5.6/mysql-test/r/xml.result index 30aa77dd..07113eae 100644 --- a/mysql-wsrep-5.6/mysql-test/r/xml.result +++ b/mysql-wsrep-5.6/mysql-test/r/xml.result @@ -1164,3 +1164,21 @@ aa bb # # End of 5.5 tests # +# +# Bug#13358486 WEIGHT_STRING = MY_STRNXFRM_UNICODE: +# ASSERTION `SRC' FAILED +# +set names utf8; +do weight_string(extractvalue('','/*/a') level 1 reverse); +do char((weight_string(extractvalue((''),('tX')) level 7 desc)) using cp852); +set names default; +# +# Bug#22552615 EXTRACTVALUE RETURNS NULL WHEN NO MATCHING +# TEXT NODE IS FOUND FOR THE EXPRESSION +# +set @x = 'HOLA'; +set @y = 'Default Value'; +select ExtractValue( @x, '/MESSAGE/DATA2' ) into @y; +select @y; +@y + diff --git a/mysql-wsrep-5.6/mysql-test/std_data/binlog-header.log b/mysql-wsrep-5.6/mysql-test/std_data/binlog-header.log new file mode 100644 index 00000000..c415a57e Binary files /dev/null and b/mysql-wsrep-5.6/mysql-test/std_data/binlog-header.log differ diff --git a/mysql-wsrep-5.6/mysql-test/std_data/binlog_transaction_with_GTID.000001 b/mysql-wsrep-5.6/mysql-test/std_data/binlog_transaction_with_GTID.000001 new file mode 100644 index 00000000..e7d8af59 Binary files /dev/null and b/mysql-wsrep-5.6/mysql-test/std_data/binlog_transaction_with_GTID.000001 differ diff --git a/mysql-wsrep-5.6/mysql-test/std_data/binlog_transaction_with_anonymous_GTID.000001 b/mysql-wsrep-5.6/mysql-test/std_data/binlog_transaction_with_anonymous_GTID.000001 new file mode 100644 index 00000000..e0fac267 Binary files /dev/null and b/mysql-wsrep-5.6/mysql-test/std_data/binlog_transaction_with_anonymous_GTID.000001 differ diff --git a/mysql-wsrep-5.6/mysql-test/std_data/bug16171518_1.dat b/mysql-wsrep-5.6/mysql-test/std_data/bug16171518_1.dat new file mode 100644 index 00000000..b65b9359 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/std_data/bug16171518_1.dat @@ -0,0 +1,59 @@ + + + 0bc + def + ghi + jkl + + + 1no + + pqr + stu + + + + 2BC + DEF + GHI + JKL + + + 3NO + + PQR + STU + + + + + + + 6BC + DEF + + JKL + + + 7NO + PQR + STU + VWX + + + + 8bc + def + ghi + + + + 9kl + + mno + pqr + + + + + diff --git a/mysql-wsrep-5.6/mysql-test/std_data/bug16171518_2.dat b/mysql-wsrep-5.6/mysql-test/std_data/bug16171518_2.dat new file mode 100644 index 00000000..8a483337 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/std_data/bug16171518_2.dat @@ -0,0 +1,12 @@ + + + ABC + DEF + + + + GHI + + 123 + + diff --git a/mysql-wsrep-5.6/mysql-test/std_data/ca-cert-verify.pem b/mysql-wsrep-5.6/mysql-test/std_data/ca-cert-verify.pem new file mode 100644 index 00000000..21d6264a --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/std_data/ca-cert-verify.pem @@ -0,0 +1,20 @@ +-----BEGIN CERTIFICATE----- +MIIDWzCCAkOgAwIBAgIJAO/QdKLEDQdXMA0GCSqGSIb3DQEBCwUAMEQxCzAJBgNV +BAYTAklOMREwDwYDVQQIDAhLYXJuYXRrYTESMBAGA1UEBwwJQmFuZ2Fsb3JlMQ4w +DAYDVQQKDAVNeVNRTDAeFw0xNjAxMDUxMDA1MDhaFw0yNTExMTMxMDA1MDhaMEQx +CzAJBgNVBAYTAklOMREwDwYDVQQIDAhLYXJuYXRrYTESMBAGA1UEBwwJQmFuZ2Fs +b3JlMQ4wDAYDVQQKDAVNeVNRTDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBAKdOCuS2CzfBTJ2x8SAzY0J7cYJfNJvMDF1cvANnhkIhtnkWt/HZ5DJ9NxeX +q5h7FJLAi4gddqdk/tvQJw0V6gZepJr/mKVnMPivF5+oHPc9ZJQMX6B3FBNwWylm +ACd5GKx8I/H/MXyuhQTcoV//Ab+2pI8RHeYbBsm3lHH+tX7bRU6mUFjneqMpiCkb +JHt6BWZiWR10O6pMuGQ9+dDdsLhEV1fj3CctEPwW6rs4IZzD8xl5n+8cy7qu6eYH +Wt/snwsTzkrufeMRqTtqelxON9eoQwYOR1oH3vNEVlcbuoJAvaWOqBROUBdf12SP +TYSdP9nlRh7lTKQOywN4kYt6LqUCAwEAAaNQME4wHQYDVR0OBBYEFJ4c9tKaUU0P +EjBq5G207jjXI7RAMB8GA1UdIwQYMBaAFJ4c9tKaUU0PEjBq5G207jjXI7RAMAwG +A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBABRnUyj21oFi0SGJg/K5+8Lc +4n6OwVU/NgLOysIB0baIP/Rqeaze59xG/v9FPQgBlWcJK3RabOywx5bxAxdcus+1 +yp5j4h37Qq1/qkgqmevvdSAPa0OBQbLb+58/naV+ywUpCYZ6flLdCMH3fXuDSlSq +qrCznextjojtWbnzrBmCmJmXWGd2gSaJDvb90ZZp/Elt3vN1sgjW0M/JEkb4MJ1r +6nfD/FHr2lUwBHm2yk7Blovx7x4d/Ip3pglk63cNO/Rn0SBTdoVDS2LB9du3Phq2 +TZiL3NrRMGUNwmdaavyrJxaPq5D+Sfa4LYP3MMYD4KhLogNzIl299n5joyizlJw= +-----END CERTIFICATE----- diff --git a/mysql-wsrep-5.6/mysql-test/std_data/dtrace.d b/mysql-wsrep-5.6/mysql-test/std_data/dtrace.d new file mode 100644 index 00000000..4af7dc24 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/std_data/dtrace.d @@ -0,0 +1,119 @@ +/* + This Dtrace script is used by the test "dynamic_tracing.test" for + dynamic tracing. This script is executed in background by + "dynamic_tracing.test" and SQL queries are executed concurrently. When + any probe used in this script are hit then counter is incremented. After + hitting all the 8(exp_probe_hits) probes, summary containing probes enabled + and their hit state is printed. +*/ + +#pragma D option quiet + +short query_parse_start; +short query_parse_done; +short select_start; +short select_done; +short net_read_start; +short net_read_done; +short handler_rdlock_start; +short handler_rdlock_done; + +short tot_probe_hits; +short exp_probe_hits; + +BEGIN +{ + query_parse_start= 0; + query_parse_done= 0; + select_start= 0; + select_done= 0; + net_read_start= 0; + net_read_done= 0; + handler_rdlock_start= 0; + handler_rdlock_done= 0; + + tot_probe_hits= 0; + exp_probe_hits= 8; + printf("\n Dynamic tracing ...... started.\n"); +} + +mysql*:::query-parse-start +/query_parse_start == 0/ +{ + query_parse_start++; + tot_probe_hits++; +} + +mysql*:::query-parse-done +/query_parse_done == 0/ +{ + query_parse_done++; + tot_probe_hits++; +} + +mysql*:::select-start +/select_start == 0/ +{ + select_start++; + tot_probe_hits++; +} + +mysql*:::select-done +/select_done == 0/ +{ + select_done++; + tot_probe_hits++; +} + +mysql*:::net-read-start +/net_read_start == 0/ +{ + net_read_start++; + tot_probe_hits++; +} + +mysql*:::net-read-done +/net_read_done == 0/ +{ + net_read_done++; + tot_probe_hits++; +} + +mysql*:::handler-rdlock-start +/handler_rdlock_start == 0/ +{ + handler_rdlock_start++; + tot_probe_hits++; +} + +mysql*:::handler-rdlock-done +/handler_rdlock_done == 0/ +{ + handler_rdlock_done++; + tot_probe_hits++; +} + +mysql*:::query-parse-start, +mysql*:::query-parse-done, +mysql*:::select-start, +mysql*:::select-done, +mysql*:::net-read-start, +mysql*:::net-read-done, +mysql*:::handler-rdlock-start, +mysql*:::handler-rdlock-done +/tot_probe_hits >= exp_probe_hits/ +{ + printf("\n query-parse-start : %d", query_parse_start); + printf("\n query-parse-done : %d", query_parse_done); + printf("\n select-start : %d", select_start); + printf("\n select-done : %d", select_done); + printf("\n net-read-start : %d", net_read_start); + printf("\n net-read-done : %d", net_read_done); + printf("\n handler_rdlock_start : %d", handler_rdlock_start); + printf("\n handler_rdlock_done : %d", handler_rdlock_done); + printf("\n"); + printf("\n Expected probe hits : %d", exp_probe_hits); + printf("\n Actual probe hits : %d\n", tot_probe_hits); + printf("\n Dynamic tracing ...... completed.\n"); + exit(0); +} diff --git a/mysql-wsrep-5.6/mysql-test/std_data/galera-cert.pem b/mysql-wsrep-5.6/mysql-test/std_data/galera-cert.pem new file mode 100644 index 00000000..2996b330 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/std_data/galera-cert.pem @@ -0,0 +1,26 @@ +-----BEGIN CERTIFICATE----- +MIIDWTCCAkGgAwIBAgIJAIlW4JmZGnU4MA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNV +BAYTAkZJMRUwEwYDVQQHDAxEZWZhdWx0IENpdHkxHDAaBgNVBAoME0RlZmF1bHQg +Q29tcGFueSBMdGQwIBcNMTQxMDI0MDc1MTU1WhgPMzAxNDAyMjQwNzUxNTVaMEIx +CzAJBgNVBAYTAkZJMRUwEwYDVQQHDAxEZWZhdWx0IENpdHkxHDAaBgNVBAoME0Rl +ZmF1bHQgQ29tcGFueSBMdGQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +AQDDzU6xLZDD5rZENsOpTpTmqS8YisBaefU3ZeN7VJepZZ/7unM/1YLGJtuRh2Qa +MyTkvyjzf7bSFsDt9L5lfQwBBblVeWkrCvGnQmHDQQYB7JrSmFDPz9W9Mxf9Q2BW +B3lcoKXXJgMnWw0WGrt0lEdFp9gWbq8H9hwJdjpyyk4ZTIuucSOD4JUP3QFEhYU5 +kdcIbDRVw81J4eAZ6EdvbjDN05S7qWjW7rJTnCHAHEd18hcsMGwjpwhjEaSdhMrM +mhOeL8kuQV0fI8v2xfYBliIn9xBZGOVzySPzwFmQceORlW6F3V5w6mwFkmuXqXWX +Qo98swTu7mb89qVYmR71d3L3AgMBAAGjUDBOMB0GA1UdDgQWBBRdWet/kGNTyvXK +wuBdP/eSldOgWjAfBgNVHSMEGDAWgBRdWet/kGNTyvXKwuBdP/eSldOgWjAMBgNV +HRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQCcJpP+DR4AJxVelNTSZa+V38c+ +jgrMD2Ku2eU8NQlsjgMfNEU5Md/g7FpP8aCFzVf0kAAT7DxZmSE3uWXQbMXyVJmy +bF+qXinf71QzdWULm6sASoshC6wbHnXL9ZjWQ3gh1nqVgo3MmLQYrb3eJfKaaLoc +wpjhYxVxGFOx1ITN3jED64lUfoLHvR6NFbESYKAuAAzSNqX4HOQ3uGk2THM8JocZ +oH2+38d81Kd4HQ7DDDKS/isG0+rR60Ti1cMgu7OT7p1dZCwT/KQuI5eGjE9lubkc +yAJjaod4rVLdBri3XVvtySfS2+/75qUgv2TF7d/s7mxMq4DDt29yeKSUhZCs +-----END CERTIFICATE----- +-----BEGIN DH PARAMETERS----- +MIGHAoGBAJWyvKjE+s7OP4Lj1jXKGlJGWT4Vd5YaxPljihTsRe1aXkWAgsuwISXk +/TQ8Rx5Zmze7rtwtU0PoYxvuam9FMXYqhw2dVe4qRdeSX78DSiL/YBkQzaxlfWVy +RE9+9dzHbCtRVDlN7K1kA+mGWH4/r7NAu4Qm/003V0NTtMwQSqebAgEC +-----END DH PARAMETERS----- + diff --git a/mysql-wsrep-5.6/mysql-test/std_data/galera-key.pem b/mysql-wsrep-5.6/mysql-test/std_data/galera-key.pem new file mode 100644 index 00000000..c88c613c --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/std_data/galera-key.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDDzU6xLZDD5rZE +NsOpTpTmqS8YisBaefU3ZeN7VJepZZ/7unM/1YLGJtuRh2QaMyTkvyjzf7bSFsDt +9L5lfQwBBblVeWkrCvGnQmHDQQYB7JrSmFDPz9W9Mxf9Q2BWB3lcoKXXJgMnWw0W +Grt0lEdFp9gWbq8H9hwJdjpyyk4ZTIuucSOD4JUP3QFEhYU5kdcIbDRVw81J4eAZ +6EdvbjDN05S7qWjW7rJTnCHAHEd18hcsMGwjpwhjEaSdhMrMmhOeL8kuQV0fI8v2 +xfYBliIn9xBZGOVzySPzwFmQceORlW6F3V5w6mwFkmuXqXWXQo98swTu7mb89qVY +mR71d3L3AgMBAAECggEBAIMT0UdZSp1quL/nrYqNGa9kuSuDz4uCM3+3jNcGZVU4 +vCYHxpmINLi0UK8W5ROJA3zC4AZKjDgOlW93NXK5iKyyiUTIN3hiJi4jiVDuGbh2 +DZtH7mmAKAU1zCx2y2osLLmurfbe8qOJF7ShhrZfgWsHFujFhhUdU92dsTkhZ7EU +2NF8ScxCo4PbOJoHC3j0ApfwCMxUMAKZF5+08EeKYqK7OAXI79HeIvEbHn3cUDGm +bvg6ykwlz2UUO4sg+xdCmn1Bt36HF/4e973Y5fkE/vd9mryHIlu9t7GJgWyUiPr8 +BGEoAWDSpPOMd/b9ivtxh9Gd+LW/uitMuBIfrRPgz9kCgYEA+JqeeD2xqF2IzZyq +i1UqgKe3su2U2zhkgbu1h/1M/reNIZGylF0wFs3P+kNIB2NavmHjXcgSjdJzqRL9 +XEWfFJRmeARo9RTEQEVd8zp1Eo8ISeiksGgvbL4rrNIRR5V5MZytfISRiGCWN6jx +ulJ6EieQk5EcvknGlWpJY/bBsQ0CgYEAyaCLqrR38gVl2Z0t6YlhW/HWAwGt+lf4 +apN1AS4uykx7wRW2B0y9QUDfsrYeVlbbeRPP4UzPmJez+J2cweoIIeFFyo3KP2L7 +79E3EVYywjXhPg52F7OjFA4Bp970XclIC5Al7kDufSgwZmWdceSx4Jjc5ixyQEC8 +Ad0ThgP6yxMCgYAvC4OFmZcvF1Q2JLmZWGqMojB/KbqLqaZLbqwxqduSMEYC3kF/ +FgttpVEAOQ8+ZqzbbkbKjnwEXpkIm9FaTsqF6HdjquH5zw48Y2QeDSfudSbKZb4U +rAKdf3dgYvhmJYEjxFSIRcYMmsqSieQEsGrtWJNheYqI8AkmaVCuHBoXWQKBgQCj +daelNffD2wJuQNI28axfiRjSiSsNuQHpDTCfS1ydnxH5QGu5UUphO4HfdWv03SfC +6f/vDIGEmQBLvyOVxfDf3qzhAMCFUO8kxj1ZrcMq1dmMoNa2cmj0WkKXYNZFrmfd +D/jgRf3Ss6FBcoIJErnudp8nb8MUOibxb9RjIpjQxwKBgEliKaGN+/QkPTNJ4vXz +609CIilxpE+YVTzlv3YeZP5HqsJTJPS2ARIUr/Pjpbl3LHfYNeeGDCwgkJIK0JJH +iA1M51q6t3zG2y9gKmC15FF0jShoZkRgqBxqrSHAnrCo5t2C48ElxJ3FEU8T75sz +dlGTbkmR0Wm43Kh++dWICJ3g +-----END PRIVATE KEY----- diff --git a/mysql-wsrep-5.6/mysql-test/std_data/galera-upgrade-ca-cert.pem b/mysql-wsrep-5.6/mysql-test/std_data/galera-upgrade-ca-cert.pem new file mode 100644 index 00000000..13d27e84 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/std_data/galera-upgrade-ca-cert.pem @@ -0,0 +1,40 @@ +-----BEGIN CERTIFICATE----- +MIIDWTCCAkGgAwIBAgIJAIlW4JmZGnU4MA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNV +BAYTAkZJMRUwEwYDVQQHDAxEZWZhdWx0IENpdHkxHDAaBgNVBAoME0RlZmF1bHQg +Q29tcGFueSBMdGQwIBcNMTQxMDI0MDc1MTU1WhgPMzAxNDAyMjQwNzUxNTVaMEIx +CzAJBgNVBAYTAkZJMRUwEwYDVQQHDAxEZWZhdWx0IENpdHkxHDAaBgNVBAoME0Rl +ZmF1bHQgQ29tcGFueSBMdGQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +AQDDzU6xLZDD5rZENsOpTpTmqS8YisBaefU3ZeN7VJepZZ/7unM/1YLGJtuRh2Qa +MyTkvyjzf7bSFsDt9L5lfQwBBblVeWkrCvGnQmHDQQYB7JrSmFDPz9W9Mxf9Q2BW +B3lcoKXXJgMnWw0WGrt0lEdFp9gWbq8H9hwJdjpyyk4ZTIuucSOD4JUP3QFEhYU5 +kdcIbDRVw81J4eAZ6EdvbjDN05S7qWjW7rJTnCHAHEd18hcsMGwjpwhjEaSdhMrM +mhOeL8kuQV0fI8v2xfYBliIn9xBZGOVzySPzwFmQceORlW6F3V5w6mwFkmuXqXWX +Qo98swTu7mb89qVYmR71d3L3AgMBAAGjUDBOMB0GA1UdDgQWBBRdWet/kGNTyvXK +wuBdP/eSldOgWjAfBgNVHSMEGDAWgBRdWet/kGNTyvXKwuBdP/eSldOgWjAMBgNV +HRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQCcJpP+DR4AJxVelNTSZa+V38c+ +jgrMD2Ku2eU8NQlsjgMfNEU5Md/g7FpP8aCFzVf0kAAT7DxZmSE3uWXQbMXyVJmy +bF+qXinf71QzdWULm6sASoshC6wbHnXL9ZjWQ3gh1nqVgo3MmLQYrb3eJfKaaLoc +wpjhYxVxGFOx1ITN3jED64lUfoLHvR6NFbESYKAuAAzSNqX4HOQ3uGk2THM8JocZ +oH2+38d81Kd4HQ7DDDKS/isG0+rR60Ti1cMgu7OT7p1dZCwT/KQuI5eGjE9lubkc +yAJjaod4rVLdBri3XVvtySfS2+/75qUgv2TF7d/s7mxMq4DDt29yeKSUhZCs +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDVzCCAj+gAwIBAgIJALBO5bqmtlYkMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNV +BAYTAkZJMRUwEwYDVQQHDAxEZWZhdWx0IENpdHkxHDAaBgNVBAoME0RlZmF1bHQg +Q29tcGFueSBMdGQwHhcNMTUwNjI2MDcxMjQ1WhcNMjUwNTA0MDcxMjQ1WjBCMQsw +CQYDVQQGEwJGSTEVMBMGA1UEBwwMRGVmYXVsdCBDaXR5MRwwGgYDVQQKDBNEZWZh +dWx0IENvbXBhbnkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA +1DlcztIzSngGeTUFibj9GZ4ZO78ASpgYySZv/DRIVn/3hbF41ZRD/6uJlb5rf1R7 +fpFsurbXNDDxeap7b/Gz2XSQy96Dbm0SbsFSZttV/R2WtlT1Wf5n9ix6RLqhKSbg +nPyL2fsDaxtZh2uywGJEXhwXFtdx3deIo/tYivDfl5Tcsv0NnZY8Vg0boBRP+FEn +ReJOdSa5LLn+QJN2Xa+wutbLHe0hI6huKUXU2YUeBfgyk1nWol5241ZUDCgDsoaW +8r2YeJNHmNInd3wERbqFgFHsR4N1+Atcyrfn/uQSj9zrTPO/Pp51KpjWf/gjxjXP +biu5De50qZ4+U4no20EIOwIDAQABo1AwTjAdBgNVHQ4EFgQU3kSPGchrOoQJ5gq1 +mmV2HEra6GswHwYDVR0jBBgwFoAU3kSPGchrOoQJ5gq1mmV2HEra6GswDAYDVR0T +BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAfoBD64FJ9fAR19+vwueFGmpWNIqF +PzN7QmEpCMduV3DXuxYO73q2ikXgrVO5HWFz9IjNvzXbSRmWNzJGaZ3QYZ+Xx1JJ +8MrAOUr6djWuyD659f64dh/2jMxiQNoEHrknXm9HSqR5oJVwndFyr/zvSkYSRexE +KFciIprb9LOba9G3ZMBYBdqK+f3Ky16BMjaD6XfaTx+xjHk/8peSueXIQl+v2biz +zSfpEUa0dKCIxckrzD4JknDHFimTsrzlRftcg8t8piOXwZomFcnVunyGs2bJ/Npj +25c2e6sx7XSc5bUgPGuQcSGflZPLg9zWyJ69sVYUNAz+gqfvWfOOJuzPNg== +-----END CERTIFICATE----- diff --git a/mysql-wsrep-5.6/mysql-test/std_data/galera-upgrade-server-cert.pem b/mysql-wsrep-5.6/mysql-test/std_data/galera-upgrade-server-cert.pem new file mode 100644 index 00000000..3af8b1ae --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/std_data/galera-upgrade-server-cert.pem @@ -0,0 +1,20 @@ +-----BEGIN CERTIFICATE----- +MIIDVzCCAj+gAwIBAgIJALBO5bqmtlYkMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNV +BAYTAkZJMRUwEwYDVQQHDAxEZWZhdWx0IENpdHkxHDAaBgNVBAoME0RlZmF1bHQg +Q29tcGFueSBMdGQwHhcNMTUwNjI2MDcxMjQ1WhcNMjUwNTA0MDcxMjQ1WjBCMQsw +CQYDVQQGEwJGSTEVMBMGA1UEBwwMRGVmYXVsdCBDaXR5MRwwGgYDVQQKDBNEZWZh +dWx0IENvbXBhbnkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA +1DlcztIzSngGeTUFibj9GZ4ZO78ASpgYySZv/DRIVn/3hbF41ZRD/6uJlb5rf1R7 +fpFsurbXNDDxeap7b/Gz2XSQy96Dbm0SbsFSZttV/R2WtlT1Wf5n9ix6RLqhKSbg +nPyL2fsDaxtZh2uywGJEXhwXFtdx3deIo/tYivDfl5Tcsv0NnZY8Vg0boBRP+FEn +ReJOdSa5LLn+QJN2Xa+wutbLHe0hI6huKUXU2YUeBfgyk1nWol5241ZUDCgDsoaW +8r2YeJNHmNInd3wERbqFgFHsR4N1+Atcyrfn/uQSj9zrTPO/Pp51KpjWf/gjxjXP +biu5De50qZ4+U4no20EIOwIDAQABo1AwTjAdBgNVHQ4EFgQU3kSPGchrOoQJ5gq1 +mmV2HEra6GswHwYDVR0jBBgwFoAU3kSPGchrOoQJ5gq1mmV2HEra6GswDAYDVR0T +BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAfoBD64FJ9fAR19+vwueFGmpWNIqF +PzN7QmEpCMduV3DXuxYO73q2ikXgrVO5HWFz9IjNvzXbSRmWNzJGaZ3QYZ+Xx1JJ +8MrAOUr6djWuyD659f64dh/2jMxiQNoEHrknXm9HSqR5oJVwndFyr/zvSkYSRexE +KFciIprb9LOba9G3ZMBYBdqK+f3Ky16BMjaD6XfaTx+xjHk/8peSueXIQl+v2biz +zSfpEUa0dKCIxckrzD4JknDHFimTsrzlRftcg8t8piOXwZomFcnVunyGs2bJ/Npj +25c2e6sx7XSc5bUgPGuQcSGflZPLg9zWyJ69sVYUNAz+gqfvWfOOJuzPNg== +-----END CERTIFICATE----- diff --git a/mysql-wsrep-5.6/mysql-test/std_data/galera-upgrade-server-key.pem b/mysql-wsrep-5.6/mysql-test/std_data/galera-upgrade-server-key.pem new file mode 100644 index 00000000..d243c9e0 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/std_data/galera-upgrade-server-key.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDUOVzO0jNKeAZ5 +NQWJuP0Znhk7vwBKmBjJJm/8NEhWf/eFsXjVlEP/q4mVvmt/VHt+kWy6ttc0MPF5 +qntv8bPZdJDL3oNubRJuwVJm21X9HZa2VPVZ/mf2LHpEuqEpJuCc/IvZ+wNrG1mH +a7LAYkReHBcW13Hd14ij+1iK8N+XlNyy/Q2dljxWDRugFE/4USdF4k51Jrksuf5A +k3Zdr7C61ssd7SEjqG4pRdTZhR4F+DKTWdaiXnbjVlQMKAOyhpbyvZh4k0eY0id3 +fARFuoWAUexHg3X4C1zKt+f+5BKP3OtM878+nnUqmNZ/+CPGNc9uK7kN7nSpnj5T +iejbQQg7AgMBAAECggEBAJ4m7VG3db+uOGzFJY5fzEX1+qn6ibYNKJNmUJfrQmkr +zgLUoc7QQehbJhnwoN1v0OQebZ+rOC7NtnZLpNdkkPmhk3JKLTnykIT3DnhWRftt +vG2+XGUnYMQkmy1ywz0Omt6CmZnlJMQByrNPgBM8Z+SWHGLKRTHkOBCz82T/YjDr +wqug1Yv6W0wMNM/cikgoBldVG7hABCJuShjffIbUgVysK3dEPNywNAC78neoGECm +evPZOaIkWEr86SpAlwA6Yh+zTQZ03CXATcGonJdWJ015DvlKRv6QyRR0Q/Y1ONwb +f115kll15MJBEspFdSyhlMcVJlwO8WMaZ2qIzlQZmdECgYEA//P469QzX00L/urK +7IRvtSVu5CP/A/Wui90U4KoP7XgXIeExnEtzLVs1K7vjuzdpTyq+68XuC40gPcJW +RvoX229m6gRV8nC53UiV71jM8IvkyEqFYT/gfZC9KQCMSRJLtVnDMpZ3gMxAY6/5 +p20o616Au8DKFFetQV0aD4Hj1/MCgYEA1ENV1WkgvN6yItB77E9kN/vbKLRh0hrg +9xj0SmMXGYyDM9NpjbgbgJIZo3ukkBtp3kEY8P9JQZRcd1EcnnSrwTB7ChdInWkR +m/LpIZBEMqNQbeu4QSzZYYS6z4tcGGx43aHqzzNBZdnQnqhYL1CvlLwhkgX6oQCo +woXqyfMNKJkCgYEA63gD1NGPwWkcVBSlQxpDup8JeZE0Fux6++kUP+u0Y39LqLuH +7IXtHBkAvY9JXv8HPvHQWw/og2/97VNQFFQYhqPiRgBfIX9bPpx8c4l6YQISI8GL +G4CsglgZ7hK2/LJ8PAascWnD3xYJVqyaPNFMB90VCaW/Qx+2IKAKTaHtfskCgYBu +1f5C4pMqrCpeTXj4Cvis1wE4PwB5QnnH7SrakOVl/N4huLn8O2948lEa8Zwbd4UP +ffR1Gwh4iuzBjQQhpZBt30/QFBphv5RnVy7uzLMfsfF0hEqBFdcoubMGXqGnSzTN +nhfLO9thQJxTzFnH0xzr0FTDOAYH/h0g/eZ8r0JmuQKBgQDjhXM+hJ3Pkwua+Fnl +nZfY5MeSzkJki/9iwVo8rSDwmZS9Nsc83oZnddM7c2x63t+zYOAcMxsVCiByMDzo +5IB781HWRBGcU8TnW1b0bAnZimjKp/qsZ/Szr38rvImqG8TjzbcSD7w0SpyRQ/Ot +A7SZFkWYfem8/q/VImjU/CNbOQ== +-----END PRIVATE KEY----- diff --git a/mysql-wsrep-5.6/mysql-test/std_data/loadxml2.dat b/mysql-wsrep-5.6/mysql-test/std_data/loadxml2.dat index e1b29627..f0d966cf 100644 --- a/mysql-wsrep-5.6/mysql-test/std_data/loadxml2.dat +++ b/mysql-wsrep-5.6/mysql-test/std_data/loadxml2.dat @@ -10,8 +10,8 @@ 1 - line1 -line2 + line1 +line2 line3 diff --git a/mysql-wsrep-5.6/mysql-test/std_data/server-cert-verify-fail.pem b/mysql-wsrep-5.6/mysql-test/std_data/server-cert-verify-fail.pem new file mode 100644 index 00000000..4203425a --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/std_data/server-cert-verify-fail.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDJzCCAg8CAQEwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UEBhMCSU4xETAPBgNV +BAgMCEthcm5hdGthMRIwEAYDVQQHDAlCYW5nYWxvcmUxDjAMBgNVBAoMBU15U1FM +MB4XDTE2MDEwNTEwMDgyN1oXDTI1MTExMzEwMDgyN1owbzELMAkGA1UEBhMCSU4x +EjAQBgNVBAgMCTpLYXJuYXRrYTETMBEGA1UEBwwKOkJhbmdhbG9yZTEPMA0GA1UE +CgwGOk15U1FMMRcwFQYDVQQLDA4vQ049bG9jYWxob3N0LzENMAsGA1UEAwwEZmFp +bDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL3wnWuJodzZYq9TAJRm +HU7995FA3TEWdUinYTgGP79aTVQ4M9aeINlB6whWXOI8seh9Ja7C6kMzqOgYbgCl +WlDPAVJWktFYeWXOLxbpzh1KWkS6jBkWT02t7H7JcYbil7xjlJUxLz4UOOUDUDIP +6yqdA9VE3osESttjzj57Zm2xPqzbIHVJfORn7EexH4pryS7439p6i4XtfL31NJ8V +07M3j3a8GqbcEqXYvcUCrLnywDQ1igP817b6ta52nbgYWiqdn0mJs535UJ/p/rSl +D4Ae/6G3BSEY7whir6xY6vsd4KJ6w+wRCHnY0ky6OdDJVJLH1iqh7si7P3RBGkxw +Y7MCAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAggbw1jj2b7H5KDdeGJGIoOGkQAcs +GNSJussCfdk7qnzYXKmjyNppC86jjaOrXona5f+SNCuujdu86Tv8V69EH57k4lUc +DW7J4AD3vUb/tBzB0tsI/76Z4gm1XoCsnCGGpWd8GQAg/QNn/ZfJB2Vb/9ObN6rH +0HV7ouB6OGZSsb71+grKiN6mDyB1lZynCGvqBxOCKFISfcRbCNFHo/pONlHaNGPE +vjDH1bPZbEHj8owYgkdcQe0a8EbJYeQfm6fH8V8bmUcG7N60DrCnq4l1qwwVkh1S +7RpIDgrWkU+esIIdYZIIbtDxQP1Sm7kUh++7b+bcHnyw3KtDVSCw7MIedA== +-----END CERTIFICATE----- diff --git a/mysql-wsrep-5.6/mysql-test/std_data/server-cert-verify-pass.pem b/mysql-wsrep-5.6/mysql-test/std_data/server-cert-verify-pass.pem new file mode 100644 index 00000000..f8780f1f --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/std_data/server-cert-verify-pass.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDEzCCAfsCAQEwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UEBhMCSU4xETAPBgNV +BAgMCEthcm5hdGthMRIwEAYDVQQHDAlCYW5nYWxvcmUxDjAMBgNVBAoMBU15U1FM +MB4XDTE2MDEwNTEwMDU1OVoXDTI1MTExMzEwMDU1OVowWzELMAkGA1UEBhMCSU4x +EjAQBgNVBAgMCTpLYXJuYXRrYTETMBEGA1UEBwwKOkJhbmdhbG9yZTEPMA0GA1UE +CgwGOk15U1FMMRIwEAYDVQQDDAlsb2NhbGhvc3QwggEiMA0GCSqGSIb3DQEBAQUA +A4IBDwAwggEKAoIBAQDAmkbUwDe+nrqL8A8uwlIZk74HHCDjUAWrskKF9leEIQsB +5exFZ8JEo1u6mdR4laQWsxizGdTPqIEidkDyyEMh4+joHgyQEPD/G3rFVW8yEFHb +42O04O96BEPFXNPDRuX3MxI+lGbYDjxTS/WhVub4/3SqLjC28FJmEUXIHA0/A+c5 +hlYXK0u+aPAqXxHIjBgB4BxxHXZKqecmvR3LhXoVmhJmndsVfKajB27nDKc8/OTI +H2SXb6h3nRPDXRfwB/C5i+004tEsVeIgkYshcCgLSyDdeVieUP2pm3EAmDSjmtLF +6CgY/EBSfH+JCKFUk75bA4k8CCGzBfIeOcsKHwgFAgMBAAEwDQYJKoZIhvcNAQEL +BQADggEBAInDuHtDkeT6dkWmRJCP56c4xiQqib2QuYUuMSrAhf07xlLHc6iHnD2X +hCWCrja6uwF90DnPjeouKMAUe5txq/uKA8/Y/NfXN6nPiAeHLI0qnTv7Mr9TQ8zU +DNDwRz6onlI2cS4GhrwAnlpiaxu7AjMUWHtfBFGFrgn3PawjDQpsBZNcxw1QsLc0 +E0hFrWLOd0vDETEhoRge88N7a0jqK0Rd9cvRWnvjI+IsjQMLZzKufivIHPzI9K+9 +Wtp8iRHcaBr5DpsBjgsO7dqVRbsNyaWsdHdLt+CQSGXpv7P6fq3K6nJFTBeIgSfS +gflrHVKYZRkKDDDpX4yHNdnIqrvy4RU= +-----END CERTIFICATE----- diff --git a/mysql-wsrep-5.6/mysql-test/std_data/server-key-verify-fail.pem b/mysql-wsrep-5.6/mysql-test/std_data/server-key-verify-fail.pem new file mode 100644 index 00000000..af1ae1e3 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/std_data/server-key-verify-fail.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpQIBAAKCAQEAvfCda4mh3Nlir1MAlGYdTv33kUDdMRZ1SKdhOAY/v1pNVDgz +1p4g2UHrCFZc4jyx6H0lrsLqQzOo6BhuAKVaUM8BUlaS0Vh5Zc4vFunOHUpaRLqM +GRZPTa3sfslxhuKXvGOUlTEvPhQ45QNQMg/rKp0D1UTeiwRK22POPntmbbE+rNsg +dUl85GfsR7EfimvJLvjf2nqLhe18vfU0nxXTszePdrwaptwSpdi9xQKsufLANDWK +A/zXtvq1rnaduBhaKp2fSYmznflQn+n+tKUPgB7/obcFIRjvCGKvrFjq+x3gonrD +7BEIedjSTLo50MlUksfWKqHuyLs/dEEaTHBjswIDAQABAoIBAQCSUyNzDPydXvsf +hhoUOParPAvU4tuETYDdD9Vdi7Lgf3jDQOjulbNIq/ec3KuBvrBwIrk9APvn+YxO +AUP9S2Vgi5jBDeDdVgNv4n90b3pSJk2UVQJI8V72wN5Ibnf/KeErSKvWo6V5daq/ +AuZtKsZIdd3WFtA62HuyuBjTGc23Alj1C0EKnN0Rx1uBwDvx/OVQ266Us/x8jJqW +ZxIOfcvfNzBQEa5hAzbQCReVaC+rBLRAcMM2yGP7aDa+8cRkwuVlSqpX8CXBdLoU +PqmU49etcW72Rb1AFt9WgEu1Oh9UYbHFSB+FEbO8IGcGBsuYHf9zkxQyjpy/iKyT +H5dTu7YBAoGBAOWqEGepZVrfB+P6X18n3vbJhgYmF0sa0mCmwkFYgk36yNqsZ8at +lQjm5mbn4wjEKHIcQ/T1taq73W471M+PxMnn0WTwoG5jsyarZGgy6/95YXiyZtQe +qgA4P3aKkCteRP22DjG7uxmm9Hoqx8Z31vfRTLAHN1IEHPHHkg/J3gPTAoGBANO4 +aqKeY4vcDvVkvxVbADrw++tZGwA+RuxfO4HKKru59VdA2PsAxhXwb3Dfejwj7hYW +yE9edHjGpMr1+dpf8YJYs7qjajHe1HxBOYqQGHycIdw+Gv56R4HpaS9eW3x8l/Pi +b4xnAodv2qIriACOe7br+rll4wKX46Wt64zdvpShAoGAT0r3HQM0Vjp4u/J+qRjX +9za+yjKuiiS5i9snaG5JlujGHhG2Rrc5pHgsBk17alRnbnZp1BJdZZQ1MFEB+aO2 +mssp1YLqsRJFEU3NfdhO+MaMq6JUtFnd8fN5ndDbU83ZXgtUPUGGqKWm9OL+VHyd +wLQHmSL0q6F16Ngxirf0qjcCgYEAtSmiJVA+gdhk/FmeoBlkEwtNpM50Kjsf2PaM +Jrzk4Al5A5Y7lFvPI8q+sOio4XklKsWH1VJPe2EOdZUQnGlocE6SS+u03MN9Mm1l +XUl7inTXDGwgEQx0z5b4KE4nHlhGdauWI5+pLFbrz8RL9Z32AkneGnIyU2/AnW46 +lijQAMECgYEAmgp/88ndIw49RCtMhYhtXQ87AsEAP6kzXQyKppDkn0os+xI5igIL +i/UDxB33hx3yjrUZwoGDV9MwlMhZNX5Tf5bwjPmmh1NR6KdEpPt5AkklX4s6uil2 +Bxl1P5l1jl/PbEYtv5LDZKIPANWRzViMSIWqjUWlbdqE7/vjx+Oo+cc= +-----END RSA PRIVATE KEY----- diff --git a/mysql-wsrep-5.6/mysql-test/std_data/server-key-verify-pass.pem b/mysql-wsrep-5.6/mysql-test/std_data/server-key-verify-pass.pem new file mode 100644 index 00000000..7ecc44f6 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/std_data/server-key-verify-pass.pem @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEowIBAAKCAQEAwJpG1MA3vp66i/APLsJSGZO+Bxwg41AFq7JChfZXhCELAeXs +RWfCRKNbupnUeJWkFrMYsxnUz6iBInZA8shDIePo6B4MkBDw/xt6xVVvMhBR2+Nj +tODvegRDxVzTw0bl9zMSPpRm2A48U0v1oVbm+P90qi4wtvBSZhFFyBwNPwPnOYZW +FytLvmjwKl8RyIwYAeAccR12SqnnJr0dy4V6FZoSZp3bFXymowdu5wynPPzkyB9k +l2+od50Tw10X8AfwuYvtNOLRLFXiIJGLIXAoC0sg3XlYnlD9qZtxAJg0o5rSxego +GPxAUnx/iQihVJO+WwOJPAghswXyHjnLCh8IBQIDAQABAoIBAHPQUSc9LkgBSks7 +XuXPE28t1+aOk3gcdkx4NGg5aQaal/PcPea+LaL4WAAs4AZidPjxWLjZn43+1SfT +09opcbS/Rx3Mc+FtTn0YGQrwBJ0mExMV+K6bU2Ubi2TyHKQfzciHfUEEG5Nve/ba +hikuCFVRxuVOQRzABcw6NqvNsmlg892lfw6/+RDwMBcz7ocwzmiOUoIxgjyFo9G4 +aJvRmHLij5892H6qveik+A/Xr+8leGQHiQET2wW/F9MFP5ypIT7aeE6remeZH7fG +f4/Zfei/TE4xK2ElNR/91byzeKIVY4vjtTndAiBuqpfYuICb40MC02LNW5Oe6VN2 +3mQ6EgECgYEA7O4ndBnbs/00gyTGyNg6I+3wRTibhNH4R8RZFJiLfKRKOlUiLhUo ++bQeO4bCQ6YY++TYDvMEXTlA3jow9R9Mj2AWc6bNmQmJd/065QyFHftywT66I+V4 +rz1ohSJyHXcv4DxqNk3o3Vb4N8GFjZKcodSgTv2Lk+9ipDYFcQiZop0CgYEA0BrF +SIyLTnjoVht/7RbIGEqhMQUiz5mx7qQ1TPB+YTG77G2xXJNg5d6S7WT4LN+cqbxN +YdndIbW4NdV7bH7FlG9q7jfkuZ+AY2BPU047tcDeyO0HYYEhVY+EyZqHci/26mvt +JrawdqS5HQS1y/rKfytm7YBGTvqoNZHvOHc6aokCgYEAxcjlbJkte+pyzMuFmiJP +HrFBczeXM+BoJ9j0GCpjvvAS+vEYsGl/pDvFRSHwx7I/hv/5kTkzOnNSAHGJbwbq +zYGEHJVxakC43k6pvI2gDnBa0pD/qHmmLnvP5dvkcU6Oy90DOUP+kc9JNJo7V/y8 +/qdWD7q+qwcaTETAdCSexE0CgYA/DN1Y7bwHOnqqHArWOmDFe1b7EyNI4rgWJYpA +lVy09eyJ5XInKj/hZV3+rujCL723b2XCj89/tx7osJWEeaRDJL6xDh4uXzT25uch +xkIw/w6Asc/aqtT+p00EB92hqwaUX76qTA+K4r1zHUo3UvSnMu8sZgDnTOpJ0L05 +zmXUgQKBgDT+IFrAzOty4B0mJncTCC/TulpW704bEZwNJfQSdtiBQr/vqoXygBQc +bHfpncpSfhzHB5lhRUv02TqXgl53D70nM7JD5nx98WYTTBxsbvxPlt4gBRZkfgq5 +tHKclAArc1SbfW5Z8oYyl7h33LQJK116QSyiIIGieH5VXNPwnqUs +-----END RSA PRIVATE KEY----- diff --git a/mysql-wsrep-5.6/mysql-test/std_data/slave-relay-bin_linux.index b/mysql-wsrep-5.6/mysql-test/std_data/slave-relay-bin_linux.index new file mode 100644 index 00000000..13eac4c3 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/std_data/slave-relay-bin_linux.index @@ -0,0 +1 @@ +./slave-relay-bin.000001 diff --git a/mysql-wsrep-5.6/mysql-test/std_data/slave-relay-bin_win.index b/mysql-wsrep-5.6/mysql-test/std_data/slave-relay-bin_win.index new file mode 100644 index 00000000..b79f3b9e --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/std_data/slave-relay-bin_win.index @@ -0,0 +1 @@ +.\slave-relay-bin.000001 diff --git a/mysql-wsrep-5.6/mysql-test/std_data/wsrep_notify.sh b/mysql-wsrep-5.6/mysql-test/std_data/wsrep_notify.sh new file mode 100755 index 00000000..7036f603 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/std_data/wsrep_notify.sh @@ -0,0 +1,99 @@ +#!/bin/sh -eu + +# This is a simple example of wsrep notification script (wsrep_notify_cmd). +# It will create 'wsrep' schema and two tables in it: 'membeship' and 'status' +# and fill them on every membership or node status change. +# +# Edit parameters below to specify the address and login to server. + +USER=root +HOST=127.0.0.1 +PORT=$NODE_MYPORT_1 + +SCHEMA="mtr_wsrep_notify" +MEMB_TABLE="$SCHEMA.membership" +STATUS_TABLE="$SCHEMA.status" + +BEGIN=" +SET wsrep_on=0; +CREATE SCHEMA IF NOT EXISTS $SCHEMA; +CREATE TABLE IF NOT EXISTS $MEMB_TABLE ( + idx INT, + uuid CHAR(40), /* node UUID */ + name VARCHAR(32), /* node name */ + addr VARCHAR(256) /* node address */ +) ENGINE=MEMORY; +CREATE TABLE IF NOT EXISTS $STATUS_TABLE ( + size INT, /* component size */ + idx INT, /* this node index */ + status CHAR(16), /* this node status */ + uuid CHAR(40), /* cluster UUID */ + prim BOOLEAN /* if component is primary */ +) ENGINE=MEMORY; +BEGIN; +" +END="COMMIT;" + +configuration_change() +{ + echo "$BEGIN;" + + local idx=0 + + for NODE in $(echo $MEMBERS | sed s/,/\ /g) + do + echo "INSERT INTO $MEMB_TABLE VALUES ( $idx, " + # Don't forget to properly quote string values + echo "'$NODE'" | sed s/\\//\',\'/g + echo ");" + idx=$(( $idx + 1 )) + done + + echo "INSERT INTO $STATUS_TABLE VALUES($idx, $INDEX, '$STATUS', '$CLUSTER_UUID', $PRIMARY);" + + echo "$END" +} + +status_update() +{ + echo "SET wsrep_on=0; BEGIN; UPDATE $STATUS_TABLE SET status='$STATUS'; COMMIT;" +} + +COM=status_update # not a configuration change by default + +while [ $# -gt 0 ] +do + case $1 in + --status) + STATUS=$2 + shift + ;; + --uuid) + CLUSTER_UUID=$2 + shift + ;; + --primary) + [ "$2" = "yes" ] && PRIMARY="1" || PRIMARY="0" + COM=configuration_change + shift + ;; + --index) + INDEX=$2 + shift + ;; + --members) + MEMBERS=$2 + shift + ;; + esac + shift +done + +# Undefined means node is shutting down +if [ "$STATUS" != "Undefined" ] +then + $COM | mysql -B -u$USER -h$HOST -P$PORT +fi + +exit 0 +# diff --git a/mysql-wsrep-5.6/mysql-test/suite/auth_sec/r/cert_verify.result b/mysql-wsrep-5.6/mysql-test/suite/auth_sec/r/cert_verify.result new file mode 100644 index 00000000..1da77329 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/auth_sec/r/cert_verify.result @@ -0,0 +1,5 @@ +#T1: Host name (/CN=localhost/) as OU name in the server certificate, server certificate verification should fail. +#T2: Host name (localhost) as common name in the server certificate, server certificate verification should pass. +Variable_name Value +Ssl_version TLS_VERSION +# restart server using restart diff --git a/mysql-wsrep-5.6/mysql-test/suite/auth_sec/r/mysql_no_login.result b/mysql-wsrep-5.6/mysql-test/suite/auth_sec/r/mysql_no_login.result new file mode 100644 index 00000000..e732fa98 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/auth_sec/r/mysql_no_login.result @@ -0,0 +1,43 @@ +INSTALL PLUGIN mysql_no_login SONAME 'mysql_no_login.so'; +SELECT PLUGIN_NAME, PLUGIN_STATUS, PLUGIN_TYPE, PLUGIN_DESCRIPTION +FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'mysql_no_login'; +PLUGIN_NAME mysql_no_login +PLUGIN_STATUS ACTIVE +PLUGIN_TYPE AUTHENTICATION +PLUGIN_DESCRIPTION No login authentication plugin +Creating users noauth, otheruser +Creating view, procedure, function +# Connect as otheruser - should succeed. +user() current_user() @@proxy_user +otheruser@localhost otheruser@localhost NULL +a +2 +noauthdb.f1() +5 +# Attempt to access underlying tables directly using otheruser - should fail. +# Connect as noauth - should fail. +#try to set password of this plugin user with password function - should warn +SET PASSWORD FOR noauth@localhost = password(''); +Warnings: +Note 1699 SET PASSWORD has no significance for users authenticating via plugins +#try to set password of this plugin user with password hash - should warn +grant all on *.* to noauth@localhost identified by password '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29'; +Warnings: +Warning 1699 SET PASSWORD has no significance for users authenticating via plugins +#try to expire password of this plugin user - should warn +alter user noauth@localhost password expire; +ERROR HY000: Operation ALTER USER failed for 'noauth'@'localhost' +#uninstall plugin and try to login with this plugin user - should return error +uninstall plugin mysql_no_login; +# Connect as noauth - should fail. +INSTALL PLUGIN mysql_no_login SONAME 'mysql_no_login.so'; +Creating users noauth, otheruser +Creating view, procedure, function +# Connect as otheruser - should succeed. +user() current_user() @@proxy_user +otheruser@localhost otheruser@localhost NULL +a +2 +noauthdb.f1() +5 +# Attempt to access underlying tables directly using otheruser - should fail. diff --git a/mysql-wsrep-5.6/mysql-test/suite/auth_sec/t/cert_verify.test b/mysql-wsrep-5.6/mysql-test/suite/auth_sec/t/cert_verify.test new file mode 100644 index 00000000..1515fc62 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/auth_sec/t/cert_verify.test @@ -0,0 +1,45 @@ +# Want to skip this test from Valgrind execution +--source include/no_valgrind_without_big.inc +# This test should work in embedded server after we fix mysqltest +-- source include/not_embedded.inc +-- source include/have_ssl_communication.inc +# Save the initial number of concurrent sessions +--source include/count_sessions.inc + +let $ssl_verify_fail_path = --ssl --ssl-ca=$MYSQL_TEST_DIR/std_data/ca-cert-verify.pem --ssl-key=$MYSQL_TEST_DIR/std_data/server-key-verify-fail.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/server-cert-verify-fail.pem; +let $ssl_verify_pass_path = --ssl --ssl-ca=$MYSQL_TEST_DIR/std_data/ca-cert-verify.pem --ssl-key=$MYSQL_TEST_DIR/std_data/server-key-verify-pass.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/server-cert-verify-pass.pem; + +let $tls_default= TLSv1; + +--echo #T1: Host name (/CN=localhost/) as OU name in the server certificate, server certificate verification should fail. +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--shutdown_server +--source include/wait_until_disconnected.inc + +--exec echo "restart:" $ssl_verify_fail_path > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--enable_reconnect +--source include/wait_until_connected_again.inc + +--error 1 +--exec $MYSQL --protocol=tcp --ssl-ca=$MYSQL_TEST_DIR/std_data/ca-cert-verify.pem --ssl-verify-server-cert -e "SHOW STATUS like 'Ssl_version'" + +--echo #T2: Host name (localhost) as common name in the server certificate, server certificate verification should pass. +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--shutdown_server +--source include/wait_until_disconnected.inc + +--exec echo "restart:" $ssl_verify_pass_path > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--enable_reconnect +--source include/wait_until_connected_again.inc + +--replace_result $tls_default TLS_VERSION +--exec $MYSQL --protocol=tcp --ssl-ca=$MYSQL_TEST_DIR/std_data/ca-cert-verify.pem --ssl-verify-server-cert -e "SHOW STATUS like 'Ssl_version'" + +--echo # restart server using restart +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--shutdown_server +--source include/wait_until_disconnected.inc + +--exec echo "restart: " > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--enable_reconnect +--source include/wait_until_connected_again.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/auth_sec/t/mysql_no_login-master.opt b/mysql-wsrep-5.6/mysql-test/suite/auth_sec/t/mysql_no_login-master.opt new file mode 100644 index 00000000..abae27a5 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/auth_sec/t/mysql_no_login-master.opt @@ -0,0 +1 @@ +$MYSQL_NO_LOGIN_OPT diff --git a/mysql-wsrep-5.6/mysql-test/suite/auth_sec/t/mysql_no_login.test b/mysql-wsrep-5.6/mysql-test/suite/auth_sec/t/mysql_no_login.test new file mode 100644 index 00000000..594d6c61 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/auth_sec/t/mysql_no_login.test @@ -0,0 +1,128 @@ +# +# Testing MYSQL_NO_LOGIN authentication plugin. +# +--source include/have_mysql_no_login_plugin.inc +--source include/not_embedded.inc + +--replace_regex /\.dll/.so/ +eval INSTALL PLUGIN mysql_no_login SONAME '$MYSQL_NO_LOGIN'; + +query_vertical SELECT PLUGIN_NAME, PLUGIN_STATUS, PLUGIN_TYPE, PLUGIN_DESCRIPTION + FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'mysql_no_login'; + +--disable_query_log +CREATE DATABASE noauthdb; +CREATE TABLE noauthdb.t1 (a INT); +CREATE TABLE noauthdb.t2 (a INT); +INSERT INTO noauthdb.t1 VALUES (1), (2); +INSERT INTO noauthdb.t2 VALUES (3), (4); + +--echo Creating users noauth, otheruser +CREATE USER noauth@localhost IDENTIFIED WITH 'mysql_no_login'; +CREATE USER otheruser@localhost; +GRANT SELECT, UPDATE, INSERT ON noauthdb.* TO noauth@localhost; + +--echo Creating view, procedure, function +CREATE DEFINER = noauth@localhost SQL SECURITY DEFINER VIEW noauthdb.v1 AS SELECT * FROM noauthdb.t1 WHERE a % 2 = 0; +CREATE DEFINER = noauth@localhost PROCEDURE noauthdb.p1 () CONTAINS SQL SQL SECURITY DEFINER UPDATE noauthdb.t2 SET a = 5 WHERE a = 3; +delimiter //; +CREATE DEFINER = noauth@localhost FUNCTION noauthdb.f1() RETURNS INT CONTAINS SQL SQL SECURITY DEFINER +BEGIN +DECLARE outp INT DEFAULT NULL; +SELECT MAX(a) INTO outp FROM noauthdb.t2; +RETURN outp; +END// +delimiter ;// + +GRANT SELECT ON noauthdb.v1 TO otheruser@localhost; +GRANT EXECUTE ON noauthdb.* TO otheruser@localhost; +GRANT EXECUTE ON noauthdb.* TO noauth@localhost; + +--enable_query_log + +--echo # Connect as otheruser - should succeed. +--exec $MYSQL --user=otheruser -e "select user(), current_user(), @@proxy_user; SELECT * FROM noauthdb.v1; CALL noauthdb.p1(); SELECT noauthdb.f1();" + +--echo # Attempt to access underlying tables directly using otheruser - should fail. +--error 1, ER_TABLEACCESS_DENIED_ERROR +--exec $MYSQL --user=otheruser -e "SELECT * FROM noauthdb.t1;" + +--echo # Connect as noauth - should fail. +--error 1, ER_ACCESS_DENIED_ERROR +--exec $MYSQL --user=noauth -e "select user(), current_user(), @@proxy_user" + +--echo #try to set password of this plugin user with password function - should warn +SET PASSWORD FOR noauth@localhost = password(''); + +--echo #try to set password of this plugin user with password hash - should warn +grant all on *.* to noauth@localhost identified by password '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29'; + +--echo #try to expire password of this plugin user - should warn +--error ER_CANNOT_USER +alter user noauth@localhost password expire; + +--echo #uninstall plugin and try to login with this plugin user - should return error +uninstall plugin mysql_no_login; +--echo # Connect as noauth - should fail. +--error 1, ER_PLUGIN_IS_NOT_LOADED +--exec $MYSQL --user=noauth -e "select user(), current_user(), @@proxy_user" + +# Cleanup +--disable_query_log + +DROP DATABASE noauthdb; +DROP USER noauth@localhost; +DROP USER otheruser@localhost; + +--enable_query_log +##proxy related scenario +--replace_regex /\.dll/.so/ +eval INSTALL PLUGIN mysql_no_login SONAME '$MYSQL_NO_LOGIN'; +--disable_query_log +CREATE DATABASE noauthdb; +CREATE TABLE noauthdb.t1 (a INT); +CREATE TABLE noauthdb.t2 (a INT); +INSERT INTO noauthdb.t1 VALUES (1), (2); +INSERT INTO noauthdb.t2 VALUES (3), (4); + +--echo Creating users noauth, otheruser +CREATE USER noauth@localhost IDENTIFIED WITH 'mysql_no_login'; +CREATE USER otheruser@localhost; +GRANT PROXY ON 'noauth'@'localhost' TO 'otheruser'@'localhost'; +GRANT SELECT, UPDATE, INSERT ON noauthdb.* TO noauth@localhost; + +--echo Creating view, procedure, function +CREATE DEFINER = noauth@localhost SQL SECURITY DEFINER VIEW noauthdb.v1 AS SELECT * FROM noauthdb.t1 WHERE a % 2 = 0; +CREATE DEFINER = noauth@localhost PROCEDURE noauthdb.p1 () CONTAINS SQL SQL SECURITY DEFINER UPDATE noauthdb.t2 SET a = 5 WHERE a = 3; +delimiter //; +CREATE DEFINER = noauth@localhost FUNCTION noauthdb.f1() RETURNS INT CONTAINS SQL SQL SECURITY DEFINER +BEGIN +DECLARE outp INT DEFAULT NULL; +SELECT MAX(a) INTO outp FROM noauthdb.t2; +RETURN outp; +END// +delimiter ;// + +GRANT SELECT ON noauthdb.v1 TO otheruser@localhost; +GRANT EXECUTE ON noauthdb.* TO otheruser@localhost; +GRANT EXECUTE ON noauthdb.* TO noauth@localhost; + +--enable_query_log + +--echo # Connect as otheruser - should succeed. +--exec $MYSQL --user=otheruser -e "select user(), current_user(), @@proxy_user; SELECT * FROM noauthdb.v1; CALL noauthdb.p1(); SELECT noauthdb.f1();" + +--echo # Attempt to access underlying tables directly using otheruser - should fail. +--error 1, ER_TABLEACCESS_DENIED_ERROR +--exec $MYSQL --user=otheruser -e "SELECT * FROM noauthdb.t1;" + +# Cleanup + --disable_query_log + + DROP DATABASE noauthdb; + DROP USER noauth@localhost; + DROP USER otheruser@localhost; + + #UNINSTALL PLUGIN mysql_no_auth; + --enable_query_log +--exit diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_database.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_database.result index f315aaab..810d7b77 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_database.result +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_database.result @@ -205,7 +205,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt1` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ FLUSH STATUS; diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_enforce_gtid_consistency.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_enforce_gtid_consistency.result index a61c52fe..6e9cd693 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_enforce_gtid_consistency.result +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_enforce_gtid_consistency.result @@ -51,11 +51,11 @@ CREATE TEMPORARY TABLE t1 (a INT) ENGINE = InnoDB; DROP TEMPORARY TABLE t1; BEGIN; CREATE TEMPORARY TABLE t1 (a INT) ENGINE = InnoDB; -ERROR HY000: When @@GLOBAL.ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1. +ERROR HY000: When @@GLOBAL.ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1. These statements are also not allowed in a function or trigger because functions and triggers are also considered to be multi-statement transactions. COMMIT; SET AUTOCOMMIT = 0; CREATE TEMPORARY TABLE t1 (a INT) ENGINE = InnoDB; -ERROR HY000: When @@GLOBAL.ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1. +ERROR HY000: When @@GLOBAL.ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1. These statements are also not allowed in a function or trigger because functions and triggers are also considered to be multi-statement transactions. SET AUTOCOMMIT = 1; CREATE TEMPORARY TABLE t1 (a INT) ENGINE = InnoDB; BEGIN; @@ -67,11 +67,11 @@ SET AUTOCOMMIT = 1; ALTER TABLE t1 ADD COLUMN (d INT); BEGIN; DROP TEMPORARY TABLE t1; -ERROR HY000: When @@GLOBAL.ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1. +ERROR HY000: When @@GLOBAL.ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1. These statements are also not allowed in a function or trigger because functions and triggers are also considered to be multi-statement transactions. COMMIT; SET AUTOCOMMIT = 0; DROP TEMPORARY TABLE t1; -ERROR HY000: When @@GLOBAL.ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1. +ERROR HY000: When @@GLOBAL.ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1. These statements are also not allowed in a function or trigger because functions and triggers are also considered to be multi-statement transactions. COMMIT; SET AUTOCOMMIT = 1; DROP TEMPORARY TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_error_action.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_error_action.result index 9d961378..a5b70fb3 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_error_action.result +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_error_action.result @@ -6,26 +6,30 @@ call mtr.add_suppression("Could not open .*"); call mtr.add_suppression("Could not use .*"); call mtr.add_suppression("Can't generate a unique log-filename master-bin"); call mtr.add_suppression("The server was unable to create a new log file *"); +call mtr.add_suppression("An error occurred during flush stage of the commit"); +call mtr.add_suppression("An error occurred during sync stage of the commit"); +call mtr.add_suppression("Either disk is full or file system is read only"); +call mtr.add_suppression("Attempting backtrace. You can use the following information to find out"); RESET MASTER; Test case1 SET GLOBAL binlog_error_action= ABORT_SERVER; flush logs; -ERROR HY000: Binary logging not possible. Message: Either disk is full or file system is read only while rotating the binlog. Aborting the server +ERROR HY000: Binary logging not possible. Message: Either disk is full or file system is read only while rotating the binlog. Aborting the server. Test case2 SET SESSION debug="+d,fault_injection_updating_index"; SET GLOBAL binlog_error_action= ABORT_SERVER; flush logs; -ERROR HY000: Binary logging not possible. Message: Either disk is full or file system is read only while opening the binlog. Aborting the server +ERROR HY000: Binary logging not possible. Message: Either disk is full or file system is read only while opening the binlog. Aborting the server. Test case3 SET SESSION debug="+d,simulate_disk_full_on_open_binlog"; SET GLOBAL binlog_error_action= ABORT_SERVER; flush logs; -ERROR HY000: Binary logging not possible. Message: Either disk is full or file system is read only while opening the binlog. Aborting the server +ERROR HY000: Binary logging not possible. Message: Either disk is full or file system is read only while opening the binlog. Aborting the server. Test case4 SET SESSION debug="+d,fault_injection_init_name"; SET GLOBAL binlog_error_action= ABORT_SERVER; flush logs; -ERROR HY000: Binary logging not possible. Message: Either disk is full or file system is read only while opening the binlog. Aborting the server +ERROR HY000: Binary logging not possible. Message: Either disk is full or file system is read only while opening the binlog. Aborting the server. Test case5 flush logs; ERROR HY000: File 'master-bin.index' not found (Errcode: 13 - Permission denied) @@ -59,4 +63,109 @@ Tables_in_test t2 DROP TABLE t2; SET SESSION debug="-d,fault_injection_init_name"; +Test case09 +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +SET SESSION debug='+d,error_unique_log_filename'; +FLUSH LOGS; +ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) + +DROP TABLE t1; SET SESSION debug=""; +SHOW BINARY LOGS; +ERROR HY000: You are not using binary logging +Test case10 +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +SET GLOBAL binlog_error_action=ABORT_SERVER; +SET SESSION debug='+d,error_unique_log_filename'; +FLUSH LOGS; +ERROR HY000: Binary logging not possible. Message: Either disk is full or file system is read only while rotating the binlog. Aborting the server. +DROP TABLE t1; +Test case11 +RESET MASTER; +CREATE TABLE t1(i INT); +SET SESSION debug = "+d,simulate_error_during_flush_cache_to_file"; +SET GLOBAL binlog_error_action = ABORT_SERVER; +INSERT INTO t1 VALUES (1); +ERROR HY000: Binary logging not possible. Message: An error occurred during flush stage of the commit. 'binlog_error_action' is set to 'ABORT_SERVER'. Hence aborting the server. +include/assert.inc [Count of elements in t1 should be 0.] +include/assert.inc [Query is not binlogged as expected.] +RESET MASTER; +SET SESSION debug ="+d,simulate_error_during_flush_cache_to_file"; +SET GLOBAL binlog_error_action= IGNORE_ERROR; +INSERT INTO t1 VALUES (2); +include/assert.inc [Count of elements in t1 should be 1.] +include/assert.inc [Query is not binlogged as expected.] +DROP TABLE t1; +RESET MASTER; +Test case12 +SET GLOBAL sync_binlog = 1; +CREATE TABLE t1(i INT); +SET SESSION debug = "+d,simulate_error_during_sync_binlog_file"; +SET GLOBAL binlog_error_action = ABORT_SERVER; +INSERT INTO t1 VALUES (1); +ERROR HY000: Binary logging not possible. Message: An error occurred during sync stage of the commit. 'binlog_error_action' is set to 'ABORT_SERVER'. Hence aborting the server. +DELETE FROM t1; +RESET MASTER; +SET SESSION debug = "+d,simulate_error_during_sync_binlog_file"; +SET GLOBAL binlog_error_action = IGNORE_ERROR; +INSERT INTO t1 VALUES (2); +include/assert.inc [Count of elements in t1 should be 1.] +DROP table t1; +SET SESSION debug = "-d,simulate_error_during_sync_binlog_file"; +RESET MASTER; +Test case13 +CREATE TABLE t1(i INT); +SET SESSION debug = "+d,simulate_do_write_cache_failure"; +SET GLOBAL binlog_error_action = ABORT_SERVER; +INSERT INTO t1 VALUES (1); +ERROR HY000: Binary logging not possible. Message: An error occurred during flush stage of the commit. 'binlog_error_action' is set to 'ABORT_SERVER'. Hence aborting the server. +include/assert.inc [Count of elements in t1 should be 0.] +include/assert.inc [Query is not binlogged as expected.] +RESET MASTER; +SET SESSION debug = "+d,simulate_do_write_cache_failure"; +SET GLOBAL binlog_error_action = IGNORE_ERROR; +INSERT INTO t1 VALUES (2); +include/assert.inc [Count of elements in t1 should be 1.] +DROP table t1; +RESET MASTER; +Test case14 +SET GLOBAL binlog_error_action = IGNORE_ERROR; +SET GLOBAL sync_binlog = 1; +CREATE TABLE t1(i INT); +CREATE TABLE t2(i INT); +SET DEBUG_SYNC = "waiting_to_enter_flush_stage SIGNAL about_to_enter_flush_stage WAIT_FOR binlog_closed"; +INSERT INTO t1 values (1);; +SET DEBUG_SYNC = "now wait_for about_to_enter_flush_stage"; +SET DEBUG_SYNC = "after_binlog_closed_due_to_error SIGNAL binlog_closed"; +SET SESSION debug = "+d,simulate_error_during_sync_binlog_file"; +INSERT INTO t2 values (2);; +DROP table t1, t2; +Test case15 +SET GLOBAL binlog_error_action = IGNORE_ERROR; +SET GLOBAL sync_binlog = 1; +CREATE TABLE t1(i INT); +CREATE TABLE t2(i INT); +SET DEBUG_SYNC = "before_binlog_closed_due_to_error SIGNAL binlog_about_to_be_closed WAIT_FOR in_the_middle_of_flush_stage"; +SET SESSION debug = "+d,simulate_error_during_sync_binlog_file"; +INSERT INTO t1 values (1);; +SET DEBUG_SYNC = "now wait_for binlog_about_to_be_closed"; +SET DEBUG_SYNC = "waiting_in_the_middle_of_flush_stage SIGNAL in_the_middle_of_flush_stage"; +INSERT INTO t2 values (2);; +DROP table t1, t2; +Test case16 +SET GLOBAL binlog_error_action = IGNORE_ERROR; +SET GLOBAL sync_binlog = 1; +CREATE TABLE t1(i INT); +CREATE TABLE t2(i INT); +SET DEBUG_SYNC = "before_binlog_closed_due_to_error SIGNAL binlog_about_to_be_closed WAIT_FOR another_group_encountered_flush_error"; +SET SESSION debug = "+d,simulate_error_during_sync_binlog_file"; +INSERT INTO t1 values (1);; +SET DEBUG_SYNC = "now wait_for binlog_about_to_be_closed"; +SET DEBUG_SYNC = "before_binlog_closed_due_to_error SIGNAL another_group_encountered_flush_error"; +SET SESSION debug ="+d,simulate_error_during_flush_cache_to_file"; +INSERT INTO t2 values (2);; +Matching lines are: +--TIME-- [ERROR] An error occurred during flush_or_sync stage stage of the commit. 'binlog_error_action' is set to 'IGNORE_ERROR'. Hence turning logging off for the whole duration of the MySQL server process. To turn it on again: fix the cause, shutdown the MySQL server and restart it. + +Occurrences of the An error occurred during in the input file : 1 +DROP table t1, t2; diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_gtid_exhausted.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_gtid_exhausted.result new file mode 100644 index 00000000..e98a3d07 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_gtid_exhausted.result @@ -0,0 +1,21 @@ +call mtr.add_suppression("An error occurred during flush stage of the commit"); +call mtr.add_suppression("Attempting backtrace. You can use the following information to find out"); +SET GLOBAL binlog_error_action=IGNORE_ERROR; +CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; +RESET MASTER; +SET GLOBAL gtid_purged = CONCAT(@@GLOBAL.server_uuid, ':1-9223372036854775805'); +INSERT INTO t1 VALUES (1); +INSERT INTO t1 VALUES (2); +ERROR HY000: Impossible to generate Global Transaction Identifier: the integer component reached the maximal value. Restart the server with a new server_uuid. +include/assert.inc [Count of elements in t1 should be 2.] +RESET MASTER; +DROP TABLE t1; +CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; +RESET MASTER; +SET GLOBAL gtid_purged = CONCAT(@@GLOBAL.server_uuid, ':1-9223372036854775805'); +INSERT INTO t1 VALUES (1); +SET GLOBAL binlog_error_action=ABORT_SERVER; +INSERT INTO t1 VALUES (2); +ERROR HY000: Binary logging not possible. Message: An error occurred during flush stage of the commit. 'binlog_error_action' is set to 'ABORT_SERVER'. Hence aborting the server. +RESET MASTER; +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_gtid_mysqlbinlog_row.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_gtid_mysqlbinlog_row.result index 18d5719b..8516f258 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_gtid_mysqlbinlog_row.result +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_gtid_mysqlbinlog_row.result @@ -358,6 +358,19 @@ INSERT INTO t2 SET a=1; INSERT INTO t2 SET b=1; UPDATE t1, t2 SET t1.a=10, t2.a=20; DROP TABLE t1,t2; +CREATE TABLE t1(a BINARY(16), b VARBINARY(32)); +INSERT INTO t1 VALUES (0x275c275c3132,0x5c78276566); +UPDATE t1 SET a= 0x5c27; +DELETE FROM t1 where b=0x5c78276566; +DROP TABLE t1; +CREATE TABLE t1(i INT, a CHAR(16), b VARCHAR(32)); +INSERT INTO t1 VALUES(1, 'a''b', 'a''b'); +INSERT INTO t1 VALUES(2, 'a\\b', 'a\\b'); +UPDATE t1 SET a='a\\b', b='a\\b' WHERE i=1; +UPDATE t1 SET a='a''b', b='a''b' WHERE i=2; +DELETE FROM t1 WHERE a='a''b' AND b='a''b'; +DELETE FROM t1 WHERE a='a\\b' AND b='a\\b'; +DROP TABLE t1; flush logs; /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; @@ -5393,6 +5406,244 @@ SET @@SESSION.GTID_NEXT= 'GTID'/*!*/; SET TIMESTAMP=1000000000/*!*/; DROP TABLE `t1`,`t2` /* generated by server */ /*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # GTID [commit=yes] +SET @@SESSION.GTID_NEXT= 'GTID'/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +CREATE TABLE t1(a BINARY(16), b VARBINARY(32)) +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # GTID [commit=yes] +SET @@SESSION.GTID_NEXT= 'GTID'/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Table_map: `test`.`t1` mapped to number # +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Write_rows: table id # flags: STMT_END_F +### INSERT INTO `test`.`t1` +### SET +### @1='\x27\x5c\x27\x5c12' /* STRING(16) meta=65040 nullable=1 is_null=0 */ +### @2='\x5cx\x27ef' /* VARSTRING(32) meta=32 nullable=1 is_null=0 */ +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # GTID [commit=yes] +SET @@SESSION.GTID_NEXT= 'GTID'/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Table_map: `test`.`t1` mapped to number # +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Update_rows: table id # flags: STMT_END_F +### UPDATE `test`.`t1` +### WHERE +### @1='\x27\x5c\x27\x5c12' /* STRING(16) meta=65040 nullable=1 is_null=0 */ +### @2='\x5cx\x27ef' /* VARSTRING(32) meta=32 nullable=1 is_null=0 */ +### SET +### @1='\x5c\x27' /* STRING(16) meta=65040 nullable=1 is_null=0 */ +### @2='\x5cx\x27ef' /* VARSTRING(32) meta=32 nullable=1 is_null=0 */ +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # GTID [commit=yes] +SET @@SESSION.GTID_NEXT= 'GTID'/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Table_map: `test`.`t1` mapped to number # +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Delete_rows: table id # flags: STMT_END_F +### DELETE FROM `test`.`t1` +### WHERE +### @1='\x5c\x27' /* STRING(16) meta=65040 nullable=1 is_null=0 */ +### @2='\x5cx\x27ef' /* VARSTRING(32) meta=32 nullable=1 is_null=0 */ +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # GTID [commit=yes] +SET @@SESSION.GTID_NEXT= 'GTID'/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +DROP TABLE `t1` /* generated by server */ +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # GTID [commit=yes] +SET @@SESSION.GTID_NEXT= 'GTID'/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +CREATE TABLE t1(i INT, a CHAR(16), b VARCHAR(32)) +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # GTID [commit=yes] +SET @@SESSION.GTID_NEXT= 'GTID'/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Table_map: `test`.`t1` mapped to number # +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Write_rows: table id # flags: STMT_END_F +### INSERT INTO `test`.`t1` +### SET +### @1=1 /* INT meta=0 nullable=1 is_null=0 */ +### @2='a\x27b' /* STRING(16) meta=65040 nullable=1 is_null=0 */ +### @3='a\x27b' /* VARSTRING(32) meta=32 nullable=1 is_null=0 */ +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # GTID [commit=yes] +SET @@SESSION.GTID_NEXT= 'GTID'/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Table_map: `test`.`t1` mapped to number # +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Write_rows: table id # flags: STMT_END_F +### INSERT INTO `test`.`t1` +### SET +### @1=2 /* INT meta=0 nullable=1 is_null=0 */ +### @2='a\x5cb' /* STRING(16) meta=65040 nullable=1 is_null=0 */ +### @3='a\x5cb' /* VARSTRING(32) meta=32 nullable=1 is_null=0 */ +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # GTID [commit=yes] +SET @@SESSION.GTID_NEXT= 'GTID'/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Table_map: `test`.`t1` mapped to number # +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Update_rows: table id # flags: STMT_END_F +### UPDATE `test`.`t1` +### WHERE +### @1=1 /* INT meta=0 nullable=1 is_null=0 */ +### @2='a\x27b' /* STRING(16) meta=65040 nullable=1 is_null=0 */ +### @3='a\x27b' /* VARSTRING(32) meta=32 nullable=1 is_null=0 */ +### SET +### @1=1 /* INT meta=0 nullable=1 is_null=0 */ +### @2='a\x5cb' /* STRING(16) meta=65040 nullable=1 is_null=0 */ +### @3='a\x5cb' /* VARSTRING(32) meta=32 nullable=1 is_null=0 */ +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # GTID [commit=yes] +SET @@SESSION.GTID_NEXT= 'GTID'/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Table_map: `test`.`t1` mapped to number # +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Update_rows: table id # flags: STMT_END_F +### UPDATE `test`.`t1` +### WHERE +### @1=2 /* INT meta=0 nullable=1 is_null=0 */ +### @2='a\x5cb' /* STRING(16) meta=65040 nullable=1 is_null=0 */ +### @3='a\x5cb' /* VARSTRING(32) meta=32 nullable=1 is_null=0 */ +### SET +### @1=2 /* INT meta=0 nullable=1 is_null=0 */ +### @2='a\x27b' /* STRING(16) meta=65040 nullable=1 is_null=0 */ +### @3='a\x27b' /* VARSTRING(32) meta=32 nullable=1 is_null=0 */ +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # GTID [commit=yes] +SET @@SESSION.GTID_NEXT= 'GTID'/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Table_map: `test`.`t1` mapped to number # +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Delete_rows: table id # flags: STMT_END_F +### DELETE FROM `test`.`t1` +### WHERE +### @1=2 /* INT meta=0 nullable=1 is_null=0 */ +### @2='a\x27b' /* STRING(16) meta=65040 nullable=1 is_null=0 */ +### @3='a\x27b' /* VARSTRING(32) meta=32 nullable=1 is_null=0 */ +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # GTID [commit=yes] +SET @@SESSION.GTID_NEXT= 'GTID'/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Table_map: `test`.`t1` mapped to number # +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Delete_rows: table id # flags: STMT_END_F +### DELETE FROM `test`.`t1` +### WHERE +### @1=1 /* INT meta=0 nullable=1 is_null=0 */ +### @2='a\x5cb' /* STRING(16) meta=65040 nullable=1 is_null=0 */ +### @3='a\x5cb' /* VARSTRING(32) meta=32 nullable=1 is_null=0 */ +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # GTID [commit=yes] +SET @@SESSION.GTID_NEXT= 'GTID'/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +DROP TABLE `t1` /* generated by server */ +/*!*/; SET @@SESSION.GTID_NEXT= 'GTID' /* added by mysqlbinlog */ /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # CRC32 # Rotate to master-bin.000002 pos: 4 diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_gtid_mysqlbinlog_row_innodb.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_gtid_mysqlbinlog_row_innodb.result index e4dd6c31..f3f4fa6d 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_gtid_mysqlbinlog_row_innodb.result +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_gtid_mysqlbinlog_row_innodb.result @@ -2711,7 +2711,7 @@ BEGIN ### @61='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */ ### @62='b' /* VARSTRING(1) meta=1 nullable=1 is_null=0 */ ### @63='ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */ -### @64=''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */ +### @64='\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */ ### @65='tinyblob' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ ### @66='tinytext' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ ### @67='\x00t\x00i\x00n\x00y\x00t\x00e\x00x\x00t\x00-\x00u\x00c\x00s\x002' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ @@ -3239,7 +3239,7 @@ BEGIN ### @61='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */ ### @62='b' /* VARSTRING(1) meta=1 nullable=1 is_null=0 */ ### @63='ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */ -### @64=''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */ +### @64='\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */ ### @65='tinyblob' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ ### @66='tinytext' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ ### @67='\x00t\x00i\x00n\x00y\x00t\x00e\x00x\x00t\x00-\x00u\x00c\x00s\x002' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ @@ -3335,7 +3335,7 @@ BEGIN ### @61='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */ ### @62='b' /* VARSTRING(1) meta=1 nullable=1 is_null=0 */ ### @63='ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */ -### @64=''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */ +### @64='\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */ ### @65='tinyblob' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ ### @66='tinytext' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ ### @67='\x00t\x00i\x00n\x00y\x00t\x00e\x00x\x00t\x00-\x00u\x00c\x00s\x002' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ @@ -3703,7 +3703,7 @@ BEGIN ### @61='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */ ### @62='b' /* VARSTRING(1) meta=1 nullable=1 is_null=0 */ ### @63='ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */ -### @64=''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */ +### @64='\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */ ### @65='tinyblob' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ ### @66='tinytext' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ ### @67='\x00t\x00i\x00n\x00y\x00t\x00e\x00x\x00t\x00-\x00u\x00c\x00s\x002' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_gtid_mysqlbinlog_row_myisam.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_gtid_mysqlbinlog_row_myisam.result index a1a29d3b..59adb4e8 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_gtid_mysqlbinlog_row_myisam.result +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_gtid_mysqlbinlog_row_myisam.result @@ -2715,7 +2715,7 @@ BEGIN ### @61='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */ ### @62='b' /* VARSTRING(1) meta=1 nullable=1 is_null=0 */ ### @63='ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */ -### @64=''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */ +### @64='\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */ ### @65='tinyblob' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ ### @66='tinytext' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ ### @67='\x00t\x00i\x00n\x00y\x00t\x00e\x00x\x00t\x00-\x00u\x00c\x00s\x002' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ @@ -3249,7 +3249,7 @@ BEGIN ### @61='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */ ### @62='b' /* VARSTRING(1) meta=1 nullable=1 is_null=0 */ ### @63='ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */ -### @64=''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */ +### @64='\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */ ### @65='tinyblob' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ ### @66='tinytext' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ ### @67='\x00t\x00i\x00n\x00y\x00t\x00e\x00x\x00t\x00-\x00u\x00c\x00s\x002' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ @@ -3347,7 +3347,7 @@ BEGIN ### @61='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */ ### @62='b' /* VARSTRING(1) meta=1 nullable=1 is_null=0 */ ### @63='ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */ -### @64=''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */ +### @64='\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */ ### @65='tinyblob' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ ### @66='tinytext' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ ### @67='\x00t\x00i\x00n\x00y\x00t\x00e\x00x\x00t\x00-\x00u\x00c\x00s\x002' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ @@ -3721,7 +3721,7 @@ BEGIN ### @61='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */ ### @62='b' /* VARSTRING(1) meta=1 nullable=1 is_null=0 */ ### @63='ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */ -### @64=''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */ +### @64='\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */ ### @65='tinyblob' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ ### @66='tinytext' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ ### @67='\x00t\x00i\x00n\x00y\x00t\x00e\x00x\x00t\x00-\x00u\x00c\x00s\x002' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_index.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_index.result index 6ebc7ff5..a1d357ed 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_index.result +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_index.result @@ -4,9 +4,6 @@ call mtr.add_suppression('MYSQL_BIN_LOG::open failed to sync the index file'); call mtr.add_suppression('Turning logging off for the whole duration of the MySQL server process.'); call mtr.add_suppression('Could not open .*'); call mtr.add_suppression('MYSQL_BIN_LOG::purge_logs failed to clean registers before purging logs.'); -call mtr.add_suppression("The server was unable to create a new log file. " - "An incident event has been written to the binary " - "log which will stop the slaves."); RESET MASTER; flush logs; flush logs; diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_innodb_row.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_innodb_row.result index 449a9086..4f1ee073 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_innodb_row.result +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_innodb_row.result @@ -57,7 +57,7 @@ DROP TEMPORARY TABLE t1; ############################################### include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `t1` /* generated by server */ ############################################### # # Bug#12346411 SQL/LOG.CC:6509: ASSERTION `PREPARED_XIDS > 0' FAILED diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_max_extension.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_max_extension.result index e0e38a3f..cef41898 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_max_extension.result +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_max_extension.result @@ -1,9 +1,7 @@ call mtr.add_suppression("Next log extension: 2147483647. Remaining log filename extensions: 0."); call mtr.add_suppression("Log filename extension number exhausted:"); call mtr.add_suppression("Can't generate a unique log-filename"); -call mtr.add_suppression("The server was unable to create a new log file. " - "An incident event has been written to the binary " - "log which will stop the slaves."); +call mtr.add_suppression("Could not open .*"); RESET MASTER; FLUSH LOGS; ERROR HY000: Can't generate a unique log-filename master-bin.(1-999) diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result index 0f0aa26c..746e5d0d 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result @@ -358,6 +358,19 @@ INSERT INTO t2 SET a=1; INSERT INTO t2 SET b=1; UPDATE t1, t2 SET t1.a=10, t2.a=20; DROP TABLE t1,t2; +CREATE TABLE t1(a BINARY(16), b VARBINARY(32)); +INSERT INTO t1 VALUES (0x275c275c3132,0x5c78276566); +UPDATE t1 SET a= 0x5c27; +DELETE FROM t1 where b=0x5c78276566; +DROP TABLE t1; +CREATE TABLE t1(i INT, a CHAR(16), b VARCHAR(32)); +INSERT INTO t1 VALUES(1, 'a''b', 'a''b'); +INSERT INTO t1 VALUES(2, 'a\\b', 'a\\b'); +UPDATE t1 SET a='a\\b', b='a\\b' WHERE i=1; +UPDATE t1 SET a='a''b', b='a''b' WHERE i=2; +DELETE FROM t1 WHERE a='a''b' AND b='a''b'; +DELETE FROM t1 WHERE a='a\\b' AND b='a\\b'; +DROP TABLE t1; flush logs; /*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/; @@ -4398,6 +4411,205 @@ SET TIMESTAMP=1000000000/*!*/; DROP TABLE `t1`,`t2` /* generated by server */ /*!*/; # at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +CREATE TABLE t1(a BINARY(16), b VARBINARY(32)) +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Table_map: `test`.`t1` mapped to number # +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Write_rows: table id # flags: STMT_END_F +### INSERT INTO `test`.`t1` +### SET +### @1='\x27\x5c\x27\x5c12' /* STRING(16) meta=65040 nullable=1 is_null=0 */ +### @2='\x5cx\x27ef' /* VARSTRING(32) meta=32 nullable=1 is_null=0 */ +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Table_map: `test`.`t1` mapped to number # +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Update_rows: table id # flags: STMT_END_F +### UPDATE `test`.`t1` +### WHERE +### @1='\x27\x5c\x27\x5c12' /* STRING(16) meta=65040 nullable=1 is_null=0 */ +### @2='\x5cx\x27ef' /* VARSTRING(32) meta=32 nullable=1 is_null=0 */ +### SET +### @1='\x5c\x27' /* STRING(16) meta=65040 nullable=1 is_null=0 */ +### @2='\x5cx\x27ef' /* VARSTRING(32) meta=32 nullable=1 is_null=0 */ +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Table_map: `test`.`t1` mapped to number # +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Delete_rows: table id # flags: STMT_END_F +### DELETE FROM `test`.`t1` +### WHERE +### @1='\x5c\x27' /* STRING(16) meta=65040 nullable=1 is_null=0 */ +### @2='\x5cx\x27ef' /* VARSTRING(32) meta=32 nullable=1 is_null=0 */ +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +DROP TABLE `t1` /* generated by server */ +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +CREATE TABLE t1(i INT, a CHAR(16), b VARCHAR(32)) +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Table_map: `test`.`t1` mapped to number # +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Write_rows: table id # flags: STMT_END_F +### INSERT INTO `test`.`t1` +### SET +### @1=1 /* INT meta=0 nullable=1 is_null=0 */ +### @2='a\x27b' /* STRING(16) meta=65040 nullable=1 is_null=0 */ +### @3='a\x27b' /* VARSTRING(32) meta=32 nullable=1 is_null=0 */ +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Table_map: `test`.`t1` mapped to number # +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Write_rows: table id # flags: STMT_END_F +### INSERT INTO `test`.`t1` +### SET +### @1=2 /* INT meta=0 nullable=1 is_null=0 */ +### @2='a\x5cb' /* STRING(16) meta=65040 nullable=1 is_null=0 */ +### @3='a\x5cb' /* VARSTRING(32) meta=32 nullable=1 is_null=0 */ +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Table_map: `test`.`t1` mapped to number # +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Update_rows: table id # flags: STMT_END_F +### UPDATE `test`.`t1` +### WHERE +### @1=1 /* INT meta=0 nullable=1 is_null=0 */ +### @2='a\x27b' /* STRING(16) meta=65040 nullable=1 is_null=0 */ +### @3='a\x27b' /* VARSTRING(32) meta=32 nullable=1 is_null=0 */ +### SET +### @1=1 /* INT meta=0 nullable=1 is_null=0 */ +### @2='a\x5cb' /* STRING(16) meta=65040 nullable=1 is_null=0 */ +### @3='a\x5cb' /* VARSTRING(32) meta=32 nullable=1 is_null=0 */ +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Table_map: `test`.`t1` mapped to number # +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Update_rows: table id # flags: STMT_END_F +### UPDATE `test`.`t1` +### WHERE +### @1=2 /* INT meta=0 nullable=1 is_null=0 */ +### @2='a\x5cb' /* STRING(16) meta=65040 nullable=1 is_null=0 */ +### @3='a\x5cb' /* VARSTRING(32) meta=32 nullable=1 is_null=0 */ +### SET +### @1=2 /* INT meta=0 nullable=1 is_null=0 */ +### @2='a\x27b' /* STRING(16) meta=65040 nullable=1 is_null=0 */ +### @3='a\x27b' /* VARSTRING(32) meta=32 nullable=1 is_null=0 */ +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Table_map: `test`.`t1` mapped to number # +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Delete_rows: table id # flags: STMT_END_F +### DELETE FROM `test`.`t1` +### WHERE +### @1=2 /* INT meta=0 nullable=1 is_null=0 */ +### @2='a\x27b' /* STRING(16) meta=65040 nullable=1 is_null=0 */ +### @3='a\x27b' /* VARSTRING(32) meta=32 nullable=1 is_null=0 */ +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Table_map: `test`.`t1` mapped to number # +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Delete_rows: table id # flags: STMT_END_F +### DELETE FROM `test`.`t1` +### WHERE +### @1=1 /* INT meta=0 nullable=1 is_null=0 */ +### @2='a\x5cb' /* STRING(16) meta=65040 nullable=1 is_null=0 */ +### @3='a\x5cb' /* VARSTRING(32) meta=32 nullable=1 is_null=0 */ +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # CRC32 # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +DROP TABLE `t1` /* generated by server */ +/*!*/; +# at # #010909 4:46:40 server id 1 end_log_pos # CRC32 # Rotate to master-bin.000002 pos: 4 DELIMITER ; # End of log file diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result index f4a79b05..51dee704 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result @@ -2696,7 +2696,7 @@ BEGIN ### @61='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */ ### @62='b' /* VARSTRING(1) meta=1 nullable=1 is_null=0 */ ### @63='ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */ -### @64=''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */ +### @64='\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */ ### @65='tinyblob' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ ### @66='tinytext' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ ### @67='\x00t\x00i\x00n\x00y\x00t\x00e\x00x\x00t\x00-\x00u\x00c\x00s\x002' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ @@ -3215,7 +3215,7 @@ BEGIN ### @61='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */ ### @62='b' /* VARSTRING(1) meta=1 nullable=1 is_null=0 */ ### @63='ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */ -### @64=''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */ +### @64='\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */ ### @65='tinyblob' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ ### @66='tinytext' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ ### @67='\x00t\x00i\x00n\x00y\x00t\x00e\x00x\x00t\x00-\x00u\x00c\x00s\x002' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ @@ -3308,7 +3308,7 @@ BEGIN ### @61='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */ ### @62='b' /* VARSTRING(1) meta=1 nullable=1 is_null=0 */ ### @63='ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */ -### @64=''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */ +### @64='\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */ ### @65='tinyblob' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ ### @66='tinytext' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ ### @67='\x00t\x00i\x00n\x00y\x00t\x00e\x00x\x00t\x00-\x00u\x00c\x00s\x002' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ @@ -3667,7 +3667,7 @@ BEGIN ### @61='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */ ### @62='b' /* VARSTRING(1) meta=1 nullable=1 is_null=0 */ ### @63='ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */ -### @64=''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */ +### @64='\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */ ### @65='tinyblob' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ ### @66='tinytext' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ ### @67='\x00t\x00i\x00n\x00y\x00t\x00e\x00x\x00t\x00-\x00u\x00c\x00s\x002' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result index 2d2fd897..bcba6d9e 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result @@ -2700,7 +2700,7 @@ BEGIN ### @61='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */ ### @62='b' /* VARSTRING(1) meta=1 nullable=1 is_null=0 */ ### @63='ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */ -### @64=''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */ +### @64='\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */ ### @65='tinyblob' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ ### @66='tinytext' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ ### @67='\x00t\x00i\x00n\x00y\x00t\x00e\x00x\x00t\x00-\x00u\x00c\x00s\x002' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ @@ -3225,7 +3225,7 @@ BEGIN ### @61='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */ ### @62='b' /* VARSTRING(1) meta=1 nullable=1 is_null=0 */ ### @63='ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */ -### @64=''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */ +### @64='\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */ ### @65='tinyblob' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ ### @66='tinytext' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ ### @67='\x00t\x00i\x00n\x00y\x00t\x00e\x00x\x00t\x00-\x00u\x00c\x00s\x002' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ @@ -3320,7 +3320,7 @@ BEGIN ### @61='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */ ### @62='b' /* VARSTRING(1) meta=1 nullable=1 is_null=0 */ ### @63='ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */ -### @64=''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */ +### @64='\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */ ### @65='tinyblob' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ ### @66='tinytext' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ ### @67='\x00t\x00i\x00n\x00y\x00t\x00e\x00x\x00t\x00-\x00u\x00c\x00s\x002' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ @@ -3685,7 +3685,7 @@ BEGIN ### @61='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */ ### @62='b' /* VARSTRING(1) meta=1 nullable=1 is_null=0 */ ### @63='ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */ -### @64=''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */ +### @64='\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27\x27' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */ ### @65='tinyblob' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ ### @66='tinytext' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ ### @67='\x00t\x00i\x00n\x00y\x00t\x00e\x00x\x00t\x00-\x00u\x00c\x00s\x002' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */ diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_rotate_bgc_sync.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_rotate_bgc_sync.result new file mode 100644 index 00000000..d11a6738 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_rotate_bgc_sync.result @@ -0,0 +1,42 @@ +SET @saved_binlog_error_action= @@GLOBAL.binlog_error_action; +SET GLOBAL binlog_error_action= ABORT_SERVER; +SET @saved_sync_binlog= @@GLOBAL.sync_binlog; +SET GLOBAL sync_binlog= 2; +[connection conn1] +CREATE TABLE t1 (c1 INT) ENGINE=MyISAM; +SET DEBUG_SYNC= 'before_sync_binlog_file SIGNAL holding_before_bgc_sync_binlog_file WAIT_FOR continue_bgc_sync_binlog_file'; +INSERT INTO t1 VALUES (1); +[connection conn2] +SET DEBUG_SYNC= 'NOW WAIT_FOR holding_before_bgc_sync_binlog_file'; +SET DEBUG_SYNC= 'before_rotate_binlog_file SIGNAL holding_before_rotate_binlog_file WAIT_FOR continue_rotate_binlog_file'; +FLUSH LOGS; +[connection default] +SET DEBUG_SYNC= 'now WAIT_FOR holding_before_rotate_binlog_file'; +SET DEBUG_SYNC= 'now SIGNAL continue_bgc_sync_binlog_file'; +SET DEBUG_SYNC= 'before_rotate_binlog_file CLEAR'; +SET DEBUG_SYNC = 'now SIGNAL continue_rotate_binlog_file'; +[connection conn1] +[connection conn2] +[connection default] +DROP TABLE t1; +SET DEBUG_SYNC= 'RESET'; +[connection conn1] +CREATE TABLE t1 (c1 INT) ENGINE=InnoDB; +SET DEBUG_SYNC= 'before_sync_binlog_file SIGNAL holding_before_bgc_sync_binlog_file WAIT_FOR continue_bgc_sync_binlog_file'; +INSERT INTO t1 VALUES (1); +[connection conn2] +SET DEBUG_SYNC= 'NOW WAIT_FOR holding_before_bgc_sync_binlog_file'; +SET DEBUG_SYNC= 'before_rotate_binlog_file SIGNAL holding_before_rotate_binlog_file WAIT_FOR continue_rotate_binlog_file'; +FLUSH LOGS; +[connection default] +SET DEBUG_SYNC= 'now WAIT_FOR holding_before_rotate_binlog_file'; +SET DEBUG_SYNC= 'now SIGNAL continue_bgc_sync_binlog_file'; +SET DEBUG_SYNC= 'before_rotate_binlog_file CLEAR'; +SET DEBUG_SYNC = 'now SIGNAL continue_rotate_binlog_file'; +[connection conn1] +[connection conn2] +[connection default] +DROP TABLE t1; +SET DEBUG_SYNC= 'RESET'; +SET GLOBAL binlog_error_action= @saved_binlog_error_action; +SET GLOBAL sync_binlog= @saved_sync_binlog; diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_row_binlog.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_row_binlog.result index f60f80cb..ff380542 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_row_binlog.result +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_row_binlog.result @@ -559,7 +559,7 @@ COERCIBILITY(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) d2, COERCIBILITY(s1) d3; DROP TEMPORARY TABLE tmp1; END -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `bug39182`.`tmp1` /* generated by server */ +master-bin.000001 # Query # # use `bug39182`; DROP TEMPORARY TABLE IF EXISTS `tmp1` /* generated by server */ DROP PROCEDURE p1; DROP TABLE t1; DROP DATABASE bug39182; @@ -632,7 +632,7 @@ master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t2` ( master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t3` ( `a` int(11) DEFAULT NULL -) +) ENGINE=InnoDB master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (mysql.user) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F @@ -673,7 +673,7 @@ master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t2` ( master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t3` ( `a` int(11) DEFAULT NULL -) +) ENGINE=InnoDB master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (mysql.user) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F @@ -686,7 +686,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (mysql.user) master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt1` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt1` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`t2`,`t3` /* generated by server */ master-bin.000001 # Query # # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam master-bin.000001 # Query # # BEGIN @@ -788,9 +788,11 @@ SELECT * FROM t1; c1 1 # Their values should be ON -SHOW SESSION VARIABLES LIKE "%_checks"; +SHOW SESSION VARIABLES LIKE "foreign_key_checks"; Variable_name Value foreign_key_checks ON +SHOW SESSION VARIABLES LIKE "unique_checks"; +Variable_name Value unique_checks ON SET @@SESSION.foreign_key_checks= OFF; @@ -806,9 +808,11 @@ c1 1 2 # Their values should be OFF -SHOW SESSION VARIABLES LIKE "%_checks"; +SHOW SESSION VARIABLES LIKE "foreign_key_checks"; Variable_name Value foreign_key_checks OFF +SHOW SESSION VARIABLES LIKE "unique_checks"; +Variable_name Value unique_checks OFF # INSERT INTO t1 VALUES(2) # foreign_key_checks=1 and unique_checks=1 @@ -824,8 +828,10 @@ c1 1 2 # Their values should be OFF -SHOW SESSION VARIABLES LIKE "%_checks"; +SHOW SESSION VARIABLES LIKE "foreign_key_checks"; Variable_name Value foreign_key_checks OFF +SHOW SESSION VARIABLES LIKE "unique_checks"; +Variable_name Value unique_checks OFF DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result index 50e2fd16..8d0b6a5f 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result @@ -27,11 +27,11 @@ include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # CREATE DATABASE `drop-temp+table-test` master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TABLE t(c1 int) -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp` /* generated by server */ -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp` /* generated by server */ -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp1`,`drop-temp+table-test`.`tmp` /* generated by server */ -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp3` /* generated by server */ -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp2` /* generated by server */ +master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp` /* generated by server */ +master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp` /* generated by server */ +master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp1`,`tmp` /* generated by server */ +master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp3` /* generated by server */ +master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp2` /* generated by server */ master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS `t` /* generated by server */ master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS `tmp2`,`t` /* generated by server */ master-bin.000001 # Query # # use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `shortn2`,`table:name`,`shortn1` diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result index d3b8f544..b9e99041 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result @@ -425,7 +425,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `t2` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ reset master; create table t1 (a int) engine=innodb; diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_simplified_binlog_gtid_recovery.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_simplified_binlog_gtid_recovery.result new file mode 100644 index 00000000..40b50b8b --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_simplified_binlog_gtid_recovery.result @@ -0,0 +1,47 @@ +include/rpl_init.inc [topology=none] +include/rpl_default_connections.inc +CREATE TABLE t1 ( +c1 INT NOT NULL PRIMARY KEY +); +# Generate master-bin.000002 +FLUSH LOGS; +INSERT INTO t1 VALUES (1); +# Generate master-bin.000003 +FLUSH LOGS; +INSERT INTO t1 VALUES (2); +# Generate master-bin.000004 +FLUSH LOGS; +INSERT INTO t1 VALUES (3); +# Move master-bin.000002 to master-bin.000002.bkp and +# master-bin.000003 to master-bin.000003.bkp +# +# Only master-bin.000001 and master-bin.000004 remain, others are moved +# , restart the server with enabled simplified-binlog-gtid-recovery +# and gtid_mode on. If the server scans more than one binary log in +# every iteration, it will cause read error on the 2nd and 3rd files. +# +include/rpl_restart_server.inc [server_number=1 parameters: --simplified-binlog-gtid-recovery=on --gtid-mode=on --enforce-gtid-consistency --log-slave-updates] +# +# Verify that GLOBAL.GTID_EXECUTED and GLOBAL.GTID_PURGED are empty +# after server restarts. +# +include/assert.inc [GLOBAL.GTID_EXECUTED must be empty.] +include/assert.inc [GLOBAL.GTID_PURGED must be empty.] +DROP TABLE t1; +# Move master-bin.000004 to master-bin.000004.bkp +# +# Only master-bin.000001 and master-bin.000005 remain, others are moved +# , restart the server with enabled simplified-binlog-gtid-recovery +# and gtid_mode on again. If the server scans more than one binary +# log in every iteration, it will cause read error on the 2nd and +# 4th files. +# +include/rpl_restart_server.inc [server_number=1 parameters: --simplified-binlog-gtid-recovery=on --gtid-mode=on --enforce-gtid-consistency --log-slave-updates] +# +# Verify that GLOBAL.GTID_EXECUTED contains committed gtid MASTER_UUID:1 +# and GLOBAL.GTID_PURGED is empty after server restarts again. +# +include/assert.inc [committed gtid MASTER_UUID:1] +include/assert.inc [GLOBAL.GTID_PURGED is empty] +# Move binary logs back. +include/rpl_end.inc diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_stm_binlog.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_stm_binlog.result index e0cc9cab..8842ace9 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_stm_binlog.result +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_stm_binlog.result @@ -557,9 +557,11 @@ SELECT * FROM t1; c1 1 # Their values should be ON -SHOW SESSION VARIABLES LIKE "%_checks"; +SHOW SESSION VARIABLES LIKE "foreign_key_checks"; Variable_name Value foreign_key_checks ON +SHOW SESSION VARIABLES LIKE "unique_checks"; +Variable_name Value unique_checks ON SET @@SESSION.foreign_key_checks= OFF; @@ -575,9 +577,11 @@ c1 1 2 # Their values should be OFF -SHOW SESSION VARIABLES LIKE "%_checks"; +SHOW SESSION VARIABLES LIKE "foreign_key_checks"; Variable_name Value foreign_key_checks OFF +SHOW SESSION VARIABLES LIKE "unique_checks"; +Variable_name Value unique_checks OFF # INSERT INTO t1 VALUES(2) # foreign_key_checks=1 and unique_checks=1 @@ -593,8 +597,10 @@ c1 1 2 # Their values should be OFF -SHOW SESSION VARIABLES LIKE "%_checks"; +SHOW SESSION VARIABLES LIKE "foreign_key_checks"; Variable_name Value foreign_key_checks OFF +SHOW SESSION VARIABLES LIKE "unique_checks"; +Variable_name Value unique_checks OFF DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result index 3e4b8005..03b2af08 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result @@ -34,11 +34,11 @@ master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TEMPORARY TABLE master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TEMPORARY TABLE tmp2(c1 int) master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TEMPORARY TABLE tmp3(c1 int) master-bin.000001 # Query # # use `drop-temp+table-test`; CREATE TABLE t(c1 int) -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp` /* generated by server */ -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp` /* generated by server */ -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp1`,`drop-temp+table-test`.`tmp` /* generated by server */ +master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp` /* generated by server */ +master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp` /* generated by server */ +master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp1`,`tmp` /* generated by server */ master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE `tmp3` /* generated by server */ -master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `drop-temp+table-test`.`tmp2` /* generated by server */ +master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TEMPORARY TABLE IF EXISTS `tmp2` /* generated by server */ master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS `t` /* generated by server */ master-bin.000001 # Query # # use `drop-temp+table-test`; DROP TABLE IF EXISTS `tmp2`,`t` /* generated by server */ master-bin.000001 # Query # # use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `shortn2`,`table:name`,`shortn1` diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/r/show_binlog_events_no_lock.result b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/show_binlog_events_no_lock.result new file mode 100644 index 00000000..e21765d4 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/r/show_binlog_events_no_lock.result @@ -0,0 +1,10 @@ +RESET MASTER; +CREATE TABLE t1(i INT); +DROP TABLE t1; +SET DEBUG_SYNC = "wait_in_show_binlog_events_loop SIGNAL reached_for_loop WAIT_FOR go_ahead"; +SHOW BINLOG EVENTS; +SET DEBUG_SYNC = "now WAIT_FOR reached_for_loop"; +CREATE TABLE t1(i INT); +INSERT INTO t1 VALUES (12); +DROP TABLE t1; +SET DEBUG_SYNC = "now SIGNAL go_ahead"; diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_error_action-master.opt b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_error_action-master.opt new file mode 100644 index 00000000..6cce02a2 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_error_action-master.opt @@ -0,0 +1 @@ +--no-console --skip-core-file --log-error=$MYSQLTEST_VARDIR/tmp/binlog_error_action.err diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_error_action.test b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_error_action.test index 548c5e2a..9daea6a3 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_error_action.test +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_error_action.test @@ -22,6 +22,7 @@ # Don't test this under valgrind, memory leaks will occur --source include/not_valgrind.inc --source include/have_debug.inc +--source include/have_debug_sync.inc # Avoid CrashReporter popup on Mac --source include/not_crashrep.inc @@ -33,7 +34,10 @@ call mtr.add_suppression("Could not open .*"); call mtr.add_suppression("Could not use .*"); call mtr.add_suppression("Can't generate a unique log-filename master-bin"); call mtr.add_suppression("The server was unable to create a new log file *"); - +call mtr.add_suppression("An error occurred during flush stage of the commit"); +call mtr.add_suppression("An error occurred during sync stage of the commit"); +call mtr.add_suppression("Either disk is full or file system is read only"); +call mtr.add_suppression("Attempting backtrace. You can use the following information to find out"); let $old=`select @@debug`; RESET MASTER; @@ -135,5 +139,351 @@ DROP TABLE t2; SET SESSION debug="-d,fault_injection_init_name"; --source include/restart_mysqld.inc +############################################################################### +# Bug#20805298: BINLOG_ERROR_ACTION DOESN'T HANDLE SOME +# FAILURES DURING BINLOG ROTATION +# +# Problem: +# ======== +# Hardware errors in binlog partition during binlog rotate are not handled by +# binlog_error_action. +# +# Test: +# ===== +# Simulate failure during creation of new binary log file name. Set +# binlog_error_action to "IGNORE_ERROR" and observe that the binary log gets +# disabled and the server continues by logging an appropriate error message in +# error log file. Set binlog_error_action to "ABORT_ERROR" and observe that +# the +# server aborts when creation of new binarylog file name fails. +############################################################################### +--echo Test case09 +# Test error scenario with binlog_error_action=IGNORE_ERROR +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +SET SESSION debug='+d,error_unique_log_filename'; +--error ER_NO_UNIQUE_LOGFILE +FLUSH LOGS; +DROP TABLE t1; +eval SET SESSION debug="$debug_save"; +# Test to prove that binary log is disabled +--error ER_NO_BINARY_LOGGING +SHOW BINARY LOGS; +--source include/restart_mysqld.inc + +--echo Test case10 +# Test error scenario with binlog_error_action=ABORT_SERVER + +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +SET GLOBAL binlog_error_action=ABORT_SERVER; +SET SESSION debug='+d,error_unique_log_filename'; +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--error ER_BINLOG_LOGGING_IMPOSSIBLE +FLUSH LOGS; +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--enable_reconnect +--source include/wait_until_connected_again.inc +DROP TABLE t1; + +############################################################################### +# BUG#16666407BINLOG WRITE ERRORS SILENTLY IGNORED +# BUG#20938915 2PC SUCCEEDS EVEN THOUGH BINLOG FLUSH/SYNC FAILS +############################################################################### + +############################ +--echo Test case11 +############################ + +# Simulate error during flushing cache to file and test the behaviour +# when binlog_error_action is set to ABORT_SERVER/IGNORE_ERROR. + +# Case 11.1 (binlog_error_action = ABORT_SERVER) +--source include/shutdown_mysqld.inc +--remove_file $MYSQLTEST_VARDIR/tmp/binlog_error_action.err +--source include/start_mysqld.inc +RESET MASTER; + +CREATE TABLE t1(i INT); +--let $log_pos_before = query_get_value("SHOW BINARY LOGS", File_size, 1) +SET SESSION debug = "+d,simulate_error_during_flush_cache_to_file"; +SET GLOBAL binlog_error_action = ABORT_SERVER; +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +# Check that flush error causing server to abort and client gets +# ER_BINLOG_LOGGING_IMPOSSIBLE when binlog_error_action= 'ABORT_SERVER'. +--error ER_BINLOG_LOGGING_IMPOSSIBLE +INSERT INTO t1 VALUES (1); +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--enable_reconnect +--source include/wait_until_connected_again.inc + +# Check that error present in error log +--let SEARCH_FILE = $MYSQLTEST_VARDIR/tmp/binlog_error_action.err +--let SEARCH_PATTERN = An error occurred during flush stage of the commit. 'binlog_error_action' is set to 'ABORT_SERVER'. +--source include/search_pattern_in_file.inc + +# Check that transaction is not committed +--let $assert_cond= COUNT(*) = 0 FROM t1; +--let $assert_text= Count of elements in t1 should be 0. +--source include/assert.inc + +# Check that transaction is not binlogged as well +--let $log_pos_after = query_get_value("SHOW BINARY LOGS", File_size, 1) +--let $assert_cond = $log_pos_before = $log_pos_after +--let $assert_text = Query is not binlogged as expected. +--source include/assert.inc + +# Case 11.2 (binlog_error_action = IGNORE_ERROR) +RESET MASTER; +--let $log_pos_before = query_get_value("SHOW BINARY LOGS", File_size, 1) +SET SESSION debug ="+d,simulate_error_during_flush_cache_to_file"; +SET GLOBAL binlog_error_action= IGNORE_ERROR; +INSERT INTO t1 VALUES (2); + +# Check that transaction is committed +--let $assert_cond = COUNT(*) = 1 FROM t1; +--let $assert_text = Count of elements in t1 should be 1. +--source include/assert.inc + +# Restart so that binary log is enabled again and we can do the below test +--source include/restart_mysqld.inc + +# Check that transaction is not binlogged +--let $log_pos_after = query_get_value("SHOW BINARY LOGS", File_size, 1) +--let $assert_cond = $log_pos_before = $log_pos_after +--let $assert_text = Query is not binlogged as expected. +--source include/assert.inc + +# Check that error present in error log +--let SEARCH_FILE = $MYSQLTEST_VARDIR/tmp/binlog_error_action.err +--let SEARCH_PATTERN = An error occurred during flush stage of the commit. 'binlog_error_action' is set to 'IGNORE_ERROR'. +--source include/search_pattern_in_file.inc + +# Cleanup +DROP TABLE t1; +RESET MASTER; + +############################ +--echo Test case12 +############################ + +# Simulate error during syncing binlog file and test the behaviour +# when binlog_error_action is set to ABORT_SERVER/IGNORE_ERROR. +# Set sync_binlog=1 just to make sure that logic enters into sync phase. + +# Case 12.1 (binlog_error_action = ABORT_SERVER) +SET GLOBAL sync_binlog = 1; +CREATE TABLE t1(i INT); +SET SESSION debug = "+d,simulate_error_during_sync_binlog_file"; +SET GLOBAL binlog_error_action = ABORT_SERVER; +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +# Check that sync error causing server to abort and client gets +# ER_BINLOG_LOGGING_IMPOSSIBLE when binlog_error_action= 'ABORT_SERVER'. +--error ER_BINLOG_LOGGING_IMPOSSIBLE +INSERT INTO t1 VALUES (1); + +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--enable_reconnect +--source include/wait_until_connected_again.inc + +# Cleanup +DELETE FROM t1; +RESET MASTER; + +# Case 12.2 (binlog_error_action = IGNORE_ERROR) +SET SESSION debug = "+d,simulate_error_during_sync_binlog_file"; +SET GLOBAL binlog_error_action = IGNORE_ERROR; +INSERT INTO t1 VALUES (2); + +# Check that transaction is committed +--let $assert_cond = COUNT(*) = 1 FROM t1; +--let $assert_text = Count of elements in t1 should be 1. +--source include/assert.inc + +# Cleanup +DROP table t1; +SET SESSION debug = "-d,simulate_error_during_sync_binlog_file"; +--source include/restart_mysqld.inc +RESET MASTER; + +############################ +--echo Test case13 +############################ + +# Simulate error during flushing events to binlog cache and test the behaviour +# when binlog_error_action is set to ABORT_SERVER/IGNORE_ERROR. + +# Case 13.1 (binlog_error_action = ABORT_SERVER) +CREATE TABLE t1(i INT); +--let $log_pos_before = query_get_value("SHOW BINARY LOGS", File_size, 1) +SET SESSION debug = "+d,simulate_do_write_cache_failure"; +SET GLOBAL binlog_error_action = ABORT_SERVER; +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect + +# Check that write cache error is causing server to abort and client gets +# ER_BINLOG_LOGGING_IMPOSSIBLE when binlog_error_action= 'ABORT_SERVER'. +--error ER_BINLOG_LOGGING_IMPOSSIBLE +INSERT INTO t1 VALUES (1); +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--enable_reconnect +--source include/wait_until_connected_again.inc + +# Check that transaction is not committed +--let $assert_cond = COUNT(*) = 0 FROM t1; +--let $assert_text = Count of elements in t1 should be 0. +--source include/assert.inc + +# Check that transaction is not binlogged as well +--let $log_pos_after = query_get_value("SHOW BINARY LOGS", File_size, 1) +--let $assert_cond = $log_pos_before = $log_pos_after +--let $assert_text = Query is not binlogged as expected. +--source include/assert.inc + +# Cleanup +RESET MASTER; + +# Case 13.2 (binlog_error_action = IGNORE_ERROR) +SET SESSION debug = "+d,simulate_do_write_cache_failure"; +SET GLOBAL binlog_error_action = IGNORE_ERROR; +INSERT INTO t1 VALUES (2); + +# Check that transaction is committed (binlog check cannot be done +# as we would have written STOP_EVENT in the binlog while closing +# it) +--let $assert_cond = COUNT(*) = 1 FROM t1; +--let $assert_text = Count of elements in t1 should be 1. +--source include/assert.inc + +# Cleanup +DROP table t1; +--source include/restart_mysqld.inc +RESET MASTER; + +############################ +--echo Test case14 +############################ + +# Simulating a situation when a transaction is about to +# enter ordered_commit and another transaction closed +# binary log due to an error. + +SET GLOBAL binlog_error_action = IGNORE_ERROR; +SET GLOBAL sync_binlog = 1; +CREATE TABLE t1(i INT); +CREATE TABLE t2(i INT); +connect(con1,localhost,root,,); +connect(con2,localhost,root,,); + +--connection con1 +SET DEBUG_SYNC = "waiting_to_enter_flush_stage SIGNAL about_to_enter_flush_stage WAIT_FOR binlog_closed"; +--send INSERT INTO t1 values (1); + +--connection default +SET DEBUG_SYNC = "now wait_for about_to_enter_flush_stage"; + +--connection con2 +SET DEBUG_SYNC = "after_binlog_closed_due_to_error SIGNAL binlog_closed"; +SET SESSION debug = "+d,simulate_error_during_sync_binlog_file"; +--send INSERT INTO t2 values (2); + +--connection con1 +--reap +--connection con2 +--reap + # Cleanup -eval SET SESSION debug="$old"; +--disconnect con1 +--disconnect con2 + +--connection default +DROP table t1, t2; +--source include/restart_mysqld.inc + +############################ +--echo Test case15 +############################ + +# Simulating a situation when a transaction is about to +# close binary log due to a sync error (about to acquire lock_log) +# and another transaction in the middle of flush stage (holding +# lock_log. + +SET GLOBAL binlog_error_action = IGNORE_ERROR; +SET GLOBAL sync_binlog = 1; +CREATE TABLE t1(i INT); +CREATE TABLE t2(i INT); +connect(con1,localhost,root,,); +connect(con2,localhost,root,,); + +--connection con1 +SET DEBUG_SYNC = "before_binlog_closed_due_to_error SIGNAL binlog_about_to_be_closed WAIT_FOR in_the_middle_of_flush_stage"; +SET SESSION debug = "+d,simulate_error_during_sync_binlog_file"; +--send INSERT INTO t1 values (1); + +--connection default +SET DEBUG_SYNC = "now wait_for binlog_about_to_be_closed"; + +--connection con2 +SET DEBUG_SYNC = "waiting_in_the_middle_of_flush_stage SIGNAL in_the_middle_of_flush_stage"; +--send INSERT INTO t2 values (2); + +--connection con1 +--reap +--connection con2 +--reap + +# Claenup +--disconnect con1 +--disconnect con2 + +--connection default +DROP table t1, t2; +--source include/shutdown_mysqld.inc +--remove_file $MYSQLTEST_VARDIR/tmp/binlog_error_action.err +--source include/start_mysqld.inc + +############################ +--echo Test case16 +############################ + +# Simulating a situation where two binlog groups encounter +# errors (one flush error, one sync error) at the same time +# and both of them try to close the binary log. + +SET GLOBAL binlog_error_action = IGNORE_ERROR; +SET GLOBAL sync_binlog = 1; +CREATE TABLE t1(i INT); +CREATE TABLE t2(i INT); +connect(con1,localhost,root,,); +connect(con2,localhost,root,,); + +--connection con1 +SET DEBUG_SYNC = "before_binlog_closed_due_to_error SIGNAL binlog_about_to_be_closed WAIT_FOR another_group_encountered_flush_error"; +SET SESSION debug = "+d,simulate_error_during_sync_binlog_file"; +--send INSERT INTO t1 values (1); + +--connection default +SET DEBUG_SYNC = "now wait_for binlog_about_to_be_closed"; + +--connection con2 +SET DEBUG_SYNC = "before_binlog_closed_due_to_error SIGNAL another_group_encountered_flush_error"; +SET SESSION debug ="+d,simulate_error_during_flush_cache_to_file"; +--send INSERT INTO t2 values (2); + +--connection con1 +--reap +--connection con2 +--reap +--replace_regex /[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} [0-9]+/--TIME--/ /flush|sync stage/flush_or_sync stage/ +--let GREP_FILE=$MYSQLTEST_VARDIR/tmp/binlog_error_action.err +--let GREP_PATTERN=An error occurred during +--source extra/rpl_tests/grep_pattern.inc + +# Claenup +--disconnect con1 +--disconnect con2 + +--connection default +DROP table t1, t2; +--source include/restart_mysqld.inc + diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_gtid_exhausted-master.opt b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_gtid_exhausted-master.opt new file mode 100644 index 00000000..7e17eec8 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_gtid_exhausted-master.opt @@ -0,0 +1 @@ +--skip-core-file diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_gtid_exhausted.test b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_gtid_exhausted.test new file mode 100644 index 00000000..bf1d42a8 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_gtid_exhausted.test @@ -0,0 +1,64 @@ +############################################################################### +# Bug#21276561: FAILURE TO GENERATE GTID LEADS TO INCONSISTENCY +# +# Problem: +# ======= +# If generating a GTID for a transaction fails, the transaction is not written +# to the binary log but still gets committed, which potentially leads to +# master/slave data inconsistency. +# +# Test: +# ===== +# Simulate a scenario such that generation of GTID number reaches its maximum +# value and the new GTID cannot be generated because of that. Verify that this +# fatal error case is appropriately handled as per the binlog_error_action +# value specified by user. +############################################################################### +--source include/have_innodb.inc +--source include/have_gtid.inc +# This test case is binlog_format agnostic +--source include/have_binlog_format_statement.inc +# Don't test this under valgrind, memory leaks will occur +--source include/not_valgrind.inc + +call mtr.add_suppression("An error occurred during flush stage of the commit"); +call mtr.add_suppression("Attempting backtrace. You can use the following information to find out"); + +#Test case 1: +SET GLOBAL binlog_error_action=IGNORE_ERROR; +CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; +# @@GLOBAL.GTID_PURGED can only be set when @@GLOBAL.GTID_EXECUTED is empty. +# Hence execute RESET MASTER. +RESET MASTER; +SET GLOBAL gtid_purged = CONCAT(@@GLOBAL.server_uuid, ':1-9223372036854775805'); +INSERT INTO t1 VALUES (1); +--error ER_GNO_EXHAUSTED +INSERT INTO t1 VALUES (2); + +# Check that transaction is committed +--let $assert_cond = COUNT(*) = 2 FROM t1; +--let $assert_text = Count of elements in t1 should be 2. +--source include/assert.inc +--source include/restart_mysqld.inc + +RESET MASTER; +DROP TABLE t1; + +#Test case 2: +CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; +# @@GLOBAL.GTID_PURGED can only be set when @@GLOBAL.GTID_EXECUTED is empty. +# Hence execute RESET MASTER. +RESET MASTER; +SET GLOBAL gtid_purged = CONCAT(@@GLOBAL.server_uuid, ':1-9223372036854775805'); +INSERT INTO t1 VALUES (1); +SET GLOBAL binlog_error_action=ABORT_SERVER; +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--error ER_BINLOG_LOGGING_IMPOSSIBLE +INSERT INTO t1 VALUES (2); + +--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect +--enable_reconnect +--source include/wait_until_connected_again.inc + +RESET MASTER; +DROP TABLE t1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_index.test b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_index.test index ed4be5b0..41c4a852 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_index.test +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_index.test @@ -14,9 +14,6 @@ call mtr.add_suppression('MYSQL_BIN_LOG::open failed to sync the index file'); call mtr.add_suppression('Turning logging off for the whole duration of the MySQL server process.'); call mtr.add_suppression('Could not open .*'); call mtr.add_suppression('MYSQL_BIN_LOG::purge_logs failed to clean registers before purging logs.'); -call mtr.add_suppression("The server was unable to create a new log file. " - "An incident event has been written to the binary " - "log which will stop the slaves."); let $old=`select @@debug`; RESET MASTER; diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_max_extension.test b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_max_extension.test index 0bbbc877..6d3fa29b 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_max_extension.test +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_max_extension.test @@ -22,9 +22,7 @@ call mtr.add_suppression("Next log extension: 2147483647. Remaining log filename extensions: 0."); call mtr.add_suppression("Log filename extension number exhausted:"); call mtr.add_suppression("Can't generate a unique log-filename"); -call mtr.add_suppression("The server was unable to create a new log file. " - "An incident event has been written to the binary " - "log which will stop the slaves."); +call mtr.add_suppression("Could not open .*"); -- source include/have_log_bin.inc RESET MASTER; diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_rotate_bgc_sync.test b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_rotate_bgc_sync.test new file mode 100644 index 00000000..bd6f1406 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_rotate_bgc_sync.test @@ -0,0 +1,108 @@ +# ==== Purpose ==== +# +# This test will try to rotate the binary log of the server while binary log +# group commit sync stage tries to sync the recently flushed binary log group. +# +# As binary log group commit releases the binary log's LOCK_log right after +# finishing the flush stage and entering the sync stage, the rotate procedure +# (executed by MYSQL_BIN_LOG::new_file_impl) will be able take LOCK_log, but +# it will delay the binary log rotation until the amount of prepared +# transactions not yet committed be zero or the binary log group commit sync +# stage has finished. +# +# ==== Related Bugs and Worklogs ==== +# +# BUG#22245619 SERVER ABORT AFTER SYNC STAGE OF THE COMMIT FAILS +# + +# This test case is binary log format agnostic +--source include/have_binlog_format_row.inc +--source include/have_debug_sync.inc + +# Set the options to hit the issue +SET @saved_binlog_error_action= @@GLOBAL.binlog_error_action; +SET GLOBAL binlog_error_action= ABORT_SERVER; +SET @saved_sync_binlog= @@GLOBAL.sync_binlog; +SET GLOBAL sync_binlog= 2; + +# Create two additional connections +# conn1 will do the binary log group commit +# conn2 will rotate the binary log +# the default connection will coordinate the test case activity +--connect(conn1,localhost,root,,test) +--connect(conn2,localhost,root,,test) + +--let $engine= MyISAM + +while ($engine) +{ + --let $rpl_connection_name= conn1 + --source include/rpl_connection.inc + # Create a new table + --eval CREATE TABLE t1 (c1 INT) ENGINE=$engine + + # Make the server to hold before syncing the binary log group + SET DEBUG_SYNC= 'before_sync_binlog_file SIGNAL holding_before_bgc_sync_binlog_file WAIT_FOR continue_bgc_sync_binlog_file'; + --send INSERT INTO t1 VALUES (1) + + --let $rpl_connection_name= conn2 + --source include/rpl_connection.inc + # Wait until it reached the sync binary log group + SET DEBUG_SYNC= 'NOW WAIT_FOR holding_before_bgc_sync_binlog_file'; + + # Make the server to hold while rotating the binary log + # It can hold in two places: + # a) waiting before all flushed transactions with Xid to be committed; + # b) after closing the old and before opening the new binary log file; + # + # The debug sync will happen at (a) if there are transactions for a + # transactional storage engine or at (b) if there are no transactions + # for a transactional storage engine in the group to be committed. + SET DEBUG_SYNC= 'before_rotate_binlog_file SIGNAL holding_before_rotate_binlog_file WAIT_FOR continue_rotate_binlog_file'; + # Rotate the binary log + --send FLUSH LOGS + + # Wait until the server reaches the debug sync point while rotating the + # binary log + --let $rpl_connection_name= default + --source include/rpl_connection.inc + SET DEBUG_SYNC= 'now WAIT_FOR holding_before_rotate_binlog_file'; + + # Let the binary log group commit to sync and continue + SET DEBUG_SYNC= 'now SIGNAL continue_bgc_sync_binlog_file'; + # Clear the binary log rotate debug sync point to avoid it to stop twice + SET DEBUG_SYNC= 'before_rotate_binlog_file CLEAR'; + # Let the binary log rotate to continue + SET DEBUG_SYNC = 'now SIGNAL continue_rotate_binlog_file'; + + --let $rpl_connection_name= conn1 + --source include/rpl_connection.inc + --reap + + --let $rpl_connection_name= conn2 + --source include/rpl_connection.inc + --reap + + --let $rpl_connection_name= default + --source include/rpl_connection.inc + + # Cleanup + DROP TABLE t1; + SET DEBUG_SYNC= 'RESET'; + + if ($engine == InnoDB) + { + --let $engine= + } + if ($engine == MyISAM) + { + --let $engine= InnoDB + } +} + +# Disconnect the additional connections +--disconnect conn1 +--disconnect conn2 + +SET GLOBAL binlog_error_action= @saved_binlog_error_action; +SET GLOBAL sync_binlog= @saved_sync_binlog; diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_simplified_binlog_gtid_recovery.test b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_simplified_binlog_gtid_recovery.test new file mode 100644 index 00000000..5337e7bd --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/binlog_simplified_binlog_gtid_recovery.test @@ -0,0 +1,120 @@ +# ==== Purpose ==== +# +# BUG#16741603: MYSQLD SCANS ALL BINARY LOGS ON CRASH RECOVERY +# +# Verify that the server does not scan more than one binary log +# in every iteration when initializing GTID sets on server start +# if simplified-binlog-gtid-recovery is enabled. +# +# +# ==== Implementation ==== +# +# 1) Start server and generate four binary logs with gtid_mode off. +# 2) Move master-bin.000002 to master-bin.000002.bkp and +# master-bin.000003 to master-bin.000003.bkp +# 3) Only master-bin.000001 and master-bin.000004 remain, others are moved +# , restart the server with enabled simplified-binlog-gtid-recovery +# and gtid_mode on. If the server scans more than one binary log in +# every iteration, it will cause read error on the 2nd and 3rd files. +# 4) Verify that GLOBAL.GTID_EXECUTED and GLOBAL.GTID_PURGED are empty +# after server restarts. +# 5) Move master-bin.000004 to master-bin.000004.bkp +# 6) Only master-bin.000001 and master-bin.000005 remain, others are moved +# , restart the server with enabled simplified-binlog-gtid-recovery +# and gtid_mode on again. If the server scans more than one binary +# log in every iteration, it will cause read error on the 2nd and +# 4th files. +# 7) Verify that GLOBAL.GTID_EXECUTED contains committed gtid MASTER_UUID:1 +# and GLOBAL.GTID_PURGED is empty after server restarts again. +# 8) Move binary logs back. +# + +--source include/not_gtid_enabled.inc + +# Invoke rpl_init.inc in order to set up the connections needed by +# rpl_restart_server.inc +--let $rpl_server_count= 1 +--let $rpl_topology= none +--source include/rpl_init.inc +--source include/rpl_default_connections.inc + +--let $MYSQLD_DATADIR= `select @@datadir` +--let $master_uuid= `SELECT @@GLOBAL.SERVER_UUID` +CREATE TABLE t1 ( + c1 INT NOT NULL PRIMARY KEY +); + +--echo # Generate master-bin.000002 +FLUSH LOGS; +INSERT INTO t1 VALUES (1); +--let $binlog_file2= query_get_value(SHOW MASTER STATUS, File, 1) + +--echo # Generate master-bin.000003 +FLUSH LOGS; +INSERT INTO t1 VALUES (2); +--let $binlog_file3= query_get_value(SHOW MASTER STATUS, File, 1) + +--echo # Generate master-bin.000004 +FLUSH LOGS; +INSERT INTO t1 VALUES (3); +--let $binlog_file4= query_get_value(SHOW MASTER STATUS, File, 1) + +--echo # Move master-bin.000002 to master-bin.000002.bkp and +--echo # master-bin.000003 to master-bin.000003.bkp +--move_file $MYSQLD_DATADIR/$binlog_file2 $MYSQLD_DATADIR/$binlog_file2.bkp +--move_file $MYSQLD_DATADIR/$binlog_file3 $MYSQLD_DATADIR/$binlog_file3.bkp + +--echo # +--echo # Only master-bin.000001 and master-bin.000004 remain, others are moved +--echo # , restart the server with enabled simplified-binlog-gtid-recovery +--echo # and gtid_mode on. If the server scans more than one binary log in +--echo # every iteration, it will cause read error on the 2nd and 3rd files. +--echo # +--let $rpl_server_number= 1 +--let $rpl_server_parameters= --simplified-binlog-gtid-recovery=on --gtid-mode=on --enforce-gtid-consistency --log-slave-updates +--source include/rpl_restart_server.inc + +--echo # +--echo # Verify that GLOBAL.GTID_EXECUTED and GLOBAL.GTID_PURGED are empty +--echo # after server restarts. +--echo # +--let $assert_text= GLOBAL.GTID_EXECUTED must be empty. +--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "" +--source include/assert.inc +--let $assert_text= GLOBAL.GTID_PURGED must be empty. +--let $assert_cond= "[SELECT @@GLOBAL.GTID_PURGED]" = "" +--source include/assert.inc + +DROP TABLE t1; +--echo # Move master-bin.000004 to master-bin.000004.bkp +--move_file $MYSQLD_DATADIR/$binlog_file4 $MYSQLD_DATADIR/$binlog_file4.bkp + +--echo # +--echo # Only master-bin.000001 and master-bin.000005 remain, others are moved +--echo # , restart the server with enabled simplified-binlog-gtid-recovery +--echo # and gtid_mode on again. If the server scans more than one binary +--echo # log in every iteration, it will cause read error on the 2nd and +--echo # 4th files. +--echo # +--let $rpl_server_number= 1 +--let $rpl_server_parameters= --simplified-binlog-gtid-recovery=on --gtid-mode=on --enforce-gtid-consistency --log-slave-updates +--source include/rpl_restart_server.inc + +--echo # +--echo # Verify that GLOBAL.GTID_EXECUTED contains committed gtid MASTER_UUID:1 +--echo # and GLOBAL.GTID_PURGED is empty after server restarts again. +--echo # +--let $assert_text= committed gtid MASTER_UUID:1 +--let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "$master_uuid:1" +--source include/assert.inc +--let $assert_text= GLOBAL.GTID_PURGED is empty +--let $assert_cond= "[SELECT @@GLOBAL.GTID_PURGED]" = "" +--source include/assert.inc + +--echo # Move binary logs back. +--move_file $MYSQLD_DATADIR/$binlog_file2.bkp $MYSQLD_DATADIR/$binlog_file2 +--move_file $MYSQLD_DATADIR/$binlog_file3.bkp $MYSQLD_DATADIR/$binlog_file3 +--move_file $MYSQLD_DATADIR/$binlog_file4.bkp $MYSQLD_DATADIR/$binlog_file4 + +--source include/rpl_end.inc + diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/t/disabled.def b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/disabled.def index 888298bb..b7438289 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/binlog/t/disabled.def +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/disabled.def @@ -9,3 +9,5 @@ # Do not use any TAB characters for whitespace. # ############################################################################## + +binlog_index : codership/mysql-wsrep##71 Regression: Duplicate "file was not purged because it is the active log file" warning diff --git a/mysql-wsrep-5.6/mysql-test/suite/binlog/t/show_binlog_events_no_lock.test b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/show_binlog_events_no_lock.test new file mode 100644 index 00000000..8f03c8f9 --- /dev/null +++ b/mysql-wsrep-5.6/mysql-test/suite/binlog/t/show_binlog_events_no_lock.test @@ -0,0 +1,50 @@ +########################################################################### +# BUG#20928790 SHOW BINLOG EVENTS COMPLETELY LOCKS DOWN WRITES TO BINLOG, # +# HENCE TRANSACTIONS. # +# # +# Problem: While a `SHOW BINLOG EVENTS` is executing, any parallel # +# transaction is blocked. # +# # +# Steps to reproduce: # +# =================== # +# 1) Execute 'show binlog events' on one connection and let it wait # +# inside a loop that reads the events from the file using DEBUG_SYNC # +# point # +# 2) While the command is waiting, execute some transactions and see # +# that they are not blocked. # +# # +########################################################################### +--source include/have_debug_sync.inc +--source include/have_binlog_format_statement.inc + +# To make test to start with master-bin.000001 +RESET MASTER; +# Run some sample tests to put it in master-bin.000001 +CREATE TABLE t1(i INT); +DROP TABLE t1; + +connect (con1,localhost,root,,); +# Let show binlog events wait while it is reading events +SET DEBUG_SYNC = "wait_in_show_binlog_events_loop SIGNAL reached_for_loop WAIT_FOR go_ahead"; +--send SHOW BINLOG EVENTS + +--connection default +# Make sure show binlog events execution reaches the point where we wanted to +SET DEBUG_SYNC = "now WAIT_FOR reached_for_loop"; + +# Now execute some transactions and it should not be blocked +CREATE TABLE t1(i INT); +INSERT INTO t1 VALUES (12); +DROP TABLE t1; + +# Once above sample transactions are running fine, send signal to continue +# 'show binlog events' command +SET DEBUG_SYNC = "now SIGNAL go_ahead"; + +# Make sure show binlog events run successfully +# 'show binlog events' output varies for different runs +# (gtid, non-gtid, 5.6, 5.7). So lets disable the output +--disable_result_log +--connection con1 +--reap +--enable_result_log diff --git a/mysql-wsrep-5.6/mysql-test/suite/engines/funcs/r/up_multi_db_table.result b/mysql-wsrep-5.6/mysql-test/suite/engines/funcs/r/up_multi_db_table.result index fc415da5..743be148 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/engines/funcs/r/up_multi_db_table.result +++ b/mysql-wsrep-5.6/mysql-test/suite/engines/funcs/r/up_multi_db_table.result @@ -10,7 +10,7 @@ CREATE TABLE d3.t3 (c1 TINYINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); -UPDATE d1.t1, d2.t2, d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; +UPDATE d1.t1 STRAIGHT_JOIN d2.t2 STRAIGHT_JOIN d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; c1 c2 1 30 @@ -44,7 +44,7 @@ CREATE TABLE d3.t3 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); -UPDATE d1.t1, d2.t2, d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; +UPDATE d1.t1 STRAIGHT_JOIN d2.t2 STRAIGHT_JOIN d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; c1 c2 1 30 @@ -78,7 +78,7 @@ CREATE TABLE d3.t3 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); -UPDATE d1.t1, d2.t2, d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; +UPDATE d1.t1 STRAIGHT_JOIN d2.t2 STRAIGHT_JOIN d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; c1 c2 1 30 @@ -112,7 +112,7 @@ CREATE TABLE d3.t3 (c1 INT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); -UPDATE d1.t1, d2.t2, d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; +UPDATE d1.t1 STRAIGHT_JOIN d2.t2 STRAIGHT_JOIN d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; c1 c2 1 30 @@ -146,7 +146,7 @@ CREATE TABLE d3.t3 (c1 INTEGER NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); -UPDATE d1.t1, d2.t2, d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; +UPDATE d1.t1 STRAIGHT_JOIn d2.t2 STRAIGHT_JOIN d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; c1 c2 1 30 @@ -180,7 +180,7 @@ CREATE TABLE d3.t3 (c1 BIGINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); -UPDATE d1.t1, d2.t2, d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; +UPDATE d1.t1 STRAIGHT_JOIN d2.t2 STRAIGHT_JOIN d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; c1 c2 1 30 @@ -214,7 +214,7 @@ CREATE TABLE d3.t3 (c1 TINYINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); -UPDATE IGNORE d1.t1, d2.t2, d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; +UPDATE IGNORE d1.t1 STRAIGHT_JOIN d2.t2 STRAIGHT_JOIN d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; c1 c2 1 30 @@ -248,7 +248,7 @@ CREATE TABLE d3.t3 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); -UPDATE IGNORE d1.t1, d2.t2, d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; +UPDATE IGNORE d1.t1 STRAIGHT_JOIN d2.t2 STRAIGHT_JOIN d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; c1 c2 1 30 @@ -282,7 +282,7 @@ CREATE TABLE d3.t3 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); -UPDATE IGNORE d1.t1, d2.t2, d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; +UPDATE IGNORE d1.t1 STRAIGHT_JOIN d2.t2 STRAIGHT_JOIN d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; c1 c2 1 30 @@ -316,7 +316,7 @@ CREATE TABLE d3.t3 (c1 INT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); -UPDATE IGNORE d1.t1, d2.t2, d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; +UPDATE IGNORE d1.t1 STRAIGHT_JOIN d2.t2 STRAIGHT_JOIN d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; c1 c2 1 30 @@ -350,7 +350,7 @@ CREATE TABLE d3.t3 (c1 INTEGER NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); -UPDATE IGNORE d1.t1, d2.t2, d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; +UPDATE IGNORE d1.t1 STRAIGHT_JOIN d2.t2 STRAIGHT_JOIN d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; c1 c2 1 30 @@ -384,7 +384,7 @@ CREATE TABLE d3.t3 (c1 BIGINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); -UPDATE IGNORE d1.t1, d2.t2, d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; +UPDATE IGNORE d1.t1 STRAIGHT_JOIN d2.t2 STRAIGHT_JOIN d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; c1 c2 1 30 diff --git a/mysql-wsrep-5.6/mysql-test/suite/engines/funcs/t/up_multi_db_table.test b/mysql-wsrep-5.6/mysql-test/suite/engines/funcs/t/up_multi_db_table.test index a68ef533..0d180a0c 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/engines/funcs/t/up_multi_db_table.test +++ b/mysql-wsrep-5.6/mysql-test/suite/engines/funcs/t/up_multi_db_table.test @@ -12,7 +12,7 @@ CREATE TABLE d3.t3 (c1 TINYINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); -UPDATE d1.t1, d2.t2, d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; +UPDATE d1.t1 STRAIGHT_JOIN d2.t2 STRAIGHT_JOIN d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; @@ -28,7 +28,7 @@ CREATE TABLE d3.t3 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); -UPDATE d1.t1, d2.t2, d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; +UPDATE d1.t1 STRAIGHT_JOIN d2.t2 STRAIGHT_JOIN d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; @@ -44,7 +44,7 @@ CREATE TABLE d3.t3 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); -UPDATE d1.t1, d2.t2, d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; +UPDATE d1.t1 STRAIGHT_JOIN d2.t2 STRAIGHT_JOIN d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; @@ -60,7 +60,7 @@ CREATE TABLE d3.t3 (c1 INT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); -UPDATE d1.t1, d2.t2, d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; +UPDATE d1.t1 STRAIGHT_JOIN d2.t2 STRAIGHT_JOIN d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; @@ -76,7 +76,7 @@ CREATE TABLE d3.t3 (c1 INTEGER NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); -UPDATE d1.t1, d2.t2, d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; +UPDATE d1.t1 STRAIGHT_JOIn d2.t2 STRAIGHT_JOIN d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; @@ -92,7 +92,7 @@ CREATE TABLE d3.t3 (c1 BIGINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); -UPDATE d1.t1, d2.t2, d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; +UPDATE d1.t1 STRAIGHT_JOIN d2.t2 STRAIGHT_JOIN d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; @@ -108,7 +108,7 @@ CREATE TABLE d3.t3 (c1 TINYINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); -UPDATE IGNORE d1.t1, d2.t2, d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; +UPDATE IGNORE d1.t1 STRAIGHT_JOIN d2.t2 STRAIGHT_JOIN d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; @@ -124,7 +124,7 @@ CREATE TABLE d3.t3 (c1 SMALLINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); -UPDATE IGNORE d1.t1, d2.t2, d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; +UPDATE IGNORE d1.t1 STRAIGHT_JOIN d2.t2 STRAIGHT_JOIN d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; @@ -140,7 +140,7 @@ CREATE TABLE d3.t3 (c1 MEDIUMINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); -UPDATE IGNORE d1.t1, d2.t2, d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; +UPDATE IGNORE d1.t1 STRAIGHT_JOIN d2.t2 STRAIGHT_JOIN d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; @@ -156,7 +156,7 @@ CREATE TABLE d3.t3 (c1 INT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); -UPDATE IGNORE d1.t1, d2.t2, d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; +UPDATE IGNORE d1.t1 STRAIGHT_JOIN d2.t2 STRAIGHT_JOIN d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; @@ -172,7 +172,7 @@ CREATE TABLE d3.t3 (c1 INTEGER NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); -UPDATE IGNORE d1.t1, d2.t2, d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; +UPDATE IGNORE d1.t1 STRAIGHT_JOIN d2.t2 STRAIGHT_JOIN d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; @@ -188,7 +188,7 @@ CREATE TABLE d3.t3 (c1 BIGINT NOT NULL PRIMARY KEY, c2 INTEGER, KEY(c2)); INSERT INTO d1.t1 VALUES(1,1),(2,2),(3,3),(4,4),(5,5); INSERT INTO d2.t2 VALUES(11,1),(12,1),(13,1),(14,2),(15,6); INSERT INTO d3.t3 VALUES(21,11),(22,11),(23,13),(24,14),(25,15); -UPDATE IGNORE d1.t1, d2.t2, d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; +UPDATE IGNORE d1.t1 STRAIGHT_JOIN d2.t2 STRAIGHT_JOIN d3.t3 SET d1.t1.c2=30, d2.t2.c2=40, d3.t3.c2=50 WHERE d1.t1.c1=d2.t2.c2 AND d2.t2.c1=d3.t3.c2; SELECT * FROM d1.t1 ORDER BY c1; SELECT * FROM d2.t2 ORDER BY c1; SELECT * FROM d3.t3 ORDER BY c1; diff --git a/mysql-wsrep-5.6/mysql-test/suite/engines/iuds/r/strings_charsets_update_delete.result b/mysql-wsrep-5.6/mysql-test/suite/engines/iuds/r/strings_charsets_update_delete.result index fdd1a4be..a881e2b8 100644 Binary files a/mysql-wsrep-5.6/mysql-test/suite/engines/iuds/r/strings_charsets_update_delete.result and b/mysql-wsrep-5.6/mysql-test/suite/engines/iuds/r/strings_charsets_update_delete.result differ diff --git a/mysql-wsrep-5.6/mysql-test/suite/funcs_1/datadict/processlist_priv.inc b/mysql-wsrep-5.6/mysql-test/suite/funcs_1/datadict/processlist_priv.inc index d8e4c1ed..bbfedace 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/funcs_1/datadict/processlist_priv.inc +++ b/mysql-wsrep-5.6/mysql-test/suite/funcs_1/datadict/processlist_priv.inc @@ -137,10 +137,15 @@ WHERE DB = 'information_schema' AND COMMAND = 'Sleep' AND USER = 'ddicttestuser1 --source include/wait_condition.inc eval SHOW CREATE TABLE $table; --replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_result "init" STATE "starting" STATE "cleaning up" STATE --sorted_result eval SHOW $table; --replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_result "init" STATE "starting" STATE "cleaning up" STATE +--sorted_result eval SELECT * FROM $table $select_where ORDER BY id; +--replace_result "init" STATE "starting" STATE "cleaning up" STATE +--sorted_result --replace_column 1 ID 3 HOST_NAME 6 TIME eval SELECT $columns FROM $table $select_where ORDER BY id; --source suite/funcs_1/datadict/datadict_priv.inc @@ -156,10 +161,16 @@ connection con100; # but "ddicttestuser1" must not see anything of the root session. eval SHOW CREATE TABLE $table; --replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_result "init" STATE "starting" STATE "cleaning up" STATE +--sorted_result eval SHOW $table; --replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_result "init" STATE "starting" STATE "cleaning up" STATE +--sorted_result eval SELECT * FROM $table $select_where ORDER BY id; --replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_result "init" STATE "starting" STATE "cleaning up" STATE +--sorted_result eval SELECT $columns FROM $table $select_where ORDER BY id; --source suite/funcs_1/datadict/datadict_priv.inc --real_sleep 0.3 @@ -182,9 +193,11 @@ GRANT PROCESS ON *.* TO ddicttestuser1@'localhost' IDENTIFIED BY 'ddictpass'; connection con100; SHOW GRANTS; --replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_result "init" STATE "starting" STATE "cleaning up" STATE --sorted_result SHOW processlist; --replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_result "init" STATE "starting" STATE "cleaning up" STATE --sorted_result SELECT * FROM information_schema.processlist; --real_sleep 0.3 @@ -196,9 +209,11 @@ SELECT * FROM information_schema.processlist; connect (con101,localhost,ddicttestuser1,ddictpass,information_schema); SHOW GRANTS; --replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_result "init" STATE "starting" STATE "cleaning up" STATE --sorted_result SHOW processlist; --replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_result "init" STATE "starting" STATE "cleaning up" STATE --sorted_result SELECT * FROM information_schema.processlist; --real_sleep 0.3 @@ -220,9 +235,11 @@ GRANT PROCESS ON *.* TO ''@'localhost'; connect (anonymous1,localhost,"''",,information_schema); SHOW GRANTS; --replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_result "init" STATE "starting" STATE "cleaning up" STATE --sorted_result SHOW processlist; --replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_result "init" STATE "starting" STATE "cleaning up" STATE --sorted_result SELECT * FROM information_schema.processlist; --real_sleep 0.3 @@ -244,9 +261,11 @@ connect (con102,localhost,ddicttestuser1,ddictpass,information_schema); --echo #################################################################################### SHOW GRANTS; --replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_result "init" STATE "starting" STATE "cleaning up" STATE --sorted_result SHOW processlist; --replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_result "init" STATE "starting" STATE "cleaning up" STATE --sorted_result SELECT * FROM information_schema.processlist; --real_sleep 0.3 @@ -271,10 +290,12 @@ if ($fixed_bug_30395) { # Bug#30395 strange results after REVOKE PROCESS ON *.* FROM ... --replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_result "init" STATE "starting" STATE "cleaning up" STATE --sorted_result SHOW processlist; } --replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_result "init" STATE "starting" STATE "cleaning up" STATE --sorted_result SELECT * FROM information_schema.processlist; --real_sleep 0.3 @@ -295,9 +316,11 @@ connect (con103,localhost,ddicttestuser1,ddictpass,information_schema); --echo #################################################################################### SHOW GRANTS FOR 'ddicttestuser1'@'localhost'; --replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_result "init" STATE "starting" STATE "cleaning up" STATE --sorted_result SHOW processlist; --replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_result "init" STATE "starting" STATE "cleaning up" STATE --sorted_result SELECT * FROM information_schema.processlist; --real_sleep 0.3 @@ -319,9 +342,11 @@ connect (con104,localhost,ddicttestuser1,ddictpass,information_schema); --echo #################################################################################### SHOW GRANTS FOR 'ddicttestuser1'@'localhost'; --replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_result "init" STATE "starting" STATE "cleaning up" STATE --sorted_result SHOW processlist; --replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_result "init" STATE "starting" STATE "cleaning up" STATE --sorted_result SELECT * FROM information_schema.processlist; --real_sleep 0.3 @@ -368,9 +393,11 @@ connect (con200,localhost,ddicttestuser2,ddictpass,information_schema); --echo #################################################################################### SHOW GRANTS FOR 'ddicttestuser2'@'localhost'; --replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_result "init" STATE "starting" STATE "cleaning up" STATE --sorted_result SHOW processlist; --replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_result "init" STATE "starting" STATE "cleaning up" STATE --sorted_result SELECT * FROM information_schema.processlist; --real_sleep 0.3 @@ -391,9 +418,11 @@ connect (con201,localhost,ddicttestuser2,ddictpass,information_schema); --echo #################################################################################### SHOW GRANTS; --replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_result "init" STATE "starting" STATE "cleaning up" STATE --sorted_result SHOW processlist; --replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_result "init" STATE "starting" STATE "cleaning up" STATE --sorted_result SELECT * FROM information_schema.processlist; --real_sleep 0.3 @@ -416,9 +445,11 @@ SHOW GRANTS FOR 'ddicttestuser1'@'localhost'; --error ER_ACCESS_DENIED_ERROR GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost'; --replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_result "init" STATE "starting" STATE "cleaning up" STATE --sorted_result SHOW processlist; --replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_result "init" STATE "starting" STATE "cleaning up" STATE --sorted_result SELECT * FROM information_schema.processlist; --real_sleep 0.3 @@ -442,9 +473,11 @@ connect (con108,localhost,ddicttestuser1,ddictpass,information_schema); --echo #################################################################################### SHOW GRANTS FOR 'ddicttestuser1'@'localhost'; --replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_result "init" STATE "starting" STATE "cleaning up" STATE --sorted_result SHOW processlist; --replace_column 1 ID 3 HOST_NAME 6 TIME +--replace_result "init" STATE "starting" STATE "cleaning up" STATE --sorted_result SELECT * FROM information_schema.processlist; --real_sleep 0.3 diff --git a/mysql-wsrep-5.6/mysql-test/suite/funcs_1/datadict/processlist_val.inc b/mysql-wsrep-5.6/mysql-test/suite/funcs_1/datadict/processlist_val.inc index 9e876a2a..cc1aaa47 100644 --- a/mysql-wsrep-5.6/mysql-test/suite/funcs_1/datadict/processlist_val.inc +++ b/mysql-wsrep-5.6/mysql-test/suite/funcs_1/datadict/processlist_val.inc @@ -93,9 +93,11 @@ echo # # 1. Just dump what we get --replace_column 1 3 6